Commit 31b4bc6f by chenwq

```

feat(claims): 添加核赔订单导入功能

- 在核赔订单列表页面添加导入按钮
- 新增batch-import组件用于处理批量导入功能
- 实现Excel文件上传验证(仅支持xlsx格式)
- 添加导入过程中的错误提示和成功反馈
- 支持错误文件下载功能

fix(claims): 统一消息提示样式并修复导入组件显示问题

- 将所有$message.error调用替换为统一的消息提示配置
- 添加customClass 'message-Z-zinde' 以保持样式一致性
- 修复批量导入组件在不同环境下的显示问题
- 优化错误处理逻辑,提供更清晰的用户反馈

refactor(claims): 调整页面结构和组件引用

- 从ghIndex.vue中移除导入相关代码和组件引用
- 在index.vue中添加批量导入组件和相关方法
- 整理组件注册和数据属性定义
- 优化页面布局和按钮配置
```
1 parent 200c6fb0
......@@ -49,7 +49,11 @@ export default {
const file = event.target.files[0]
if (!file) return
if (file.name.substring(file.name.lastIndexOf('.')).toLowerCase() !== '.xlsx') {
this.$message.error('仅支持上传xlsx格式的文件')
this.$message({
message: '仅支持上传xlsx格式的文件',
type: 'error',
customClass: 'message-Z-zinde'
})
this.$refs.fileInput.value = ''
return
}
......@@ -67,7 +71,13 @@ export default {
this.result = { totalCount: 0, successCount: 0, failCount: 0, batchId: '' }
},
startImport() {
if (!this.file.size) return this.$message.error('请上传文件')
if (!this.file.size) {
return this.$message({
message: '请上传文件',
type: 'error',
customClass: 'message-Z-zinde'
})
}
const reader = new FileReader()
this.importing = true
reader.readAsDataURL(this.file)
......@@ -78,7 +88,11 @@ export default {
.batchImportGHClaims({ file: `${fileType}@${base64}` })
.then(res => {
if (res.code !== 0 && res.code !== '0') {
this.$message.error(res.message || '导入失败,请检查文件后重试')
this.$message({
message: res.message || '导入失败,请检查文件后重试',
type: 'error',
customClass: 'message-Z-zinde'
})
return
}
this.setResult(res.data || {})
......@@ -91,7 +105,11 @@ export default {
}
reader.onerror = () => {
this.importing = false
this.$message.error('文件读取失败,请重新上传')
this.$message({
message: '文件读取失败,请重新上传',
type: 'error',
customClass: 'message-Z-zinde'
})
}
},
setResult(res) {
......@@ -106,14 +124,32 @@ export default {
this.hasResult = true
},
downloadErrorFile() {
if (!this.result.batchId) return this.$message.error('未获取到导入批次,请联系管理员')
if (!this.result.batchId) {
return this.$message({
message: '未获取到导入批次,请联系管理员',
type: 'error',
customClass: 'message-Z-zinde'
})
}
this.$apis.claims
.exportBatchImportError({ batchId: this.result.batchId })
.then(res => {
if (res.code !== 0 && res.code !== '0') return this.$message.error(res.message || '错误文件导出失败')
if (res.code !== 0 && res.code !== '0') {
return this.$message({
message: res.message || '错误文件导出失败',
type: 'error',
customClass: 'message-Z-zinde'
})
}
const data = res.data || {}
const fileUrl = typeof data === 'string' ? data : data.fileUrl || data.url || data.downloadUrl || data.exportUrl || ''
if (!fileUrl) return this.$message.error('未获取到错误文件,请联系管理员')
if (!fileUrl) {
return this.$message({
message: '未获取到错误文件,请联系管理员',
type: 'error',
customClass: 'message-Z-zinde'
})
}
window.location.href = fileUrl
})
.catch(() => {})
......
......@@ -27,7 +27,6 @@
<span>核赔订单列表</span>
<div class="table_top_btn flex_sc">
<GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton>
<GLButton size="small" plain fn="导入" type="primary" @click="handleImport">导入</GLButton>
<GLButton size="small" plain fn="跟进人配置" type="primary" @click="handleConfig">跟进人配置</GLButton>
<GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton>
<el-button plain size="small" @click="exportList">导出</el-button>
......@@ -110,12 +109,10 @@
</GLDialog>
<!-- 跟进人配置 -->
<follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></follow-pop>
<batch-import :visible.sync="importVisible" @success="handleImportSuccess"></batch-import>
</div>
</template>
<script>
import followPop from './components/followPop'
import batchImport from './components/batchImport'
import * as dayjs from 'dayjs'
//服务状态:0-待提交国任 1-待支付 2-校验不通过 3-支付成功 4-支付失败
const statusList = [
......@@ -264,7 +261,6 @@ export default {
data() {
return {
isFollowSync: false,
importVisible: false,
signImage: '',
showUpload: false,
delReasonObj: {
......@@ -797,8 +793,7 @@ export default {
}
},
components: {
followPop,
batchImport
followPop
},
created() {
this.getClaimsCount()
......@@ -815,12 +810,6 @@ export default {
window.sessionStorage.setItem('ghPageInfo', JSON.stringify(ghPageInfo))
},
methods: {
handleImport() {
this.importVisible = true
},
handleImportSuccess() {
this.handleOkFn()
},
getFollowPersonList() {
this.$apis.claims
.getFollowPersonList({
......
......@@ -20,6 +20,7 @@
<span>核赔订单列表</span>
<div class="table_top_btn flex_sc">
<GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton>
<GLButton size="small" plain fn="导入" type="primary" @click="handleImport">导入</GLButton>
<GLButton size="small" plain fn="跟进人配置" type="primary" @click="handleConfig">跟进人配置</GLButton>
<GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton>
<el-button plain size="small" @click="exportList">导出</el-button>
......@@ -41,10 +42,12 @@
</div>
<!-- 跟进人配置 -->
<dj-follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></dj-follow-pop>
<batch-import :visible.sync="importVisible" @success="handleImportSuccess"></batch-import>
</div>
</template>
<script>
import djFollowPop from './components/djFollowPop'
import batchImport from './components/batchImport'
import * as dayjs from 'dayjs'
const statusList = [
// {
......@@ -632,11 +635,13 @@ export default {
color: '#C6C6C6'
}
},
isFollowSync: false
isFollowSync: false,
importVisible: false
}
},
components: {
djFollowPop
djFollowPop,
batchImport
},
created() {
this.diffHost()
......@@ -651,6 +656,12 @@ export default {
window.sessionStorage.setItem('djPageInfo', JSON.stringify(djPageInfo))
},
methods: {
handleImport() {
this.importVisible = true
},
handleImportSuccess() {
this.handleOkFn()
},
getClaimsCount() {
this.$apis.claims.getclaimsCount({}).then(res => {
this.orderCount = res
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!