Merge branch 'test' into Warmfix-SearchbarStyle
gitea/salix-front/pipeline/pr-test This commit looks good
Details
gitea/salix-front/pipeline/pr-test This commit looks good
Details
This commit is contained in:
commit
d5289c1405
|
@ -1,12 +1,13 @@
|
|||
<script setup>
|
||||
import { ref, computed } from 'vue';
|
||||
import { ref, computed, useAttrs, nextTick } from 'vue';
|
||||
import { useI18n } from 'vue-i18n';
|
||||
import { useState } from 'src/composables/useState';
|
||||
|
||||
import FormModel from 'components/FormModel.vue';
|
||||
|
||||
const emit = defineEmits(['onDataSaved', 'onDataCanceled']);
|
||||
|
||||
defineProps({
|
||||
const props = defineProps({
|
||||
title: {
|
||||
type: String,
|
||||
default: '',
|
||||
|
@ -22,12 +23,21 @@ defineProps({
|
|||
});
|
||||
|
||||
const { t } = useI18n();
|
||||
|
||||
const attrs = useAttrs();
|
||||
const state = useState();
|
||||
const formModelRef = ref(null);
|
||||
const closeButton = ref(null);
|
||||
const isSaveAndContinue = ref(false);
|
||||
const onDataSaved = (formData, requestResponse) => {
|
||||
if (closeButton.value && !isSaveAndContinue.value) closeButton.value.click();
|
||||
const isSaveAndContinue = ref(props.showSaveAndContinueBtn);
|
||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||
const reset = computed(() => formModelRef.value?.reset);
|
||||
|
||||
const onDataSaved = async (formData, requestResponse) => {
|
||||
if (!isSaveAndContinue.value) closeButton.value?.click();
|
||||
if (isSaveAndContinue.value) {
|
||||
await nextTick();
|
||||
state.set(attrs.model, attrs.formInitialData);
|
||||
}
|
||||
isSaveAndContinue.value = props.showSaveAndContinueBtn;
|
||||
emit('onDataSaved', formData, requestResponse);
|
||||
};
|
||||
|
||||
|
@ -36,9 +46,6 @@ const onClick = async (saveAndContinue) => {
|
|||
await formModelRef.value.save();
|
||||
};
|
||||
|
||||
const isLoading = computed(() => formModelRef.value?.isLoading);
|
||||
const reset = computed(() => formModelRef.value?.reset);
|
||||
|
||||
defineExpose({
|
||||
isLoading,
|
||||
onDataSaved,
|
||||
|
@ -74,10 +81,7 @@ defineExpose({
|
|||
data-cy="FormModelPopup_cancel"
|
||||
v-close-popup
|
||||
z-max
|
||||
@click="
|
||||
isSaveAndContinue = false;
|
||||
emit('onDataCanceled');
|
||||
"
|
||||
@click="emit('onDataCanceled')"
|
||||
/>
|
||||
<QBtn
|
||||
:flat="showSaveAndContinueBtn"
|
||||
|
|
|
@ -961,14 +961,6 @@ function cardClick(_, row) {
|
|||
transition-show="scale"
|
||||
transition-hide="scale"
|
||||
:full-width="createComplement?.isFullWidth ?? false"
|
||||
@before-hide="
|
||||
() => {
|
||||
if (createRef.isSaveAndContinue) {
|
||||
showForm = true;
|
||||
createForm.formInitialData = { ...create.formInitialData };
|
||||
}
|
||||
}
|
||||
"
|
||||
data-cy="vn-table-create-dialog"
|
||||
>
|
||||
<FormModelPopup
|
||||
|
|
|
@ -18,6 +18,7 @@ import VnInput from 'src/components/common/VnInput.vue';
|
|||
import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||
import CustomerSamplesPreview from 'src/pages/Customer/components/CustomerSamplesPreview.vue';
|
||||
import FormPopup from 'src/components/FormPopup.vue';
|
||||
import { useArrayData } from 'src/composables/useArrayData';
|
||||
|
||||
const { dialogRef, onDialogOK } = useDialogPluginComponent();
|
||||
|
||||
|
@ -39,7 +40,7 @@ const optionsSamplesVisible = ref([]);
|
|||
const sampleType = ref({ hasPreview: false });
|
||||
const initialData = reactive({});
|
||||
const entityId = computed(() => route.params.id);
|
||||
const customer = computed(() => state.get('Customer'));
|
||||
const customer = computed(() => useArrayData('Customer').store?.data);
|
||||
const filterEmailUsers = { where: { userFk: user.value.id } };
|
||||
const filterClientsAddresses = {
|
||||
include: [
|
||||
|
@ -65,9 +66,9 @@ const filterSamplesVisible = {
|
|||
defineEmits(['confirm', ...useDialogPluginComponent.emits]);
|
||||
|
||||
onBeforeMount(async () => {
|
||||
initialData.clientFk = customer.value.id;
|
||||
initialData.recipient = customer.value.email;
|
||||
initialData.recipientId = customer.value.id;
|
||||
initialData.clientFk = customer.value?.id;
|
||||
initialData.recipient = customer.value?.email;
|
||||
initialData.recipientId = customer.value?.id;
|
||||
});
|
||||
|
||||
const setEmailUser = (data) => {
|
||||
|
|
Loading…
Reference in New Issue