From fbe0595485e2e7c0fde9c0d95f02e38b58e7b2d3 Mon Sep 17 00:00:00 2001
From: 南骏 池 <chiffly@163.com>
Date: 星期一, 05 五月 2025 10:39:36 +0800
Subject: [PATCH] 1.现场收料界面 2.界面优化

---
 H5/Js/PurchaseReturn.js |   93 +++++++++++++++++++---------------------------
 1 files changed, 38 insertions(+), 55 deletions(-)

diff --git a/H5/Js/PurchaseReturn.js b/H5/Js/PurchaseReturn.js
index 409bdfa..c103af5 100644
--- a/H5/Js/PurchaseReturn.js
+++ b/H5/Js/PurchaseReturn.js
@@ -14,7 +14,7 @@
                 quantity:0
             },
             formData: {},
-            tableData: [],
+            ItemDetail: [],
             codeTableData: [],
             itemOutNoList: [],
             itemOutNoStr: [],
@@ -35,6 +35,8 @@
             loginGuid: this.GetLoginInfor().loginGuid,
             loginAccount: this.GetLoginInfor().loginAccount,
         };
+        that.beginload();
+        //that.show = false;
     },
     methods: {
         getItemOutNo() {
@@ -64,6 +66,29 @@
                 });
 
         },
+        beginload() {
+            var that = this;
+
+            that.isLoading = true;
+            that.AxiosHttp("post", 'MesCgthSq/GetMesCgthSq', {
+            }, false)
+                .then(function (res) {
+                    var json = res;
+                    if (json.status == 0) {
+                        that.itemOutNoList = json.data.tbBillList;
+                    }
+                    else {
+                        that.$toast.fail(json.message);
+                    }
+                    that.isLoading = false;
+                })
+                .catch(function (error) {
+                    that.isLoading = false;
+                    that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
+                    console.log(error);
+                });
+
+        },
         onSelect(item) {
             // 榛樿鎯呭喌涓嬬偣鍑婚�夐」鏃朵笉浼氳嚜鍔ㄦ敹璧�
             // 鍙互閫氳繃 close-on-click-action 灞炴�у紑鍚嚜鍔ㄦ敹璧�
@@ -79,37 +104,15 @@
 
             this.getItem();
 
-            //var that = this;
-
-            //that.isLoading = true;
-            //that.AxiosHttp("post", 'MesInvItemOuts/GetPage', {
-            //    billNo: this.scanFormData.itemOutNo,
-            //    pageIndex: 1,
-            //    limit: 1,
-            //}, false)
-            //    .then(function (res) {
-            //        var json = res;
-            //        if (json.status == 0) {
-            //            that.formData = json.data.tbBillList[0];
-            //            that.formData.billTypeName = "鍑哄簱鍗�";
-
-            //            that.getScanBarcode();
-            //        }
-            //        else {
-            //            that.$toast.fail(json.message);
-            //        }
-            //        that.isLoading = false;
-            //    })
-            //    .catch(function (error) {
-            //        that.isLoading = false;
-            //        that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-            //        console.log(error);
-            //    });
-
         },
         getItem() {
             var that = this;
             that.isLoading = true;
+
+            let itemOut = this.itemOutNoList.filter(it => it.billNo == that.scanFormData.itemOutNo);
+
+            this.invItemOutId = itemOut[0].id;
+
             that.AxiosHttp("post", 'MesCgthSq/GetSumItem', {
                 id: that.invItemOutId,
                 billNo: that.scanFormData.itemOutNo,
@@ -118,45 +121,22 @@
                 .then(function (res) {
                     var json = res;
                     if (json.status == 0) {
-                        that.tableData = json.data.tbBillList.sumItem;
-                        that.scanFormData.itemNo = json.data.tbBillList.itemNo
-                        //that.scanFormData.quantity = json.data.tbBillList.quantity
-                        console.log(json);
+                        that.ItemDetail = json.data.tbBillList;
+                        that.$refs.barcode.focus();
                     }
                     else {
                         that.$toast.fail(json.message);
+                        that.ItemDetail = [];
                     }
                     that.isLoading = false;
                 })
                 .catch(function (error) {
                     that.isLoading = false;
                     that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-                    console.log(error);
+                    that.ItemDetail = [];
                 });
         },
-        //getScanBarcode() {
 
-        //    var that = this;
-        //    that.isLoading = true;
-        //    that.AxiosHttp("post", 'MesInvItemOuts/GetScanBarcode', {
-        //        id: that.formData.guid
-        //    }, false)
-        //        .then(function (res) {
-        //            var json = res;
-        //            if (json.status == 0) {
-        //                that.codeTableData = res.data.tbBillList;
-        //            }
-        //            else {
-        //                that.$toast.fail(json.message);
-        //            }
-        //            that.isLoading = false;
-        //        })
-        //        .catch(function (error) {
-        //            that.isLoading = false;
-        //            that.$toast.fail("缃戠粶閿欒锛岃閲嶈瘯锛�");
-        //            console.log(error);
-        //        });
-        //},
         SaveBarCodes() {
 
             //if (!this.scanFormData.barcode) {
@@ -180,10 +160,13 @@
                         //}
                         that.scanFormData.quantity = json.data.tbBillList.barcodeNum
                         that.getItem();
+                        that.$refs.barcode.focus();
+                        that.scanFormData.barcode = null;
                     }
                     else {
                         that.$toast.fail(json.message);
                         that.$refs.barcode.focus();
+                        that.scanFormData.barcode = null;
                     }
                     that.$notify({ type: 'success', message: json.message });
                     that.isLoading = false;

--
Gitblit v1.9.3