| | |
| | | <template> |
| | | <div class="app-container"> |
| | | <div class="search_form"> |
| | | <div> |
| | | <div class="search_form" style="margin-bottom: 10px;"> |
| | | <div> |
| | | <span class="search_title ml10">入库日期:</span> |
| | | <el-date-picker v-model="searchForm.timeStr" |
| | |
| | | height="calc(100vh - 18.5em)"> |
| | | <el-table-column align="center" |
| | | type="selection" |
| | | :selectable="isRowSelectableForApprove" |
| | | width="55"/> |
| | | <el-table-column align="center" |
| | | label="序号" |
| | |
| | | prop="approvalStatus" |
| | | show-overflow-tooltip> |
| | | <template #default="scope"> |
| | | {{ getApprovalStatusLabel(scope.row.approvalStatus) }} |
| | | <el-tag :type="getApprovalStatusTagType(scope.row.approvalStatus)" size="small"> |
| | | {{ getApprovalStatusLabel(scope.row.approvalStatus) }} |
| | | </el-tag> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | |
| | | import {ElMessageBox} from "element-plus"; |
| | | import { |
| | | getStockInRecordListPage, |
| | | batchDeleteStockInRecords, |
| | | batchDeletePendingStockInRecords, |
| | | batchApproveStockInRecords, |
| | | } from "@/api/inventoryManagement/stockInRecord.js"; |
| | | import { |
| | | findAllQualifiedStockInRecordTypeOptions, findAllUnQualifiedStockInRecordTypeOptions, |
| | | findAllQualifiedStockInRecordTypeOptions, |
| | | // findAllUnQualifiedStockInRecordTypeOptions, |
| | | } from "@/api/basicData/enum.js"; |
| | | |
| | | const {proxy} = getCurrentInstance(); |
| | |
| | | APPROVED: "通过", |
| | | REJECTED: "驳回", |
| | | }; |
| | | approvalStatusLabelMap[3] = "待确认"; |
| | | |
| | | const getApprovalStatusLabel = (status) => { |
| | | if (status === null || status === undefined || status === "") { |
| | | return "待审批"; |
| | | } |
| | | return approvalStatusLabelMap[status] || "待审批"; |
| | | }; |
| | | |
| | | // 通过/驳回固定色;其余(含待审批、空值、未映射但文案为待审批)统一用 warning 预警色 |
| | | const getApprovalStatusTagType = (status) => { |
| | | if (status === 1 || status === "1" || status === "approved" || status === "APPROVED") return "success"; |
| | | if (status === 2 || status === "2" || status === "rejected" || status === "REJECTED") return "danger"; |
| | | return "warning"; |
| | | }; |
| | | |
| | | const isPendingApproval = status => { |
| | | return status === 0 || status === "0" || status === "pending" || status === "PENDING" || status === null || status === undefined || status === ""; |
| | | }; |
| | | |
| | | const isRowSelectableForApprove = row => { |
| | | return isPendingApproval(row?.approvalStatus); |
| | | }; |
| | | |
| | | const pageProductChange = obj => { |
| | |
| | | |
| | | const getList = () => { |
| | | tableLoading.value = true; |
| | | const params = {...page, type: props.type, topParentProductId: props.topParentProductId}; |
| | | const params = {...page, topParentProductId: props.topParentProductId}; |
| | | params.timeStr = searchForm.value.timeStr; |
| | | params.productName = searchForm.value.productName; |
| | | params.recordType = searchForm.value.recordType; |
| | |
| | | }) |
| | | return |
| | | } |
| | | findAllUnQualifiedStockInRecordTypeOptions() |
| | | .then(res => { |
| | | stockRecordTypeOptions.value = res.data; |
| | | }) |
| | | // findAllUnQualifiedStockInRecordTypeOptions() |
| | | // .then(res => { |
| | | // stockRecordTypeOptions.value = res.data; |
| | | // }) |
| | | } |
| | | |
| | | // 表格选择数据 |
| | | const handleSelectionChange = selection => { |
| | | selectedRows.value = selection.filter(item => item.id); |
| | | selectedRows.value = selection.filter(item => item.id && isPendingApproval(item.approvalStatus)); |
| | | }; |
| | | |
| | | const expandedRowKeys = ref([]); |
| | |
| | | distinguishCancelAndClose: true, |
| | | }) |
| | | .then(() => { |
| | | batchApproveStockInRecords({ids, approvalStatus: "通过"}) |
| | | batchApproveStockInRecords({ids, approvalStatus: 1}) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审批通过成功"); |
| | | getList(); |
| | |
| | | }) |
| | | .catch((action) => { |
| | | if (action === "cancel") { |
| | | batchApproveStockInRecords({ids, approvalStatus: "驳回"}) |
| | | batchApproveStockInRecords({ids, approvalStatus: 2}) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("审批驳回成功"); |
| | | getList(); |
| | |
| | | type: "warning", |
| | | }) |
| | | .then(() => { |
| | | batchDeleteStockInRecords(ids) |
| | | batchDeletePendingStockInRecords(ids) |
| | | .then(() => { |
| | | proxy.$modal.msgSuccess("删除成功"); |
| | | getList(); |