donghuozuoye
This commit is contained in:
parent
5115e4023c
commit
25f000b3e1
|
@ -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}/`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
|
@ -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}/`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
}
|
}
|
|
@ -165,7 +165,7 @@ const routes = [
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
"name": "opl",
|
"name": "opl",
|
||||||
"path": "/opm/opl/:id",
|
"path": "/opm/opl",
|
||||||
"meta": {
|
"meta": {
|
||||||
"title": "作业许可证",
|
"title": "作业许可证",
|
||||||
"icon": "el-icon-menu",
|
"icon": "el-icon-menu",
|
||||||
|
@ -176,7 +176,7 @@ const routes = [
|
||||||
,
|
,
|
||||||
{
|
{
|
||||||
"name": "fire",
|
"name": "fire",
|
||||||
"path": "/opm/fire/:id",
|
"path": "/opm/fire",
|
||||||
"meta": {
|
"meta": {
|
||||||
"title": "许可证基本信息",
|
"title": "许可证基本信息",
|
||||||
"icon": "el-icon-menu",
|
"icon": "el-icon-menu",
|
||||||
|
@ -299,7 +299,19 @@ const routes = [
|
||||||
"icon": "el-icon-menu",
|
"icon": "el-icon-menu",
|
||||||
},
|
},
|
||||||
"component": "hrm/employee"
|
"component": "hrm/employee"
|
||||||
|
}
|
||||||
|
,
|
||||||
|
{
|
||||||
|
"name": "certificate",
|
||||||
|
"path": "/hrm/certificate",
|
||||||
|
"meta": {
|
||||||
|
"title": "相关证书",
|
||||||
|
"icon": "el-icon-menu",
|
||||||
|
"hidden": true
|
||||||
|
},
|
||||||
|
"component": "hrm/certificate"
|
||||||
},
|
},
|
||||||
|
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -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>
|
|
@ -1,89 +1,149 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
<el-button type="primary" icon="el-icon-plus" @click="handleForm('add')"></el-button>
|
<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="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> -->
|
<el-button type="primary" plain :disabled="selection.length!=1" @click="permission">权限设置</el-button> -->
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<div class="right-panel-search">
|
<div class="right-panel-search">
|
||||||
<el-input v-model="search.keyword" placeholder="姓名/手机号" clearable @click="upsearch"></el-input>
|
<el-input
|
||||||
<el-button type="primary" icon="el-icon-search" @click="upsearch"></el-button>
|
v-model="search.keyword"
|
||||||
</div>
|
placeholder="姓名/手机号"
|
||||||
</div>
|
clearable
|
||||||
</el-header>
|
@click="upsearch"
|
||||||
<el-main class="nopadding">
|
></el-input>
|
||||||
<scTable ref="table" :apiObj="apiObj" row-key="id" @selection-change="selectionChange" stripe @resetQuery="resetQuery" >
|
<el-button
|
||||||
<el-table-column type="selection" width="50"></el-table-column>
|
type="primary"
|
||||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
icon="el-icon-search"
|
||||||
<el-table-column label="姓名" prop="name" width="150"></el-table-column>
|
@click="upsearch"
|
||||||
<el-table-column label="证件照" prop="photo" width="200">
|
></el-button>
|
||||||
|
</div>
|
||||||
</el-table-column>
|
</div>
|
||||||
<el-table-column label="手机号" prop="phone" width="120"></el-table-column>
|
</el-header>
|
||||||
<el-table-column label="部门" prop="belong_dept" width="180">
|
<el-main class="nopadding">
|
||||||
<template #default="scope">
|
<scTable
|
||||||
<span v-if="scope.row.belong_dept_">{{scope.row.belong_dept_.name}}</span>
|
ref="table"
|
||||||
</template>
|
:apiObj="apiObj"
|
||||||
</el-table-column>
|
row-key="id"
|
||||||
<el-table-column label="创建时间" prop="create_time" width="180"></el-table-column>
|
@selection-change="selectionChange"
|
||||||
<el-table-column label="操作" fixed="right" align="right" width="170">
|
stripe
|
||||||
<template #default="scope">
|
@resetQuery="resetQuery"
|
||||||
<el-button-group>
|
>
|
||||||
<el-button text type="primary" size="small" @click="handleForm('show',scope.row)">查看</el-button>
|
<el-table-column type="selection" width="50"></el-table-column>
|
||||||
<el-button text type="warning" size="small" @click="handleForm('edit',scope.row)">编辑</el-button>
|
<el-table-column label="#" type="index" width="50"></el-table-column>
|
||||||
<!-- <el-popconfirm title="确定删除吗?" @confirm="table_del(scope.row, scope.$index)">
|
<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>
|
<template #reference>
|
||||||
<el-button text type="danger" size="small">删除</el-button>
|
<el-button text type="danger" size="small">删除</el-button>
|
||||||
</template>
|
</template>
|
||||||
</el-popconfirm> -->
|
</el-popconfirm> -->
|
||||||
</el-button-group>
|
</el-button-group>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
|
</scTable>
|
||||||
</scTable>
|
</el-main>
|
||||||
</el-main>
|
</el-container>
|
||||||
</el-container>
|
<save-dialog
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
v-if="dialog.save"
|
||||||
</template>
|
ref="saveDialog"
|
||||||
|
@success="handleSaveSuccess"
|
||||||
|
@closed="dialog.save = false"
|
||||||
|
></save-dialog>
|
||||||
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from './ep_form.vue'
|
import saveDialog from "./ep_form.vue";
|
||||||
export default {
|
export default {
|
||||||
name: 'employee',
|
name: "employee",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
permission: false
|
permission: false,
|
||||||
},
|
},
|
||||||
apiObj: this.$API.hrm.employee.list,
|
apiObj: this.$API.hrm.employee.list,
|
||||||
query: {},
|
query: {},
|
||||||
selection: [],
|
selection: [],
|
||||||
search: {
|
search: {
|
||||||
keyword: null
|
keyword: null,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
//添加
|
//人员证书添加
|
||||||
handleForm(type,row) {
|
Addcertificate(row) {
|
||||||
this.dialog.save = true;
|
this.$router.push({
|
||||||
this.$nextTick(() => {
|
name: "certificate",
|
||||||
if(type==='add'){
|
query: {
|
||||||
this.$refs.saveDialog.open(type)
|
id: row.id,
|
||||||
}else{
|
},
|
||||||
this.$refs.saveDialog.open(type).setData(row)
|
});
|
||||||
}
|
},
|
||||||
|
//添加
|
||||||
|
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(){
|
add(){
|
||||||
this.dialog.save = true
|
this.dialog.save = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
|
@ -104,82 +164,84 @@
|
||||||
this.$refs.saveDialog.open('show').setData(row)
|
this.$refs.saveDialog.open('show').setData(row)
|
||||||
})
|
})
|
||||||
},*/
|
},*/
|
||||||
//权限设置
|
//权限设置
|
||||||
permission(){
|
permission() {
|
||||||
this.dialog.permission = true
|
this.dialog.permission = true;
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.permissionDialog.open()
|
this.$refs.permissionDialog.open();
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
//删除
|
//删除
|
||||||
async table_del(row){
|
async table_del(row) {
|
||||||
await this.$API.hrm.employee.create.req(row.id).then(res=>{
|
await this.$API.hrm.employee.create.req(row.id).then((res) => {
|
||||||
if(res.err_msg){
|
if (res.err_msg) {
|
||||||
this.$message.error(res.err_msg);
|
this.$message.error(res.err_msg);
|
||||||
}else{
|
} else {
|
||||||
this.$refs.table.refresh();
|
this.$refs.table.refresh();
|
||||||
this.$message.success("删除成功")
|
this.$message.success("删除成功");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
//批量删除
|
//批量删除
|
||||||
async batch_del(){
|
async batch_del() {
|
||||||
this.$confirm(`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`, '提示', {
|
this.$confirm(
|
||||||
type: 'warning'
|
`确定删除选中的 ${this.selection.length} 项吗?如果删除项中含有子集将会被一并删除`,
|
||||||
}).then(() => {
|
"提示",
|
||||||
const loading = this.$loading();
|
{
|
||||||
this.$refs.table.refresh()
|
type: "warning",
|
||||||
loading.close();
|
}
|
||||||
this.$message.success("操作成功")
|
)
|
||||||
}).catch(() => {
|
.then(() => {
|
||||||
|
const loading = this.$loading();
|
||||||
})
|
this.$refs.table.refresh();
|
||||||
},
|
loading.close();
|
||||||
//表格选择后回调事件
|
this.$message.success("操作成功");
|
||||||
selectionChange(selection){
|
})
|
||||||
this.selection = selection;
|
.catch(() => {});
|
||||||
},
|
},
|
||||||
//表格内开关
|
//表格选择后回调事件
|
||||||
changeSwitch(val, row){
|
selectionChange(selection) {
|
||||||
row.status = row.status == '1'?'0':'1'
|
this.selection = selection;
|
||||||
row.$switch_status = true;
|
},
|
||||||
setTimeout(()=>{
|
//表格内开关
|
||||||
delete row.$switch_status;
|
changeSwitch(val, row) {
|
||||||
row.status = val;
|
row.status = row.status == "1" ? "0" : "1";
|
||||||
this.$message.success("操作成功")
|
row.$switch_status = true;
|
||||||
}, 500)
|
setTimeout(() => {
|
||||||
},
|
delete row.$switch_status;
|
||||||
//搜索
|
row.status = val;
|
||||||
upsearch(){
|
this.$message.success("操作成功");
|
||||||
|
}, 500);
|
||||||
},
|
},
|
||||||
//根据ID获取树结构
|
//搜索
|
||||||
filterTree(id){
|
upsearch() {},
|
||||||
var target = null;
|
//根据ID获取树结构
|
||||||
function filter(tree){
|
filterTree(id) {
|
||||||
tree.forEach(item => {
|
var target = null;
|
||||||
if(item.id == id){
|
function filter(tree) {
|
||||||
target = item
|
tree.forEach((item) => {
|
||||||
}
|
if (item.id == id) {
|
||||||
if(item.children){
|
target = item;
|
||||||
filter(item.children)
|
}
|
||||||
}
|
if (item.children) {
|
||||||
})
|
filter(item.children);
|
||||||
}
|
}
|
||||||
filter(this.$refs.table.tableData)
|
});
|
||||||
return target
|
}
|
||||||
},
|
filter(this.$refs.table.tableData);
|
||||||
//本地更新数据
|
return target;
|
||||||
handleSaveSuccess(data, mode){
|
},
|
||||||
if(mode=='add'){
|
//本地更新数据
|
||||||
this.$refs.table.refresh()
|
handleSaveSuccess(data, mode) {
|
||||||
}else if(mode=='edit'){
|
if (mode == "add") {
|
||||||
this.$refs.table.refresh()
|
this.$refs.table.refresh();
|
||||||
}
|
} else if (mode == "edit") {
|
||||||
},
|
this.$refs.table.refresh();
|
||||||
resetQuery(){
|
}
|
||||||
this.query = {}
|
},
|
||||||
}
|
resetQuery() {
|
||||||
}
|
this.query = {};
|
||||||
}
|
},
|
||||||
</script>
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
|
|
@ -42,7 +42,7 @@
|
||||||
<el-form-item label="所属部门">
|
<el-form-item label="所属部门">
|
||||||
<el-cascader
|
<el-cascader
|
||||||
v-model="form.dept"
|
v-model="form.dept"
|
||||||
:options="depts"
|
:options="group"
|
||||||
:props="deptsProps"
|
:props="deptsProps"
|
||||||
clearable
|
clearable
|
||||||
style="width: 100%;">
|
style="width: 100%;">
|
||||||
|
@ -216,7 +216,7 @@
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getPosts();
|
this.getPosts();
|
||||||
this.getGroup();
|
this.getGroup();
|
||||||
this.getUserPostList();
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getPosts(){
|
getPosts(){
|
||||||
|
|
|
@ -1,19 +1,24 @@
|
||||||
<template>
|
<template>
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<el-steps :active="active" finish-status="success">
|
<el-steps
|
||||||
|
:active="active"
|
||||||
|
style="width: 100%"
|
||||||
|
:align-center="true"
|
||||||
|
finish-status="success"
|
||||||
|
>
|
||||||
<el-step
|
<el-step
|
||||||
v-for="(item, index) of stepTitle"
|
v-for="(item, index) of stepTitle"
|
||||||
:key="index"
|
:key="index"
|
||||||
:title="item"
|
:title="item"
|
||||||
|
style="50%"
|
||||||
@click="handleStep(index)"
|
@click="handleStep(index)"
|
||||||
>
|
>
|
||||||
</el-step>
|
</el-step>
|
||||||
</el-steps>
|
</el-steps>
|
||||||
</el-header>
|
</el-header>
|
||||||
|
<!--基本信息!-->
|
||||||
<el-main class="nopadding">
|
<el-main class="nopadding" v-show="active === 0">
|
||||||
<el-form
|
<el-form
|
||||||
v-show="active === 0"
|
v-show="active === 0"
|
||||||
ref="dialogForm"
|
ref="dialogForm"
|
||||||
|
@ -168,15 +173,13 @@
|
||||||
|
|
||||||
<el-col :md="24" :sm="12" :xs="24">
|
<el-col :md="24" :sm="12" :xs="24">
|
||||||
<el-form-item label="风险选择">
|
<el-form-item label="风险选择">
|
||||||
<el-checkbox-group
|
<el-checkbox-group v-model="form.risks_checked">
|
||||||
v-model="form.risks_checked"
|
|
||||||
@change="handleCheckedRisksChange"
|
|
||||||
>
|
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="(item, index) in risklist"
|
v-for="(item, index) in risklist"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.name"
|
:label="item.id"
|
||||||
></el-checkbox>
|
>{{ item.name }}</el-checkbox
|
||||||
|
>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -199,15 +202,13 @@
|
||||||
|
|
||||||
<el-col :md="24" :sm="12" :xs="24">
|
<el-col :md="24" :sm="12" :xs="24">
|
||||||
<el-form-item label="措施选择">
|
<el-form-item label="措施选择">
|
||||||
<el-checkbox-group
|
<el-checkbox-group v-model="form.measures_checked">
|
||||||
v-model="form.measures_checked"
|
|
||||||
@change="handleCheckedMeasuresChange"
|
|
||||||
>
|
|
||||||
<el-checkbox
|
<el-checkbox
|
||||||
v-for="(item, index) in measurelist"
|
v-for="(item, index) in measurelist"
|
||||||
:key="index"
|
:key="index"
|
||||||
:label="item.name"
|
:label="item.id"
|
||||||
></el-checkbox>
|
>{{ item.name }}</el-checkbox
|
||||||
|
>
|
||||||
</el-checkbox-group>
|
</el-checkbox-group>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -252,12 +253,286 @@
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</el-form>
|
</el-form>
|
||||||
<div v-show="active === 1">
|
</el-main>
|
||||||
面板2
|
|
||||||
<el-button style="margin-top: 12px" @click="handleLastStep"
|
<!--作业人员!-->
|
||||||
>上一步</el-button
|
<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>
|
</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-main>
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
|
@ -281,25 +556,43 @@
|
||||||
</style>
|
</style>
|
||||||
<script>
|
<script>
|
||||||
import { genTree } from "@/utils/verificate";
|
import { genTree } from "@/utils/verificate";
|
||||||
|
const defaultformworker = {
|
||||||
|
id: "",
|
||||||
|
worker: null,
|
||||||
|
duty: null,
|
||||||
|
certificates: [],
|
||||||
|
opl: "",
|
||||||
|
};
|
||||||
|
const defaultformgas = {
|
||||||
|
id: "",
|
||||||
|
check_time: null,
|
||||||
|
opl:""
|
||||||
|
};
|
||||||
export default {
|
export default {
|
||||||
name: "fire",
|
name: "fire",
|
||||||
components: {},
|
components: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
active: 0,
|
active: 0,
|
||||||
stepSuc:[0],
|
stepSuc: [0],
|
||||||
stepTitle:['基本信息','作业人员'],
|
stepTitle: ["基本信息", "作业人员", "气体检测记录"],
|
||||||
apiObj: this.$API.opm.oplcate.list,
|
|
||||||
query: {},
|
query: {},
|
||||||
selection: [],
|
selection: [],
|
||||||
|
issave: false, //控制基本信息提交
|
||||||
search: {
|
search: {
|
||||||
keyword: null,
|
keyword: null,
|
||||||
},
|
},
|
||||||
form: {
|
form: {
|
||||||
|
id: "",
|
||||||
start_time: null,
|
start_time: null,
|
||||||
end_time: null,
|
end_time: null,
|
||||||
|
operation: "",
|
||||||
|
cate: "",
|
||||||
|
risks_checked: [],
|
||||||
},
|
},
|
||||||
|
|
||||||
operationId: "",
|
operationId: "",
|
||||||
|
oplcateId: "",
|
||||||
oplId: "",
|
oplId: "",
|
||||||
leveloptions: [
|
leveloptions: [
|
||||||
{ id: 10, name: "特殊动火" },
|
{ id: 10, name: "特殊动火" },
|
||||||
|
@ -311,19 +604,56 @@ export default {
|
||||||
risklist: [],
|
risklist: [],
|
||||||
measurelist: [],
|
measurelist: [],
|
||||||
pagtitle: "",
|
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() {
|
mounted() {
|
||||||
this.operationId = this.$route.params.operationid; //作业号
|
this.operationId = this.$route.query.operationid; //作业ID
|
||||||
this.oplId = this.$route.params.oplId; //作业许可证种类
|
this.oplcateId = this.$route.query.oplcateId; //作业许可证种类ID
|
||||||
this.getOperation();
|
this.oplId = this.$route.query.oplId; //许可证ID
|
||||||
this.getOplcates();
|
this.getoplData();
|
||||||
|
|
||||||
this.getDept();
|
this.getDept();
|
||||||
this.getUser();
|
this.getUser();
|
||||||
this.getOplcates();
|
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
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,查作业信息
|
//根据operationId,查作业信息
|
||||||
|
|
||||||
getOperation() {
|
getOperation() {
|
||||||
|
@ -347,32 +677,194 @@ export default {
|
||||||
this.useroptions = res;
|
this.useroptions = res;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
//作业
|
||||||
|
|
||||||
//根据作业许可证ID获取,风险、措施
|
//根据作业许可证ID获取,风险、措施
|
||||||
getOplcates() {
|
getOplcates() {
|
||||||
this.$API.opm.oplcate.read.req(this.oplId).then((res) => {
|
this.$API.opm.oplcate.read.req(this.oplcateId).then((res) => {
|
||||||
console.log(res); //
|
console.log(res); //
|
||||||
this.pagtitle = res.name;
|
this.pagtitle = res.name;
|
||||||
this.risklist = res.risk_options_; //风险缝隙
|
this.risklist = res.risk_options_; //风险缝隙
|
||||||
this.measurelist = res.measure_options_; //控制措施
|
this.measurelist = res.measure_options_; //控制措施
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleStep(val) {
|
handleStep(val) {
|
||||||
//点击步骤条
|
//点击步骤条
|
||||||
if(this.stepSuc.includes(val)===true){
|
if (this.stepSuc.includes(val) === true) {
|
||||||
this.active = val
|
this.active = val;
|
||||||
}
|
}
|
||||||
} ,
|
},
|
||||||
//组件点击上一步
|
//组件点击上一步
|
||||||
handleLastStep(){
|
handleLastStep() {
|
||||||
if(--this.active===0){
|
if (--this.active === 0) {
|
||||||
this.active = 0
|
this.active = 0;
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
//组件点击下一步
|
//组件点击下一步
|
||||||
handleNextStep(){
|
handleNextStep() {
|
||||||
this.stepSuc.push(++this.active)
|
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>
|
</script>
|
|
@ -189,7 +189,10 @@ export default {
|
||||||
//创建作业许可证
|
//创建作业许可证
|
||||||
creatopl(row){
|
creatopl(row){
|
||||||
|
|
||||||
this.$router.push({name: "opl", params: {id: row.id} })
|
this.$router.push({name: "opl",
|
||||||
|
query:{
|
||||||
|
id: row.id
|
||||||
|
} })
|
||||||
},
|
},
|
||||||
//权限设置
|
//权限设置
|
||||||
permission() {
|
permission() {
|
||||||
|
|
|
@ -2,20 +2,17 @@
|
||||||
<el-container>
|
<el-container>
|
||||||
<el-header>
|
<el-header>
|
||||||
<div class="left-panel">
|
<div class="left-panel">
|
||||||
|
<el-button
|
||||||
<el-button
|
icon="el-icon-plus"
|
||||||
|
style="margin: 3px 0px 0px 10px"
|
||||||
icon="el-icon-plus"
|
v-for="(item, index) in oplcateList"
|
||||||
style="margin: 3px 0px 0px 10px"
|
:key="index"
|
||||||
v-for="(item, index) in oplcateList"
|
:title="item.name"
|
||||||
:key="index"
|
type="primary"
|
||||||
:title="item.name"
|
@click="addFire(item.id)"
|
||||||
type="primary"
|
>
|
||||||
@click="addFire(item.id)"
|
{{ item.name }}
|
||||||
>
|
</el-button>
|
||||||
{{ item.name }}
|
|
||||||
</el-button>
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
<div class="right-panel">
|
<div class="right-panel">
|
||||||
<div class="right-panel-search">
|
<div class="right-panel-search">
|
||||||
|
@ -42,10 +39,50 @@
|
||||||
stripe
|
stripe
|
||||||
@resetQuery="resetQuery"
|
@resetQuery="resetQuery"
|
||||||
>
|
>
|
||||||
<el-table-column label="#" type="index" width="50"></el-table-column>
|
<el-table-column label="#" type="index" width="50" fixed="left"></el-table-column>
|
||||||
<el-table-column label="名称" prop="name" width="200"></el-table-column>
|
<el-table-column
|
||||||
<el-table-column label="标识" prop="code" width="180">
|
label="作业许可编号"
|
||||||
</el-table-column>
|
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">
|
<el-table-column label="操作" fixed="right" align="right" width="170">
|
||||||
<template #default="scope">
|
<template #default="scope">
|
||||||
|
@ -57,7 +94,7 @@
|
||||||
@click="table_show(scope.row, scope.$index)"
|
@click="table_show(scope.row, scope.$index)"
|
||||||
>查看</el-button
|
>查看</el-button
|
||||||
>
|
>
|
||||||
<el-button
|
<el-button
|
||||||
text
|
text
|
||||||
type="warning"
|
type="warning"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -69,28 +106,19 @@
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</scTable>
|
</scTable>
|
||||||
</el-main>
|
</el-main>
|
||||||
<save-dialog
|
|
||||||
v-if="dialog.save"
|
|
||||||
ref="saveDialog"
|
|
||||||
@success="handleSaveSuccess"
|
|
||||||
@closed="dialog.save = false"
|
|
||||||
></save-dialog>
|
|
||||||
</el-container>
|
</el-container>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import saveDialog from "./oplcate_form.vue";
|
|
||||||
export default {
|
export default {
|
||||||
name: "opl",
|
name: "opl",
|
||||||
components: {
|
components: {},
|
||||||
saveDialog,
|
|
||||||
},
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
permission: false,
|
permission: false,
|
||||||
},
|
},
|
||||||
apiObj: this.$API.opm.oplcate.list,
|
apiObj: this.$API.opm.opl.list,
|
||||||
query: {},
|
query: {},
|
||||||
selection: [],
|
selection: [],
|
||||||
search: {
|
search: {
|
||||||
|
@ -103,7 +131,6 @@ export default {
|
||||||
mounted() {
|
mounted() {
|
||||||
this.getoplcate();
|
this.getoplcate();
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
//作业许可证列表
|
//作业许可证列表
|
||||||
getoplcate() {
|
getoplcate() {
|
||||||
|
@ -113,19 +140,31 @@ export default {
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
//作业许可证添加
|
//点击作业类型,创建作业许可证添加
|
||||||
addFire(id) {
|
addFire(id) {
|
||||||
this.$router.push({
|
this.$router.push({
|
||||||
name: "fire",
|
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) {
|
table_edit(row) {
|
||||||
this.dialog.save = true;
|
|
||||||
this.$nextTick(() => {
|
if(row.cate_name=="动火")
|
||||||
this.$refs.saveDialog.open("edit").setData(row);
|
{
|
||||||
|
this.$router.push({
|
||||||
|
name: "fire",
|
||||||
|
query: {
|
||||||
|
oplId:row.id,//许可证ID
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
},
|
},
|
||||||
//查看
|
//查看
|
||||||
table_show(row) {
|
table_show(row) {
|
||||||
|
|
|
@ -107,7 +107,8 @@
|
||||||
>
|
>
|
||||||
设置
|
设置
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
|
|
||||||
<el-button
|
<el-button
|
||||||
type="text"
|
type="text"
|
||||||
size="small"
|
size="small"
|
||||||
|
@ -115,7 +116,7 @@
|
||||||
>
|
>
|
||||||
编辑
|
编辑
|
||||||
</el-button>
|
</el-button>
|
||||||
<el-divider direction="vertical"></el-divider>
|
|
||||||
<el-popconfirm
|
<el-popconfirm
|
||||||
title="确定删除吗?"
|
title="确定删除吗?"
|
||||||
@confirm="table_del(scope.row, scope.$index)"
|
@confirm="table_del(scope.row, scope.$index)"
|
||||||
|
@ -182,21 +183,25 @@
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
<save-dialog v-if="dialog.save" ref="saveDialog" @success="handleSaveSuccess" @closed="dialog.save=false"></save-dialog>
|
||||||
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import baseUrl from "@/config";
|
import baseUrl from "@/config";
|
||||||
import {genTree} from "@/utils/verificate";
|
import {genTree} from "@/utils/verificate";
|
||||||
import saveDialog from './user_form.vue'
|
import saveDialog from './user_form.vue'
|
||||||
|
// import certDialog from './cert_form.vue'
|
||||||
export default {
|
export default {
|
||||||
name: "user",
|
name: "user",
|
||||||
components: {
|
components: {
|
||||||
saveDialog,
|
saveDialog,
|
||||||
|
// certDialog,
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
dialog: {
|
dialog: {
|
||||||
save: false,
|
save: false,
|
||||||
|
// certSave:false,
|
||||||
},
|
},
|
||||||
baseUrl : baseUrl.API_URL,
|
baseUrl : baseUrl.API_URL,
|
||||||
type: "add",
|
type: "add",
|
||||||
|
@ -291,6 +296,15 @@
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
//添加证书
|
||||||
|
//Addcertificate(row){
|
||||||
|
// this.dialog.certSave = true;
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.certDialog.open().setData(row)
|
||||||
|
|
||||||
|
// })
|
||||||
|
|
||||||
|
// },
|
||||||
//查看
|
//查看
|
||||||
table_show(row) {
|
table_show(row) {
|
||||||
this.limitedVisible = true;
|
this.limitedVisible = true;
|
||||||
|
|
Loading…
Reference in New Issue