feat:修复bug

dev
kongyeqing 2023-09-18 17:44:07 +08:00
parent bd8a5466fe
commit 0fd8f2cb23
18 changed files with 403 additions and 107 deletions

View File

@ -1,33 +1,45 @@
<template> <template>
<el-tree :data="treeData" :props="{ children: 'children', label: 'name' }" :expand-on-click-node="false"
<el-tree :data="treeData" :props="{children:'children',label:'name'}" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick"> default-expand-all highlight-current @node-click="handleNodeClick">
</el-tree> <span class="span-ellipsis" slot-scope="{ node, data }">
<!-- <el-tooltip class="item" effect="light" :content="node.label||''" placement="top-start"> -->
<span>{{ node.label }}</span>
<!-- </el-tooltip> -->
</span>
</el-tree>
</template> </template>
<script lang="ts"> <script lang="ts">
import { Component, Emit, Prop, Vue } from 'vue-property-decorator'; import { Component, Emit, Prop, Vue } from 'vue-property-decorator';
import UnitService from '@/service/unit.service'; import UnitService from '@/service/unit.service';
@Component @Component
export default class UnitTreeComponent extends Vue { export default class UnitTreeComponent extends Vue {
public unitService:UnitService = new UnitService(); public unitService: UnitService = new UnitService();
public treeData = [] as any; public treeData = [] as any;
@Emit("callback") @Emit("callback")
handleNodeClick(data){ handleNodeClick(data) {
// //
} }
created(){ created() {
this.unitService.getUnitTree().then(res=>{ this.unitService.getUnitTree().then(res => {
this.treeData = [{ this.treeData = [{
name:"全部", name: "全部",
children:res.data children: res.data
}]; }];
}) })
} }
beforeDestory(){ beforeDestory() {
//
} }
} }
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
.span-ellipsis {
width: 100%;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
display: block;
}
</style> </style>

View File

