refactor: fall back value
This commit is contained in:
parent
303bc1214d
commit
b093e4b546
2 changed files with 24 additions and 2 deletions
|
|
@ -69,7 +69,18 @@ function triggerEdit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function assignToForm() {
|
function assignToForm() {
|
||||||
formData.value = JSON.parse(JSON.stringify(attributesForm.value));
|
formData.value = JSON.parse(
|
||||||
|
JSON.stringify({
|
||||||
|
customerDuty: attributesForm.value.customerDuty ?? false,
|
||||||
|
customerDutyCost: attributesForm.value.customerDutyCost ?? 30,
|
||||||
|
companyDuty: attributesForm.value.companyDuty ?? false,
|
||||||
|
companyDutyCost: attributesForm.value.companyDutyCost ?? 30,
|
||||||
|
responsibleUserLocal: attributesForm.value.responsibleUserLocal ?? true,
|
||||||
|
responsibleUserId: attributesForm.value.responsibleUserId ?? '',
|
||||||
|
individualDuty: attributesForm.value.individualDuty ?? false,
|
||||||
|
individualDutyCost: attributesForm.value.individualDutyCost ?? 10,
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
|
|
@ -78,7 +78,18 @@ function triggerEdit() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function assignToForm() {
|
function assignToForm() {
|
||||||
formData.value = JSON.parse(JSON.stringify(attributesForm.value));
|
formData.value = JSON.parse(
|
||||||
|
JSON.stringify({
|
||||||
|
customerDuty: attributesForm.value.customerDuty ?? false,
|
||||||
|
customerDutyCost: attributesForm.value.customerDutyCost ?? 30,
|
||||||
|
companyDuty: attributesForm.value.companyDuty ?? false,
|
||||||
|
companyDutyCost: attributesForm.value.companyDutyCost ?? 30,
|
||||||
|
responsibleUserLocal: attributesForm.value.responsibleUserLocal ?? true,
|
||||||
|
responsibleUserId: attributesForm.value.responsibleUserId ?? '',
|
||||||
|
individualDuty: attributesForm.value.individualDuty ?? false,
|
||||||
|
individualDutyCost: attributesForm.value.individualDutyCost ?? 10,
|
||||||
|
}),
|
||||||
|
);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue