dytyqx
6 天以前 d1a4129ae92fc9ee10a41ef27c0accf37afa3f43
src/views/warehouse/barcodeMaster/Gy_BarCodeBillList.vue
@@ -127,6 +127,22 @@
        </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">
        <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
      </el-col>
      <el-col :span="1.5">
@@ -164,7 +180,7 @@
      <pagination v-show="total > 0" :total="total" :page.sync="page" :limit.sync="pageSize" @pagination="handleQuery" />
      <!-- 列设置 -->
      <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>
      <!-- 打印 -->
@@ -389,6 +405,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 = "";
@@ -462,7 +482,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) {
@@ -471,10 +491,18 @@
      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"] + "''";
@@ -536,6 +564,43 @@
          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) {//检查data【i】.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("接口请求失败!");
      });
@@ -573,6 +638,18 @@
    //#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 删除
    handleDrop() {
    },
@@ -610,6 +687,106 @@
    },
    //#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]["条码状态"]!="正常"){
            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 = '正常' 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
    //#region 列设置
    handleRowHide() {
      this.rowHideShow = true