From 1430e4abdac94e88aa339b279b68ab265df21eb0 Mon Sep 17 00:00:00 2001 From: zhouhy Date: Wed, 18 Oct 2023 09:02:14 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E9=A1=B9=E4=BF=A1=E6=81=AF?= =?UTF-8?q?=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/qualityInspectionItem.js | 51 +++ src/router/index.js | 14 + src/views/base/monitorWorkUnit/index.vue | 73 +++- .../base/qualityInspectionItem/childIndex.vue | 372 ++++++++++++++++ .../base/qualityInspectionItem/index.vue | 399 ++++++++++++++++++ vue.config.js | 4 +- 6 files changed, 899 insertions(+), 14 deletions(-) create mode 100644 src/api/base/qualityInspectionItem.js create mode 100644 src/views/base/qualityInspectionItem/childIndex.vue create mode 100644 src/views/base/qualityInspectionItem/index.vue diff --git a/src/api/base/qualityInspectionItem.js b/src/api/base/qualityInspectionItem.js new file mode 100644 index 0000000..b6287b2 --- /dev/null +++ b/src/api/base/qualityInspectionItem.js @@ -0,0 +1,51 @@ +import request from '@/utils/request' + +// 查询质检项信息维护列表 +export function listQualityInspectionItem(query) { + return request({ + url: '/base/qualityInspectionItem/list', + method: 'get', + params: query + }) +} + +// 查询质检项信息维护详细 +export function getQualityInspectionItem(objId) { + return request({ + url: '/base/qualityInspectionItem/' + objId, + method: 'get' + }) +} + +// 新增质检项信息维护 +export function addQualityInspectionItem(data) { + return request({ + url: '/base/qualityInspectionItem', + method: 'post', + data: data + }) +} + +// 修改质检项信息维护 +export function updateQualityInspectionItem(data) { + return request({ + url: '/base/qualityInspectionItem', + method: 'put', + data: data + }) +} + +// 删除质检项信息维护 +export function delQualityInspectionItem(objId) { + return request({ + url: '/base/qualityInspectionItem/' + objId, + method: 'delete' + }) +} +//查询所有的父级 +export function getQualityInspectionItemParent(){ + return request({ + url:'/base/qualityInspectionItem/getParent', + method :'get' + }) +} diff --git a/src/router/index.js b/src/router/index.js index 8a907a2..c3396df 100644 --- a/src/router/index.js +++ b/src/router/index.js @@ -190,6 +190,20 @@ export const dynamicRoutes = [ }, ], }, + { + path: "/base/qualityInspectionItemChild", + component: Layout, + hidden: true, + permissions: ["base:qualityInspectionItem:list"], + children: [ + { + path:"index/:parentId(\\d+)", + component:() => import("@/views/base/qualityInspectionItem/childIndex"), + name:"childQuality", + meta: {title: "质检项缺陷信息",activeMenu: "/base/qualityInspectionItem"}, + }, + ], + }, ] // 防止连续点击多次路由报错 diff --git a/src/views/base/monitorWorkUnit/index.vue b/src/views/base/monitorWorkUnit/index.vue index 9fa6fb1..41ae96d 100644 --- a/src/views/base/monitorWorkUnit/index.vue +++ b/src/views/base/monitorWorkUnit/index.vue @@ -183,12 +183,18 @@ - - + + - + + + + + + + import { listMonitorWorkUnit, getMonitorWorkUnit, delMonitorWorkUnit, addMonitorWorkUnit, updateMonitorWorkUnit } from "@/api/base/monitorWorkUnit"; import {getWorkUnitTrees} from '@/api/base/workUnit' +import { listMonitorInfo } from '@/api/base/monitorInfo' +import Treeselect from "@riophae/vue-treeselect"; +import "@riophae/vue-treeselect/dist/vue-treeselect.css"; export default { name: "MonitorWorkUnit", dicts: ['monitor_type', 'formula_mode', 'is_flag'], - data() { + components: { + Treeselect + },data() { return { - workUnitOptions:undefined, + monitorInfoOptions:[], + workUnitOptions:[], workUnitName:undefined, // 遮罩层 loading: true, @@ -320,6 +332,7 @@ export default { }, created() { this.getList(); + this.getTreeselect(); this.getDeptTrees(); }, watch: { @@ -330,10 +343,43 @@ export default { } }, methods: { + /** 查询计量设备信息下拉树结构 */ + getTreeselect() { + listMonitorInfo().then(response => { + this.monitorInfoOptions = []; + const data = { objId: 0, monitorName: '顶级节点', children: [] }; + data.children = this.handleTree(response.data, "objId", "parentId"); + this.monitorInfoOptions.push(data); + }); + }, + /** 转换计量设备信息数据结构 */ + normalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id: node.objId, + label: node.monitorName, + children: node.children + }; + }, + /** 转换统计单元信息数据结构 */ + workUnitOptionsNormalizer(node) { + if (node.children && !node.children.length) { + delete node.children; + } + return { + id2: node.workUnitCode, + label2: node.workUnitName, + // workUnitCode:node.workUnitCode, + children2: node.children + }; + }, /** 查询计量设备下拉树结构 */ getDeptTrees() { getWorkUnitTrees().then(response => { this.workUnitOptions = response.data; + console.log(this.workUnitOptions) }); }, // 筛选节点 @@ -343,8 +389,7 @@ export default { }, // 节点单击事件 handleNodeClick(data) { - console.log(data.code) - this.queryParams.monitorCode = data.code; + this.queryParams.workUnitCode = data.code; this.handleQuery(); }, /** 查询统计计量信息列表 */ @@ -364,15 +409,17 @@ export default { // 表单重置 reset() { this.form = { + parentIds:null, + parentId: null, objId: null, monitorCode: null, workUnitCode: null, - monitorStatus: null, - monitorType: null, - formulaMode: null, + monitorStatus: 0, + monitorType: 1, + formulaMode: 0, proportion: null, remark: null, - isFlag: null, + isFlag: 0, createdBy: null, createdTime: null, updatedBy: null, @@ -388,7 +435,7 @@ export default { /** 重置按钮操作 */ resetQuery() { this.resetForm("queryForm"); - this.queryParams.monitorCode = null; + this.queryParams.workUnitCode = null; this.handleQuery(); }, // 多选框选中数据 @@ -400,6 +447,7 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); + this.getTreeselect(); this.open = true; this.title = "添加统计计量信息"; }, @@ -416,6 +464,7 @@ export default { /** 提交按钮 */ submitForm() { this.$refs["form"].validate(valid => { + console.log(this.form.monitorCode) if (valid) { if (this.form.objId != null) { updateMonitorWorkUnit(this.form).then(response => { diff --git a/src/views/base/qualityInspectionItem/childIndex.vue b/src/views/base/qualityInspectionItem/childIndex.vue new file mode 100644 index 0000000..d8331bf --- /dev/null +++ b/src/views/base/qualityInspectionItem/childIndex.vue @@ -0,0 +1,372 @@ + + + diff --git a/src/views/base/qualityInspectionItem/index.vue b/src/views/base/qualityInspectionItem/index.vue new file mode 100644 index 0000000..f160440 --- /dev/null +++ b/src/views/base/qualityInspectionItem/index.vue @@ -0,0 +1,399 @@ + + + diff --git a/vue.config.js b/vue.config.js index afe0349..ab99287 100644 --- a/vue.config.js +++ b/vue.config.js @@ -35,8 +35,8 @@ module.exports = { proxy: { // detail: https://cli.vuejs.org/config/#devserver-proxy [process.env.VUE_APP_BASE_API]: { - target: `http://10.11.43.2:8080`, - // target: `http://localhost:8080`, + // target: `http://10.11.43.2:8080`, + target: `http://localhost:8080`, changeOrigin: true, pathRewrite: { ['^' + process.env.VUE_APP_BASE_API]: ''