fix: set default value as 0 in int field
This commit is contained in:
parent
55a67bbc0c
commit
88f33db249
@ -211,7 +211,7 @@ const filterOptions = createResource({
|
|||||||
|
|
||||||
const options = computed(() => {
|
const options = computed(() => {
|
||||||
let searchedContacts = props.fetchContacts ? filterOptions.data : []
|
let searchedContacts = props.fetchContacts ? filterOptions.data : []
|
||||||
if (!searchedContacts.length && query.value) {
|
if (!searchedContacts?.length && query.value) {
|
||||||
searchedContacts.push({
|
searchedContacts.push({
|
||||||
label: query.value,
|
label: query.value,
|
||||||
value: query.value,
|
value: query.value,
|
||||||
|
|||||||
@ -136,7 +136,6 @@
|
|||||||
<DateTimePicker
|
<DateTimePicker
|
||||||
v-else-if="field.fieldtype === 'Datetime'"
|
v-else-if="field.fieldtype === 'Datetime'"
|
||||||
:value="data[field.fieldname]"
|
:value="data[field.fieldname]"
|
||||||
icon-left=""
|
|
||||||
:formatter="(date) => getFormat(date, '', true, true)"
|
:formatter="(date) => getFormat(date, '', true, true)"
|
||||||
:placeholder="getPlaceholder(field)"
|
:placeholder="getPlaceholder(field)"
|
||||||
input-class="border-none"
|
input-class="border-none"
|
||||||
@ -144,7 +143,6 @@
|
|||||||
/>
|
/>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
v-else-if="field.fieldtype === 'Date'"
|
v-else-if="field.fieldtype === 'Date'"
|
||||||
icon-left=""
|
|
||||||
:value="data[field.fieldname]"
|
:value="data[field.fieldname]"
|
||||||
:formatter="(date) => getFormat(date, '', true)"
|
:formatter="(date) => getFormat(date, '', true)"
|
||||||
:placeholder="getPlaceholder(field)"
|
:placeholder="getPlaceholder(field)"
|
||||||
@ -162,10 +160,10 @@
|
|||||||
@change="fieldChange($event.target.value, field)"
|
@change="fieldChange($event.target.value, field)"
|
||||||
/>
|
/>
|
||||||
<FormattedInput
|
<FormattedInput
|
||||||
v-else-if="['Int'].includes(field.fieldtype)"
|
v-else-if="field.fieldtype === 'Int'"
|
||||||
type="number"
|
type="text"
|
||||||
:placeholder="getPlaceholder(field)"
|
:placeholder="getPlaceholder(field)"
|
||||||
:value="data[field.fieldname]"
|
:value="data[field.fieldname] || '0'"
|
||||||
:disabled="Boolean(field.read_only)"
|
:disabled="Boolean(field.read_only)"
|
||||||
:description="field.description"
|
:description="field.description"
|
||||||
@change="fieldChange($event.target.value, field)"
|
@change="fieldChange($event.target.value, field)"
|
||||||
|
|||||||
@ -279,7 +279,7 @@
|
|||||||
v-else-if="field.fieldtype === 'Int'"
|
v-else-if="field.fieldtype === 'Int'"
|
||||||
class="form-control"
|
class="form-control"
|
||||||
type="text"
|
type="text"
|
||||||
v-model="document.doc[field.fieldname]"
|
:value="document.doc[field.fieldname] || '0'"
|
||||||
:placeholder="field.placeholder"
|
:placeholder="field.placeholder"
|
||||||
:debounce="500"
|
:debounce="500"
|
||||||
@change.stop="fieldChange($event.target.value, field)"
|
@change.stop="fieldChange($event.target.value, field)"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user