forked from verdnatura/salix-front
fix(TicketService): pay use selected
This commit is contained in:
parent
7b9e26528a
commit
3b18375cdb
|
@ -19,12 +19,11 @@ const { t } = useI18n();
|
||||||
const ticketServiceTypeFetchRef = ref(null);
|
const ticketServiceTypeFetchRef = ref(null);
|
||||||
const ticketServiceCrudRef = ref(null);
|
const ticketServiceCrudRef = ref(null);
|
||||||
const ticketServiceOptions = ref([]);
|
const ticketServiceOptions = ref([]);
|
||||||
const selected = ref([]);
|
|
||||||
const arrayData = useArrayData('TicketNotes');
|
const arrayData = useArrayData('TicketNotes');
|
||||||
const { store } = arrayData;
|
const { store } = arrayData;
|
||||||
const { notify } = useNotify();
|
const { notify } = useNotify();
|
||||||
|
|
||||||
const selectedServices = ref(new Set());
|
const selected = ref([]);
|
||||||
const defaultTaxClass = ref(null);
|
const defaultTaxClass = ref(null);
|
||||||
|
|
||||||
const crudModelFilter = computed(() => ({
|
const crudModelFilter = computed(() => ({
|
||||||
|
@ -48,10 +47,10 @@ onMounted(async () => await getDefaultTaxClass());
|
||||||
|
|
||||||
const createRefund = async () => {
|
const createRefund = async () => {
|
||||||
try {
|
try {
|
||||||
if (!selectedServices.value.size) return;
|
if (!selected.value.length) return;
|
||||||
|
|
||||||
const params = {
|
const params = {
|
||||||
servicesIds: Array.from(selectedServices.value),
|
servicesIds: selected.value.map((s) => s.id),
|
||||||
withWarehouse: false,
|
withWarehouse: false,
|
||||||
negative: true,
|
negative: true,
|
||||||
};
|
};
|
||||||
|
@ -130,7 +129,7 @@ const columns = computed(() => [
|
||||||
<QBtn
|
<QBtn
|
||||||
color="primary"
|
color="primary"
|
||||||
:label="t('service.pay')"
|
:label="t('service.pay')"
|
||||||
:disabled="!selectedServices.size"
|
:disabled="!selected.length"
|
||||||
@click.stop="createRefund()"
|
@click.stop="createRefund()"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue