From 8d52034ba702293ca292b6e64cae66f37a745d34 Mon Sep 17 00:00:00 2001 From: git_rabbit Date: Fri, 9 Jan 2026 15:55:32 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E7=89=A9=E6=96=99=E7=AE=A1=E7=90=86):=20?= =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E7=89=A9=E6=96=99=E9=80=89=E6=8B=A9=E5=99=A8?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=B9=B6=E6=B7=BB=E5=8A=A0=E7=8B=AC=E7=AB=8B?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=B9=E7=AA=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 修改查询表单、入库单和出库单的物料下拉选择器,显示类型、编码、名称和供应商信息 - 更新handleMaterialChange函数以处理新的下拉选项结构 - 为库存管理添加独立的修改弹窗,包含完整表单和验证规则 - 移除不必要的操作按钮并优化表格列显示 - 添加炉号、供应商名称等字段显示 --- .gitignore | 2 + .../productionMaterial/MmInventory.vue | 264 ++++++++++++++---- .../productionMaterial/MmRecordInbound.vue | 14 +- .../productionMaterial/MmRecordOutbound.vue | 32 +-- 4 files changed, 243 insertions(+), 69 deletions(-) diff --git a/.gitignore b/.gitignore index 308820b..2f3d0f5 100644 --- a/.gitignore +++ b/.gitignore @@ -21,3 +21,5 @@ selenium-debug.log package-lock.json yarn.lock /deploy.js +.trae/ +.trae/ diff --git a/src/views/materialManagement/productionMaterial/MmInventory.vue b/src/views/materialManagement/productionMaterial/MmInventory.vue index 97e295b..128a03e 100644 --- a/src/views/materialManagement/productionMaterial/MmInventory.vue +++ b/src/views/materialManagement/productionMaterial/MmInventory.vue @@ -10,9 +10,13 @@ - - {{ item.materialCode }} - {{ item.materialName }} + + {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] @@ -75,8 +79,10 @@ @sort-change="sortChange" :default-sort="{ prop: 'createdTime', order: 'descending' }"> - + + + @@ -128,10 +134,21 @@ - - - {{ item.materialCode }} - {{ item.materialName }} + + + {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] @@ -154,9 +171,21 @@ + + + + + + + + + + + + - + {{ item.locationCode }} {{ item.locationName }} @@ -195,6 +224,12 @@ + + + + + + @@ -237,7 +272,7 @@ @@ -258,10 +293,21 @@ - - - {{ item.materialCode }} - {{ item.materialName }} + + + {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] @@ -280,9 +326,21 @@ + + + + + + + + + + + + - + {{ item.locationCode }} {{ item.locationName }} @@ -299,7 +357,7 @@ - + @@ -333,6 +391,12 @@ + + + + + + @@ -375,7 +439,7 @@ @@ -412,6 +476,98 @@ {{ $t('btn.submit') }} + + + + + + + + + + {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] + + + + + + + + + + + + + + + + + + + + + + + + + + + + {{ item.locationCode }} + {{ item.locationName }} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -530,6 +686,7 @@ const title = ref('') const opertype = ref(0) const openStorage = ref(false) const openOutStorage = ref(false) +const openUpdate = ref(false) const state = reactive({ single: true, multiple: true, @@ -539,6 +696,7 @@ const state = reactive({ transactionType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }], quantity: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }], warehouseCode: [{ required: true, message: '仓库编码不能为空', trigger: 'blur' }], + locationCode: [{ required: true, message: '库位编码不能为空', trigger: 'blur' }], // inboundNo: [{ required: true, message: '入库单号不能为空', trigger: 'blur' }], batchNo: [{ required: true, message: '批次号不能为空', trigger: 'blur' }] }, @@ -547,21 +705,30 @@ const state = reactive({ transactionType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }], quantity: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }], warehouseCode: [{ required: true, message: '仓库编码不能为空', trigger: 'blur' }], + locationCode: [{ required: true, message: '库位编码不能为空', trigger: 'blur' }], // outboundNo: [{ required: true, message: '出库单号不能为空', trigger: 'blur' }], batchNo: [{ required: true, message: '批次号不能为空', trigger: 'blur' }] }, + rulesUpdate: { + materialCode: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], + warehouseCode: [{ required: true, message: '仓库编码不能为空', trigger: 'blur' }], + locationCode: [{ required: true, message: '库位编码不能为空', trigger: 'blur' }], + batchNo: [{ required: true, message: '批次号不能为空', trigger: 'blur' }], + currentQty: [{ required: true, message: '库存数量不能为空', trigger: 'blur' }] + }, options: {}, transactionOptions: {}, locationOptions: [], inOrOut: '入库' }) -const { form, rules, rulesOut, options, transactionOptions, locationOptions, single, multiple, inOrOut } = toRefs(state) +const { form, rules, rulesOut, rulesUpdate, options, transactionOptions, locationOptions, single, multiple, inOrOut } = toRefs(state) // 关闭dialog function cancel() { openStorage.value = false openOutStorage.value = false + openUpdate.value = false reset() } @@ -570,11 +737,15 @@ function reset() { form.value = { id: null, materialCode: null, + materialName: null, + supplierCode: null, + supplierName: null, warehouseCode: null, warehouseName: null, locationCode: null, locationName: null, batchNo: null, + stoveCode: null, currentQty: null, unit: null, productionDate: null, @@ -612,7 +783,7 @@ function handleUpdate(row) { getMmInventory(id).then((res) => { const { code, data } = res if (code == 200) { - openOutStorage.value = true + openUpdate.value = true title.value = '修改库存' opertype.value = 2 @@ -624,42 +795,38 @@ function handleUpdate(row) { } // 添加&修改 表单提交 -function submitFormStorage() { +function submitInboundForm() { proxy.$refs['formRef'].validate((valid) => { if (valid) { - if (form.value.id != undefined && opertype.value === 2) { - reateInboundReceipt(form.value).then((res) => { - proxy.$modal.msgSuccess('修改成功') - openStorage.value = false - getList() - }) - } else { - createInboundReceipt(form.value).then((res) => { - proxy.$modal.msgSuccess(inOrOut.value === '入库' ? '入库成功' : '出库成功') - openStorage.value = false - getList() - }) - } + createInboundReceipt(form.value).then((res) => { + proxy.$modal.msgSuccess('入库成功') + openStorage.value = false + getList() + }) } }) } -function submitFormOutStorage() { +function submitOutboundForm() { proxy.$refs['formRef'].validate((valid) => { if (valid) { - if (form.value.id != undefined && opertype.value === 2) { - reateInboundReceipt(form.value).then((res) => { - proxy.$modal.msgSuccess('修改成功') - openOutStorage.value = false - getList() - }) - } else { - createOutboundReceipt(form.value).then((res) => { - proxy.$modal.msgSuccess('新增成功') - openOutStorage.value = false - getList() - }) - } + createOutboundReceipt(form.value).then((res) => { + proxy.$modal.msgSuccess('出库成功') + openOutStorage.value = false + getList() + }) + } + }) +} + +function submitUpdateForm() { + proxy.$refs['formRef'].validate((valid) => { + if (valid) { + updateMmInventory(form.value).then((res) => { + proxy.$modal.msgSuccess('修改成功') + openUpdate.value = false + getList() + }) } }) } @@ -729,6 +896,9 @@ function getLocationOptionList() { function handleMaterialChange(val) { form.value.materialCode = val.materialCode form.value.materialName = val.materialName + form.value.type = val.type || '' + form.value.supplierCode = val.supplierCode || '' + form.value.supplierName = val.supplierName || '' } // 库位编码选择器改变事件 diff --git a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue index f1bf79f..666649e 100644 --- a/src/views/materialManagement/productionMaterial/MmRecordInbound.vue +++ b/src/views/materialManagement/productionMaterial/MmRecordInbound.vue @@ -49,7 +49,7 @@ - + @@ -81,6 +81,9 @@ + + + @@ -88,9 +91,8 @@ - - - + + diff --git a/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue b/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue index e44b41f..a8a6f25 100644 --- a/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue +++ b/src/views/materialManagement/productionMaterial/MmRecordOutbound.vue @@ -46,7 +46,7 @@ - + @@ -89,7 +89,7 @@ - + @@ -314,18 +314,18 @@ const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, /*** 用户导入参数 */ const upload = reactive({ - // 是否显示弹出层(用户导入) - open: false, - // 弹出层标题(用户导入) - title: '', - // 是否禁用上传 - isUploading: false, - // 是否更新已经存在的用户数据 - updateSupport: 0, - // 设置上传的请求头部 - headers: { Authorization: 'Bearer ' + getToken() }, - // 上传的地址 - url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData' + // 是否显示弹出层(用户导入) + open: false, + // 弹出层标题(用户导入) + title: '', + // 是否禁用上传 + isUploading: false, + // 是否更新已经存在的用户数据 + updateSupport: 0, + // 设置上传的请求头部 + headers: { Authorization: 'Bearer ' + getToken() }, + // 上传的地址 + url: import.meta.env.VITE_APP_BASE_API + '/system/user/importData' }) var dictParams = []