Ver código fonte

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend-mes into dengfei

695593266@qq.com 11 meses atrás
pai
commit
9d6cec6ea7

+ 12 - 8
src/api/workOrderList/index.js

@@ -87,7 +87,7 @@ export async function pickorderList(params) {
 // }
 
 // 任务列表 pageByCurrentUser 我的任务
-export async function pageByCurrentUser (data) {
+export async function pageByCurrentUser(data) {
   const res = await request.get('/aps/assign/pageByCurrentUser/v2', {
     params: data
   });
@@ -98,7 +98,7 @@ export async function pageByCurrentUser (data) {
 }
 
 // 任务列表 pageByCurrentUserLeader 全部任务
-export async function pageByCurrentUserLeader (data) {
+export async function pageByCurrentUserLeader(data) {
   const res = await request.get('/aps/assign/pageByCurrentUserLeader/v2', {
     params: data
   });
@@ -121,9 +121,7 @@ export async function listWorkCenter(firstProduceTaskId) {
 
 // 更新派单任务实际时间
 export async function batchUpdateRealTime(data) {
-  const res = await request.put(
-    `/aps/assign/batchUpdateRealTime`,data
-  );
+  const res = await request.put(`/aps/assign/batchUpdateRealTime`, data);
   if (res.data.code == 0) {
     return res.data.data;
   }
@@ -141,12 +139,18 @@ export async function listUpdateRealTimeRecord(assigneeId) {
 }
 // 根据任务ID获取派单任务项分页列表
 export async function pageAssigneeByTask(params) {
-  const res = await request.get(
-    `/aps/assign/pageAssigneeByTask`,{params}
-  );
+  const res = await request.get(`/aps/assign/pageAssigneeByTask`, { params });
   if (res.data.code == 0) {
     return res.data.data;
   }
   return Promise.reject(new Error(res.data.message));
 }
 
+// 更新派单任务实际时间确认
+export async function batchUpdateRealTimeConfirm(data) {
+  const res = await request.put(`/aps/assign/batchUpdateRealTimeConfirm`, data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
+}

+ 43 - 11
src/views/produce/components/taskDialog/index.vue

@@ -90,9 +90,14 @@
         ></el-input>
       </template>
       <template v-slot:action="{ row }">
+        <!-- <el-popconfirm title="确定完成这个任务?" @confirm="sureData(row)">
+          <template v-slot:reference>
+            <el-link :underline="false" type="primary">确定 </el-link>
+          </template>
+        </el-popconfirm> -->
         <el-popconfirm title="确认本次报工?" @confirm="saveData(row)">
           <template v-slot:reference>
-            <el-link :underline="false" type="primary">报工 </el-link>
+            <el-link  :underline="false" type="primary">报工 </el-link>
           </template>
         </el-popconfirm>
 
@@ -101,7 +106,7 @@
           :underline="false"
           type="primary"
           @click="viewRecords(row.id)"
-          >报工修改录</el-link
+          >报工修改录</el-link
         >
       </template>
     </ele-pro-table>
@@ -113,7 +118,8 @@
   import {
     batchUpdateRealTime,
     listUpdateRealTimeRecord,
-    pageAssigneeByTask
+    pageAssigneeByTask,
+    batchUpdateRealTimeConfirm
   } from '@/api/workOrderList';
   import modifyDialog from '@/views/taskList/components/modifyDialog.vue';
 
@@ -247,7 +253,7 @@
             slot: 'action',
             label: '操作',
             align: 'center',
-            width: 140,
+            width: 165,
             resizable: false,
             showOverflowTooltip: true,
             fixed: 'right'
@@ -267,13 +273,30 @@
           categoryId: workData.categoryId,
           apsWorkOrderId: workData.apsWorkOrderId
         };
+
         this.getData();
       },
+      // 确定完成
+      sureData(row) {
+        let params = {
+          // realStartTime: row.realStartTime,
+          // realEndTime: row.realEndTime,
+          qualifiedQuantity: row.qualifiedQuantity,
+          qualifiedWeight: row.qualifiedWeight,
+          unqualifiedQuantity: row.unqualifiedQuantity,
+          unqualifiedWeight: row.unqualifiedWeight,
+          remark: row.assigneeRemark,
+          apsAssigneeId: row.id
+        };
+        batchUpdateRealTimeConfirm(params).then((res)=>{
+          console.log(res,'res 1111')
+        })
+      },
       getData() {
         this.workList = [];
         this.loading = true;
-        for(let key in this.params){
-          if(!this.params[key]){
+        for (let key in this.params) {
+          if (!this.params[key]) {
             return;
           }
         }
@@ -308,12 +331,21 @@
         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.qualifiedQuantity - 0 + (row.unqualifiedQuantity - 0) !=
+          row.quantity - 0
+        ) {
+          return this.$message.warning(
+            `合格数量加不合格数量需要等于任务数量${row.quantity}`
+          );
         }
-        if(((row.qualifiedWeight - 0) + (row.unqualifiedWeight - 0)) != (row.weight - 0)){
-           return this.$message.warning(`合格重量加不合格重量需要等于任务重量${row.weight}`);
+        if (
+          row.qualifiedWeight - 0 + (row.unqualifiedWeight - 0) !=
+          row.weight - 0
+        ) {
+          return this.$message.warning(
+            `合格重量加不合格重量需要等于任务重量${row.weight}`
+          );
         }
 
         let params = {

+ 1 - 1
src/views/produce/index.vue

@@ -615,7 +615,7 @@
           if (this.workListIds.length > 1) {
             return this.$message.warning('任务只能选择一个工单!');
           }
-          this.$refs.taskDialogRef.open(this.workStepQueryParam, this.workData);
+          this.$refs.taskDialogRef.open(this.workStepQueryParam, this.workData.list[0]);
         }
         // 工艺路线 *** 修改 判断只能选择一个
         // if (t === 'work') {