index.vue 21 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660
  1. <template>
  2. <basic-container>
  3. <avue-crud :option="option"
  4. :table-loading="loading"
  5. :data="data"
  6. :page.sync="page"
  7. ref="crud"
  8. v-model="form"
  9. @search-change="searchChange"
  10. @search-reset="searchReset"
  11. @selection-change="selectionChange"
  12. @current-change="currentChange"
  13. @size-change="sizeChange"
  14. @refresh-change="refreshChange"
  15. @on-load="onLoad"
  16. @row-update="rowUpdate"
  17. @row-save="rowSave"
  18. @row-del="rowDel">
  19. <template slot-scope="scope" slot="menu">
  20. <el-button type="text"
  21. size="small"
  22. plain
  23. class="none-border"
  24. @click.stop="handleDetail(scope.row)">详情
  25. </el-button>
  26. <el-button type="text"
  27. size="small"
  28. plain
  29. class="none-border"
  30. @click.stop="handleAttachments(scope.row)">附件
  31. </el-button>
  32. <el-button type="text"
  33. size="small"
  34. plain
  35. class="none-border"
  36. @click.stop="handleAudit(scope.row)">审核记录
  37. </el-button>
  38. </template>
  39. <template slot-scope="{row}" slot="claimSourceType">
  40. <el-tag :type="getClaimSourceTypeType(row.claimSourceType)">
  41. {{ getClaimSourceTypeLabel(row.claimSourceType) }}
  42. </el-tag>
  43. </template>
  44. <template slot-scope="{row}" slot="auditStatus">
  45. <el-tag :type="getAuditStatusType(row.auditStatus)">
  46. {{ getAuditStatusLabel(row.auditStatus) }}
  47. </el-tag>
  48. </template>
  49. </avue-crud>
  50. <!-- 理赔详情对话框 -->
  51. <el-dialog title="理赔详情"
  52. :visible.sync="detailVisible"
  53. width="80%"
  54. :close-on-click-modal="false"
  55. :modal="true"
  56. :append-to-body="true"
  57. :lock-scroll="false">
  58. <div v-if="claimDetail" class="claim-detail-container">
  59. <!-- 基本信息 -->
  60. <el-card class="detail-card" shadow="never">
  61. <div slot="header" class="card-header">
  62. <span>基本信息</span>
  63. </div>
  64. <el-row :gutter="20">
  65. <el-col :span="8">
  66. <div class="detail-item">
  67. <label>理赔编号:</label>
  68. <span>{{ claimDetail.claimNo }}</span>
  69. </div>
  70. </el-col>
  71. <el-col :span="8">
  72. <div class="detail-item">
  73. <label>来源类型:</label>
  74. <el-tag :type="getClaimSourceTypeType(claimDetail.claimSourceType)" size="small">
  75. {{ getClaimSourceTypeLabel(claimDetail.claimSourceType) }}
  76. </el-tag>
  77. </div>
  78. </el-col>
  79. <el-col :span="8">
  80. <div class="detail-item">
  81. <label>审核状态:</label>
  82. <el-tag :type="getAuditStatusType(claimDetail.auditStatus)" size="small">
  83. {{ getAuditStatusLabel(claimDetail.auditStatus) }}
  84. </el-tag>
  85. </div>
  86. </el-col>
  87. <el-col :span="8">
  88. <div class="detail-item">
  89. <label>来源名称:</label>
  90. <span>{{ claimDetail.sourceName }}</span>
  91. </div>
  92. </el-col>
  93. <el-col :span="8">
  94. <div class="detail-item">
  95. <label>来源编码:</label>
  96. <span>{{ claimDetail.sourceCode }}</span>
  97. </div>
  98. </el-col>
  99. <el-col :span="8">
  100. <div class="detail-item">
  101. <label>提交时间:</label>
  102. <span>{{ claimDetail.submitTime }}</span>
  103. </div>
  104. </el-col>
  105. </el-row>
  106. </el-card>
  107. <!-- 消费者信息 -->
  108. <el-card class="detail-card" shadow="never">
  109. <div slot="header" class="card-header">
  110. <span>消费者信息</span>
  111. </div>
  112. <el-row :gutter="20">
  113. <el-col :span="12">
  114. <div class="detail-item">
  115. <label>消费者姓名:</label>
  116. <span>{{ claimDetail.consumerName }}</span>
  117. </div>
  118. </el-col>
  119. <el-col :span="12">
  120. <div class="detail-item">
  121. <label>消费者电话:</label>
  122. <span>{{ claimDetail.consumerPhone }}</span>
  123. </div>
  124. </el-col>
  125. </el-row>
  126. </el-card>
  127. <!-- 轮胎信息 -->
  128. <el-card class="detail-card" shadow="never">
  129. <div slot="header" class="card-header">
  130. <span>轮胎信息</span>
  131. </div>
  132. <el-row :gutter="20">
  133. <el-col :span="8">
  134. <div class="detail-item">
  135. <label>轮胎编号:</label>
  136. <span>{{ claimDetail.tyreNo }}</span>
  137. </div>
  138. </el-col>
  139. <el-col :span="8">
  140. <div class="detail-item">
  141. <label>轮胎规格:</label>
  142. <span>{{ claimDetail.tyreSpecs }}</span>
  143. </div>
  144. </el-col>
  145. <el-col :span="8">
  146. <div class="detail-item">
  147. <label>行驶里程:</label>
  148. <span>{{ claimDetail.runMileage }} 公里</span>
  149. </div>
  150. </el-col>
  151. <el-col :span="8">
  152. <div class="detail-item">
  153. <label>购买日期:</label>
  154. <span>{{ claimDetail.purchaseDate }}</span>
  155. </div>
  156. </el-col>
  157. <el-col :span="8">
  158. <div class="detail-item">
  159. <label>安装日期:</label>
  160. <span>{{ claimDetail.mountDate }}</span>
  161. </div>
  162. </el-col>
  163. </el-row>
  164. </el-card>
  165. <!-- 理赔信息 -->
  166. <el-card class="detail-card" shadow="never">
  167. <div slot="header" class="card-header">
  168. <span>理赔信息</span>
  169. </div>
  170. <el-row :gutter="20">
  171. <el-col :span="12">
  172. <div class="detail-item">
  173. <label>理赔金额:</label>
  174. <span class="amount">¥{{ claimDetail.claimAmount }}</span>
  175. </div>
  176. </el-col>
  177. <el-col :span="24">
  178. <div class="detail-item">
  179. <label>理赔原因:</label>
  180. <span>{{ claimDetail.claimReason }}</span>
  181. </div>
  182. </el-col>
  183. </el-row>
  184. </el-card>
  185. </div>
  186. <span slot="footer" class="dialog-footer">
  187. <el-button @click="detailVisible = false">关闭</el-button>
  188. </span>
  189. </el-dialog>
  190. <!-- 附件列表对话框 -->
  191. <el-dialog title="理赔附件"
  192. :visible.sync="attachmentVisible"
  193. width="800px"
  194. append-to-body>
  195. <el-table :data="attachmentList" v-loading="attachmentLoading">
  196. <!-- 新增缩略图列 -->
  197. <el-table-column label="缩略图" width="80" align="center">
  198. <template slot-scope="scope">
  199. <div class="thumbnail-container">
  200. <!-- 图片缩略图 -->
  201. <img v-if="isImageFile(scope.row.fileName)"
  202. :src="scope.row.fileUrl"
  203. class="thumbnail-image"
  204. style="height: auto !important;"
  205. @click="previewImage(scope.row)"
  206. @error="handleImageError"
  207. alt="缩略图" />
  208. <!-- 视频缩略图 -->
  209. <div v-else-if="isVideoFile(scope.row.fileName)"
  210. class="thumbnail-video"
  211. @click="previewVideo(scope.row)">
  212. <i class="el-icon-video-play"></i>
  213. </div>
  214. <!-- 其他文件类型图标 -->
  215. <div v-else class="thumbnail-file">
  216. <i class="el-icon-document"></i>
  217. </div>
  218. </div>
  219. </template>
  220. </el-table-column>
  221. <el-table-column prop="fileName" label="文件名" show-overflow-tooltip></el-table-column>
  222. <el-table-column prop="fileType" label="文件类型" width="100"></el-table-column>
  223. <el-table-column prop="fileSize" label="文件大小" width="120">
  224. <template slot-scope="scope">
  225. {{ formatFileSize(scope.row.fileSize) }}
  226. </template>
  227. </el-table-column>
  228. <el-table-column label="操作" width="150">
  229. <template slot-scope="scope">
  230. <el-button v-if="isImageFile(scope.row.fileName)"
  231. type="text"
  232. size="small"
  233. @click="previewImage(scope.row)">预览</el-button>
  234. <el-button v-else-if="isVideoFile(scope.row.fileName)"
  235. type="text"
  236. size="small"
  237. @click="previewVideo(scope.row)">播放</el-button>
  238. <el-button type="text" size="small" @click="downloadFile(scope.row)">下载</el-button>
  239. </template>
  240. </el-table-column>
  241. </el-table>
  242. <span slot="footer" class="dialog-footer">
  243. <el-button @click="attachmentVisible = false">关闭</el-button>
  244. </span>
  245. </el-dialog>
  246. <!-- 图片预览对话框 -->
  247. <el-dialog title="图片预览"
  248. :visible.sync="imagePreviewVisible"
  249. width="80%"
  250. :close-on-click-modal="false"
  251. append-to-body
  252. custom-class="image-preview-dialog"
  253. @close="closeImagePreview">
  254. <div class="image-preview-container">
  255. <el-image :src="previewImageUrl"
  256. :preview-src-list="previewImageList"
  257. :initial-index="currentPreviewIndex"
  258. fit="contain"
  259. class="preview-image">
  260. <div slot="error" class="image-slot">
  261. <i class="el-icon-picture-outline"></i>
  262. <p>图片加载失败</p>
  263. </div>
  264. </el-image>
  265. </div>
  266. <span slot="footer" class="dialog-footer">
  267. <el-button @click="closeImagePreview">关闭</el-button>
  268. </span>
  269. </el-dialog>
  270. <!-- 视频预览对话框 -->
  271. <el-dialog title="视频播放"
  272. :visible.sync="videoPreviewVisible"
  273. width="80%"
  274. :close-on-click-modal="false"
  275. append-to-body
  276. custom-class="video-preview-dialog"
  277. @close="closeVideoPreview">
  278. <div class="video-preview-container">
  279. <video v-if="previewVideoUrl"
  280. :src="previewVideoUrl"
  281. controls
  282. preload="metadata"
  283. class="preview-video"
  284. @error="handleVideoError">
  285. 您的浏览器不支持视频播放。
  286. </video>
  287. <div v-else class="video-error">
  288. <i class="el-icon-video-camera"></i>
  289. <p>视频加载失败</p>
  290. </div>
  291. </div>
  292. <span slot="footer" class="dialog-footer">
  293. <el-button @click="closeVideoPreview">关闭</el-button>
  294. </span>
  295. </el-dialog>
  296. <!-- 审核记录对话框 -->
  297. <el-dialog title="审核记录"
  298. :visible.sync="auditVisible"
  299. width="1000px"
  300. append-to-body>
  301. <div style="margin-bottom: 16px;">
  302. <el-button type="primary" size="small" @click="handleAddAudit">新增审核</el-button>
  303. </div>
  304. <el-table :data="auditList" v-loading="auditLoading">
  305. <el-table-column prop="auditResult" label="审核结果" width="100">
  306. <template slot-scope="scope">
  307. <el-tag :type="getAuditResultType(scope.row.auditResult)">
  308. {{ getAuditResultText(scope.row.auditResult) }}
  309. </el-tag>
  310. </template>
  311. </el-table-column>
  312. <el-table-column prop="auditAmount" label="审核金额" width="120">
  313. <template slot-scope="scope">
  314. ¥{{ scope.row.auditAmount }}
  315. </template>
  316. </el-table-column>
  317. <el-table-column prop="reasonDetail" label="审核说明" show-overflow-tooltip></el-table-column>
  318. <el-table-column prop="auditorName" label="审核人" width="100"></el-table-column>
  319. <el-table-column prop="auditTime" label="审核时间" width="150"></el-table-column>
  320. <el-table-column label="操作" width="80">
  321. <template slot-scope="scope">
  322. <el-button type="text" size="small" @click="handleEditAudit(scope.row)">编辑</el-button>
  323. </template>
  324. </el-table-column>
  325. </el-table>
  326. <span slot="footer" class="dialog-footer">
  327. <el-button @click="auditVisible = false">关闭</el-button>
  328. </span>
  329. </el-dialog>
  330. <!-- 审核记录新增/编辑对话框 -->
  331. <el-dialog :title="auditFormMode === 'add' ? '新增审核记录' : '编辑审核记录'"
  332. :visible.sync="auditFormVisible"
  333. width="600px"
  334. append-to-body>
  335. <el-form :model="auditForm" :rules="auditFormRules" ref="auditFormRef" label-width="120px">
  336. <el-form-item label="审核结果" prop="auditResult">
  337. <el-select v-model="auditForm.auditResult" placeholder="请选择审核结果" style="width: 100%;">
  338. <el-option :label="getAuditStatusLabel(AUDIT_STATUS.APPROVED, '通过')" :value="AUDIT_STATUS.APPROVED" />
  339. <el-option :label="getAuditStatusLabel(AUDIT_STATUS.REJECTED, '拒绝')" :value="AUDIT_STATUS.REJECTED" />
  340. </el-select>
  341. </el-form-item>
  342. <el-form-item label="审核金额" prop="auditAmount">
  343. <el-input-number v-model="auditForm.auditAmount" :precision="4" :min="0" :max="999999.9999" style="width: 100%;" placeholder="请输入审核金额"></el-input-number>
  344. </el-form-item>
  345. <el-form-item label="审核说明" prop="reasonDetail">
  346. <el-input type="textarea" v-model="auditForm.reasonDetail" :rows="3" placeholder="请输入审核说明"></el-input>
  347. </el-form-item>
  348. <el-form-item label="审核人" prop="auditorName">
  349. <el-input v-model="auditForm.auditorName" placeholder="请输入审核人姓名"></el-input>
  350. </el-form-item>
  351. <el-form-item label="审核时间" prop="auditTime">
  352. <el-date-picker v-model="auditForm.auditTime" type="datetime" placeholder="请选择审核时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"></el-date-picker>
  353. </el-form-item>
  354. <el-form-item label="反馈渠道">
  355. <el-select v-model="auditForm.feedbackChannel" placeholder="请选择反馈渠道" style="width: 100%;" clearable>
  356. <el-option label="电话" value="电话"></el-option>
  357. <el-option label="在线客服" value="在线客服"></el-option>
  358. <el-option label="邮件" value="邮件"></el-option>
  359. <el-option label="短信" value="短信"></el-option>
  360. </el-select>
  361. </el-form-item>
  362. <el-form-item label="反馈描述">
  363. <el-input type="textarea" v-model="auditForm.feedbackDesc" :rows="2" placeholder="请输入反馈描述"></el-input>
  364. </el-form-item>
  365. <el-form-item label="反馈时间">
  366. <el-date-picker v-model="auditForm.feedbackTime" type="datetime" placeholder="请选择反馈时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"></el-date-picker>
  367. </el-form-item>
  368. <el-form-item label="申诉状态">
  369. <el-select v-model="auditForm.appealStatus" placeholder="请选择申诉状态" style="width: 100%;">
  370. <el-option label="无申诉" :value="0"></el-option>
  371. <el-option label="申诉中" :value="1"></el-option>
  372. </el-select>
  373. </el-form-item>
  374. <el-form-item label="申诉结果" >
  375. <el-input v-model="auditForm.appealResult" placeholder="请输入申诉结果"></el-input>
  376. </el-form-item>
  377. <el-form-item label="申诉时间" >
  378. <el-date-picker v-model="auditForm.appealTime" type="datetime" placeholder="请选择申诉时间" format="yyyy-MM-dd HH:mm:ss" value-format="yyyy-MM-dd HH:mm:ss" style="width: 100%;"></el-date-picker>
  379. </el-form-item>
  380. </el-form>
  381. <span slot="footer" class="dialog-footer">
  382. <el-button @click="auditFormVisible = false">取消</el-button>
  383. <el-button type="primary" @click="handleSaveAudit" :loading="auditFormLoading">确定</el-button>
  384. </span>
  385. </el-dialog>
  386. </basic-container>
  387. </template>
  388. <script>
  389. import claimMixin from './claimMixin';
  390. import { AUDIT_STATUS, AUDIT_STATUS_OPTIONS } from '@/constants/claim';
  391. export default {
  392. name: 'Claim',
  393. mixins: [claimMixin],
  394. data() {
  395. return {
  396. AUDIT_STATUS,
  397. AUDIT_STATUS_OPTIONS
  398. };
  399. },
  400. methods: {
  401. getAuditStatusLabel: function(value, fallback) {
  402. var opts = this.AUDIT_STATUS_OPTIONS || [];
  403. var fb = (typeof fallback === 'string') ? fallback : '';
  404. for (var i = 0; i < opts.length; i++) {
  405. var item = opts[i];
  406. if (item && item.value === value) {
  407. var label = item.label;
  408. return (typeof label === 'string' && label) ? label : fb;
  409. }
  410. }
  411. return fb;
  412. }
  413. }
  414. }
  415. </script>
  416. <style lang="scss" scoped >
  417. /* 理赔详情弹层样式 */
  418. .claim-detail-container {
  419. max-height: 70vh;
  420. overflow-y: auto;
  421. }
  422. .detail-card {
  423. margin-bottom: 20px;
  424. border: 1px solid #ebeef5;
  425. }
  426. .detail-card:last-child {
  427. margin-bottom: 0;
  428. }
  429. .card-header {
  430. font-weight: bold;
  431. color: #303133;
  432. font-size: 16px;
  433. border-bottom: 1px solid #ebeef5;
  434. padding: 15px 20px;
  435. background-color: #fafafa;
  436. }
  437. .detail-item {
  438. margin-bottom: 15px;
  439. display: flex;
  440. align-items: center;
  441. min-height: 32px;
  442. }
  443. .detail-item label {
  444. font-weight: 600;
  445. color: #606266;
  446. min-width: 100px;
  447. margin-right: 10px;
  448. flex-shrink: 0;
  449. line-height: 32px;
  450. }
  451. .detail-item span {
  452. color: #303133;
  453. word-break: break-all;
  454. }
  455. .amount {
  456. color: #E6A23C;
  457. font-weight: bold;
  458. font-size: 16px;
  459. }
  460. .dialog-footer {
  461. text-align: right;
  462. padding-top: 20px;
  463. border-top: 1px solid #ebeef5;
  464. }
  465. /* 响应式布局 */
  466. @media (max-width: 768px) {
  467. .claim-detail-container {
  468. max-height: 60vh;
  469. }
  470. .detail-item {
  471. flex-direction: column;
  472. align-items: flex-start;
  473. }
  474. .detail-item label {
  475. min-width: auto;
  476. margin-bottom: 5px;
  477. margin-right: 0;
  478. }
  479. }
  480. .thumbnail-container {
  481. display: flex;
  482. justify-content: center;
  483. align-items: center;
  484. width: 50px;
  485. height: 50px;
  486. .thumbnail-image {
  487. width: 50px;
  488. height: 50px;
  489. object-fit: cover;
  490. border-radius: 4px;
  491. cursor: pointer;
  492. transition: transform 0.2s;
  493. &:hover {
  494. transform: scale(1.1);
  495. }
  496. }
  497. .thumbnail-video {
  498. width: 50px;
  499. height: 50px;
  500. background: #f5f5f5;
  501. border: 1px solid #ddd;
  502. border-radius: 4px;
  503. display: flex;
  504. justify-content: center;
  505. align-items: center;
  506. cursor: pointer;
  507. transition: background-color 0.2s;
  508. &:hover {
  509. background: #e6f7ff;
  510. }
  511. i {
  512. font-size: 20px;
  513. color: #1890ff;
  514. }
  515. }
  516. .thumbnail-file {
  517. width: 50px;
  518. height: 50px;
  519. background: #f5f5f5;
  520. border: 1px solid #ddd;
  521. border-radius: 4px;
  522. display: flex;
  523. justify-content: center;
  524. align-items: center;
  525. i {
  526. font-size: 20px;
  527. color: #666;
  528. }
  529. }
  530. }
  531. .image-preview-container {
  532. text-align: center;
  533. .preview-image {
  534. max-width: 100%;
  535. max-height: 80vh; // 增加最大高度限制
  536. min-height: 200px; // 设置最小高度
  537. }
  538. .image-slot {
  539. display: flex;
  540. flex-direction: column;
  541. justify-content: center;
  542. align-items: center;
  543. height: 200px;
  544. color: #999;
  545. i {
  546. font-size: 40px;
  547. margin-bottom: 10px;
  548. }
  549. }
  550. }
  551. // 新增:图片预览对话框样式
  552. .image-preview-dialog {
  553. .el-dialog {
  554. margin-top: 5vh !important;
  555. margin-bottom: 5vh !important;
  556. max-height: 90vh;
  557. display: flex;
  558. flex-direction: column;
  559. }
  560. .el-dialog__body {
  561. flex: 1;
  562. padding: 20px;
  563. overflow: auto;
  564. }
  565. .el-dialog__footer {
  566. flex-shrink: 0;
  567. }
  568. }
  569. .video-preview-dialog {
  570. .el-dialog {
  571. margin-top: 5vh !important;
  572. margin-bottom: 5vh !important;
  573. max-height: 90vh;
  574. display: flex;
  575. flex-direction: column;
  576. }
  577. .el-dialog__body {
  578. flex: 1;
  579. padding: 20px;
  580. overflow: auto;
  581. }
  582. .el-dialog__footer {
  583. flex-shrink: 0;
  584. }
  585. }
  586. .video-preview-container {
  587. text-align: center;
  588. .preview-video {
  589. max-width: 100%;
  590. max-height: 70vh;
  591. min-height: 300px;
  592. background: #000;
  593. }
  594. .video-error {
  595. display: flex;
  596. flex-direction: column;
  597. justify-content: center;
  598. align-items: center;
  599. height: 300px;
  600. color: #999;
  601. background: #f5f5f5;
  602. border-radius: 4px;
  603. i {
  604. font-size: 60px;
  605. margin-bottom: 15px;
  606. }
  607. p {
  608. font-size: 16px;
  609. margin: 0;
  610. }
  611. }
  612. }
  613. </style>