forked from xxhjsb/hbt-prevention-ui
feat:检查区域检查单元检查对象关联
parent
8a78eab4ba
commit
558514599f
|
@ -421,6 +421,11 @@ export default class AnalEvaluationComponent extends Vue {
|
||||||
require: true,
|
require: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
format: "yyyy-MM-dd",
|
format: "yyyy-MM-dd",
|
||||||
|
pickerOptions: {
|
||||||
|
disabledDate(time) {
|
||||||
|
return time.getTime() < moment(new Date()).add(1, 'month').subtract(1, 'day').toDate().getTime();
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,8 +42,8 @@ export default class AreaService extends BaseService<any>{
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public getAnalControls():Promise<AxiosResponse<ActionResult<any>>>{
|
public getAnalControls(params?):Promise<AxiosResponse<ActionResult<any>>>{
|
||||||
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
|
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
|
||||||
return this.get(url,null,false)
|
return this.post(url,params,{},false)
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -37,7 +37,7 @@ export default class BlankComponent extends Vue {
|
||||||
this.systemService.getDictData("prevention_measures_sort"),
|
this.systemService.getDictData("prevention_measures_sort"),
|
||||||
this.systemService.getDictData("prevention_task_type"),
|
this.systemService.getDictData("prevention_task_type"),
|
||||||
this.systemService.getDictData("prevention_evaluate_status"),
|
this.systemService.getDictData("prevention_evaluate_status"),
|
||||||
this.areaService.getAnalControls(),
|
// this.areaService.getAnalControls([]),
|
||||||
this.systemService.getDictData("prevention_task_status"),
|
this.systemService.getDictData("prevention_task_status"),
|
||||||
this.systemService.getDictData("prevention_hazard_category"),
|
this.systemService.getDictData("prevention_hazard_category"),
|
||||||
this.systemService.getDictData("prevention_training_level"),
|
this.systemService.getDictData("prevention_training_level"),
|
||||||
|
@ -203,24 +203,24 @@ export default class BlankComponent extends Vue {
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("setAnalCntrol", results[24].data)
|
// this.$store.commit("setAnalCntrol", results[24].data)
|
||||||
|
|
||||||
|
|
||||||
this.$store.commit("set_prevention_task_status", results[25].data.map(item => {
|
this.$store.commit("set_prevention_task_status", results[24].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_hazard_category", results[26].data.map(item => {
|
this.$store.commit("set_prevention_hazard_category", results[25].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_training_level", results[27].data.map(item => {
|
this.$store.commit("set_prevention_training_level", results[26].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
|
@ -228,21 +228,21 @@ export default class BlankComponent extends Vue {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
this.$store.commit("set_prevention_training_methods", results[28].data.map(item => {
|
this.$store.commit("set_prevention_training_methods", results[27].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_integral_eventtype", results[29].data.map(item => {
|
this.$store.commit("set_prevention_integral_eventtype", results[28].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_integral_type", results[30].data.map(item => {
|
this.$store.commit("set_prevention_integral_type", results[29].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
|
@ -250,58 +250,58 @@ export default class BlankComponent extends Vue {
|
||||||
}))
|
}))
|
||||||
|
|
||||||
|
|
||||||
this.$store.commit("set_prevention_risk_source", results[31].data.map(item => {
|
this.$store.commit("set_prevention_risk_source", results[30].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_risk_craft", results[32].data.map(item => {
|
this.$store.commit("set_prevention_risk_craft", results[31].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_risk_chemical", results[33].data.map(item => {
|
this.$store.commit("set_prevention_risk_chemical", results[32].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
|
|
||||||
this.$store.commit("set_prevention_enterprise_nature", results[34].data.map(item => {
|
this.$store.commit("set_prevention_enterprise_nature", results[33].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("set_prevention_enterprise_size", results[35].data.map(item => {
|
this.$store.commit("set_prevention_enterprise_size", results[34].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("set_prevention_regulatory_category", results[36].data.map(item => {
|
this.$store.commit("set_prevention_regulatory_category", results[35].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("set_prevention_regulatory_subcategories", results[37].data.map(item => {
|
this.$store.commit("set_prevention_regulatory_subcategories", results[36].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("set_prevention_registration_status", results[38].data.map(item => {
|
this.$store.commit("set_prevention_registration_status", results[37].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
}
|
}
|
||||||
}))
|
}))
|
||||||
this.$store.commit("set_prevention_safety_label", results[39].data.map(item => {
|
this.$store.commit("set_prevention_safety_label", results[38].data.map(item => {
|
||||||
return {
|
return {
|
||||||
name: item.dictLabel,
|
name: item.dictLabel,
|
||||||
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
value: isNaN(+item.dictValue) ? item.dictValue : +item.dictValue,
|
||||||
|
|
|
@ -142,7 +142,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 加载单元列表
|
// 加载单元列表
|
||||||
public loadUnitData(id?) {
|
public loadUnitData(id?, isVerify = false) {
|
||||||
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
this.unitService.selectByPage({ pageSize: 1000, areaId: id }, false).then((res: any) => {
|
||||||
this.unitList = res.data.datas.map(item => {
|
this.unitList = res.data.datas.map(item => {
|
||||||
if (item.name) {
|
if (item.name) {
|
||||||
|
@ -153,7 +153,13 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const option = this.updateOptions.find(item => item.key === "unitId") as any;
|
const option = this.updateOptions.find(item => item.key === "unitId") as any;
|
||||||
option.datas = this.unitList
|
option.datas = this.unitList;
|
||||||
|
if (isVerify) {
|
||||||
|
//单元是否删除
|
||||||
|
if (this.updateParams.unitId) {
|
||||||
|
this.judgeDeleteUnitMethod(this.updateParams);
|
||||||
|
}
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -527,6 +533,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
} else if (data.value === "selectAll") {
|
} else if (data.value === "selectAll") {
|
||||||
this.selectAll()
|
this.selectAll()
|
||||||
} else if (data.value === "add") {
|
} else if (data.value === "add") {
|
||||||
|
this.unitList = []
|
||||||
|
const option = this.updateOptions.find(item => item.key === "unitId") as any;
|
||||||
|
option.datas = []
|
||||||
this.showUpdateModel()
|
this.showUpdateModel()
|
||||||
} else if (data.value === "delete") {
|
} else if (data.value === "delete") {
|
||||||
this.deleteData(this.selectData.map((item: any) => item.id))
|
this.deleteData(this.selectData.map((item: any) => item.id))
|
||||||
|
@ -563,7 +572,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
number: null,
|
number: null,
|
||||||
photo: null,
|
photo: null,
|
||||||
inspectTime: moment().format("YYYY-MM-DD HH:mm"),
|
inspectTime: moment().format("YYYY-MM-DD HH:mm"),
|
||||||
dangerType: 4
|
dangerType: 4,
|
||||||
|
unitId: null,
|
||||||
}
|
}
|
||||||
if (!row) {
|
if (!row) {
|
||||||
this.tableService.getNumber().then(res => {
|
this.tableService.getNumber().then(res => {
|
||||||
|
@ -574,9 +584,6 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
})
|
})
|
||||||
} else {
|
} else {
|
||||||
this.tableService.selectById(row.id).then((res: any) => {
|
this.tableService.selectById(row.id).then((res: any) => {
|
||||||
console.log(JSON.parse(JSON.stringify(res)));
|
|
||||||
|
|
||||||
// const unitName =
|
|
||||||
this.updateParams = Object.assign({
|
this.updateParams = Object.assign({
|
||||||
classifyName: this.$store.getters.prevention_dangrous_type_map[res.data.classify],
|
classifyName: this.$store.getters.prevention_dangrous_type_map[res.data.classify],
|
||||||
attributeClassifyName: this.$store.getters.prevention_safe_reason_map[row.attributeClassify],
|
attributeClassifyName: this.$store.getters.prevention_safe_reason_map[row.attributeClassify],
|
||||||
|
@ -599,11 +606,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
||||||
//区域是否删除
|
//区域是否删除
|
||||||
let isDeleteArea = !res.data.areaId ? true : this.judgeDeleteAreaMethod(res.data);
|
let isDeleteArea = !res.data.areaId ? true : this.judgeDeleteAreaMethod(res.data);
|
||||||
if (!isDeleteArea) {
|
if (!isDeleteArea) {
|
||||||
this.loadUnitData(res.data.areaId);
|
this.loadUnitData(res.data.areaId, true);
|
||||||
//单元是否删除
|
|
||||||
if (res.data.unitId) {
|
|
||||||
this.judgeDeleteUnitMethod(res.data);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// 获取url
|
// 获取url
|
||||||
|
|
|
@ -18,8 +18,8 @@
|
||||||
|
|
||||||
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
<el-table ref="multipleTable" :data="tableData.datas" height="100%" border row-key="checked"
|
||||||
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
@selection-change="handleSelectionChange" style="width: 100%" @sort-change="sortChange($event)">
|
||||||
<el-table-column v-if="!(isManager)" type="selection" :selectable="selectable"
|
<el-table-column v-if="!(isManager)" type="selection" :selectable="selectable" fixed label="全选"
|
||||||
fixed label="全选" width="40">
|
width="40">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="序号" width="60">
|
<el-table-column label="序号" width="60">
|
||||||
<div slot-scope="scope">{{scope.$index+1}}</div>
|
<div slot-scope="scope">{{scope.$index+1}}</div>
|
||||||
|
@ -42,15 +42,19 @@
|
||||||
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
@click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)"
|
||||||
@click="showUpdateModel(scope.row)">修改</el-button>
|
@click="showUpdateModel(scope.row)">修改</el-button>
|
||||||
<el-button type="text" v-if="(isBase || (isManager && scope.row.status === 0)) && !(isClap && scope.row.status)"
|
<el-button type="text"
|
||||||
|
v-if="(isBase || (isManager && scope.row.status === 0)) && !(isClap && scope.row.status)"
|
||||||
@click="deleteData([scope.row.id])">删除</el-button>
|
@click="deleteData([scope.row.id])">删除</el-button>
|
||||||
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">抄送</el-button>
|
||||||
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
|
<el-button type="text" v-if="isManager" @click="showUpdateModel(0)">移交</el-button> -->
|
||||||
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
<el-button type="text"
|
||||||
|
v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
||||||
@click="changeStatus(scope.row, 1)">中断</el-button>
|
@click="changeStatus(scope.row, 1)">中断</el-button>
|
||||||
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 2"
|
<el-button type="text"
|
||||||
|
v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 2"
|
||||||
@click="changeStatus(scope.row, 2)">恢复</el-button>
|
@click="changeStatus(scope.row, 2)">恢复</el-button>
|
||||||
<el-button type="text" v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
<el-button type="text"
|
||||||
|
v-if="isManager && params.type===3 && scope.row.taskInfo.processStatus === 1"
|
||||||
@click="changeStatus(scope.row, 3)">作废</el-button>
|
@click="changeStatus(scope.row, 3)">作废</el-button>
|
||||||
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">处理</el-button> -->
|
<!-- <el-button type="text" v-if="isManager" @click="showUpdateModel(0)">处理</el-button> -->
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -634,7 +634,7 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
|
||||||
this.tableColumn.push({ name: '隐患标题', width: "150", key: "title" });
|
this.tableColumn.push({ name: '隐患标题', width: "150", key: "title" });
|
||||||
this.tableColumn.push({ name: '隐患描述', width: "300", key: "description" });
|
this.tableColumn.push({ name: '隐患描述', width: "300", key: "description" });
|
||||||
this.tableColumn.push({ name: '隐患等级', render: (data) => this.levelMap[data.level] });
|
this.tableColumn.push({ name: '隐患等级', render: (data) => this.levelMap[data.level] });
|
||||||
this.tableColumn.push({ name: '隐患分类', render: (data) => this.$store.getters.prevention_dangrous_type_map[data.dangerType] });
|
this.tableColumn.push({ name: '隐患分类', render: (data) => this.$store.getters.prevention_dangrous_type_map[data.classify] });
|
||||||
this.tableColumn.push({ name: '整改方式', render: (data) => this.reformModeMap[data.reformMode] });
|
this.tableColumn.push({ name: '整改方式', render: (data) => this.reformModeMap[data.reformMode] });
|
||||||
this.tableColumn.push({ name: '隐患位置', width: "150", key: "locationName" });
|
this.tableColumn.push({ name: '隐患位置', width: "150", key: "locationName" });
|
||||||
this.tableColumn.push({ name: '治理责任人', width: "100", key: "executeUserName" });
|
this.tableColumn.push({ name: '治理责任人', width: "100", key: "executeUserName" });
|
||||||
|
|
|
@ -455,6 +455,17 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
require: true,
|
require: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
datas: this.riskSource
|
datas: this.riskSource
|
||||||
|
}, {
|
||||||
|
name: "发起时间",
|
||||||
|
key: "processStartTime",
|
||||||
|
type: "date",
|
||||||
|
subType: "datetime",
|
||||||
|
format: "yyyy-MM-dd HH:mm:ss",
|
||||||
|
width: "calc(50% - 20px)",
|
||||||
|
require: true,
|
||||||
|
showError: false,
|
||||||
|
disable: true,
|
||||||
|
hide: !this.updateParams.id || this.updateParams.status === 0
|
||||||
},]
|
},]
|
||||||
if (this.params)
|
if (this.params)
|
||||||
this.updateOptions2 = [{
|
this.updateOptions2 = [{
|
||||||
|
@ -790,9 +801,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item && item.key === "executeDeadline") {
|
if (item && item.key === "executeDeadline") {
|
||||||
const now = this.updateParams.createTime;
|
const now = this.updateParams.taskInfo.processStartTime;
|
||||||
if (now > data) {
|
if (now > data) {
|
||||||
this.$message.error("治理时限不能早于上报时间")
|
this.$message.error("治理时限不能早于发起时间")
|
||||||
this.updateParams.executeDeadline = null;
|
this.updateParams.executeDeadline = null;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -805,9 +816,9 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (item && item.key === "realConfirmTime") {
|
if (item && item.key === "realConfirmTime") {
|
||||||
const now = this.updateParams.createTime;
|
const now = this.updateParams.taskInfo.processStartTime;
|
||||||
if (now > data) {
|
if (now > data) {
|
||||||
this.$message.error("确认时间不能早于上报时间")
|
this.$message.error("确认时间不能早于发起时间")
|
||||||
this.updateParams.realConfirmTime = null;
|
this.updateParams.realConfirmTime = null;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -938,10 +949,13 @@ export default class HiddenDangerManagerComponent extends BaseRecordComponent<an
|
||||||
occurNodeName: this.$store.getters.prevention_occur_step_map[row.occurNode],
|
occurNodeName: this.$store.getters.prevention_occur_step_map[row.occurNode],
|
||||||
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
professionClassifyName: this.$store.getters.prevention_major_type_map[row.professionClassify],
|
||||||
reformModeName: this.reformModeMap[row.reformMode],
|
reformModeName: this.reformModeMap[row.reformMode],
|
||||||
majorHazard: null
|
majorHazard: null,
|
||||||
|
processStartTime: row.taskInfo.processStartTime
|
||||||
}, row);
|
}, row);
|
||||||
this.updateParams.majorHazard = this.updateParams.majorHazard ? +this.updateParams.majorHazard : 0
|
this.updateParams.majorHazard = this.updateParams.majorHazard ? +this.updateParams.majorHazard : 0
|
||||||
this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
this.updateParams.majorHazardName = !this.updateParams.majorHazard ? '不涉及' : this.$store.getters.prevention_risk_source_map[this.updateParams.majorHazard]
|
||||||
|
const option = this.updateOptions.find(item => item.key === "processStartTime") as any;
|
||||||
|
option.hide = row.status === 0;
|
||||||
// 获取url
|
// 获取url
|
||||||
if (row.resourceId) {
|
if (row.resourceId) {
|
||||||
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((photos: any) => {
|
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((photos: any) => {
|
||||||
|
|
|
@ -295,7 +295,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 加载单元列表
|
// 加载单元列表
|
||||||
public loadUnitData(ids?) {
|
public loadUnitData(ids?, isVerify = false) {
|
||||||
if (!ids || ids.length === 0) {
|
if (!ids || ids.length === 0) {
|
||||||
this.unitList = []
|
this.unitList = []
|
||||||
const option = this.updateOptions.find(item => item.key === "units") as any;
|
const option = this.updateOptions.find(item => item.key === "units") as any;
|
||||||
|
@ -312,7 +312,11 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
const option = this.updateOptions.find(item => item.key === "units") as any;
|
const option = this.updateOptions.find(item => item.key === "units") as any;
|
||||||
option.datas = this.unitList
|
option.datas = this.unitList;
|
||||||
|
if (isVerify) {
|
||||||
|
//单元是否删除
|
||||||
|
this.judgeDeleteUnitMethod();
|
||||||
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -506,9 +510,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||||
//区域是否删除
|
//区域是否删除
|
||||||
let isDeleteArea = this.judgeDeleteAreaMethod(res);
|
let isDeleteArea = this.judgeDeleteAreaMethod(res);
|
||||||
if (!isDeleteArea) {
|
if (!isDeleteArea) {
|
||||||
this.loadUnitData(res.data.areas);
|
this.loadUnitData(res.data.areas, true);
|
||||||
//单元是否删除
|
|
||||||
this.judgeDeleteUnitMethod(res);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.updateParams.tableItems.forEach((item, i) => {
|
this.updateParams.tableItems.forEach((item, i) => {
|
||||||
|
@ -552,7 +555,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||||
* 判断单元是否删除
|
* 判断单元是否删除
|
||||||
* @param res
|
* @param res
|
||||||
*/
|
*/
|
||||||
public judgeDeleteUnitMethod(res: any) {
|
public judgeDeleteUnitMethod() {
|
||||||
let deleteData = [] as any;
|
let deleteData = [] as any;
|
||||||
this.updateParams.units.forEach((item, index) => {
|
this.updateParams.units.forEach((item, index) => {
|
||||||
const find = this.unitList.find((data: any) => data.value === item);
|
const find = this.unitList.find((data: any) => data.value === item);
|
||||||
|
|
|
@ -109,7 +109,10 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
public areaMap = {} as any;
|
public areaMap = {} as any;
|
||||||
public unitList = [] as any;
|
public unitList = [] as any;
|
||||||
public unitMap = {} as any;
|
public unitMap = {} as any;
|
||||||
|
//检查对象
|
||||||
|
public analControlList = [] as any;
|
||||||
|
//检查对象数据
|
||||||
|
public analControlNameList = {} as any;
|
||||||
|
|
||||||
public updateActions = [{
|
public updateActions = [{
|
||||||
name: "取消",
|
name: "取消",
|
||||||
|
@ -117,14 +120,14 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: "保存并继续添加",
|
name: "保存并继续添加",
|
||||||
hide: false,
|
|
||||||
value: "saveAndContinue",
|
value: "saveAndContinue",
|
||||||
type: "primary"
|
type: "primary",
|
||||||
|
hide: false,
|
||||||
}, {
|
}, {
|
||||||
name: "保存",
|
name: "保存",
|
||||||
value: "save",
|
value: "save",
|
||||||
type: "primary"
|
type: "primary"
|
||||||
},];
|
},] as any;
|
||||||
|
|
||||||
public selectData = [];
|
public selectData = [];
|
||||||
|
|
||||||
|
@ -263,7 +266,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
multiple: true,
|
multiple: true,
|
||||||
showError: false,
|
showError: false,
|
||||||
clearable: true,
|
clearable: true,
|
||||||
datas: this.$store.state.analControlList,
|
datas: this.analControlList,
|
||||||
}, {
|
}, {
|
||||||
name: "计划检查时间",
|
name: "计划检查时间",
|
||||||
key: "startTime",
|
key: "startTime",
|
||||||
|
@ -360,7 +363,7 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
// 加载单元列表
|
// 加载单元列表
|
||||||
public loadUnitData(ids?) {
|
public loadUnitData(ids?, isVerify = false) {
|
||||||
return new Promise<void>((resove, reject) => {
|
return new Promise<void>((resove, reject) => {
|
||||||
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
|
this.unitService.getListByIds({ areaIds: ids }, false).then((res: any) => {
|
||||||
this.unitList = res.data.map(item => {
|
this.unitList = res.data.map(item => {
|
||||||
|
@ -371,12 +374,35 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
value: item.id
|
value: item.id
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
});
|
});
|
||||||
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
|
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
|
||||||
if (option) {
|
if (option) {
|
||||||
option.datas = this.unitList;
|
option.datas = this.unitList;
|
||||||
}
|
}
|
||||||
|
if (isVerify) {
|
||||||
|
//单元是否删除
|
||||||
|
const isDeleteUnit = this.judgeDeleteUnitMethod(this.updateParams);
|
||||||
|
if (!isDeleteUnit) {
|
||||||
|
this.judgeAnalControl(this.updateParams)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
resove()
|
||||||
|
})
|
||||||
|
})
|
||||||
|
}
|
||||||
|
//加载检查对象
|
||||||
|
public loadAnalControlList(ids?) {
|
||||||
|
return new Promise<void>((resove, reject) => {
|
||||||
|
this.areaService.getAnalControls(ids).then((res: any) => {
|
||||||
|
this.analControlList = res.data.map((item) => {
|
||||||
|
this.analControlNameList[item.value] = item.name
|
||||||
|
return item
|
||||||
|
})
|
||||||
|
const option = this.updateOptions.find(item => item.key === "analControlIds") as any;
|
||||||
|
if (option) {
|
||||||
|
option.datas = this.analControlList;
|
||||||
|
}
|
||||||
|
|
||||||
resove()
|
resove()
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
@ -461,12 +487,20 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
this.buildUpdateForm();
|
this.buildUpdateForm();
|
||||||
}
|
}
|
||||||
if (item && item.key === "areaIds") {
|
if (item && item.key === "areaIds") {
|
||||||
if (!data) {
|
if (!data || !data.length) {
|
||||||
this.unitList = []
|
this.unitList = [];
|
||||||
|
const option = this.updateOptions.find(item => item.key === "unitIds") as any;
|
||||||
|
option.datas = []
|
||||||
|
this.updateParams.unitIds = null;
|
||||||
|
this.updateParams.unitIds = null;
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
this.loadUnitData(data)
|
this.loadUnitData(data)
|
||||||
}
|
}
|
||||||
|
//检查单元
|
||||||
|
if (item && item.key === 'unitIds') {
|
||||||
|
this.loadAnalControlList(data)
|
||||||
|
}
|
||||||
if (item && item.key === "chargeUserId") {
|
if (item && item.key === "chargeUserId") {
|
||||||
this.updateParams.chargeUserName = this.$store.getters.user_map[data]
|
this.updateParams.chargeUserName = this.$store.getters.user_map[data]
|
||||||
}
|
}
|
||||||
|
@ -582,9 +616,10 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
|
|
||||||
// 打开增改查弹窗
|
// 打开增改查弹窗
|
||||||
public async showUpdateModel(row?, isRead?) {
|
public async showUpdateModel(row?, isRead?) {
|
||||||
this.updateActions[1].hide = false;
|
this.updateActions[1].hide = row ? true : false;
|
||||||
this.isReadonly = !!isRead;
|
this.isReadonly = !!isRead;
|
||||||
if (row) {
|
if (row) {
|
||||||
|
await this.loadAnalControlList(row.unitIds)
|
||||||
if (isRead) {
|
if (isRead) {
|
||||||
await this.loadUnitData(row.areaIds)
|
await this.loadUnitData(row.areaIds)
|
||||||
this.updateParams = Object.assign({
|
this.updateParams = Object.assign({
|
||||||
|
@ -594,14 +629,15 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
inspectTypeName: this.$store.getters.prevention_danger_check_type_map[row.inspectType],
|
inspectTypeName: this.$store.getters.prevention_danger_check_type_map[row.inspectType],
|
||||||
inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit],
|
inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit],
|
||||||
}, row);
|
}, row);
|
||||||
|
this.updateParams.analControlNames = row.analControlIds.map(item => {
|
||||||
|
return this.analControlNameList[item] ? this.analControlNameList[item] : item
|
||||||
|
}).join(",")
|
||||||
} else {
|
} else {
|
||||||
this.updateParams = JSON.parse(JSON.stringify(row));
|
this.updateParams = JSON.parse(JSON.stringify(row));
|
||||||
//区域是否删除
|
//区域是否删除
|
||||||
let isDeleteArea = this.judgeDeleteAreaMethod(this.updateParams);
|
let isDeleteArea = this.judgeDeleteAreaMethod(this.updateParams);
|
||||||
if (!isDeleteArea) {
|
if (!isDeleteArea) {
|
||||||
this.loadUnitData(row.areaIds);
|
this.loadUnitData(row.areaIds, true);
|
||||||
//单元是否删除
|
|
||||||
this.judgeDeleteUnitMethod(this.updateParams);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (row.planType === 1) {
|
if (row.planType === 1) {
|
||||||
|
@ -630,7 +666,8 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
if (deleteData.length > 0) {
|
if (deleteData.length > 0) {
|
||||||
this.updateParams.areaIds = null;
|
this.updateParams.areaIds = null;
|
||||||
this.updateParams.unitIds = null;
|
this.updateParams.unitIds = null;
|
||||||
this.$confirm(`风险区域信息变更,请重新选择!`, "", {
|
this.updateParams.analControlIds = null;
|
||||||
|
this.$confirm(`检查区域信息变更,请重新选择!`, "", {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
|
@ -650,7 +687,6 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
* @param res
|
* @param res
|
||||||
*/
|
*/
|
||||||
public judgeDeleteUnitMethod(paramsData: any) {
|
public judgeDeleteUnitMethod(paramsData: any) {
|
||||||
|
|
||||||
let deleteData = [] as any;
|
let deleteData = [] as any;
|
||||||
paramsData.unitIds.forEach((item, index) => {
|
paramsData.unitIds.forEach((item, index) => {
|
||||||
const find = this.unitList.find((data: any) => data.value === item);
|
const find = this.unitList.find((data: any) => data.value === item);
|
||||||
|
@ -660,7 +696,33 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
});
|
});
|
||||||
if (deleteData.length > 0) {
|
if (deleteData.length > 0) {
|
||||||
this.updateParams.unitIds = null;
|
this.updateParams.unitIds = null;
|
||||||
this.$confirm(`风险单元信息变更,请重新选择!`, "", {
|
this.updateParams.analControlIds = null;
|
||||||
|
this.$confirm(`检查单元信息变更,请重新选择!`, "", {
|
||||||
|
type: 'warning',
|
||||||
|
showCancelButton: false,
|
||||||
|
closeOnClickModal: false,
|
||||||
|
}).then(() => {
|
||||||
|
//
|
||||||
|
}).catch(() => {
|
||||||
|
//
|
||||||
|
})
|
||||||
|
}
|
||||||
|
return !!deleteData.length
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 判断检查对象是否删除
|
||||||
|
*/
|
||||||
|
public judgeAnalControl(paramsData: any) {
|
||||||
|
let deleteData = [] as any;
|
||||||
|
paramsData.analControlIds.forEach((item, index) => {
|
||||||
|
const find = this.analControlList.find((data: any) => data.value === item);
|
||||||
|
if (!find) {
|
||||||
|
deleteData.push(item);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if (deleteData.length > 0) {
|
||||||
|
this.updateParams.analControlIds = null;
|
||||||
|
this.$confirm(`检查对象信息变更,请重新选择!`, "", {
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
showCancelButton: false,
|
showCancelButton: false,
|
||||||
closeOnClickModal: false,
|
closeOnClickModal: false,
|
||||||
|
@ -688,15 +750,19 @@ export default class PlanComponent extends BaseRecordComponent<any> {
|
||||||
//单元是否删除
|
//单元是否删除
|
||||||
let isDeleteUnit = this.judgeDeleteUnitMethod(JSON.parse(JSON.stringify(row)));
|
let isDeleteUnit = this.judgeDeleteUnitMethod(JSON.parse(JSON.stringify(row)));
|
||||||
if (!isDeleteUnit) {
|
if (!isDeleteUnit) {
|
||||||
|
await this.loadAnalControlList(row.unitIds);
|
||||||
|
//检查对象是否删除
|
||||||
|
let isDeleteAnal = this.judgeAnalControl(JSON.parse(JSON.stringify(row)));
|
||||||
|
if (!isDeleteAnal) {
|
||||||
this.updateActions[1].hide = true;
|
this.updateActions[1].hide = true;
|
||||||
this.currentPlan = row;
|
this.currentPlan = row;
|
||||||
this.showSend = true;
|
this.showSend = true;
|
||||||
this.tableTabs = [];
|
this.tableTabs = [];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public openRecordModel(row) {
|
public openRecordModel(row) {
|
||||||
|
|
|
@ -330,7 +330,11 @@ export default class IntegralMall extends BaseRecordComponent<any> {
|
||||||
id: res.data.id
|
id: res.data.id
|
||||||
}]
|
}]
|
||||||
this.updateParams.photo = this.photoList.length || null;
|
this.updateParams.photo = this.photoList.length || null;
|
||||||
this.buildUpdateForm()
|
if (this.photoList.length) {
|
||||||
|
const option = this.updateOptions.find(item => item.key === "photo") as any;
|
||||||
|
option.showError = false
|
||||||
|
}
|
||||||
|
// this.buildUpdateForm()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -67,6 +67,11 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
||||||
name: "隐患排查任务",
|
name: "隐患排查任务",
|
||||||
key: "taskName",
|
key: "taskName",
|
||||||
type: "text",
|
type: "text",
|
||||||
|
}, {
|
||||||
|
name: "重大危险源",
|
||||||
|
key: "majorHazard",
|
||||||
|
type: "select",
|
||||||
|
datas: this.$store.state.prevention_risk_source
|
||||||
}];
|
}];
|
||||||
|
|
||||||
public showUpdate = false;
|
public showUpdate = false;
|
||||||
|
@ -263,6 +268,12 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
||||||
this.tableColumn.push({ name: '管控对象', key: "analControlName" });
|
this.tableColumn.push({ name: '管控对象', key: "analControlName" });
|
||||||
this.tableColumn.push({ name: '分析对象', key: "itemName" });
|
this.tableColumn.push({ name: '分析对象', key: "itemName" });
|
||||||
this.tableColumn.push({ name: '管控措施', key: "measureDescription" });
|
this.tableColumn.push({ name: '管控措施', key: "measureDescription" });
|
||||||
|
this.tableColumn.push({
|
||||||
|
name: '重大危险源', key: 'majorHazard', render: (data) => {
|
||||||
|
data.majorHazard = parseInt(data.majorHazard)
|
||||||
|
return !data.majorHazard ? '--' : this.$store.getters.prevention_risk_source_map[data.majorHazard]
|
||||||
|
}
|
||||||
|
})
|
||||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName" });
|
this.tableColumn.push({ name: '隐患排查任务', key: "taskName" });
|
||||||
this.tableColumn.push({ name: '排查时间', key: "endTime" });
|
this.tableColumn.push({ name: '排查时间', key: "endTime" });
|
||||||
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" });
|
this.tableColumn.push({ name: '责任人', key: "taskChargeUserName" });
|
||||||
|
@ -421,6 +432,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
// 删除数据
|
// 删除数据
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,11 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
|
||||||
name: "是",
|
name: "是",
|
||||||
value: 1
|
value: 1
|
||||||
}]
|
}]
|
||||||
|
}, {
|
||||||
|
name: "重大危险源",
|
||||||
|
key: "majorHazard",
|
||||||
|
type: "select",
|
||||||
|
datas: this.$store.state.prevention_risk_source
|
||||||
}];
|
}];
|
||||||
|
|
||||||
public showUpdate = false;
|
public showUpdate = false;
|
||||||
|
@ -199,6 +204,12 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
|
||||||
|
|
||||||
public buildTable() {
|
public buildTable() {
|
||||||
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" });
|
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" });
|
||||||
|
this.tableColumn.push({
|
||||||
|
name: '重大危险源', key: 'majorHazard', render: (data) => {
|
||||||
|
data.majorHazard = parseInt(data.majorHazard)
|
||||||
|
return !data.majorHazard ? '--' : this.$store.getters.prevention_risk_source_map[data.majorHazard]
|
||||||
|
}
|
||||||
|
})
|
||||||
this.tableColumn.push({
|
this.tableColumn.push({
|
||||||
name: '排查结果', key: "result", render: (data) => {
|
name: '排查结果', key: "result", render: (data) => {
|
||||||
if (data.result == 2) {
|
if (data.result == 2) {
|
||||||
|
@ -275,6 +286,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
|
||||||
pageNum: 1,
|
pageNum: 1,
|
||||||
pageSize: 20,
|
pageSize: 20,
|
||||||
} as any;
|
} as any;
|
||||||
|
this.getTableData()
|
||||||
}
|
}
|
||||||
// 分页数据
|
// 分页数据
|
||||||
public getTableData() {
|
public getTableData() {
|
||||||
|
|
|
@ -33,7 +33,7 @@
|
||||||
</template>
|
</template>
|
||||||
<el-table-column label="操作" fixed="right" width="160">
|
<el-table-column label="操作" fixed="right" width="160">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<el-button type="text" @click="deleteData([scope.row])">删除</el-button>
|
<el-button type="text" @click="deleteData([scope.row.id])">删除</el-button>
|
||||||
<el-button type="text" @click="showSubModal(scope.row.id)">查看执行纪录</el-button>
|
<el-button type="text" @click="showSubModal(scope.row.id)">查看执行纪录</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
|
|
@ -108,7 +108,13 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
|
||||||
name: "隐患排查任务",
|
name: "隐患排查任务",
|
||||||
key: "taskName",
|
key: "taskName",
|
||||||
type: "text",
|
type: "text",
|
||||||
}];
|
},{
|
||||||
|
name: "重大危险源",
|
||||||
|
key: "majorHazard",
|
||||||
|
type: "select",
|
||||||
|
datas:this.$store.state.prevention_risk_source
|
||||||
|
}
|
||||||
|
];
|
||||||
|
|
||||||
public showUpdate = false;
|
public showUpdate = false;
|
||||||
public updateParams = {} as any;
|
public updateParams = {} as any;
|
||||||
|
|
|
@ -176,7 +176,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
|
||||||
width: "calc(50% - 20px)",
|
width: "calc(50% - 20px)",
|
||||||
showError: false,
|
showError: false,
|
||||||
rules: [
|
rules: [
|
||||||
{ pattern: /^(([1-9]?\d(\.\d{1,1})?)|99|99.0)$/, message: '支持输入两位整数,保留一位小数', }
|
{ pattern: /^[1-9]\d{0,2}(\.\d{1,1})?$/, message: '支持输入三位整数,保留一位小数', }
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue