From ffd88d66e16c6c7a37135bb2631c3f1aa4b43e98 Mon Sep 17 00:00:00 2001
From: 啊鑫 <t2856754968@163.com>
Date: 星期三, 10 九月 2025 15:22:30 +0800
Subject: [PATCH] 111

---
 H5/Js/Scbl.js |  138 +++++++++++++++++++++++++++++++++++++--------
 1 files changed, 112 insertions(+), 26 deletions(-)

diff --git a/H5/Js/Scbl.js b/H5/Js/Scbl.js
index d407253..0f63308 100644
--- a/H5/Js/Scbl.js
+++ b/H5/Js/Scbl.js
@@ -16,10 +16,20 @@
             barcode: "",
             ItemBlDetail:[],
             modeInfo: [],
+            queryInfo: { dateTime: "", lineNo: "", lineName: "" },
             active: 0,
             show: false,
+            show1:false,
             actions: [],
+            actions1: [],
             ItemDetail: [],
+            minDate: new Date(new Date().getFullYear() - 1, 0, 1),  // 杩囧幓涓�骞�
+            maxDate: new Date(new Date().getFullYear() + 1, 11, 31), // 鏈潵涓�骞�
+            showScDatePicker: false,
+            tempDate: new Date(),
+            showDatePicker: false,
+            ItemBarKw: [],
+            currentIndex: -1, 
         }
     },
     mounted() {
@@ -32,16 +42,72 @@
         selectType = this.type == "bl" ? selectType = "鐢熶骇琛ユ枡" : selectType = "鐢熶骇瓒呴";
     },
     methods: {
+        handleRowClick(item, index) {
+            if (this.isLoading) {
+                return;
+            }
+
+            // 閲嶇疆鎵�鏈夎鐨勯�変腑鐘舵��
+            this.currentIndex = -1;
+
+            // 璁剧疆褰撳墠閫変腑琛�
+            this.currentIndex = index;
+            this.selItem = {
+                itemid: item.itemId,
+                index: index
+            };
+
+            console.log('褰撳墠閫変腑椤�:', this.selItem); // 璋冭瘯鐢�
+
+            this.GetBarKwByItem();
+        },
+        GetBarKwByItem() {
+
+            var that = this;
+            that.isLoading = true;
+            that.AxiosHttp("post", 'Womdaa/GetBarKwByItem', {
+                itemId: that.selItem.itemid,
+                userName: that.userInfo.loginAccount
+            }, false)
+                .then(function (res) {
+                    var json = res;
+                    if (json.status == 0) {
+                        that.ItemBarKw = json.data.tbBillList;
+                    }
+                    else {
+                        that.$toast.fail(json.message);
+                        that.$playSound('error');
+                        that.ItemBarKw = [];
+                    }
+                    that.isLoading = false;
+                })
+                .catch(function (error) {
+                    that.isLoading = false;
+                    that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                    that.$playSound('error');
+                    console.log(error);
+                    that.ItemBarKw = [];
+                });
+        },
+        formatDate(date) {
+            const d = new Date(date);
+            console.log(d);
+            return `${d.getFullYear()}-${(d.getMonth() + 1).toString().padStart(2, '0')}-${d.getDate().toString().padStart(2, '0')}`;
+        },
+        onDateConfirm(date) {
+            this.queryInfo.dateTime = this.formatDate(date);
+            this.showDatePicker = false;
+        },
         getInfo() {
             this.show = true;
 
             var that = this;
             that.isLoading = true;
 
-
-
             that.AxiosHttp("post", 'MesItemBl/GetSCBLBillNo', {
                 type: selectType,
+                dateTime: that.queryInfo.dateTime,
+                lineNo: that.queryInfo.lineNo
             }, false)
                 .then(function (res) {
                     var json = res;
@@ -56,14 +122,12 @@
                     }
                     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);
                 });
         },
@@ -77,10 +141,15 @@
             //this.$toast(item.name);
 
         },
