fix : 修复征集公司回显

This commit is contained in:
2024-07-06 23:29:33 +08:00
parent ce5297145b
commit 57776764f8

View File

@@ -104,6 +104,7 @@
<el-button color="#DED0B2" v-else @click="handleResubmit">重新提交</el-button>
<el-button @click="handleBack">返回</el-button>
</div>
<company-picker :multiple="true" ref="companyRef" title="请选择征集公司" @ok="selected"
v-model:value="selectedCompanyList"/>
</div>
@@ -128,7 +129,6 @@ import {getSubCompOpt} from '@/api/user/user.js'
import {useTagsView} from '@/stores/tagsview.js'
import {getFundOption} from "@/api/special-fund";
import CompanyPicker from "@/components/DetailComponent/CompanyPicker.vue";
import {matterTree} from "@/utils/matterTree";
import {useCacheStore} from '@/stores/cache.js'
@@ -408,22 +408,30 @@ const handleResubmit = () => {
}
})
}
const matterTree = (array,data, id) => {
if (id) {
data.forEach(item => {
if (item.value == id) {
let obj={
label:item.label,
value:item.value
}
array.push(obj);
}
if (item.children && item.children.length > 0) {
matterTree(array,item.children,id)
}
})
return array;
}
}
const getCompanyOptionItem = (val) => {
let newObj = {}
let newArray = []
if (val !== undefined) {
val.forEach(item => {
matterTree(companyNameArray.value, companyOption.value, item)
})
companyNameArray.value.forEach(companyItem => {
newObj = {
label: companyItem
}
newArray.push(newObj)
})
}
return newArray;
return companyNameArray.value;
}
const getDetailInfo = async () => {
getFormInfo(route.query.id).then(res => {