feat:修复双预防平台bug

dev
kongyeqing 2023-09-25 17:40:22 +08:00
parent 558514599f
commit 478b1e3b84
11 changed files with 194 additions and 58 deletions

View File

@ -154,8 +154,8 @@ export default class AnalEvaluationComponent extends Vue {
public showRiskValueUpdate = false;
public showRiskValueModal: any = 'lslvalue'
;
public showRiskValueModal: any = 'lslvalue';
public riskTitle: any = '选择L值';
public riskTableData = [] as any;
@ -200,6 +200,12 @@ export default class AnalEvaluationComponent extends Vue {
required: true,
})
public analysisUpdateParams!: any;
@Watch("analysisUpdateParams", { immediate: true })
onChangeData(newValue, oldVale) {
if (!oldVale || (newValue.id !== oldVale.id)) {
this.buildInitData()
}
}
@PropSync("show", {
required: true,
@ -469,6 +475,7 @@ export default class AnalEvaluationComponent extends Vue {
width: "calc(50% - 20px)",
datas: this.$store.state.prevention_control_level,
showError: false,
disable: this.analysisUpdateParams.riskLevel === 4
}];
}
public triTableActions = [{
@ -638,7 +645,13 @@ export default class AnalEvaluationComponent extends Vue {
datas: this.$store.state.prevention_risk_level
},];
created() {
// created () {
// this.buildInitData()
// }
/**
* 初始化数据
*/
public buildInitData() {
this.$store.state.prevention_measures_sort.map((item) => {
this.measuresSelectData[item.value] = this.treeSelectData(item.children)
})
@ -741,7 +754,7 @@ export default class AnalEvaluationComponent extends Vue {
}
public dataCallback(data) {
console.log('返回数据', data);
//console.log('', data);
}
@ -884,7 +897,9 @@ export default class AnalEvaluationComponent extends Vue {
}
}
}
if(this.analysisUpdateParams.riskLevel === 4){
this.analysisUpdateParams.riskControlLevel = 1
}
this.riskUpdateForm()
this.remainUpdateForm()
}
@ -1071,9 +1086,7 @@ export default class AnalEvaluationComponent extends Vue {
//
this.clearShowError(this.methodUpdateParams, this.riskLECUpdateOptions)
}
this.showRiskValueUpdate = false;
console.log('methodUpdateParams', this.methodUpdateParams);
}
}
/**
@ -1170,7 +1183,6 @@ export default class AnalEvaluationComponent extends Vue {
vaildParams = false
}
if (vaildParams === true) {
console.log('this.analysisUpdateParams', this.analysisUpdateParams);
if (this.analysisUpdateParams.measures.length === 0) {
this.$message.warning('请添加管控措施!')
return

View File

@ -36,8 +36,8 @@ export default class AreaAnalService extends BaseService<any>{
}
}
public getAnalControls():Promise<AxiosResponse<ActionResult<any>>>{
public getAnalControls(params?):Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.prevention+'/risk/identifyinventory/getAnalControls';
return this.get(url,null,false)
return this.post(url,params,{},false)
}
}

View File

@ -471,9 +471,7 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
}
public addMarker() {
this.marker = new mapboxgl.Marker({ draggable: !this.isReadonly })
.setLngLat(this.center)
.addTo(this.map);
this.marker = new mapboxgl.Marker({ draggable: !this.isReadonly }).setLngLat(this.center).addTo(this.map);
this.map.flyTo({ center: this.center })
}
@ -579,7 +577,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
this.tableService.getNumber().then(res => {
this.updateParams.number = res.data;
this.center = [118.751353, 31.969568];
this.buildUpdateForm()
this.buildUpdateForm();
//
this.clearFileListMethod();
this.showUpdate = true;
})
} else {
@ -602,6 +602,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
//
this.center = [res.data.locationLng, res.data.locationLat];
this.buildUpdateForm();
//
this.clearFileListMethod();
if (row && !isRead) {
//
let isDeleteArea = !res.data.areaId ? true : this.judgeDeleteAreaMethod(res.data);
@ -702,6 +704,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
return
}
this.showUpdate = false;
//
this.clearFileListMethod();
this.updateParams = {} as any;
}
@ -730,11 +734,12 @@ 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.photoList.splice(this.photoList.findIndex(item => item.id === file.id), 1)
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)
this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1);
this.updateParams.fileList = this.photoList.length || null;
}
public onPreview(file) {
@ -813,6 +818,17 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public selectable(row) {
return row
}
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.photoList = [];
this.fileList = [];
const photoOption = this.updateOptions.find(item => item.key === "photo") as any;
photoOption.fileList = [];
const fileOption = this.updateOptions.find(item => item.key === "file") as any;
fileOption.fileList = [];
}
}
</script>
<style lang="scss" scoped src="../common.component.scss"></style>

View File

@ -115,6 +115,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public checkUpdateActions = [] as any;
public subUpdateOptions = [] as any;
//
public analControlList = [] as any;
//
public analControlNameList = [] as any;
public subUpdateActions = [{
name: "取消",
@ -220,6 +224,7 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
}, {
name: "适用类型",
key: "types",
format: "typesName",
type: "select",
width: "calc(50% - 20px)",
require: true,
@ -315,11 +320,33 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
option.datas = this.unitList;
if (isVerify) {
//
this.judgeDeleteUnitMethod();
const isDeleteUnit = this.judgeDeleteUnitMethod(this.updateParams);
console.log('isDeleteUnit',isDeleteUnit);
if (!isDeleteUnit) {
this.judgeAnalControl(this.updateParams)
}
}
})
}
//
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 === "targets") as any;
if (option) {
option.datas = this.analControlList;
}
resove()
})
})
}
public getNumber() {
this.tableService.getNumber().then(res => {
this.updateParams.number = res.data
@ -329,9 +356,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public buildTable() {
this.tableColumn = [];
this.tableColumn.push({ name: '检查表名称', key: "name" });
this.tableColumn.push({ name: '区域名称', key: "areas" });
this.tableColumn.push({ name: '单元名称', key: "units" });
this.tableColumn.push({ name: '对象名称', key: "targets" });
this.tableColumn.push({ name: '适用区域', key: "areas" });
this.tableColumn.push({ name: '适用单元', key: "units" });
this.tableColumn.push({ name: '适用对象', key: "targets" });
this.tableColumn.push({ name: '适用部门', key: "depts" });
this.tableColumn.push({
name: '适用类型', key: "types", filters: this.$store.state.prevention_dangrous_type.map(item => {
@ -373,6 +400,10 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.loadUnitData(data)
}
//
if (item && item.key === 'units') {
this.loadAnalControlList(data)
}
}
public callback(data, type?) {
@ -488,8 +519,6 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.showSubUpdate = true;
}
public showUpdateModel(row?, isRead?) {
this.updateParams = { number: null, tableItems: [] } as any;
this.isReadonly = !!isRead;
@ -505,13 +534,16 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.tableService.selectById(this.currentId, true).then((res: any) => {
if (isRead) {
this.updateParams = Object.assign(res.data, row)
this.updateParams.typesName = this.updateParams.types.split(',').map((item) => {
item = +item
return this.$store.getters.prevention_dangrous_type_map[item]
}).join(',')
} else {
this.updateParams = res.data;
//
let isDeleteArea = this.judgeDeleteAreaMethod(res);
if (!isDeleteArea) {
this.loadUnitData(res.data.areas, true);
}
}
this.updateParams.tableItems.forEach((item, i) => {
@ -537,7 +569,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
if (deleteData.length > 0) {
this.updateParams.areas = null;
this.updateParams.units = null;
this.$confirm(`风险区域信息变更,请重新选择!`, "", {
this.updateParams.targets = null;
this.$confirm(`适用区域信息已变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
@ -555,9 +588,9 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
* 判断单元是否删除
* @param res
*/
public judgeDeleteUnitMethod() {
public judgeDeleteUnitMethod(paramsData: any) {
let deleteData = [] as any;
this.updateParams.units.forEach((item, index) => {
paramsData.units.forEach((item, index) => {
const find = this.unitList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
@ -565,7 +598,8 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
});
if (deleteData.length > 0) {
this.updateParams.units = null;
this.$confirm(`风险单元信息变更,请重新选择!`, "", {
this.updateParams.targets = null;
this.$confirm(`适用单元信息已变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
@ -578,6 +612,33 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
return !!deleteData.length
}
/**
* 判断检查对象是否删除
*/
public judgeAnalControl(paramsData: any) {
let deleteData = [] as any;
paramsData.targets.forEach((item, index) => {
const find = this.analControlList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
}
});
if (deleteData.length > 0) {
this.updateParams.targets = null;
this.$confirm(`适用对象信息已变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!deleteData.length
}
public doSubSave(goOn?) {
if (!this.subUpdateParams.index) {
this.subUpdateParams.index = this.updateParams.tableItems.length + 1;

View File

@ -408,7 +408,6 @@ export default class PlanComponent extends BaseRecordComponent<any> {
})
}
public buildTable() {
this.tableColumn.push({ name: '检查标题', key: "name", width: "250px" });
this.tableColumn.push({

View File

@ -249,7 +249,7 @@ export default class AreaAnalComponent extends BaseRecordComponent<any> {
}
})
tmpRiskDatas.forEach((item: any) => {
item.result = Math.ceil(value / len).toString()
item.result =value ? Math.ceil(value / len).toString() :0
})
}
if (this.popTitle === 'S') {

View File

@ -93,10 +93,10 @@
</el-dialog>
<!-- 危害分析评价 -->
<el-dialog :close-on-click-modal="false" :visible.sync="showSubUpdate" width="952px"
:before-close="handleAnalyClose" destroy-on-close>
destroy-on-close>
<AnalEvaluationComponent :isReadonly="analyIsReadonly" :data.sync="analysisUpdateParams"
:show.sync="showSubUpdate" :tabledata.sync="updateParams" :areaList="areaList" :type="'work'"
:checkRiskType="checkRiskType"></AnalEvaluationComponent>
:checkRiskType="checkRiskType" ref="analEvaluation" ></AnalEvaluationComponent>
</el-dialog>
<!-- 作业步骤 -->
<el-dialog :close-on-click-modal="false" :title="`作业步骤(共${currentProTableData.datas.length}步)`"
@ -116,8 +116,12 @@
<div class="content-item">可能发生事故:<span>{{!item.seriousResult ? '--'
:item.seriousResult.split(",").map(items =>
seriousResultMap[items]).join(",")}}</span></div>
<div class="content-item">风险等级: <span style="color: #fff;" :class="`color_level_${item.riskLevel}`">{{!item.riskLevel ? '--':riskLevelMap[item.riskLevel]}}</span></div>
<div class="content-item">残余风险等级:<span style="color: #fff;" :class="`color_level_${item.remainLevel}`" >{{!item.remainLevel ? '--':riskLevelMap[item.remainLevel]}}</span></div>
<div class="content-item">风险等级: <span style="color: #fff;"
:class="`color_level_${item.riskLevel}`">{{!item.riskLevel ?
'--':riskLevelMap[item.riskLevel]}}</span></div>
<div class="content-item">残余风险等级:<span style="color: #fff;"
:class="`color_level_${item.remainLevel}`">{{!item.remainLevel ?
'--':riskLevelMap[item.remainLevel]}}</span></div>
</div>
</template>
</el-step>

View File

@ -392,7 +392,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
//
public loadAreaData() {
this.unitList = [];
this.jobList = [];
this.tableService.getDistinctList({}).then((res: any) => {
@ -979,13 +978,13 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
this.analyIsReadonly = true;
//select
this.analysisTransformParam(row);
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
this.analysisUpdateParams = Object.assign(this.analysisUpdateParams, row);
//
this.initAnalysisMeasure();
} else {
this.analyIsReadonly = false
//
this.analysisUpdateParams = { ...this.analysisUpdateParams, ...JSON.parse(JSON.stringify(row)) };
this.analysisUpdateParams = Object.assign(this.analysisUpdateParams, row);
//
this.updateAnalysisParam(row);
//
@ -993,7 +992,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
}
}
this.showSubUpdate = true
this.showSubUpdate = true;
}
//
@ -1063,7 +1062,6 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
return item
})
}
}
</script>
<style lang="scss" scoped src="../../../common.component.scss"></style>

View File

@ -26,7 +26,9 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
public params = {
orderByColumn: "",
isAsc: "desc"
isAsc: "desc",
pageNum: 1,
pageSize: 20,
} as any;
@ -72,6 +74,20 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
key: "majorHazard",
type: "select",
datas: this.$store.state.prevention_risk_source
}, {
name: "状态",
key: "status",
type: "select",
datas: [{
name: '已排查',
value: 1
}, {
name: '待排查',
value: 2
}, {
name: '超期未排查',
value: 3
}]
}];
public showUpdate = false;
@ -222,9 +238,9 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
onMove: this.onRemove2,
onPreview: this.onPreview,
autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf",
accept: "image/png, image/jpeg",
listType: "text",
tip: "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件",
tip: "请上传.pdf,.png,.jpg格式文件",
fileList: this.fileList,
btn: [{
name: "点击上传",
@ -342,6 +358,8 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
} else {
this.params.pageNum = 1
}
this.getTableData();
return
@ -395,7 +413,7 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
this.$store.state.userList.map((item) => {
this.userListName[item.value] = item.name
})
this.updateParams.checkTime = moment().format('YYYY-MM-DD HH:mm:ss')
this.updateParams.taskChargeUserName = this.userListName[this.account.userId]
this.updateParams.ownerName = this.userListName[this.updateParams.ownerId]
this.tableService.addOrUpdate(this.updateParams, this.updateParams.id).then((res) => {
@ -511,6 +529,8 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
}
//
public showSubModal(row) {
//
this.clearFileListMethod()
const mathData = Math.floor(Math.random() * 1000);
this.updateParams = Object.assign({
// checkUserId: this.account.userId,
@ -536,6 +556,15 @@ export default class DutyManagerComponent extends BaseRecordComponent<any> {
}
this.getTableData()
}
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.fileList = [];
const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any;
option.fileList = [];
}
}
</script>

View File

@ -123,26 +123,30 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
format: "dangerFlagName",
type: "radio",
require: true,
width: "calc(50% - 20px)"
width: "calc(50% - 20px)",
hide: this.updateParams.result === 1,
}, {
name: "问题描述",
key: "taskName",
type: "textarea",
require: true,
width: "calc(50% - 20px)"
width: "calc(50% - 20px)",
hide: this.updateParams.result === 1,
}, {
name: "隐患类别",
key: "dangerType",
format: "dangerTypeName",
type: "select",
require: true,
width: "calc(50% - 20px)"
width: "calc(50% - 20px)",
hide: this.updateParams.result === 1 || this.updateParams.dangerFlag == 0,
}, {
name: "隐患归属人",
key: "ownerId",
format: "ownerName",
require: true,
width: "calc(50% - 20px)"
width: "calc(50% - 20px)",
hide: this.updateParams.result === 1 || this.updateParams.dangerFlag == 0,
},
{
name: "IMEI码",
@ -203,6 +207,9 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
}
public buildTable() {
this.tableColumn.push({name:"是否包保责任人任务",key:"insuranceDutyFlag",width:"150px",render:(data)=>{
return data.insuranceDutyFlag === 1 ? '是':'否'
}})
this.tableColumn.push({ name: '隐患排查任务', key: "taskName", with: "250px" });
this.tableColumn.push({
name: '重大危险源', key: 'majorHazard', render: (data) => {
@ -258,7 +265,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
public callback(data, type) {
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
}
this.getTableData();
@ -370,7 +377,7 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
public showSubModal(row) {
this.photoList = []
this.photoList = [];
if (row.resourceId) {
this.tableService.getFileUrls({ ids: row.resourceId.split(",") }).then((photos: any) => {
this.photoList = photos.data.map(item => {
@ -384,18 +391,28 @@ export default class DutyRecordsManagerComponent extends BaseRecordComponent<any
this.subUpdateForm()
})
}
this.updateParams = Object.assign({
insuranceDutyFlagName: row.insuranceDutyFlag === 0 ? '否' : '是',
resultName: row.result === 1 ? '正常' : '异常',
dangerFlagName: row.dangerFlag === 0 ? '否' : row.dangerFlag === 1 ? '是' : null,
dangerTypeName: this.$store.getters.prevention_hazard_category_map[row.dangerType],
dangerTypeName: this.$store.getters.prevention_danger_type_map[row.dangerType],
checkUserName: this.$store.getters.user_map[row.checkUserId],
ownerName: this.$store.getters.user_map[row.ownerId],
}, row)
this.showUpdate = true
this.updateParams.resourceId = null
this.subUpdateForm()
//
this.clearFileListMethod()
}
/**
* 清除附件数据
*/
public clearFileListMethod() {
this.photoList = [];
const option = this.subUpdateOptions.find(item => item.key === "resourceId") as any;
option.fileList = [];
}
}
</script>

View File

@ -98,23 +98,23 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
}];
public formOptions: FormOption<BtnOption>[] = [{
name: "管控对象",
key: "controlName",
key: "analControlName",
type: "text",
}, {
name: "分析对象",
key: "analName",
key: "itemName",
type: "text",
}, {
name: "隐患排查任务",
key: "taskName",
type: "text",
},{
}, {
name: "重大危险源",
key: "majorHazard",
type: "select",
datas:this.$store.state.prevention_risk_source
datas: this.$store.state.prevention_risk_source
}
];
];
public showUpdate = false;
public updateParams = {} as any;
@ -331,7 +331,7 @@ export default class MeasuresReportManagerComponent extends BaseRecordComponent<
public callback(data, type) {
if (type) {
if (type === 'pageSize' || type === 'pageNum') {
if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data;
}
this.getTableData();