youxiankongjian
This commit is contained in:
parent
f9ba761143
commit
839c5c0a02
|
@ -178,12 +178,23 @@ const routes = [
|
|||
"name": "fire",
|
||||
"path": "/opm/fire",
|
||||
"meta": {
|
||||
"title": "许可证基本信息",
|
||||
"title": "动火作业许可证",
|
||||
"icon": "el-icon-menu",
|
||||
"hidden": true
|
||||
},
|
||||
"component": "opm/fire"
|
||||
},
|
||||
,
|
||||
{
|
||||
"name": "space",
|
||||
"path": "/opm/space",
|
||||
"meta": {
|
||||
"title": "有限空间作业许可证",
|
||||
"icon": "el-icon-menu",
|
||||
"hidden": true
|
||||
},
|
||||
"component": "opm/space"
|
||||
},
|
||||
]
|
||||
},
|
||||
{
|
||||
|
|
|
@ -284,9 +284,12 @@
|
|||
</el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.worker_.name }}
|
||||
<el-table-column label="证书" prop="certificates" width="150">
|
||||
<template #default="scope" >
|
||||
<el-tag v-for="item in scope.row.certificates_"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
|
@ -296,10 +299,7 @@
|
|||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template #default="scope">
|
||||
<el-button type="text" size="small" @click="editWorker(scope.row)"
|
||||
>编辑</el-button
|
||||
>
|
||||
<el-divider direction="vertical"></el-divider>
|
||||
|
||||
<el-popconfirm
|
||||
title="确定删除该作业人员吗?"
|
||||
@confirm="delWorker(scope.row)"
|
||||
|
@ -445,6 +445,21 @@
|
|||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template #default="scope">
|
||||
|
||||
<el-popconfirm
|
||||
title="确定删除该条气体检测记录吗?"
|
||||
@confirm="delgas(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button text type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
|
||||
</scTable>
|
||||
<sc-dialog v-model="gasdialog" draggable title="气体检测记录">
|
||||
<el-form
|
||||
|
@ -573,6 +588,7 @@ export default {
|
|||
components: {},
|
||||
data() {
|
||||
return {
|
||||
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||
|
@ -635,6 +651,8 @@ export default {
|
|||
this.getUser();
|
||||
},
|
||||
methods: {
|
||||
|
||||
|
||||
getoplData() {
|
||||
if (this.oplId == "") {
|
||||
this.getOperation();
|
||||
|
@ -703,9 +721,9 @@ export default {
|
|||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
if (this.active == 0) {
|
||||
console.log(this.oplId);
|
||||
// console.log(this.oplId);
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "" && this.issave == false) {
|
||||
if (this.oplId == "") {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
|
@ -714,30 +732,35 @@ export default {
|
|||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.$emit("success", this.form);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
|
||||
this.oplId = res.id;
|
||||
this.getworkerList(res.id);
|
||||
this.getgasList(res.id);
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.form.id, this.form).then(() => {
|
||||
|
||||
this.$API.opm.opl.update.req(this.oplId, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.getworkerList(this.form.id);
|
||||
this.getgasList(this.oplId);
|
||||
this.getworkerList(this.oplId);
|
||||
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
} else {
|
||||
this.active = 2;
|
||||
this.getgasList();
|
||||
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
@ -765,18 +788,14 @@ export default {
|
|||
|
||||
this.formworker = Object.assign({}, defaultformworker);
|
||||
},
|
||||
//编辑作业人人员
|
||||
editWorker(row) {
|
||||
this.formworker = row;
|
||||
this.workerdialog = true;
|
||||
this.selectWorker();
|
||||
},
|
||||
|
||||
//删除作业人员
|
||||
delWorker(row) {
|
||||
this.$API.opm.worker.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("作业人员删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
|
@ -787,29 +806,18 @@ export default {
|
|||
submitWorker() {
|
||||
this.formworker.opl = this.oplId;
|
||||
this.$refs.workerForm.validate(async (valid) => {
|
||||
if (this.formworker.id == "") {
|
||||
|
||||
this.$API.opm.worker.create
|
||||
.req(this.formworker)
|
||||
.then((res) => {
|
||||
this.$message.success("创建作业人员成功");
|
||||
this.workerdialog = false;
|
||||
return res;
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else {
|
||||
this.$API.opm.worker.update
|
||||
.req(this.formworker.id, this.formworker)
|
||||
.then((res) => {
|
||||
this.$message.success("修改作业人员成功");
|
||||
this.workerdialog = false;
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//气体检测记录列表
|
||||
|
@ -830,30 +838,32 @@ export default {
|
|||
submitgas() {
|
||||
this.formgas.opl = this.oplId;
|
||||
this.$refs.gasForm.validate(async (valid) => {
|
||||
if (this.formgas.id == "") {
|
||||
|
||||
this.$API.opm.gas.create
|
||||
.req(this.formgas)
|
||||
.then((res) => {
|
||||
this.$message.success("创建气体检测记录成功");
|
||||
this.gasdialog = false;
|
||||
return res;
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else {
|
||||
this.$API.opm.gas.update
|
||||
.req(this.formgas.id, this.formgas)
|
||||
.then((res) => {
|
||||
this.$message.success("修改气体检测记录成功");
|
||||
this.gasdialog = false;
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
}
|
||||
|
||||
});
|
||||
},
|
||||
//删除气体检测记录
|
||||
delgas(row) {
|
||||
this.$API.opm.gas.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("气体检测记录删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
//退出界面
|
||||
submitOut(){
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
:key="index"
|
||||
:title="item.name"
|
||||
type="primary"
|
||||
@click="addFire(item.id)"
|
||||
@click="addFire(item.id, item.name)"
|
||||
>
|
||||
{{ item.name }}
|
||||
</el-button>
|
||||
|
@ -39,7 +39,12 @@
|
|||
stripe
|
||||
@resetQuery="resetQuery"
|
||||
>
|
||||
<el-table-column label="#" type="index" width="50" fixed="left"></el-table-column>
|
||||
<el-table-column
|
||||
label="#"
|
||||
type="index"
|
||||
width="50"
|
||||
fixed="left"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="作业许可编号"
|
||||
prop="number"
|
||||
|
@ -52,7 +57,7 @@
|
|||
width="120"
|
||||
fixed="left"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
<el-table-column
|
||||
label="许可证种类"
|
||||
prop="cate_name"
|
||||
width="120"
|
||||
|
@ -94,7 +99,7 @@
|
|||
@click="table_show(scope.row, scope.$index)"
|
||||
>查看</el-button
|
||||
>
|
||||
<el-button
|
||||
<el-button
|
||||
text
|
||||
type="warning"
|
||||
size="small"
|
||||
|
@ -141,30 +146,50 @@ export default {
|
|||
},
|
||||
|
||||
//点击作业类型,创建作业许可证添加
|
||||
addFire(id) {
|
||||
this.$router.push({
|
||||
name: "fire",
|
||||
query: {
|
||||
operationid: this.$route.query.id,//作业ID
|
||||
oplcateId:id,//许可证类型ID
|
||||
oplId:"",//许可证ID
|
||||
},
|
||||
});
|
||||
addFire(id, name) {
|
||||
switch (name) {
|
||||
case "动火":
|
||||
this.$router.push({
|
||||
name: "fire",
|
||||
query: {
|
||||
operationid: this.$route.query.id, //作业ID
|
||||
oplcateId: id, //许可证类型ID
|
||||
oplId: "", //许可证ID
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "有限空间":
|
||||
this.$router.push({
|
||||
name: "space",
|
||||
query: {
|
||||
operationid: this.$route.query.id, //作业ID
|
||||
oplcateId: id, //许可证类型ID
|
||||
oplId: "", //许可证ID
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
//编辑
|
||||
table_edit(row) {
|
||||
|
||||
if(row.cate_name=="动火")
|
||||
{
|
||||
this.$router.push({
|
||||
name: "fire",
|
||||
query: {
|
||||
oplId:row.id,//许可证ID
|
||||
},
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
switch (row.cate_name) {
|
||||
case "动火":
|
||||
this.$router.push({
|
||||
name: "fire",
|
||||
query: {
|
||||
oplId: row.id, //许可证ID
|
||||
},
|
||||
});
|
||||
break;
|
||||
case "有限空间":
|
||||
this.$router.push({
|
||||
name: "space",
|
||||
query: {
|
||||
oplId: row.id, //许可证ID
|
||||
},
|
||||
});
|
||||
break;
|
||||
}
|
||||
},
|
||||
//查看
|
||||
table_show(row) {
|
||||
|
|
|
@ -0,0 +1,875 @@
|
|||
<template>
|
||||
<el-container>
|
||||
<el-header>
|
||||
<el-steps
|
||||
:active="active"
|
||||
style="width: 100%"
|
||||
:align-center="true"
|
||||
finish-status="success"
|
||||
>
|
||||
<el-step
|
||||
v-for="(item, index) of stepTitle"
|
||||
:key="index"
|
||||
:title="item"
|
||||
style="50%"
|
||||
@click="handleStep(index)"
|
||||
>
|
||||
</el-step>
|
||||
</el-steps>
|
||||
</el-header>
|
||||
<!--基本信息!-->
|
||||
<el-main class="nopadding" v-show="active === 0">
|
||||
<el-form
|
||||
v-show="active === 0"
|
||||
ref="dialogForm"
|
||||
:model="form"
|
||||
:rules="rules"
|
||||
label-width="110px"
|
||||
style="margin: 40px 40px 40px 40px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="关联作业">
|
||||
<el-input
|
||||
v-model="operationId"
|
||||
type="text"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业许可种类">
|
||||
<el-input
|
||||
v-model="pagtitle"
|
||||
type="text"
|
||||
:disabled="true"
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业开始时间">
|
||||
<el-date-picker
|
||||
v-model="form.start_time"
|
||||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业结束时间">
|
||||
<el-date-picker
|
||||
v-model="form.end_time"
|
||||
type="datetime"
|
||||
placeholder="选择开始时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业级别">
|
||||
<el-select v-model="form.level" placeholder="选择作业级别">
|
||||
<el-option
|
||||
v-for="item in leveloptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.name"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业部门">
|
||||
<el-cascader
|
||||
placeholder="选择作业部门"
|
||||
getCheckedNodes="true"
|
||||
v-model="form.dept_do"
|
||||
:options="deptoptions"
|
||||
:props="{
|
||||
expandTrigger: 'hover', // 次级菜单的展开方式
|
||||
label: 'label', //
|
||||
value: 'value', //
|
||||
emitPath: false, // 在选中节点改变时,是否返回由该节点所在的各级菜单的值所组成的数组,若设置 false,则只返回该节点的值
|
||||
}"
|
||||
clearable
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业负责人">
|
||||
<el-select v-model="form.charger" placeholder="选择作业负责人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业监护人">
|
||||
<el-select v-model="form.monitor" placeholder="选择作业监护人">
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<!--
|
||||
临时用电
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="安装/拆除">
|
||||
<el-input v-model="work_type" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="安装/拆除时间">
|
||||
<el-input v-model="work_time" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="验收时间">
|
||||
<el-input v-model="accept_time" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="用电地点">
|
||||
<el-input v-model="power_to" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="电源接入点">
|
||||
<el-input v-model="power_from" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="用电开始">
|
||||
<el-input
|
||||
v-model="power_start_time"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="用电截至">
|
||||
<el-input
|
||||
v-model="power_end_time"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="计划用电天数">
|
||||
<el-input v-model="power_days" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col> !-->
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="风险选择">
|
||||
<el-checkbox-group v-model="form.risks_checked">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in risklist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="其他风险">
|
||||
<el-input
|
||||
v-model="form.other_risk"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!--
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="逃生路径">
|
||||
<el-input v-model="escape_route" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col> !-->
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="措施选择">
|
||||
<el-checkbox-group v-model="form.measures_checked">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in measurelist"
|
||||
:key="index"
|
||||
:label="item.id"
|
||||
>{{ item.name }}</el-checkbox
|
||||
>
|
||||
</el-checkbox-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-card class="box-card">
|
||||
<div class="clearfix">
|
||||
<span>应急处置:</span>
|
||||
</div>
|
||||
<div class="content">
|
||||
<p>1、发生火灾时立即使用消防器材边灭火边报告</p>
|
||||
<p>2、预判火势无法控制时,应立即疏散人群并拨打110或119求救。</p>
|
||||
<p>
|
||||
3、发生人员烫伤时用清水对烫伤部位进行冲洗或浸泡,用干净的纱布或衣物盖住被烫伤部位,伤势严重时立即拨打120送医。若贴身衣服与伤口粘在一起时,可用剪刀剪开,然后缓慢剥离衣物。
|
||||
</p>
|
||||
</div>
|
||||
</el-card>
|
||||
<el-form-item label="其他应急处置">
|
||||
<el-input
|
||||
v-model="form.other_emr"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
|
||||
<!--
|
||||
<el-col :md="12" :sm="12" :xs="24">
|
||||
<el-form-item label="作业审批照片">
|
||||
<el-input v-model="create_imgs" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
!-->
|
||||
</el-row>
|
||||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item>
|
||||
<el-button style="margin-top: 12px" @click="handleNextStep"
|
||||
>下一步</el-button
|
||||
>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
</el-main>
|
||||
|
||||
<!--作业人员!-->
|
||||
<el-main class="nopadding" v-show="active === 1">
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="addworker"
|
||||
></el-button>
|
||||
</div>
|
||||
<scTable
|
||||
ref="workerTable"
|
||||
:data="apiworkerObj"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
fixed="left"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column label="姓名" prop="name" width="150">
|
||||
<template #default="scope">
|
||||
{{ scope.row.worker_.name }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="工作职责" prop="duty" width="150">
|
||||
</el-table-column>
|
||||
<el-table-column label="证书" prop="certificates" width="150">
|
||||
<template #default="scope" >
|
||||
<el-tag v-for="item in scope.row.certificates_"
|
||||
:key="item.number"
|
||||
:label="item.name"
|
||||
:value="item.number">{{item.name}}</el-tag>
|
||||
</template>
|
||||
|
||||
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template #default="scope">
|
||||
|
||||
<el-popconfirm
|
||||
title="确定删除该作业人员吗?"
|
||||
@confirm="delWorker(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button text type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</scTable>
|
||||
<sc-dialog v-model="workerdialog" draggable title="选择作业人员">
|
||||
<el-form
|
||||
ref="workerForm"
|
||||
:model="formworker"
|
||||
:rules="rules"
|
||||
:disabled="mode == 'show'"
|
||||
label-width="80px"
|
||||
width="70%"
|
||||
style="margin: 40px 40px 40px 40px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="作业人员">
|
||||
<el-select
|
||||
v-model="formworker.worker"
|
||||
@change="selectWorker"
|
||||
placeholder="选择作业人员"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="工作职责">
|
||||
<el-select
|
||||
v-model="formworker.duty"
|
||||
filterable
|
||||
allow-create
|
||||
default-first-option
|
||||
:reserve-keyword="false"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in dutyOptions"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.label"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="证书">
|
||||
<el-select
|
||||
v-model="formworker.certificates"
|
||||
multiple
|
||||
placeholder="选择证书"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in certificatesOptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialogcart = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitWorker">确 定</el-button>
|
||||
</template>
|
||||
</sc-dialog>
|
||||
<el-button style="margin-top: 12px" @click="handleLastStep"
|
||||
>上一步</el-button
|
||||
>
|
||||
<el-button style="margin-top: 12px" @click="handleNextStep"
|
||||
>下一步</el-button
|
||||
>
|
||||
|
||||
</el-main>
|
||||
<!--气体浓度检测记录!-->
|
||||
<el-main class="nopadding" v-show="active === 2">
|
||||
<div class="left-panel" style="margin: 10px">
|
||||
<el-button
|
||||
type="primary"
|
||||
icon="el-icon-plus"
|
||||
@click="addgas"
|
||||
></el-button>
|
||||
</div>
|
||||
<scTable
|
||||
ref="gasTable"
|
||||
:data="apigasObj"
|
||||
row-key="id"
|
||||
hidePagination
|
||||
stripe
|
||||
>
|
||||
<el-table-column
|
||||
label="#"
|
||||
fixed="left"
|
||||
type="index"
|
||||
width="50"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检测时间"
|
||||
prop="check_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检测部位"
|
||||
prop="check_place"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="O2(%)" prop="o2" width="150"></el-table-column>
|
||||
<el-table-column label="CO" prop="co" width="150"></el-table-column>
|
||||
<el-table-column
|
||||
label="可燃气体(V%LEL)"
|
||||
prop="lel"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column
|
||||
label="检验结论"
|
||||
prop="is_ok"
|
||||
width="150"
|
||||
> <template #default="scope">
|
||||
{{ is_ok_[scope.row.is_ok] }}
|
||||
</template></el-table-column>
|
||||
<el-table-column
|
||||
label="检测人"
|
||||
prop="checker"
|
||||
width="150"
|
||||
> <template #default="scope">
|
||||
{{ scope.row.checker_.name }}
|
||||
</template></el-table-column>
|
||||
<el-table-column
|
||||
label="创建时间"
|
||||
prop="create_time"
|
||||
width="150"
|
||||
></el-table-column>
|
||||
<el-table-column label="操作" fixed="right" align="center" width="200">
|
||||
<template #default="scope">
|
||||
|
||||
<el-popconfirm
|
||||
title="确定删除该气体浓度检测记录吗?"
|
||||
@confirm="delgas(scope.row)"
|
||||
>
|
||||
<template #reference>
|
||||
<el-button text type="danger" size="small">删除</el-button>
|
||||
</template>
|
||||
</el-popconfirm>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
</scTable>
|
||||
<sc-dialog v-model="gasdialog" draggable title="气体检测记录">
|
||||
<el-form
|
||||
ref="gasForm"
|
||||
:model="formgas"
|
||||
:rules="rules"
|
||||
:disabled="mode == 'show'"
|
||||
label-width="80px"
|
||||
width="70%"
|
||||
style="margin: 40px 40px 40px 40px"
|
||||
>
|
||||
<el-row>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="检测时间">
|
||||
<el-date-picker
|
||||
v-model="formgas.check_time"
|
||||
type="datetime"
|
||||
placeholder="选择检测时间"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="检测部位">
|
||||
<el-input
|
||||
v-model="formgas.check_place"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="O2(%)">
|
||||
<el-input v-model.number="formgas.o2" type="text" clearable></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="CO">
|
||||
<el-input
|
||||
v-model.number="formgas.co"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="H2S(10ppm)">
|
||||
<el-input
|
||||
v-model.number="formgas.h2s"
|
||||
type="text"
|
||||
clearable
|
||||
></el-input>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="检验结论">
|
||||
|
||||
<el-radio-group v-model="formgas.is_ok">
|
||||
<el-radio l :label="true" >正常</el-radio>
|
||||
<el-radio :label="false" >不正常</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :md="24" :sm="12" :xs="24">
|
||||
<el-form-item label="检测人">
|
||||
<el-select
|
||||
v-model="formgas.checker"
|
||||
placeholder="选择作业人员"
|
||||
>
|
||||
<el-option
|
||||
v-for="item in useroptions"
|
||||
:key="item.id"
|
||||
:label="item.name"
|
||||
:value="item.id"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<el-button @click="dialoggase = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitgas">确 定</el-button>
|
||||
</template>
|
||||
</sc-dialog>
|
||||
<el-button style="margin-top: 12px" @click="handleLastStep"
|
||||
>上一步</el-button
|
||||
>
|
||||
<el-button style="margin-top: 12px" @click="submitOut">退出</el-button>
|
||||
</el-main>
|
||||
</el-container>
|
||||
</template>
|
||||
<style scoped>
|
||||
.clearfix {
|
||||
font-size: 20px;
|
||||
}
|
||||
|
||||
.box-card p {
|
||||
line-height: 20px;
|
||||
}
|
||||
.content {
|
||||
margin-top: 10px;
|
||||
}
|
||||
.stepSuc:hover {
|
||||
cursor: pointer;
|
||||
}
|
||||
.stepErr:hover {
|
||||
cursor: not-allowed;
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
import { genTree } from "@/utils/verificate";
|
||||
const defaultformworker = {
|
||||
id: "",
|
||||
worker: null,
|
||||
duty: null,
|
||||
certificates: [],
|
||||
opl: "",
|
||||
};
|
||||
const defaultformgas = {
|
||||
id: "",
|
||||
check_time: null,
|
||||
opl:""
|
||||
};
|
||||
export default {
|
||||
name: "fire",
|
||||
components: {},
|
||||
data() {
|
||||
return {
|
||||
active: 0,
|
||||
stepSuc: [0],
|
||||
stepTitle: ["基本信息", "作业人员", "气体浓度检测记录"],
|
||||
query: {},
|
||||
selection: [],
|
||||
issave: false, //控制基本信息提交
|
||||
search: {
|
||||
keyword: null,
|
||||
},
|
||||
form: {
|
||||
id: "",
|
||||
start_time: null,
|
||||
end_time: null,
|
||||
operation: "",
|
||||
cate: "",
|
||||
risks_checked: [],
|
||||
},
|
||||
|
||||
operationId: "",
|
||||
oplcateId: "",
|
||||
oplId: "",
|
||||
leveloptions: [
|
||||
{ id: 10, name: "特级" },
|
||||
{ id: 20, name: "一级" },
|
||||
{ id: 30, name: "二级" },
|
||||
],
|
||||
deptoptions: [],
|
||||
useroptions: [],
|
||||
risklist: [],
|
||||
measurelist: [],
|
||||
pagtitle: "",
|
||||
|
||||
dutyOptions: [
|
||||
{ value: 10, label: "作业人员" },
|
||||
{ value: 20, label: "起重司机" },
|
||||
{ value: 30, label: "司索人员" },
|
||||
{ value: 40, label: "起重指挥" },
|
||||
{ value: 40, label: "电工" },
|
||||
],
|
||||
certificatesOptions: [],
|
||||
formworker: defaultformworker,
|
||||
apiworkerObj: [],
|
||||
workerdialog: false,
|
||||
gasdialog: false,
|
||||
formgas: defaultformgas,
|
||||
apigasObj: [],
|
||||
is_ok_: {
|
||||
true: "正常",
|
||||
false: "不正常",
|
||||
},
|
||||
};
|
||||
},
|
||||
mounted() {
|
||||
this.operationId = this.$route.query.operationid; //作业ID
|
||||
this.oplcateId = this.$route.query.oplcateId; //作业许可证种类ID
|
||||
this.oplId = this.$route.query.oplId; //许可证ID
|
||||
this.getoplData();
|
||||
|
||||
this.getDept();
|
||||
this.getUser();
|
||||
},
|
||||
methods: {
|
||||
getoplData() {
|
||||
if (this.oplId == "") {
|
||||
this.getOperation();
|
||||
this.getOplcates();
|
||||
} else {
|
||||
this.getData();
|
||||
}
|
||||
},
|
||||
//根据oplId,查许可证
|
||||
getData() {
|
||||
this.$API.opm.opl.read.req(this.oplId).then((res) => {
|
||||
this.form = res;
|
||||
|
||||
this.oplcateId = res.cate;
|
||||
this.operationId = res.operation;
|
||||
this.getOperation();
|
||||
this.getOplcates();
|
||||
});
|
||||
},
|
||||
//根据operationId,查作业信息
|
||||
|
||||
getOperation() {
|
||||
this.$API.opm.operation.read.req(this.operationId).then((res) => {
|
||||
this.form.start_time = res.start_time; //作业开始时间
|
||||
this.form.end_time = res.end_time; //作业结束时间
|
||||
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
//作业部门
|
||||
getDept() {
|
||||
this.$API.system.dept.list.req({ page: 0 }).then((res) => {
|
||||
this.deptoptions = genTree(res);
|
||||
});
|
||||
},
|
||||
|
||||
//作业负责人、作业监护人
|
||||
getUser() {
|
||||
this.$API.system.user.list.req({ page: 0 }).then((res) => {
|
||||
this.useroptions = res;
|
||||
});
|
||||
},
|
||||
//作业
|
||||
|
||||
//根据作业许可证ID获取,风险、措施
|
||||
getOplcates() {
|
||||
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||
console.log(res); //
|
||||
this.pagtitle = res.name;
|
||||
this.risklist = res.risk_options_; //风险缝隙
|
||||
this.measurelist = res.measure_options_; //控制措施
|
||||
});
|
||||
},
|
||||
handleStep(val) {
|
||||
//点击步骤条
|
||||
if (this.stepSuc.includes(val) === true) {
|
||||
this.active = val;
|
||||
}
|
||||
},
|
||||
//组件点击上一步
|
||||
handleLastStep() {
|
||||
if (--this.active === 0) {
|
||||
this.active = 0;
|
||||
}
|
||||
},
|
||||
//组件点击下一步
|
||||
handleNextStep() {
|
||||
if (this.active == 0) {
|
||||
console.log(this.oplId);
|
||||
//如果是创建许可证书
|
||||
if (this.oplId == "" && this.issave == false) {
|
||||
//基本信息提交
|
||||
debugger;
|
||||
this.form.cate = this.oplcateId;
|
||||
this.form.operation = this.operationId;
|
||||
console.log(this.form);
|
||||
this.$API.opm.opl.create
|
||||
.req(this.form)
|
||||
.then((res) => {
|
||||
this.$emit("success", this.form, this.mode);
|
||||
this.$message.success("创建成功");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.oplId = res.id;
|
||||
this.getworkerList(res.id);
|
||||
this.getgasList(res.id);
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
} else if (this.oplId != "") {
|
||||
this.$API.opm.opl.update.req(this.form.id, this.form).then(() => {
|
||||
this.$message.success("基本修改成功!");
|
||||
this.issave = true;
|
||||
this.active = 1;
|
||||
this.getworkerList(this.form.id);
|
||||
this.getgasList(this.form.id);
|
||||
});
|
||||
} else {
|
||||
this.active = 1;
|
||||
}
|
||||
} else {
|
||||
this.active = 2;
|
||||
|
||||
}
|
||||
// this.stepSuc.push(++this.active)
|
||||
},
|
||||
|
||||
//选择人员后,调出该人员的所有证书
|
||||
selectWorker() {
|
||||
this.$API.hrm.certificate.list
|
||||
.req({ employee__user: this.formworker.worker, page: 0 })
|
||||
.then((res) => {
|
||||
this.certificatesOptions = res;
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
//作业人员列表
|
||||
|
||||
getworkerList(id) {
|
||||
this.$API.opm.worker.list.req({ opl: id, page: 0 }).then((res) => {
|
||||
this.apiworkerObj = res;
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
//创建作业人员,显示Form
|
||||
addworker() {
|
||||
this.workerdialog = true;
|
||||
|
||||
this.formworker = Object.assign({}, defaultformworker);
|
||||
},
|
||||
|
||||
//删除作业人员
|
||||
delWorker(row) {
|
||||
this.$API.opm.worker.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("作业人员删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
//提交作业人员信息
|
||||
submitWorker() {
|
||||
this.formworker.opl = this.oplId;
|
||||
this.$refs.workerForm.validate(async (valid) => {
|
||||
|
||||
this.$API.opm.worker.create
|
||||
.req(this.formworker)
|
||||
.then((res) => {
|
||||
this.$message.success("创建作业人员成功");
|
||||
this.workerdialog = false;
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
//气体检测记录列表
|
||||
|
||||
getgasList(id) {
|
||||
this.$API.opm.gas.list.req({ opl: id, page: 0 }).then((res) => {
|
||||
this.apigasObj = res;
|
||||
console.log(res);
|
||||
});
|
||||
},
|
||||
//创建气体检测记录,显示Form
|
||||
addgas() {
|
||||
this.gasdialog = true;
|
||||
this.formgas = Object.assign({}, defaultformgas);
|
||||
},
|
||||
|
||||
//提交气体检测记录
|
||||
submitgas() {
|
||||
this.formgas.opl = this.oplId;
|
||||
this.$refs.gasForm.validate(async (valid) => {
|
||||
|
||||
this.$API.opm.gas.create
|
||||
.req(this.formgas)
|
||||
.then((res) => {
|
||||
this.$message.success("创建气体浓度检测记录成功");
|
||||
this.gasdialog = false;
|
||||
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
|
||||
});
|
||||
},
|
||||
//删除气体检测记录
|
||||
delgas(row) {
|
||||
this.$API.opm.gas.delete
|
||||
.req(row.id)
|
||||
.then((res) => {
|
||||
this.$message.success("气体浓度检测记录删除成功");
|
||||
|
||||
return res;
|
||||
})
|
||||
.catch((err) => {
|
||||
return err;
|
||||
});
|
||||
},
|
||||
//退出界面
|
||||
submitOut(){
|
||||
this.$router.push({
|
||||
name: "opl",
|
||||
query: {
|
||||
operationid: this.$route.query.id,//作业ID
|
||||
|
||||
},
|
||||
});
|
||||
}
|
||||
},
|
||||
};
|
||||
</script>
|
Loading…
Reference in New Issue