fix(04): submit on tab 2

This commit is contained in:
puriphatt 2024-08-21 10:11:56 +07:00
parent 18efaa48b6
commit 6246daa6c0
2 changed files with 16 additions and 0 deletions

View file

@ -219,6 +219,7 @@ const serviceCodeFilter = selectFilterOptionRefMod(
class="col-6"
:label="$t('serviceName')"
v-model="serviceName"
:rules="[(val: string) => !!val || $t('pleaseInformation')]"
/>
<q-input
lazy-rules="ondemand"

View file

@ -1069,6 +1069,14 @@ async function submitService() {
formDataProductService.value.registeredBranchId = null;
}
if (
formDataProductService.value.code === '' ||
formDataProductService.value.name === ''
) {
serviceTab.value = 1;
return;
}
const res = await createService(formDataProductService.value);
if (res) {
stat.value[2].count = stat.value[2].count + 1;
@ -1102,6 +1110,13 @@ async function submitProduct() {
}
if (dialogProduct.value) {
if (
formDataProduct.value.name === '' ||
formDataProduct.value.code === ''
) {
productTab.value = 1;
return;
}
const res = await createProduct(formDataProduct.value);
if (res) {