@ -19,7 +19,7 @@ export default class integralFlowService extends BaseService<any>{
//设置审批人 //设置审批人
public taskCandidateSet(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{ public taskCandidateSet(params,showLoading?:boolean): Promise<AxiosResponse<ActionResult<any>>>{
const url = this.prefix.bpm+'/operate/candidateset'; const url = this.prefix.bpm+'/operate/candidate/set';
return this.post(url,params,{},true) return this.post(url,params,{},true)
} }

View File

@ -132,9 +132,11 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public loadAreaData() { public loadAreaData() {
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => { this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
this.areaList = res.data.datas.map(item => { this.areaList = res.data.datas.map(item => {
return { if (item.name) {
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
} }
}); });
}) })
@ -143,9 +145,11 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public loadUnitData(id?) { public loadUnitData(id?) {
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 => {
return { if (item.name) {
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
} }
}); });
const option = this.updateOptions.find(item => item.key === "unitId") as any; const option = this.updateOptions.find(item => item.key === "unitId") as any;
@ -469,6 +473,8 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
public change(data, item) { public change(data, item) {
if (item && item.key === "areaId") { if (item && item.key === "areaId") {
this.unitList = [];
this.updateParams.unitId = []
this.loadUnitData(data) this.loadUnitData(data)
} }
if (item && item.key === "inspectUserId") { if (item && item.key === "inspectUserId") {
@ -493,9 +499,9 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
} }
if (item && item.key === 'violateNumber') { if (item && item.key === 'violateNumber') {
this.updateParams.violateNumber = null this.updateParams.violateNumber = null
setTimeout(()=>{ setTimeout(() => {
this.updateParams.violateNumber = +data.toFixed(0) this.updateParams.violateNumber = +data.toFixed(0)
},0) }, 0)
} }
// //
} }
@ -568,6 +574,9 @@ 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],
@ -577,16 +586,26 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
occurNodeName: this.$store.getters.prevention_occur_step_map[res.data.occurNode], occurNodeName: this.$store.getters.prevention_occur_step_map[res.data.occurNode],
professionClassifyName: this.$store.getters.prevention_major_type_map[res.data.professionClassify], professionClassifyName: this.$store.getters.prevention_major_type_map[res.data.professionClassify],
reformModeName: this.reformModeMap[res.data.reformMode], reformModeName: this.reformModeMap[res.data.reformMode],
unitName: (this.unitList.find((item: any) => item.value === res.data.unitId) as any).name, unitName: (this.unitList.find((item: any) => item.value === res.data.unitId) as any)?.name ?? null,
areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any).name, areaName: (this.areaList.find((item: any) => item.value === res.data.areaId) as any)?.name ?? null,
type: "随手拍", type: "随手拍",
}, res.data) }, res.data)
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]
// //
this.center = [res.data.locationLng, res.data.locationLat]; this.center = [res.data.locationLng, res.data.locationLat];
this.buildUpdateForm() this.buildUpdateForm();
if (row && !isRead) {
//
let isDeleteArea = !res.data.areaId ? true : this.judgeDeleteAreaMethod(res.data);
if (!isDeleteArea) {
this.loadUnitData(res.data.areaId);
//
if (res.data.unitId) {
this.judgeDeleteUnitMethod(res.data);
}
}
}
// url // url
if (res.data.resourceId) { if (res.data.resourceId) {
this.updateParams.photo = 1; this.updateParams.photo = 1;
@ -621,6 +640,48 @@ export default class HiddenDangerClapComponent extends BaseRecordComponent<any>
} }
} }
/**
* 判断区域是否删除
* @param res
*/
public judgeDeleteAreaMethod(res: any) {
const find = this.areaList.find((data: any) => data.value === res.areaId);
if (!find) {
this.updateParams.areaId = null;
this.updateParams.unitId = null;
this.$confirm(`风险区域信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!find
}
/**
* 判断单元是否删除
* @param res
*/
public judgeDeleteUnitMethod(res: any) {
const find = this.unitList.find((data: any) => data.value === res.unitId);
if (!find) {
this.updateParams.unitId = [];
this.$confirm(`风险单元信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!find
}
public onDragEnd() { public onDragEnd() {
const lngLat = this.marker.getLngLat(); const lngLat = this.marker.getLngLat();
this.updateParams.locationLng = lngLat.lng; this.updateParams.locationLng = lngLat.lng;

View File

@ -456,19 +456,22 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
}, { }, {
name: "治理资金", name: "治理资金",
type: "number", type: "number",
width: "35%", width: "calc(50% - 20px)",
key: "executeMoney", key: "executeMoney",
require: true, require: true,
hide: this.updateParams.reformConfirmFlag === 0, hide: this.updateParams.reformConfirmFlag === 0,
showError: false, showError: false,
rules: [
{ pattern: /^[1-9]\d{0,7}(\.\d{1,3})?$/, message: '不超过八位的整数', },
],
unit: { unit: {
name: "¥", name: "",
type: "text" type: "text"
} }
}, { }, {
name: "", name: "资金来源",
type: "textarea", type: "textarea",
width: "calc(65% - 40px)", width: "calc(50% - 20px)",
key: "executeMoneySource", key: "executeMoneySource",
hide: this.updateParams.reformConfirmFlag === 0, hide: this.updateParams.reformConfirmFlag === 0,
placeholder: "请输入资金来源" placeholder: "请输入资金来源"
@ -479,6 +482,13 @@ export default class HiddenDangerFilesComponent extends BaseRecordComponent<any>
key: "realConfirmUserName", key: "realConfirmUserName",
require: true, require: true,
disable: true, disable: true,
}, {
name: "确认人",
type: "text",
width: "calc(50% - 20px)",
key: "realConfirmUserName",
require: true,
disable: true,
}, { }, {
name: "确认时间", name: "确认时间",
type: "date", type: "date",

View File

@ -282,9 +282,11 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
public loadAreaData() { public loadAreaData() {
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => { this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
this.areaList = res.data.datas.map(item => { this.areaList = res.data.datas.map(item => {
return { if (item.name) {
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
} }
}); });
}) })
@ -299,9 +301,11 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
} }
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 => {
return { if (item.name) {
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
} }
}); });
const option = this.updateOptions.find(item => item.key === "units") as any; const option = this.updateOptions.find(item => item.key === "units") as any;
@ -354,9 +358,6 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
} }
public change(data, item) { public change(data, item) {
console.log('item', item);
console.log('data', data);
// //
if (item && item.key === "areas") { if (item && item.key === "areas") {
if (this.updateParams.units.length) { if (this.updateParams.units.length) {
@ -498,9 +499,14 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.updateParams = Object.assign(res.data, row) this.updateParams = Object.assign(res.data, row)
} else { } else {
this.updateParams = res.data; this.updateParams = res.data;
this.loadUnitData(res.data.areas) //
let isDeleteArea = this.judgeDeleteAreaMethod(res);
if (!isDeleteArea) {
this.loadUnitData(res.data.areas);
//
this.judgeDeleteUnitMethod(res);
}
} }
this.updateParams.tableItems.forEach((item, i) => { this.updateParams.tableItems.forEach((item, i) => {
item.index = i + 1 item.index = i + 1
}) })
@ -508,10 +514,63 @@ export default class RulesManagerComponent extends BaseRecordComponent<any> {
this.showUpdate = true; this.showUpdate = true;
}) })
} }
} }
/**
* 判断区域是否删除
* @param res
*/
public judgeDeleteAreaMethod(res: any) {
let deleteData = [] as any;
this.updateParams.areas.forEach((item, index) => {
const find = this.areaList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
}
});
if (deleteData.length > 0) {
this.updateParams.areas = null;
this.updateParams.units = null;
this.$confirm(`风险区域信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!deleteData.length
}
/**
* 判断单元是否删除
* @param res
*/
public judgeDeleteUnitMethod(res: any) {
let deleteData = [] as any;
this.updateParams.units.forEach((item, index) => {
const find = this.unitList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
}
});
if (deleteData.length > 0) {
this.updateParams.units = null;
this.$confirm(`风险单元信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!deleteData.length
}
public doSubSave(goOn?) { public doSubSave(goOn?) {
if (!this.subUpdateParams.index) { if (!this.subUpdateParams.index) {
this.subUpdateParams.index = this.updateParams.tableItems.length + 1; this.subUpdateParams.index = this.updateParams.tableItems.length + 1;

View File

@ -344,16 +344,16 @@ export default class PlanComponent extends BaseRecordComponent<any> {
}] }]
}) })
} }
// //
public loadAreaData() { public loadAreaData() {
this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => { this.areaService.selectByPage({ pageSize: 1000 }).then((res: any) => {
this.areaList = res.data.datas.map(item => { this.areaList = res.data.datas.map(item => {
this.areaMap[item.id] = item.name; if (item.name) {
return { this.areaMap[item.id] = item.name;
name: item.name, return {
value: item.id name: item.name,
value: item.id
}
} }
}); });
}) })
@ -363,18 +363,20 @@ export default class PlanComponent extends BaseRecordComponent<any> {
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 => {
this.unitMap[item.id] = item.name; if (item.name) {
return { this.unitMap[item.id] = item.name;
name: item.name, return {
value: item.id name: item.name,
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;
} }
resove() resove()
// this.buildUpdateForm()
}) })
}) })
} }
@ -578,14 +580,25 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.updateActions[2].hide = false; this.updateActions[2].hide = false;
this.isReadonly = !!isRead; this.isReadonly = !!isRead;
if (row) { if (row) {
await this.loadUnitData(row.areaIds) if (isRead) {
this.updateParams = Object.assign({ await this.loadUnitData(row.areaIds)
planTypeName: this.planTypeMap[row.planType], this.updateParams = Object.assign({
areaNames: row.areaIds.map(item => this.areaMap[item]).join(","), planTypeName: this.planTypeMap[row.planType],
unitNames: row.unitIds.map(item => this.unitMap[item]).join(","), areaNames: row.areaIds.map(item => this.areaMap[item]).join(","),
inspectTypeName: this.$store.getters.prevention_danger_check_type_map[row.inspectType], unitNames: row.unitIds.map(item => this.unitMap[item]).join(","),
inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit], inspectTypeName: this.$store.getters.prevention_danger_check_type_map[row.inspectType],
}, row); inspectCycleUnitName: this.$store.getters.prevention_cycle_unit_map[row.inspectCycleUnit],
}, row);
} else {
this.updateParams = JSON.parse(JSON.stringify(row));
//
let isDeleteArea = this.judgeDeleteAreaMethod(this.updateParams);
if (!isDeleteArea) {
this.loadUnitData(row.areaIds);
//
this.judgeDeleteUnitMethod(this.updateParams);
}
}
if (row.planType === 1) { if (row.planType === 1) {
this.$set(this.updateParams, "time", isRead ? row.startTime + "~" + row.endTime : [row.startTime, row.endTime]) this.$set(this.updateParams, "time", isRead ? row.startTime + "~" + row.endTime : [row.startTime, row.endTime])
} else if (row.planType === 2) { } else if (row.planType === 2) {
@ -597,18 +610,88 @@ export default class PlanComponent extends BaseRecordComponent<any> {
this.buildUpdateForm(); this.buildUpdateForm();
this.showUpdate = true this.showUpdate = true
} }
/**
* 判断区域是否删除
* @param res
*/
public judgeDeleteAreaMethod(paramsData: any) {
let deleteData = [] as any;
paramsData.areaIds.forEach((item, index) => {
const find = this.areaList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
}
});
if (deleteData.length > 0) {
this.updateParams.areaIds = null;
this.updateParams.unitIds = null;
this.$confirm(`风险区域信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!deleteData.length
}
/**
* 判断单元是否删除
* @param res
*/
public judgeDeleteUnitMethod(paramsData: any) {
let deleteData = [] as any;
paramsData.unitIds.forEach((item, index) => {
const find = this.unitList.find((data: any) => data.value === item);
if (!find) {
deleteData.push(item);
}
});
if (deleteData.length > 0) {
this.updateParams.unitIds = null;
this.$confirm(`风险单元信息变更,请重新选择!`, "", {
type: 'warning',
showCancelButton: false,
closeOnClickModal: false,
}).then(() => {
//
}).catch(() => {
//
})
}
return !!deleteData.length
}
// //
public openSendModel(row) { public async openSendModel(row) {
const now = moment().format("YYYY-MM-DD HH:mm:ss") const now = moment().format("YYYY-MM-DD HH:mm:ss")
if (row.startTime < now) { if (row.startTime < now) {
this.$message.error("检查开始时间不能早于当前时间,请先修改数据"); this.$message.error("检查开始时间不能早于当前时间,请先修改数据");
return return
} }
this.updateActions[2].hide = true; //
this.currentPlan = row; let isDeleteArea = this.judgeDeleteAreaMethod(JSON.parse(JSON.stringify(row)));
this.showSend = true; if (!isDeleteArea) {
this.tableTabs = []; await this.loadUnitData(row.areaIds);
//
let isDeleteUnit = this.judgeDeleteUnitMethod(JSON.parse(JSON.stringify(row)));
if (!isDeleteUnit) {
this.updateActions[2].hide = true;
this.currentPlan = row;
this.showSend = true;
this.tableTabs = [];
}
} else {
return
}
} }
public openRecordModel(row) { public openRecordModel(row) {

View File

@ -25,7 +25,7 @@
<el-table-column v-if="item.imgRender" :label="item.name" :width="item.width" :key="item.key"> <el-table-column v-if="item.imgRender" :label="item.name" :width="item.width" :key="item.key">
<template slot-scope="scope"> <template slot-scope="scope">
<img :src="item.imgRender(scope.row)" min-width="70" height="70" <img :src="item.imgRender(scope.row)" min-width="70" height="70"
style="cursor: pointer;" @click="onclickImg(item.imgRender(scope.row))"> style="cursor: pointer;" @click="onclickImg(item.imgRender(scope.row))"/>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column v-if="!item.render && !item.imgRender" :prop="item.key" :label="item.name" <el-table-column v-if="!item.render && !item.imgRender" :prop="item.key" :label="item.name"

View File

@ -21,7 +21,7 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
public tableService = new IntegralEventService(); public tableService = new IntegralEventService();
public params = { public params = {
userId: null, userName: null,
createTime: null, createTime: null,
} as any; } as any;
@ -75,15 +75,14 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
public formOptions: FormOption<BtnOption>[] = [{ public formOptions: FormOption<BtnOption>[] = [{
name: "姓名", name: "姓名",
key: "userId", key: "userName",
type: "select", type: "text",
datas: this.$store.state.userList
}, { }, {
name: "时间", name: "时间",
key: "createTime", key: "createTime",
type: "date", type: "date",
subType: "datetimerange", subType: "datetimerange",
format: 'yyyy-MM-dd HH:mm:ss' format: 'yyyy-MM-dd HH:mm'
}]; }];
public subActions = [{ public subActions = [{
@ -183,11 +182,11 @@ export default class IntegralEvent extends BaseRecordComponent<any> {
public toggleAll() { public toggleAll() {
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
(this.$refs.multipleTable as any).toggleRowSelection(item); (this.$refs.multipleTable as any).toggleRowSelection(item);
}) })
} }
public selectAll() { public selectAll() {
if (!this.selectData.length) { if (!this.selectData.length) {
this.toggleAll() this.toggleAll()

View File

@ -379,9 +379,9 @@ export default class IntegralExchange extends BaseRecordComponent<any> {
return `<span class="color_1">结束</span>` return `<span class="color_1">结束</span>`
} else { } else {
if (data.status === 1) { if (data.status === 1) {
return `<span class="color_3">申请</span>` return `<span class="color_2">申请</span>`
} else if (data.status === 2) { } else if (data.status === 2) {
return `<span class="color_3">审批中</span>` return `<span class="color_2">审批中</span>`
} }
} }
} }

View File

@ -527,7 +527,7 @@ export default class DeviceManagerComponent extends BaseRecordComponent<any> {
if (!this.selectData.length) { if (!this.selectData.length) {
this.toggleAll() this.toggleAll()
} else { } else {
console.log('this.tableData.datas',this.tableData.datas); console.log('this.tableData.datas', this.tableData.datas);
this.tableData.datas.forEach((item, index) => { this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.id === item.id); const find = this.selectData.find((data: any) => data.id === item.id);

View File

@ -570,6 +570,9 @@ export default class BusinessInfo extends BaseRecordComponent<any> {
}) })
this.updateParams.planViewResourceId = resourceId.join(",") this.updateParams.planViewResourceId = resourceId.join(",")
this.updateParams.planViewResourceName = resourceName.join(",") this.updateParams.planViewResourceName = resourceName.join(",")
} else {
this.updateParams.planViewResourceId = '';
this.updateParams.planViewResourceName = '';
} }
if (this.fileList2.length > 0) { if (this.fileList2.length > 0) {
@ -582,6 +585,9 @@ export default class BusinessInfo extends BaseRecordComponent<any> {
}) })
this.updateParams.orgResourceId = resourceId.join(",") this.updateParams.orgResourceId = resourceId.join(",")
this.updateParams.orgResourceName = resourceName.join(",") this.updateParams.orgResourceName = resourceName.join(",")
} else {
this.updateParams.orgResourceId = '';
this.updateParams.orgResourceId = '';
} }
// //

View File

@ -219,9 +219,9 @@ export default class RiskJudgment extends BaseRecordComponent<any> {
onMove: this.onRemove, onMove: this.onRemove,
onPreview: this.onPreview, onPreview: this.onPreview,
autoUpload: true, autoUpload: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf", accept: "image/png, image/jpeg",
listType: "text", listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件", tip: this.isReadonly ? "" : "请上传.png,.jpg格式文件",
fileList: this.fileList, fileList: this.fileList,
btn: [{ btn: [{
name: "上传附件", name: "上传附件",
@ -442,7 +442,7 @@ export default class RiskJudgment extends BaseRecordComponent<any> {
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
if (type === 'pageSize' || type === 'pageNum') { if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data; this.params[type] = data;
} }
this.getTableData(); this.getTableData();

View File

@ -62,8 +62,8 @@
</el-dialog> </el-dialog>
<!-- 公告情况 --> <!-- 公告情况 -->
<el-dialog :close-on-click-modal="false" :title="subTitle" :visible.sync="showNoticeInfo" width="1080px" <el-dialog v-if="noticeInfoData.length" :close-on-click-modal="false" :title="subTitle"
destroy-on-close> :visible.sync="showNoticeInfo" width="1080px" destroy-on-close>
<el-table :data="noticeInfoData" height="100%" border row-key="checked" style="width: 100%"> <el-table :data="noticeInfoData" height="100%" border row-key="checked" style="width: 100%">
<el-table-column label="序号" width="60"> <el-table-column label="序号" width="60">
<template slot-scope="scope"> <template slot-scope="scope">
@ -73,12 +73,20 @@
<template v-for="item in noticeInfoColumn"> <template v-for="item in noticeInfoColumn">
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name" <el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
:width="item.width" :key="item.key"> :width="item.width" :key="item.key">
<div :class="item.showTip ?'column-cell-render' :''" slot-scope="scope" <div slot-scope="scope" v-html="item.render(scope.row)" :filters="item.filters"
v-html="item.render(scope.row)" :filters="item.filters" :filter-method="item.filterMethod" :filter-method="item.filterMethod" @click="showDetails($event,scope.row)"></div>
@click="showDetails($event,scope.row)"></div>
</el-table-column> </el-table-column>
<el-table-column v-else :prop="item.key" :label="item.name" :width="item.width" :key="item.key" <el-table-column v-if="item.imgRender" :label="item.name" :width="item.width" :key="item.key">
:filters="item.filters" :filter-method="item.filterMethod" :show-overflow-tooltip="item.showTip">
<template slot-scope="scope">
<img :src="item.imgRender(scope.row)" min-width="70" height="70" style="cursor: pointer;"
@click="onclickImg(item.imgRender(scope.row))" />
</template>
</el-table-column>
<el-table-column v-if="!item.render && !item.imgRender" :prop="item.key" :label="item.name"
:width="item.width" :key="item.key" :filters="item.filters" :filter-method="item.filterMethod"
:show-overflow-tooltip="item.showTip">
</el-table-column> </el-table-column>
</template> </template>
</el-table> </el-table>

View File

@ -216,9 +216,9 @@ export default class SafetyNotice extends BaseRecordComponent<any> {
onPreview: this.onPreview, onPreview: this.onPreview,
autoUpload: true, autoUpload: true,
require: true, require: true,
accept: "image/png, image/jpeg,.doc,.docx,.xls,.xlsx,.pdf", accept: "image/png, image/jpeg",
listType: "text", listType: "text",
tip: this.isReadonly ? "" : "请上传.pdf,.png,.jpg,.doc.docx,.xls,.xlsx格式文件", tip: this.isReadonly ? "" : "请上传.png,.jpg格式文件",
fileList: this.fileList, fileList: this.fileList,
btn: [{ btn: [{
name: "上传附件", name: "上传附件",
@ -301,7 +301,7 @@ export default class SafetyNotice extends BaseRecordComponent<any> {
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
if (type === 'pageSize' || type === 'pageNum') { if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data; this.params[type] = data;
} }
this.getTableData(); this.getTableData();
@ -431,11 +431,10 @@ export default class SafetyNotice extends BaseRecordComponent<any> {
* @param isReadonly 是否是查看 * @param isReadonly 是否是查看
*/ */
public showUpdateModel(row: any, isReadonly = false) { public showUpdateModel(row: any, isReadonly = false) {
console.log('row', row);
this.updateParams = {} as any; this.updateParams = {} as any;
this.fileList = [] this.fileList = []
this.isReadonly = isReadonly this.isReadonly = isReadonly
this.tableService.selectByDetail({ id: row.id, type: this.params.type }).then((res: any) => { this.tableService.selectByDetail({ id: row.id, type: this.params.type, status: row.status }).then((res: any) => {
this.updateParams = Object.assign(res.data, row); this.updateParams = Object.assign(res.data, row);
if (!this.updateParams.promise) { if (!this.updateParams.promise) {
this.updateParams.promise = this.defaultPromise[this.params.type] this.updateParams.promise = this.defaultPromise[this.params.type]
@ -498,13 +497,46 @@ export default class SafetyNotice extends BaseRecordComponent<any> {
* @param data 当前行数据 * @param data 当前行数据
*/ */
public showDetails(el, data) { public showDetails(el, data) {
this.noticeInfoData = [] as any;
if (el.target.classList.contains("situation")) { if (el.target.classList.contains("situation")) {
this.tableService.selectTaskByDetail({ id: data.id, type: this.params.type }).then((res: any) => { this.tableService.selectTaskByDetail({ id: data.id, type: this.params.type }).then((res: any) => {
console.log('res', res); let resourceId = [] as any;
this.noticeInfoData = res.data res.data.forEach((item: any) => {
//column if (item.resourceId) {
this.buildNoticeInfoColumn() resourceId.push(item.resourceId)
this.showNoticeInfo = true }
})
if (resourceId.length > 0) {
let addUrlList = [] as any;
this.tableService.getFileUrls({ ids: resourceId }).then((files: any) => {
addUrlList = res.data.map((item: any) => {
let url = '';
files.data.filter(it => it.id == item.resourceId).forEach((file) => {
url = file.url
})
return {
...item,
url: url
}
});
this.noticeInfoData = addUrlList;
//column
this.buildNoticeInfoColumn()
this.showNoticeInfo = true
}).catch((err) => {
this.noticeInfoData = res.data;
//column
this.buildNoticeInfoColumn()
this.showNoticeInfo = true
})
} else {
this.noticeInfoData = res.data;
//column
this.buildNoticeInfoColumn()
this.showNoticeInfo = true
}
}) })
} }
} }
@ -514,21 +546,35 @@ export default class SafetyNotice extends BaseRecordComponent<any> {
public buildNoticeInfoColumn() { public buildNoticeInfoColumn() {
this.noticeInfoColumn = [] as any; this.noticeInfoColumn = [] as any;
if (this.params.type === 2) { if (this.params.type === 2) {
this.noticeInfoColumn.push({ name: '班组名称', key: "riskNumber", }) this.noticeInfoColumn.push({ name: '班组名称', key: "name", })
this.noticeInfoColumn.push({ name: '班组负责人', key: "chargeUserName", }) this.noticeInfoColumn.push({ name: '班组负责人', key: "chargeUserName", })
} }
if (this.params.type === 3) { if (this.params.type === 3) {
this.noticeInfoColumn.push({ name: '车间名称', key: "riskNumber", }) this.noticeInfoColumn.push({ name: '车间名称', key: "name", })
this.noticeInfoColumn.push({ name: '车间负责人', key: "chargeUserName", }) this.noticeInfoColumn.push({ name: '车间负责人', key: "chargeUserName", })
} }
this.noticeInfoColumn.push({ name: '风险点', key: "riskNumber", }) this.noticeInfoColumn.push({ name: '风险点', key: "riskNumber", })
this.noticeInfoColumn.push({ name: '作业数量', key: "riskNumber", }) this.noticeInfoColumn.push({ name: '作业数量', key: "jobNumber", })
this.noticeInfoColumn.push({ this.noticeInfoColumn.push({
name: '承诺状态', key: "status", render: (data) => { name: '承诺状态', key: "status", render: (data: any) => {
return `<span style="color:${this.tableStateColor[data.status]}">${this.tableState[data.status]}</span>` return `<span style="color:${this.tableStateColor[data.status]}">${this.tableState[data.status]}</span>`
} }
}) })
this.noticeInfoColumn.push({ name: '签名', key: "riskNumber", }) this.noticeInfoColumn.push({
name: '签名', key: "url", imgRender: (data) => {
if (data.resourceId) {
return data.url
}
}
})
}
/**
* 查看图片
* @param data
*/
public onclickImg(data: any) {
this.currentUrl = data;
this.showFile = true;
} }
} }
</script> </script>

View File

@ -208,7 +208,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
datas: this.$store.state.prevention_security_identifier, datas: this.$store.state.prevention_security_identifier,
filterable: true, filterable: true,
multiple: true, multiple: true,
clearable:true, clearable: true,
}, },
{ {
name: "风险管控措施", name: "风险管控措施",
@ -351,7 +351,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
if (type === 'pageSize' || type === 'pageNum') { if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data; this.params[type] = data;
} }
this.getTableData(); this.getTableData();
@ -459,7 +459,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
} }
public onRemove(file, fileList) { public onRemove(file, fileList) {
this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1) this.fileList.splice(this.fileList.findIndex(item => item.id === file.id), 1);
} }
public onPreview(file) { public onPreview(file) {
@ -504,6 +504,9 @@ export default class RiskCard extends BaseRecordComponent<any> {
}) })
this.subUpdateParams.resourceId = resourceId.join(",") this.subUpdateParams.resourceId = resourceId.join(",")
this.subUpdateParams.resourceName = resourceName.join(",") this.subUpdateParams.resourceName = resourceName.join(",")
} else {
this.subUpdateParams.resourceId = '';
this.subUpdateParams.resourceName = '';
} }
this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode] this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode]
this.subUpdateParams.safetySign = this.subUpdateParams.safetySign.join(",") this.subUpdateParams.safetySign = this.subUpdateParams.safetySign.join(",")

View File

@ -279,7 +279,7 @@ export default class SafeCard extends BaseRecordComponent<any> {
public callback(data, type) { public callback(data, type) {
if (type) { if (type) {
if (type === 'pageSize' || type === 'pageNum') { if (type === 'pageSize' || type === 'pageNum') {
this.params[type] = data; this.params[type] = data;
} }
this.getTableData(); this.getTableData();
@ -426,6 +426,9 @@ export default class SafeCard extends BaseRecordComponent<any> {
}) })
this.subUpdateParams.resourceId = resourceId.join(",") this.subUpdateParams.resourceId = resourceId.join(",")
this.subUpdateParams.resourceName = resourceName.join(",") this.subUpdateParams.resourceName = resourceName.join(",")
} else {
this.subUpdateParams.resourceId = '';
this.subUpdateParams.resourceName = '';
} }
this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode] this.subUpdateParams.postName = this.$store.getters.post_map[this.subUpdateParams.postCode]
this.subUpdateParams.promiserName = this.$store.getters.user_map[this.subUpdateParams.promiserId] this.subUpdateParams.promiserName = this.$store.getters.user_map[this.subUpdateParams.promiserId]

View File

@ -438,6 +438,9 @@ export default class ManagementSystem extends BaseRecordComponent<any> {
}) })
this.subUpdateParams.resourceId = resourceId.join(",") this.subUpdateParams.resourceId = resourceId.join(",")
this.subUpdateParams.resourceName = resourceName.join(",") this.subUpdateParams.resourceName = resourceName.join(",")
} else {
this.subUpdateParams.resourceId = '';
this.subUpdateParams.resourceName = '';
} }
this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId]; this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId];
this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId] this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId]

View File

@ -456,6 +456,9 @@ export default class Programme extends BaseRecordComponent<any> {
}) })
this.subUpdateParams.resourceId = resourceId.join(",") this.subUpdateParams.resourceId = resourceId.join(",")
this.subUpdateParams.resourceName = resourceName.join(",") this.subUpdateParams.resourceName = resourceName.join(",")
} else {
this.subUpdateParams.resourceId = '';
this.subUpdateParams.resourceName = '';
} }
this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId]; this.subUpdateParams.compileUserName = this.$store.getters.user_map[this.subUpdateParams.compileUserId];
this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId] this.subUpdateParams.publishDeptName = this.$store.getters.dept_map[this.subUpdateParams.publishDeptId]