|
@@ -7,7 +7,7 @@
|
|
|
postMaterialtaskDownloadFileExportQuery,
|
|
|
getMaterialtaskInfo,
|
|
|
} from '/@/services/apis/MaterialTaskController';
|
|
|
- import { nextTick, ref } from 'vue';
|
|
|
+ import { nextTick, ref, reactive } from 'vue';
|
|
|
import { Radio } from 'ant-design-vue';
|
|
|
import { useTable, BasicTable, TableAction } from '/@/components/Table';
|
|
|
import auditModal from './auditModal.vue';
|
|
@@ -22,10 +22,14 @@
|
|
|
import { getFileList } from '/@/api/system/file';
|
|
|
import FormTemplate from '/@/views/form/preview/index.vue';
|
|
|
import { formatToDateTime } from '/@/utils/dateUtil';
|
|
|
+ import { useLoading } from '/@/components/Loading';
|
|
|
const RadioGroup = Radio.Group;
|
|
|
const RadioButton = Radio.Button;
|
|
|
const emit = defineEmits(['success', 'register']);
|
|
|
const taskDataInfo = ref();
|
|
|
+ const state = reactive({
|
|
|
+ downloadLoading: false,
|
|
|
+ });
|
|
|
const [register, {}] = useModalInner(async (data) => {
|
|
|
taskDataInfo.value = await getMaterialtaskInfo({ id: data.id });
|
|
|
taskDataInfo.value.isUpdate = data.isUpdate;
|
|
@@ -88,6 +92,10 @@
|
|
|
reload();
|
|
|
};
|
|
|
|
|
|
+ const [openFullLoading, closeFullLoading] = useLoading({
|
|
|
+ tip: '处理中...',
|
|
|
+ });
|
|
|
+
|
|
|
const handleClose = () => {
|
|
|
status.value = 1;
|
|
|
emit('success');
|
|
@@ -142,15 +150,22 @@
|
|
|
};
|
|
|
|
|
|
const handelDownload = async () => {
|
|
|
- const postData = {
|
|
|
- materialTaskId: taskDataInfo.value.id,
|
|
|
- state: status.value,
|
|
|
- };
|
|
|
- const data = await postMaterialtaskDownloadFileExportQuery(postData);
|
|
|
- downloadByData(
|
|
|
- data.data,
|
|
|
- `${taskDataInfo.value.name}${formatToDateTime(new Date(), 'YYYYMMDDHHmmss')}.zip`,
|
|
|
- );
|
|
|
+ try {
|
|
|
+ openFullLoading();
|
|
|
+ state.downloadLoading = true;
|
|
|
+ const postData = {
|
|
|
+ materialTaskId: taskDataInfo.value.id,
|
|
|
+ state: status.value,
|
|
|
+ };
|
|
|
+ const data = await postMaterialtaskDownloadFileExportQuery(postData);
|
|
|
+ downloadByData(
|
|
|
+ data.data,
|
|
|
+ `${taskDataInfo.value.name}${formatToDateTime(new Date(), 'YYYYMMDDHHmmss')}.zip`,
|
|
|
+ );
|
|
|
+ } finally {
|
|
|
+ closeFullLoading();
|
|
|
+ state.downloadLoading = false;
|
|
|
+ }
|
|
|
};
|
|
|
</script>
|
|
|
|
|
@@ -243,7 +258,9 @@
|
|
|
>
|
|
|
审核
|
|
|
</a-button>
|
|
|
- <a-button type="primary" @click="handelDownload">下载</a-button>
|
|
|
+ <a-button type="primary" @click="handelDownload" :loading="state.downloadLoading">
|
|
|
+ 下载
|
|
|
+ </a-button>
|
|
|
<a-button type="primary" @click="handelExport">导出</a-button>
|
|
|
</template>
|
|
|
<template #action="{ record }">
|