采购管理去质检操作的报错问题修改+批量合格入库批量不合格操作的时候增加一项都没有选择的时候提示的逻辑
2个文件已修改
73 ■■■■■ 已修改文件
src/components/makepager/CommonFormTableView.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/purchaseManage/purchase/components/TestingAll.vue 65 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/components/makepager/CommonFormTableView.vue
@@ -10,7 +10,7 @@
        :span-method="arraySpanMethod"
        style="width: 100%"
        @selection-change="handleSelectionChange"
        :row-key="(row) => row.productId"
        :row-key="getRowKeys"
      >
        <el-table-column v-if="selectBox"  type="selection" :selectable="isDisabled" :reserve-selection="true" width="40" align="center">
          
@@ -336,6 +336,12 @@
  },
  computed: {},
  methods: {
    // 获取row的key值
    getRowKeys(row) {
      let string;
      string = row[this.productTableList.key?this.productTableList.key:this.productTableList.productId];
      return string;
    },
    isDisabled(row){ 
      if (this.name == "rework") {
        if (row.status == 1) {
src/views/purchaseManage/purchase/components/TestingAll.vue
@@ -2,24 +2,21 @@
  <div class="add-quotation">
    <el-dialog :visible.sync="editConfig.visible" width="70%" append-to-body custom-class="iframe-dialog">
      <el-header>
        <el-button type="primary" :disabled="isDisabled"  size="small"
          @click="saveClick()">批量合格入库</el-button>
        <el-button type="primary" :disabled="isDisabled"  size="small"
          @click="saveNoClick()">批量不合格</el-button>
        <el-button type="primary" :disabled="isDisabled" size="small" @click="saveClick()">批量合格入库</el-button>
        <el-button type="primary" :disabled="isDisabled" size="small" @click="saveNoClick()">批量不合格</el-button>
      </el-header>
      <el-form ref="form" :model="editConfig.infomation" label-position="right" label-width="130px" size="mini"
        style="height: 60vh; overflow-x: hidden">
        <div class="basic-info">
          <div class="product-view">
            <CommonFormTableView :isBoder="true"
              name="rework" :selectBox="true" :detailEnter="true" :recalculateShow="false"
              :addTypeIdMultiple="true" :product-table-list="productTableList" sign="purchase" @rowClick="rowClick"
              @getSelectArray="getSelectArray" @toFiltering="toFiltering">
            <CommonFormTableView :isBoder="true" name="rework" :selectBox="true" :detailEnter="true"
              :recalculateShow="false" :addTypeIdMultiple="true" :product-table-list="productTableList" sign="purchase"
              @rowClick="rowClick" @getSelectArray="getSelectArray" @toFiltering="toFiltering">
              <template slot="tableButton">
                <el-table-column label="操作" width="120" align="center">
                  <template slot-scope="scope"  v-if="scope.row.status==1" >
                    <el-button type="text"  size="small" @click="saveClick(scope.row)"
                  <template slot-scope="scope" v-if="scope.row.status == 1">
                    <el-button type="text" size="small" @click="saveClick(scope.row)"
                      style="margin-right: 5px">合格</el-button>
                    <el-button type="text" size="small" @click="saveNoClick(scope.row)"
                      style="margin-right: 5px">不合格</el-button>
@@ -100,7 +97,7 @@
      thatTimes: [],
      selectList: [],
      qualityStatusList: getDataByType("qualityStatus"),
      isDisabled:false,
      isDisabled: false,
    }
  },
  created() {
@@ -133,14 +130,14 @@
      } else {
        this.savePurchaseQualityInspectionInfo({
          purchaseId:  Number(this.editConfig.infomation.id),
          purchaseId: Number(this.editConfig.infomation.id),
          ids: this.selectList,
          status: 2,
        })
      }
    },
    // 不合格
    saveNoClick(row){
    saveNoClick(row) {
      if (row) {
        this.savePurchaseQualityInspectionInfo({
          purchaseId: Number(this.editConfig.infomation.id),
@@ -150,25 +147,34 @@
      } else {
        this.savePurchaseQualityInspectionInfo({
          purchaseId:  Number(this.editConfig.infomation.id),
          purchaseId: Number(this.editConfig.infomation.id),
          ids: this.selectList,
          status: 3,
        })
      }
    },
    async savePurchaseQualityInspectionInfo(params) {
      await savePurchaseQualityInspectionInfo(params).then((res) => {
        if (res.code === 200) {
          this.editConfig.visible = false
          if(params.status===2){
            this.$message.success("质检合格!")
          }else if(params.status===3){
            this.$message.success("已设置为不合格!")
      if (params.ids.length > 0) {
        await savePurchaseQualityInspectionInfo(params).then((res) => {
          if (res) {
            if (res.code === 200) {
              this.editConfig.visible = false
              if (params.status === 2) {
                this.$message.success("质检合格!")
              } else if (params.status === 3) {
                this.$message.success("已设置为不合格!")
              }
              this.$parent.getData()
            }
          }
          this.$parent.getData()
        }
      })
        })
      }else{
        this.$message({
          message: "至少选择一条!",
          type: "warning",
        });
      }
    },
    handleClose() {
      this.editConfig.visible = false
@@ -178,6 +184,7 @@
        tableProductList: [],
        tableData: this.tableData,
        disabled: this.editConfig.isDisabled,
        key: 'id',
        isReturn: true,
        tableColumn: [
          {
@@ -193,12 +200,12 @@
          { label: "数量", prop: "amount" },
          { label: "单位", prop: "unit" },
          {
            label: "状态",
            label: "状态",
            prop: "status",
            isFilter: true,
            isFilterList: this.statusList,
            selectedListDefault: this.getSelectedOperateStatus([], this.statusList),
            isCallMethod: true,
            isCallMethod: true,
            getCallMethod: this.getpurchaseStatus
          },
        ]
@@ -222,11 +229,11 @@
    async getPurchaseQualityInspectionInfo(params) {
      await getPurchaseQualityInspectionInfo(params).then((res) => {
        this.timeList = []
        this.isDisabled=true // 判断有没有待质检的
        this.isDisabled = true // 判断有没有待质检的
        res.data.map((item) => {
          this.timeList.push({ id: item.createTime, name: item.createTime })
          if(item.status===1){
            this.isDisabled=false
          if (item.status === 1) {
            this.isDisabled = false
          }
        })
        this.setTableForm()