From 1430e4abdac94e88aa339b279b68ab265df21eb0 Mon Sep 17 00:00:00 2001 From: zhouhy Date: Wed, 18 Oct 2023 09:02:14 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E9=A1=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=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]: '' From 6ee62274178ac2f2ab341ba61e3d0ab0c6e427a5 Mon Sep 17 00:00:00 2001 From: zhouhy Date: Thu, 19 Oct 2023 15:25:14 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E8=B4=A8=E6=A3=80=E9=A1=B9=E4=BF=A1?= =?UTF-8?q?=E6=81=AF=E7=BB=B4=E6=8A=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/qualityInspectionItem/childIndex.vue | 11 +++++----- src/views/base/workUnit/index.vue | 22 +++++++++++++++++-- 2 files changed, 25 insertions(+), 8 deletions(-) diff --git a/src/views/base/qualityInspectionItem/childIndex.vue b/src/views/base/qualityInspectionItem/childIndex.vue index d8331bf..bc2cfbd 100644 --- a/src/views/base/qualityInspectionItem/childIndex.vue +++ b/src/views/base/qualityInspectionItem/childIndex.vue @@ -141,16 +141,15 @@ - + - + - + - - - + + - - + + + + + { + console.log(response.rows) + this.ProductLineCode = response.rows; + }) + }, /** 查询统计单元信息列表 */ getList() { this.loading = true; From bc54f5be2e1d5ab26cbdc254cd390ce43fbd1140 Mon Sep 17 00:00:00 2001 From: zhouhy Date: Fri, 20 Oct 2023 08:44:05 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E7=BB=9F=E8=AE=A1=E5=8D=95=E5=85=83?= =?UTF-8?q?=E4=BF=A1=E6=81=AF=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../base/qualityInspectionItem/index.vue | 14 +++++-------- src/views/base/workUnit/index.vue | 21 +++++++++---------- 2 files changed, 15 insertions(+), 20 deletions(-) diff --git a/src/views/base/qualityInspectionItem/index.vue b/src/views/base/qualityInspectionItem/index.vue index f160440..7cab936 100644 --- a/src/views/base/qualityInspectionItem/index.vue +++ b/src/views/base/qualityInspectionItem/index.vue @@ -181,7 +181,7 @@ {{dict.label}} @@ -190,7 +190,7 @@ {{dict.label}} @@ -309,11 +309,11 @@ export default { qualityDefectCode: null, qualityDefectName: null, parentId: null, - materialCategories: null, - materialSubclass: null, + materialCategories: 0, + materialSubclass: 0, plantCode: null, remark: null, - isFlag: null, + isFlag: 0, createdBy: null, createdTime: null, updatedBy: null, @@ -340,10 +340,6 @@ export default { /** 新增按钮操作 */ handleAdd() { this.reset(); - this.form.parentId = 0; - this.form.materialCategories = 0; - this.form.materialSubclass = 0; - this.form.isFlag = 0; this.open = true; this.title = "添加质检项信息维护"; }, diff --git a/src/views/base/workUnit/index.vue b/src/views/base/workUnit/index.vue index da1d11e..99915f4 100644 --- a/src/views/base/workUnit/index.vue +++ b/src/views/base/workUnit/index.vue @@ -72,11 +72,11 @@ :tree-props="{children: 'children', hasChildren: 'hasChildren'}" > - + - +