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 { ...@@ -49,7 +49,11 @@ export default {
const file = event.target.files[0] const file = event.target.files[0]
if (!file) return if (!file) return
if (file.name.substring(file.name.lastIndexOf('.')).toLowerCase() !== '.xlsx') { 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 = '' this.$refs.fileInput.value = ''
return return
} }
...@@ -67,7 +71,13 @@ export default { ...@@ -67,7 +71,13 @@ export default {
this.result = { totalCount: 0, successCount: 0, failCount: 0, batchId: '' } this.result = { totalCount: 0, successCount: 0, failCount: 0, batchId: '' }
}, },
startImport() { 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() const reader = new FileReader()
this.importing = true this.importing = true
reader.readAsDataURL(this.file) reader.readAsDataURL(this.file)
...@@ -78,7 +88,11 @@ export default { ...@@ -78,7 +88,11 @@ export default {
.batchImportGHClaims({ file: `${fileType}@${base64}` }) .batchImportGHClaims({ file: `${fileType}@${base64}` })
.then(res => { .then(res => {
if (res.code !== 0 && res.code !== '0') { if (res.code !== 0 && res.code !== '0') {
this.$message.error(res.message || '导入失败,请检查文件后重试') this.$message({
message: res.message || '导入失败,请检查文件后重试',
type: 'error',
customClass: 'message-Z-zinde'
})
return return
} }
this.setResult(res.data || {}) this.setResult(res.data || {})
...@@ -91,7 +105,11 @@ export default { ...@@ -91,7 +105,11 @@ export default {
} }
reader.onerror = () => { reader.onerror = () => {
this.importing = false this.importing = false
this.$message.error('文件读取失败,请重新上传') this.$message({
message: '文件读取失败,请重新上传',
type: 'error',
customClass: 'message-Z-zinde'
})
} }
}, },
setResult(res) { setResult(res) {
...@@ -106,14 +124,32 @@ export default { ...@@ -106,14 +124,32 @@ export default {
this.hasResult = true this.hasResult = true
}, },
downloadErrorFile() { 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 this.$apis.claims
.exportBatchImportError({ batchId: this.result.batchId }) .exportBatchImportError({ batchId: this.result.batchId })
.then(res => { .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 data = res.data || {}
const fileUrl = typeof data === 'string' ? data : data.fileUrl || data.url || data.downloadUrl || data.exportUrl || '' 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 window.location.href = fileUrl
}) })
.catch(() => {}) .catch(() => {})
......
...@@ -27,7 +27,6 @@ ...@@ -27,7 +27,6 @@
<span>核赔订单列表</span> <span>核赔订单列表</span>
<div class="table_top_btn flex_sc"> <div class="table_top_btn flex_sc">
<GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton> <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="handleConfig">跟进人配置</GLButton>
<GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton> <GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton>
<el-button plain size="small" @click="exportList">导出</el-button> <el-button plain size="small" @click="exportList">导出</el-button>
...@@ -110,12 +109,10 @@ ...@@ -110,12 +109,10 @@
</GLDialog> </GLDialog>
<!-- 跟进人配置 --> <!-- 跟进人配置 -->
<follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></follow-pop> <follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></follow-pop>
<batch-import :visible.sync="importVisible" @success="handleImportSuccess"></batch-import>
</div> </div>
</template> </template>
<script> <script>
import followPop from './components/followPop' import followPop from './components/followPop'
import batchImport from './components/batchImport'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
//服务状态:0-待提交国任 1-待支付 2-校验不通过 3-支付成功 4-支付失败 //服务状态:0-待提交国任 1-待支付 2-校验不通过 3-支付成功 4-支付失败
const statusList = [ const statusList = [
...@@ -264,7 +261,6 @@ export default { ...@@ -264,7 +261,6 @@ export default {
data() { data() {
return { return {
isFollowSync: false, isFollowSync: false,
importVisible: false,
signImage: '', signImage: '',
showUpload: false, showUpload: false,
delReasonObj: { delReasonObj: {
...@@ -797,8 +793,7 @@ export default { ...@@ -797,8 +793,7 @@ export default {
} }
}, },
components: { components: {
followPop, followPop
batchImport
}, },
created() { created() {
this.getClaimsCount() this.getClaimsCount()
...@@ -815,12 +810,6 @@ export default { ...@@ -815,12 +810,6 @@ export default {
window.sessionStorage.setItem('ghPageInfo', JSON.stringify(ghPageInfo)) window.sessionStorage.setItem('ghPageInfo', JSON.stringify(ghPageInfo))
}, },
methods: { methods: {
handleImport() {
this.importVisible = true
},
handleImportSuccess() {
this.handleOkFn()
},
getFollowPersonList() { getFollowPersonList() {
this.$apis.claims this.$apis.claims
.getFollowPersonList({ .getFollowPersonList({
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
<span>核赔订单列表</span> <span>核赔订单列表</span>
<div class="table_top_btn flex_sc"> <div class="table_top_btn flex_sc">
<GLButton size="small" fn="订单详情" type="primary" @click="handleEdit(1)">新增核赔</GLButton> <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="handleConfig">跟进人配置</GLButton>
<GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton> <GLButton size="small" plain fn="批量审核" type="primary" @click="batchAudit">批量审核通过</GLButton>
<el-button plain size="small" @click="exportList">导出</el-button> <el-button plain size="small" @click="exportList">导出</el-button>
...@@ -41,10 +42,12 @@ ...@@ -41,10 +42,12 @@
</div> </div>
<!-- 跟进人配置 --> <!-- 跟进人配置 -->
<dj-follow-pop ref="followRef" @handleClose="handleClose" :isFollowSync="isFollowSync" v-if="isFollowSync"></dj-follow-pop> <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> </div>
</template> </template>
<script> <script>
import djFollowPop from './components/djFollowPop' import djFollowPop from './components/djFollowPop'
import batchImport from './components/batchImport'
import * as dayjs from 'dayjs' import * as dayjs from 'dayjs'
const statusList = [ const statusList = [
// { // {
...@@ -632,11 +635,13 @@ export default { ...@@ -632,11 +635,13 @@ export default {
color: '#C6C6C6' color: '#C6C6C6'
} }
}, },
isFollowSync: false isFollowSync: false,
importVisible: false
} }
}, },
components: { components: {
djFollowPop djFollowPop,
batchImport
}, },
created() { created() {
this.diffHost() this.diffHost()
...@@ -651,6 +656,12 @@ export default { ...@@ -651,6 +656,12 @@ export default {
window.sessionStorage.setItem('djPageInfo', JSON.stringify(djPageInfo)) window.sessionStorage.setItem('djPageInfo', JSON.stringify(djPageInfo))
}, },
methods: { methods: {
handleImport() {
this.importVisible = true
},
handleImportSuccess() {
this.handleOkFn()
},
getClaimsCount() { getClaimsCount() {
this.$apis.claims.getclaimsCount({}).then(res => { this.$apis.claims.getclaimsCount({}).then(res => {
this.orderCount = 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!