feat:排查任务状态和执行记录分页

dev
kongyeqing 2023-11-22 14:47:13 +08:00
parent 1ae25bb8db
commit ae0297d45a
8 changed files with 117 additions and 35 deletions

View File

@ -2,7 +2,7 @@
<el-tree :data="treeData" :props="{ children: 'children', label: 'name' }" :expand-on-click-node="false"
default-expand-all highlight-current @node-click="handleNodeClick">
<span class="span-ellipsis" slot-scope="{ node, data }">
<el-tooltip style="font-size: 10px;padding: 5px;" popper-class="tooltip_item" effect="light"
<el-tooltip style="font-size: 14px;padding: 5px;" popper-class="tooltip_item" effect="light"
:content="node.label || ''" placement="bottom-start" :visible-arrow="false">
<span>{{ node.label }}</span>
</el-tooltip>
@ -51,7 +51,7 @@ export default class UnitTreeComponent extends Vue {
<style lang="scss" >
.tooltip_item {
padding: 5px !important;
font-size: 12px;
// font-size: 12px;
margin-top: 5px !important;
margin-left: 60px;

View File

@ -1,6 +1,6 @@
<script lang="ts">
import { Component } from 'vue-property-decorator';
import { Component, Watch } from 'vue-property-decorator';
import template from "./common.component.html"
import BaseRecordComponent from "hbt-common/components/common/baseRecord.component.vue"
import FormComponent from "hbt-common/components/common/form.component.vue"
@ -156,7 +156,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
created() {
//
this.initRiskSource()
// this.initRiskSource();
// console.log('111');
}
public tabTableChange(type) {
this.params.pageNum = 1;
@ -227,13 +229,19 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
name: "限期整改",
value: 2
}]
},{
}, {
name: "整改部门",
key: "reformDeptId",
type: "treeSelect",
width:"280px",
width: "280px",
expandLevel: Infinity,
datas: this.$store.state.deptTreeList
}, {
name: "重大危险源",
key: "majorHazard",
type: "select",
clearable: true,
datas: this.riskSource,
}];
this.updateOptions = [{
@ -699,6 +707,10 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
}]
}
@Watch("$store.state.prevention_risk_source", { immediate: true, deep: true })
onChanges() {
this.initRiskSource()
}
//
public initRiskSource() {
@ -729,6 +741,15 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
this.tableColumn.push({ name: '最新提交时间', width: "180", key: "updateTime", sortable: 'custom' });
this.tableColumn.push({ name: '发起人', width: "100", key: "startUser", render: (data) => data.taskInfo.startUser || "--" });
this.tableColumn.push({ name: '隐患来源', width: "150", render: (data) => this.$store.getters.prevention_danger_resource_map[data.source] });
this.tableColumn.push({
name: '重大危险源', width: "150", render: (data) => {
if (data.majorHazard) {
return this.$store.getters.prevention_risk_source_map[data.majorHazard]
} else {
return '不涉及'
}
}
});
this.tableColumn.push({ name: '上报人', width: "100", key: "reportUserName", render: (data) => data.reportUserName || "--" });
this.tableColumn.push({ name: '上报时间', width: "150", key: "reportTime", render: (data) => data.reportTime || "--" });
this.tableColumn.push({
@ -905,7 +926,14 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
} else {
this.params.pageNum = 1
}
Object.keys(this.params).forEach(item => {
if (this.isEmpty(this.params[item])) {
delete this.params[item];
}
})
this.getTableData();
return
}
@ -936,6 +964,15 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
}
}
public isEmpty(obj) {
if (typeof obj === 'undefined' || obj === null || obj === '') {
return true;
} else {
return false;
}
}
//
public reset() {
this.params = {

View File

@ -41,7 +41,7 @@
</div>
</div>
<div class="custom-box echarts-box dis-flex flex-col">
<div class="title">企业风险辨识</div>
<div class="title">部门风险辨识</div>
<hbt-echarts class="echarts" :options="buildBarOption()" @onChartInit="getChart($event,true)"></hbt-echarts>
</div>
</div>

View File

@ -297,8 +297,15 @@ export default class MajorHazard extends BaseRecordComponent<any> {
}
public buildTable() {
this.tableColumn.push({ name: '企业名称', key: "companyName", });
this.tableColumn.push({
name: '企业名称', key: "companyName", render: (data) => {
if (data.syncFlag === 1) {
return '<span class="color_4">有更新</span>' + ' ' + data.companyName
} else {
return data.companyName
}
}
});
this.tableColumn.push({
name: '重大危险源名称', key: "majorHazard", render: (data) => {
let majorHazard = parseInt(data.majorHazard)
@ -542,12 +549,12 @@ export default class MajorHazard extends BaseRecordComponent<any> {
this.operateDuty = [];
}
public showModal(row, isReadonly) {
if (isReadonly) {
this.isReadonly = true
} else {
this.isReadonly = false
public showModal(row, isReadonly = false) {
this.isReadonly = isReadonly
if(isReadonly === false){
if(row.syncFlag === 1){
this.majorhazardDutyTaskList(row.majorHazard)
}
}
if (!this.taskTypeMap[row.type]) {
this.initSelectList()
@ -575,21 +582,21 @@ export default class MajorHazard extends BaseRecordComponent<any> {
}
this.tableService.selectDutyDetailList({ taskId: row.id }).then((res: any) => {
if (res.code === 200) {
this.mainDuty = res.data[1] ? res.data[1] :[]
this.mainDuty = res.data[1] ? res.data[1] : []
this.mainDuty.forEach((item: any) => {
item.type = 1;
if (!isReadonly) {
item.dutyContent = item.dutyContent.toString();
}
})
this.techDuty = res.data[2] ? res.data[2] :[]
this.techDuty = res.data[2] ? res.data[2] : []
this.techDuty.forEach((item: any) => {
item.type = 2;
if (!isReadonly) {
item.dutyContent = item.dutyContent.toString();
}
})
this.operateDuty = res.data[3] ? res.data[3] :[]
this.operateDuty = res.data[3] ? res.data[3] : []
this.operateDuty.forEach((item: any) => {
item.type = 3;
if (!isReadonly) {

View File

@ -74,18 +74,26 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source,
clearable:true,
clearable: true,
}, {
name: "责任部门",
key: "chargeDeptId",
type: "treeSelect",
expandLevel: Infinity,
width: "280px",
datas: this.$store.state.deptTreeList,
clearable: true,
}, {
name: "责任人",
key: "taskChargeUserId",
type: "select",
datas: this.$store.state.userList,
clearable:true,
clearable: true,
}, {
name: "状态",
key: "status",
type: "select",
clearable:true,
clearable: true,
datas: [{
name: '已排查',
value: 1
@ -317,6 +325,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
})
this.tableColumn.push({ name: '隐患排查任务', key: "taskName" });
this.tableColumn.push({ name: '排查时间', key: "endTime" });
this.tableColumn.push({ name: '责任部门', key: "chargeDeptName" });
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" });
this.tableColumn.push({ name: '开始时间', key: "taskStartTime", sortable: 'custom' });
this.tableColumn.push({ name: '截止时间', key: "taskEndTime", sortable: 'custom' });

View File

@ -52,6 +52,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
name: "反向选择",
value: "reverse"
}];
public resultNameList = {1:'正常',2:'异常',3:'未巡检'};
public formOptions: FormOption<BtnOption>[] = [{
name: "排查结果",
key: "result",
@ -62,6 +63,9 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
}, {
name: "异常",
value: 2
}, {
name: "未巡检",
value: 3
}]
}, {
name: "是否为隐患",
@ -218,6 +222,8 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
}
})
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" });
// this.tableColumn.push({ name: '', key: "chargeDeptName" });
// this.tableColumn.push({ name: '', key: "taskChargeUserName" });
this.tableColumn.push({
name: '重大危险源', key: 'majorHazard', render: (data) => {
data.majorHazard = parseInt(data.majorHazard)
@ -230,6 +236,8 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
return "<span class='noDraw'>异常</span>"
} else if (data.result == 1) {
return "<span class='color_1'>正常</span>"
}else if (data.result == 3) {
return "<span class='color_3'>未巡检</span>"
}
}
});
@ -400,7 +408,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
}
this.updateParams = Object.assign({
insuranceDutyFlagName: row.insuranceDutyFlag === 0 ? '否' : '是',
resultName: row.result === 1 ? '正常' : '异常',
resultName: this.resultNameList[ row.result ],
dangerFlagName: row.dangerFlag === 0 ? '否' : row.dangerFlag === 1 ? '是' : null,
dangerTypeName: this.$store.getters.prevention_danger_type_map[row.dangerType],
checkUserName: this.$store.getters.user_map[row.checkUserId],

View File

@ -44,11 +44,12 @@
</div>
<!-- 查看执行记录 -->
<el-dialog :close-on-click-modal="false" :show-close="false" :visible.sync="showProtable" width="940px"
<el-dialog :close-on-click-modal="false" title="执行记录" :visible.sync="showProtable" width="940px"
destroy-on-close>
<TableComponent :tableData="currentProTableData.datas" :tableColumn="proTableColumn" :showFooter="false"
style="margin-bottom: 20px;">
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="250" border
<TableComponent :tableData="currentProTableData" :tableColumn="proTableColumn" :showFooter="true"
style="margin-bottom: 20px;" @pageNumberChange="proCallback($event,'pageNum')"
@pageSizeChange="proCallback($event,'pageSize')" >
<el-table ref="multipleTable" :data="currentProTableData.datas" tooltip-effect="dark" height="450" border
style="width: 100%">
<template v-for="item in proTableColumn">
<el-table-column v-if="item.render" :label="item.name" :width="item.width" :key="item.key">
@ -60,8 +61,8 @@
</template>
</el-table>
</TableComponent>
<ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
<!-- <ButtonListComponent :actions="subActions" @callback="subCallback" btn-position="center" :full-btn="true">
</ButtonListComponent> -->
</el-dialog>
</div>

View File

@ -32,6 +32,12 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
public params = {} as any;
public proParams = {
pageSize:10,
pageNum:1,
controlId:null,
} as any;
public treeData = [];
public areaList = {} as any;
@ -488,11 +494,25 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
//
public showSubModal(id) {
this.showProtable = true
this.currentProTableData.datas = [] as any;
this.tableService.selectById({ controlId: id }).then((res: any) => {
this.showProtable = true;
this.proParams.controlId = id;
this.setExecutionRecordList()
}
//
public proCallback(data, type){
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
this.proParams[type] = data;
}
this.setExecutionRecordList();
return
}
}
//
public setExecutionRecordList(){
this.tableService.selectById(this.proParams).then((res: any) => {
if (res.code === 200 && res.data && res.data.datas) {
this.currentProTableData.datas = res.data.datas
this.currentProTableData = res.data
this.currentProTableData.datas.forEach((item, index) => {
item.index = index + 1
return item