lucw пре 7 месеци
родитељ
комит
612d814347

Разлика између датотеке није приказан због своје велике величине
+ 746 - 130
src/views/batchRecord/components/editModal.vue


+ 83 - 51
src/views/batchRecord/components/list.vue

@@ -43,53 +43,57 @@
       </template>
 
       <template v-slot:action="{ row }">
-        <el-link
-          v-if="
-            row.executeStatus == 0 ||
-            (row.executeStatus == 1 && row.executeMethod == 3)
-          "
-          type="primary"
-          :underline="false"
-          @click="openEdit('edit', row)"
-        >
-          编辑
-        </el-link>
+        <div>
+          <el-link
+            v-if="
+              row.executeStatus == 0 ||
+              (row.executeStatus == 1 && row.itemType == 2)
+            "
+            type="primary"
+            :underline="false"
+            @click="openEdit('edit', row)"
+          >
+            编辑
+          </el-link>
 
-        <el-link
-          v-if="
-            row.executeStatus == 0 ||
-            (row.executeStatus == 1 && row.executeMethod == 2) ||
-            (row.executeStatus == 1 && row.executeMethod == 3)
-          "
-          type="primary"
-          :underline="false"
-          @click="execute(row)"
-        >
-          报工
-        </el-link>
+          <el-popconfirm
+            v-if="
+              row.executeStatus == 0 ||
+              (row.executeStatus == 1 && row.itemType == 2) ||
+              (row.executeStatus == 1 && row.itemType == 3)
+            "
+            title="确定要报工此记录吗?"
+            class="ele-action"
+            @confirm="execute(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="primary" :underline="false"> 报工 </el-link>
+            </template>
+          </el-popconfirm>
 
-        <el-link
-          v-if="row.approvalStatus === 0"
-          type="primary"
-          :underline="false"
-          @click="openApproval(row)"
-        >
-          提交
-        </el-link>
+          <el-link
+            v-if="row.approvalStatus === 0"
+            type="primary"
+            :underline="false"
+            @click="openApproval(row)"
+          >
+            提交
+          </el-link>
 
-        <el-popconfirm
-          v-if="
-            row.executeStatus == 0 &&
-            $hasPermission('mes:producetaskrecordrulesrecord:logicdelete')
-          "
-          title="确定要删除此用户吗?"
-          class="ele-action"
-          @confirm="deleteById(row)"
-        >
-          <template v-slot:reference>
-            <el-link type="danger" :underline="false"> 删除 </el-link>
-          </template>
-        </el-popconfirm>
+          <el-popconfirm
+            v-if="
+              row.executeStatus == 0 &&
+              $hasPermission('mes:producetaskrecordrulesrecord:logicdelete')
+            "
+            title="确定要删除此用户吗?"
+            class="ele-action"
+            @confirm="deleteById(row)"
+          >
+            <template v-slot:reference>
+              <el-link type="danger" :underline="false"> 删除 </el-link>
+            </template>
+          </el-popconfirm>
+        </div>
       </template>
     </ele-pro-table>
     <!-- 编辑添加组件 -->
@@ -127,7 +131,8 @@
   import tableColumnsMixin from '@/mixins/tableColumnsMixin';
   import {
     producetaskrulerecordPage,
-    logicDeleteById
+    logicDeleteById,
+    saveRuleRecord
   } from '@/api/producetaskrulerecord/index';
   import editModal from './editModal.vue';
   import { parameterGetByCode } from '@/api/system/dictionary-data';
@@ -135,6 +140,10 @@
   import programRulesDialog from '@/views/produce/components/prenatalExamination/programRulesDialog.vue';
   import taskDialog from '@/views/produce/components/prenatalExamination/taskDialog.vue';
   import processSubmitDialog from '@/components/processSubmitDialog/processSubmitDialog.vue';
+  import {
+    queryListByWorkOrderId,
+    saveOrUpdateAndSubmit
+  } from '@/api/producetaskrecordrulesrecord/index.js';
 
   export default {
     components: {
@@ -281,7 +290,8 @@
         // 是否展示处理按钮
         showBut: false,
         showReleaseRulesDialog: false,
-        processSubmitDialogFlag: false
+        processSubmitDialogFlag: false,
+        butLoading: false
       };
     },
     computed: {
@@ -408,14 +418,36 @@
           return;
         }
         if (row.executeMethod == 2) {
-          return this.$refs.releaseRulesDialogRef?.open(
-            currentItem,
-            currentItem
-          );
+          return this.releaseRulesSaveOrSubmit(row);
         }
 
         // 任务确认
