forked from xxhjsb/hbt-prevention-ui
feat:新增安全检查执行进程
parent
f210a60f6a
commit
0766894045
|
@ -39,6 +39,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
public params = {} as any;
|
||||
// 是否显示删改查按钮
|
||||
public isBase = true;
|
||||
public isClap = true;
|
||||
|
||||
public isAction = false;
|
||||
|
||||
|
@ -118,6 +119,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
public selectData = [];
|
||||
|
||||
public levelMap = ["","一般隐患","重大隐患"]
|
||||
public statusMap = ["未下发","已下发"];
|
||||
public reformModeMap = ["","即查即改","限期整改"]
|
||||
|
||||
|
||||
|
@ -414,6 +416,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
this.tableColumn.push({name:'隐患位置',key:"locationName"});
|
||||
this.tableColumn.push({name:'检查时间',key:"inspectTime"});
|
||||
this.tableColumn.push({name:'检查人员',key:"inspectUserName"});
|
||||
this.tableColumn.push({name:'下发状态',render:(data)=>{
|
||||
return `<span class="color_"${data.status}>${this.statusMap[data.status] || ""}</span>`
|
||||
}});
|
||||
}
|
||||
public getMap(map){
|
||||
this.map = map;
|
||||
|
@ -534,6 +539,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
id:item.id
|
||||
}
|
||||
})
|
||||
this.updateParams.photo = this.photoList.length || null;
|
||||
this.buildUpdateForm()
|
||||
})
|
||||
}
|
||||
|
@ -583,7 +589,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
type:res.data.type,
|
||||
id:res.data.id
|
||||
});
|
||||
this.updateParams.photo = this.photoList.length
|
||||
this.updateParams.photo = this.photoList.length || null;
|
||||
}
|
||||
}
|
||||
public onSuccess2(res,file,fileList){
|
||||
|
@ -599,7 +605,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
|
|||
|
||||
public onRemove(file,fileList){
|
||||
this.photoList.splice(this.photoList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
this.updateParams.photo = this.photoList.length
|
||||
this.updateParams.photo = this.photoList.length || null;
|
||||
}
|
||||
public onRemove2(file,fileList){
|
||||
this.fileList.splice(this.fileList.findIndex(item=>item.id === file.response.data.id),1)
|
||||
|
|
|
@ -33,7 +33,7 @@
|
|||
<el-table-column label="操作" :width="tableActionWidth">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" v-if="isBase || isFile" @click="showUpdateModel(scope.row,true)">查看</el-button>
|
||||
<el-button type="text" v-if="isBase" :disabled="isPlan && ((scope.row.planType===2 && scope.row.state) || (scope.row.planType===1 && scope.row.status)) || (isManager && scope.row.status)" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase && !(isClap && scope.row.status)" :disabled="isPlan && ((scope.row.planType===2 && scope.row.state) || (scope.row.planType===1 && scope.row.status)) || (isManager && scope.row.status)" @click="showUpdateModel(scope.row)">修改</el-button>
|
||||
<el-button type="text" v-if="isBase" :disabled="(isPlan && ((scope.row.planType===2 && (scope.row.state || scope.row.status)) || (scope.row.planType===1 && scope.row.status))) || (isManager && scope.row.status)" @click="deleteData([scope.row])">删除</el-button>
|
||||
<el-button type="text" v-if="isPlan && !scope.row.status" :disabled="scope.row.planType===2 && scope.row.state===0 " @click="openSendModel(scope.row)">下发</el-button>
|
||||
<el-button type="text" v-if="isPlan && scope.row.planType===2 && !scope.row.state" @click="changeState(scope.row)">启用</el-button>
|
||||
|
@ -94,14 +94,14 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="检查记录" width="280px">
|
||||
<div slot-scope="scope">
|
||||
<span v-if="hideActions || isPlan">{{scope.row.itemRecord}}</span>
|
||||
<span v-if="hideActions || isPlan || (isAction && !scope.row.userIds.includes(account.userId))">{{scope.row.itemRecord}}</span>
|
||||
<el-input v-else type="textarea" v-model="scope.row.itemRecord"></el-input>
|
||||
</div>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
<div class="sub-title" v-if="!hideActions">隐患登记情况</div>
|
||||
<div class="full" v-if="isAction && !hideActions">
|
||||
<div class="full" style="margin-bottom: 20px;" v-if="isAction && !hideActions">
|
||||
<el-button type="success" plain @click="showUpdateModel()" icon="el-icon-plus">添加</el-button>
|
||||
<el-button type="danger" plain @click="callback({value:'delete'})" icon="el-icon-delete">批量删除</el-button>
|
||||
</div>
|
||||
|
|
|
@ -9,6 +9,7 @@ import AreaService from "@/service/area.service"
|
|||
import FormOption from "hbt-common/models/formOptions"
|
||||
import BtnOption from "hbt-common/models/btnOptions"
|
||||
import DrawComponent from '@/components/draw.component.vue';
|
||||
import WorkFlowService from "@/service/workFlow.service"
|
||||
import TaskService from '@/service/task.service';
|
||||
import MapComponent from "@/components/map.component.vue"
|
||||
import mapboxgl from "mapbox-gl";
|
||||
|
@ -24,6 +25,7 @@ import moment from 'moment';
|
|||
})
|
||||
export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
||||
public tableService = new TaskService();
|
||||
public workFlowService = new WorkFlowService();
|
||||
|
||||
public isAction = true;
|
||||
// 显示计划列表按钮
|
||||
|
@ -401,7 +403,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
this.updateParams.resourceName = this.photoList.map(item=>item.name).join(",")
|
||||
this.updateParams.resourceOtherId = this.fileList.map(item=>item.id).join(",")
|
||||
this.updateParams.resourceOtherName = this.fileList.map(item=>item.name).join(",")
|
||||
this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then(res=>{
|
||||
this.tableService.addOrUpdate(this.updateParams,!this.updateParams.id).then((res:any)=>{
|
||||
this.$message.success(!this.updateParams.id?"新增成功!":"编辑成功");
|
||||
this.handleClose();
|
||||
this.getTroubleList();
|
||||
|
@ -613,9 +615,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
public getTroubleList(){
|
||||
this.tableService.getTroubleList(this.recordParams).then((res:any)=>{
|
||||
this.troubleTableData =res.data.map(data=>{
|
||||
data.urls = data.resources.map(source=>source.resourceUrl) || [];
|
||||
return data
|
||||
});
|
||||
|
||||
data.urls = data.resources.map(source=>source.resourceUrl) || [];
|
||||
return data
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -643,13 +646,36 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
this.selectData = data;
|
||||
}
|
||||
|
||||
public startWorkFlow(ids,userIds){
|
||||
const keyValue = ids.map(id=>{
|
||||
return {
|
||||
F_Id:id,
|
||||
F_FormId:1742822461669376,
|
||||
F_Type:2,
|
||||
F_UrlAddress:"ceshi1"
|
||||
}
|
||||
})
|
||||
this.workFlowService.startWorkFlow({
|
||||
"F_Id": "1743872031226688",
|
||||
"relationTaskList": "[]",
|
||||
"keyValue": JSON.stringify(keyValue),
|
||||
"userJson": "[]",
|
||||
"fileValue": [],
|
||||
"nextNodeName":"确认",
|
||||
"nodeName":"上报",
|
||||
"userList": userIds
|
||||
}).then((res:any)=>{
|
||||
this.getTableData()
|
||||
// 发起工作流成功
|
||||
})
|
||||
}
|
||||
|
||||
public doCheck(){
|
||||
const params = [] as any;
|
||||
let total = 0;
|
||||
this.tableTabs.forEach(item=>{
|
||||
total+=item.tableItems.length;
|
||||
item.tableItems.forEach(subItem=>{
|
||||
console.log(subItem)
|
||||
if(subItem.userIds.includes(this.account.userId)){
|
||||
params.push({
|
||||
content:subItem.itemRecord,
|
||||
|
@ -667,8 +693,14 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
|
|||
total,
|
||||
}).then(res=>{
|
||||
this.$message.success("检查成功");
|
||||
if(this.troubleTableData.length){
|
||||
this.troubleTableData.forEach((item)=>{
|
||||
this.startWorkFlow([item.dangerManageId],[item.reformUserId])
|
||||
})
|
||||
}else{
|
||||
this.getTableData()
|
||||
}
|
||||
this.handleClose();
|
||||
this.getTableData()
|
||||
})
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue