From 69efa794fed691aeb990325aa9ed2309f6ff8c10 Mon Sep 17 00:00:00 2001
From: cnf <3283105747@qq.com>
Date: 星期三, 10 十二月 2025 09:26:39 +0800
Subject: [PATCH] 工控报工修改

---
 BaoGong/js/fjByPrd.js |  254 ++++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 223 insertions(+), 31 deletions(-)

diff --git a/BaoGong/js/fjByPrd.js b/BaoGong/js/fjByPrd.js
index d27d938..03732f4 100644
--- a/BaoGong/js/fjByPrd.js
+++ b/BaoGong/js/fjByPrd.js
@@ -7,40 +7,37 @@
             showBgr: false,//鎶ュ伐浜�
             showAction: false,//鍙充笂瑙�
             modelDaaJson: [],
-            modelYgJson:[],
+            modelYgJson: [],
             modelJson: [],
-            actions: [{ name: '寮�宸�' }, { name: '鏆傚仠' }, { name: '鎻愪氦棣栨' }, { name: '鎻愪氦鍏ュ簱妫�' }],
+            actions: [{ name: '鍒锋柊' }, { name: '寮�宸�' }, { name: '鏆傚仠' }, { name: '鎻愪氦棣栨' }, { name: '鎻愪氦鍏ュ簱妫�' }],
             erd: null,
             tableHeight: 1,
             searchHeight: 1,
             fjInfor: {
-                guid:"",
-                gdbh: "PPBOM00015331-1",
-                bgUserNo: "鍒樼涓�",
-                "gdzs": "500",
-                "yscs": "20",
-                "yrks": "20",
-                "kdysl": "480",//鍙墦鍗版暟閲�
-                "gdzt": "鐢熶骇涓�",
-                "prdName": "濉戜欢-XQJ-001-姘寸",
-                "prdNo": "011616000382",
-                "prdModel": "妯″唴娉ㄥ 楦挎晥鐢佃剳鏉夸笓鐢�",
-                "qt": "榻愬",
-                "yjkg": "2025-09-27 16:36:28.003",
-                "yjwg": "2025-09-27 16:36:28.003",
-                "xsdd": "salw123",
-                "ydsl": "20",//宸叉墦鏁伴噺
-                "sj": "鍚堟牸",
-                "xj": "鍚堟牸",
-                "sysl": "400",
-                "dyzs": "0", //鎵撳嵃寮犳暟
-                list: [
-                      { bg: 1, rk: 1, tbm: 'TB25111827361', nbzsl: 48, dw: '涓�', itemNo: "060101030301", itemName: '鍗板埛鍝�-鍔熺巼璐�-New General', bgr: '鍒樼涓�', bgrDate: '2025-11-26 13:24:25' }
-                    , { bg: 0, rk: 0, tbm: 'TB25111827361', nbzsl: 48, dw: '涓�', itemNo: "060101030301", itemName: '鍗板埛鍝�-鍔熺巼璐�-New General', bgr: '鍒樼涓�', bgrDate: '2025-11-26 13:24:25' }
-                    , { bg: 1, rk: 1, tbm: 'TB25111827361', nbzsl: 48, dw: '涓�', itemNo: "060101030301", itemName: '鍗板埛鍝�-鍔熺巼璐�-New General', bgr: '鍒樼涓�', bgrDate: '2025-11-26 13:24:25' }
-                    , { bg: 0, rk: 0, tbm: 'TB25111827361', nbzsl: 48, dw: '涓�', itemNo: "060101030301", itemName: '鍗板埛鍝�-鍔熺巼璐�-New General', bgr: '鍒樼涓�', bgrDate: '2025-11-26 13:24:25' }
-                ]
+                guid: "",
+                gdbh: "",
+                bgUserNo: "",
+                "gdzs": "",
+                "yscs": "",
+                "yrks": "",
+                "kdysl": "",//鍙墦鍗版暟閲�
+                "gdzt": "",
+                "prdName": "",
+                "prdNo": "",
+                "prdModel": "",
+                "qt": "",
+                "yjkg": "",
+                "yjwg": "",
+                "xsdd": "",
+                "ydsl": "",//宸叉墦鏁伴噺
+                "sj": "",
+                "xj": "",
+                "dyzs": "", //鎵撳嵃寮犳暟
+                "yssj": 0,
+                "bzsl": 1,//鍖呰鏁伴噺
+                list: []
             },
