From 9620ca5caed59bd206dce701a04a5a4e4cfb9dc5 Mon Sep 17 00:00:00 2001
From: dytyqx <1342948614@qq.com>
Date: 星期二, 31 三月 2026 13:46:57 +0800
Subject: [PATCH] Merge branch 'master' of http://101.37.171.70:10101/r/MES-WEB-VUEUI

---
 src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue |  273 ++++++++++++++++++++++++++++++++++++++++++++++++++----
 1 files changed, 253 insertions(+), 20 deletions(-)

diff --git a/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue b/src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue
index ae933a5..817c60b 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">
@@ -153,16 +177,17 @@
         </template>
       </el-table>
       <!-- 璁板綍鏁般�侀〉鏁般�佸綋鍓嶉〉 -->
-      <pagination v-show="total > 0" :total="total" :page.sync="page" :limit.sync="pageSize" @pagination="handleQuery" />
+      <!-- <pagination v-show="total > 0" :total="total" :page.sync="page" :limit.sync="pageSize" @pagination="handleQuery" /> -->
+      <pagination v-show="total > 0" :total="total" :page.sync="page" :limit.sync="pageSize" :pageSizes="pageSizes" @pagination="getList" />
       <!-- 鍒楄缃� -->
       <el-dialog title="闅愯棌鍒楄缃�" :visible.sync="openRowHide" width="816px" append-to-body>
-        <RowSettings :colName="btResList" HModName="Kf_POStockInBillList" @rowEditClose="rowSetClose"
+        <RowSettings :colName="btResList" HModName="Gy_BarCodeBillList" @rowEditClose="rowSetClose"
           v-if="rowHideShow" />
       </el-dialog>
       <!-- 鎵撳嵃 -->
       <el-dialog title="鎵撳嵃妯℃澘閫夋嫨" :visible.sync="openPrintList" width="800px" append-to-body>
-        <PrintList :linterid="rowSel.toString()" :MyMsg="rowSel.toString()" Type="HGy_BarCodeBillList"
-          HModName="HGy_BarCodeBillList" @rowEditClose="rowSetClose" v-if="printListShow" />
+        <PrintList :linterid="rowSel.toString()" :MyMsg="rowSel.toString()" Type="HGy_BarCodeBill"
+          HModName="HGy_BarCodeBill" @rowEditClose="rowSetClose" v-if="printListShow" />
       </el-dialog>
     </div>
   </div>
@@ -182,7 +207,6 @@
       baseURL: process.env.VUE_APP_BASE_API,                //鍚庣鎺ュ彛鍓嶇紑(鍚庣鏈嶅姟鍣╥p鍦板潃)
 
       HInterID: null,
-      checkDataList: [],                                    //琛ㄦ牸閫変腑鏁版嵁闆嗗悎
       rowSel: [],                                           //鐢ㄤ簬鎵撳嵃鐨勬暟鎹泦鍚�
       
       rqsgList: [                                           //鏃ユ湡闂撮殧涓嬫媺鍒楄〃鏁版嵁
@@ -249,6 +273,15 @@
         ColContent2: '',
       },
       
+
+      loading: true,
+      tyResList: [],//鍒楄〃锛堟帴鍙f暟鎹級
+      btList: [],//琛ㄥご鍒楄〃鏄剧ず
+      btResList: [],
+      tableData: [],//鍒楄〃(鍒嗛〉鏄剧ず)
+      dataList: [],
+      titleData: [],//涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
+      pageSizes: [ 50,100, 500, 5000, 50000],
       page: 1,                                                      //page椤电储寮�
       pageSize: 0,                                                  //page椤甸潰璁板綍鏁�
       total: 0,                                                     //璁板綍鍚堣鏁�
@@ -262,6 +295,7 @@
       lastSelectedRow: null,                                        // 涓婁竴娆¢�変腑鐨勮
       selectedRow: null,                                            // 褰撳墠閫変腑鐨勮
       rowForm: {},                                                  // 褰撻�変腑鐨勫彧鏈変竴琛屾椂锛屾洿鏂版暟鎹负璇ラ�変腑鐨勮銆�
+      checkDataList: [],                                            // 琛ㄦ牸閫変腑鏁版嵁闆嗗悎
 
       tyResList: [],                                                // 鍒楄〃鏁版嵁锛岀敤浜庡鍑�
       titleData: [],                                                // 涓嶉渶瑕佹樉绀虹殑瀛楁 鍙墿灞�
