update 质量检测基础数据

This commit is contained in:
g7hoo 2022-08-11 16:52:37 +08:00
parent 3f2e8e8b9e
commit b3aba50b09
2 changed files with 54 additions and 5 deletions

View File

@ -52,18 +52,32 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
// import AddOrUpdate from './qualityInspectionDet-add-or-update' // import AddOrUpdate from './qualityInspectionDet-add-or-update'
import BaseTable from '@/components/base-table' import BaseTable from '@/components/base-table'
import TableOperateComponent from '@/components/base-table/components/operationComponent' 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 = [ const tableConfigs = [
{ prop: 'createTime', name: '添加时间' }, { prop: 'createTime', name: '添加时间' },
{ prop: 'typeId', name: '检测类型id' }, { prop: 'typeName', name: '检测类型' },
{ prop: 'content', name: '检测内容' }, { prop: 'content', name: '检测内容' },
{ prop: 'code', name: '检测编码' }, { prop: 'code', name: '检测编码' },
{ prop: 'remark', name: '备注' }, { prop: 'remark', name: '备注' },
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } { 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 { export default {
data() { data() {
@ -87,9 +101,31 @@ export default {
BaseTable BaseTable
}, },
activated() { activated() {
this.getInspectionTypeList()
this.getDataList() this.getDataList()
}, },
methods: { 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() { getDataList() {
this.addOrUpdateVisible = false this.addOrUpdateVisible = false

View File

@ -51,7 +51,7 @@ import AddOrUpdate from '@/components/base-dialog/addOrUpdate'
// import AddOrUpdate from './qualityInspectionType-add-or-update' // import AddOrUpdate from './qualityInspectionType-add-or-update'
import BaseTable from '@/components/base-table' import BaseTable from '@/components/base-table'
import TableOperateComponent from '@/components/base-table/components/operationComponent' 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 = [ const tableConfigs = [
{ prop: 'createTime', name: '添加时间' }, { prop: 'createTime', name: '添加时间' },
@ -61,7 +61,20 @@ const tableConfigs = [
{ prop: 'operations', name: '操作', fixed: 'right', width: 180, subcomponent: TableOperateComponent, options: ['edit', 'delete'] } { 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 { export default {
data() { data() {