From d92bbafaf36bbcd4c0dbe0cb591fa86c85475325 Mon Sep 17 00:00:00 2001 From: liuxy Date: Thu, 1 Dec 2022 11:49:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E6=9B=B4=E6=96=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/CheckOutBillServiceImpl.java | 11 +++++--- .../st/outbill/wql/QST_IVT_CHECKOUTBILL.wql | 4 +++ .../src/views/wms/st/outbill/AddDialog.vue | 8 +++++- .../src/views/wms/st/outbill/AddDtl.vue | 27 ++++++++++++++----- .../src/views/wms/st/outbill/DivDialog.vue | 27 +++++++++++++++---- .../src/views/wms/st/outbill/index.vue | 7 +++-- 6 files changed, 65 insertions(+), 19 deletions(-) diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java index 998bb8b25..b761ce62b 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/service/impl/CheckOutBillServiceImpl.java @@ -97,6 +97,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { map.put("begin_time", MapUtil.getStr(whereJson, "begin_time")); map.put("end_time", MapUtil.getStr(whereJson, "end_time")); map.put("sap_pcsn", MapUtil.getStr(whereJson, "sap_pcsn")); + map.put("stor_id", MapUtil.getStr(whereJson, "stor_id")); map.put("canuse_qty", "0"); if (StrUtil.isNotEmpty(map.get("material_code"))) { @@ -744,7 +745,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("sale_order_name", dtl.getString("source_bill_code")); - jsonMap.put("sect_id", ""); + jsonMap.put("sect_id", whereJson.getString("sect_id")); JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足"); @@ -820,9 +821,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("pcsn", dtl.getString("pcsn")); + jsonMap.put("sect_id", whereJson.getString("sect_id")); JSONObject jsonIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); - if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("此物料批次库存不存在"); + if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("库存不足"); double canuse_qty = jsonIvt.getDoubleValue("canuse_qty"); jsonIvt.put("change_qty", canuse_qty + ""); @@ -953,7 +955,7 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("sale_order_name", dtl.getString("source_bill_code")); - jsonMap.put("sect_id", ""); + jsonMap.put("sect_id", whereJson.getString("sect_id")); JSONObject jsonOneIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); if (ObjectUtil.isEmpty(jsonOneIvt)) throw new BadRequestException("库存不足"); @@ -1029,9 +1031,10 @@ public class CheckOutBillServiceImpl implements CheckOutBillService { jsonMap.put("flag", "1"); jsonMap.put("material_id", dtl.getString("material_id")); jsonMap.put("pcsn", dtl.getString("pcsn")); + jsonMap.put("sect_id", whereJson.getString("sect_id")); JSONObject jsonIvt = WQL.getWO("ST_OUTIVT01").addParamMap(jsonMap).process().uniqueResult(0); - if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("此物料批次库存不存在"); + if (ObjectUtil.isEmpty(jsonIvt)) throw new BadRequestException("库存不足"); double canuse_qty = jsonIvt.getDoubleValue("canuse_qty"); jsonIvt.put("change_qty", canuse_qty + ""); diff --git a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql index d03b77352..5d1717f08 100644 --- a/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql +++ b/lms/nladmin-system/src/main/java/org/nl/wms/st/outbill/wql/QST_IVT_CHECKOUTBILL.wql @@ -479,6 +479,10 @@ mater.material_name like 输入.material_code) ENDOPTION + OPTION 输入.stor_id <> "" + attr.stor_id = 输入.stor_id + ENDOPTION + OPTION 输入.sap_pcsn <> "" sub.sap_pcsn like 输入.sap_pcsn ENDOPTION diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue index 3ee5de01a..a75bdd822 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/AddDialog.vue @@ -249,7 +249,7 @@ - + @@ -301,6 +301,7 @@ export default { storlist: [], inStorList: [], invtypelist: [], + storId: null, rules: { stor_id: [ { required: true, message: '仓库不能为空', trigger: 'blur' } @@ -401,6 +402,11 @@ export default { this.crud.notify('请选择业务类型!', CRUD.NOTIFICATION_TYPE.INFO) return } + if (this.form.stor_id === '') { + this.crud.notify('请选择仓库!', CRUD.NOTIFICATION_TYPE.INFO) + return + } + this.storId = this.form.stor_id this.dtlShow = true /* checkoutbill.paramByCodeType({ 'bill_type': this.form.bill_type }).then(res => { this.materType = res.materType diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/AddDtl.vue b/lms/nladmin-ui/src/views/wms/st/outbill/AddDtl.vue index 22f846578..5baaff16e 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/AddDtl.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/AddDtl.vue @@ -83,13 +83,19 @@ export default { name: 'AddDtl', components: { rrOperation, pagination, DateRangePicker }, cruds() { - return CRUD({ title: '用户', url: 'api/checkoutbill/addDtl', optShow: { - add: false, - edit: false, - del: false, - reset: true, - download: false - }}) + return CRUD({ + title: '用户', url: 'api/checkoutbill/addDtl', + optShow: { + add: false, + edit: false, + del: false, + reset: true, + download: false + }, + query: { + + } + }) }, mixins: [presenter(), header()], props: { @@ -99,6 +105,9 @@ export default { }, openParam: { type: String + }, + storId: { + type: String } }, data() { @@ -124,6 +133,7 @@ export default { methods: { [CRUD.HOOK.beforeRefresh]() { this.crud.query.mater_type = this.opendtlParam + this.crud.query.stor_id = this.storId if (this.openShow) { this.openShow = false return false @@ -133,9 +143,12 @@ export default { }, close() { this.crud.resetQuery(false) + // 清空grid数据 + this.crud.data = undefined this.$emit('update:dialogShow', false) }, open() { + debugger this.crud.query.mater_type = this.opendtlParam // this.crud.toQuery() }, diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue index 057ef50f7..7ec93519b 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/DivDialog.vue @@ -6,6 +6,7 @@ :show-close="false" fullscreen @close="close" + @open="open" > @@ -20,7 +21,7 @@
出库明细 - +
@@ -227,6 +228,7 @@ import StructIvt from '@/views/wms/st/outbill/StructIvt' import PointDialog from '@/views/wms/pub/PointDialog' import crudSectattr from '@/views/wms/basedata/st/sect/sectattr' import crudPoint from '@/views/wms/sch/point/point' +import crudUserStor from '@/views/wms/basedata/st/userStor/userStor' export default { name: 'DivDialog', @@ -244,6 +246,10 @@ export default { openArray: { type: Array, default: () => { return [] } + }, + storId: { + type: String, + default: null } }, data() { @@ -298,9 +304,6 @@ export default { } }, created() { - crudSectattr.getSect({ is_materialstore: '1' }).then(res => { - this.sects = res.content - }) checkoutbill.getInvTypes().then(res => { this.invtypelist = res }) @@ -311,6 +314,12 @@ export default { }) }, methods: { + open() { + crudUserStor.getSect({ 'stor_id': this.storId }).then(res => { + debugger + this.sects = res.content + }) + }, close() { this.$refs['form2'].resetFields() this.tabledis = [] @@ -434,12 +443,20 @@ export default { } }, allDiv() { + if (!this.mstrow.sect_id) { + this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO) + return + } checkoutbill.allDiv(this.mstrow).then(res => { this.crud.notify('分配成功!', CRUD.NOTIFICATION_TYPE.INFO) this.queryTableDtl() }) }, oneDiv() { + if (!this.mstrow.sect_id) { + this.crud.notify('请先选择库区!', CRUD.NOTIFICATION_TYPE.INFO) + return + } if (this.currentRow.iostorinvdtl_id !== null) { this.mstrow.iostorinvdtl_id = this.currentRow.iostorinvdtl_id checkoutbill.allDivOne(this.mstrow).then(res => { diff --git a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue index c82de8ea6..bd3a309df 100644 --- a/lms/nladmin-ui/src/views/wms/st/outbill/index.vue +++ b/lms/nladmin-ui/src/views/wms/st/outbill/index.vue @@ -216,7 +216,7 @@ - + @@ -276,7 +276,8 @@ export default { currentRow: null, checkrows: [], storlist: [], - billtypelist: [] + billtypelist: [], + storId: null } }, mounted: function() { @@ -358,7 +359,9 @@ export default { }, divOpen() { checkoutbill.getOutBillDtl({ 'iostorinv_id': this.currentRow.iostorinv_id }).then(res => { + debugger this.openParam = res + this.storId = this.currentRow.stor_id this.divShow = true this.mstrow = this.currentRow })