From 9e579eda4601ed7b492b9d19a24e8146f6ebdf8d Mon Sep 17 00:00:00 2001 From: dengjunjie <dengjunjie@hnkhzn.com> Date: 星期六, 19 四月 2025 19:50:43 +0800 Subject: [PATCH] 优化空托出入库逻辑 --- 项目代码/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js | 96 ++++++++++++++++++++++++++++++++++++++++++++++- 1 files changed, 93 insertions(+), 3 deletions(-) diff --git "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" index 10dd868..c624a5c 100644 --- "a/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" +++ "b/\351\241\271\347\233\256\344\273\243\347\240\201/WMS/WIDESEA_WMSClient/src/extension/inbound/inboundOrder.js" @@ -1,6 +1,8 @@ //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜 +import { el, fa, th } from "element-plus/es/locales.mjs"; + let extension = { components: { //鏌ヨ鐣岄潰鎵╁睍缁勪欢 @@ -15,13 +17,37 @@ tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓) buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽� methods: { + //鑾峰彇琛ㄥ崟閰嶇疆 + getOption(field) { + let option; + this.detailOptions.columns.forEach(x => { + if (x.field == field) { + option = x; + } + // x.forEach(item => { + // if (item.field == field) { + // option = item; + // } + // }) + }) + return option; + }, //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄� onInit() { + // let enableBtn = this.buttons.find(x => x.value == 'Add'); + // if (enableBtn) { + // this.detailOptions.columns.forEach(x => { + // if (x.field == 'materielCode' || x.field == 'batchNo' || x.field == 'orderQuantity') { + // x.readonly = false + // } + // }); + // } }, onInited() { //妗嗘灦鍒濆鍖栭厤缃悗 //濡傛灉瑕侀厤缃槑缁嗚〃,鍦ㄦ鏂规硶鎿嶄綔 this.detailOptions.columns.forEach(x => { + if (x.field == 'materielCode') { x.onChange = (val, option) => { // this.$error(val.materielCode) @@ -29,12 +55,22 @@ source => { if (!source.status) return this.$error(source.message); val.materielName = source.data.materielName; - this.$success(source.data.materielName); + // this.$success(source.data.materielName); this.refresh(); }) + // let locationCodes = this.getOption("locationCode"); + // locationCodes.bind.data.splice(0); + // this.http.post("/api/LocationInfo/GetLocationCodes", { Extra: val.materielCode }, true).then( + // source => { + // if (!source.status) return this.$error(source.message); + // val.materielName = source.message; + // for (let i = 0; i < source.data.length; i++) { + // locationCodes.bind.data.push({ key: source.data[i], value: source.data[i] }); + // } + // this.refresh(); + // }) } } - }); }, searchBefore(param) { @@ -48,10 +84,28 @@ }, addBefore(formData) { //鏂板缓淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛紝鍙互缁欑粰琛ㄥ崟璁剧疆鍊硷紝鑷繁杈撳嚭鐪媐ormData鐨勫�� - return true; + let req = true; + // let locationCodes = formData.detailData.map(x=>{ + // // this.$error(x.locationCode); + // return x.locationCode + // }); + + formData.detailData.forEach(x => { + // if ('locationCode' in x) { + // // return this.$error(x.batchNo); + // } + if (!x.hasOwnProperty('batchNo')) { + req = false; + return this.$error("鏌滃彿涓嶈兘涓虹┖"); + } + }) + if (formData.detailData.length > 3) return this.$error("鍏ュ簱鍗曟槑缁嗕笉鑳借秴杩�3涓�"); + return req; }, updateBefore(formData) { //缂栬緫淇濆瓨鍓峟ormData涓哄璞★紝鍖呮嫭鏄庣粏琛ㄣ�佸垹闄よ鐨処d + // this.$error(formData.detailData.length) + if (formData.detailData.length > 3) return this.$error("鍏ュ簱鍗曟槑缁嗕笉鑳借秴杩�3涓�"); return true; }, rowClick({ row, column, event }) { @@ -65,6 +119,42 @@ //(3)this.editFormFields.瀛楁='xxx'; //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊� //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions) + if (this.currentAction == 'Add') { + let locationCodes=this.getOption("locationCode"); + locationCodes.bind.data.splice(0); + this.http.post("/api/LocationInfo/GetLocationCodes", null, true).then( + source => { + if (!source.status) return this.$error(source.message); + for (let i = 0; i < source.data.length; i++) { + locationCodes.bind.data.push({ key: source.data[i], value: source.data[i] }); + } + this.refresh(); + }) + this.detailOptions.columns.forEach(x => { + if (x.field == 'materielCode' || x.field == 'batchNo' || x.field == 'orderQuantity' || x.field == 'locationCode') { + x.readonly = false + } + }); + } else { + this.detailOptions.columns.forEach(x => { + if (x.field == 'materielCode' || x.field == 'batchNo' || x.field == 'orderQuantity' || x.field == 'locationCode') { + x.readonly = true// row.orderStatus > 0 + } + }); + } + // if (row.orderStatus != '0') { + // this.detailOptions.columns.forEach(x => { + // if (x.field == 'materielCode' || x.field == 'batchNo' || x.field == 'orderQuantity') { + // x.readonly = row.orderStatus > 0 + // } + // }); + // } else { + // this.detailOptions.columns.forEach(x => { + // if (x.field == 'materielCode' || x.field == 'batchNo' || x.field == 'orderQuantity') { + // x.disabled = true; + // } + // }) + // } } } }; -- Gitblit v1.9.3