Files
dvcp_v2_webapp/project/xumu/AppClaimApply/list.vue
aixianling 4051b31101 refactor(xumu): 优化理赔申请列表展示逻辑
- 根据 remarks 字段判断是否可申请理赔,而非拼接 status 和 auditStatus
- 简化 permit 字段的使用,直接用于判断是否显示理赔按钮
2025-01-16 10:49:13 +08:00

124 lines
4.6 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<script>
import {mapState} from "vuex"
const columns = [
{label: "序号", type: "index"},
{label: "投保单号", prop: "orderNo"},
{label: "所属养殖户", prop: "applyName"},
{label: "所属养殖场", prop: "farmName"},
{label: "投保数量(头)", prop: "insureNumber", width: 120},
{label: "投保状态", prop: "status", width: 160, dict: "insureStatus"},
{label: "投保类型", prop: "insureType", dict: "insureType"},
{label: "投保时间", prop: "createTime"},
{label: "可理赔数量", prop: "unpaidClaimNumber", width: 120},
{label: "说明", prop: "remarks"},
]
export default {
name: "claimList",
props: {
instance: Function,
dict: Object,
permissions: Function
},
data() {
return {
columns,
tableData: [],
page: {pageNum: 1, pageSize: 10, total: 0},
search: {},
dialog: false,
form: {}
}
},
computed: {
...mapState(['user']),
userinfo: v => v.user.info || {},
pageTitle: v => v.$parent.menuName || v.$parent.$options.label
},
watch: {
search: {
deep: true,
handler() {
this.page.pageNum = 1
this.getTableData()
}
}
},
methods: {
getTableData() {
this.instance.post("/api/insurance/claim/apply/page", {...this.page, ...this.search}).then(res => {
if (res?.data) {
this.tableData = res.data?.records.map(e => ({...e, permit: e.remarks == "可申请理赔"}))
this.page.total = res.data.total
}
})
},
},
created() {
this.getTableData()
}
}
</script>
<template>
<ai-page class="claimList" :title="pageTitle">
<ai-search-bar>
<template #left>
<ai-input placeholder="投保订单号" v-model="search.orderNo"/>
<ai-select placeholder="全部投保类型" v-model="search.insureType" dict="insureType"/>
<ai-search label="投保日期">
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/>
<el-date-picker value-format="yyyy-MM-dd HH:mm:ss" v-model="search.endDate" type="datetime" placeholder="结束日期" size="small"/>
</ai-search>
<ai-input placeholder="养殖户" v-model="search.applyName"/>
<ai-input placeholder="养殖场" v-model="search.farmName"/>
</template>
</ai-search-bar>
<ai-search-bar>
<template #left>
<ai-download :instance="instance" url="/api/insurance/claim/apply/export" :params="{...search,...page}" :fileName="`${pageTitle}导出表-${Date.now()}`"/>
</template>
</ai-search-bar>
<ai-table :tableData="tableData" :colConfigs="columns" :dict="dict" @getList="getTableData"
:total="page.total" :current.sync="page.pageNum" :size.sync="page.pageSize">
<el-table-column slot="options" label="操作" fixed="right" align="center">
<template slot-scope="{row}">
<div class="table-options">
<template v-if="row.permit">
<el-button type="text" @click="dialog=true,$set(form,'id',row.orderNo)">理赔</el-button>
</template>
<el-button v-else type="text" @click="$router.push({hash:'#add',query:{id:row.orderNo}})">查看</el-button>
</div>
</template>
</el-table-column>
</ai-table>
<ai-dialog v-model="dialog" title="理赔须知" @closed="form={}">
<el-form size="small" label-position="top" :mode="form" ref="form">
<el-form-item label="如遇一下情况进行赔付:">
1自然灾害如暴雨洪水台风冰雹雷击暴风雪等导致的肉牛死亡或伤残<br/>
2疾病与疫病:包括但不限于口蹄疫布鲁氏菌病炭疽牛结核病等对肉牛生命安全造成威胁的疾病<br/>
3意外事故:如火灾爆炸触电盗窃走失等<br/>
4强制扑杀:由于政府政策或疫情控制需要对肉牛进行的强制扑杀
</el-form-item>
<el-form-item class="flex center">
<el-checkbox v-model="form.agree">本人阅读并知晓理赔须知承认上传资料的真实性</el-checkbox>
</el-form-item>
</el-form>
<template #foot>
<el-button @click="$router.push({hash:'#claim',query:{id:form.id}})" type="primary" :disabled="!form.agree">符合要求立即申请</el-button>
<el-button @click="dialog=false">取消</el-button>
</template>
</ai-dialog>
</ai-page>
</template>
<style scoped lang="scss">
.claimList {
height: 100%;
.deleteBtn {
color: $errorColor;
}
}
</style>