// 片区公司关联 const associationChange = async (areaId,companyId, type) => { let list = await GetCompanyList({ areaId:areaId, companyId:companyId, status: 1, pageIndex:1, pageSize:500, }); if(list && list.data.length > 0){ if(type == 1){ companyOptions.value = []; for (let i=0;i<list.data.length;i++) { let company = { value:list.data[i].id, label:list.data[i].name, } companyOptions.value.push(company); } switch (parseInt(cateId.value)) { case 1 : qFormState.companyID = ''; break; case 2 : iFormState.companyID = ''; break; case 5 : hFormState.companyID = ''; break; case 6 : sFormState.companyID = ''; break; } }else{ console.log(list.data); switch (parseInt(cateId.value)) { case 1 : qFormState.areaID = list.data[0].areaId; break; case 2 : iFormState.areaID = list.data[0].areaId; break; case 5 : hFormState.areaID = list.data[0].areaId; break; case 6 : sFormState.areaID = list.data[0].areaId; break; } } }else{ companyOptions.value = []; switch (parseInt(cateId.value)) { case 1 : qFormState.companyID = ''; break; case 2 : iFormState.companyID = ''; break; case 5 : hFormState.companyID = ''; break; case 6 : sFormState.companyID = ''; break; } } }
标签:areaId,vue,companyId,list,片区,关联,let,type From: https://www.cnblogs.com/siyunianhua/p/16598039.html