forked from mt-fe-group/mt-yd-ui
update 质量检测基础数据
This commit is contained in:
parent
3f2e8e8b9e
commit
b3aba50b09
@ -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
|
||||||
|
@ -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() {
|
||||||
|
Loading…
Reference in New Issue
Block a user