From c38154df95a2c2fa1bd32c45f6be9c0d98e37440 Mon Sep 17 00:00:00 2001
From: wangxinhui <wangxinhui@hnkhzn.com>
Date: 星期二, 29 四月 2025 10:52:14 +0800
Subject: [PATCH] Merge branch 'master' of http://115.159.85.185:8098/r/MeiRuiAn/HuaiAn

---
 代码管理/WMS/WIDESEA_WMSClient/src/extension/basic/materielCodeInfo.js |  134 +++++++++++++++++++++++++++++++++++++-------
 1 files changed, 111 insertions(+), 23 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 dc5728a..516fc1d 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"
@@ -1,5 +1,8 @@
 //姝s鏂囦欢鏄敤鏉ヨ嚜瀹氫箟鎵╁睍涓氬姟浠g爜锛屽彲浠ユ墿灞曚竴浜涜嚜瀹氫箟椤甸潰鎴栬�呴噸鏂伴厤缃敓鎴愮殑浠g爜
 import gridBody from './extend/materielcodeprintView.vue'
+import modelHeader from './extend/materielcodeSelectView.vue'
+import modelBody from './extend/purchaseOrderNoSelectView.vue'
+import modelFooter from './extend/GetOrderQuantityView.vue'
 let extension = {
   components: {
     //鏌ヨ鐣岄潰鎵╁睍缁勪欢
@@ -7,9 +10,9 @@
     gridBody: gridBody,
     gridFooter: '',
     //鏂板缓銆佺紪杈戝脊鍑烘鎵╁睍缁勪欢
-    modelHeader: '',
-    modelBody: '',
-    modelFooter: ''
+    modelHeader: modelHeader,
+    modelBody: modelBody,
+    modelFooter: modelFooter
   },
   tableAction: '', //鎸囧畾鏌愬紶琛ㄧ殑鏉冮檺(杩欓噷濉啓琛ㄥ悕,榛樿涓嶇敤濉啓)
   buttons: { view: [], box: [], detail: [] }, //鎵╁睍鐨勬寜閽�
@@ -26,29 +29,100 @@
       })
       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 materielCodeOption = this.getOption("materielCode");
-      let purchaseOrderNoOption = this.getOption("purchaseOrderNo");
-      purchaseOrderNoOption.onChange = (val, option) => {
-        this.editFormFields.materielCode = "";
-        materielCodeOption.data = [];
-        if (val == null || val == 0) {
-          return this.$error("璇烽�夋嫨鐗╂枡缂栧彿锛�")
-        }
-        // console.log(val)
-        // console.log(option)
-        this.http.post("/api/PurchaseOrder/GetPurchaseOrderInfo?purchaseOrderNo=" + 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: i, value: source.data[i] })
+      this.$nextTick(() => {
+        this.editFormOptions.forEach((option) => {
+          option.forEach((item) => {
+            if (item.field == 'materielCode') {
+              //鍒濆鍖栧脊鍑烘閫夋嫨鍣ㄩ厤缃�
+              item.extra = {
+                icon: 'el-icon-zoom-out', //鏄剧ず鍥炬爣
+                text: '閫夋嫨鏁版嵁', //鏄剧ず鏂囨湰
+                style: 'color: #3a8ee6;font-size: 13px;cursor: pointer;',
+                //瑙﹀彂浜嬩欢
+                click: (item) => {
+                  this.$refs.modelHeader.open(this.editFormFields.warehouseId);
+                }
+              };
             }
-            // this.editFormFields.InputOder_itemname = source.data.itemName;
-            // this.$success(source.data.itemName);
-            this.refresh();
-          })
-      }
+          });
+        });
+        this.editFormOptions.forEach((option) => {
+          option.forEach((item) => {
+            if (item.field == 'purchaseOrderNo') {
+              //鍒濆鍖栧脊鍑烘閫夋嫨鍣ㄩ厤缃�
+              item.extra = {
+                icon: 'el-icon-zoom-out', //鏄剧ず鍥炬爣
+                text: '閫夋嫨鏁版嵁', //鏄剧ず鏂囨湰
+                style: 'color: #3a8ee6;font-size: 13px;cursor: pointer;',
+                //瑙﹀彂浜嬩欢
+                click: (item) => {
+                  this.$refs.modelBody.open(this.editFormFields.materielCode);
+                }
+              };
+            }
+          });
+        });
+        this.editFormOptions.forEach((option) => {
+          option.forEach((item) => {
+            if (item.field == 'quantity') {
+              //鍒濆鍖栧脊鍑烘閫夋嫨鍣ㄩ厤缃�
+              item.extra = {
+                icon: 'el-icon-zoom-out', //鏄剧ず鍥炬爣
+                text: '閲囪喘鍗曟渶澶ф暟閲�', //鏄剧ず鏂囨湰
+                style: 'color: #3a8ee6;font-size: 13px;cursor: pointer;',
+                //瑙﹀彂浜嬩欢
+                click: (item) => {
+                  this.$refs.modelFooter.open(this.editFormFields.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);
+        //       this.$nextTick(() => {
+
+        //         for (let i = 0; i < source.data.length; i++) {
+        //           materielCodeOption.data.push({ key: source.data[i], value: source.data[i] })
+        //         }
+        //       })
+        //     })
+        // }
+        // 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);
+        //       this.$nextTick(() => {
+        //         for (let i = 0; i < source.data.length; i++) {
+        //           purchaseOrderNoOption.data.push({ key: source.data[i], value: source.data[i] })
+        //         }
+        //       });
+        //     })
+        // }
+      });
 
       this.columns.push({
         field: '鎿嶄綔',
@@ -99,6 +173,20 @@
       //(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");
+        let hour= String(date.getHours()).padStart(2, "0");
+        let minute= String(date.getMinutes()).padStart(2, "0");
+        let second= String(date.getSeconds()).padStart(2, "0");
+        //灏唝ear鎴彇鍚庝袱浣�
+        this.editFormFields.lotNo = (year.toString().substr(-2)) + month+day + hour + minute+second;
+        this.editFormFields.productionDate = year + "-" + month + "-" + day;
+        this.editFormFields.effectiveDate = year + 2 + "-" + month + "-" + day;
+      }
     }
   }
 };

--
Gitblit v1.9.3