Răsfoiți Sursa

任务字段更改

jingshuyong 11 luni în urmă
părinte
comite
fe0d4ed6dc

+ 22 - 13
src/views/produce/components/taskDialog/index.vue

@@ -101,7 +101,7 @@
           :underline="false"
           type="primary"
           @click="viewRecords(row.id)"
-          >修改记录</el-link
+          >报工记录</el-link
         >
       </template>
     </ele-pro-table>
@@ -137,7 +137,7 @@
             prop: 'assigneeName',
             width: 180,
             align: 'center',
-            showOverflowTooltip: true,
+            showOverflowTooltip: true
           },
           {
             label: '执行类型',
@@ -150,13 +150,6 @@
               return row.assigneeType.desc;
             }
           },
-          {
-            label: '工时',
-            prop: 'durationText',
-            width: 140,
-            align: 'center',
-            showOverflowTooltip: true
-          },
           {
             label: '任务开始时间',
             prop: 'startTime',
@@ -171,6 +164,7 @@
             align: 'center',
             showOverflowTooltip: true
           },
+
           {
             label: '任务数量',
             prop: 'quantity',
@@ -201,6 +195,13 @@
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            label: '工时',
+            prop: 'durationText',
+            width: 140,
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             slot: 'qualifiedQuantity',
             label: '合格数量',
@@ -290,18 +291,26 @@
         if (!row.realEndTime) {
           return this.$message.warning('请选择结束时间');
         }
-        if (!row.qualifiedQuantity) {
+        if (!row.qualifiedQuantity && row.qualifiedQuantity != 0) {
           return this.$message.warning('请输入合格数量');
         }
-        if (!row.qualifiedWeight) {
+        if (!row.qualifiedWeight && row.qualifiedWeight != 0) {
           return this.$message.warning('请输入合格重量');
         }
-        if (!row.unqualifiedQuantity) {
+        if (!row.unqualifiedQuantity && row.unqualifiedQuantity != 0) {
           return this.$message.warning('请输入不合格数量');
         }
-        if (!row.unqualifiedWeight) {
+        if (!row.unqualifiedWeight && row.unqualifiedWeight != 0) {
           return this.$message.warning('请输入不合格重量');
         }
+        if(((row.qualifiedQuantity - 0) + (row.unqualifiedQuantity - 0)) != (row.quantity - 0)){
+          console.log(((row.qualifiedQuantity - 0) + (row.qualifiedQuantity - 0)),'--------------')
+           return this.$message.warning(`合格数量加不合格数量需要等于任务数量${row.quantity}`);
+        }
+        if(((row.qualifiedWeight - 0) + (row.unqualifiedWeight - 0)) != (row.weight - 0)){
+           return this.$message.warning(`合格重量加不合格重量需要等于任务重量${row.weight}`);
+        }
+
         let params = {
           realStartTime: row.realStartTime,
           realEndTime: row.realEndTime,

+ 1 - 1
src/views/taskList/components/Ddtails.vue

@@ -158,7 +158,7 @@
         </el-col>
       </el-row>
       <el-row v-if="title === '详情'">
-        <headerTitle style="margin-top: 15px" title="修改记录"></headerTitle>
+        <headerTitle style="margin-top: 15px" title="报工记录"></headerTitle>
         <ModifyRecord ref="ModifyRecordRef" :list="list" />
       </el-row>
       <div slot="footer" class="tool_btn">

+ 9 - 9
src/views/taskList/components/ModifyRecord.vue

@@ -37,12 +37,19 @@
             showOverflowTooltip: true
           },
           {
-            label: '实际开始时间',
-            prop: 'realStartTime',
+            label: '实际结束时间',
+            prop: 'realEndTime',
             minWidth: 150,
             align: 'center',
             showOverflowTooltip: true
           },
+          {
+            label: '工时',
+            prop: 'durationText',
+            width: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             label: '合格数量',
             prop: 'qualifiedQuantity',
@@ -77,13 +84,6 @@
             minWidth: 220,
             align: 'center',
             showOverflowTooltip: true
-          },
-          {
-            label: '工时',
-            prop: 'durationText',
-            width: 150,
-            align: 'center',
-            showOverflowTooltip: true
           }
         ]
       };

+ 1 - 1
src/views/taskList/components/modifyDialog.vue

@@ -43,7 +43,7 @@
     props: {
       title: {
         type: String,
-        default: '修改记录'
+        default: '报工记录'
       },
     }
   };

+ 44 - 26
src/views/taskList/index.vue

@@ -40,11 +40,8 @@
           @click="details('report', row)"
           >报工
         </el-link>
-        <el-link
-          :underline="false"
-          type="primary"
-          @click="viewRecords(row.id)"
-        >修改记录
+        <el-link :underline="false" type="primary" @click="viewRecords(row.id)"
+          >修改记录
         </el-link>
       </template>
     </ele-pro-table>
@@ -64,7 +61,7 @@
   } from '@/api/workOrderList';
 
   export default {
-    components: { TaskSearch, Ddtails,modifyDialog },
+    components: { TaskSearch, Ddtails, modifyDialog },
     data() {
       return {
         loading: false,
@@ -219,7 +216,7 @@
             label: '要求生产重量',
             align: 'center',
             showOverflowTooltip: true,
-            width: 110,
+            width: 110
           },
           {
             prop: 'planStartTime',
@@ -251,6 +248,27 @@
             showOverflowTooltip: true,
             width: 180
           },
+          {
+            label: '实际开始时间',
+            prop: 'realStartTime',
+            minWidth: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '实际结束时间',
+            prop: 'realEndTime',
+            minWidth: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
+          {
+            label: '工时',
+            prop: 'durationText',
+            width: 150,
+            align: 'center',
+            showOverflowTooltip: true
+          },
           {
             prop: 'firstTaskName',
             label: '首工序',
@@ -266,7 +284,7 @@
             width: 180
           },
           {
-            prop:'statusText',
+            prop: 'statusText',
             label: '状态',
             align: 'center',
             // formatter: (row) => {
@@ -310,9 +328,7 @@
       }
     },
     created() {},
-    mounted() {
-
-    },
+    mounted() {},
     methods: {
       handleTabClick(e) {
         this.tabValue = e.name;
@@ -337,7 +353,7 @@
           workOrderCode: row.workOrderCode,
           productionPlanCode: row.productionPlanCode,
           produceRoutingName: row.produceRoutingName,
-          formingNum: row.formingNum,
+          formingNum: row.quantity,
           assignTeamName: row.assignTeamName,
           formingWeight: row.quantity,
           planStartTime: row.planStartTime,
@@ -351,7 +367,7 @@
           assigneeName: row.assigneeName,
           weight: row.weight,
           quantity: row.quantity,
-          durationText:row.durationText,
+          durationText: row.durationText,
           apsAssigneeId: row.id
         };
         let form = {
@@ -361,20 +377,22 @@
           unqualifiedQuantity: row.unqualifiedQuantity,
           qualifiedWeight: row.qualifiedWeight,
           remark: row.assigneeRemark,
-          qualifiedQuantity: row.qualifiedQuantity,
-        }
-        this.$refs.detailsRef.open(type, currentRow,form);
+          qualifiedQuantity: row.qualifiedQuantity
+        };
+        this.$refs.detailsRef.open(type, currentRow, form);
       },
-      viewRecords(apsAssigneeId){
-        listUpdateRealTimeRecord(apsAssigneeId).then(res => {
-          if (res && res.length > 0){
-            this.$refs.modifyRef.open(res)
-          }else{
-            this.$message.warning('暂无修改历史记录数据')
-          }
-        }).catch((err)=>{
-          this.$message.error(err.message)
-        })
+      viewRecords(apsAssigneeId) {
+        listUpdateRealTimeRecord(apsAssigneeId)
+          .then((res) => {
+            if (res && res.length > 0) {
+              this.$refs.modifyRef.open(res);
+            } else {
+              this.$message.warning('暂无修改历史记录数据');
+            }
+          })
+          .catch((err) => {
+            this.$message.error(err.message);
+          });
       }
     }
   };