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 {
|
import {
|
||||||
createCustomer,
|
createCustomer,
|
||||||
getCustomer,
|
getCustomer,
|
||||||
|
getMaxSn,
|
||||||
updateCustomer,
|
updateCustomer,
|
||||||
} from '#/api/license/customer';
|
} from '#/api/license/customer';
|
||||||
import { $t } from '#/locales';
|
import { $t } from '#/locales';
|
||||||
@@ -78,9 +79,16 @@ const [Modal, modalApi] = useVbenModal({
|
|||||||
modalApi.unlock();
|
modalApi.unlock();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 设置到 values
|
// 设置到 values
|
||||||
formData.value = data;
|
formData.value = data;
|
||||||
await formApi.setValues(formData.value);
|
await formApi.setValues(formData.value);
|
||||||
|
|
||||||
|
// 设置最大SN
|
||||||
|
const maxSn = await getMaxSn();
|
||||||
|
if (!formData.value?.code) {
|
||||||
|
formApi.setFieldValue('code', maxSn);
|
||||||
|
}
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
Reference in New Issue
Block a user