From 70ddea1608c8402a429baf69ed03028dae9c8f87 Mon Sep 17 00:00:00 2001
From: 快乐的昕的电脑 <快乐的昕的电脑@DESKTOP-C2BQPQU>
Date: 星期一, 22 九月 2025 15:10:22 +0800
Subject: [PATCH] 1.受托退料:优化,添加成功声音、拆分后打印、退料后刷新库位列表。2.受托入库:列表查询与选择改为存储过程,添加成功声音

---
 H5/Js/Sttl.js |   98 +++++++++++++++++++++++++++++++++++++++++++------
 1 files changed, 86 insertions(+), 12 deletions(-)

diff --git a/H5/Js/Sttl.js b/H5/Js/Sttl.js
index c8117c2..ace746b 100644
--- a/H5/Js/Sttl.js
+++ b/H5/Js/Sttl.js
@@ -14,11 +14,16 @@
             selectType: "",
             daa001: "",
             barcode: "",
-            ItemBlDetail:[],
             modeInfo: [],
             active: 0,
             show: false,
             actions: [],
+            ItemBlDetail: [], // 寰呮壂
+            ItemYsDetail: [], // 宸叉壂
+            ItemTblDetail: [],
+            ItemDetail: [],
+            ItemBarKw: [],
+            currentIndex: -1,
         }
     },
     mounted() {
@@ -29,6 +34,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: 'STCK',//鍙楁墭閫�鏂�/鍙楁墭鍑哄簱
+                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;
@@ -65,7 +120,7 @@
         //onClick(index, title) {
         //    this.$toast(`${index} ${title}`);
         //    this.$notify({ type: 'success', message: '鏌愭煇鐗╂枡鎵爜鎴愬姛鏌愭煇鐗╂枡鎵爜鎴愬姛鏌愭煇鐗╂枡鎵爜鎴愬姛鏌愭煇鐗╂枡鎵爜鎴愬姛' });
-
+        //that.$playSound('success');
         //},
         onSelect(item) {
             // 榛樿鎯呭喌涓嬬偣鍑婚�夐」鏃朵笉浼氳嚜鍔ㄦ敹璧�
@@ -73,6 +128,8 @@
             this.show = false;
 
             this.billNo = item.name;
+            // 娓呯┖搴撲綅鍒楄〃
+            this.ItemBarKw = [];
             this.GetMesItemDetailByBillNo();
             //this.$toast(item.name);
 
@@ -87,8 +144,10 @@
                 .then(function (res) {
                     var json = res;
                     if (json.status == 0) {
-                        that.ItemBlDetail = json.data.tbBillList;
-                        //that.daa001 = json.data.tbBillList.item1;
+                        //that.ItemBlDetail = json.data.tbBillList;
+                        var tbBillList = json.data.tbBillList || {};
+                        that.ItemBlDetail = tbBillList.blDetails || []; // 寰呮壂
+                        that.ItemYsDetail = tbBillList.ysDetails || []; // 宸叉壂
                         that.$refs.barcode.focus();
                     }
                     else {
@@ -146,6 +205,7 @@
                 userName: that.userInfo.loginAccount,
                 barcode: that.barcode,
                 daa001: that.billNo,
+                billNo: that.billNo,
                 //type: selectType
             }, false)
                 .then(function (res) {
@@ -157,17 +217,27 @@
                         that.num = null;
                         //that.ItemBlDetail = json.data.tbBillList.item2
                         that.$notify({ type: 'success', message: '鎵弿鎴愬姛' });
+                        that.$playSound('success');
                         that.GetMesItemDetailByBillNo();
                         that.$refs.barcode.focus();
                         that.barcode = "";
                         that.num = "";
                         that.splitNum = "";
+                        that.GetBarKwByItem();                        // 閫�鏂欏悗鍒锋柊搴撲綅
                         
 
                     } else if (json.status == 2) {
+                        //浣跨敤tbBillList
+                        //that.$refs.splitNum.focus();
+                        //that.splitNum = json.data.cfNum;
+                        //that.num = json.data.num;
                         that.$refs.splitNum.focus();
-                        that.splitNum = json.data.cfNum;
-                        that.num = json.data.num;
+                        that.splitNum = json.data.tbBillList.splitNum; // 鎷嗗垎鏁伴噺
+                        that.num = json.data.tbBillList.barcodeNum;    // 鏉$爜鏁伴噺
+                        that.daa001 = json.data.tbBillList.daa001;     // 宸ュ崟鍙�
+                        if (json.data.tbBillList.billNo) {
+                            that.billNo = json.data.tbBillList.billNo;
+                        }     // 鍙戣揣閫氱煡鍗曞彿锛屽彧鍦ㄦ湁鍊兼椂璧嬪��
                     }
                     else {
                         that.$toast.fail(json.message);
@@ -212,11 +282,11 @@
                 return;
             }
 
-            if (!that.daa001) {
-                this.$toast.fail("宸ュ崟鍙蜂笉鑳戒负绌�");
-                that.isLoading = false;
-                return;
-            }
+            //if (!that.daa001) {
+            //    this.$toast.fail("宸ュ崟鍙蜂笉鑳戒负绌�");
+            //    that.isLoading = false;
+            //    return;
+            //}
 
             if (!that.splitNum) {
                 this.$toast.fail("鍙戣揣鏁伴噺涓嶈兘涓虹┖");
@@ -227,7 +297,8 @@
             that.AxiosHttp("post", 'MesSttl/SplitBarcode', {
                 userName: that.userInfo.loginAccount,
                 barcode: that.barcode,
-                daa001: that.billNo,
+                daa001: that.daa001,
+                billNo: that.billNo,
                 num: that.splitNum,
                 //type: selectType
             }, false)
@@ -236,11 +307,14 @@
                     if (json.status == 0) {
                         that.ItemBlDetail = json.data.pendingList;
                         that.$notify({ type: 'success', message: '鎵弿鎴愬姛' });
+                        that.$playSound('success');
+                        that.sendPrintMessage(json.data.tbBillList);//鎵撳嵃
                         that.$refs.barcode.focus();
                         that.barcode = "";
                         that.num = "";
                         that.splitNum = "";
                         that.GetMesItemDetailByBillNo();
+                        that.GetBarKwByItem();// 閫�鏂欏悗鍒锋柊搴撲綅
                     }
                     else {
                         that.$toast.fail(json.message);

--
Gitblit v1.9.3