From 6a0b06bf40c470363c6a774e448e99e0904d73eb Mon Sep 17 00:00:00 2001 From: siontion Date: Mon, 22 Jan 2024 17:46:31 +0800 Subject: [PATCH 1/4] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=89=A9=E6=96=99?= =?UTF-8?q?=E8=81=94=E5=8A=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 出库物料联动 --- .../src/views/heli/storage/StorageForm.vue | 8 ++++- .../src/views/heli/storage/StorageOut.vue | 34 +++++++++++++++---- 2 files changed, 34 insertions(+), 8 deletions(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue index d82473aa..aa442e10 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue @@ -408,7 +408,11 @@ const handleStatus = (async (num) => { isShowBtnCancel.value = false; isShowBtnOther.value = true; } + query.type= 'update' + query.id = storageid.value + formData.value.id = storageid.value reload(); + }) const userList = ref([]) // 用户列表 @@ -508,8 +512,10 @@ const submitForm = async () => { // 成功后刷新 + query.type= 'update' + query.id = storageid.value + formData.value.id = storageid.value reload(); - } finally { formLoading.value = false } diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue index 4aa88463..9afc04e4 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue @@ -387,6 +387,9 @@ const handleStatus = (async (num) => { isShowBtnCancel.value = false; isShowBtnOther.value = true; } + query.id = storageid.value + query.type= 'update' + formData.value.id = storageid.value reload() }) const userList = ref([]) // 用户列表 @@ -503,7 +506,10 @@ const submitForm = async () => { // 成功后刷新 - reload(); + query.id = storageid.value + query.type= 'update' + formData.value.id = storageid.value + reload() } finally { formLoading.value = false } @@ -532,6 +538,8 @@ const onAddItem = () => { productBomItemValueDOList: [] } matCount = matCount + 1 + + formData.value.matItemDOList.push(newData) } else { message.alertWarning('清选择出库仓库') @@ -562,11 +570,23 @@ const handleWh = (async (wid) => { pnList.value = [] rgList.value = dataRg.list - formData.value.matItemDOList.forEach(item => { - item.rgId = '' - item.pnId = '' - item.pnlist.value = [] - }) + const matLastRemoteData = await StorageMatApi.getStorageMatList() + + let matParams = { + pageNo: 1, + pageSize: 10, + status: "1" + } + const dataMat = await MaterialApi.getMaterialPage(matParams) + matList.value = [] + matList.value = dataMat.list.filter((item) => matLastRemoteData.find((fish) => fish.matId === item.id && fish.whId == wid) !== undefined) + + formData.value.matItemDOList = [] + // formData.value.matItemDOList.forEach(item => { + // item.rgId = '' + // item.pnId = '' + // item.pnlist.value = [] + // }) //------------------- }) const handleRg = (async (scope) => { @@ -599,7 +619,7 @@ const remoteMatCodeSearch = async (name) => { const dataMat = await MaterialApi.getMaterialPage(matParams) matList.value = [] - matList.value = dataMat.list.filter((item) => matLastRemoteData.find((fish) => fish.matId === item.id) !== undefined) + matList.value = dataMat.list.filter((item) => matLastRemoteData.find((fish) => fish.matId === item.id && fish.whId == formData.value.whId) !== undefined) matSelectLoading.value = false } From 5e8776ab7cadd455e3231211af411ffe01d85172 Mon Sep 17 00:00:00 2001 From: siontion Date: Mon, 22 Jan 2024 18:16:27 +0800 Subject: [PATCH 2/4] reload reload --- .../mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue index 32dc7fcf..2ffc0ae6 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageForm.vue @@ -557,9 +557,9 @@ const handleStatus = async (num) => { query.type= 'update' query.id = storageid.value formData.value.id = storageid.value - reload(); + reload() -}) +} const userList = ref([]) // 用户列表 // ====================附件信息 开始======================================= From 4967c31e4a701b6f8dfdd8c9be5b0c7755fe219d Mon Sep 17 00:00:00 2001 From: siontion Date: Mon, 22 Jan 2024 18:36:31 +0800 Subject: [PATCH 3/4] =?UTF-8?q?=E5=87=BA=E5=BA=93=E7=AE=A1=E7=90=86=20?= =?UTF-8?q?=E8=AE=BE=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 出库管理 设置 --- mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue index e093768d..441ff1cf 100644 --- a/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue +++ b/mes-ui/mes-ui-admin-vue3/src/views/heli/storage/StorageOut.vue @@ -718,7 +718,7 @@ const handleWh = async (wid) => { let matParams = { pageNo: 1, - pageSize: 10, + pageSize: 99, status: "1" } const dataMat = await MaterialApi.getMaterialPage(matParams) From dcc965388fd3ed71ad71169a204eded5f5f170d7 Mon Sep 17 00:00:00 2001 From: siontion Date: Tue, 23 Jan 2024 08:51:17 +0800 Subject: [PATCH 4/4] =?UTF-8?q?v=5Fstorage=5Fmaterial=5Famount=20=E5=87=BA?= =?UTF-8?q?=E5=85=A5=E5=BA=93=E7=89=A9=E6=96=99=E5=BA=93=E5=AD=98=E8=A7=86?= =?UTF-8?q?=E5=9B=BE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v_storage_material_amount 出入库物料库存视图 --- sql/v1.1.0/heli.sql | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sql/v1.1.0/heli.sql b/sql/v1.1.0/heli.sql index 4b2c56d1..8614b97a 100644 --- a/sql/v1.1.0/heli.sql +++ b/sql/v1.1.0/heli.sql @@ -160,3 +160,16 @@ CREATE TABLE `base_serial_number` ( PRIMARY KEY ( `id` ) USING BTREE, UNIQUE KEY `uk_business_segment` ( `business_type`, `segment` ) USING BTREE ) ENGINE = InnoDB COMMENT = '序列号记录表'; + +CREATE ALGORITHM = UNDEFINED DEFINER = `root` @`%` SQL SECURITY DEFINER VIEW `v_storage_material_amount` AS +select `t`.`tenant_id` AS `tenant_id`,`t`.`mat_id` AS `mat_id`,`t`.`mat_name` AS `mat_name`,`t`.`mat_code` AS `mat_code`, + `t`.`wh_id` AS `wh_id`,`t`.`rg_id` AS `rg_id`,`t`.`pn_id` AS `pn_id`,`t`.`spec` AS `spec`,`t`.`unit` AS `unit`, + `t`.`material_type` AS `material_type`,`t`.`lot_no` AS `lot_no`,'' AS `storage_ok_qty`,sum(`t`.`storage_ok_qty`) AS `mat_rest` +from ( + select `st`.`stock_type` AS `stock_type`,`mat`.`tenant_id` AS `tenant_id`,`mat`.`mat_id` AS `mat_id`,`bm`.`code` AS `mat_code`,`bm`.`name` AS `mat_name`, + `mat`.`wh_id` AS `wh_id`,`mat`.`rg_id` AS `rg_id`,`mat`.`pn_id` AS `pn_id`,`mat`.`lot_no` AS `lot_no`,`bm`.`spec` AS `spec`,`bm`.`unit` AS `unit`,`bm`.`material_type` AS `material_type`, + (case when (`st`.`stock_type` = 1) then `mat`.`storage_ok_qty` else (`mat`.`storage_ok_qty` * -(1)) end) AS `storage_ok_qty` + from ((`mes-heli`.`wms_storage_mat` `mat` + left join `mes-heli`.`wms_storage` `st` on((`mat`.`stock_id` = `st`.`id`))) + left join `mes-heli`.`base_material` `bm` on((`mat`.`mat_id` = `bm`.`id`))) + where ((`mat`.`deleted` = 0) and (`st`.`status` <> 3) and (`st`.`deleted` = 0) and (`bm`.`deleted` = 0) and (`bm`.`status` = 1))) `t` group by `t`.`mat_id` \ No newline at end of file