| | |
| | | <el-table ref="multipleTableRef" :data="tableData.inspectRecordData" style="width: 100%" height="calc(100% - 100px)" :header-cell-style="{ background: '#fafafa' }"> |
| | | <el-table-column property="taskName" label="任务名称"> |
| | | <template #default="scope"> |
| | | <div :class="hasJump == true && scope.row.startTime.slice(0, 10) == date&&(tableData.params.taskStatus == 4 || tableData.params.taskStatus == 5)?'redTit':''"> |
| | | {{scope.row.taskName}} |
| | | <div :class="hasJump == true && scope.row.startTime.slice(0, 10) == date && (tableData.params.taskStatus == 4 || tableData.params.taskStatus == 5) ? 'redTit' : ''"> |
| | | {{ scope.row.taskName }} |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | |
| | | <el-table-column prop="execUserName" label="执行人" show-overflow-tooltip></el-table-column> |
| | | <el-table-column property="taskStatus" label="任务状态" width="180"> |
| | | <template #default="scope"> |
| | | <el-tag :type="scope.row.resultStatus === 1? 'danger': scope.row.taskStatus === 1 ? 'info' : scope.row.taskStatus === 2 ? '' : scope.row.taskStatus === 3 ? 'success' : 'danger'"> |
| | | <el-tag :type="scope.row.resultStatus === 1 ? 'danger' : scope.row.taskStatus === 1 ? 'info' : scope.row.taskStatus === 2 ? '' : scope.row.taskStatus === 3 ? 'success' : 'danger'"> |
| | | <span> |
| | | {{ scope.row.resultStatus === 1?'已巡检存在异常':parseNumber(scope.row.taskStatus, '任务状态') }} |
| | | {{ scope.row.resultStatus === 1 ? '已巡检存在异常' : parseNumber(scope.row.taskStatus, '任务状态') }} |
| | | </span> |
| | | </el-tag> |
| | | </template> |
| | |
| | | }; |
| | | |
| | | interface stateType { |
| | | isRed:boolean; |
| | | isRed: boolean; |
| | | hasJump: boolean; |
| | | date: string; |
| | | tableData: { |
| | |
| | | validTime: string | null; |
| | | createUserId: number | null; |
| | | reportTime: string | null; |
| | | resultStatus: number | null |
| | | resultStatus: number | null; |
| | | }; |
| | | }; |
| | | workTypeList: Array<type>; |
| | |
| | | id: number; |
| | | groupName: string; |
| | | } |
| | | interface timeType {} |
| | | export default { |
| | | name: 'index', |
| | | components: { inspectRecordDialog }, |
| | |
| | | taskStatusList: [ |
| | | { id: 1, name: '待巡检' }, |
| | | { id: 2, name: '巡检中' }, |
| | | { id: 3, name: '已巡检正常'}, |
| | | { id: 3, name: '已巡检正常' }, |
| | | { id: 5, name: '已巡检存在异常' }, |
| | | { id: 4, name: '超时未完成巡检' } |
| | | ], |
| | |
| | | |
| | | //获取巡检记录数据 |
| | | const getInspectRecord = async () => { |
| | | const data = JSON.parse(JSON.stringify(state.tableData.params)) |
| | | if(state.tableData.params.taskStatus == 3){ |
| | | data.taskStatus = 3 |
| | | data.resultStatus = 0 |
| | | const data = JSON.parse(JSON.stringify(state.tableData.params)); |
| | | if (state.tableData.params.taskStatus == 3) { |
| | | data.taskStatus = 3; |
| | | data.resultStatus = 0; |
| | | } |
| | | if(state.tableData.params.taskStatus == 5){ |
| | | data.taskStatus = 3 |
| | | data.resultStatus = 1 |
| | | if (state.tableData.params.taskStatus == 5) { |
| | | data.taskStatus = 3; |
| | | data.resultStatus = 1; |
| | | } |
| | | console.log(state.tableData.params.taskStatus,data.taskStatus,'data') |
| | | console.log(state.tableData.params.taskStatus, data.taskStatus, 'data'); |
| | | let res = await inspectRecordApi().getInspectRecordList(data); |
| | | if (res.data.code === '200') { |
| | | state.tableData.inspectRecordData = JSON.parse(JSON.stringify(res.data.data.records)); |
| | |
| | | const onHandleCurrentChange = (val: number) => { |
| | | state.tableData.params.pageIndex = val; |
| | | getInspectRecord(); |
| | | state.isRed = false |
| | | state.isRed = false; |
| | | }; |
| | | // 时间格式化 |
| | | const timeForm = { |
| | | const timeForm: timeType = { |
| | | hour12: false, |
| | | year: 'numeric', |
| | | month: '2-digit', |
| | |
| | | startTime: null, |
| | | validTime: null, |
| | | createUserId: null, |
| | | resultStatus: null, |
| | | reportTime: null |
| | | }; |
| | | }; |
| | |
| | | }; |
| | | // 页面加载时 |
| | | onMounted(() => { |
| | | getDateTime() |
| | | getDateTime(); |
| | | if (route.query.id) { |
| | | state.hasJump = true |
| | | state.hasJump = true; |
| | | state.tableData.params.taskStatus = Number(route.query.id); |
| | | state.isRed = true |
| | | state.isRed = true; |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | }else{ |
| | | } else { |
| | | getInspectRecord(); |
| | | getQuotaList(); |
| | | getDepartmentData(); |
| | | getClassGroupData(); |
| | | getInspectTaskPoint(); |
| | | } |
| | | |
| | | }); |
| | | |
| | | return { |
| | |
| | | color: #0098f5; |
| | | } |
| | | } |
| | | .redTit{ |
| | | .redTit { |
| | | color: red; |
| | | } |
| | | .el-input { |