Merge pull request 'refs #5930 mod component' (!66) from 5930-claimBasicData into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
Reviewed-on: #66 Reviewed-by: Alex Moreno <alexm@verdnatura.es>
This commit is contained in:
commit
b0f4e23871
|
@ -25,6 +25,10 @@ const $props = defineProps({
|
||||||
type: Object,
|
type: Object,
|
||||||
default: null,
|
default: null,
|
||||||
},
|
},
|
||||||
|
urlUpdate: {
|
||||||
|
type: String,
|
||||||
|
default: null,
|
||||||
|
},
|
||||||
});
|
});
|
||||||
|
|
||||||
const emit = defineEmits(['onFetch']);
|
const emit = defineEmits(['onFetch']);
|
||||||
|
@ -66,7 +70,7 @@ async function save() {
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
isLoading.value = true;
|
isLoading.value = true;
|
||||||
await axios.patch($props.url, formData.value);
|
await axios.patch($props.urlUpdate || $props.url, formData.value);
|
||||||
|
|
||||||
originalData.value = formData.value;
|
originalData.value = formData.value;
|
||||||
hasChanges.value = false;
|
hasChanges.value = false;
|
||||||
|
|
|
@ -2,18 +2,13 @@ import axios from 'axios';
|
||||||
|
|
||||||
export async function getUrl(route, appName = 'salix') {
|
export async function getUrl(route, appName = 'salix') {
|
||||||
let url;
|
let url;
|
||||||
const env = process.env.NODE_ENV === 'development' ? 'dev' : process.env.NODE_ENV;
|
|
||||||
const filter = {
|
const filter = {
|
||||||
where: {and: [
|
where: { and: [{ appName: appName }, { environment: process.env.NODE_ENV }] },
|
||||||
{appName: appName},
|
|
||||||
{environment: env}
|
|
||||||
]}
|
|
||||||
};
|
};
|
||||||
|
|
||||||
await axios.get('Urls/findOne', {params: {filter}})
|
await axios.get('Urls/findOne', { params: { filter } }).then((res) => {
|
||||||
.then(res => {
|
url = res.data.url + route;
|
||||||
url = res.data.url + route;
|
});
|
||||||
});
|
|
||||||
|
|
||||||
return url;
|
return url;
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,16 @@ const session = useSession();
|
||||||
const token = session.getToken();
|
const token = session.getToken();
|
||||||
|
|
||||||
const claimFilter = {
|
const claimFilter = {
|
||||||
|
fields: [
|
||||||
|
'id',
|
||||||
|
'clientFk',
|
||||||
|
'created',
|
||||||
|
'workerFk',
|
||||||
|
'claimStateFk',
|
||||||
|
'packages',
|
||||||
|
'rma',
|
||||||
|
'hasToPickUp',
|
||||||
|
],
|
||||||
include: [
|
include: [
|
||||||
{
|
{
|
||||||
relation: 'client',
|
relation: 'client',
|
||||||
|
@ -85,6 +95,7 @@ const statesFilter = {
|
||||||
<QCard>
|
<QCard>
|
||||||
<FormModel
|
<FormModel
|
||||||
:url="`Claims/${route.params.id}`"
|
:url="`Claims/${route.params.id}`"
|
||||||
|
:url-update="`Claims/updateClaim/${route.params.id}`"
|
||||||
:filter="claimFilter"
|
:filter="claimFilter"
|
||||||
model="claim"
|
model="claim"
|
||||||
>
|
>
|
||||||
|
@ -180,9 +191,10 @@ const statesFilter = {
|
||||||
<div class="row q-gutter-md q-mb-md">
|
<div class="row q-gutter-md q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
<QInput
|
<QInput
|
||||||
v-model="data.packages"
|
v-model.number="data.packages"
|
||||||
:label="t('claim.basicData.packages')"
|
:label="t('claim.basicData.packages')"
|
||||||
:rules="validate('claim.packages')"
|
:rules="validate('claim.packages')"
|
||||||
|
type="number"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
<div class="col">
|
<div class="col">
|
||||||
|
|
Loading…
Reference in New Issue