From 52dbfd767f2485a1d615c5d9db50d648a1d8214a Mon Sep 17 00:00:00 2001
From: wbc <2597324127@qq.com>
Date: 星期二, 23 十二月 2025 23:56:58 +0800
Subject: [PATCH] 生产报工模糊查询

---
 H5/Js/Dbck.js |   88 ++++++++++++++++++++++++++++++++++----------
 1 files changed, 68 insertions(+), 20 deletions(-)

diff --git a/H5/Js/Dbck.js b/H5/Js/Dbck.js
index 930b51a..37e9047 100644
--- a/H5/Js/Dbck.js
+++ b/H5/Js/Dbck.js
@@ -11,8 +11,14 @@
             num: "",
             fum: "",
             billNo: "",
-            barcode:"",
-            ItemBlDetail:[],
+            barcode: "",
+
+            ItemBlDetail: [], // 寰呮壂
+            ItemYsDetail: [], // 宸叉壂
+            ItemDetail: [],
+            ItemBarKw: [],
+            currentIndex: -1,
+
             modeInfo: [],
             active: 0,
             show: false,
@@ -29,6 +35,56 @@
         };
     },
     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();
+            //this.active = 1;            //鑷姩鍒囨崲鍒板簱浣嶅垪琛╰ab
+        },
+        GetBarKwByItem() {
+
+            var that = this;
+            that.isLoading = true;
+            that.AxiosHttp("post", 'Womdaa/GetBarKwByItemCK', {
+                itemId: that.selItem.itemid,
+                userName: that.userInfo.loginAccount,
+                type: 'DBCK',//璋冩嫧鍑哄簱
+                billNo: that.billNo
+            }, 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 = [];
+                });
+        },
         getInfo() {
             this.show = true;
 
@@ -45,21 +101,18 @@
                             that.$toast.fail("娌℃湁鎵惧埌鍙互閫夋嫨鐨勫嚭搴撳崟鍙�");
                         }
 
-
                         that.actions = json.data.tbBillList.map(item => {
                             return { name: item }
                         });
                     }
                     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);
                 });
         },
@@ -74,6 +127,8 @@
             this.show = false;
 
             this.billNo = item.name;
+            // 娓呯┖搴撲綅鍒楄〃
+            this.ItemBarKw = [];
             this.GetMesItemBlDetailByBillNo();
             //this.$toast(item.name);
 
@@ -87,14 +142,18 @@
                 .then(function (res) {
                     var json = res;
                     if (json.status == 0) {
-                        that.ItemDetail = json.data.tbBillList;
-                        that.$playSound('success');
+                        //that.ItemDetail = json.data.tbBillList;
+                        var tbBillList = json.data.tbBillList || {};
+                        that.ItemBlDetail = tbBillList.blDetails || []; // 寰呮壂
+                        that.ItemYsDetail = tbBillList.ysDetails || []; // 宸叉壂
                         that.$refs.barcode.focus();
                         that.barcode = "";
+                        // 閲嶇疆搴撲綅鏌ヨ涓墍鏈夎鐨勯�変腑鐘舵��
+                        that.currentIndex = -1;
+                        that.ItemBarKw = [];
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$playSound('error');
                         that.$refs.billNo.focus();
                         that.billNo = "";
                         that.ItemDetail = null;
@@ -104,7 +163,6 @@
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    that.$playSound('error');
                     that.$refs.billNo.focus();
                     that.billNo = "";
                     that.ItemBlDetail = null;
@@ -120,21 +178,18 @@
 
             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;
             }
@@ -153,8 +208,7 @@
                         ////that.fum = json.data.form.fum;
                         //that.ItemBlDetail = json.data.items
                         that.$notify({ type: 'success', message: '鎵爜鎴愬姛' });
-                        that.$playSound('success');
-
+                        that.$toast.success("鎵弿鎴愬姛");
                         that.$refs.barcode.focus();
                         that.barcode = "";
                         //that.GetMesItemBlDetailByBillNo();
@@ -162,14 +216,12 @@
                     }
                     else if (json.status == 2) {
                         that.itemNo = json.data.tbBillList.itemNo;
-                        that.$playSound('error');
                         that.$refs.splitNum.focus();
                         that.scanInfo.splitNum = json.data.tbBillList.splitNum;
                         that.scanInfo.barcodeNum = json.data.tbBillList.barcodeNum;
                     }
                     else {
                         that.$toast.fail(json.message);
-                        that.$playSound('error');
                         that.$refs.barcode.focus();
                         that.barcode = "";
                     }
@@ -178,7 +230,6 @@
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    that.$playSound('error');
                     //console.log(error);
                     that.$refs.barcode.focus();
                     that.barcode = "";
@@ -194,17 +245,14 @@
             var that = this;
             if (that.billNo.length <= 0) {
                 that.$toast.fail("鐢宠鍗曞彿涓嶈兘涓虹┖锛�");
-                that.$playSound('error');
                 return;
             }
             if (that.scanInfo.splitNum * 1 <= 0) {
                 that.$toast.fail("鎷嗗垎鏁伴噺涓嶈兘涓虹┖锛�");
-                that.$playSound('error');
                 return;
             }
             if (that.barcode.length * 1 <= 0) {
                 that.$toast.fail("鐗╂枡鏉$爜涓嶈兘涓虹┖锛�");
-                that.$playSound('error');
                 return;
             }
             //that.ip = "";

--
Gitblit v1.9.3