diff --git a/admin/src/views/product/edit.vue b/admin/src/views/product/edit.vue index e62bd921..f368682a 100644 --- a/admin/src/views/product/edit.vue +++ b/admin/src/views/product/edit.vue @@ -23,7 +23,7 @@ filterable placeholder="请输入用户信息" :remote-method="queryUser" - @blur="selectedUser" + @change="selectedUser" :loading="loading" > { const selectedUser = (value: any) => { optionsData.land = [] formData.land_id = '' + queryLand(value) } const queryLand = async (user_id: string) => { @@ -167,10 +167,6 @@ const queryLand = async (user_id: string) => { loading.value = false } -const selectedLand = () => { - queryLand(formData.user_id) -} - // 提交按钮 const handleSubmit = async () => { await formRef.value?.validate() @@ -192,11 +188,14 @@ const generateUuid = () => { const open = (type = 'add') => { mode.value = type popupRef.value?.open() - formData.code = generateUuid() + formData.code = generateUuid() getUserInfo() .then((res: any) => { const root = res.user.root ?? 0 formData.root = root + if (type == 'edit') { + queryLand(formData.user_id) + } }) .catch((err: any) => { console.log('err', err)