diff --git a/src/components/FormModel.vue b/src/components/FormModel.vue index 5e67a1310..c1cd80ce3 100644 --- a/src/components/FormModel.vue +++ b/src/components/FormModel.vue @@ -323,6 +323,22 @@ async function onKeyup(evt) { } } +async function onKeyup(evt) { + if (evt.key === 'Enter' && !('prevent-submit' in attrs)) { + const input = evt.target; + if (input.type == 'textarea' && evt.shiftKey) { + let { selectionStart, selectionEnd } = input; + input.value = + input.value.substring(0, selectionStart) + + '\n' + + input.value.substring(selectionEnd); + selectionStart = selectionEnd = selectionStart + 1; + return; + } + await save(); + } +} + defineExpose({ save, isLoading, diff --git a/src/pages/Customer/components/CustomerNewPayment.vue b/src/pages/Customer/components/CustomerNewPayment.vue index 8f61bac89..6ecccc544 100644 --- a/src/pages/Customer/components/CustomerNewPayment.vue +++ b/src/pages/Customer/components/CustomerNewPayment.vue @@ -77,7 +77,6 @@ onBeforeMount(() => { function setPaymentType(accounting) { if (!accounting) return; accountingType.value = accounting.accountingType; - initialData.description = []; initialData.payed = Date.vnNew(); isCash.value = accountingType.value.code == 'cash'; @@ -87,14 +86,14 @@ function setPaymentType(accounting) { initialData.payed.getDate() + accountingType.value.daysInFuture, ); maxAmount.value = accountingType.value && accountingType.value.maxAmount; - if (accountingType.value.code == 'compensation') return (initialData.description = ''); - if (accountingType.value.receiptDescription) - initialData.description.push(accountingType.value.receiptDescription); - if (initialData.description) initialData.description.push(initialData.description); - initialData.description = initialData.description.join(', '); + let descriptions = []; + if (accountingType.value.receiptDescription) + descriptions.push(accountingType.value.receiptDescription); + if (initialData.description) descriptions.push(initialData.description); + initialData.description = descriptions.join(', '); } const calculateFromAmount = (event) => { diff --git a/src/pages/Ticket/Card/TicketEditMana.vue b/src/pages/Ticket/Card/TicketEditMana.vue index b3ba870fb..ff40a6592 100644 --- a/src/pages/Ticket/Card/TicketEditMana.vue +++ b/src/pages/Ticket/Card/TicketEditMana.vue @@ -1,32 +1,26 @@ diff --git a/src/pages/Worker/Card/WorkerDescriptor.vue b/src/pages/Worker/Card/WorkerDescriptor.vue index de3f634e2..0e946f1dd 100644 --- a/src/pages/Worker/Card/WorkerDescriptor.vue +++ b/src/pages/Worker/Card/WorkerDescriptor.vue @@ -111,6 +111,7 @@ const handlePhotoUpdated = (evt = false) => {