This commit is contained in:
shijing 2022-06-25 17:23:07 +08:00
commit d55a6c1070
10 changed files with 1265 additions and 247 deletions

View File

@ -35,4 +35,37 @@ export default {
}
}
},
certificate: {
list: {
name: "人员证书列表",
req: async function(data){
return await http.get(
`${config.API_URL}/hrm/certificate/`,
data
);
}
},
create: {
name: "新增人员证书",
req: async function(data){
return await http.post(
`${config.API_URL}/hrm/certificate/`,
data);
}
},
update: {
name: "更新人员证书",
req: async function(id, data){
return await http.put(
`${config.API_URL}/hrm/certificate/${id}/`,
data);
}
},
delete: {
name: "删除人员证书",
req: async function(id){
return await http.delete(`${config.API_URL}/hrm/certificate/${id}/`);
}
}
},
}

View File

@ -89,4 +89,131 @@ export default {
}
}
},
/*作业许可证*/
opl: {
list: {
name: "获取",
req: async function(data){
return await http.get(
`${config.API_URL}/opm/opl/`,
data
);
}
},
read:{
name: "查询",
req: async function(id){
return await http.get(
`${config.API_URL}/opm/opl/${id}/`);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/opm/opl/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/opm/opl/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/opm/opl/${id}/`);
}
}
},
/*作业人员*/
worker: {
list: {
name: "获取",
req: async function(data){
return await http.get(
`${config.API_URL}/opm/opl_worker/`,
data
);
}
},
read:{
name: "查询",
req: async function(id){
return await http.get(
`${config.API_URL}/opm/opl_worker/${id}/`);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/opm/opl_worker/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/opm/opl_worker/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/opm/opl_worker/${id}/`);
}
}
},
/*气体检测*/
gas: {
list: {
name: "获取",
req: async function(data){
return await http.get(
`${config.API_URL}/opm/gas_check/`,
data
);
}
},
read:{
name: "查询",
req: async function(id){
return await http.get(
`${config.API_URL}/opm/gas_check/${id}/`);
}
},
update: {
name: "更新",
req: async function(id, data){
return await http.put(
`${config.API_URL}/opm/gas_check/${id}/`,
data);
}
},
create: {
name: "创建",
req: async function(data){
return await http.post(
`${config.API_URL}/opm/gas_check/`,
data);
}
},
delete: {
name: "删除",
req: async function(id){
return await http.delete(
`${config.API_URL}/opm/gas_check/${id}/`);
}
}
},
}

View File

