Browse Source

选定集改造补充

master_hella_20240701
ljlong_2630 7 months ago
parent
commit
526d5d7882
  1. 3
      src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts
  2. 25
      src/views/qms/basicDataManage/selectedSet/index.vue

3
src/views/qms/basicDataManage/selectedProject/selectedProject.data.ts

@ -10,6 +10,7 @@ export const SelectedProjectRules = reactive({
// dictionaryTypeAndCode: [required], // dictionaryTypeAndCode: [required],
estimateCode: [required], estimateCode: [required],
defectLevel: [required], defectLevel: [required],
dictionaryValue: [required]
}) })
export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
@ -28,7 +29,7 @@ export const SelectedProject = useCrudSchemas(reactive<CrudSchema[]>([
} }
}, },
{ {
label: '选定集', label: '字典项',
field: 'dictionaryValue', field: 'dictionaryValue',
sort: 'custom', sort: 'custom',
isSearch: true, isSearch: true,

25
src/views/qms/basicDataManage/selectedSet/index.vue

@ -108,6 +108,7 @@ const tableData = ref([])
const routeName = ref() const routeName = ref()
const selectDictType = ref() const selectDictType = ref()
const optionsList = ref() const optionsList = ref()
const existValue = ref([])
routeName.value = route.name routeName.value = route.name
const tableColumns = ref(SelectedSet.allSchemas.tableColumns) const tableColumns = ref(SelectedSet.allSchemas.tableColumns)
@ -377,16 +378,37 @@ const validateNotRepetition = (data) => {
}; };
const detailValidate = (data) => { const detailValidate = (formType,data) => {
let tag = true; let tag = true;
existValue.value.forEach(item=>{
if(data.dictionaryValue == item.dictionaryValue){
message.warning("选定集字典项不能重复!")
tag = false;
}
})
return tag return tag
} }
const detailOpenForm = (type, row, masterParmas) => { const detailOpenForm = (type, row, masterParmas) => {
let param = {
masterId : masterParmas.masterId
}
if(type == 'create'){ if(type == 'create'){
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
if(res.length > 0){
existValue.value = res
}
})
}else if('update'){ }else if('update'){
SelectedProjectApi.getSelectedProjectNoPage(param).then(res => {
if(res.length > 0){
existValue.value = res.filter(item=>{
return item?.id != row.id
})
} }
})
}
} }
@ -396,6 +418,7 @@ const detailBasiFormOnChange = (field,val,detailFormRef) => {
} }
const formSelectChange = (a,b,c,d) => { const formSelectChange = (a,b,c,d) => {
} }
/** 初始化 **/ /** 初始化 **/

Loading…
Cancel
Save