Prechádzať zdrojové kódy

fix(bpm): 修复不合格品处置功能逻辑缺陷

修复处置操作列缺失及处置提交时数据源错误的问题,确保单行处置与批量处置均可正确提交。
yusheng 1 deň pred
rodič
commit
e16650a382

+ 27 - 3
src/views/bpm/handleTask/components/qualityReportApproval/unqualifiedProduct.vue

@@ -36,7 +36,18 @@
             </template>
           </el-popconfirm>
         </template>
-
+        <template v-slot:action="{ row }">
+          <el-link
+            slot="reference"
+            type="primary"
+            :underline="false"
+            icon="el-icon-edit"
+            v-if="row.disposalStatus != 2"
+            @click="disposeFn(2, row)"
+          >
+            处置
+          </el-link>
+        </template>
         <template v-slot:badTypeName="{ row, $index }">
           <el-select
             v-model="row.badTypeId"
@@ -734,6 +745,16 @@
               return this.allList.find((item) => item.value == cellValue)
                 ?.label;
             }
+          },
+          {
+            columnKey: 'action',
+            label: '操作',
+            width: 100,
+            align: 'center',
+            resizable: false,
+            fixed: 'right',
+            slot: 'action',
+            showOverflowTooltip: true
           }
         ];
         return arr;
@@ -935,6 +956,7 @@
       },
       // // 处置
       disposeFn(type, row) {
+        this.current = {};
         if (type == 1) {
           this.all = true;
         } else {
@@ -942,7 +964,6 @@
         }
         this.formData = { ...row };
         this.dialogVisible = true;
-        // let ids = this.current ? [this.current.id] : this.selection.map((item) => item.id);
       },
 
       async getQueryQualityInventory() {
@@ -1023,7 +1044,10 @@
 
       async handleDispose() {
         this.$refs['disposeForm'].validate(async (valid) => {
-          let ids = this.selection.map((item) => item.id);
+          // let ids = this.selection.map((item) => item.id);
+          let ids = this.current?.id
+            ? [this.current.id]
+            : this.selection.map((item) => item.id);
           this.poList.forEach((item, index) => {
             if (ids.includes(item.id)) {
               this.$set(this.poList[index], 'disposalStatus', 1);