|
@@ -156,7 +156,6 @@
|
|
|
|
|
|
|
|
<el-button v-if="hasPermission('finance:invoice:ledgerImportExport')" type="success"
|
|
<el-button v-if="hasPermission('finance:invoice:ledgerImportExport')" type="success"
|
|
|
@click="ledgerImportExport()" plain style="margin-left: 10px;">台账导入导出</el-button>
|
|
@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;"
|
|
<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>
|
|
@@ -313,6 +312,31 @@
|
|
|
<InvoiceListImport ref="invoiceListImport" @refreshDataList="refreshList"></InvoiceListImport>
|
|
<InvoiceListImport ref="invoiceListImport" @refreshDataList="refreshList"></InvoiceListImport>
|
|
|
<InvoiceListImport ref="invoiceListImport" @refreshDataList="refreshList" @import-error="handleImportError"></InvoiceListImport>
|
|
<InvoiceListImport ref="invoiceListImport" @refreshDataList="refreshList" @import-error="handleImportError"></InvoiceListImport>
|
|
|
|
|
|
|
|
|
|
+ <!-- 台账导入导出对话框 -->
|
|
|
|
|
+ <el-dialog v-model="ledgerImportDialogVisible" title="台账导入导出" width="500" :close-on-click-modal="false">
|
|
|
|
|
+ <el-upload
|
|
|
|
|
+ ref="ledgerUpload"
|
|
|
|
|
+ drag
|
|
|
|
|
+ :auto-upload="false"
|
|
|
|
|
+ :on-change="handleLedgerFileChange"
|
|
|
|
|
+ :on-remove="handleLedgerFileRemove"
|
|
|
|
|
+ :limit="1"
|
|
|
|
|
+ accept=".xls,.xlsx"
|
|
|
|
|
+ :file-list="ledgerFileList"
|
|
|
|
|
+ style="text-align: center;"
|
|
|
|
|
+ >
|
|
|
|
|
+ <i class="el-icon-upload" style="font-size: 48px; color: #909399;"></i>
|
|
|
|
|
+ <div class="el-upload__text">将文件拖到此处,或<em>点击上传</em></div>
|
|
|
|
|
+ <template #tip>
|
|
|
|
|
+ <div class="el-upload__tip" style="color: #909399;">仅支持 .xls 和 .xlsx 格式的Excel文件</div>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-upload>
|
|
|
|
|
+ <template #footer>
|
|
|
|
|
+ <el-button @click="ledgerImportDialogVisible = false">取消</el-button>
|
|
|
|
|
+ <el-button type="primary" @click="submitLedgerImport" :loading="ledgerImportLoading" :disabled="ledgerFileList.length === 0">确认导入</el-button>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-dialog>
|
|
|
|
|
+
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -372,7 +396,10 @@ export default {
|
|
|
processDefinitionInvalidId: '',
|
|
processDefinitionInvalidId: '',
|
|
|
procDefInvalidKey: '',
|
|
procDefInvalidKey: '',
|
|
|
dingNoticeEnabled: "",
|
|
dingNoticeEnabled: "",
|
|
|
- isInitCompleted: false // 初始化完成标识
|
|
|
|
|
|
|
+ isInitCompleted: false, // 初始化完成标识
|
|
|
|
|
+ ledgerImportDialogVisible: false,
|
|
|
|
|
+ ledgerFileList: [],
|
|
|
|
|
+ ledgerImportLoading: false
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
financeInvoiceService: null,
|
|
financeInvoiceService: null,
|
|
@@ -408,11 +435,11 @@ export default {
|
|
|
const $toolbar = this.$refs.toolbarRef;
|
|
const $toolbar = this.$refs.toolbarRef;
|
|
|
$table.connect($toolbar);
|
|
$table.connect($toolbar);
|
|
|
});
|
|
});
|
|
|
- this.getDingNoticeDictValue()
|
|
|
|
|
|
|
+ //this.getDingNoticeDictValue()
|
|
|
this.refreshList();
|
|
this.refreshList();
|
|
|
},
|
|
},
|
|
|
activated() {
|
|
activated() {
|
|
|
- this.getDingNoticeDictValue()
|
|
|
|
|
|
|
+ //this.getDingNoticeDictValue()
|
|
|
this.refreshList()
|
|
this.refreshList()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
@@ -421,28 +448,47 @@ export default {
|
|
|
this.$refs.invoiceListImport.init()
|
|
this.$refs.invoiceListImport.init()
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
- // 台账导入导出
|
|
|
|
|
|
|
+ // 台账导入导出 - 打开弹窗
|
|
|
ledgerImportExport() {
|
|
ledgerImportExport() {
|
|
|
- this.$refs.ledgerFileInput.click()
|
|
|
|
|
|
|
+ this.ledgerImportDialogVisible = true
|
|
|
|
|
+ this.ledgerFileList = []
|
|
|
},
|
|
},
|
|
|
- handleLedgerFileChange(event) {
|
|
|
|
|
- const file = event.target.files[0]
|
|
|
|
|
- if (!file) return
|
|
|
|
|
-
|
|
|
|
|
|
|
+ // 台账导入导出 - 文件选择
|
|
|
|
|
+ handleLedgerFileChange(file) {
|
|
|
|
|
+ const fileName = file.name.toLowerCase()
|
|
|
|
|
+ if (!fileName.endsWith('.xls') && !fileName.endsWith('.xlsx')) {
|
|
|
|
|
+ this.$message.error('仅支持 .xls 和 .xlsx 格式的Excel文件')
|
|
|
|
|
+ this.ledgerFileList = []
|
|
|
|
|
+ this.$refs.ledgerUpload.clearFiles()
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ this.ledgerFileList = [file]
|
|
|
|
|
+ },
|
|
|
|
|
+ // 台账导入导出 - 文件移除
|
|
|
|
|
+ handleLedgerFileRemove() {
|
|
|
|
|
+ this.ledgerFileList = []
|
|
|
|
|
+ },
|
|
|
|
|
+ // 台账导入导出 - 确认提交
|
|
|
|
|
+ submitLedgerImport() {
|
|
|
|
|
+ if (this.ledgerFileList.length === 0) {
|
|
|
|
|
+ this.$message.warning('请先选择文件')
|
|
|
|
|
+ return
|
|
|
|
|
+ }
|
|
|
|
|
+ const file = this.ledgerFileList[0].raw
|
|
|
const formData = new FormData()
|
|
const formData = new FormData()
|
|
|
formData.append('file', file)
|
|
formData.append('file', file)
|
|
|
|
|
|
|
|
- this.loading = true
|
|
|
|
|
|
|
+ this.ledgerImportLoading = true
|
|
|
this.financeInvoiceService.importLedger(formData).then((res) => {
|
|
this.financeInvoiceService.importLedger(formData).then((res) => {
|
|
|
|
|
+ this.ledgerImportLoading = false
|
|
|
|
|
+ this.ledgerImportDialogVisible = false
|
|
|
|
|
+ this.ledgerFileList = []
|
|
|
|
|
+ this.$refs.ledgerUpload.clearFiles()
|
|
|
this.$utils.downloadExcel(res, '评估公司台账_' + this.moment(new Date()).format('YYYY-MM-DD') + '.xlsx')
|
|
this.$utils.downloadExcel(res, '评估公司台账_' + this.moment(new Date()).format('YYYY-MM-DD') + '.xlsx')
|
|
|
this.$message.success('台账导出成功')
|
|
this.$message.success('台账导出成功')
|
|
|
- this.loading = false
|
|
|
|
|
}).catch((err) => {
|
|
}).catch((err) => {
|
|
|
|
|
+ this.ledgerImportLoading = false
|
|
|
this.$message.error('台账导入导出失败:' + (err.message || '未知错误'))
|
|
this.$message.error('台账导入导出失败:' + (err.message || '未知错误'))
|
|
|
- this.loading = false
|
|
|
|
|
- }).finally(() => {
|
|
|
|
|
- // 清空input,允许重复选择同一文件
|
|
|
|
|
- event.target.value = ''
|
|
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -1155,7 +1201,7 @@ export default {
|
|
|
this.$message.error('操作失败,请重试')
|
|
this.$message.error('操作失败,请重试')
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
- getDingNoticeDictValue() {
|
|
|
|
|
|
|
+ /*getDingNoticeDictValue() {
|
|
|
let params = {
|
|
let params = {
|
|
|
label: '是否接收钉钉通知',
|
|
label: '是否接收钉钉通知',
|
|
|
type: "ding_notice_enabled"
|
|
type: "ding_notice_enabled"
|
|
@@ -1166,7 +1212,7 @@ export default {
|
|
|
}).catch(() => {
|
|
}).catch(() => {
|
|
|
this.$message.error('操作失败,请重试')
|
|
this.$message.error('操作失败,请重试')
|
|
|
})
|
|
})
|
|
|
- }
|
|
|
|
|
|
|
+ }*/
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
</script>
|
|
</script>
|