feat: 取客户最大sn
This commit is contained in:
@@ -63,4 +63,9 @@ async function isCustomerNameExists(
|
||||
});
|
||||
}
|
||||
|
||||
export { isCustomerNameExists };
|
||||
/** 查询当前最大sn */
|
||||
async function getMaxSn() {
|
||||
return requestClient.get<boolean>('/license/customer/max-sn');
|
||||
}
|
||||
|
||||
export { getMaxSn, isCustomerNameExists };
|
||||
|
||||
@@ -11,6 +11,7 @@ import { useVbenForm } from '#/adapter/form';
|
||||
import {
|
||||
createCustomer,
|
||||
getCustomer,
|
||||
getMaxSn,
|
||||
updateCustomer,
|
||||
} from '#/api/license/customer';
|
||||
import { $t } from '#/locales';
|
||||
@@ -78,9 +79,16 @@ const [Modal, modalApi] = useVbenModal({
|
||||
modalApi.unlock();
|
||||
}
|
||||
}
|
||||
|
||||
// 设置到 values
|
||||
formData.value = data;
|
||||
await formApi.setValues(formData.value);
|
||||
|
||||
// 设置最大SN
|
||||
const maxSn = await getMaxSn();
|
||||
if (!formData.value?.code) {
|
||||
formApi.setFieldValue('code', maxSn);
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user