diff --git a/klp-ui/src/views/mes/qc/certificate/chemistry.vue b/klp-ui/src/views/mes/qc/certificate/chemistry.vue index 658da095..bb9f6456 100644 --- a/klp-ui/src/views/mes/qc/certificate/chemistry.vue +++ b/klp-ui/src/views/mes/qc/certificate/chemistry.vue @@ -121,10 +121,14 @@ - - - + @@ -258,6 +262,7 @@ import * as XLSX from 'xlsx'; import { listChemicalItem, getChemicalItem, delChemicalItem, addChemicalItem, updateChemicalItem, batchAddChemicalItem } from "@/api/mes/qc/chemicalItem"; import CoilSelector from "@/components/CoilSelector"; +import { listMaterialCoil } from "@/api/wms/coil"; const CHEMI_TEMPLATE_HEADERS = ['入场钢卷号', 'C(%)', 'Si(%)', 'Mn(%)', 'P(%)', 'S(%)', 'Als(%)']; @@ -331,7 +336,9 @@ export default { importStatus: 'idle', // idle | validated | matched | processing | finished | error importErrorMsg: '', importValidateLoading: false, - importLoading: false + importLoading: false, + coilNoOptions: [], + coilNoLoading: false, }; }, created() { @@ -399,6 +406,26 @@ export default { handleSelect(coil) { this.form.coilNo = coil.enterCoilNo; }, + queryCoilNo(queryString, cb) { + if (!queryString || queryString.length < 2) { + cb([]); + return; + } + this.coilNoLoading = true; + listMaterialCoil({ + enterCoilNo: queryString, + pageNum: 1, + pageSize: 20 + }).then(response => { + const options = (response.rows || []).map(item => ({ + value: item.enterCoilNo, + label: item.enterCoilNo + })); + cb(options); + }).finally(() => { + this.coilNoLoading = false; + }); + }, handleBatchAdd(rows) { this.loading = true; this.buttonLoading = true; diff --git a/klp-ui/src/views/mes/qc/certificate/physics.vue b/klp-ui/src/views/mes/qc/certificate/physics.vue index 9669350a..4cfd5e18 100644 --- a/klp-ui/src/views/mes/qc/certificate/physics.vue +++ b/klp-ui/src/views/mes/qc/certificate/physics.vue @@ -171,9 +171,14 @@ - - + @@ -312,6 +317,7 @@ import * as XLSX from 'xlsx'; import { listPhysicalItem, getPhysicalItem, delPhysicalItem, addPhysicalItem, updatePhysicalItem, batchAddPhysicalItem } from "@/api/mes/qc/physicalItem"; import CoilSelector from "@/components/CoilSelector"; +import { listMaterialCoil } from "@/api/wms/coil"; const PHYS_TEMPLATE_HEADERS = [ '当前钢卷号', '屈服强度(MPa)', '抗拉强度(MPa)', '伸长率(%)', '硬度(HRB)', '弯曲试验', @@ -391,7 +397,9 @@ export default { importStatus: 'idle', // idle | validated | matched | processing | finished | error importErrorMsg: '', importValidateLoading: false, - importLoading: false + importLoading: false, + coilNoOptions: [], + coilNoLoading: false, }; }, created() { @@ -460,6 +468,26 @@ export default { handleSelect(coil) { this.form.coilNo = coil.enterCoilNo; }, + queryCoilNo(queryString, cb) { + if (!queryString || queryString.length < 2) { + cb([]); + return; + } + this.coilNoLoading = true; + listMaterialCoil({ + enterCoilNo: queryString, + pageNum: 1, + pageSize: 20 + }).then(response => { + const options = (response.rows || []).map(item => ({ + value: item.enterCoilNo, + label: item.enterCoilNo + })); + cb(options); + }).finally(() => { + this.coilNoLoading = false; + }); + }, handleBatchAdd(rows) { this.loading = true; this.buttonLoading = true; diff --git a/klp-ui/src/views/mes/qc/inspection/task.vue b/klp-ui/src/views/mes/qc/inspection/task.vue index 37d93e3d..fe6599a8 100644 --- a/klp-ui/src/views/mes/qc/inspection/task.vue +++ b/klp-ui/src/views/mes/qc/inspection/task.vue @@ -246,7 +246,25 @@ - +
+ + {{ coilNo }} + +
+
@@ -358,7 +376,7 @@ import { listInspectionItemTemplate } from "@/api/mes/qc/inspectionItemTemplate" import { SchemeSelect } from "@/components/KLPService"; import CoilSelector from "@/components/CoilSelector/index.vue"; import CurrentCoilNo from "@/components/KLPService/Renderer/CurrentCoilNo.vue"; -import { listCoilByIds } from "@/api/wms/coil"; +import { listCoilByIds, listMaterialCoil } from "@/api/wms/coil"; export default { name: "InspectionTask", @@ -449,6 +467,10 @@ export default { schemeOptions: [], selectedCompany: '', selectedScheme: '', + enterCoilNoOptions: [], + enterCoilNoLoading: false, + selectedEnterCoilNos: [], + tempEnterCoilNo: '', }; }, computed: { @@ -506,6 +528,8 @@ export default { }, handleTaskAdd() { this.resetTaskForm(); + this.selectedEnterCoilNos = []; + this.tempEnterCoilNo = ''; this.taskOpen = true; this.taskTitle = "添加检验任务"; }, @@ -522,6 +546,13 @@ export default { this.taskCoilList = res.rows || []; }); } + // 初始化已选择的入场卷号 + if (response.data.enterCoilNos) { + this.selectedEnterCoilNos = response.data.enterCoilNos.split(',').filter(item => item.trim()); + } else { + this.selectedEnterCoilNos = []; + } + this.tempEnterCoilNo = ''; this.taskLoading = false; this.taskOpen = true; this.taskTitle = "修改检验任务"; @@ -667,6 +698,37 @@ export default { this.taskQueryParams.schemeName = this.selectedScheme || undefined; this.handleTaskQuery(); }, + queryEnterCoilNo(queryString, cb) { + if (!queryString || queryString.length < 2) { + cb([]); + return; + } + this.enterCoilNoLoading = true; + listMaterialCoil({ + enterCoilNo: queryString, + pageNum: 1, + pageSize: 20 + }).then(response => { + const options = (response.rows || []).map(item => ({ + value: item.enterCoilNo, + label: item.enterCoilNo + })).filter(opt => !this.selectedEnterCoilNos.includes(opt.value)); + cb(options); + }).finally(() => { + this.enterCoilNoLoading = false; + }); + }, + handleSelectEnterCoilNo(item) { + if (!this.selectedEnterCoilNos.includes(item.value)) { + this.selectedEnterCoilNos.push(item.value); + } + this.tempEnterCoilNo = ''; + this.taskForm.enterCoilNos = this.selectedEnterCoilNos.join(','); + }, + removeEnterCoilNo(index) { + this.selectedEnterCoilNos.splice(index, 1); + this.taskForm.enterCoilNos = this.selectedEnterCoilNos.join(','); + }, cancelTask() { this.taskOpen = false; this.resetTaskForm(); @@ -695,6 +757,8 @@ export default { updateBy: undefined }; this.taskCoilList = []; + this.selectedEnterCoilNos = []; + this.tempEnterCoilNo = ''; this.resetForm("taskForm"); },