diff --git a/src/App.vue b/src/App.vue index 8bb587c..89da55c 100644 --- a/src/App.vue +++ b/src/App.vue @@ -56,3 +56,9 @@ watch( } ) + + diff --git a/src/utils/warehouse.js b/src/utils/warehouse.js new file mode 100644 index 0000000..56b0aad --- /dev/null +++ b/src/utils/warehouse.js @@ -0,0 +1,9 @@ +export const warehouseOptions = [ + { warehouseCode: 'WH001', warehouseName: '原材料库' }, + { warehouseCode: 'WH002', warehouseName: '半成品库' }, + { warehouseCode: 'WH003', warehouseName: '产成品库' }, + { warehouseCode: 'WH004', warehouseName: '退货库' }, + { warehouseCode: 'WH005', warehouseName: '转用库' }, + { warehouseCode: 'WH006', warehouseName: '报废库' }, + // 更多仓库... +] \ No newline at end of file diff --git a/src/views/materialManagement/productionMaterial/MmInventory.vue b/src/views/materialManagement/productionMaterial/MmInventory.vue index c43dc02..5868d9e 100644 --- a/src/views/materialManagement/productionMaterial/MmInventory.vue +++ b/src/views/materialManagement/productionMaterial/MmInventory.vue @@ -7,11 +7,29 @@
- - + + + + {{ item.materialCode }} + {{ item.materialName }} + + - - + + + + {{ item.locationCode }} + {{ item.locationName }} + + + + + + + {{ item.warehouseCode }} + {{ item.warehouseName }} + + {{ $t('btn.search') }} @@ -39,7 +57,7 @@ header-cell-class-name="el-table-header-cell" highlight-current-row @sort-change="sortChange"> - + @@ -77,11 +95,11 @@ - + @@ -91,8 +109,11 @@ - - + + + {{ item.materialCode }} + {{ item.materialName }} + @@ -110,14 +131,16 @@ - + - - + + + {{ item.locationCode }} + {{ item.locationName }} @@ -125,7 +148,7 @@ - + @@ -143,6 +166,12 @@ + + + + + + @@ -193,37 +222,70 @@ - + + + + + + - - + + + {{ item.materialCode }} + {{ item.materialName }} + + + + + + + + + + + + + + + + + + + {{ item.locationCode }} + {{ item.locationName }} + - - + + - - + + - + @@ -233,30 +295,9 @@ - - - - - - - - - - - - - - - - - - - - - - + @@ -267,14 +308,8 @@ - - - - - - - - + + @@ -299,7 +334,7 @@ --> - + @@ -326,8 +361,9 @@ import { getTransactionOption, createInboundReceipt, getLocationOption, - createOutboundReceipt, + createOutboundReceipt } from '@/api/materialManagement/productionMaterial/mminventory.js' +import { warehouseOptions } from '@/utils/warehouse.js' const { proxy } = getCurrentInstance() const ids = ref([]) const loading = ref(false) @@ -343,7 +379,7 @@ const queryParams = reactive({ transactionType: '' }) const columns = ref([ - { visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' }, + // { visible: true, align: 'center', type: '', prop: 'id', label: '主键ID' }, { visible: true, align: 'center', type: '', prop: 'materialCode', label: '物料编码', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'warehouseCode', label: '仓库编码', showOverflowTooltip: true }, { visible: true, align: 'center', type: '', prop: 'warehouseName', label: '仓库名称', showOverflowTooltip: true }, @@ -418,22 +454,22 @@ const state = reactive({ transactionType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }], quantity: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }], warehouseCode: [{ required: true, message: '仓库编码不能为空', trigger: 'blur' }], - inboundNo: [{ required: true, message: '入库单号不能为空', trigger: 'blur' }], + inboundNo: [{ required: true, message: '入库单号不能为空', trigger: 'blur' }] }, rulesOut: { materialCode: [{ required: true, message: '物料编码不能为空', trigger: 'blur' }], transactionType: [{ required: true, message: '入库类型不能为空', trigger: 'blur' }], quantity: [{ required: true, message: '入库数量不能为空', trigger: 'blur' }], warehouseCode: [{ required: true, message: '仓库编码不能为空', trigger: 'blur' }], - outboundNo: [{ required: true, message: '出库单号不能为空', trigger: 'blur' }], + outboundNo: [{ required: true, message: '出库单号不能为空', trigger: 'blur' }] }, options: {}, transactionOptions: {}, - warehouseOptions: {}, - locationOptions: [] + locationOptions: [], + inOrOut: 0 }) -const { form, rules, rulesOut, options, transactionOptions, warehouseOptions, locationOptions, single, multiple } = toRefs(state) +const { form, rules, rulesOut, options, transactionOptions, locationOptions, single, multiple, inOrOut } = toRefs(state) // 关闭dialog function cancel() { @@ -468,9 +504,7 @@ function handleStorage() { openStorage.value = true title.value = '填写入库单信息' opertype.value = 1 - getMaterialCodeList() - getTypeOfWarehousingList() - getLocationOptionList() + inOrOut.value = 0 } // 出库操作 function handleOutStorage() { @@ -478,9 +512,7 @@ function handleOutStorage() { openOutStorage.value = true title.value = '填写出库单信息' opertype.value = 1 - getMaterialCodeList() - getTypeOfWarehousingList() - getLocationOptionList() + inOrOut.value = 1 } // 修改按钮操作 function handleUpdate(row) { @@ -502,7 +534,7 @@ function handleUpdate(row) { // 添加&修改 表单提交 function submitFormStorage() { - console.log(form.value, "==========================") + console.log(form.value, '==========================') proxy.$refs['formRef'].validate((valid) => { if (valid) { if (form.value.id != undefined && opertype.value === 2) { @@ -513,7 +545,7 @@ function submitFormStorage() { }) } else { createInboundReceipt(form.value).then((res) => { - proxy.$modal.msgSuccess('新增成功') + proxy.$modal.msgSuccess(inOrOut.value === 0 ? '入库成功' : '出库成功') openStorage.value = false getList() }) @@ -603,5 +635,21 @@ function getLocationOptionList() { } } +// 物料编码选择器改变事件 +function handleMaterialChange(val) { + form.value.materialCode = val.materialCode + form.value.materialName = val.materialName +} + +// 库位编码选择器改变事件 +function handleLocationChange(val) { + form.value.locationCode = val.locationCode + form.value.locationName = val.locationName + form.value.warehouseCode = val.warehouseCode +} + handleQuery() +getMaterialCodeList() +getTypeOfWarehousingList() +getLocationOptionList() diff --git a/src/views/materialManagement/productionMaterial/MmLocation.vue b/src/views/materialManagement/productionMaterial/MmLocation.vue index 5447aca..54101b6 100644 --- a/src/views/materialManagement/productionMaterial/MmLocation.vue +++ b/src/views/materialManagement/productionMaterial/MmLocation.vue @@ -6,11 +6,21 @@