forked from verdnatura/salix-front
ref #5876
This commit is contained in:
parent
a5710e66e1
commit
562fe18b65
|
@ -25,7 +25,8 @@ const client = ref({});
|
||||||
|
|
||||||
const inputFile = ref();
|
const inputFile = ref();
|
||||||
const files = ref({});
|
const files = ref({});
|
||||||
|
const spinnerRef = ref();
|
||||||
|
const progress = ref(0);
|
||||||
const claimDmsRef = ref();
|
const claimDmsRef = ref();
|
||||||
const dmsType = ref({});
|
const dmsType = ref({});
|
||||||
const config = ref({});
|
const config = ref({});
|
||||||
|
@ -98,13 +99,8 @@ function setClaimDms(data) {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function create() {
|
async function create() {
|
||||||
const formData = new FormData();
|
|
||||||
const inputFiles = files.value;
|
const inputFiles = files.value;
|
||||||
for (let i = 0; i < inputFiles.length; i++)
|
|
||||||
formData.append(inputFiles[i].name, inputFiles[i]);
|
|
||||||
|
|
||||||
const query = `claims/${claimId.value}/uploadFile`;
|
const query = `claims/${claimId.value}/uploadFile`;
|
||||||
|
|
||||||
const dms = {
|
const dms = {
|
||||||
hasFile: false,
|
hasFile: false,
|
||||||
hasFileAttached: false,
|
hasFileAttached: false,
|
||||||
|
@ -119,9 +115,16 @@ async function create() {
|
||||||
}).toUpperCase(),
|
}).toUpperCase(),
|
||||||
};
|
};
|
||||||
|
|
||||||
await axios.post(query, formData, {
|
spinnerRef.value.show();
|
||||||
params: dms,
|
for (let i = 0; i < inputFiles.length; i++) {
|
||||||
});
|
const formData = new FormData();
|
||||||
|
formData.append(inputFiles[i].name, inputFiles[i]);
|
||||||
|
await axios.post(query, formData, {
|
||||||
|
params: dms,
|
||||||
|
});
|
||||||
|
progress.value = i;
|
||||||
|
}
|
||||||
|
spinnerRef.value.hide();
|
||||||
|
|
||||||
quasar.notify({
|
quasar.notify({
|
||||||
message: t('globals.dataSaved'),
|
message: t('globals.dataSaved'),
|
||||||
|
@ -234,7 +237,16 @@ function onDrag() {
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<QDialog ref="spinnerRef">
|
||||||
|
<QCard>
|
||||||
|
<QCardSection class="row justify-center">
|
||||||
|
<QSpinner color="orange" size="xl" />
|
||||||
|
</QCardSection>
|
||||||
|
<QCardSection>
|
||||||
|
<p>{{ `${progress} de ${files.length} archivos subidos` }}</p>
|
||||||
|
</QCardSection>
|
||||||
|
</QCard>
|
||||||
|
</QDialog>
|
||||||
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
<QPageSticky position="bottom-right" :offset="[25, 25]">
|
||||||
<label for="fileInput">
|
<label for="fileInput">
|
||||||
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
|
<QBtn fab @click="inputFile.nativeEl.click()" icon="add" color="primary">
|
||||||
|
|
Loading…
Reference in New Issue