feat:工作危害分析bug

dev
kongyeqing 2023-09-06 18:01:31 +08:00
parent a39b7b7282
commit 81ce4e55ce
12 changed files with 134 additions and 101 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 18 KiB

View File

Before

Width:  |  Height:  |  Size: 20 KiB

After

Width:  |  Height:  |  Size: 20 KiB

View File

@ -109,6 +109,7 @@ import { L_COLUMN, L_VALUE, S_COLUMN, S_VALUE } from '@/mock/lsRisk';
import { L_LECCOLUMN, L_LECVALUE, E_COLUMN, E_VALUE, C_COLUMN, C_VALUE } from '@/mock/lecRisk';
import MeasureComponent from '@/components/measure.component.vue'
import moment from 'moment';
import { Message } from 'element-ui';
@Component({
components: {
@ -1110,6 +1111,8 @@ export default class AnalEvaluationComponent extends Vue {
if (data.value === "cancel") {
this.visible = false;
} else if (data.value === "store") {
let vaildParams = true
if ((this.$refs.basicForm as any).vaildParams() === false) {
//
@ -1124,6 +1127,12 @@ 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
}
const tmpUpdateParams = JSON.parse(JSON.stringify(this.updateParams))
// this.analysisUpdateParams.measures = this.currentMeasureData.datas
//

View File

@ -34,8 +34,8 @@
<el-dialog :close-on-click-modal="false" :title="taskIsReadonly ? '详情' : taskUpdataParams.index ? '编辑' : '新增'"
:visible.sync="showSubUpdate" width="952px" :before-close="handleCloseTask">
<FormComponent :options="taskUpdateOptions" :isReadonly="taskIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="taskUpdataParams" :actions="subActions" :full-btn="true" btnPosition="center"
@actionCallback="taskCallback" @change="taskSelectChange">
:data.sync="taskUpdataParams" :actions="taskIsReadonly ? [] : taskActions" :full-btn="true"
btnPosition="center" @actionCallback="taskCallback" @change="taskSelectChange">
</FormComponent>
</el-dialog>
</div>
@ -231,6 +231,7 @@ export default class MeasureComponent extends Vue {
width: "calc(50% - 20px)",
require: true,
showError: false,
min: 1,
// labelWidth:"130px"
}, {
key: "reviewCycleUnit",
@ -274,19 +275,26 @@ export default class MeasureComponent extends Vue {
showError: false,
},]
}
public subActions = [] as any;
//
public taskActions = [] as any;
public subActions = [{
public buildTaskAction(){
this.taskActions= [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
type: "primary",
hide: this.taskUpdataParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
public tableActions = [{
name: "添加",
value: "fourSubAdd",
@ -328,6 +336,7 @@ export default class MeasureComponent extends Vue {
// }
this.measuresUpdateForm()
this.taskUpdateForm()
this.buildActions()
}
@PropSync("tabledata", {
@ -335,10 +344,27 @@ export default class MeasureComponent extends Vue {
})
public measureData!: any;
public buildActions() {
this.subActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updataParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
created() {
this.buildTable();
console.log('measureData', this.measureData);
}
@ -442,6 +468,7 @@ export default class MeasureComponent extends Vue {
}
this.showSubUpdate = true
this.taskUpdateForm()
this.buildTaskAction()
}
// ---
@ -501,6 +528,7 @@ export default class MeasureComponent extends Vue {
}
this.taskUpdateForm();
this.showSubUpdate = true;
this.buildTaskAction()
}
public deleteTask(row) {

View File

@ -388,10 +388,9 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public showUpdateModel(data?, isRead?) {
if (!data) {
this.currentId = -1;
@ -399,7 +398,6 @@ export default class AreaManagerComponent extends BaseRecordComponent<any> {
} else {
this.currentId = data.id;
this.updateParams = Object.assign({ bottomHeight: 0, topHeight: 0, geoJson: "[]", majorHazardFlagName: this.$store.getters.common_yes_no_map[data.majorHazardFlag], majorHazardLevelName: this.levelName(data.majorHazardLevel) }, data);
this.isReadonly = !!isRead;
this.buildFormOptions();
this.showUpdate = true

View File

@ -2,7 +2,7 @@
<div class="common-content-box dis-flex flex-col flex-1">
<div class="search-box">
<FormComponent :inline="true" :options="formOptions" :data.sync="params" @actionCallback="callback"
:actions="formActions" :full-btn="false" @change="change" btn-position="end"></FormComponent>
:actions="formActions" :full-btn="false" @change="callback" btn-position="end"></FormComponent>
</div>
<div class="table-box flex-1">
<TableComponent :tableData="tableData" :tableColumn="tableColumn" @actionCallback="callback($event)"

View File

@ -38,7 +38,7 @@
</div>
<el-dialog :close-on-click-modal="false" :visible.sync="showUpdate" destroy-on-close>
<img style="width:100%" src="../../../../assets/images/4.jpg" alt="">
<img style="width:100%" src="../../../../assets/images/4.png" alt="">
</el-dialog>
<!-- 选取LS值 -->
@ -104,44 +104,4 @@
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog>
<!-- 选取LS值 -->
<!-- <el-dialog :close-on-click-modal="false" :title="popTitle" :visible.sync="showPop" width="1000px" destroy-on-close>
<el-table :data="riskDatas" border style="width: 100%; margin-bottom: 20px;" :span-method="colSpan">
<el-table-column prop="index" label="序号"></el-table-column>
<el-table-column prop="name" label="项目"></el-table-column>
<el-table-column label="取值标准">
<el-table-column prop="noInvolved" label="是否涉及">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===0}"
@click="selectRow(scope.row,0)">
<span>不涉及</span>
</div>
</el-table-column>
<el-table-column prop="type1" label="1">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===1}"
@click="selectRow(scope.row,1)"><span>{{scope.row.type1}}</span></div>
</el-table-column>
<el-table-column prop="type2" label="2">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===2}"
@click="selectRow(scope.row,2)"><span>{{scope.row.type2}}</span></div>
</el-table-column>
<el-table-column prop="type3" label="3">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===3}"
@click="selectRow(scope.row,3)"><span>{{scope.row.type3}}</span></div>
</el-table-column>
<el-table-column prop="type4" label="4">
<div slot-scope="scope" class="cursor td-content" :class="{active:scope.row.value===4}"
@click="selectRow(scope.row,4)"><span>{{scope.row.type4}}</span></div>
</el-table-column>
</el-table-column>
<el-table-column prop="value" :label="popTitle==='L值取值'?'Ln':'Sn'">
<div slot-scope="scope">
<span v-if="scope.row.value">{{scope.row.value}}</span>
<span v-else></span>
</div>
</el-table-column>
<el-table-column prop="result" :label="popTitle==='L值取值'?'L':'S'"></el-table-column>
</el-table>
<ButtonListComponent :actions="popBtns" @callback="popCallback" btn-position="center" :full-btn="true">
</ButtonListComponent>
</el-dialog> -->
</div>

View File

@ -236,7 +236,8 @@ export default class DeviceAnalManagerComponent extends BaseRecordComponent<any>
width: "calc(50% - 20px)",
require: true,
showError: false,
format: "yyyy-MM-dd"
format: "yyyy-MM-dd",
disable: true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",

View File

@ -244,7 +244,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
width: "calc(50% - 20px)",
require: true,
showError: false,
format: "yyyy-MM-dd"
format: "yyyy-MM-dd",
disable:true,
}, {
name: "区域固有风险等级",
key: "analRiskLevel",
@ -506,7 +507,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
this.subTableColumn.push({ name: '步骤名称', key: "name" });
this.subTableColumn.push({ name: '作业步骤描述', key: "description", showTip: true, width: "200px" });
this.subTableColumn.push({ name: '作业地点', key: "location" }); this.subTableColumn.push({ name: '风险源', key: "riskSource" });
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px" });
this.subTableColumn.push({ name: '危害分析', key: "hazardAnalysis", width: "200px", showTip: true, });
this.subTableColumn.push({
name: '最严重后果', key: "seriousResult", width: "100px", render: (data) => {
if (data.seriousResult) {
@ -651,6 +652,7 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
//

View File

@ -398,6 +398,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public showUpdateModel(id) {
@ -498,13 +499,8 @@ export default class RiskCard extends BaseRecordComponent<any> {
})
}
public showModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
} else {
this.subIsReadonly = false
}
public showModal(row, isReadonly = false) {
this.subIsReadonly = isReadonly
this.tableService.getListDetail({ id: row.id }).then((res: any) => {
if (res.code === 200) {
@ -512,6 +508,7 @@ export default class RiskCard extends BaseRecordComponent<any> {
riskLevelName: this.$store.getters.prevention_risk_level_map[res.data.riskLevel],
safetySignName: res.data.safetySign.split(",").map(item => this.$store.getters.prevention_security_identifier_map[item]).join(",")
}, res.data)
this.subUpdateParams.postCode = +res.data.postCode
if (res.data.resourceId) {
this.tableService.getFileUrls({ ids: res.data.resourceId.split(",") }).then((files: any) => {
this.fileList = files.data.map(item => {

View File

@ -83,7 +83,7 @@
:title="subIsReadonly?'详情':subUpdateParams.index||subUpdateParams.id ?'编辑': '新增'" :visible.sync="subShowUpdate"
width="952px">
<FormComponent :options="subUpdateOptions" :isReadonly="subIsReadonly" labelWidth="110px" labelAlign="right"
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="updateActions"
:data.sync="subUpdateParams" @actionCallback="triCallback" @change="changes" :actions="subUpdateActions"
:full-btn="true" btnPosition="center">
</FormComponent>
</el-dialog>

View File

@ -124,21 +124,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
value: "cancel"
}];
public updateActions = [] as any;
public updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary"
}, {
name: "保存",
value: "save",
type: "primary"
}];
public subUpdateActions = [] as any;
public updateOptions: FormOption<BtnOption>[] = [] as any;
public buildUpdateForm() {
@ -217,7 +205,19 @@ export default class TrainRecords extends BaseRecordComponent<any> {
showError: false,
},
]
this.updateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.updateParams.id
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
public subUpdateOptions: FormOption<BtnOption>[] = []
@ -272,13 +272,29 @@ export default class TrainRecords extends BaseRecordComponent<any> {
}]
}, {
name: "得分",
type: "text",
type: "number",
key: "score",
require: true,
width: "calc(50% - 20px)",
controls: false,
showError: false,
max: 100,
min: 0,
hide: !(this.subUpdateParams.examStatus === 1)
},]
this.subUpdateActions = [{
name: "取消",
value: "cancel"
}, {
name: "保存并继续添加",
value: "saveAndContinue",
type: "primary",
hide: this.subUpdateParams.index
}, {
name: "保存",
value: "save",
type: "primary"
}];
}
@ -355,6 +371,28 @@ export default class TrainRecords extends BaseRecordComponent<any> {
}
this.buildSubForm()
}
//
this.durationChange(data, item);
//
this.scoreFormat(data, item);
}
/**
* 培训时长格式化保留一位小数
* @param data
* @param item
*/
public durationChange(data: any, item: any) {
if (item && item.key === 'duration') {
this.updateParams.duration = null;
this.$set(this.updateParams, item.key, +data.toFixed(1))
}
}
public scoreFormat(data: any, item: any) {
if (item && item.key === 'score') {
this.updateParams.score = null;
this.$set(this.subUpdateParams, item.key, +data.toFixed(2))
}
}
public callback(data, type) {
@ -398,6 +436,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
pageNum: 1,
pageSize: 20,
} as any;
this.getTableData()
}
public showUpdateModel(id) {
@ -423,7 +462,7 @@ export default class TrainRecords extends BaseRecordComponent<any> {
this.toggleAll()
} else {
this.tableData.datas.forEach((item, index) => {
const find = this.selectData.find((data: any) => data.userId === item.userId);
const find = this.selectData.find((data: any) => data.id === item.id);
if (!find) {
(this.$refs.multipleTable as any).toggleRowSelection(item);
}
@ -472,9 +511,9 @@ export default class TrainRecords extends BaseRecordComponent<any> {
public subCallback(data) {
if (data.value === "add") {
this.subIsReadonly = false
this.buildSubForm()
this.subUpdateParams = {} as any;
this.subShowUpdate = true
this.buildSubForm()
} else if (data.value === "cancel") {
this.showUpdate = false
} else if (data && data.value.indexOf("save") >= 0) {
@ -531,11 +570,11 @@ export default class TrainRecords extends BaseRecordComponent<any> {
public showSubModal(row, isReadonly) {
if (isReadonly) {
this.subIsReadonly = true
this.subUpdateParams = row
this.subUpdateParams = JSON.parse(JSON.stringify(row))
this.subUpdateParams.examStatusName = row.examStatus === 1 ? '已参加' : '未参加'
} else {
this.subIsReadonly = false
this.subUpdateParams = row
this.subUpdateParams = JSON.parse(JSON.stringify(row))
}
this.subShowUpdate = true
this.buildSubForm()
@ -543,7 +582,6 @@ export default class TrainRecords extends BaseRecordComponent<any> {
//
public deleteSubData(indexs) {
this.$confirm('确认删除所选数据', '确认数据', {
confirmButtonText: '确定',
cancelButtonText: '取消',