|
@@ -5,8 +5,8 @@
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
- * @typedef {import('@/api/claim/index').ClaimItem} ClaimItem - 理赔申请数据项
|
|
|
|
|
- * @typedef {import('@/api/claim/index').ClaimQueryParams} ClaimQueryParams - 理赔查询参数
|
|
|
|
|
|
|
+ * @typedef {import('@/api/types/claim-search').ClaimMainRecord} ClaimItem - 理赔申请数据项(综合查询主表)
|
|
|
|
|
+ * @typedef {import('@/api/types/claim-search').ClaimSearchComprehensiveParams} ClaimQueryParams - 理赔查询参数(以综合查询接口为准)
|
|
|
* @typedef {import('@/api/claim/index').ClaimAuditItem} ClaimAuditItem - 审核记录数据项
|
|
* @typedef {import('@/api/claim/index').ClaimAuditItem} ClaimAuditItem - 审核记录数据项
|
|
|
* @typedef {import('@/api/claim/index').ClaimAttachmentItem} ClaimAttachmentItem - 附件信息
|
|
* @typedef {import('@/api/claim/index').ClaimAttachmentItem} ClaimAttachmentItem - 附件信息
|
|
|
*/
|
|
*/
|
|
@@ -63,7 +63,8 @@
|
|
|
* @property {Array<Object>} column - 列配置
|
|
* @property {Array<Object>} column - 列配置
|
|
|
*/
|
|
*/
|
|
|
|
|
|
|
|
-import { getClaimList, getClaimDetail, getClaimAttachments, getClaimAuditList, addClaimAudit, updateClaimAudit, removeClaimAudit } from '@/api/claim/index'
|
|
|
|
|
|
|
+import { getClaimSearchComprehensive } from '@/api/claimSearch'
|
|
|
|
|
+import { getClaimDetail, getClaimAttachments, getClaimAuditList, addClaimAudit, updateClaimAudit, removeClaimAudit } from '@/api/claim/index'
|
|
|
import { formatFileSize } from '@/util/util'
|
|
import { formatFileSize } from '@/util/util'
|
|
|
import { mapGetters } from 'vuex'
|
|
import { mapGetters } from 'vuex'
|
|
|
import {
|
|
import {
|
|
@@ -208,12 +209,12 @@ export default {
|
|
|
{
|
|
{
|
|
|
label: '来源方名称',
|
|
label: '来源方名称',
|
|
|
prop: 'sourceName',
|
|
prop: 'sourceName',
|
|
|
- search: true
|
|
|
|
|
|
|
+ search: false
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '来源编码',
|
|
label: '来源编码',
|
|
|
prop: 'sourceCode',
|
|
prop: 'sourceCode',
|
|
|
- search: true
|
|
|
|
|
|
|
+ search: false
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '联系人',
|
|
label: '联系人',
|
|
@@ -232,11 +233,17 @@ export default {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '规格型号',
|
|
label: '规格型号',
|
|
|
- prop: 'tyreSpecs'
|
|
|
|
|
|
|
+ prop: 'tyreSpecs',
|
|
|
|
|
+ search: true
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '购买日期',
|
|
label: '购买日期',
|
|
|
prop: 'purchaseDate',
|
|
prop: 'purchaseDate',
|
|
|
|
|
+ type: 'datetime',
|
|
|
|
|
+ format: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
|
+ valueFormat: 'yyyy-MM-dd HH:mm:ss',
|
|
|
|
|
+ search: true,
|
|
|
|
|
+ searchRange: true,
|
|
|
formatter: function(row, value) {
|
|
formatter: function(row, value) {
|
|
|
if (!value || typeof value !== 'string') return value || ''
|
|
if (!value || typeof value !== 'string') return value || ''
|
|
|
return value.substring(0, 10)
|
|
return value.substring(0, 10)
|
|
@@ -252,12 +259,13 @@ export default {
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '行驶里程(km)',
|
|
label: '行驶里程(km)',
|
|
|
- prop: 'runMileage'
|
|
|
|
|
|
|
+ prop: 'runMileage',
|
|
|
|
|
+ type: 'number'
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '车牌号',
|
|
label: '车牌号',
|
|
|
prop: 'vehicleNumber',
|
|
prop: 'vehicleNumber',
|
|
|
- search: true
|
|
|
|
|
|
|
+ search: false
|
|
|
},
|
|
},
|
|
|
{
|
|
{
|
|
|
label: '轮胎数量',
|
|
label: '轮胎数量',
|
|
@@ -328,10 +336,29 @@ export default {
|
|
|
async onLoad(page, params = {}) {
|
|
async onLoad(page, params = {}) {
|
|
|
try {
|
|
try {
|
|
|
this.loading = true
|
|
this.loading = true
|
|
|
- const res = await getClaimList(page.currentPage, page.pageSize, Object.assign(params, this.query))
|
|
|
|
|
- const data = res.data.data
|
|
|
|
|
- this.page.total = data.total
|
|
|
|
|
- this.data = data.records
|
|
|
|
|
|
|
+ const mergedQuery = Object.assign({}, this.query, params)
|
|
|
|
|
+ const { purchaseDate, ...rest } = mergedQuery || {}
|
|
|
|
|
+
|
|
|
|
|
+ /** @type {ClaimQueryParams & Record<string, any>} */
|
|
|
|
|
+ const apiParams = { ...rest }
|
|
|
|
|
+
|
|
|
|
|
+ // 购买日期区间:页面用 purchaseDate,接口用 purchaseDateStartStr/purchaseDateEndStr
|
|
|
|
|
+ if (Array.isArray(purchaseDate) && purchaseDate.length === 2) {
|
|
|
|
|
+ apiParams.purchaseDateStartStr = purchaseDate[0]
|
|
|
|
|
+ apiParams.purchaseDateEndStr = purchaseDate[1]
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ const res = await getClaimSearchComprehensive(page.pageSize, page.currentPage, apiParams)
|
|
|
|
|
+ const pageData = res?.data?.data
|
|
|
|
|
+ const records = (pageData && Array.isArray(pageData.records)) ? pageData.records : []
|
|
|
|
|
+
|
|
|
|
|
+ this.page.total = pageData?.total || 0
|
|
|
|
|
+ // 综合查询返回 records[].claimMain,列表展示按主表字段铺平
|
|
|
|
|
+ this.data = records.map((r) => ({
|
|
|
|
|
+ ...(r && r.claimMain ? r.claimMain : {}),
|
|
|
|
|
+ attachments: (r && Array.isArray(r.attachments)) ? r.attachments : [],
|
|
|
|
|
+ auditRecords: (r && Array.isArray(r.auditRecords)) ? r.auditRecords : []
|
|
|
|
|
+ }))
|
|
|
} catch (error) {
|
|
} catch (error) {
|
|
|
console.error('获取理赔列表失败:', error)
|
|
console.error('获取理赔列表失败:', error)
|
|
|
this.$message.error('获取理赔列表失败')
|
|
this.$message.error('获取理赔列表失败')
|
|
@@ -349,6 +376,7 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
searchChange(params, done) {
|
|
searchChange(params, done) {
|
|
|
this.query = params
|
|
this.query = params
|
|
|
|
|
+ this.page.currentPage = 1
|
|
|
this.onLoad(this.page, params)
|
|
this.onLoad(this.page, params)
|
|
|
done()
|
|
done()
|
|
|
},
|
|
},
|
|
@@ -360,6 +388,7 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
searchReset() {
|
|
searchReset() {
|
|
|
this.query = {}
|
|
this.query = {}
|
|
|
|
|
+ this.page.currentPage = 1
|
|
|
this.onLoad(this.page)
|
|
this.onLoad(this.page)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
@@ -381,6 +410,7 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
currentChange(currentPage) {
|
|
currentChange(currentPage) {
|
|
|
this.page.currentPage = currentPage
|
|
this.page.currentPage = currentPage
|
|
|
|
|
+ this.onLoad(this.page, this.query)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -391,6 +421,8 @@ export default {
|
|
|
*/
|
|
*/
|
|
|
sizeChange(pageSize) {
|
|
sizeChange(pageSize) {
|
|
|
this.page.pageSize = pageSize
|
|
this.page.pageSize = pageSize
|
|
|
|
|
+ this.page.currentPage = 1
|
|
|
|
|
+ this.onLoad(this.page, this.query)
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
/**
|
|
/**
|