+        onSelect1(actions1) {
+            this.queryInfo.lineNo = actions1.lineNo;
+            this.show1 = false;
+            this.queryInfo.lineName = actions1.name;
+        },
         GetMesItemBlDetailByBillNo() {
             var that = this;
             that.isLoading = true;
-            that.AxiosHttp("post", 'MesItemBl/GetMesItemWWBlDetailByBillNo', {
+            that.AxiosHttp("post", 'MesItemBl/GetMesItemBlDetailByBillNo', {
                 billNo: that.billNo,
                 type: selectType
             }, false)
@@ -89,12 +158,14 @@
                     if (json.status == 0) {
                         that.ItemDetail = json.data.tbBillList;
                         that.daa001 = json.data.tbBillList.daa001;
+                        console.log(json.data.tbBillList.daa001);
+                        console.log(json.data.tbBillList.items);
                         that.$refs.barcode.focus();
-                        that.$playSound('success');
+                        that.currentIndex = -1;
+                        that.ItemBarKw = [];
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$playSound('error');
                         that.$refs.billNo.focus();
                         that.billNo = "";
                         that.daa001 = "";
@@ -105,12 +176,39 @@
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    that.$playSound('error');
                     //console.log(error);
                     tthat.$refs.billNo.focus();
                     that.billNo = "";
                     that.daa001 = "";
                     that.ItemBlDetail = [];
+                });
+        },
+        getLineInfo() {
+            var that = this;
+            that.show1 = true;
+            that.actions = [];
+            that.isLoading = true;
+            that.AxiosHttp("post", 'MesItemBl/GetLineInfo', {
+                selectLine: that.selectLine
+            }, false)
+                .then(function (res) {
+                    var json = res;
+                    console.log(json);
+                    if (json.status == 0 && json.data.tbLineInfo.length > 0) {
+                        that.actions1 = json.data.tbLineInfo.map(item => ({
+                            name: item.lineName,
+                            lineNo: item.lineNo
+                        }));
+                    } else {
+                        that.$toast.fail("娌℃湁鍙敤鐨勬暟鎹�");
+                        that.$playSound('error');
+                    }
+                    that.isLoading = false;
+                })
+                .catch(function () {
+                    that.isLoading = false;
+                    that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                    that.$playSound('error');
                 });
         },
         getBarcode() {
@@ -126,28 +224,24 @@
 
             if (!that.userInfo.loginAccount) {
                 this.$toast.fail("璇烽噸鏂版鏌ョ櫥褰曠姸鎬�");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.barcode) {
                 this.$toast.fail("鏉$爜涓嶈兘涓虹┖");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.billNo) {
                 this.$toast.fail("琛ユ枡鍗曞彿涓嶈兘涓虹┖");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.daa001) {
                 this.$toast.fail("宸ュ崟鍙蜂笉鑳戒负绌�");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
@@ -169,7 +263,6 @@
                         that.num = null;
                         //that.ItemBlDetail = json.data.tbBillList.item2
                         that.$notify({ type: 'success', message: '鎵弿鎴愬姛' });
-                        that.$playSound('success');
                         that.GetMesItemBlDetailByBillNo();
                         that.$refs.barcode.focus();
                         that.barcode = "";
@@ -178,14 +271,12 @@
                         
 
                     } else if (json.status == 2) {
-                        that.$playSound('error');
                         that.$refs.splitNum.focus();
                         that.splitNum = json.data.cfNum;
                         that.num = json.data.num;
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$playSound('error');
                         that.$refs.barcode.focus();
                         that.barcode = "";
                         that.num = "";
@@ -195,7 +286,6 @@
                 })
                 .catch(function (error) {
                     that.isLoading = false;
-                    that.$playSound('error');
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
                     //console.log(error);
                     that.$refs.barcode.focus();
@@ -212,35 +302,30 @@
 
             if (!that.userInfo.loginAccount) {
                 this.$toast.fail("璇烽噸鏂版鏌ョ櫥褰曠姸鎬�");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.barcode) {
                 this.$toast.fail("鏉$爜涓嶈兘涓虹┖");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.billNo) {
                 this.$toast.fail("琛ユ枡鍗曞彿涓嶈兘涓虹┖");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.daa001) {
                 this.$toast.fail("宸ュ崟鍙蜂笉鑳戒负绌�");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
 
             if (!that.splitNum) {
                 this.$toast.fail("鍙戣揣鏁伴噺涓嶈兘涓虹┖");
-                that.$playSound('error');
                 that.isLoading = false;
                 return;
             }
@@ -257,17 +342,19 @@
                     var json = res;
                     if (json.status == 0) {
                         that.ItemBlDetail = json.data.pendingList;
-                        that.$notify({ type: 'success', message: '鎵弿鎴愬姛' });
-                        that.$playSound('success');
-                        that.$refs.barcode.focus();
                         that.barcode = "";
                         that.num = "";
                         that.splitNum = "";
+                        that.$notify({ type: 'success', message: json.message });
+                        that.$playSound('success');
                         that.GetMesItemBlDetailByBillNo();
+                        //that.sendMessage(json.data.tbBillList);
+                        that.sendPrintMessage(json.data.tbBillList);
+
+                        that.$refs.barcode.focus();
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$playSound('error');
                         that.$refs.barcode.focus();
                     }
                     that.isLoading = false;
@@ -275,7 +362,6 @@
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    that.$playSound('error');
                     //console.log(error);
                     that.$refs.barcode.focus();
                     that.barcode = "";

--
Gitblit v1.9.3