@@ -312,7 +346,7 @@
     //#region 澶氶�夋閫変腑鏁版嵁
     handleSelectionChange(selection) {
       // this.rowForm = {}
-      checkDataList = selection;
+      this.checkDataList = selection;
       this.ids = selection.map(item => item.hmainid)
       this.single = selection.length != 1
       this.multiple = !selection.length
@@ -340,7 +374,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;//缁勭粐鍒楄〃
@@ -381,6 +415,10 @@
 
     //#region 蹇�熻繃婊�
     handleQuery() {
+      var params = this.get_UrlVars();
+      var HSourceInterID = params[params[1]];  
+      var HSourceEntryID = params[params[2]];
+      var HSEQ  = params[params[3]];
       this.sWhere = ''
       if (this.queryParams.ColName && this.queryParams.Comparator) {
         var com = "";
@@ -454,7 +492,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) {
@@ -463,16 +501,29 @@
       if (this.queryParams.HMaterName) {
         this.sWhere += " and 鐗╂枡鍚嶇О like ''%" + this.queryParams.HMaterName + "%''";
       }
+      if(HSEQ!=''&&HSEQ!=null){
+         this.sWhere += " and 婧愬崟琛屽彿 = ''" + HSEQ + "''";
+      }
+      if(HSourceInterID!=''&&HSourceInterID!=null){
+         this.sWhere += " and HSourceInterID = ''" + HSourceInterID + "''";
+      }
+      if(HSourceEntryID!=''&&HSourceEntryID!=null){
+         this.sWhere += " and HSourceEntryID = ''" + HSourceEntryID + "''";
+      }
       if (this.queryParams.HOrgID) {
         this.sWhere += " and HStockOrgID = ''" + this.queryParams.HOrgID + "''";
       }
+      //濡傛灉鏄嚜鍔ㄧ櫥褰曪紝鍒欏彧鑳芥煡鐪嬩緵搴斿晢鑷繁鐨勬潯鐮併��
+      if (sessionStorage["HAutoLogin"] == "1") {
+        this.sWhere += " and HSupID = ''" + sessionStorage["HUserName"] + "''";
+      }
+
       this.getList()
     },
     //#endregion
 
     //#region 鏌ヨ
     getList() {
-      this.pageSize = 50
       if (this.pageSize == 0) {
         this.pageSize = 50
       }
@@ -480,7 +531,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"],
@@ -518,8 +569,46 @@
           option.data = data1.data;
           var result = data1.data;
           option.data = result;
+          this.checkDataList = [];
           let HModName = "Gy_BarCodeBillList"
           this.DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, this.dataList);
+        }
+        else{
+          if(data1.list){
+            this.btResList = data1.list             //鍒楄〃琛ㄥご鏁版嵁
+            this.total = data1.count;
+            var data = [];//鍒楀瓧娈垫暟鎹�
+            var col = [];
+            var totalArray = [];
+            //缁欑┖鐨勬暟缁勮祴鍊�
+            for (var key in data1.list) {//寰簭閬嶅巻鏁扮粍
+              data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType });//浠庢瘡涓璞′腑鎻愬彇鏁版嵁
+            }
+            //鍦ㄥ垪琛ㄥ乏杈规坊鍔犲嬀閫夋
+            col.push({ type: 'checkbox', fixed: 'left', totalRowText: '鍚堣' });
+            for (var i = 0; i < data.length; i++) {//閬嶅巻data鏁扮粍閲嶇殑鏁版嵁
+              if (this.titleData.indexOf(data[i].name) > -1) {//妫�鏌ata銆恑銆�.name鏄惁鍦ㄦ暟缁勪腑  //璁$畻鍒�
+                col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //闅愯棌id鍒�
+              } else if (totalArray.indexOf(data[i].name) > -1 || (data[i].Type == "Decimal" || data[i].Type == "Int32")) { //璁$畻鍒�
+                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, totalRow: true, width: 120 });
+              }
+              else {
+                col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 });
+              }
+            }
+            option.cols = [col]
+            this.dataList = option
+            option.data = data1.data;
+            var result = data1.data;
+            option.data = result;
+            this.checkDataList = [];
+            let HModName = "Gy_BarCodeBillList"
+            this.DisPlay_HideColumn(HModName, sessionStorage["HUserName"], option, this.dataList);
+          }
+          else{
+            this.tableShow = true
+            this.loading = false
+          }
         }
       }).catch(error => {
         this.$modal.msgError("鎺ュ彛璇锋眰澶辫触!");
@@ -558,8 +647,152 @@
 
     //#endregion
 
+    //#region 鑾峰彇鍙傛暟
+      get_UrlVars() {
+            var vars = [], hash;
+            var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
+            for (var i = 0; i < hashes.length; i++) {
+                hash = hashes[i].split('=');
+                vars.push(hash[0]);
+                vars[hash[0]] = hash[1];
+            }
+            return vars;
+        },
+    //#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
 
@@ -576,7 +809,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,
@@ -680,11 +913,11 @@
               this.totalNameList.push(item)
             }
           })
-          if (data1.data[0].HPageSize == 0) {
-            this.pageSize = 50
-          } else {
-            this.pageSize = data1.data[0].HPageSize
-          }
+          // if (data1.data[0].HPageSize == 0) {
+          //   this.pageSize = 50
+          // } else {
+          //   this.pageSize = data1.data[0].HPageSize
+          // }
           this.tableData = option.data
           this.tableShow = true
           this.loading = false
@@ -727,8 +960,8 @@
        this.$modal.msgError("璇烽�夋嫨鏁版嵁");
       } else {
         this.rowSel = [];
-        for (var i = 0; i < this.selection.length; i++) {
-          this.rowSel.push(this.selection[i].HItemID.toString());
+        for (var i = 0; i < this.checkDataList.length; i++) {
+          this.rowSel.push(this.checkDataList[i].HItemID.toString());
         }
         this.printListShow = true;
         this.openPrintList = true;

--
Gitblit v1.9.1