diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java index f9f35ab..d9efcdc 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolPlan.java @@ -1,7 +1,6 @@ package com.inspur.patrol.domain; import java.util.Date; -import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.inspur.common.annotation.Excel; diff --git a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java index 718df80..0888930 100644 --- a/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java +++ b/zfipc-server/zfipc-system/src/main/java/com/inspur/patrol/domain/IpcPatrolTask.java @@ -1,7 +1,6 @@ package com.inspur.patrol.domain; import java.util.Date; -import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; import com.inspur.common.annotation.Excel; diff --git a/zfipc-ui/package.json b/zfipc-ui/package.json index 6cd9651..8c174b5 100644 --- a/zfipc-ui/package.json +++ b/zfipc-ui/package.json @@ -5,8 +5,8 @@ "author": "", "license": "MIT", "scripts": { - "dev": "vue-cli-service serve", - "build:prod": "vue-cli-service build", + "dev": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service serve", + "build:prod": "SET NODE_OPTIONS=--openssl-legacy-provider && vue-cli-service build", "build:stage": "vue-cli-service build --mode staging", "preview": "node build/index.js --preview", "lint": "eslint --ext .js,.vue src" diff --git a/zfipc-ui/src/App.vue b/zfipc-ui/src/App.vue index 13059ea..35bad36 100644 --- a/zfipc-ui/src/App.vue +++ b/zfipc-ui/src/App.vue @@ -51,4 +51,8 @@ div.el-table tr { color: white; background-color: #0b2d57; } +.el-descriptions__body { + color: white; + background-color: transparent; +} diff --git a/zfipc-ui/src/api/patrol/item.js b/zfipc-ui/src/api/patrol/item.js new file mode 100644 index 0000000..317444b --- /dev/null +++ b/zfipc-ui/src/api/patrol/item.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询巡检项目列表 +export function listItem(query) { + return request({ + url: '/patrol/item/list', + method: 'get', + params: query + }) +} + +// 查询巡检项目详细 +export function getItem(id) { + return request({ + url: '/patrol/item/' + id, + method: 'get' + }) +} + +// 新增巡检项目 +export function addItem(data) { + return request({ + url: '/patrol/item', + method: 'post', + data: data + }) +} + +// 修改巡检项目 +export function updateItem(data) { + return request({ + url: '/patrol/item', + method: 'put', + data: data + }) +} + +// 删除巡检项目 +export function delItem(id) { + return request({ + url: '/patrol/item/' + id, + method: 'delete' + }) +} diff --git a/zfipc-ui/src/api/patrol/taskItem.js b/zfipc-ui/src/api/patrol/taskItem.js new file mode 100644 index 0000000..4a691e6 --- /dev/null +++ b/zfipc-ui/src/api/patrol/taskItem.js @@ -0,0 +1,44 @@ +import request from '@/utils/request' + +// 查询巡检任务项目列表 +export function listTaskItem(query) { + return request({ + url: '/patrol/taskItem/list', + method: 'get', + params: query + }) +} + +// 查询巡检任务项目详细 +export function getTaskItem(id) { + return request({ + url: '/patrol/taskItem/' + id, + method: 'get' + }) +} + +// 新增巡检任务项目 +export function addTaskItem(data) { + return request({ + url: '/patrol/taskItem', + method: 'post', + data: data + }) +} + +// 修改巡检任务项目 +export function updateTaskItem(data) { + return request({ + url: '/patrol/taskItem', + method: 'put', + data: data + }) +} + +// 删除巡检任务项目 +export function delTaskItem(id) { + return request({ + url: '/patrol/taskItem/' + id, + method: 'delete' + }) +} diff --git a/zfipc-ui/src/views/patrol/history/index.vue b/zfipc-ui/src/views/patrol/history/index.vue index 75b8b8c..ba833e3 100644 --- a/zfipc-ui/src/views/patrol/history/index.vue +++ b/zfipc-ui/src/views/patrol/history/index.vue @@ -416,9 +416,108 @@ + 点检项目 + + + + + + + + + + + + + + + + + + + + 巡检报告 { + this.itemList = response.data; + }); + }, /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { @@ -735,17 +848,10 @@ export default { }; this.resetForm("form"); }, - // 打开报告弹窗 - handleReprot(row) { - this.resetReport(); - this.reportForm.taskId = row.id; - this.openReport = true; - this.titleReport = "提交巡检报告"; - this.key++; - }, // 查看报告 handleReprotView(row) { this.resetReport(); + this.getItemList(row.id); getTaskReport(row.id).then((response) => { this.reportForm = response.data; this.openReport = true; diff --git a/zfipc-ui/src/views/patrol/item/index.vue b/zfipc-ui/src/views/patrol/item/index.vue new file mode 100644 index 0000000..2e2dbd1 --- /dev/null +++ b/zfipc-ui/src/views/patrol/item/index.vue @@ -0,0 +1,678 @@ + + + + \ No newline at end of file diff --git a/zfipc-ui/src/views/patrol/plan/index.vue b/zfipc-ui/src/views/patrol/plan/index.vue index 2b9fcb2..6eff76b 100644 --- a/zfipc-ui/src/views/patrol/plan/index.vue +++ b/zfipc-ui/src/views/patrol/plan/index.vue @@ -428,7 +428,7 @@
+ + + + + + {{ getItemName(form.itemId) }} + + - - - - - {{ form.timeLimit }} - @@ -533,6 +535,7 @@ + + + + + + + {{ form.timeLimit }} + + { + this.itemList = response.data; + }); + }, + /** 根据巡检ID获得巡检名称 */ + getItemName(id) { + const item = this.itemList.find((item) => item.id === id); + if (item) { + return item.name; + } else { + return ""; + } + }, /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { @@ -1123,6 +1168,7 @@ export default { handleAdd() { this.operateType = "add"; this.reset(); + this.getItemList(); this.open = true; this.title = "添加巡检计划"; }, @@ -1130,6 +1176,7 @@ export default { handleUpdate(row) { this.operateType = "update"; this.reset(); + this.getItemList(); const id = row.id || this.ids; getPlan(id).then((response) => { this.form = response.data; @@ -1148,6 +1195,7 @@ export default { handleView(row) { this.operateType = "view"; this.reset(); + this.getItemList(); const id = row.id || this.ids; getPlan(id).then((response) => { this.form = response.data; @@ -1283,6 +1331,7 @@ export default { .el-input-number, .el-date-editor, .el-cascader, +.el-cascader, .el-select { width: 100%; } diff --git a/zfipc-ui/src/views/patrol/task/index.vue b/zfipc-ui/src/views/patrol/task/index.vue index ff39ab8..214eaf1 100644 --- a/zfipc-ui/src/views/patrol/task/index.vue +++ b/zfipc-ui/src/views/patrol/task/index.vue @@ -405,9 +405,185 @@ + 点检项目 + + + + + + + {{dict.label}} + + + + + + + + + + + + + + + + + + + + + + + + + + + 巡检报告 = item.minValue && + item.actualValue <= item.maxValue + ) { + item.isAbnormal = 0; + } else { + item.isAbnormal = 1; + } + } + break; + case 3: + break; + default: + break; + } + }, + getItemList(taskId) { + listTaskItem({ taskId: taskId }).then((response) => { + this.itemForm.itemList = response.data; + }); + }, /** 查询部门下拉树结构 */ getDeptTree() { deptTreeSelect().then((response) => { @@ -778,6 +998,7 @@ export default { // 打开报告弹窗 handleReprot(row) { this.resetReport(); + this.getItemList(row.id); this.reportForm.taskId = row.id; this.openReport = true; this.titleReport = "提交巡检报告"; @@ -787,6 +1008,7 @@ export default { // 查看报告 handleReprotView(row) { this.resetReport(); + this.getItemList(row.id); this.isView = true; getTaskReport(row.id).then((response) => { this.reportForm = response.data; @@ -812,12 +1034,28 @@ export default { }, // 提交报告 submitFormReport() { - this.$refs["reportForm"].validate((valid) => { - if (valid) { - addTaskReport(this.reportForm).then((response) => { - this.$modal.msgSuccess("提交成功"); - this.openReport = false; - this.getList(); + this.$refs["itemForm"].validate((validItems) => { + if (validItems) { + this.itemForm.itemList.forEach((item) => { + this.itemChange(item); + }); + this.$refs["reportForm"].validate((valid) => { + if (valid) { + this.reportForm.itemList = this.itemForm.itemList; + const count = this.reportForm.itemList.filter( + (item) => item.isAbnormal == 1 + ).length; + if (count > 0) { + this.reportForm.reportResult = "存在异常,异常项个数:" + count; + } else { + this.reportForm.reportResult = "巡检正常,无异常"; + } + addTaskReport(this.reportForm).then((response) => { + this.$modal.msgSuccess("提交成功"); + this.openReport = false; + this.getList(); + }); + } }); } }); @@ -842,4 +1080,7 @@ export default { .el-table .font-color-red { color: red !important; } +.color-red { + color: red; +} \ No newline at end of file