refs #6664 claimPortes

This commit is contained in:
Carlos Satorres 2024-01-25 13:48:42 +01:00
parent 8ae7756e9a
commit 35aa0ba20a
2 changed files with 7 additions and 23 deletions

View File

@ -37,7 +37,7 @@ const marker_labels = [
{ value: DEFAULT_MIN_RESPONSABILITY, label: t('claim.summary.company') },
{ value: DEFAULT_MAX_RESPONSABILITY, label: t('claim.summary.person') },
];
const portesMultiplicator = ref();
const multiplicatorValue = ref();
const columns = computed(() => [
{
@ -135,24 +135,10 @@ async function regularizeClaim() {
message: t('globals.dataSaved'),
type: 'positive',
});
// if (claim.value.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2) {
// quasar
// .dialog({
// component: VnConfirm,
// componentProps: {
// title: t('confirmGreuges'),
// message: `
// <input class="q-field__native text-grey-2" type="number" placeholder="1" id="multiplicatorValue" name="multiplicatorValue" min="0" max="50"/>
// `,
// data: { inputId: 'multiplicatorValue' },
// promise: onUpdateGreugeAccept,
// },
// })
// .onOk(async () => await onUpdateGreugeAccept());
// }
await onUpdateGreugeAccept();
}
async function onUpdateGreugeAccept({ return: multiplicatorValue }) {
async function onUpdateGreugeAccept() {
const greugeTypeFreightId = (
await axios.get(`GreugeTypes/findOne`, {
filter: { where: { code: 'freightPickUp' } },
@ -160,7 +146,7 @@ async function onUpdateGreugeAccept({ return: multiplicatorValue }) {
).data.id;
const freightPickUpPrice =
(await axios.get(`GreugeConfigs/findOne`)).data.freightPickUpPrice *
+multiplicatorValue;
+multiplicatorValue.value;
console.log(freightPickUpPrice);
await axios.post(`Greuges`, {
clientFk: claim.value.clientFk,
@ -267,6 +253,9 @@ async function importToNewRefundTicket() {
</QCard>
<QCard class="q-mb-md q-pa-sm no-box-shadow" style="position: static">
<QInput
:disable="
!(claim.responsibility >= Math.ceil(DEFAULT_MAX_RESPONSABILITY) / 2)
"
:label="t('confirmGreuges')"
class="q-field__native text-grey-2"
type="number"
@ -277,10 +266,6 @@ async function importToNewRefundTicket() {
max="50"
v-model="multiplicatorValue"
/>
<QBtn
@click="onUpdateGreugeAccept(multiplicatorValue)"
:label="t('Apply Greuges')"
></QBtn>
</QCard>
</QDrawer>
<Teleport to="#st-data" v-if="stateStore.isSubToolbarShown()"> </Teleport>

View File

@ -31,7 +31,6 @@ describe('ClaimAction', () => {
it('should regularize', () => {
cy.get('[title="Regularize"]').click();
cy.clickConfirm();
});
it('should remove the line', () => {