This commit is contained in:
mkm 2023-08-17 17:17:56 +08:00
parent 86d0fd06ca
commit 3d424426af

View File

@ -990,21 +990,42 @@ const getAreaList = async () => {
const getStreetList = async () => {
const data = await apiStreetList({ street: formData.area })
if (formData.company_type == 16) {
ResponsibleArea('area', formData.area)
const f = await companyResponsibleArea({
key: 'area',
value: formData.area
})
data.forEach((item: any) => {
if (f.find((t: any) => item.street_code == t + '')) item.disabled = true
else item.disabled = false
})
}
datas['streetOptions'] = data
}
const getVillageList = async () => {
const data = await apiVillageList({ village: formData.street })
if (formData.company_type == 17) {
ResponsibleArea('street', formData.street)
const f = await companyResponsibleArea({
key: 'street',
value: formData.street
})
data.forEach((item: any) => {
if (f.find((t: any) => item.village_code == t + '')) item.disabled = true
else item.disabled = false
})
}
datas['villageOptions'] = data
}
const getBrigadeList = async () => {
const data = await apiBrigadeList()
if (formData.company_type == 18) {
ResponsibleArea('village', formData.village)
const f = await companyResponsibleArea({
key: 'village',
value: formData.village
})
data.forEach((item: any) => {
if (f.find((t: any) => item.id == t + '')) item.disabled = true
else item.disabled = false
})
}
// //
@ -1012,17 +1033,6 @@ const getBrigadeList = async () => {
datas['brigadeOptions'] = data
}
getProvinceList()
const ResponsibleArea = async (key: any, value: any) => {
const f = await companyResponsibleArea({
key: key,
value: value
})
f.forEach((item: any) => {
if (f.find((t: any) => item.id == t + '')) item.disabled = true
else item.disabled = false
})
}
const getcontract_type = async () => {
const data = await dictDataLists({ type_id: 7 })
datas['contract_type'] = data['lists']