dianlixunjian
徐景良 2024-09-14 17:36:41 +08:00
parent ff3f4dcfe4
commit ef1b3d879a
1 changed files with 19 additions and 19 deletions

View File

@ -36,14 +36,14 @@
@change="handleStreetChange"
/>
</a-form-item>
<!-- <a-form-item label="村/社区" name="communityid">
<a-form-item label="村/社区" name="communityid">
<a-select
v-model:value="formState.communityid"
:options="data.communityOptions"
:field-names="{ label: 'name', value: 'id' }"
@change="handleCommunityChange"
/>
</a-form-item> -->
</a-form-item>
</a-form>
</a-modal>
@ -84,14 +84,14 @@
@change="handleStreetChange"
/>
</a-form-item>
<!-- <a-form-item label="村/社区" name="communityid">
<a-form-item label="村/社区" name="communityid">
<a-select
v-model:value="formState.communityid"
:options="data.communityOptions"
:field-names="{ label: 'name', value: 'id' }"
@change="handleCommunityChange"
/>
</a-form-item> -->
</a-form-item>
</a-form>
</a-modal>
</div>
@ -123,12 +123,12 @@
const rules = ref({
countyid: [{ required: true, message: '县区不能为空', trigger: 'blur' }],
streetid: [{ required: true, message: '乡镇不能为空', trigger: 'blur' }],
// communityid: [{ required: true, message: '/', trigger: 'blur' }],
communityid: [{ required: true, message: '村/社区不能为空', trigger: 'blur' }],
});
const data = reactive({
countyOptions: [],
streetOptions: [],
// communityOptions: [],
communityOptions: [],
});
watch(
@ -157,19 +157,19 @@
data.streetOptions = res;
});
formState.value.streetid = '';
// formState.value.communityid = '';
formState.value.communityid = '';
}
async function handleStreetChange(value, option) {
formState.value.streetid = value;
formState.value.streetname = option.name;
// getOptions(value).then((res) => {
// data.communityOptions = res;
// });
getOptions(value).then((res) => {
data.communityOptions = res;
});
}
async function handleCommunityChange(value, option) {
formState.value.communityid = value;
formState.value.communityname = option.name;
}
// async function handleCommunityChange(value, option) {
// formState.value.communityid = value;
// formState.value.communityname = option.name;
// }
async function getOptions(value) {
const data = await getChildrenTree({
parentId: value,
@ -192,9 +192,9 @@
data.streetOptions = res;
});
// /
// getOptions(formState.value.streetid).then((res) => {
// data.communityOptions = res;
// });
getOptions(formState.value.streetid).then((res) => {
data.communityOptions = res;
});
}
function handlerCloseModal() {
@ -211,8 +211,8 @@
countyname: formState.value.countyname,
streetid: formState.value.streetid,
streetname: formState.value.streetname,
// communityid: formState.value.communityid,
// communityname: formState.value.communityname,
communityid: formState.value.communityid,
communityname: formState.value.communityname,
};
console.log(querys);
const data = await UpdateDroneCaseInfo(querys);