From b3aba50b094bc0d9bd910fadc38df044627fc9e0 Mon Sep 17 00:00:00 2001 From: g7hoo Date: Thu, 11 Aug 2022 16:52:37 +0800 Subject: [PATCH] =?UTF-8?q?update=20=E8=B4=A8=E9=87=8F=E6=A3=80=E6=B5=8B?= =?UTF-8?q?=E5=9F=BA=E7=A1=80=E6=95=B0=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../monitoring/qualityInspectionDet.vue | 42 +++++++++++++++++-- .../monitoring/qualityInspectionType.vue | 17 +++++++- 2 files changed, 54 insertions(+), 5 deletions(-) diff --git a/src/views/modules/monitoring/qualityInspectionDet.vue b/src/views/modules/monitoring/qualityInspectionDet.vue index 5dfcfb4..b457526 100644 --- a/src/views/modules/monitoring/qualityInspectionDet.vue +++ b/src/views/modules/monitoring/qualityInspectionDet.vue @@ -52,18 +52,32 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate' // import AddOrUpdate from './qualityInspectionDet-add-or-update' import BaseTable from '@/components/base-table' import TableOperateComponent from '@/components/base-table/components/operationComponent' -import TableTextComponent from '@/components/base-table/components/detailComponent' +// import TableTextComponent from '@/components/base-table/components/detailComponent' const tableConfigs = [ { prop: 'createTime', name: '添加时间' }, - { prop: 'typeId', name: '检测类型id' }, + { prop: 'typeName', name: '检测类型' }, { prop: 'content', name: '检测内容' }, { prop: 'code', name: '检测编码' }, { prop: 'remark', name: '备注' }, { prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] -const addOrUpdateConfigs = {} +const addOrUpdateConfigs = { + type: 'dialog', + infoUrl: '/monitoring/qualityInspectionDet', + fields: [ + { name: 'typeId', label: '检测类型', type: 'select', options: [] }, + { name: 'content', label: '检测内容' }, + { name: 'code', label: '内容编码', api: '/monitoring/qualityInspectionDet/getCode' }, + 'remark' + ], + operations: [ + { name: 'cancel', showAlways: true }, + { name: 'save', url: '/monitoring/qualityInspectionDet', permission: '', showOnEdit: false }, + { name: 'update', url: '/monitoring/qualityInspectionDet', permission: '', showOnEdit: true } + ] +} export default { data() { @@ -87,9 +101,31 @@ export default { BaseTable }, activated() { + this.getInspectionTypeList() this.getDataList() }, methods: { + // 获取产检测类型列表 + getInspectionTypeList() { + this.$http({ + url: this.$http.adornUrl('/monitoring/qualityInspectionType/page'), + method: 'get', + params: this.$http.adornParams({ + limit: 999, + page: 1 + }) + }).then(({ data: res }) => { + if (res && res.code === 0) { + this.addOrUpdateConfigs.fields.forEach(item => { + if (item.name === 'typeId') item.options = res.data.list.map(item => ({ label: item.name, value: item.id })) + }) + } else { + this.addOrUpdateConfigs.fields.forEach(item => { + if (item.name === 'typeId') item.options.splice(0) + }) + } + }) + }, // 获取数据列表 getDataList() { this.addOrUpdateVisible = false diff --git a/src/views/modules/monitoring/qualityInspectionType.vue b/src/views/modules/monitoring/qualityInspectionType.vue index 7c386ae..1ee5e4f 100644 --- a/src/views/modules/monitoring/qualityInspectionType.vue +++ b/src/views/modules/monitoring/qualityInspectionType.vue @@ -51,7 +51,7 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate' // import AddOrUpdate from './qualityInspectionType-add-or-update' import BaseTable from '@/components/base-table' import TableOperateComponent from '@/components/base-table/components/operationComponent' -import TableTextComponent from '@/components/base-table/components/detailComponent' +// import TableTextComponent from '@/components/base-table/components/detailComponent' const tableConfigs = [ { prop: 'createTime', name: '添加时间' }, @@ -61,7 +61,20 @@ const tableConfigs = [ { prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } ] -const addOrUpdateConfigs = {} +const addOrUpdateConfigs = { + type: 'dialog', + infoUrl: '/monitoring/qualityInspectionType', + fields: [ + { name: 'name', label: '检测类型' }, + { name: 'code', label: '检测类型编码', api: '/monitoring/qualityInspectionType/getCode' }, + 'remark' + ], + operations: [ + { name: 'cancel', showAlways: true }, + { name: 'save', url: '/monitoring/qualityInspectionType', permission: '', showOnEdit: false }, + { name: 'update', url: '/monitoring/qualityInspectionType', permission: '', showOnEdit: true } + ] +} export default { data() {