+            isButtonDisabled: true,
         }
     },
     computed: {
@@ -61,10 +58,26 @@
         })
     },
     methods: {
+        //鍒囨崲鐧诲綍璐﹀彿
+        onClickLogin() {
+            var that = this;
+            that.$dialog.confirm({
+                title: '鍙嬫儏鎻愰啋',
+                message: '纭畾鍒囨崲璐﹀彿鍚楋紵',
+            })
+                .then(() => {
+                    window.location.href = ("/BaoGong/fjLogin.aspx?math=" + Math.random() + "&cjId=" + that.Request("cjId"));
+                })
+                .catch(() => {
+                    // on cancel
+                });
+        },
+        //杩斿洖
         onClickLeft() {
             var that = this;
             window.location.href = ("/BaoGong/fjDefault.aspx?cjId=" + that.Request("cjId"));
         },
+        //璇诲彇宸ュ崟鍒楄〃
         getDaaList() {
             var that = this;
             that.showDaa = true;
@@ -81,12 +94,13 @@
                         that.modelDaaJson = res.rtnData;
                     }
                     else {
-                        that.$message.error(json.rtnMsg);
+                        that.$toast.fail(json.rtnMsg);
                     }
                 })
                 .catch(function (error) {
                 });
         },
+        //璇诲彇鍛樺伐鍒楄〃
         getYgList() {
             var that = this;
             that.showBgr = true;
@@ -104,12 +118,13 @@
                         that.modelYgJson = res.rtnData;
                     }
                     else {
-                        that.$message.error(json.rtnMsg);
+                        that.$toast.fail(json.rtnMsg);
                     }
                 })
                 .catch(function (error) {
                 });
         },
+        //璇诲彇宸ュ崟淇℃伅
         getDaa(daaGuid) {
             var that = this;
             that.isLoading = true;
@@ -124,18 +139,195 @@
                         that.isLoading = false;
                         that.fjInfor = res.rtnData;
                         that.showDaa = false;
+                        that.djsReset();
                     }
                     else {
-                        that.$message.error(json.rtnMsg);
+                        that.$toast.fail(json.rtnMsg);
                     }
                 })
                 .catch(function (error) {
                 });
         },
