From 99cda620b8e070ea621b1b6dfa8b555790186d89 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期五, 01 八月 2025 08:38:17 +0800
Subject: [PATCH] 1.巡检新增工位扫描 2.生产报工优化 3.生产领料条码打印优化 4.产品绑定送检新增AGV 5.产品绑定提交优化

---
 H5/Js/IPQC_XJ/Add.js |  196 +++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 190 insertions(+), 6 deletions(-)

diff --git a/H5/Js/IPQC_XJ/Add.js b/H5/Js/IPQC_XJ/Add.js
index 5692543..0f6f4b0 100644
--- a/H5/Js/IPQC_XJ/Add.js
+++ b/H5/Js/IPQC_XJ/Add.js
@@ -24,6 +24,7 @@
                 mocode: "",
                 boardStyle: ""
             },
+            jyGw:"",//妫�楠屽伐浣�
             isShowTable: false,
             tableData: [],//杩斿洖鐨勬楠岄」鐩�
             jymxData: [],//灞曠ず鐨勬楠岄」鐩�
@@ -40,6 +41,10 @@
             okValue: '',//OK-鏁伴噺
             ngValue: '',//NG-鏁伴噺
             showDialog: false,//涓嶈壇琛ㄨ堪杈撳叆妗�
+            selectKey: "",//鏌ヨ鍏抽敭瀛�
+            actions: [],//鍒楄〃鐨勫��
+            daashow: false,//宸ュ崟鍒楄〃灞曠ず
+            lineId:[],
             //鍥剧墖涓婁紶妗�
             fileList: [
 
@@ -47,7 +52,24 @@
         }
     },
     mounted() {
-        var that = this;
+        let that = this;
+        //璇诲彇鎵爜beg 2025-7-25
+        window.msgFromUniapp = function (arg) {
+            //alert(arg.txtName);
+            //alert("鎵爜鐨勭粨鏋�:" + arg.msg);
+            //alert("宸ヤ綅鐮�:" + that.jyGw);
+            if (arg.txtName === "GW") {
+                that.jyGw = arg.msg;
+                that.selIpqcItemsByGw();
+            }
+            else if (arg.txtName === "DAA") {
+                that.formData.lotNo = arg.msg;
+                that.createByWomdaa();
+            }
+            
+            
+        }
+        //璇诲彇鎵爜end
         this.userInfo = {
             loginGuid: this.GetLoginInfor().loginGuid,
             loginAccount: this.GetLoginInfor().loginAccount,
@@ -55,7 +77,16 @@
         this.formData.id = this.Request("id"),
         this.formData.releaseNo = this.Request("releaseNo");
         this.formData.lotNo = this.Request("lotNo");
+
+        ////璇诲彇鎵爜beg 2025-7-25
+        //let that = this;
+        //window.msgFromUniapp = function (arg) {
+        //    alert("鎵爜鐨勭粨鏋�:" + arg.msg);
+        //}
+        ////璇诲彇鎵爜end
+
         this.init();
+
     },
     methods: {
         // 杈撳叆杩囨护
@@ -111,6 +142,70 @@
                 console.log(error);
             });
         },
+
+        getInfo() {
+            this.daashow = true;
+            var that = this;
+            that.actions = [];
+            that.isLoading = true;
+            console.log(that.lineId);
+
+            that.AxiosHttp("post", 'Ipqc/GetIpqcXjDaa', {
+                selectKey: that.selectKey,
+                xt: that.lineId,
+            }, false)
+                .then(function (res) {
+                    var json = res;
+                    if (json.status == 0) {
+
+                        if (json.data.tbBillList.length <= 0) {
+                            that.$toast.fail("娌℃湁鍙敤鐨勬暟鎹�");
+                            that.$playSound('error');
+                        } else {
+                            that.itemInfo = json.data.tbBillList;
+                            that.actions = json.data.tbBillList.map(item => {
+                                return {
+                                    name: item.daaInfo  // 鎷兼帴瀛楁
+
+                                };
+                            });
+                        }
+                    }
+                    else {
+                        that.$toast.fail(json.message);
+                        that.$playSound('error');
+                    }
+                    that.isLoading = false;
+                })
+                .catch(function (error) {
+                    that.isLoading = false;
+                    that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                    that.$playSound('error');
+                    console.log(error);
+                });
+        },
+
+        onSelect(item) {
+            // 榛樿鎯呭喌涓嬬偣鍑婚�夐」鏃朵笉浼氳嚜鍔ㄦ敹璧�
+            // 鍙互閫氳繃 close-on-click-action 灞炴�у紑鍚嚜鍔ㄦ敹璧�
+            this.daashow = false;
+            console.log(item);
+            // 姝e垯鍖归厤绗竴涓柟鎷彿鍐呭
+            const regex = /\[([^\]]+)\]/;
+            const matchResult = item.name.match(regex);
+
+            if (matchResult && matchResult[1]) {
+                this.formData.lotNo = matchResult[1]; // PPBOM00000088-1
+                console.log('鎻愬彇鐨凞AA001:', this.formData.lotNo);
+            } else {
+                this.$toast.fail('宸ュ崟鍙锋牸寮忓紓甯�');
+                this.formData.lotNo = '';
+            }
+            this.createByWomdaa();
+            //this.$toast(item.name);
+
+        },
+
         getInputJYZ() {
             // 鍒囨崲鎸囧畾绱㈠紩鐨� popup 鐘舵��
             var that = this;
@@ -158,10 +253,38 @@
             console.log(this.tabActive)
             this.togglePopup(this.tabActive);
         },
