|
@@ -2,7 +2,7 @@
|
|
|
import { Search } from '@element-plus/icons-vue'
|
|
|
import {useRouter,useRoute} from 'vue-router'
|
|
|
import {getServiceList,getRegisterList,updateRegisterStatus,
|
|
|
- registerDelete,registerListExport} from '@/api/financialMana'
|
|
|
+ registerDelete,registerListExport,importDataApi} from '@/api/financialMana'
|
|
|
import {downloadByFlow} from '@/utils/common-methods'
|
|
|
|
|
|
const router = useRouter()
|
|
@@ -48,7 +48,8 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
|
|
|
contract_register_id:'',
|
|
|
contract_status:''
|
|
|
},
|
|
|
- currentStatusRow:{}
|
|
|
+ currentStatusRow:{},
|
|
|
+ importLoading:false
|
|
|
})
|
|
|
|
|
|
// 监听
|
|
@@ -113,6 +114,30 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
|
|
|
downloadByFlow(res,'xlsx','财务列表')
|
|
|
})
|
|
|
}
|
|
|
+
|
|
|
+ // 导入数据
|
|
|
+ const importData=(e)=>{
|
|
|
+ if(financial.importLoading){
|
|
|
+ ElMessage.warning('正在导入中,请勿重复导入')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ let {file}=e
|
|
|
+ if(!file.name.endsWith('xlsx')){
|
|
|
+ ElMessage.warning('上传你的文件不为.xlxs结尾')
|
|
|
+ return
|
|
|
+ }
|
|
|
+ financial.importLoading=true
|
|
|
+ let formData = new FormData()
|
|
|
+ formData.append('File',file)
|
|
|
+ importDataApi(formData).then(res=>{
|
|
|
+ ElMessage.success('导入成功')
|
|
|
+ searchFinancial()
|
|
|
+ }).finally(()=>{
|
|
|
+ financial.importLoading=false
|
|
|
+ })
|
|
|
+ }
|
|
|
+
|
|
|
+
|
|
|
// 显示开票详情
|
|
|
const invoiceDetail=(row)=>{
|
|
|
// console.log(row);
|
|
@@ -201,7 +226,18 @@ const statusArray=[{id:1,label:"进行中"},{id:2,label:"已完成"}]
|
|
|
<div class="financial-top-option-zone">
|
|
|
<el-button type="primary" size="large" style="width: 130px;margin-right: 30px;" v-permission="'financial:list:complianceAdd'"
|
|
|
@click="registration('compliance')">合规登记</el-button>
|
|
|
- <el-button @click="exportData" size="large" style="width: 130px;margin-left: 0;" >导出</el-button>
|
|
|
+ <el-button @click="exportData" size="large" style="width: 130px;margin: 0 30px 0 0;" >导出</el-button>
|
|
|
+ <el-upload
|
|
|
+ class="upload-demo"
|
|
|
+ accept=".xlsx"
|
|
|
+ :show-file-list="false"
|
|
|
+ :http-request="importData"
|
|
|
+ v-permission="'financial:list:complianceImport'"
|
|
|
+ >
|
|
|
+ <el-button size="large" :loading="financial.importLoading"
|
|
|
+ style="width: 130px;margin-left: 0;" >导入</el-button>
|
|
|
+ </el-upload>
|
|
|
+
|
|
|
</div>
|
|
|
<div class="financial-table-zone">
|
|
|
<!-- 表格 -->
|