feat(xumu): 新增理赔申请和贷款申请功能
- 添加理赔申请和贷款申请的路由、页面组件和相关逻辑 - 实现理赔申请和贷款申请的数据获取、表单提交和审核流程 - 优化耳标选择器组件,支持在不同场景下的使用 - 调整图片上传组件,增加只读模式和预览功能
This commit is contained in:
		
							
								
								
									
										35
									
								
								project/xumu/AppClaimApply/AppClaimApply.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										35
									
								
								project/xumu/AppClaimApply/AppClaimApply.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,35 @@ | ||||
| <script> | ||||
| import add from "./add.vue"; | ||||
| import list from "./list.vue"; | ||||
|  | ||||
| export default { | ||||
|   name: "AppClaimApply", | ||||
|   label: "理赔申请", | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     dict: Object, | ||||
|     permissions: Function | ||||
|   }, | ||||
|   computed: { | ||||
|     currentPage() { | ||||
|       let {hash} = this.$route | ||||
|       return ["#claim", "#add"].includes(hash) ? add : list | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.dict.load("auditStatus", "insureType", "insureStatus", "category", "variety") | ||||
|   }, | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <section class="AppClaimApply"> | ||||
|     <component :is="currentPage" v-bind="$props"/> | ||||
|   </section> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .AppClaimApply { | ||||
|   height: 100%; | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										145
									
								
								project/xumu/AppClaimApply/add.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										145
									
								
								project/xumu/AppClaimApply/add.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,145 @@ | ||||
| <script> | ||||
| import {mapState} from "vuex" | ||||
| import AiEartagPicker from "@project/xumu/components/AiEartagPicker.vue"; | ||||
|  | ||||
| const records = [ | ||||
|   {label: "序号", type: "index"}, | ||||
|   {label: "报案号", prop: "reportNo"}, | ||||
|   {label: "审批状态", prop: "auditStatus", dict: "auditStatus"}, | ||||
|   {label: "审批时间", prop: "auditTime"}, | ||||
|   {label: "审批人", prop: "auditName"}, | ||||
| ] | ||||
| export default { | ||||
|   name: "claimAdd", | ||||
|   components: {AiEartagPicker}, | ||||
|   props: { | ||||
|     instance: Function, | ||||
|     permissions: Function, | ||||
|     dict: Object | ||||
|   }, | ||||
|   data() { | ||||
|     return { | ||||
|       detail: {detailList: []}, | ||||
|       records | ||||
|     } | ||||
|   }, | ||||
|   computed: { | ||||
|     ...mapState(["user"]), | ||||
|     userinfo: v => v.user.info || {}, | ||||
|     pageTitle: v => { | ||||
|       const appName = v.$parent.menuName || v.$parent.$options.label | ||||
|       return v.isClaim ? `新增${appName}` : `${appName}详情` | ||||
|     }, | ||||
|     isClaim: v => v.$route.hash == "#claim", | ||||
|     formImages: v => [ | ||||
|       {label: "勘察报告书", prop: "surveyPicture", rules: {required: v.isClaim, message: '请上传 勘察报告书'}}, | ||||
|       {label: "无害化回执单", prop: "receiptPicture", rules: {required: v.isClaim, message: '请上传 无害化回执单'}}, | ||||
|     ], | ||||
|     columns: v => [ | ||||
|       {label: "序号", type: "index"}, | ||||
|       {label: "生物芯片耳标号", prop: "biochipEarNumber"}, | ||||
|       {label: "身长测量照片", prop: "heightPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "电子耳标照片", prop: "earNumberPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "防疫耳标照片", prop: "preventionPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "无害化处理照片", prop: "harmlessPicture", upload: {instance: v.instance, readonly: !v.isClaim, valueIsUrl: !0, limit: 1}}, | ||||
|       {label: "报案号", prop: "reportNo", hide: v.isClaim}, | ||||
|     ].filter(e => !e.hide), | ||||
|     selectedEartags: v => v.detail.list?.length || 0, | ||||
|   }, | ||||
|   methods: { | ||||
|     back(params = {}) { | ||||
|       this.$router.push(params) | ||||
|     }, | ||||
|     getDetail() { | ||||
|       const {id} = this.$route.query | ||||
|       return id && this.instance.post("/api/insurance/claim/apply/getInfo", null, {params: {orderNo: id}}).then(res => { | ||||
|         if (res?.data) { | ||||
|           const detail = res.data | ||||
|           return this.detail = {...detail} | ||||
|         } | ||||
|       }) | ||||
|     }, | ||||
|     submit() { | ||||
|       this.$refs.detail.validate().then(() => { | ||||
|         this.instance.post("/api/insurance/claim/apply/add", {...this.detail}).then(res => { | ||||
|           if (res?.code == '0') { | ||||
|             this.$message.success("提交成功!") | ||||
|             this.back() | ||||
|           } | ||||
|         }) | ||||
|       }) | ||||
|     } | ||||
|   }, | ||||
|   created() { | ||||
|     this.getDetail() | ||||
|   } | ||||
| } | ||||
| </script> | ||||
|  | ||||
| <template> | ||||
|   <ai-page :title="pageTitle" class="claimAdd" showBack content-string="blank"> | ||||
|     <el-form size="small" label-width="120px" :model="detail" ref="detail"> | ||||
|       <ai-card title="基础信息"> | ||||
|         <div class="grid"> | ||||
|           <el-form-item label="养殖场" prop="farmId"> | ||||
|             <b v-text="detail.farmName"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="承保公司" prop="companyId"> | ||||
|             <b v-text="detail.companyName"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="投保类型"> | ||||
|             <ai-input :value="dict.getLabel('insureType',detail.insureType)" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="保险产品" prop="productType"> | ||||
|             <b v-text="detail.productType"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="联系人"> | ||||
|             <ai-input v-model="detail.contacts" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|           <el-form-item label="联系电话"> | ||||
|             <ai-input v-model="detail.phone" :edit="!1"/> | ||||
|           </el-form-item> | ||||
|         </div> | ||||
|       </ai-card> | ||||
|       <ai-card title="投保对象"> | ||||
|         <template #right v-if="isClaim"> | ||||
|           <ai-eartag-picker @select="v=>detail.detailList=v" :instance="instance" | ||||
|                             :action="`/api/insurance/claim/apply/getClaimEarNumberList?orderNo=${detail.orderNo}`"> | ||||
|             <el-button type="text">选择</el-button> | ||||
|           </ai-eartag-picker> | ||||
|         </template> | ||||
|         <ai-highlight class="mar-b8 font-14" :content="`投保标的共${detail.insureNumber}只,已理赔标的共 @v 只`" color="red" :value="selectedEartags"/> | ||||
|         <ai-table :tableData="detail.detailList" :colConfigs="columns" :isShowPagination="!1" hideOptions/> | ||||
|       </ai-card> | ||||
|       <ai-card title="理赔材料" v-if="isClaim"> | ||||
|         <div class="font-12 mar-b8">只能上传JPG/PNG文件,且不超过2M,一次最多5张</div> | ||||
|         <el-form-item v-for="(img,i) in formImages" :key="i" v-bind="img"> | ||||
|           <ai-uploader v-model="detail[img.prop]" :instance="instance" value-is-url :limit="5"/> | ||||
|         </el-form-item> | ||||
|       </ai-card> | ||||
|       <ai-card title="理赔记录" v-else> | ||||
|         <ai-table :tableData="detail.list" :colConfigs="records" :isShowPagination="!1" hideOptions/> | ||||
|       </ai-card> | ||||
|     </el-form> | ||||
|     <div slot="footer"> | ||||
|       <template v-if="isClaim"> | ||||
|         <el-button type="primary" @click="submit(1)">提交</el-button> | ||||
|       </template> | ||||
|       <el-button @click="back">返回</el-button> | ||||
|     </div> | ||||
|   </ai-page> | ||||
| </template> | ||||
|  | ||||
| <style scoped lang="scss"> | ||||
| .claimAdd { | ||||
|   :deep(.el-form--label-top) { | ||||
|     .el-form-item__label { | ||||
|       width: 100% !important; | ||||
|     } | ||||
|  | ||||
|     .el-form-item__content { | ||||
|       margin-left: unset !important; | ||||
|     } | ||||
|   } | ||||
| } | ||||
| </style> | ||||
							
								
								
									
										123
									
								
								project/xumu/AppClaimApply/list.vue
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										123
									
								
								project/xumu/AppClaimApply/list.vue
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,123 @@ | ||||
| <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.status}` + e.auditStatus})) | ||||
|           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 v-model="search.beginDate" type="datetime" placeholder="开始日期" size="small"/> | ||||
|           <el-date-picker 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="['12'].includes(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> | ||||
		Reference in New Issue
	
	Block a user