| | |
| | | </template> |
| | | <template #aside> |
| | | <SideList |
| | | legend |
| | | :items="subtasks" |
| | | :loading="sideLoading" |
| | | @item-click="chooseSubtask" |
| | |
| | | @check="handleProblemCheck" |
| | | ></CompProblemCard> |
| | | </el-scrollbar> |
| | | <el-empty v-else description="暂无记录" v-loading="mainLoading" /> |
| | | <el-empty v-else description="暂无问题" v-loading="mainLoading" /> |
| | | </template> |
| | | </BaseContentLayout> |
| | | <CompProblemAddOrUpd |
| | |
| | | buttons: [ |
| | | { |
| | | name: '新增问题', |
| | | color: 'success', |
| | | // color: 'success', |
| | | color: 'primary', |
| | | click: () => { |
| | | this.proAddOrUpdDialogVisible = true; |
| | | } |
| | | }, |
| | | { |
| | | name: '场景图片', |
| | | color: 'warning', |
| | | // color: 'warning', |
| | | color: 'primary', |
| | | click: () => { |
| | | this.anyPhotoDialog = true; |
| | | } |
| | | }, |
| | | { |
| | | name: '设施设备', |
| | | color: 'info', |
| | | color: 'primary', |
| | | click: () => { |
| | | this.openDeviceShowDialog(); |
| | | } |
| | |
| | | taskApi.getSubtaskSummary(param).then((res) => { |
| | | const list = []; |
| | | res.forEach((s) => { |
| | | const t = this.getSubtaskType(s); |
| | | const t = ProCheckProxy.getSubtaskType(s); |
| | | list.push({ |
| | | status: s.subtask.status, |
| | | type: t, |
| | | title: s.stName, |
| | | categoly: s.stPlanTime.split('T')[0], |
| | |
| | | this.mainLoading = false; |
| | | } |
| | | }); |
| | | }, |
| | | //获取任务问题的审核情况 |
| | | getSubtaskType(s) { |
| | | let type = 0; |
| | | // 无问题 |
| | | if (s.proNum == 0) { |
| | | type = 0; |
| | | } |
| | | // 问题未审核 |
| | | else if (s.proCheckedNum == 0) { |
| | | type = 1; |
| | | } |
| | | // 问题部分审核 |
| | | else if (s.proCheckedNum < s.proNum) { |
| | | type = 2; |
| | | } |
| | | // 未整改 |
| | | else if (s.changeNum < s.proNum) { |
| | | type = 3; |
| | | } |
| | | // 整改未审核 |
| | | else if (s.changeCheckedNum == 0) { |
| | | type = 4; |
| | | } |
| | | // 整改部分审核 |
| | | else if (s.changeCheckedNum < s.changeNum) { |
| | | type = 5; |
| | | } |
| | | // 完全审核 |
| | | else { |
| | | type = 6; |
| | | } |
| | | return type; |
| | | }, |
| | | //点击左侧菜单任务事件 |
| | | chooseSubtask(s) { |
| | |
| | | this.mainLoading = false; |
| | | }); |
| | | }, |
| | | onAddProCanceled() { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | }, |
| | | onAddProCanceled() {}, |
| | | // 问题卡片组件主动发起刷新父组件数据 |
| | | updateSubtask(refresh = false) { |
| | | this.curSubtask.data.proCheckedNum++; |
| | | this.curSubtask.type = this.getSubtaskType(this.curSubtask.data); |
| | | this.curSubtask.type = ProCheckProxy.getSubtaskType(this.curSubtask.data); |
| | | if (this.proAddOrUpdDialogVisible) { |
| | | this.proAddOrUpdDialogVisible = false; |
| | | } |
| | |
| | | // 刷新当前选中子任务 |
| | | refreshCurrSubtask(refresh) { |
| | | this.sideLoading = false; |
| | | // this.mainLoading = true; |
| | | setTimeout(() => { |
| | | this.mainLoading = true; |
| | | taskApi |
| | | .getProBySubtask(this.curSubtask.data.stGuid) |
| | | .then((res) => { |
| | |
| | | // this.curSubtask = s; |
| | | }) |
| | | .finally(() => { |
| | | // this.mainLoading = false; |
| | | this.mainLoading = false; |
| | | }); |
| | | }, 150); |
| | | }, 500); |
| | | }, |
| | | // 问题审核完成后,更新左侧列表对应子任务状态 |
| | | handleProblemCheck(){ |
| | | const status = ProCheckProxy.calProStatus(this.curProList) |
| | | this.curSubtask.data.proNum = status.proNum |
| | | this.curSubtask.data.proCheckedNum = status.proCheckedNum |
| | | this.curSubtask.data.changeNum = status.changeNum |
| | | this.curSubtask.data.changeCheckedNum = status.changeCheckedNum |
| | | this.curSubtask.type = this.getSubtaskType(this.curSubtask.data) |
| | | handleProblemCheck() { |
| | | const status = ProCheckProxy.calProStatus(this.curProList); |
| | | this.curSubtask.data.proNum = status.proNum; |
| | | this.curSubtask.data.proCheckedNum = status.proCheckedNum; |
| | | this.curSubtask.data.changeNum = status.changeNum; |
| | | this.curSubtask.data.changeCheckedNum = status.changeCheckedNum; |
| | | this.curSubtask.type = ProCheckProxy.getSubtaskType(this.curSubtask.data); |
| | | } |
| | | }, |
| | | mounted() {} |