wangyi
2026-01-19 7fb0a8f0ab16c149484bf043754cd10cfa94de2f
src/views/warehouse/transfer/Kf_MoveStockRequestBillList.vue
@@ -40,7 +40,7 @@
            </el-form-item>
            <el-form-item label="规格型号" prop="SpecificationModel">
              <el-input v-model="queryParams.SpecificationModel" placeholder="请输入" @keyup.enter.native="handleQuery" />
            </el-form-item>
            </el-form-item>
            <el-form-item label="源单单号" prop="HSourceBillNo">
              <el-input v-model="queryParams.HSourceBillNo" placeholder="请输入" @keyup.enter.native="handleQuery" />
            </el-form-item>
@@ -132,10 +132,10 @@
        <el-button type="primary" icon="el-icon-edit" size="mini" :disabled="single"
          @click="handleEdit(row = rowForm, OperationType = 3)">编辑</el-button>
      </el-col>
      <el-col :span="1.5">
      <!-- <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-document-copy" size="mini" :disabled="single"
          @click="handleEdit(row = rowForm, OperationType = 1, copyType = 1)">复制</el-button>
      </el-col>
      </el-col> -->
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="handleDelete">删除
        </el-button>
@@ -147,6 +147,22 @@
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-edit-outline" size="mini" :disabled="single"
          @click="set_CheckBill(2, form = rowForm)">返审核</el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="set_CloseBill(0)">关闭
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="set_CloseBill(1)">反关闭
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="set_DropBill(1)">作废
        </el-button>
      </el-col>
      <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-delete" size="mini" :disabled="single" @click="set_DropBill(2)">反作废
        </el-button>
      </el-col>
      <!-- <el-col :span="1.5">
        <el-button type="primary" icon="el-icon-download" size="mini" @click="handleExport">导出</el-button>
@@ -172,7 +188,7 @@
              <el-checkbox v-model="checked" v-if="item.type == 'checkbox'"></el-checkbox>
              <div :style="item.style">
                <span v-if="column.property.includes('日期')">{{ parseTime(row[column.property], '{y}-{m}-{d}') }}</span>
                <el-button type="text" @click="handleEdit(row, OperationType = 3)"
                <el-button type="text" @click.stop="handleEdit(row, OperationType = 3)"
                  v-else-if="column.property == '单据号'">{{
                    row.单据号
                  }}</el-button>
@@ -182,10 +198,10 @@
          </el-table-column>
        </template>
      </el-table>
      <pagination v-show="total > 0" :total="total" :page.sync="page" :limit.sync="pageSize" :pageSizes="pageSizes" @pagination="getList" />
      <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="HModName" @rowEditClose="rowSetClose"
          v-if="rowHideShow" />
        <RowSettings :colName="btResList" :HModName="HModName" @rowEditClose="rowSetClose" v-if="rowHideShow" />
      </el-dialog>
      <!-- 编辑 -->
      <el-dialog title="编辑调拨申请单" :visible.sync="openEdit" width="1480px" append-to-body class="xsckdBox" @close="close">
@@ -193,8 +209,8 @@
          :copyType="copyType" @editClose="editClose" v-if="editShow" />
      </el-dialog>
      <el-dialog title="打印模板选择" :visible.sync="openPrintList" width="800px" append-to-body>
        <PrintList :linterid=this.rowForm.hmainid :MyMsg=this.rowForm.hmainid :Type='HModName'
          :HModName='HModName' @rowEditClose="rowSetClose" v-if="printListShow" />
        <PrintList :linterid=this.rowForm.hmainid :MyMsg=this.rowForm.hmainid :Type='HModName' :HModName='HModName'
          @rowEditClose="rowSetClose" v-if="printListShow" />
        <!-- <div>111</div> -->
      </el-dialog>
    </div>
