diff --git a/components.d.ts b/components.d.ts index 6627051..443565a 100644 --- a/components.d.ts +++ b/components.d.ts @@ -10,6 +10,7 @@ declare module 'vue' { Breadcrumb: typeof import('./src/components/Breadcrumb/index.vue')['default'] ElButton: typeof import('element-plus/es')['ElButton'] ElCascader: typeof import('element-plus/es')['ElCascader'] + ElCheckbox: typeof import('element-plus/es')['ElCheckbox'] ElCol: typeof import('element-plus/es')['ElCol'] ElDatePicker: typeof import('element-plus/es')['ElDatePicker'] ElDialog: typeof import('element-plus/es')['ElDialog'] diff --git a/src/http/api/home/index.ts b/src/http/api/home/index.ts index 43d494b..a503c51 100644 --- a/src/http/api/home/index.ts +++ b/src/http/api/home/index.ts @@ -18,8 +18,8 @@ export const getBookCarDetailsApi = (data: any = {}) => { export const getLeaseInfoByIdApi = (data: any = {}) => { return get('/material-mall/ma-lease/getById', data) } -export const getAreaApi = (data: any = {}) => { - return get('/material-mall/maType/getArea', data) +export const getAreaApi = (areaCode: any) => { + return get(`/material-mall/maType/getArea?areaCode=${areaCode}`,) } // 立即接单 export const setAcceptByIdApi = (data: any = {}) => { diff --git a/src/views/user/sourcingNeed/index.vue b/src/views/user/sourcingNeed/index.vue index 53780a0..3912c4f 100644 --- a/src/views/user/sourcingNeed/index.vue +++ b/src/views/user/sourcingNeed/index.vue @@ -249,10 +249,11 @@ style="width: 95%" placeholder="请选择项目所在省" v-model="addOrEditForm.areaId" + @change="onProvinceChange($event)" > @@ -265,13 +266,14 @@ clearable style="width: 95%" placeholder="请选择项目所在市" - v-model="addOrEditForm.areaId" + v-model="addOrEditForm.areaId2" + @change="onCityChange($event)" > @@ -282,13 +284,14 @@ clearable style="width: 95%" placeholder="请选择项所在县" - v-model="addOrEditForm.areaId" + v-model="addOrEditForm.areaId1" + @change="onCountyChange($event)" > @@ -299,7 +302,7 @@ style="width: 100%" clearable placeholder="请输入详细地址" - v-model="addOrEditForm.areaId" + v-model="addOrEditForm.areaId3" /> @@ -608,6 +611,9 @@ const addOrEditFormRef = ref(null) const addOrEditDialogVisible = ref(false) const addOrEditDemandFormList = ref([]) const addOrEditDemandFormRefList = ref([]) +const areaProvinceList = ref([]) +const areaCityList = ref([]) +const areaCountyList = ref([]) const uploadUrl = import.meta.env.VITE_API_URL + '/file/upload' const searchParams = reactive({ @@ -705,7 +711,7 @@ const getLeaseListData = async () => { } const getAreaData = async () => { - const res: any = await getAreaApi() + const res: any = await getAreaApi(0) areaList.value = res.data } @@ -874,6 +880,16 @@ const onDeleteDemand = (index: any) => { }) } +const onProvinceChange = async (id: any) => { + const res: any = await getAreaApi(id) + areaCityList.value = res.data +} +const onCityChange = async (id: any) => { + const res: any = await getAreaApi(id) + areaCountyList.value = res.data +} +const onCountyChange = async (id: any) => {} + onMounted(() => { getClassAndCompanyData() getLeaseListData()