@ -165,7 +165,7 @@ const routes = [
,
{
"name": "opl",
"path": "/opm/opl/:id",
"path": "/opm/opl",
"meta": {
"title": "作业许可证",
"icon": "el-icon-menu",
@ -176,7 +176,7 @@ const routes = [
,
{
"name": "fire",
"path": "/opm/fire/:id",
"path": "/opm/fire",
"meta": {
"title": "许可证基本信息",
"icon": "el-icon-menu",
@ -299,7 +299,19 @@ const routes = [
"icon": "el-icon-menu",
},
"component": "hrm/employee"
}
,
{
"name": "certificate",
"path": "/hrm/certificate",
"meta": {
"title": "相关证书",
"icon": "el-icon-menu",
"hidden": true
},
"component": "hrm/certificate"
},
]
},
{

View File

@ -0,0 +1,236 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleForm('add')"
></el-button>
<!--
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> -->
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input
v-model="search.keyword"
placeholder="姓名/手机号"
clearable
@click="upsearch"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
@selection-change="selectionChange"
stripe
@resetQuery="resetQuery"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="#" fixed="left" type="index" width="50"></el-table-column>
<el-table-column label="证书名称" fixed="left" prop="name" width="150"></el-table-column>
<el-table-column label="证书编号" prop="number" width="200"> </el-table-column>
<el-table-column label="证书类型" prop="type" width="200"><template #default="scope">{{type_[scope.row.type]}} </template></el-table-column>
<el-table-column label="发证日期" prop="issue_date" width="180"></el-table-column>
<el-table-column label="有效期" prop="expiration_date" width="200"> </el-table-column>
<el-table-column label="下一次复审日期" prop="review_date" width="180"></el-table-column>
<el-table-column label="证书文件" prop="file" width="180"></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="170">
<template #default="scope">
<el-button-group>
<el-button
text
type="warning"
size="small"
@click="handleForm('edit', scope.row)"
>编辑</el-button
>
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<sc-dialog v-model="dialogcart" draggable title="创建人员证书">
<el-form
ref="dialogForm"
:model="form"
:rules="rules"
:disabled="mode === 'show'"
label-width="120px"
>
<el-row>
<el-col :md="12" :sm="24">
<el-form-item label="证书名称" prop="name">
<el-input
v-model="form.name"
placeholder="请输入证书名称"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="证书编号" prop="number">
<el-input
v-model="form.number"
placeholder="请输入证书编号"
clearable
></el-input>
</el-form-item>
</el-col>
<el-col :md="12" :sm="24">
<el-form-item label="证书类型" prop="type">
<el-select v-model="form.type" placeholder="选择证书类型">
<el-option
v-for="item in typeoptions"
: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-date-picker
v-model="form.issue_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择发证日期"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="有效期">
<el-date-picker
v-model="form.expiration_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择有效期"
/>
</el-form-item>
</el-col>
<el-col :md="12" :sm="12" :xs="24">
<el-form-item label="下一次复审日期">
<el-date-picker
v-model="form.review_date"
type="date"
value-format="YYYY-MM-DD"
placeholder="选择下一次复审日期"
/>
</el-form-item>
</el-col>
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="上传证书文件">
<sc-upload-file
v-model="form.file"
:limit="5"
:data="{ otherData: 'demo' }"
tip="最多上传3个文件,单个文件不要超过10M,请上传xlsx/docx格式文件"
>
<el-button type="primary" icon="el-icon-upload"
>上传附件</el-button
>
</sc-upload-file>
</el-form-item>
</el-col>
</el-row>
</el-form>
<template #footer>
<el-button @click="dialogcart = false"> </el-button>
<el-button type="primary" @click="submitcert"> </el-button>
</template>
</sc-dialog>
</template>
<script>
const defaultform=
{ id: "",
name: "",
number: "",
employee: ""
};
export default {
name: "certificate",
components: {},
data() {
return {
form:defaultform,
typeoptions: [
{ id: 10, name: "特种作业证书" },
{ id: 20, name: "特种设备操作证书" },
{ id: 30, name: "安全管理人员证书" },
],
type_: {
10: "特种作业证书",
20: "特种设备操作证书",
30: "安全管理人员证书",
},
dialogcart: false,
apiObj: this.$API.hrm.certificate.list,
query: {},
selection: [],
search: {
keyword: null,
},
};
},
methods: {
handleForm(type, row) {
if (type === "add") {
this.dialogcart = true;
this.form = Object.assign({}, defaultform);
} else {
this.dialogcart = true;
this.form = row;
}
},
//
submitcert() {
this.form.employee = this.$route.query.id;
this.$refs.dialogForm.validate((valid) => {
if (this.form.id == "") {
this.$API.hrm.certificate.create
.req(this.form)
.then((res) => {
this.$message.success("创建成功");
this.dialogcart = false;
return res;
})
.catch((err) => {
return err;
});
} else {
this.$API.hrm.certificate.update
.req(this.form.id, this.form)
.then((res) => {
this.$message.success("修改成功");
this.dialogcart = false;
return res;
return res;
})
.catch((err) => {
return err;
});
}
});
},
},
};
</script>

View File

@ -1,89 +1,149 @@
<template>
<el-container>
<el-header>
<div class="left-panel">
<el-button type="primary" icon="el-icon-plus" @click="handleForm('add')"></el-button>
<!--
<el-container>
<el-header>
<div class="left-panel">
<el-button
type="primary"
icon="el-icon-plus"
@click="handleForm('add')"
></el-button>
<!--
<el-button type="danger" plain icon="el-icon-delete" :disabled="selection.length==0" @click="batch_del"></el-button>
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> -->
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input v-model="search.keyword" placeholder="姓名/手机号" clearable @click="upsearch"></el-input>
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe @resetQuery="resetQuery" >
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
<el-table-column label="证件照" prop="photo" width="200">
</el-table-column>
<el-table-column label="手机号" prop="phone" width="120"></el-table-column>
<el-table-column label="部门" prop="belong_dept" width="180">
<template #default="scope">
<span v-if="scope.row.belong_dept_">{{scope.row.belong_dept_.name}}</span>
</template>
</el-table-column>
<el-table-column label="创建时间" prop="create_time" width="180"></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="170">
<template #default="scope">
<el-button-group>
<el-button text type="primary" size="small" @click="handleForm('show',scope.row)">查看</el-button>
<el-button text type="warning" size="small" @click="handleForm('edit',scope.row)">编辑</el-button>
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
</div>
<div class="right-panel">
<div class="right-panel-search">
<el-input
v-model="search.keyword"
placeholder="姓名/手机号"
clearable
@click="upsearch"
></el-input>
<el-button
type="primary"
icon="el-icon-search"
@click="upsearch"
></el-button>
</div>
</div>
</el-header>
<el-main class="nopadding">
<scTable
ref="table"
:apiObj="apiObj"
row-key="id"
@selection-change="selectionChange"
stripe
@resetQuery="resetQuery"
>
<el-table-column type="selection" width="50"></el-table-column>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
<el-table-column label="证件照" prop="photo" width="200">
</el-table-column>
<el-table-column
label="手机号"
prop="phone"
width="120"
></el-table-column>
<el-table-column label="部门" prop="belong_dept" width="180">
<template #default="scope">
<span v-if="scope.row.belong_dept_">{{
scope.row.belong_dept_.name
}}</span>
</template>
</el-table-column>
<el-table-column
label="创建时间"
prop="create_time"
width="180"
></el-table-column>
<el-table-column label="操作" fixed="right" align="left" width="170">
<template #default="scope">
<el-button-group>
<el-button
text
type="primary"
size="small"
@click="Addcertificate(scope.row)"
>绑定证书</el-button
>
<el-button
text
type="primary"
size="small"
@click="handleForm('show', scope.row)"
>查看</el-button
>
<el-button
text
type="warning"
size="small"
@click="handleForm('edit', scope.row)"
>编辑</el-button
>
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
<template #reference>
<el-button text type="danger" size="small">删除</el-button>
</template>
</el-popconfirm> -->
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</template>
</el-button-group>
</template>
</el-table-column>
</scTable>
</el-main>
</el-container>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</template>
<script>
import saveDialog from './ep_form.vue'
export default {
name: 'employee',
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
permission: false
},
apiObj: this.$API.hrm.employee.list,
query: {},
selection: [],
search: {
keyword: null
}
}
},
methods: {
//
handleForm(type,row) {
this.dialog.save = true;
this.$nextTick(() => {
if(type==='add'){
this.$refs.saveDialog.open(type)
}else{
this.$refs.saveDialog.open(type).setData(row)
}
import saveDialog from "./ep_form.vue";
export default {
name: "employee",
components: {
saveDialog,
},
data() {
return {
dialog: {
save: false,
permission: false,
},
apiObj: this.$API.hrm.employee.list,
query: {},
selection: [],
search: {
keyword: null,
},
};
},
methods: {
//
Addcertificate(row) {
this.$router.push({
name: "certificate",
query: {
id: row.id,
},
});
},
//
handleForm(type, row) {
this.dialog.save = true;
this.$nextTick(() => {
if (type === "add") {
this.$refs.saveDialog.open(type);
} else {
this.$refs.saveDialog.open(type).setData(row);
}
});
},
})
},
/*//添加
/*//添加
add(){
this.dialog.save = true
this.$nextTick(() => {
@ -104,82 +164,84 @@
this.$refs.saveDialog.open('show').setData(row)
})
},*/
//
permission(){
this.dialog.permission = true
this.$nextTick(() => {
this.$refs.permissionDialog.open()
})
},
//
async table_del(row){
await this.$API.hrm.employee.create.req(row.id).then(res=>{
if(res.err_msg){
this.$message.error(res.err_msg);
}else{
this.$refs.table.refresh();
this.$message.success("删除成功")
}
});
},
//
async batch_del(){
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`, '提示', {
type: 'warning'
}).then(() => {
const loading = this.$loading();
this.$refs.table.refresh()
loading.close();
this.$message.success("操作成功")
}).catch(() => {
})
},
//
selectionChange(selection){
this.selection = selection;
},
//
changeSwitch(val, row){
row.status = row.status == '1'?'0':'1'
row.$switch_status = true;
setTimeout(()=>{
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功")
}, 500)
},
//
upsearch(){
},
//ID
filterTree(id){
var target = null;
function filter(tree){
tree.forEach(item => {
if(item.id == id){
target = item
}
if(item.children){
filter(item.children)
}
})
}
filter(this.$refs.table.tableData)
return target
},
//
handleSaveSuccess(data, mode){
if(mode=='add'){
this.$refs.table.refresh()
}else if(mode=='edit'){
this.$refs.table.refresh()
}
},
resetQuery(){
this.query = {}
}
}
}
</script>
//
permission() {
this.dialog.permission = true;
this.$nextTick(() => {
this.$refs.permissionDialog.open();
});
},
//
async table_del(row) {
await this.$API.hrm.employee.create.req(row.id).then((res) => {
if (res.err_msg) {
this.$message.error(res.err_msg);
} else {
this.$refs.table.refresh();
this.$message.success("删除成功");
}
});
},
//
async batch_del() {
this.$confirm(
`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`,
"提示",
{
type: "warning",
}
)
.then(() => {
const loading = this.$loading();
this.$refs.table.refresh();
loading.close();
this.$message.success("操作成功");
})
.catch(() => {});
},
//
selectionChange(selection) {
this.selection = selection;
},
//
changeSwitch(val, row) {
row.status = row.status == "1" ? "0" : "1";
row.$switch_status = true;
setTimeout(() => {
delete row.$switch_status;
row.status = val;
this.$message.success("操作成功");
}, 500);
},
//
upsearch() {},
//ID
filterTree(id) {
var target = null;
function filter(tree) {
tree.forEach((item) => {
if (item.id == id) {
target = item;
}
if (item.children) {
filter(item.children);
}
});
}
filter(this.$refs.table.tableData);
return target;
},
//
handleSaveSuccess(data, mode) {
if (mode == "add") {
this.$refs.table.refresh();
} else if (mode == "edit") {
this.$refs.table.refresh();
}
},
resetQuery() {
this.query = {};
},
},
};
</script>

View File

@ -42,7 +42,7 @@
<el-form-item label="所属部门">
<el-cascader
v-model="form.dept"
:options="depts"
:options="group"
:props="deptsProps"
clearable
style="width: 100%;">
@ -216,7 +216,7 @@
mounted() {
this.getPosts();
this.getGroup();
this.getUserPostList();
},
methods: {
getPosts(){

View File

@ -1,19 +1,24 @@
<template>
<el-container>
<el-header>
<el-steps :active="active" finish-status="success">
<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">
<!--基本信息!-->
<el-main class="nopadding" v-show="active === 0">
<el-form
v-show="active === 0"
ref="dialogForm"
@ -168,15 +173,13 @@
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="风险选择">
<el-checkbox-group
v-model="form.risks_checked"
@change="handleCheckedRisksChange"
>
<el-checkbox-group v-model="form.risks_checked">
<el-checkbox
v-for="(item, index) in risklist"
:key="index"
:label="item.name"
></el-checkbox>
:label="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-col>
@ -199,15 +202,13 @@
<el-col :md="24" :sm="12" :xs="24">
<el-form-item label="措施选择">
<el-checkbox-group
v-model="form.measures_checked"
@change="handleCheckedMeasuresChange"
>
<el-checkbox-group v-model="form.measures_checked">
<el-checkbox
v-for="(item, index) in measurelist"
:key="index"
:label="item.name"
></el-checkbox>
:label="item.id"
>{{ item.name }}</el-checkbox
>
</el-checkbox-group>
</el-form-item>
</el-col>
@ -252,12 +253,286 @@
</el-col>
</el-row>
</el-form>
<div v-show="active === 1">
面板2
<el-button style="margin-top: 12px" @click="handleLastStep"
>上一步</el-button
>
</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="name" width="150">
<template #default="scope">
{{ scope.row.worker_.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-button type="text" size="small" @click="editWorker(scope.row)"
>编辑</el-button
>
<el-divider direction="vertical"></el-divider>
<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>
</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="可燃气体">
<el-input
v-model.number="formgas.lel"
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>
@ -281,25 +556,43 @@
</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:['基本信息','作业人员'],
apiObj: this.$API.opm.oplcate.list,
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: "特殊动火" },
@ -311,19 +604,56 @@ export default {
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.params.operationid; //
this.oplId = this.$route.params.oplId; //
this.getOperation();
this.getOplcates();
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();
this.getOplcates();
},
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() {
@ -347,32 +677,194 @@ export default {
this.useroptions = res;
});
},
//
//ID
getOplcates() {
this.$API.opm.oplcate.read.req(this.oplId).then((res) => {
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(){
this.stepSuc.push(++this.active)
},
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);
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);
});
} else {
this.active = 1;
}
} else {
this.active = 2;
this.getgasList();
}
// 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);
},
//
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) => {
return err;
});
},
//
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;
});
}
});
},
//
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) => {
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;
});
}
});
},
//退
submitOut(){
this.$router.push({
name: "opl",
query: {
operationid: this.$route.query.id,//ID
},
});
}
},
};
</script>

View File

@ -189,7 +189,10 @@ export default {
//
creatopl(row){
this.$router.push({name: "opl", params: {id: row.id} })
this.$router.push({name: "opl",
query:{
id: row.id
} })
},
//
permission() {

View File

@ -2,20 +2,17 @@
<el-container>
<el-header>
<div class="left-panel">
<el-button
icon="el-icon-plus"
style="margin: 3px 0px 0px 10px"
v-for="(item, index) in oplcateList"
:key="index"
:title="item.name"
type="primary"
@click="addFire(item.id)"
>
{{ item.name }}
</el-button>
<el-button
icon="el-icon-plus"
style="margin: 3px 0px 0px 10px"
v-for="(item, index) in oplcateList"
:key="index"
:title="item.name"
type="primary"
@click="addFire(item.id)"
>
{{ item.name }}
</el-button>
</div>
<div class="right-panel">
<div class="right-panel-search">
@ -42,10 +39,50 @@
stripe
@resetQuery="resetQuery"
>
<el-table-column label="#" type="index" width="50"></el-table-column>
<el-table-column label="名称" prop="name" width="200"></el-table-column>
<el-table-column label="标识" prop="code" width="180">
</el-table-column>
<el-table-column label="#" type="index" width="50" fixed="left"></el-table-column>
<el-table-column
label="作业许可编号"
prop="number"
width="120"
fixed="left"
></el-table-column>
<el-table-column
label="作业级别"
prop="level"
width="120"
fixed="left"
></el-table-column>
<el-table-column
label="许可证种类"
prop="cate_name"
width="120"
fixed="left"
></el-table-column>
<el-table-column
label="作业开始时间"
prop="start_time"
width="180"
></el-table-column>
<el-table-column
label="作业结束时间"
prop="end_time"
width="180"
></el-table-column>
<el-table-column
label="作业部门"
prop="dept_do"
width="180"
></el-table-column>
<el-table-column
label="作业负责人"
prop="charger"
width="180"
></el-table-column>
<el-table-column
label="作业监护人"
prop="monitor"
width="180"
></el-table-column>
<el-table-column label="操作" fixed="right" align="right" width="170">
<template #default="scope">
@ -57,7 +94,7 @@
@click="table_show(scope.row, scope.$index)"
>查看</el-button
>
<el-button
<el-button
text
type="warning"
size="small"
@ -69,28 +106,19 @@
</el-table-column>
</scTable>
</el-main>
<save-dialog
v-if="dialog.save"
ref="saveDialog"
@success="handleSaveSuccess"
@closed="dialog.save = false"
></save-dialog>
</el-container>
</template>
<script>
import saveDialog from "./oplcate_form.vue";
export default {
name: "opl",
components: {
saveDialog,
},
components: {},
data() {
return {
dialog: {
save: false,
permission: false,
},
apiObj: this.$API.opm.oplcate.list,
apiObj: this.$API.opm.opl.list,
query: {},
selection: [],
search: {
@ -103,7 +131,6 @@ export default {
mounted() {
this.getoplcate();
},
methods: {
//
getoplcate() {
@ -113,19 +140,31 @@ export default {
});
},
//
//
addFire(id) {
this.$router.push({
name: "fire",
params: { operationid: this.$route.params.id, oplId: id },
query: {
operationid: this.$route.query.id,//ID
oplcateId:id,//ID
oplId:"",//ID
},
});
},
//
table_edit(row) {
this.dialog.save = true;
this.$nextTick(() => {
this.$refs.saveDialog.open("edit").setData(row);
if(row.cate_name=="动火")
{
this.$router.push({
name: "fire",
query: {
oplId:row.id,//ID
},
});
}
},
//
table_show(row) {

View File

@ -107,7 +107,8 @@
>
设置
</el-button>
<el-divider direction="vertical"></el-divider>
<el-button
type="text"
size="small"
@ -115,7 +116,7 @@
>
编辑
</el-button>
<el-divider direction="vertical"></el-divider>
<el-popconfirm
title="确定删除吗?"
@confirm="table_del(scope.row, scope.$index)"
@ -182,21 +183,25 @@
</template>
</el-dialog>
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
</template>
<script>
import baseUrl from "@/config";
import {genTree} from "@/utils/verificate";
import saveDialog from './user_form.vue'
// import certDialog from './cert_form.vue'
export default {
name: "user",
components: {
saveDialog,
// certDialog,
},
data() {
return {
dialog: {
save: false,
// certSave:false,
},
baseUrl : baseUrl.API_URL,
type: "add",
@ -291,6 +296,15 @@
})
},
//
//Addcertificate(row){
// this.dialog.certSave = true;
// this.$nextTick(() => {
// this.$refs.certDialog.open().setData(row)
// })
// },
//
table_show(row) {
this.limitedVisible = true;