@@ -270,15 +286,15 @@
      // 查询参数
      queryParams: {
        HBillNo: '',
        HBillno2:'',
        HBillno2: '',
        HInitTimeCycle: 29,
        HDeptID:'',
        MaterialCode:'',
        MaterialName:'',
        SpecificationModel:'',
        HSourceBillNo:'',
        Warehouse:'',
        Hmaker:'',
        HDeptID: '',
        MaterialCode: '',
        MaterialName: '',
        SpecificationModel: '',
        HSourceBillNo: '',
        Warehouse: '',
        Hmaker: '',
        ColName1: '',
        ColName2: '',
        ColName: '',
@@ -316,8 +332,8 @@
  methods: {
    //重新同步
    set_ResCnz(){
      axios.get(this.baseURL + "/Cg_POOrderBill/Resynchronize", {
    set_ResCnz() {
      axios.get(this.$baseUrl + "/Cg_POOrderBill/Resynchronize", {
        params: { "HBillNo": '', "HBillType": 1243 }
      }).then(response => {
        let result = response.data
@@ -399,7 +415,7 @@
        this.pageSize = 50
      }
      // 销售出库单列表
      axios.get(this.baseURL + '/Kf_MoveStockRequestBill/GetMoveStockRequestBillList', {
      axios.get(this.$baseUrl + '/Kf_MoveStockRequestBill/GetMoveStockRequestBillList', {
        params: {
          "sWhere": this.sWhere,
          "user": sessionStorage["HUserName"],
@@ -422,7 +438,7 @@
            //获取不需要显示的列(H开头的列不显示)
            var patrn = new RegExp(/^h/i);
            if (patrn.test(data1.list[key].ColmCols)) {
                this.titleData[key] = data1.list[key].ColmCols;
              this.titleData[key] = data1.list[key].ColmCols;
            }
          }
          //在列表左边添加勾选框
@@ -449,20 +465,20 @@
    },
    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,
        },
      }).then(res => {
      }).then(res => {
        let data1 = res.data
        if (data1.data.length != 0) {
        if (data1.data.length != 0) {
          var dataCol = [];//数据库查询出的列数据
          var newCols = [[]];//对应数据库列顺序col
          newCols[0].push(option.cols[0][0]);//放入第一个checkbox
          dataCol = data1.data[0].HGridString.split(',');
          //列设置列数与页面列数是否一致
          if (dataCol.length == option.cols[0].length - 1) {
          if (dataCol.length == option.cols[0].length - 1) {
            //遍历寻找列设置对应列按顺序插入
            for (var j = 0; j < option.cols[0].length - 1; j++) {
              for (var i = 0; i < option.cols[0].length - 1; i++) {
@@ -688,26 +704,27 @@
        this.sWhere += " and 单据号 like '%" + this.queryParams.HBillNo + "%'";
      }
      if (this.queryParams.HDeptID) {
          this.sWhere += " and 部门 like '%" + this.queryParams.HDeptID + "%'";
        this.sWhere += " and 部门 like '%" + this.queryParams.HDeptID + "%'";
      }
      if (this.queryParams.MaterialCode) {
          this.sWhere += " and 物料代码 like '%" + this.queryParams.MaterialCode + "%'";
        this.sWhere += " and 物料代码 like '%" + this.queryParams.MaterialCode + "%'";
      }
      if (this.queryParams.MaterialName) {
          this.sWhere += " and 物料名称 like '%" + this.queryParams.MaterialName + "%'";
        this.sWhere += " and 物料名称 like '%" + this.queryParams.MaterialName + "%'";
      }
      if (this.queryParams.SpecificationModel) {
          this.sWhere += " and 规格型号 like '%" + this.queryParams.SpecificationModel + "%'";
        this.sWhere += " and 规格型号 like '%" + this.queryParams.SpecificationModel + "%'";
      }
      if (this.queryParams.HSourceBillNo) {
          this.sWhere += " and 源单单号 like '%" + this.queryParams.HSourceBillNo + "%'";
        this.sWhere += " and 源单单号 like '%" + this.queryParams.HSourceBillNo + "%'";
      }
      if (this.queryParams.Warehouse) {
          this.sWhere += " and 仓库名称 like '%" + this.queryParams.Warehouse + "%'";
        this.sWhere += " and 仓库名称 like '%" + this.queryParams.Warehouse + "%'";
      }
      if (this.queryParams.Hmaker) {
          this.sWhere += " and 制单人 like '%" + this.queryParams.Hmaker + "%'";
        this.sWhere += " and 制单人 like '%" + this.queryParams.Hmaker + "%'";
      }
      this.clearData()
      this.getList()
    },
    /** 重置按钮操作 */
@@ -716,13 +733,13 @@
      this.queryParams = {
        HBillNo: '',
        HInitTimeCycle: 29,
        HDeptID:'',
        MaterialCode:'',
        MaterialName:'',
        SpecificationModel:'',
        HSourceBillNo:'',
        Warehouse:'',
        Hmaker:'',
        HDeptID: '',
        MaterialCode: '',
        MaterialName: '',
        SpecificationModel: '',
        HSourceBillNo: '',
        Warehouse: '',
        Hmaker: '',
        ColName1: '',
        ColName2: '',
        ColName: '',
@@ -734,16 +751,24 @@
        ColContent: '',
      }
      this.riqiChange()
      this.clearData()
      this.resetForm("queryForm")
      this.getList()
    },
    clearData() {
      this.single = true
      this.multiple = true
      this.OperationType = 0
      this.copyType = 0
      this.ids = []
    },
    //退出
    close() {
      // this.reset()
      this.tableShow = true
      this.openEdit = false
      this.editShow = false
      this.clearData()
      this.getList()
    },
    //打开新增组件弹窗
@@ -763,12 +788,14 @@
      this.open = val
      this.editShow = false
      this.openEdit = val
      this.clearData()
      this.getList()
    },
    /** 删除按钮操作 */
    handleDelete() {
      this.$modal.confirm('确认要删除吗,删除后不能恢复').then(() => {
        axios.get(this.baseURL + "/Kf_MoveStockRequestBill/DeltetKf_MoveStockRequestBill", {
        if (this.rowForm.状态 == "创建") {
          axios.get(this.$baseUrl + "/Kf_MoveStockRequestBill/DeltetKf_MoveStockRequestBill", {
            params: { 'HInterID': this.rowForm.hmainid.toString() }
          }).then(response => {
            if (response.data.count == 1) {
@@ -780,13 +807,18 @@
          }).catch(error => {
            this.$modal.msgError("接口请求失败!");
          });
        } else {
          this.$modal.msgError("此数据不是创建状态,不能删除!");
        }
      }).catch(() => { })
    },
    // 反审核/审核数据
    set_CheckBill(num, form) {
      var InterID = form.hmainid || form.HInterID
      //逻辑审核方法
      axios.get(this.baseURL + "/Kf_MoveStockRequestBill/AuditKf_MoveStockRequestBill", {
      axios.get(this.$baseUrl + "/Kf_MoveStockRequestBill/AuditKf_MoveStockRequestBill", {
        params: { "HInterID": InterID, "Type": num, "user": sessionStorage["HUserName"] }
      }).then(response => {
        let result = response.data
@@ -797,6 +829,44 @@
        else {
          this.$modal.msgError("错误:" + result.code + result.Message,);
        }
        this.clearData()
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
      });
    },
    set_CloseBill(num) {
      //逻辑关闭方法
      axios.get(this.$baseUrl + "/Kf_MoveStockRequestBill/CloseKf_MoveStockRequestBill", {
        params: { "HInterID": this.rowForm.hmainid, "Type": num, "user": sessionStorage["HUserName"] }
      }).then(response => {
        let result = response.data
        if (result.code == 1) {
          this.$modal.msgSuccess(result.Message);
          this.getList();
        }
        else {
          this.$modal.msgError("错误:" + result.code + result.Message,);
        }
        this.clearData()
      }).catch(error => {
        console.log(error)
        this.$modal.msgError("接口请求失败!");
      });
    },
    set_DropBill(num) {
      //逻辑作废方法
      axios.get(this.$baseUrl + "/Kf_MoveStockRequestBill/DropKf_MoveStockRequestBill", {
        params: { "HInterID": this.rowForm.hmainid.toString(), "Type": num, "user": sessionStorage["HUserName"] }
      }).then(response => {
        let result = response.data
        if (result.count == 1) {
          this.$modal.msgSuccess(result.Message);
          this.getList();
        }
        else {
          this.$modal.msgError("错误:" + result.code + result.Message,);
        }
        this.clearData()
      }).catch(error => {
        this.$modal.msgError("接口请求失败!");
      });
@@ -815,22 +885,8 @@
      } else if (this.rowForm.状态 != "已审核" && !this.defaintOperationByCompanyName()) {
        this.$modal.msgError("打印失败!原因:单据状态不为'已审核'状态!!");
      } else {
        axios.get(this.baseURL + "/Kf_SellOutBill/CheckSellOutBill_IsExist", {
          params: { "HInterID": this.rowForm.hmainid }
        }).then(response => {
          var result = response.data
          if (result.count == 1) {
            this.printListShow = true
            this.openPrintList = true
            // this.$router.push({ path:'/printList', query: { linterid: this.rowForm.hmainid,MyMsg:this.rowForm.hmainid,Type:'Kf_SellOutBillList' }})
          } else {
            this.$modal.msgError(result.code + result.Message)
          }
        }).catch(error => {
          this.$modal.msgError("接口请求失败!");
        });
   this.printListShow = true;
                this.openPrintList = true;
      }
      //  var content= ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=Kf_SellOutBillList', 'yes']
    },
@@ -838,7 +894,7 @@
    //#region 获取公司名,根据公司进行定制化开发
    defaintOperationByCompanyName() {
      var result = false;
      axios.get(this.baseURL + '/Xt_getInfo/getCompanyName').then(response => {
      axios.get(this.$baseUrl + '/Xt_getInfo/getCompanyName').then(response => {
        var data1 = response.data
        if (data1.count == 1) {
          if (data1.data == "水务") {