-        this.$refs.taskDialogRef?.open(currentItem, currentItem);
+        this.saveRuleRecord(row);
+      },
+      // 任务确认报工
+      async saveRuleRecord(row) {
+        this.butLoading = true;
+        await saveRuleRecord(row);
+        this.$message.success('报工成功!');
+        this.butLoading = false;
+        this.reload();
+      },
+      // 记录规则报工
+      async releaseRulesSaveOrSubmit(row) {
+        this.butLoading = true;
+        if (row.produceTaskId) {
+          const pickDetails = await queryListByWorkOrderId({
+            workOrderId: row.workOrderId,
+            recordId: row.id,
+            produceTaskId: row.produceTaskId,
+            ruleId: row.ruleId
+          });
+          row.pickDetails = pickDetails;
+        }
+        await saveOrUpdateAndSubmit(row);
+        this.$message.success('报工成功!');
+        this.butLoading = false;
+        this.reload();
       }
     }
   };

+ 3 - 24
src/views/produce/components/prenatalExamination/materialModal.vue

@@ -75,17 +75,17 @@
             align: 'center'
           },
           {
-            label: '领料类型',
+            label: '类型',
             prop: 'categoryLevelNamePath',
             minWidth: 120
           },
           {
-            label: '物料编码',
+            label: '编码',
             prop: 'categoryCode',
             minWidth: 120
           },
           {
-            label: '物料名称',
+            label: '名称',
             prop: 'categoryName',
             minWidth: 120
           },
@@ -171,13 +171,6 @@
             value: 'keyword',
             type: 'input',
             placeholder: '物料编码、物料名称、批次号'
-          },
-          {
-            label: '工序名称:',
-            value: 'produceTaskInstanceId',
-            type: 'select',
-            placeholder: '选择工序',
-            planList: this.taskPlanList
           }
         ];
       }
@@ -205,11 +198,6 @@
       },
       open(params = {}, pickDetails = []) {
         this.params = params;
-        this.$nextTick(() => {
-          if (this.params.workOrderId) {
-            this.queryAllProduceTaskList(this.params.workOrderId);
-          }
-        });
         this.visible = true;
       },
       selected() {
@@ -219,15 +207,6 @@
         }
         this.$emit('confirm', this.selection);
         this.handleClose();
-      },
-      async queryAllProduceTaskList(workOrderId) {
-        const res = await queryAllProduceTaskInstanceInPickOrder(workOrderId);
-        this.taskPlanList = res.map((item) => {
-          return {
-            label: item.taskName,
-            value: item.taskId
-          };
-        });
       }
     }
   };

+ 7 - 17
src/views/produce/components/prenatalExamination/releaseRulesDialog.vue

@@ -200,10 +200,7 @@
         </el-col>
         <el-col :span="8">
           <el-form-item label="结论" required prop="conclution">
-            <el-radio-group
-              v-model="addForm.conclution"
-              @change="conclutionChange"
-            >
+            <el-radio-group v-model="addForm.conclution">
               <el-radio :label="1">合格</el-radio>
               <el-radio :label="2">不合格</el-radio>
             </el-radio-group>
@@ -471,6 +468,7 @@
 
           const every = details.every((i) => i.checkResult == 1);
           this.addForm.conclution = every ? 1 : 2;
+          console.log('this.addForm.conclution', this.addForm.conclution);
         },
         deep: true
       }
@@ -546,9 +544,6 @@
                 if (!value) return callback();
                 const now = new Date();
                 const start = new Date(value);
-                // if (start < now) {
-                //   return callback(new Error('开始时间不能小于当前时间'));
-                // }
                 callback();
               },
               trigger: 'blur'
@@ -623,17 +618,17 @@
             align: 'center'
           },
           {
-            label: '领料类型',
+            label: '类型',
             prop: 'categoryLevelNamePath',
             minWidth: 120
           },
           {
-            label: '物料编码',
+            label: '编码',
             prop: 'categoryCode',
             minWidth: 120
           },
           {
-            label: '物料名称',
+            label: '名称',
             prop: 'categoryName',
             minWidth: 120
           },
@@ -1060,7 +1055,7 @@
           this.addForm.checkFinishTime = null;
           this.addForm.checkStartTime = null;
           this.addForm.checkValidity = null;
-          this.addForm.checkValidityUnit = null;
+          this.addForm.checkValidityUnit = '';
           this.addForm.conclution = null;
           this.addForm.id = null;
           this.addForm.pickDetails = [];
@@ -1221,9 +1216,7 @@
           {
             workOrderId: this.addForm.workOrderId,
             ruleId: this.addForm.ruleId,
-            produceTaskInstanceId:
-              this.workOrderInfo.taskId ||
-              this.workOrderInfo.produceTaskInstanceId
+            produceTaskId: this.workOrderInfo.produceTaskId
           },
           []
         );
@@ -1307,9 +1300,6 @@
           i.checkResult = 1;
           return i;
         });
-      },
-      conclutionChange() {
-        console.log('this.addForm.conclution', this.addForm.conclution);
       }
     }
   };

Неке датотеке нису приказане због велике количине промена