+        //璇诲彇鎶ュ伐浜哄垪琛�
         getBgr(item) {
             var that = this;
             that.fjInfor.bgUserNo = item.ygName;
             that.showBgr = false;
+        },
+        //閫夋嫨宸ュ崟鎿嶄綔琛屼负
+        onSelect(item) {
+            var that = this;
+            var actName = item.name;
+            that.$dialog.confirm({
+                title: '鍙嬫儏鎻愰啋',
+                message: '褰撳墠宸ュ崟鍙锋槸銆�' + that.fjInfor.gdbh + '銆戠‘瀹�' + actName + '鍚楋紵',
+            })
+                .then(() => {
+                    that.onSelectSubmit(actName);
+                })
+                .catch(() => {
+                    // on cancel
+                });
+
+        },
+        //宸ュ崟鎿嶄綔鎻愪氦
+        onSelectSubmit(actName) {
+            var that = this;
+            var _daaGuid = that.fjInfor.guid;
+            if (_daaGuid.length <= 0) {
+                that.$toast.fail("璇烽�夋嫨宸ュ崟");
+                return;
+            }
+            var _inFieldValue = "";
+            var model = {
+                guid: "",
+                inFieldValue: "",
+            }
+            var _apiUrl = ('');
+            switch (actName) {
+                case '鍒锋柊':
+                    that.getDaa(_daaGuid);
+                    return;
+                    break;
+                case '寮�宸�':
+                    _inFieldValue = 8;
+                    var model = {
+                        guid: _daaGuid,
+                        inFieldValue: _inFieldValue,
+                    }
+                    var _apiUrl = ('WomdaaManager/EditModelSubmit');
+                    break;
+                case '鏆傚仠':
+                    _inFieldValue = 2;
+                    var model = {
+                        guid: _daaGuid,
+                        inFieldValue: _inFieldValue,
+                    }
+                    var _apiUrl = ('WomdaaManager/EditModelSubmit');
+                    break;
+                case '鎻愪氦棣栨':
+                    _inFieldValue = 98;
+                    var model = {
+                        guid: _daaGuid,
+                        inFieldValue: "",
+                    }
+                    var _apiUrl = ('WomdaaManager/EditModelSubmitShouJian');
+                    break;
+                case '鎻愪氦鍏ュ簱妫�':
+                    alert("涓嶇煡閬撳叆搴撴鎺ュ彛");
+                    //_inFieldValue = 99;
+                    //var model = {
+                    //    guid: _daaGuid,
+                    //    inFieldValue: "",
+                    //}
+                    //var _apiUrl = ('WomdaaManager/EditModelSubmitShouJian');
+                    break;
+            };
+            that.isLoading = true;
+            that.AxiosHttp("post", _apiUrl, model)
+                .then(function (res) {
+                    var json = res;
+                    if (json.rtnCode * 1 > 0) {
+                        that.isLoading = false;
+                        that.$dialog.alert({
+                            title: '鍙嬫儏鎻愮ず',
+                            message: json.rtnData.outMsg,
+                        }).then(() => {
+                            that.getDaa(_daaGuid);
+                        });
+                    }
+                    else {
+                        that.$toast.fail(json.rtnMsg);
+                    }
+                })
+                .catch(function (error) {
+                });
+        },
+        //鍊掕鏃跺紑濮�
+        djsReset() {
+            this.isButtonDisabled = true;
+            this.$refs.countDown.reset();
+        },
+        //鍊掕鏃剁粨鏉�
+        djsFinish() {
+            this.isButtonDisabled = false;
+        },
+        //鎵撶爜鎶ュ伐
+        onBaoGongSubmit() {
+            var that = this;
+            var _daaGuid = that.fjInfor.guid;
+            if (_daaGuid.length <= 0) {
+                that.$toast.fail("璇烽�夋嫨宸ュ崟");
+                return;
+            }
+            var _bzsl = that.fjInfor.bzsl * 1;
+            if (_bzsl * 1 <= 0) {
+                that.$toast.fail("璇风‘瀹氬寘瑁呮暟閲�");
+                return;
+            }
+            var _dyzs = that.fjInfor.dyzs * 1;
+            if (_dyzs * 1 <= 0) {
+                that.$toast.fail("璇风‘瀹氭墦鍗板紶鏁�");
+                return;
+            }
+            var model = {
+                inDaaGuid: _daaGuid,
+                bzsl: _bzsl,
+            }
+            var _apiUrl = ('BaoGong/DaaDmbg');
+            that.isLoading = true;
+            that.$dialog.confirm({
+                title: '鍙嬫儏鎻愰啋',
+                message: '褰撳墠宸ュ崟鍙锋槸銆�' + that.fjInfor.gdbh + '銆戠‘瀹氭墦鐮佹姤宸ュ悧锛�',
+            })
+                .then(() => {
+                    /////////////////////////////////////////
+                    that.AxiosHttp("post", _apiUrl, model)
+                        .then(function (res) {
+                            var json = res;
+                            if (json.rtnData.barcodeGuid.length > 0) {
+                                that.isLoading = false;
+                                that.$dialog.alert({
+                                    title: '鍙嬫儏鎻愮ず',
+                                    message: json.rtnData.outMsg,
+                                }).then(() => {
+                                    var tbm = json.rtnData.barcode;//鏉$爜
+                                    var barcodeGuid = json.rtnData.barcodeGuid; //鏉$爜guid
+                                    that.print2({ guid: barcodeGuid, tbm: tbm },0)
+                                    that.getDaa(_daaGuid);
+                                });
+                            }
+                            else {
+                                that.$toast.fail(json.rtnData.outMsg);
+                            }
+                        })
+                        .catch(function (error) {
+                        });
+                    //////////////////////////////////////////
+                })
+                .catch(() => {
+                    // on cancel
+                });
+        },
+        print2(obj,isDia) {
+            var that = this;
+            var barcodeGuid = obj.guid;//鏉$爜鏄庣粏guid
+            var tbm = obj.tbm;//鏉$爜
+            if (isDia * 1 == 1) {
+                that.$dialog.confirm({
+                    title: '鍙嬫儏鎻愰啋',
+                    message: '浣犻�夋嫨浜嗘嫋鏉跨爜銆�' + tbm + '銆戠‘瀹氶噸鏂版墦鍗板悧锛�',
+                })
+                    .then(() => {
+                        googleBrower.printLabel(that.fjInfor.guid, barcodeGuid);
+                    })
+                    .catch(() => {
+                        // on cancel
+                        return;
+                    });
+                return;
+            }
+            googleBrower.printLabel(that.fjInfor.guid, barcodeGuid);
         }
     },
 })
\ No newline at end of file

--
Gitblit v1.9.3