|
@@ -50,13 +50,13 @@
|
|
|
</el-dropdown>
|
|
</el-dropdown>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" icon="Top" @click="handleCustomerExport">
|
|
|
|
|
|
|
+ <el-button type="primary" icon="Top" :loading="buttonLoading" @click="handleCustomerExport">
|
|
|
导出客户
|
|
导出客户
|
|
|
<el-icon class="el-icon--right"> </el-icon>
|
|
<el-icon class="el-icon--right"> </el-icon>
|
|
|
</el-button>
|
|
</el-button>
|
|
|
</el-col>
|
|
</el-col>
|
|
|
<el-col :span="1.5">
|
|
<el-col :span="1.5">
|
|
|
- <el-button type="primary" icon="Top" @click="handleSupplierExport">
|
|
|
|
|
|
|
+ <el-button type="primary" icon="Top" :loading="buttonLoading" @click="handleSupplierExport">
|
|
|
导出供应商
|
|
导出供应商
|
|
|
<el-icon class="el-icon--right"> </el-icon>
|
|
<el-icon class="el-icon--right"> </el-icon>
|
|
|
</el-button>
|
|
</el-button>
|
|
@@ -88,6 +88,7 @@
|
|
|
:disabled="upload.isUploading"
|
|
:disabled="upload.isUploading"
|
|
|
:on-progress="handleFileUploadProgress"
|
|
:on-progress="handleFileUploadProgress"
|
|
|
:on-success="handleFileSuccess"
|
|
:on-success="handleFileSuccess"
|
|
|
|
|
+ :on-error="handleFileUploadError"
|
|
|
:auto-upload="false"
|
|
:auto-upload="false"
|
|
|
drag
|
|
drag
|
|
|
>
|
|
>
|
|
@@ -107,8 +108,8 @@
|
|
|
</el-upload>
|
|
</el-upload>
|
|
|
<template #footer>
|
|
<template #footer>
|
|
|
<div class="dialog-footer">
|
|
<div class="dialog-footer">
|
|
|
- <el-button type="primary" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
- <el-button @click="upload.open = false">取 消</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" :loading="upload.isUploading" @click="submitFileForm">确 定</el-button>
|
|
|
|
|
+ <el-button :disabled="upload.isUploading" @click="upload.open = false">取 消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
@@ -202,18 +203,33 @@ const handleSupplierImport = () => {
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/** 客户导出按钮操作 */
|
|
/** 客户导出按钮操作 */
|
|
|
-const handleCustomerExport = () => {
|
|
|
|
|
- proxy?.download('customer/customerInfo/exportTemplateData', {}, `客户导出_${new Date().getTime()}.xlsx`);
|
|
|
|
|
|
|
+const handleCustomerExport = async () => {
|
|
|
|
|
+ buttonLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await proxy?.download('customer/customerInfo/exportTemplateData', {}, `客户导出_${new Date().getTime()}.xlsx`);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ buttonLoading.value = false;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
-/** 客户导出按钮操作 */
|
|
|
|
|
-const handleSupplierExport = () => {
|
|
|
|
|
- proxy?.download('customer/info/exportTemplateData', {}, `供应商导出_${new Date().getTime()}.xlsx`);
|
|
|
|
|
|
|
+/** 供应商导出按钮操作 */
|
|
|
|
|
+const handleSupplierExport = async () => {
|
|
|
|
|
+ buttonLoading.value = true;
|
|
|
|
|
+ try {
|
|
|
|
|
+ await proxy?.download('customer/info/exportTemplateData', {}, `供应商导出_${new Date().getTime()}.xlsx`);
|
|
|
|
|
+ } finally {
|
|
|
|
|
+ buttonLoading.value = false;
|
|
|
|
|
+ }
|
|
|
};
|
|
};
|
|
|
|
|
|
|
|
/**文件上传中处理 */
|
|
/**文件上传中处理 */
|
|
|
const handleFileUploadProgress = () => {
|
|
const handleFileUploadProgress = () => {
|
|
|
upload.isUploading = true;
|
|
upload.isUploading = true;
|
|
|
};
|
|
};
|
|
|
|
|
+/** 文件上传失败处理 */
|
|
|
|
|
+const handleFileUploadError = () => {
|
|
|
|
|
+ upload.isUploading = false;
|
|
|
|
|
+ ElMessage.error('文件上传失败,请联系管理员!');
|
|
|
|
|
+};
|
|
|
/** 文件上传成功处理 */
|
|
/** 文件上传成功处理 */
|
|
|
const handleFileSuccess = (response: any, file: UploadFile) => {
|
|
const handleFileSuccess = (response: any, file: UploadFile) => {
|
|
|
upload.open = false;
|
|
upload.open = false;
|