From c7082f9c389230a989b1fa63862f6aa6e720990c Mon Sep 17 00:00:00 2001 From: wankeda <Administrator@DESKTOP-HAU3ST3> Date: 星期五, 28 二月 2025 10:41:13 +0800 Subject: [PATCH] PP仓出库MES,AGV对接流程 --- 代码管理/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js | 65 ++++++++++++++++++++++++++++++++ 1 files changed, 65 insertions(+), 0 deletions(-) diff --git "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js" "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js" index 25f0128..1e93c31 100644 --- "a/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js" +++ "b/\344\273\243\347\240\201\347\256\241\347\220\206/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js" @@ -14,8 +14,63 @@ tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓) buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽� methods: { + //鑾峰彇琛ㄥ崟閰嶇疆 + getOption(field) { + let option; + this.editFormOptions.forEach(x => { + x.forEach(item => { + if (item.field == field) { + option = item; + } + }) + }) + return option; + }, + formatDate(dateStr) { + let date = new Date(dateStr); + let year = date.getFullYear(); + let month = String(date.getMonth() + 1).padStart(2, "0"); + let day = String(date.getDate()).padStart(2, "0"); + return year + "-" + month + "-" + day; + }, //涓嬮潰杩欎簺鏂规硶鍙互淇濈暀涔熷彲浠ュ垹闄� onInit() { //妗嗘灦鍒濆鍖栭厤缃墠锛� + let warehouseIdOption = this.getOption("warehouseId"); + let materielCodeOption = this.getOption("materielCode"); + let purchaseOrderNoOption = this.getOption("purchaseOrderNo"); + warehouseIdOption.onChange=(val,option)=>{ + this.editFormFields.materielCode = ""; + materielCodeOption.data = []; + this.editFormFields.purchaseOrderNo = ""; + purchaseOrderNoOption.data = []; + if (val == null || val == 0) { + return this.$error("璇烽�夋嫨浠撳簱锛�") + } + this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderDetailMaterielCode?warehouseId=" + val, {}, true).then( + source => { + if (!source.status) return this.$error(source.message); + for (let i = 0; i < source.data.length; i++) { + materielCodeOption.data.push({ key: source.data[i], value: source.data[i] }) + } + this.refresh(); + }) + } + materielCodeOption.onChange = (val, option) => { + this.editFormFields.purchaseOrderNo = ""; + purchaseOrderNoOption.data = []; + if (val == null || val == 0) { + return this.$error("璇烽�夋嫨鐗╂枡缂栧彿锛�") + } + this.http.post("/api/PurchaseOrderDetail/GetPurchaseOrderNos?materielCode=" + val, {}, true).then( + source => { + if (!source.status) return this.$error(source.message); + for (let i = 0; i < source.data.length; i++) { + purchaseOrderNoOption.data.push({ key: source.data[i], value: source.data[i] }) + } + this.refresh(); + }) + } + this.columns.push({ field: '鎿嶄綔', title: '鎿嶄綔', @@ -65,6 +120,16 @@ //(3)this.editFormFields.瀛楁='xxx'; //濡傛灉闇�瑕佺粰涓嬫媺妗嗚缃粯璁ゅ�硷紝璇烽亶鍘唗his.editFormOptions鎵惧埌瀛楁閰嶇疆瀵瑰簲data灞炴�х殑key鍊� //鐪嬩笉鎳傚氨鎶婅緭鍑虹湅锛歝onsole.log(this.editFormOptions) + let isAdd = this.currentAction == 'Add'; + if (isAdd) { + let date = new Date(); + let year = date.getFullYear(); + let month = String(date.getMonth() + 1).padStart(2, "0"); + let day = String(date.getDate()).padStart(2, "0"); + this.editFormFields.lotNo = year + month + day; + this.editFormFields.productionDate = year + "-" + month + "-" + day; + this.editFormFields.effectiveDate = year + 2 + "-" + month + "-" + day; + } } } }; -- Gitblit v1.9.3