From 1758541a4f33c9ef269b9481d2b4322076702660 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期三, 09 四月 2025 10:48:14 +0800
Subject: [PATCH] 1.产品绑定

---
 H5/Js/Cpbd.js |   82 ++++++++--------------------------------
 1 files changed, 17 insertions(+), 65 deletions(-)

diff --git a/H5/Js/Cpbd.js b/H5/Js/Cpbd.js
index 4880535..ece0de9 100644
--- a/H5/Js/Cpbd.js
+++ b/H5/Js/Cpbd.js
@@ -56,40 +56,37 @@
                     that.Traceability = [];
                 });
         },
-        getScan() {
+        productBinding() {
             var that = this;
-            if (that.modeInfo.daa001.length <= 0) {
-                that.$toast.fail("宸ュ崟鍗曞彿涓嶈兘涓虹┖锛�");
+            if (that.ZsBar.length <= 0) {
+                that.$toast.fail("杩芥函鐮佷笉鑳戒负绌猴紒");
                 return;
             }
-            if (that.scanInfo.barcode.length * 1 <= 0) {
-                that.$toast.fail("鐗╂枡鏉$爜涓嶈兘涓虹┖锛�");
+            if (that.LsBar.length <= 0) {
+                that.$toast.fail("鍚庣洊鐮佷笉鑳戒负绌猴紒");
                 return;
             }
 
             that.isLoading = true;
-            that.AxiosHttp("post", 'Womdaa/ScanCode', {
-                daa001: that.modeInfo.daa001,
+            that.AxiosHttp("post", 'Womdaa/ProductBinding', {
+                ZsBar: that.ZsBar,
+                LsBar: that.LsBar,
                 userName: that.userInfo.loginAccount,
-                barcode: that.scanInfo.barcode,
             }, false)
                 .then(function (res) {
                     var json = res;
                     if (json.status == 0) {
                         // that.scanInfo = json.data.tbBillList;
                         that.$notify({ type: 'success', message: json.message });
-                        that.getModel();
-                        that.$refs.barcode.focus();
-                        that.scanInfo.barcode = null;
-                    }
-                    else if (json.status == 2) {
-                        that.$refs.splitNum.focus();
-                        that.scanInfo.splitNum = json.data.tbBillList.splitNum;
-                        that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum;
+                        that.$refs.ZsBar.focus();
+                        that.ZsBar = null;
+                        that.ZsBar = null;
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$refs.barcode.focus();
+                        that.$refs.ZsBar.focus();
+                        that.ZsBar = null;
+                        that.ZsBar = null;
                     }
                     
                     that.isLoading = false;
@@ -97,56 +94,11 @@
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    console.log(error);
-                    that.$refs.barcode.focus();
+                    that.$refs.ZsBar.focus();
+                    that.ZsBar = null;
+                    that.ZsBar = null;
                 });
         },
-        getChaiFen() {
-            //this.isPrinterPopupVisible = true; // 鏄剧ず寮圭獥
-
-            var that = this;
-            if (that.modeInfo.daa001.length <= 0) {
-                that.$toast.fail("宸ュ崟鍗曞彿涓嶈兘涓虹┖锛�");
-                return;
-            }
-            if (that.scanInfo.splitNum * 1 <= 0) {
-                that.$toast.fail("鎷嗗垎鏁伴噺涓嶈兘涓虹┖锛�");
-                return;
-            }
-            if (that.scanInfo.barcode.length * 1 <= 0) {
-                that.$toast.fail("鐗╂枡鏉$爜涓嶈兘涓虹┖锛�");
-                return;
-            }
-            that.isLoading = true;
-            that.AxiosHttp("post", 'Womdaa/ScanCodeCF', {
-                daa001: that.modeInfo.daa001,
-                userName: that.userInfo.loginAccount,
-                barcode: that.scanInfo.barcode,
-                Num: that.scanInfo.splitNum,
-            }, false)
-                .then(function (res) {
-                    var json = res;
-                    if (json.status == 0) {
-                        //  that.modeInfo = json.data.tbBillList;
-                        that.scanInfo.splitNum = null;
-                        that.scanInfo.barcodeNum = null;
-                        that.scanInfo.barcode = null;
-                        that.$notify({ type: 'success', message: json.message });
-                        that.$refs.barcode.focus();
-                        that.getModel();
-                    }
-                    else {
-                        that.$toast.fail(json.message);
-                    }
-                    that.isLoading = false;
-                })
-                .catch(function (error) {
-                    that.isLoading = false;
-                    that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    console.log(error);
-                });
-        },
-
         //鎵撳嵃鏈烘敞閲�
         //selectPrinter(printer) {
         //    this.selectedPrinter = printer.printerId; // 鏇存柊閫変腑鐨勬墦鍗版満缂栧彿

--
Gitblit v1.9.3