From 25e9acae471fc1df9677fb3efa919183fdcf6aeb Mon Sep 17 00:00:00 2001 From: "2309368887@qq.com" <2309368887@qq.com> Date: Fri, 24 Jun 2022 09:18:18 +0800 Subject: [PATCH] zuoye --- src/api/model/opm.js | 14 + src/config/route.js | 44 +++- src/views/opm/fire.vue | 378 +++++++++++++++++++++++++++ src/views/opm/operation.vue | 426 +++++++++++++++++++------------ src/views/opm/operation_form.vue | 82 +++--- src/views/opm/opl.vue | 217 ++++++++++++++++ 6 files changed, 958 insertions(+), 203 deletions(-) create mode 100644 src/views/opm/fire.vue create mode 100644 src/views/opm/opl.vue diff --git a/src/api/model/opm.js b/src/api/model/opm.js index 11b9b336..7b239c0e 100644 --- a/src/api/model/opm.js +++ b/src/api/model/opm.js @@ -21,6 +21,13 @@ export default { data); } }, + read:{ + name: "查询", + req: async function(id){ + return await http.get( + `${config.API_URL}/opm/opl_cate/${id}/`); + } + }, create: { name: "创建", req: async function(data){ @@ -51,6 +58,13 @@ export default { ); } }, + read:{ + name: "查询", + req: async function(id){ + return await http.get( + `${config.API_URL}/opm/operation/${id}/`); + } + }, update: { name: "更新", req: async function(id, data){ diff --git a/src/config/route.js b/src/config/route.js index 6f92c82f..db686ed3 100644 --- a/src/config/route.js +++ b/src/config/route.js @@ -123,13 +123,13 @@ const routes = [ }, "component": "wf/ticket" }, - { + { "name": "configuration", "path": "/wf/configuration", "meta": { "title": "工单", "icon": "el-icon-menu", - "hidden":true + "hidden": true }, "component": "wf/configuration" }, @@ -162,6 +162,28 @@ const routes = [ }, "component": "opm/oplcate" }, + , + { + "name": "opl", + "path": "/opm/opl/:id", + "meta": { + "title": "作业许可证", + "icon": "el-icon-menu", + "hidden": true + }, + "component": "opm/opl" + }, + , + { + "name": "fire", + "path": "/opm/fire/:id", + "meta": { + "title": "许可证基本信息", + "icon": "el-icon-menu", + "hidden": true + }, + "component": "opm/fire" + }, ] }, { @@ -249,15 +271,15 @@ const routes = [ }, "component": "am/area" }, - { - "name": "eqm", - "path": "/am/eqm", - "meta": { - "title": "门禁通道", - "icon": "el-icon-menu", - }, - "component": "am/em1" - }, + { + "name": "eqm", + "path": "/am/eqm", + "meta": { + "title": "门禁通道", + "icon": "el-icon-menu", + }, + "component": "am/em1" + }, ] }, { diff --git a/src/views/opm/fire.vue b/src/views/opm/fire.vue new file mode 100644 index 00000000..e2dd80da --- /dev/null +++ b/src/views/opm/fire.vue @@ -0,0 +1,378 @@ + + + \ No newline at end of file diff --git a/src/views/opm/operation.vue b/src/views/opm/operation.vue index b5a9bb6e..05378610 100644 --- a/src/views/opm/operation.vue +++ b/src/views/opm/operation.vue @@ -1,162 +1,274 @@ + + + + + + + + + + + + + + \ No newline at end of file + //编辑 + table_edit(row) { + this.dialog.save = true; + this.$nextTick(() => { + this.$refs.saveDialog.open("edit").setData(row); + }); + }, + //查看 + table_show(row) { + this.dialog.save = true; + this.$nextTick(() => { + this.$refs.saveDialog.open("show").setData(row); + }); + }, + //创建作业许可证 + creatopl(row){ + + this.$router.push({name: "opl", params: {id: row.id} }) + }, + //权限设置 + permission() { + this.dialog.permission = true; + this.$nextTick(() => { + this.$refs.permissionDialog.open(); + }); + }, + //删除 + async table_del(row) { + var reqData = { id: row.id }; + var res = await this.$API.demo.post.post(reqData); + if (res.code == 200) { + this.$refs.table.refresh(); + this.$message.success("删除成功"); + } else { + this.$alert(res.message, "提示", { type: "error" }); + } + }, + //批量删除 + 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 = {}; + }, + }, +}; + \ No newline at end of file diff --git a/src/views/opm/operation_form.vue b/src/views/opm/operation_form.vue index 9e5c7e88..154d36a9 100644 --- a/src/views/opm/operation_form.vue +++ b/src/views/opm/operation_form.vue @@ -65,45 +65,30 @@ v-for="item in areaoptions" :key="item.id" :label="item.name" - :value="item.name" + :value="item.id" /> + + - + - - - - - - - - - - - - - - @@ -115,10 +100,27 @@ v-for="item in coordinatoroptions" :key="item.id" :label="item.name" - :value="item.name" + :value="item.id" /> + + + + + @@ -134,7 +136,7 @@ \ No newline at end of file