更新细节

This commit is contained in:
yaooo 2023-12-06 11:19:30 +08:00
parent bed415a1e5
commit ffef7fc1db
1 changed files with 6 additions and 7 deletions

View File

@ -23,7 +23,7 @@
filterable filterable
placeholder="请输入用户信息" placeholder="请输入用户信息"
:remote-method="queryUser" :remote-method="queryUser"
@blur="selectedUser" @change="selectedUser"
:loading="loading" :loading="loading"
> >
<el-option <el-option
@ -42,7 +42,6 @@
filterable filterable
placeholder="请输入土地信息" placeholder="请输入土地信息"
:remote-method="queryLand" :remote-method="queryLand"
@focus="selectedLand"
:loading="loading" :loading="loading"
> >
<el-option <el-option
@ -155,6 +154,7 @@ const queryUser = async (query: string) => {
const selectedUser = (value: any) => { const selectedUser = (value: any) => {
optionsData.land = [] optionsData.land = []
formData.land_id = '' formData.land_id = ''
queryLand(value)
} }
const queryLand = async (user_id: string) => { const queryLand = async (user_id: string) => {
@ -167,10 +167,6 @@ const queryLand = async (user_id: string) => {
loading.value = false loading.value = false
} }
const selectedLand = () => {
queryLand(formData.user_id)
}
// //
const handleSubmit = async () => { const handleSubmit = async () => {
await formRef.value?.validate() await formRef.value?.validate()
@ -192,11 +188,14 @@ const generateUuid = () => {
const open = (type = 'add') => { const open = (type = 'add') => {
mode.value = type mode.value = type
popupRef.value?.open() popupRef.value?.open()
formData.code = generateUuid() formData.code = generateUuid()
getUserInfo() getUserInfo()
.then((res: any) => { .then((res: any) => {
const root = res.user.root ?? 0 const root = res.user.root ?? 0
formData.root = root formData.root = root
if (type == 'edit') {
queryLand(formData.user_id)
}
}) })
.catch((err: any) => { .catch((err: any) => {
console.log('err', err) console.log('err', err)