| | |
| | | /> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="审核状态" prop="status" align="center" width="120"> |
| | | <el-table-column label="状态" prop="status" align="center" width="120"> |
| | | <template #default="scope"> |
| | | <el-tag :type="getApprovalStatusType(scope.row.status)"> |
| | | {{ getApprovalStatusText(scope.row.status) }} |
| | |
| | | link |
| | | type="primary" |
| | | size="small" |
| | | :disabled="(scope.row.waitShippingTotal || 0) <= 0" |
| | | :disabled="(scope.row.waitShippingTotal || 0) <= 0 || isRevoked(scope.row.status)" |
| | | @click="openForm('edit', scope.row)">分批发货</el-button> |
| | | <el-button |
| | | link |
| | |
| | | <div class="summary-value shipped">{{ currentShippingOrder.shippingSuccessTotal || 0 }}</div> |
| | | </div> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">已退货数量</div> |
| | | <div class="summary-value returned">{{ currentShippingOrder.returnedQuantity || 0 }}</div> |
| | | </div> |
| | | <div class="summary-item"> |
| | | <div class="summary-label">待发货数量</div> |
| | | <div class="summary-value waiting">{{ currentShippingOrder.waitShippingTotal || 0 }}</div> |
| | | </div> |
| | |
| | | <span class="info-label">发货数量</span> |
| | | <span class="info-value quantity">{{ record.shippingNum }}</span> |
| | | </div> |
| | | <div class="info-row"> |
| | | <span class="info-label">退货数量</span> |
| | | <span class="info-value returned">{{ record.returnNum || 0 }}</span> |
| | | </div> |
| | | <div class="info-row" v-if="record.type === '货车'"> |
| | | <span class="info-label">车牌号</span> |
| | | <span class="info-value">{{ record.shippingCarNumber || '--' }}</span> |
| | |
| | | preview-teleported |
| | | /> |
| | | </div> |
| | | </div> |
| | | <div class="record-actions" v-if="canRevokeShipping(record)"> |
| | | <el-button |
| | | type="danger" |
| | | size="small" |
| | | @click="handleRevokeShipping(record)"> |
| | | 撤销发货 |
| | | </el-button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | return; |
| | | } |
| | | |
| | | if (type === 'edit' && isRevoked(row.status)) { |
| | | proxy.$modal.msgWarning("已撤销状态不能分批发货"); |
| | | return; |
| | | } |
| | | |
| | | dialogMode.value = type === 'edit' ? 'edit' : 'view'; |
| | | currentShippingOrder.value = row; |
| | | showAddForm.value = false; |
| | |
| | | if (!currentShippingOrder.value) return false; |
| | | const waitShipping = currentShippingOrder.value.waitShippingTotal || 0; |
| | | return waitShipping > 0; |
| | | }; |
| | | |
| | | // 是否可以撤销发货 |
| | | const canRevokeShipping = (record) => { |
| | | const shippingNum = record.shippingNum || 0; |
| | | const returnNum = record.returnNum || 0; |
| | | return shippingNum > 0 && returnNum > 0 && shippingNum === returnNum; |
| | | }; |
| | | |
| | | // 撤销发货 |
| | | const handleRevokeShipping = (record) => { |
| | | ElMessageBox.confirm("此操作将撤销该发货记录,是否确认?", "撤销发货", { |
| | | confirmButtonText: "确认", |
| | | cancelButtonText: "取消", |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | updateShippingInfoDetail({ ...record, status: 3 }).then((res) => { |
| | | proxy.$modal.msgSuccess("撤销成功"); |
| | | loadShippingRecords(currentShippingOrder.value.id); |
| | | getList(); |
| | | }); |
| | | }) |
| | | .catch(() => {}); |
| | | }; |
| | | |
| | | // 提交发货 |
| | |
| | | '审核中': '审核中', |
| | | '审核拒绝': '审核拒绝', |
| | | '审核通过': '审核通过', |
| | | '已撤销': '已撤销', |
| | | '0': '待审核', |
| | | '1': '审核中', |
| | | '2': '审核拒绝', |
| | |
| | | '审核中': 'warning', |
| | | '审核拒绝': 'danger', |
| | | '审核通过': 'success', |
| | | '已撤销': 'warning', |
| | | '0': 'info', |
| | | '1': 'warning', |
| | | '2': 'danger', |
| | |
| | | } |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === '审核中' || statusStr === '1'; |
| | | }; |
| | | |
| | | // 检查状态是否为"已撤销" |
| | | const isRevoked = (status) => { |
| | | if (status === null || status === undefined || status === '') { |
| | | return false; |
| | | } |
| | | if (typeof status === 'number') { |
| | | return status === 3; |
| | | } |
| | | const statusStr = String(status).trim(); |
| | | return statusStr === '已撤销' || statusStr === '3'; |
| | | }; |
| | | |
| | | onMounted(() => { |
| | |
| | | |
| | | &.shipped { |
| | | color: #67C23A; |
| | | } |
| | | |
| | | &.returned { |
| | | color: #F56C6C; |
| | | } |
| | | |
| | | &.waiting { |
| | |
| | | color: #409EFF; |
| | | font-size: 16px; |
| | | } |
| | | |
| | | &.returned { |
| | | font-weight: bold; |
| | | color: #F56C6C; |
| | | font-size: 16px; |
| | | } |
| | | } |
| | | } |
| | | |
| | | .record-actions { |
| | | margin-top: 12px; |
| | | padding-top: 12px; |
| | | border-top: 1px solid #EBEEF5; |
| | | } |
| | | |
| | | .record-images { |
| | | display: flex; |
| | | gap: 8px; |