From 0f2a50a37b68e9c3166bd4f31fbc3b779cea448b Mon Sep 17 00:00:00 2001
From: 陈婷婷 <506607603@qq.com>
Date: 星期五, 23 一月 2026 09:22:13 +0800
Subject: [PATCH] 出运单修复

---
 src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue |  174 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 1 files changed, 168 insertions(+), 6 deletions(-)

diff --git a/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue b/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue
index 9ded270..524f878 100644
--- a/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue
+++ b/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue
@@ -114,8 +114,32 @@
       </el-collapse>
     </el-form>
     <el-row :gutter="10" class="mb8" style="margin-top: 10px;">
+      <!-- <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDrop">鍒犻櫎
+        </el-button>
+      </el-col> -->
       <el-col :span="1.5">
-        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete">鍒犻櫎
+        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete(0)">浣滃簾
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete(1)">鍙嶄綔搴�
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" @click="handleBatchDelete(0)">鎵归噺浣滃簾
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" @click="handleBatchDelete(1)">鎵归噺鍙嶄綔搴�
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" @click="handleBatchLosingBar(0)">鏉$爜瀹炵墿涓㈠け鎵归噺鏍囪
+        </el-button>
+      </el-col>
+      <el-col :span="1.5">
+        <el-button type="primary" icon="el-icon-delete" size="mini" @click="handleBatchLosingBar(1)">鏉$爜瀹炵墿涓㈠け鎵归噺鍙嶆爣璁�
         </el-button>
       </el-col>
       <el-col :span="1.5">
