diff --git a/src/api/model/hrm.js b/src/api/model/hrm.js index 11ddba6f..714bba48 100644 --- a/src/api/model/hrm.js +++ b/src/api/model/hrm.js @@ -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}/`); + } + } + }, } diff --git a/src/api/model/opm.js b/src/api/model/opm.js index 7b239c0e..0777dbc2 100644 --- a/src/api/model/opm.js +++ b/src/api/model/opm.js @@ -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}/`); + } + } +}, } \ No newline at end of file diff --git a/src/config/route.js b/src/config/route.js index db686ed3..3574d6a3 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -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" }, + ] }, { diff --git a/src/views/hrm/certificate.vue b/src/views/hrm/certificate.vue new file mode 100644 index 00000000..bc50edf5 --- /dev/null +++ b/src/views/hrm/certificate.vue @@ -0,0 +1,236 @@ + + diff --git a/src/views/hrm/employee.vue b/src/views/hrm/employee.vue index 9d708a7d..d79f4880 100644 --- a/src/views/hrm/employee.vue +++ b/src/views/hrm/employee.vue @@ -1,89 +1,149 @@ + + + + + + + + + //权限设置 + 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 = {}; + }, + }, +}; + diff --git a/src/views/hrm/ep_form.vue b/src/views/hrm/ep_form.vue index 683d625d..31deb275 100644 --- a/src/views/hrm/ep_form.vue +++ b/src/views/hrm/ep_form.vue @@ -42,7 +42,7 @@ @@ -216,7 +216,7 @@ mounted() { this.getPosts(); this.getGroup(); - this.getUserPostList(); + }, methods: { getPosts(){ diff --git a/src/views/opm/fire.vue b/src/views/opm/fire.vue index e2dd80da..380971f8 100644 --- a/src/views/opm/fire.vue +++ b/src/views/opm/fire.vue @@ -1,19 +1,24 @@ @@ -281,25 +556,43 @@ \ No newline at end of file diff --git a/src/views/opm/operation.vue b/src/views/opm/operation.vue index 05378610..6a7d0c73 100644 --- a/src/views/opm/operation.vue +++ b/src/views/opm/operation.vue @@ -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() { diff --git a/src/views/opm/opl.vue b/src/views/opm/opl.vue index 40abb13c..7c5da4e5 100644 --- a/src/views/opm/opl.vue +++ b/src/views/opm/opl.vue @@ -2,20 +2,17 @@
- - - {{ item.name }} - - + + {{ item.name }} +