|
|
@@ -111,6 +111,8 @@
|
|
|
<template #buttons>
|
|
|
<el-button v-if="hasPermission('zsReimbursement:info:add')" type="primary" icon="el-icon-plus"
|
|
|
@click="add()">新建</el-button>
|
|
|
+ <el-button v-if="hasPermission('zsReimbursement:info:import')" type="info" icon="el-icon-upload"
|
|
|
+ @click="openImportDialog()">导入</el-button>
|
|
|
<el-button v-if="hasPermission('zsReimbursement:info:del')" type="danger" icon="el-icon-delete"
|
|
|
@click="del()" :disabled="$refs.infoTable && $refs.infoTable.getCheckboxRecords().length === 0"
|
|
|
plain>删除</el-button>
|
|
|
@@ -277,6 +279,7 @@
|
|
|
<ContractNameForm ref="contractNameForm"></ContractNameForm>
|
|
|
<user-select1 ref="userSelect1" @doSubmit="selectUser1"></user-select1>
|
|
|
<user-select2 ref="userSelect2" @doSubmit="selectUser2"></user-select2>
|
|
|
+ <ImportDialog ref="importDialog" @refreshDataList="refreshList" @import-error="handleImportError"></ImportDialog>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -305,6 +308,7 @@ import NewInfoUpdateForm from "./NewInfoUpdateForm";
|
|
|
|
|
|
import UserSelect1 from '@/views/utils/UserTreeSelect'
|
|
|
import UserSelect2 from '@/views/utils/UserTreeSelect'
|
|
|
+import ImportDialog from './ImportDialog'
|
|
|
import dayjs from 'dayjs';
|
|
|
export default {
|
|
|
data() {
|
|
|
@@ -395,6 +399,7 @@ export default {
|
|
|
NewInfoUpdateForm,
|
|
|
UserSelect1,
|
|
|
UserSelect2,
|
|
|
+ ImportDialog,
|
|
|
},
|
|
|
mounted() {
|
|
|
this.$nextTick(() => {
|
|
|
@@ -420,6 +425,31 @@ export default {
|
|
|
}
|
|
|
},
|
|
|
methods: {
|
|
|
+ // 打开导入弹窗
|
|
|
+ openImportDialog() {
|
|
|
+ this.$refs.importDialog.init()
|
|
|
+ },
|
|
|
+ // 导入错误处理:提示下载错误文件
|
|
|
+ handleImportError(data) {
|
|
|
+ this.$nextTick(async () => {
|
|
|
+ try {
|
|
|
+ await this.$confirm('导入数据存在问题,是否下载错误详情文件?', '提示', {
|
|
|
+ confirmButtonText: '是',
|
|
|
+ cancelButtonText: '否',
|
|
|
+ type: 'warning',
|
|
|
+ distinguishCancelAndClose: true
|
|
|
+ });
|
|
|
+ this.reimbursementService.downloadImportError(data.errorFilePath).then(res => {
|
|
|
+ this.$utils.downloadExcel(res, '中审报销导入错误结果.xlsx')
|
|
|
+ this.$message.success('文件下载成功!')
|
|
|
+ }).catch(err => {
|
|
|
+ this.$message.error('下载失败')
|
|
|
+ })
|
|
|
+ } catch (err) {
|
|
|
+ // 用户取消
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 判断时间
|
|
|
isNewVersion(row) {
|
|
|
let newStartDate = this.$dictUtils.getDictLabel("new_version_reimbursement_date", '1', '-')
|