From 470bf51114df685099a050762bacb9791099c03e Mon Sep 17 00:00:00 2001 From: git_rabbit Date: Wed, 11 Feb 2026 14:55:57 +0800 Subject: [PATCH] =?UTF-8?q?feat(=E5=B7=A5=E5=8D=95=E7=89=A9=E6=96=99?= =?UTF-8?q?=E9=A2=86=E7=94=A8):=20=E6=B7=BB=E5=8A=A0=E7=82=89=E5=8F=B7?= =?UTF-8?q?=E6=98=BE=E7=A4=BA=E5=88=97=E5=B9=B6=E8=B0=83=E6=95=B4=E8=A1=A8?= =?UTF-8?q?=E5=8D=95=E6=8F=90=E4=BA=A4=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 移除炉号输入表单项,改为在表格中显示炉号列 调整表单提交数据,将炉号替换为批次号 --- .../productionMaterial/MmInventory.vue | 839 +++++------------- .../WorkorderMaterialPickDialog.vue | 8 +- 2 files changed, 204 insertions(+), 643 deletions(-) diff --git a/src/views/materialManagement/productionMaterial/MmInventory.vue b/src/views/materialManagement/productionMaterial/MmInventory.vue index 9461c6c..712ba44 100644 --- a/src/views/materialManagement/productionMaterial/MmInventory.vue +++ b/src/views/materialManagement/productionMaterial/MmInventory.vue @@ -126,568 +126,92 @@ - - - - - - - - - {{ item.type || '' }} {{ item.materialCode || '' }} {{ item.materialName || '' }} [{{ item.supplierName || '' }}] - - - - + + - - - - - + + - - - - - + + - - - - - + + - - - - - {{ item.locationCode }} - {{ item.locationName }} - - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.locationCode }} - {{ item.locationName }} - - - - - - - - - - - - - - - - - - - - - {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.locationCode }} - {{ item.locationName }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.locationCode }} - {{ item.locationName }} - - - - - - - - - - - - - - - - - - - -
将文件拖到此处,或点击上传
- -
- -
- - - - - - - - - - {{ item.type || '' }} {{ item.materialCode }} {{ item.materialName }} [{{ item.supplierName || '' }}] - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ item.locationCode }} - {{ item.locationName }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - {{ $t('btn.search') }} - {{ $t('btn.reset') }} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + @@ -695,8 +219,6 @@ import { ref, reactive, onMounted, getCurrentInstance, toRefs } from 'vue' import { listMmInventory, - addMmInventory, - delMmInventory, updateMmInventory, getMmInventory, getMaterialOption, @@ -707,7 +229,6 @@ import { cancelMmInventory } from '@/api/materialManagement/productionMaterial/mminventory.js' import { listMmTransactionType } from '@/api/materialManagement/productionMaterial/mmtransactiontype.js' -import { warehouseOptions } from '@/utils/warehouse.js' import useUserStore from '@/store/modules/user' import { exportMmInventory } from '@/api/materialManagement/productionMaterial/mminventory.js' import { getToken } from '@/utils/auth' @@ -748,7 +269,6 @@ const columns = ref([ const total = ref(0) const dataList = ref([]) const queryRef = ref() -const defaultTime = ref([new Date(2000, 1, 1, 0, 0, 0), new Date(2000, 2, 1, 23, 59, 59)]) /*** 用户导入参数 */ const upload = reactive({ @@ -766,8 +286,6 @@ const upload = reactive({ url: import.meta.env.VITE_APP_BASE_API + '/mes/productionMaterial/MmInventory/importData' }) -var dictParams = [] - function getList() { loading.value = true try { @@ -835,8 +353,6 @@ const openShipment = ref(false) const openUpdate = ref(false) const openRecord = ref(false) const state = reactive({ - single: true, - multiple: true, form: {}, rules: { materialCode: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], @@ -889,8 +405,7 @@ const state = reactive({ recordData: [] }) -const { form, rules, rulesOut, rulesUpdate, options, transactionOptions, locationOptions, supplierOptions, single, multiple, inOrOut, recordData } = - toRefs(state) +const { form, rules, rulesOut, rulesUpdate, options, transactionOptions, locationOptions, supplierOptions, inOrOut, recordData } = toRefs(state) // 关闭dialog function cancel() { @@ -929,42 +444,88 @@ function reset() { // 填入库单操作 function handleStorage(data) { reset() - + openStorage.value = true title.value = '填写入库单信息' opertype.value = 1 - inOrOut.value = '入库' - getTypeOfWarehousingList(inOrOut.value) - openStorage.value = true - state.form = { - ...data + + // 如果有数据传递过来,填充表单 + if (data) { + state.form = { + ...state.form, + materialCode: data.materialCode, + materialName: data.materialName, + supplierCode: data.supplierCode, + supplierName: data.supplierName, + warehouseCode: data.warehouseCode, + warehouseName: data.warehouseName, + locationCode: data.locationCode, + locationName: data.locationName, + batchNo: data.batchNo, + unit: data.unit + } } + + // 获取入库类型列表 + getTypeOfWarehousingList('入库') } // 出库操作 function handleOutStorage(data) { reset() + openOutStorage.value = true title.value = '填写出库单信息' opertype.value = 1 - inOrOut.value = '出库' - getTypeOfWarehousingList(inOrOut.value) - openOutStorage.value = true - state.form = { - ...data + + // 如果有数据传递过来,填充表单 + if (data) { + state.form = { + ...state.form, + materialCode: data.materialCode, + materialName: data.materialName, + supplierCode: data.supplierCode, + supplierName: data.supplierName, + warehouseCode: data.warehouseCode, + warehouseName: data.warehouseName, + locationCode: data.locationCode, + locationName: data.locationName, + batchNo: data.batchNo, + currentQty: data.currentQty, + unit: data.unit + } } + + // 获取出库类型列表 + getTypeOfWarehousingList('出库') } // 出货操作 function handleShipment(data) { reset() + openShipment.value = true title.value = '填写出货单信息' opertype.value = 1 - inOrOut.value = '出库' - getTypeOfWarehousingList(inOrOut.value) - openShipment.value = true - state.form = { - ...data + + // 如果有数据传递过来,填充表单 + if (data) { + state.form = { + ...state.form, + materialCode: data.materialCode, + materialName: data.materialName, + supplierCode: data.supplierCode, + supplierName: data.supplierName, + warehouseCode: data.warehouseCode, + warehouseName: data.warehouseName, + locationCode: data.locationCode, + locationName: data.locationName, + batchNo: data.batchNo, + currentQty: data.currentQty, + unit: data.unit + } } - state.form.transactionType = '出货出库' + + // 获取出库类型列表(出货属于出库的一种) + getTypeOfWarehousingList('出库') } + // 修改按钮操作 function handleUpdate(row) { reset() @@ -1052,42 +613,6 @@ function resetQueryRecord() { queryRecord() } -// 添加&修改 表单提交 -function submitInboundForm(formData) { - try { - createInboundReceipt(formData || state.form).then((res) => { - const { code, msg } = res - if (code == 200) { - proxy.$modal.msgSuccess('入库成功') - openStorage.value = false - getList() - } else { - proxy.$modal.msgError(msg || '入库失败') - } - }) - } catch (error) { - proxy.$modal.msgError(error.message || '入库失败') - } -} - -function submitOutboundForm(formData) { - try { - createOutboundReceipt(formData || state.form).then((res) => { - const { code, msg } = res - if (code == 200) { - proxy.$modal.msgSuccess('出库成功') - openOutStorage.value = false - openShipment.value = false - getList() - } else { - proxy.$modal.msgError(msg || '出库失败') - } - }) - } catch (error) { - proxy.$modal.msgError(error.message || '出库失败') - } -} - function submitUpdateForm(formData) { try { updateMmInventory(formData || state.form).then((res) => { @@ -1105,25 +630,6 @@ function submitUpdateForm(formData) { } } -// 删除按钮操作 -function handleDelete(row) { - const Ids = row.id || ids.value - - proxy - .$confirm('是否确认删除参数编号为"' + Ids + '"的数据项?', '警告', { - confirmButtonText: proxy.$t('common.ok'), - cancelButtonText: proxy.$t('common.cancel'), - type: 'warning' - }) - .then(function () { - return delMmInventory(Ids) - }) - .then(() => { - getList() - proxy.$modal.msgSuccess('删除成功') - }) -} - // 物料编码列表 function getMaterialCodeList() { try { @@ -1178,6 +684,60 @@ function handleMaterialChange(val) { state.form.supplierName = val.supplierName || '' } +// 入库提交操作 +function submitStorage(formData) { + try { + createInboundReceipt(formData).then((res) => { + const { code, msg } = res + if (code == 200) { + proxy.$modal.msgSuccess('入库成功') + openStorage.value = false + getList() + } else { + proxy.$modal.msgError(msg || '入库失败') + } + }) + } catch (error) { + proxy.$modal.msgError(error.message || '入库失败') + } +} + +// 出库提交操作 +function submitOutStorage(formData) { + try { + createOutboundReceipt(formData).then((res) => { + const { code, msg } = res + if (code == 200) { + proxy.$modal.msgSuccess('出库成功') + openOutStorage.value = false + getList() + } else { + proxy.$modal.msgError(msg || '出库失败') + } + }) + } catch (error) { + proxy.$modal.msgError(error.message || '出库失败') + } +} + +// 出货提交操作 +function submitShipment(formData) { + try { + createOutboundReceipt(formData).then((res) => { + const { code, msg } = res + if (code == 200) { + proxy.$modal.msgSuccess('出货成功') + openShipment.value = false + getList() + } else { + proxy.$modal.msgError(msg || '出货失败') + } + }) + } catch (error) { + proxy.$modal.msgError(error.message || '出货失败') + } +} + // 库位编码选择器改变事件 function handleLocationChange(val) { state.form.locationCode = val.locationCode @@ -1200,7 +760,6 @@ const handleFileUploadProgress = (event, file, fileList) => { upload.isUploading = true } /** 文件上传成功处理 */ -/** 文件上传成功处理 */ const handleFileSuccess = (response, file, fileList) => { const { code, msg, data } = response upload.open = false diff --git a/src/views/productManagement/ProWorkorder/components/WorkorderMaterialPickDialog.vue b/src/views/productManagement/ProWorkorder/components/WorkorderMaterialPickDialog.vue index 46bb66a..235a9c0 100644 --- a/src/views/productManagement/ProWorkorder/components/WorkorderMaterialPickDialog.vue +++ b/src/views/productManagement/ProWorkorder/components/WorkorderMaterialPickDialog.vue @@ -25,6 +25,7 @@ + @@ -148,9 +149,9 @@ - +