forked from xxhjsb/hbt-prevention-ui
feat:新增工作危害分析评价表单
parent
3def40d1cd
commit
39135ebc1b
|
@ -1,6 +1,7 @@
|
|||
<div class="common-box dis-flex ">
|
||||
<div class="common-tree-box" v-if="treeData">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current @node-click="handleNodeClick">
|
||||
<el-tree :data="treeData" :expand-on-click-node="false" default-expand-all highlight-current
|
||||
@node-click="handleNodeClick">
|
||||
</el-tree>
|
||||
</div>
|
||||
<div class="common-content-box dis-flex flex-col flex-1">
|
||||
|
@ -38,8 +39,45 @@
|
|||
</div>
|
||||
|
||||
<el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" labelWidth="110px" labelAlign="right" :data.sync="updateParams"
|
||||
@actionCallback="callback" :actions="updateActions" :full-btn="true" btnPosition="center">
|
||||
<div class="sub-title">工作危害分析法</div>
|
||||
|
||||
<TableComponent :tableData="tableData" :tableColumn="subTableColumn" @actionCallback="callback($event)"
|
||||
:actions="subTableActions" actionPosition="flex-start" :showFooter="false" style="margin-bottom: 20px;">
|
||||
|
||||
<el-table ref="multipleTable" :data="tableData.datas" tooltip-effect="dark" height="250" border
|
||||
row-key="checked" @selection-change="handleSelectionChange" style="width: 100%">
|
||||
<el-table-column type="selection" label="全选" width="40">
|
||||
</el-table-column>
|
||||
<template v-for="item in subTableColumn">
|
||||
<el-table-column v-if="item.render" :show-overflow-tooltip="item.showTip" :label="item.name"
|
||||
:width="item.width" :key="item.key">
|
||||
<div slot-scope="scope" v-html="item.render(scope.row)"></div>
|
||||
</el-table-column>
|
||||
<el-table-column v-else :prop="item.key" :show-overflow-tooltip="item.showTip"
|
||||
:label="item.name" :width="item.width" :key="item.key">
|
||||
</el-table-column>
|
||||
</template>
|
||||
<el-table-column label="操作" width="150">
|
||||
<template slot-scope="scope">
|
||||
<el-button type="text" @click="">查看</el-button>
|
||||
<el-button type="text" @click="">修改</el-button>
|
||||
<el-button type="text" @click="">评价</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
</TableComponent>
|
||||
</FormComponent>
|
||||
|
||||
|
||||
</el-dialog>
|
||||
|
||||
<!-- <el-dialog :close-on-click-modal="false" :title="currentId>0?'详情':currentId===-1?'新增':'编辑'"
|
||||
:visible.sync="showUpdate" width="952px" :before-close="handleClose">
|
||||
<FormComponent :options="updateOptions" :isReadonly="true" labelWidth="110px" labelAlign="right"
|
||||
:data.sync="updateParams"></FormComponent>
|
||||
</el-dialog>
|
||||
</el-dialog> -->
|
||||
</div>
|
|
@ -22,6 +22,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
|
||||
public params = {} as any;
|
||||
|
||||
public subTableColumn = [] as any;
|
||||
|
||||
public treeData = [{
|
||||
label: '一级 1',
|
||||
children: [{
|
||||
|
@ -88,6 +90,18 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
name:"反向选择",
|
||||
value:"reverse"
|
||||
}];
|
||||
public updateActions = [{
|
||||
name: "取消",
|
||||
value: "cancel"
|
||||
}, {
|
||||
name: "保存并继续添加",
|
||||
value: "saveAndContinue",
|
||||
type: "primary"
|
||||
}, {
|
||||
name: "保存",
|
||||
value: "save",
|
||||
type: "primary"
|
||||
}];
|
||||
public formOptions:FormOption<BtnOption>[] = [{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
|
@ -101,13 +115,109 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
key:"unitId",
|
||||
type:"text",
|
||||
}];
|
||||
public updateOptions:FormOption<BtnOption>[]=[{
|
||||
name:"区域名称",
|
||||
key:"areaId",
|
||||
type:"select",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"单元名称",
|
||||
key:"unitId",
|
||||
type:"select",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"责任部门",
|
||||
key:"depName",
|
||||
type:"select",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"责任人",
|
||||
key:"person",
|
||||
type:"text",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"作业名称",
|
||||
key:"jobName",
|
||||
type:"select",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"作业地点",
|
||||
key:"jobAdress",
|
||||
type:"text",
|
||||
require:true,
|
||||
width: "calc(50% - 20px)",
|
||||
},{
|
||||
name:"涉及岗位",
|
||||
key: "job",
|
||||
type: "select",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
},{
|
||||
name:"评价人",
|
||||
key:"evaluator",
|
||||
require:true,
|
||||
width:"calc(50% - 20px)",
|
||||
type:"select",
|
||||
},{
|
||||
name:"评价时间",
|
||||
key: "time",
|
||||
type: "date",
|
||||
subType: "date",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
format: "yyyy-MM-dd"
|
||||
},{
|
||||
name:"是否为两大一重",
|
||||
key: "time",
|
||||
type: "radio",
|
||||
width: "calc(100% - 20px)",
|
||||
require: true,
|
||||
datas:[{
|
||||
name:"不涉及",
|
||||
value:0
|
||||
},{
|
||||
name:"重大危险源",
|
||||
value:1
|
||||
},{
|
||||
name:"重大监管化工工艺",
|
||||
value:2
|
||||
},{
|
||||
name:"重点监管危化品",
|
||||
value:3
|
||||
}]
|
||||
},{
|
||||
name:"重大危险源",
|
||||
key:"isDangrous",
|
||||
type:"select",
|
||||
width:"calc(50% - 20px)",
|
||||
require:true,
|
||||
|
||||
},{
|
||||
name:"重点监管工艺",
|
||||
key: "technology",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
},{
|
||||
name:"重点监管化学品",
|
||||
key: "chemical",
|
||||
type: "select",
|
||||
width: "calc(50% - 20px)",
|
||||
require: true,
|
||||
}];
|
||||
|
||||
public showUpdate = false;
|
||||
public showSubUpdate = false;
|
||||
public updateParams = {} as any;
|
||||
public selectData = [];
|
||||
|
||||
created(){
|
||||
|
||||
console.log()
|
||||
}
|
||||
// 树点击
|
||||
public handleNodeClick(data){
|
||||
|
@ -137,9 +247,25 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
return "<span>已绘制</span>"
|
||||
}
|
||||
}});
|
||||
|
||||
|
||||
this.subTableColumn.push({ name: '序号', key: "person" });
|
||||
this.subTableColumn.push({ name: '步骤名称', key: "person" });
|
||||
this.subTableColumn.push({ name: '作业步骤描述', key: "person", showTip: true, width:"200px"});
|
||||
this.subTableColumn.push({ name: '作业地点', key: "location" });
|
||||
this.subTableColumn.push({ name: '风险源', key: "chargeUserName" });
|
||||
this.subTableColumn.push({ name: '危害分析', key: "person" });
|
||||
this.subTableColumn.push({ name: '最严重后果', key: "person", width:"200px" });
|
||||
this.subTableColumn.push({ name: '风险等级', key: "person" });
|
||||
this.subTableColumn.push({ name: '评估方法', key: "person" });
|
||||
this.subTableColumn.push({ name: '残余风险等级', key: "person", width:"200px" });
|
||||
this.subTableColumn.push({ name: '评估方法', key: "person" });
|
||||
this.subTableColumn.push({ name: '管控措施', key: "person" });
|
||||
}
|
||||
|
||||
public callback(data){
|
||||
console.log('data',data);
|
||||
|
||||
// 查询
|
||||
if(data.value==="search"){
|
||||
this.getTableData()
|
||||
|
@ -154,6 +280,16 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
this.selectAll()
|
||||
}else if(data.value === "delete"){
|
||||
this.deleteData(this.selectData.map((item:any)=>item.id))
|
||||
}else if(data.value === "add"){
|
||||
this.showUpdate = true
|
||||
}else if (data.value === "subAdd") {
|
||||
this.showSubUpdate = true
|
||||
} else if (data.value === "cancel") {
|
||||
if (this.showSubUpdate === true) {
|
||||
this.showSubUpdate = false
|
||||
} else {
|
||||
this.showUpdate = false
|
||||
}
|
||||
}
|
||||
}
|
||||
// 重置数据
|
||||
|
@ -194,6 +330,8 @@ export default class WorkAnalManagerComponent extends BaseRecordComponent<any> {
|
|||
public handleSelectionChange(data){
|
||||
this.selectData = data;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
</script>
|
||||
<style lang="scss" scoped src="../../../common.component.scss"></style>
|
||||
|
|
Loading…
Reference in New Issue