|
@@ -154,7 +154,11 @@
|
|
|
<el-button v-if="hasPermission('finance:invoice:importInvoiceBatch')" type="primary"
|
|
<el-button v-if="hasPermission('finance:invoice:importInvoiceBatch')" type="primary"
|
|
|
@click="projectImport()" plain>批量收款导入</el-button>
|
|
@click="projectImport()" plain>批量收款导入</el-button>
|
|
|
|
|
|
|
|
- <el-button type="danger" @click="batchDownloadInvoice()" plain
|
|
|
|
|
|
|
+ <el-button v-if="hasPermission('finance:invoice:ledgerImportExport')" type="success"
|
|
|
|
|
+ @click="ledgerImportExport()" plain style="margin-left: 10px;">台账导入导出</el-button>
|
|
|
|
|
+ <input ref="ledgerFileInput" type="file" accept=".xls,.xlsx" style="display:none" @change="handleLedgerFileChange" />
|
|
|
|
|
+
|
|
|
|
|
+ <el-button type="danger" @click="batchDownloadInvoice()" plain style="margin-left: 10px;"
|
|
|
:disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0">批量下载数电票</el-button>
|
|
:disabled="$refs.invoiceTable && $refs.invoiceTable.getCheckboxRecords().length === 0">批量下载数电票</el-button>
|
|
|
|
|
|
|
|
|
|
|
|
@@ -417,6 +421,31 @@ export default {
|
|
|
this.$refs.invoiceListImport.init()
|
|
this.$refs.invoiceListImport.init()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 台账导入导出
|
|
|
|
|
+ ledgerImportExport() {
|
|
|
|
|
+ this.$refs.ledgerFileInput.click()
|
|
|
|
|
+ },
|
|
|
|
|
+ handleLedgerFileChange(event) {
|
|
|
|
|
+ const file = event.target.files[0]
|
|
|
|
|
+ if (!file) return
|
|
|
|
|
+
|
|
|
|
|
+ const formData = new FormData()
|
|
|
|
|
+ formData.append('file', file)
|
|
|
|
|
+
|
|
|
|
|
+ this.loading = true
|
|
|
|
|
+ this.financeInvoiceService.importLedger(formData).then((res) => {
|
|
|
|
|
+ this.$utils.downloadExcel(res, '评估公司台账_' + this.moment(new Date()).format('YYYY-MM-DD') + '.xlsx')
|
|
|
|
|
+ this.$message.success('台账导出成功')
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ }).catch((err) => {
|
|
|
|
|
+ this.$message.error('台账导入导出失败:' + (err.message || '未知错误'))
|
|
|
|
|
+ this.loading = false
|
|
|
|
|
+ }).finally(() => {
|
|
|
|
|
+ // 清空input,允许重复选择同一文件
|
|
|
|
|
+ event.target.value = ''
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+
|
|
|
handleImportError(data) {
|
|
handleImportError(data) {
|
|
|
console.log("父页面收到错误:", data);
|
|
console.log("父页面收到错误:", data);
|
|
|
|
|
|