|
@@ -340,10 +340,10 @@
|
|
|
<el-button @click="getList" size="small">{{ $t('find') }}</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="currentClick == '2-1'">
|
|
|
- <el-button @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
|
|
|
+ <el-button :loading="exportingData" @click="exportDocument()" size="small">{{ $t('danJuDaoChu') }}</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="currentClick == '2-1'">
|
|
|
- <el-button @click="exportDocumentFile()" size="small">{{ $t('baoXiaoPingZhengDaoChu') }}</el-button>
|
|
|
+ <el-button :loading="exportingData" @click="exportDocumentFile()" size="small">{{ $t('baoXiaoPingZhengDaoChu') }}</el-button>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="currentClick == '2-1' && permissions.costExpenseRelease">
|
|
|
<el-button @click="documentIssuance(1)" size="small">{{ $t('faFang') }}</el-button>
|
|
@@ -1112,7 +1112,7 @@ export default {
|
|
|
id: null
|
|
|
},
|
|
|
basecostSettingList: [],
|
|
|
-
|
|
|
+ exportingData:false,
|
|
|
fileList: [],
|
|
|
muHeight: document.documentElement.clientHeight || document.body.clientHeight,
|
|
|
xiamianWidth: document.documentElement.clientWidth || document.body.clientWidth,
|
|
@@ -2390,6 +2390,7 @@ export default {
|
|
|
},
|
|
|
// 单据导出
|
|
|
exportDocument() {
|
|
|
+ this.exportingData = true;
|
|
|
var stat = ''
|
|
|
var end = ''
|
|
|
if (this.date) {
|
|
@@ -2407,6 +2408,7 @@ export default {
|
|
|
sendState: this.sendState
|
|
|
},
|
|
|
res => {
|
|
|
+ this.exportingData = false;
|
|
|
if (res.code == "ok") {
|
|
|
var filePath = res.data;
|
|
|
const a = document.createElement('a'); // 创建a标签
|
|
@@ -2436,15 +2438,26 @@ export default {
|
|
|
stat = this.date[0]
|
|
|
end = this.date[1]
|
|
|
}
|
|
|
- const formData = new FormData();
|
|
|
- formData.append('code', this.code);
|
|
|
- formData.append('startDate', stat);
|
|
|
- formData.append('endDate', end);
|
|
|
- formData.append('ownerId', this.ownerId);
|
|
|
- formData.append('type', this.type);
|
|
|
- formData.append('projectId', this.selectProject ? this.selectProject : null);
|
|
|
- formData.append('sendState', this.sendState);
|
|
|
- this.http.downloadFile(`/expense-sheet/export`, formData, '报销凭证导出.zip')
|
|
|
+ this.exportingData=true
|
|
|
+ var that = this;
|
|
|
+ this.http.downloadFile(`/expense-sheet/export`, {
|
|
|
+ code: this.code,
|
|
|
+ startDate: stat,
|
|
|
+ endDate: end,
|
|
|
+ ownerId: this.ownerId,
|
|
|
+ type: this.type,
|
|
|
+ projectId: this.selectProject ? this.selectProject : null,
|
|
|
+ sendState: this.sendState
|
|
|
+ }, '报销凭证导出.zip', function(err) {
|
|
|
+ that.exportingData = false;
|
|
|
+ that.$message({
|
|
|
+ message: err,
|
|
|
+ type: "error"
|
|
|
+ });
|
|
|
+ }, function() {
|
|
|
+ console.log('55555555555')
|
|
|
+ that.exportingData = false;
|
|
|
+ })
|
|
|
},
|
|
|
// 单据发放
|
|
|
documentIssuance(type) {
|