zhuzeyu 1 жил өмнө
parent
commit
972d5add4c

+ 15 - 4
src/views/business/daywork/index.vue

@@ -72,7 +72,7 @@
             </el-table-column>
             <el-table-column fixed="right" label="操作" align="center" width="70px">
               <template #default="scope">
-                <el-button v-if="scope.row.status ==2 || scope.row.status == 3" link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)">编辑</el-button>
+                <el-button v-if=" scope.row.deptProcessStatus &&(scope.row.status ==2 || scope.row.status == 3) " link type="warning" icon="Edit" @click="handleUpdateDayworkItem(scope.row)">编辑</el-button>
                 <el-button v-else link type="primary" icon="View" @click="handleCheckDayworkItem(scope.row)">查看</el-button>
               </template>
             </el-table-column>
@@ -109,6 +109,7 @@ const dayworkLoading = ref(false)
 const loading = ref(false)
 const dayworkItemLoading = ref(false)
 const processList = ref([])
+const deptProcessList = ref([])
 const total = ref(0)
 const itemTotal = ref(0)
 
@@ -235,12 +236,16 @@ function handleProcessChange() {
 /** 查询报工详情列表 */
 function getDayworkItems() {
   dayworkItemLoading.value = true
+  listDeptProcess({ deptId: queryDayworkParams.value.deptId, flag: 1 }).then((res) => {
+    deptProcessList.value = res.rows
+  })
   listDayworkItem(queryItemParams.value).then((res) => {
-    for(let i = 0; i<res.rows.length;i++) {
-      if(res.rows[i].prodNum == 0) {
-        res.rows[i].prodNum =currentDaywork.value.oneLotQuantity
+    for (let i = 0; i < res.rows.length; i++) {
+      if (res.rows[i].prodNum == 0) {
+        res.rows[i].prodNum = currentDaywork.value.oneLotQuantity
       }
     }
+
     dayworkItemList.value = res.rows
     for (var i = 0; i < dayworkItemList.value.length; i++) {
       let timeStamp = dayworkItemList.value[i].workingHours
@@ -249,6 +254,12 @@ function getDayworkItems() {
       let hours = Math.floor(timeStamp / (1000 * 60 * 60))
       let time = `${hours}小时${minutes}分钟${seconds}秒`
       dayworkItemList.value[i].workingHours = time
+      dayworkItemList.value[i].deptProcessStatus = false
+      for (var item = 0; item < deptProcessList.value.length; item++) {
+        if (dayworkItemList.value[i].processId == deptProcessList.value[item].processId) {
+          dayworkItemList.value[i].deptProcessStatus = true
+        }
+      }
     }
     getProcessList({ technologicalProcessId: queryItemParams.value.technologicalProcessId }).then((res) => {
       processList.value = res.data