+
+        //鐢熸垚妫�楠屽崟
+        createByWomdaa() {
+            const that = this;
+            var guid1 = that.formData.guid;//涓昏〃id
+            return that.AxiosHttp("post", 'Ipqc/createByWomdaa', {
+                inOrderGuid1: guid1,
+                userAccount: that.userInfo.loginAccount,
+                DAA001: that.formData.lotNo
+            }, false).then(res => {
+                var json = res;
+                if (json.status == 0) {
+
+                }
+                else {
+                    that.$toast.fail(json.message);
+                    that.$playSound('error');
+                    that.formData.lotNo = "";
+                }
+                that.isLoading = false;
+                that.init();
+                
+            }).catch(error => {
+                that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                console.error('Refresh error:', error);
+            });
+        },
+
         //妫�楠屾槑缁嗗埛鏂�
         refreshJYItem() {
             const that = this;
-            return that.AxiosHttp("post", 'LLJ/getJYItem', {
+            return that.AxiosHttp("post", 'Ipqc/getJYItem', {
                 releaseNo: that.formData.releaseNo
             }, false).then(res1 => {
                 const tableData = res1.data.tbBillList || [];
@@ -187,8 +310,9 @@
                     let data = res.data.tbBillList[0];
                     if (data) {
                         that.formData = data;
-                        that.remarks = that.formData.remarks;
-                        that.AxiosHttp("post", 'LLJ/getJYItem', {
+                        that.remarks = that.formData.fnGDesc;
+                        that.lineId = data.lineId;
+                        that.AxiosHttp("post", 'Ipqc/getJYItem', {
                             //id: that.formData.guid,
                             releaseNo: that.formData.releaseNo
                         }, false).then(function (res1) {
@@ -222,7 +346,7 @@
         submit() {
             var that = this;
             that.ttrre = true;
-            that.AxiosHttp("post", 'MesQaItemsDetect01Manager/EditModelSubmit', {
+            that.AxiosHttp("post", 'FqcManager/EditModelSubmit', {
                 guid: that.formData.guid
             }, true, 1).then(function (res1) {
                 if (res1.rtnData.outSum == 1) {
@@ -422,16 +546,76 @@
                 }, true, 0).then(res1 => {
                     if (res1.status === 0) {
                         that.$notify({ type: 'success', message: '鍒犻櫎鎴愬姛' });
-                        that.init();//鍒锋柊妫�楠岄」鐩�
+                        
                     } else {
                         that.$toast.fail(res1.rtnMsg);
+                        
                     }
+                    that.init();//鍒锋柊妫�楠岄」鐩�
                 }).catch(error => {
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
                 });
 
             }).catch(() => {
                 // 鍙栨秷鎿嶄綔
+                that.init();//鍒锋柊妫�楠岄」鐩�
+            })
+        },
+        //妫�楠岄」鐩壂鎻忓伐浣嶅彲鍋氭楠�
+        selIpqcItemsByGw() {
+            //alert("寮�濮嬪伐浣�");
+            const that = this;
+            var guid1 = that.formData.guid;//涓昏〃id
+            return that.AxiosHttp("post", 'Ipqc/selIpqcItemsByGw', {
+                inOrderGuid1: guid1,
+                userAccount: that.userInfo.loginAccount,
+                gw: that.jyGw
+            }, false).then(res => {
+                var json = res;
+                if (json.status == 0) {
+                    that.init();//鍒锋柊
+                }
+                else {
+                    that.$toast.fail(json.message);
+                    that.$playSound('error');
+                    that.jyGw = "";
+                }
+                that.isLoading = false;
+                
+
+            }).catch(error => {
+                that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                console.error('Refresh error:', error);
+            });
+        },
+
+        //鎵弿宸ヤ綅
+        scanOnH5GW() {
+            let sendData = {
+                Type: 'Scan',
+                txtName: 'GW',
+                Barcode: '',
+                Detail: '',
+                Ip: '',
+                Port: '',
+            }
+            uni.webView.postMessage({
+                data: JSON.stringify(sendData)
+            })
+        },
+
+        //鎵弿宸ュ崟
+        scanOnH5DAA() {
+            let sendData = {
+                Type: 'Scan',
+                txtName: 'DAA',
+                Barcode: '',
+                Detail: '',
+                Ip: '',
+                Port: '',
+            }
+            uni.webView.postMessage({
+                data: JSON.stringify(sendData)
             })
         },
     }

--
Gitblit v1.9.3