@@ -340,7 +364,7 @@
     
     //#region 鍔犺浇缁勭粐涓嬫媺鍒楄〃鏁版嵁
     fetchData() {
-      axios.get(this.baseURL + "/Web/GetOrganizations", {
+      axios.get(this.$baseUrl + "/Web/GetOrganizations", {
       }).then(response => {
         if (response.data.count == 1) {
           this.organizationList = response.data.data;//缁勭粐鍒楄〃
@@ -454,7 +478,7 @@
       if (this.queryParams.HBarCode) {
         this.sWhere += " and 鏉$爜缂栧彿 like ''%" + this.queryParams.HBarCode + "%''";
       }
-      if (this.queryParams.HSupName) {
+      if (this.queryParams.HSourceBillNo) {
         this.sWhere += " and 婧愬崟鍗曞彿 like ''%" + this.queryParams.HSourceBillNo + "%''";
       }
       if (this.queryParams.HMaterNumber) {
@@ -466,6 +490,12 @@
       if (this.queryParams.HOrgID) {
         this.sWhere += " and HStockOrgID = ''" + this.queryParams.HOrgID + "''";
       }
+
+      //濡傛灉鏄嚜鍔ㄧ櫥褰曪紝鍒欏彧鑳芥煡鐪嬩緵搴斿晢鑷繁鐨勬潯鐮併��
+      if (sessionStorage["HAutoLogin"] == "1") {
+        this.sWhere += " and HSupID = ''" + sessionStorage["HUserName"] + "''";
+      }
+
       this.getList()
     },
     //#endregion
@@ -480,7 +510,7 @@
       this.loading = true
       
       // 鍒楄〃鏌ヨ
-      axios.get(this.baseURL + '/Gy_BarCodeBillList/page', {
+      axios.get(this.$baseUrl + '/Gy_BarCodeBillList/page', {
         params: {
           "sWhere": this.sWhere,
           "user": sessionStorage["HUserName"],
@@ -560,7 +590,139 @@
     //#endregion
 
     //#region 鍒犻櫎
-    handleDelete() {
+    handleDrop() {
+    },
+    //#endregion
+
+    //#region 浣滃簾
+    handleDelete(num) {
+      if (this.checkDataList.length != 1) {
+        this.$modal.msgError("璇烽�夋嫨涓�琛屾暟鎹�");
+      } else {
+        // this.rowSel = [];
+        // for (var i = 0; i < this.checkDataList.length; i++) {
+        //   this.rowSel.push(this.checkDataList[i].HItemID.toString());
+        // }
+
+        var HInterID = this.checkDataList[0].HItemID;
+        // 鍒楄〃鏌ヨ
+        axios.get(this.$baseUrl + '/Gy_BarCodeBillList/DeleteGy_BarCodeBillList', {
+          params: {
+            "HInterID": HInterID,
+            "IsAudit": num,
+            "CurUserName": sessionStorage["HUserName"],
+          },
+        }).then(response => {
+          let data1 = response.data
+          if (data1.count == 1) {
+            this.handleQuery();
+          }else{
+            this.$modal.msgError(data1.Message);
+          }
+        }).catch(error => {
+          this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+        });
+      }
+    },
+    //#endregion
+
+    //#region 鎵归噺浣滃簾
+    handleBatchDelete(num) {
+      if (this.checkDataList.length == 0) {
+        this.$modal.msgError("璇烽�夋嫨鏁版嵁");
+      } 
+      else if(this.checkDataList.length >100){
+        this.$modal.msgError("閫夋嫨鏁版嵁涓嶅彲澶т簬100鏉★紒");
+      }
+      else {
+        var HInterIDListStr = "";
+        for(var i=0;i<this.checkDataList.length;i++){
+          if(i==this.checkDataList.length-1){
+            HInterIDListStr += this.checkDataList[i].hmainid.toString();
+          }else{
+            HInterIDListStr += this.checkDataList[i].hmainid.toString() + ",";
+          }
+        }
+        // 鍒楄〃鏌ヨ
+        axios.get(this.$baseUrl + '/Gy_BarCodeBillList/DeleteBatchGy_BarCodeBillList', {
+          params: {
+            "HInterID": HInterIDListStr,
+            "IsAudit": num,
+            "CurUserName": sessionStorage["HUserName"],
+          },
+        }).then(response => {
+          let data1 = response.data
+          if (data1.count == 1) {
+            this.handleQuery();
+          }else{
+            this.$modal.msgError(data1.Message);
+          }
+        }).catch(error => {
+          this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
+        });
+      }
+    },
+    //#endregion
+
+    //#region 鏉$爜瀹炵墿涓㈠け鎵归噺 鏍囪/鍙嶆爣璁�
+    handleBatchLosingBar(num) {
+      if (this.checkDataList.length == 0) {
+        this.$modal.msgError("璇烽�夋嫨鏁版嵁");
+      } 
+      else if(this.checkDataList.length >100){
+        this.$modal.msgError("閫夋嫨鏁版嵁涓嶅彲澶т簬100鏉★紒");
+      }
+      else {
+        var HInterIDListStr = "";
+        for(var i=0;i<this.checkDataList.length;i++){
+          if(num == 0 && this.checkDataList[i]["鏉$爜鐘舵��"]!="姝e父"){
+            this.$message.error('鏉$爜銆�' + this.checkDataList[i]["鏉$爜缂栧彿"] + "銆戯細褰撳墠鏉$爜鐨勬潯鐮佺姸鎬佷笉涓恒�愭甯搞�戯紝鏍囪澶辫触锛侊紒");
+            return;
+          }else if(num == 1 && this.checkDataList[i]["鏉$爜鐘舵��"]!="鏉$爜瀹炵墿涓㈠け"){
+            this.$message.error('鏉$爜銆�' + this.checkDataList[i]["鏉$爜缂栧彿"] + "銆戯細褰撳墠鏉$爜鐨勬潯鐮佺姸鎬佷笉涓恒�愭潯鐮佸疄鐗╀涪澶便�戯紝鍙嶆爣璁板け璐ワ紒锛�");
+            return;
+          }
+
+          if(i==this.checkDataList.length-1){
+            HInterIDListStr += this.checkDataList[i].hmainid.toString();
+          }else{
+            HInterIDListStr += this.checkDataList[i].hmainid.toString() + ",";
+          }
+        }
+
+        try{
+          var sql = "";
+          if(num == 0){
+            sql = "update Gy_BarCodeBill set HBarCodeStatus = '鏉$爜瀹炵墿涓㈠け' where HItemID in (" + HInterIDListStr + ")  select * from Gy_BarCodeBill where HItemID in (" + HInterIDListStr + ")";
+          }else if(num == 1){
+            sql = "update Gy_BarCodeBill set HBarCodeStatus = '姝e父' where HItemID in (" + HInterIDListStr + ")  select * from Gy_BarCodeBill where HItemID in (" + HInterIDListStr + ")";
+          }
+          
+          var ModRightNameCheck = "";
+          axios.get(this.$baseUrl + "/CommonModel/searchMethod", {
+            params: { 
+              "sql": sql
+              , "user": sessionStorage["HUserName"]
+              , "ModRightNameCheck": ModRightNameCheck
+            }
+          }).then(response => {
+            var data1 = response.data
+            if (data1.count == 1) {
+              if(data1.data.length>0){
+                this.$message.error('鎿嶄綔鎴愬姛锛侊紒');
+                this.handleQuery();
+              }else{
+                this.$message.error('鎿嶄綔澶辫触锛侊紒鏈煡璇㈠埌鏉$爜璁板綍锛侊紒');
+              }
+            }
+            else {
+              this.$message.error('鎿嶄綔澶辫触锛侊紒' + data1.Message );
+            }
+          });
+        }catch(error){
+          this.$message.error('鎺ュ彛璇锋眰澶辫触锛侊紒' + error );
+        }
+      }
     },
     //#endregion
 
@@ -577,7 +739,7 @@
     },
     DisPlay_HideColumn(HModName, user, option, dataOption) {
       this.totalNameList = []
-      axios.get(this.baseURL + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
+      axios.get(this.$baseUrl + '/Xt_grdAlignment_WMES/grdAlignmentWMESList', {
         params: {
           "HModName": HModName,
           "user": user,

--
Gitblit v1.9.1