|
@ -50,7 +50,7 @@ |
|
|
:apiUpdate="SelectedSetApi.updateSelectedSet" |
|
|
:apiUpdate="SelectedSetApi.updateSelectedSet" |
|
|
:apiCreate="SelectedSetApi.createSelectedSet" |
|
|
:apiCreate="SelectedSetApi.createSelectedSet" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
@searchTableSuccess="searchTableSuccess" |
|
|
:isBusiness="false" |
|
|
:isBusiness="true" |
|
|
@onChange="onChange" |
|
|
@onChange="onChange" |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleAddTable="handleAddTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
|
@handleDeleteTable="handleDeleteTable" |
|
@ -92,6 +92,7 @@ import { SelectedProject,SelectedProjectRules } from '../selectedProject/selecte |
|
|
import * as SelectedProjectApi from '@/api/qms/selectedProject' |
|
|
import * as SelectedProjectApi from '@/api/qms/selectedProject' |
|
|
import * as DictDataApi from '@/api/system/dict/dict.data' |
|
|
import * as DictDataApi from '@/api/system/dict/dict.data' |
|
|
import component from 'virtual:svg-icons-register' |
|
|
import component from 'virtual:svg-icons-register' |
|
|
|
|
|
import * as DictTypeApi from '@/api/system/dict/dict.type' |
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
// import TableHead from '@/components/TableHead/src/TableHead.vue' |
|
|
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
// import ImportForm from '@/components/ImportForm/src/ImportForm.vue' |
|
|
// import Detail from '@/components/Detail/src/Detail.vue' |
|
|
// import Detail from '@/components/Detail/src/Detail.vue' |
|
@ -105,9 +106,11 @@ const route = useRoute() // 路由信息 |
|
|
const tableData = ref([]) |
|
|
const tableData = ref([]) |
|
|
const routeName = ref() |
|
|
const routeName = ref() |
|
|
const selectDictType = ref() |
|
|
const selectDictType = ref() |
|
|
|
|
|
const optionsList = ref() |
|
|
routeName.value = route.name |
|
|
routeName.value = route.name |
|
|
const tableColumns = ref(SelectedSet.allSchemas.tableColumns) |
|
|
const tableColumns = ref(SelectedSet.allSchemas.tableColumns) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 查询页面返回 |
|
|
// 查询页面返回 |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
const searchTableSuccess = (formField, searchField, val, formRef) => { |
|
|
nextTick(() => { |
|
|
nextTick(() => { |
|
@ -287,7 +290,21 @@ const handleDeleteTable = (item, index) => { |
|
|
|
|
|
|
|
|
// 主子数据 提交 |
|
|
// 主子数据 提交 |
|
|
const submitForm = async (formType, data) => { |
|
|
const submitForm = async (formType, data) => { |
|
|
|
|
|
|
|
|
data.selectedProjectDOList = tableData.value// 拼接子表数据参数 |
|
|
data.selectedProjectDOList = tableData.value// 拼接子表数据参数 |
|
|
|
|
|
data.selectedProjectDOList = data.selectedProjectDOList.map(item => { |
|
|
|
|
|
// 按照 '-%%%-'' 拆分 dictionaryCode |
|
|
|
|
|
const [dictionaryCode, dictionaryValue] = item.dictionaryTypeAndCode.split('-%%%-'); |
|
|
|
|
|
const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === item.dictionaryTypeAndCode)) |
|
|
|
|
|
const dictionaryLabel = dictionary?.options.find(option => option.value === item.dictionaryTypeAndCode)?.label |
|
|
|
|
|
// 返回一个新对象,包含拆分后的 dictionaryCode 和 dictionaryValue,以及原始项中的其他属性 |
|
|
|
|
|
return { |
|
|
|
|
|
...item, |
|
|
|
|
|
dictionaryCode, |
|
|
|
|
|
dictionaryValue, |
|
|
|
|
|
dictionaryLabel |
|
|
|
|
|
}; |
|
|
|
|
|
}); |
|
|
console.log(data.subList) |
|
|
console.log(data.subList) |
|
|
try { |
|
|
try { |
|
|
if (formType === 'create') { |
|
|
if (formType === 'create') { |
|
@ -321,19 +338,20 @@ const detailOpenForm = (type, row, masterParmas) => { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const detailBasiFormOnChange = (field,val) => { |
|
|
const detailBasiFormOnChange = (field,val,detailFormRef) => { |
|
|
console.log(field) |
|
|
console.log(field) |
|
|
console.log(val) |
|
|
console.log(33,detailFormRef) |
|
|
if(field == 'dictionaryCode'){ |
|
|
if(field == 'dictionaryTypeAndCode'){ |
|
|
DictDataApi.queryByDictType(val).then(res => { |
|
|
// 按照 '-%%%-'' 拆分 dictionaryCode |
|
|
SelectedProject.allSchemas.formSchema.find(item => { |
|
|
const [dictionaryCode, dictionaryValue] = val.split('-%%%-'); |
|
|
return item.field == 'dictionaryValue' |
|
|
const dictionary = optionsList.value.find(temp => temp.options.some(option => option.value === val)) |
|
|
}).componentProps.options = res.map(item=>{ |
|
|
const dictionaryLabel = dictionary?.options.find(option => option.value === val)?.label |
|
|
return { |
|
|
const setV = {} |
|
|
value: item.value, |
|
|
setV['dictionaryLabel'] = dictionaryLabel |
|
|
label: item.label |
|
|
setV['dictionaryCode'] = dictionaryCode |
|
|
} |
|
|
setV['dictionaryValue'] = dictionaryValue |
|
|
}) |
|
|
nextTick(() => { |
|
|
|
|
|
detailFormRef.setValues(setV) |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
@ -342,9 +360,24 @@ const formSelectChange = (a,b,c,d) => { |
|
|
console.log(111) |
|
|
console.log(111) |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const getDicDetails = ()=>{ |
|
|
|
|
|
DictTypeApi.getDictTypeAndData('inspection').then(res=>{ |
|
|
|
|
|
res.forEach(element => { |
|
|
|
|
|
element.options = element.dictDataRespVOList.map(item => { |
|
|
|
|
|
return { |
|
|
|
|
|
value: element.type + "-%%%-" + item.value, |
|
|
|
|
|
label: element.name + "-" + item.label |
|
|
|
|
|
} |
|
|
|
|
|
}) |
|
|
|
|
|
}) |
|
|
|
|
|
optionsList.value = res |
|
|
|
|
|
}) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
/** 初始化 **/ |
|
|
/** 初始化 **/ |
|
|
onMounted(async () => { |
|
|
onMounted(async () => { |
|
|
getList() |
|
|
getList() |
|
|
|
|
|
getDicDetails() |
|
|
importTemplateData.templateUrl = await SelectedSetApi.importTemplate() |
|
|
importTemplateData.templateUrl = await SelectedSetApi.importTemplate() |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|