ezhizao_zx 1 rok pred
rodič
commit
9789256f5b
1 zmenil súbory, kde vykonal 46 pridanie a 47 odobranie
  1. 46 47
      src/views/business/daywork/index.vue

+ 46 - 47
src/views/business/daywork/index.vue

@@ -83,15 +83,14 @@
               <template #default="scope">
                 <el-button v-show="scope.row.deptProcessStatus &&
         (scope.row.status == 2 || scope.row.status == 3) &&
-        scope.row.id == latestProcessId && scope.row.deptId == latestDeptId && !(lastStatus == 4 || lastStatus == 5 ||lastStatus ==7)
+        scope.row.id == latestProcessId && scope.row.deptId == latestDeptId && !(lastStatus == 4 || lastStatus == 5 || lastStatus == 7)
         " link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)">编辑
                 </el-button>
-                <el-button  link type="primary" icon="View"
-                  @click="handleCheckDayworkItem(scope.row)">查看
+                <el-button link type="primary" icon="View" @click="handleCheckDayworkItem(scope.row)">查看
                 </el-button>
                 <el-button v-show="scope.row.deptProcessStatus &&
         (scope.row.status == 2 || scope.row.status == 3) &&
-        scope.row.id == latestProcessId&& scope.row.deptId == latestDeptId &&!(lastStatus == 4 || lastStatus == 5 ||lastStatus ==7)
+        scope.row.id == latestProcessId && scope.row.deptId == latestDeptId && !(lastStatus == 4 || lastStatus == 5 || lastStatus == 7)
         " v-hasPermi="['business:daywork:remove']" link type="danger" icon="Delete"
                   @click="handleDeletedItem(scope.row.id)">删除
                 </el-button>
@@ -372,52 +371,52 @@ function getDayworkItems() {
   listDeptProcess({ deptId: queryDayworkParams.value.deptId, flag: 1 }).then(
     (res) => {
       deptProcessList.value = res.rows;
-    }
-  );
-  listDayworkItem(queryItemParams.value).then((res) => {
-    console.log(currentDaywork.value);
-    for (let i = 0; i < res.rows.length; i++) {
-      //如果时首序,投产数是单批数
-      if (res.rows[i].prodNum == 0) {
-        if (currentDaywork.value.isLast == 1) {
-          res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
-        } else {
-          res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
+      listDayworkItem(queryItemParams.value).then((res) => {
+        console.log(currentDaywork.value);
+        for (let i = 0; i < res.rows.length; i++) {
+          //如果时首序,投产数是单批数
+          if (res.rows[i].prodNum == 0) {
+            if (currentDaywork.value.isLast == 1) {
+              res.rows[i].prodNum = currentDaywork.value.lastLotQuantity;
+            } else {
+              res.rows[i].prodNum = currentDaywork.value.oneLotQuantity;
+            }
+          }
+          //拿到最新一条报工信息的工序id,只能编辑当前序
+          // if (res.rows[i] == res.rows[res.rows.length - 1]) {
+          //   latestProcessId.value = res.rows[i].processId;
+          // }
         }
-      }
-      //拿到最新一条报工信息的工序id,只能编辑当前序
-      // if (res.rows[i] == res.rows[res.rows.length - 1]) {
-      //   latestProcessId.value = res.rows[i].processId;
-      // }
-    }
-    if (res.others != null && res.others.latestProcessId != null) {
-      latestProcessId.value = res.others.latestProcessId
-    }
-    if (res.others != null && res.others.lastItem != null) {
-      latestDeptId.value = res.others.lastItem.deptId
-      lastStatus.value = res.others.lastItem.status
-    }
-    for (var i = 0; i < res.rows.length; i++) {
-      let timeStamp = res.rows[i].workingHours;
-      let seconds = Math.floor((timeStamp / 1000) % 60);
-      let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
-      let hours = Math.floor(timeStamp / (1000 * 60 * 60));
-      let time = `${hours}小时${minutes}分钟${seconds}秒`;
-      res.rows[i].workingHours = time;
-      res.rows[i].deptProcessStatus = false;
-      //报工记录的工序id是该工段绑定的工序时,允许编辑
-      for (var item = 0; item < deptProcessList.value.length; item++) {
-        if (res.rows[i].processId == deptProcessList.value[item].processId) {
-          res.rows[i].deptProcessStatus = true;
+        if (res.others != null && res.others.latestProcessId != null) {
+          latestProcessId.value = res.others.latestProcessId
         }
-      }
-      console.log(res.rows[i].deptProcessStatus)
+        if (res.others != null && res.others.lastItem != null) {
+          latestDeptId.value = res.others.lastItem.deptId
+          lastStatus.value = res.others.lastItem.status
+        }
+        for (var i = 0; i < res.rows.length; i++) {
+          let timeStamp = res.rows[i].workingHours;
+          let seconds = Math.floor((timeStamp / 1000) % 60);
+          let minutes = Math.floor((timeStamp / (1000 * 60)) % 60);
+          let hours = Math.floor(timeStamp / (1000 * 60 * 60));
+          let time = `${hours}小时${minutes}分钟${seconds}秒`;
+          res.rows[i].workingHours = time;
+          res.rows[i].deptProcessStatus = false;
+          //报工记录的工序id是该工段绑定的工序时,允许编辑
+          for (var item = 0; item < deptProcessList.value.length; item++) {
+            if (res.rows[i].processId == deptProcessList.value[item].processId) {
+              res.rows[i].deptProcessStatus = true;
+            }
+          }
+          console.log(res.rows[i].deptProcessStatus)
+        }
+        dayworkItemList.value = res.rows;
+        getProcess();
+        itemTotal.value = res.total;
+        dayworkItemLoading.value = false;
+      });
     }
-    dayworkItemList.value = res.rows;
-    getProcess();
-    itemTotal.value = res.total;
-    dayworkItemLoading.value = false;
-  });
+  );
 }
 //工序信息
 function getProcess() {