|
@@ -70,7 +70,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.status ==2 ||scope.row.status == 3) && scope.row.flag" 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>
|
|
@@ -86,6 +86,7 @@
|
|
|
|
|
|
<script setup>
|
|
|
import { listDaywork, listDayworkItem, getProcessList } from '@/api/business/daywork.js'
|
|
|
+import { listDeptProcess} from '@/api/business/deptProcess'
|
|
|
import { getDept } from '@/api/business/planDetailSubDetail.js'
|
|
|
import { toHHmmss } from '@/components/Time/time.js'
|
|
|
import dayworkItemForm from './form'
|
|
@@ -247,7 +248,20 @@ function handleProcessChange() {
|
|
|
function getDayworkItems() {
|
|
|
dayworkItemLoading.value = true
|
|
|
listDayworkItem(queryItemParams.value).then((res) => {
|
|
|
+ listDeptProcess({deptId:queryDayworkParams.value.deptId,flag:true}).then((deptProcess) => {
|
|
|
+ for(let i = 0; i < res.rows.length; i++) {
|
|
|
+ for(let j = 0; j < deptProcess.rows.length; j++) {
|
|
|
+ //如果在工段资源工序里,则代表工段长能编辑
|
|
|
+ if(res.rows[i].processAlias == deptProcess.rows[j].processAlias) {
|
|
|
+ res.rows[i].flag = true
|
|
|
+ }
|
|
|
+ else {
|
|
|
+ res.rows[i].flag = false
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
dayworkItemList.value = res.rows
|
|
|
+ console.log(dayworkItemList.value)
|
|
|
for (var i = 0; i < dayworkItemList.value.length; i++) {
|
|
|
let timeStamp = dayworkItemList.value[i].workingHours
|
|
|
let seconds = Math.floor((timeStamp / 1000) % 60);
|
|
@@ -264,6 +278,7 @@ function getDayworkItems() {
|
|
|
itemTotal.value = res.total
|
|
|
dayworkItemLoading.value = false
|
|
|
})
|
|
|
+})
|
|
|
}
|
|
|
|
|
|
/** 搜索按钮操作 */
|