detailsPage.vue 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388
  1. <template>
  2. <div>
  3. <div class="customer-head">
  4. <div class="customer-back">
  5. <el-button
  6. type="danger"
  7. style="border: none;background: none;color: red"
  8. icon="el-icon-arrow-left"
  9. @click="goBack()"
  10. >返回列表
  11. </el-button>
  12. </div>
  13. <div class="add-customer-btn">
  14. <el-button
  15. class="el-button--small-yh"
  16. style="margin-left: 6px;"
  17. type="primary"
  18. size="small"
  19. v-if="editBtn"
  20. @click="inEdit"
  21. >编 辑
  22. </el-button>
  23. <el-button
  24. class="el-button--small-yh"
  25. v-else
  26. style="margin-left: 6px;"
  27. type="primary"
  28. size="small"
  29. :disabled="editDis"
  30. @click="submit"
  31. >保 存
  32. </el-button>
  33. </div>
  34. </div>
  35. <div style="margin-top: 50px">
  36. <el-tab-pane label="基础信息">
  37. <trade-card title="基础信息">
  38. <avue-form :option="optionForm" v-model="form" ref="form">
  39. </avue-form>
  40. </trade-card>
  41. <trade-card title="文件中心">
  42. <upload-file :data="[]" :disabled="editDis"></upload-file>
  43. </trade-card>
  44. <trade-card title="反馈表">
  45. <avue-crud
  46. :option="option"
  47. :data="data"
  48. id="out-table"
  49. ref="crud"
  50. :header-cell-class-name="headerClassName"
  51. :row-style="{ height: '20px', padding: '0px' }"
  52. :cell-style="{ height: '20px', padding: '0px' }"
  53. @selection-change="selectionChange"
  54. >
  55. </avue-crud>
  56. </trade-card>
  57. <trade-card title="操作记录">
  58. <avue-form :option="optionForm2" v-model="form" ref="form2">
  59. </avue-form>
  60. </trade-card>
  61. </el-tab-pane>
  62. </div>
  63. </div>
  64. </template>
  65. <script>
  66. import {
  67. submit,
  68. detail,
  69. submitApprova,
  70. revokeApproval
  71. } from '@/api/claimSettlement/index';
  72. export default {
  73. name: 'detailsPage',
  74. data() {
  75. return {
  76. editBtn: false,
  77. editDis: false,
  78. form: {},
  79. oldForm: {},
  80. optionForm: {
  81. menuBtn: false,
  82. span: 6,
  83. disabled: false,
  84. labelWidth: 100,
  85. column: [
  86. {
  87. label: '理赔单号',
  88. prop: 'claimNo',
  89. disabled: true
  90. },
  91. {
  92. label: '来源类型',
  93. prop: 'claimSourceType',
  94. type: 'select',
  95. dicData: [
  96. {
  97. label: '经销商',
  98. value: 1
  99. },
  100. {
  101. label: '门店',
  102. value: 2
  103. },
  104. {
  105. label: '终端消费者',
  106. value: 3
  107. }
  108. ]
  109. },
  110. {
  111. label: '来源方名称',
  112. prop: 'sourceName'
  113. },
  114. {
  115. label: '消费者姓名',
  116. prop: 'consumerName'
  117. },
  118. {
  119. label: '消费者电话',
  120. prop: 'consumerPhone'
  121. },
  122. {
  123. label: '胎号',
  124. prop: 'tyreNo'
  125. },
  126. {
  127. label: '规格型号',
  128. prop: 'tyreSpecs'
  129. },
  130. {
  131. label: '购买日期',
  132. prop: 'purchaseDate',
  133. type: 'date',
  134. format: 'yyyy-MM-dd',
  135. valueFormat: 'yyyy-MM-dd'
  136. },
  137. {
  138. label: '装车日期',
  139. prop: 'mountDate',
  140. type: 'date',
  141. format: 'yyyy-MM-dd',
  142. valueFormat: 'yyyy-MM-dd'
  143. },
  144. {
  145. label: '行驶里程(km)',
  146. prop: 'runMileage'
  147. },
  148. {
  149. label: '索赔金额',
  150. prop: 'claimAmount'
  151. },
  152. {
  153. label: '理赔原因',
  154. prop: 'claimReason',
  155. type: 'textarea',
  156. span: 12,
  157. minRows: 2
  158. },
  159. {
  160. label: '备注',
  161. prop: 'remark',
  162. type: 'textarea',
  163. span: 12,
  164. minRows: 2
  165. }
  166. ]
  167. },
  168. optionForm2: {
  169. menuBtn: false,
  170. span: 6,
  171. disabled: false,
  172. labelWidth: 100,
  173. column: [
  174. {
  175. label: '审核状态',
  176. prop: 'auditStatus',
  177. type: 'select',
  178. dicData: [
  179. {
  180. label: '待审核',
  181. value: 0
  182. },
  183. {
  184. label: '审核中',
  185. value: 1
  186. },
  187. {
  188. label: '已通过',
  189. value: 2
  190. },
  191. {
  192. label: '已拒绝',
  193. value: 3
  194. }
  195. ],
  196. disabled: true
  197. },
  198. {
  199. label: '制单人',
  200. prop: 'createUserName',
  201. disabled: true
  202. },
  203. {
  204. label: '制单日期',
  205. prop: 'createTime',
  206. disabled: true
  207. },
  208. {
  209. label: '修改人',
  210. prop: 'updateUserName',
  211. disabled: true
  212. },
  213. {
  214. label: '修改日期',
  215. prop: 'updateTime',
  216. disabled: true
  217. }
  218. ]
  219. },
  220. option: {
  221. maxHeight: 340,
  222. calcHeight: 30,
  223. menuWidth: 60,
  224. searchMenuSpan: 18,
  225. tip: false,
  226. border: true,
  227. addBtn: false,
  228. viewBtn: false,
  229. editBtn: false,
  230. delBtn: false,
  231. refreshBtn: false,
  232. selection: true,
  233. align: 'center',
  234. menu: false,
  235. column: [
  236. {
  237. label: 'index',
  238. prop: 'index',
  239. width: '55',
  240. fixed: true,
  241. headerslot: true
  242. },
  243. {
  244. label: '原始文件名',
  245. prop: 'fileName',
  246. overHidden: true
  247. },
  248. {
  249. label: '文件地址',
  250. prop: 'fileUrl',
  251. overHidden: true
  252. },
  253. {
  254. label: '文件类型',
  255. prop: 'fileType',
  256. overHidden: true
  257. },
  258. {
  259. label: '制单人',
  260. prop: 'createUserName',
  261. overHidden: true
  262. },
  263. {
  264. label: '制单日期',
  265. prop: 'createTime',
  266. type: 'date',
  267. overHidden: true,
  268. width: 120,
  269. format: 'yyyy-MM-dd',
  270. valueFormat: 'yyyy-MM-dd HH:mm:ss'
  271. },
  272. {
  273. label: '修改人',
  274. prop: 'updateUserName',
  275. overHidden: true
  276. },
  277. {
  278. label: '修改日期',
  279. prop: 'updateTime',
  280. type: 'date',
  281. overHidden: true,
  282. width: 120,
  283. format: 'yyyy-MM-dd',
  284. valueFormat: 'yyyy-MM-dd HH:mm:ss'
  285. },
  286. {
  287. label: '备注',
  288. prop: 'remarks',
  289. cell: true,
  290. width: 150,
  291. overHidden: true
  292. }
  293. ]
  294. }
  295. };
  296. },
  297. components: {},
  298. props: {
  299. detailData: Object
  300. },
  301. created() {
  302. if (this.detailData && this.detailData.id) {
  303. this.editBtn = true;
  304. this.editDis = true;
  305. this.optionForm.disabled = true;
  306. this.getDetail(this.detailData.id);
  307. }
  308. },
  309. methods: {
  310. inEdit() {
  311. this.editBtn = false;
  312. if (this.form.status == '录入') {
  313. this.editDis = false;
  314. this.optionForm.disabled = false;
  315. }
  316. },
  317. /**
  318. * @param {any} id
  319. */
  320. getDetail(id) {
  321. const loading = this.$loading({
  322. lock: true,
  323. text: '加载中',
  324. spinner: 'el-icon-loading',
  325. background: 'rgba(255,255,255,0.7)'
  326. });
  327. detail({ id: id })
  328. .then(res => {
  329. this.form = res.data.data;
  330. })
  331. .finally(() => {
  332. loading.close();
  333. });
  334. },
  335. // 更改表格颜色
  336. /**
  337. * @param {{ columnIndex: number; column: { level: number; }; }} tab
  338. */
  339. headerClassName(tab) {
  340. //颜色间隔
  341. let back = ""
  342. if (tab.columnIndex >= 0 && tab.column.level === 1) {
  343. if (tab.columnIndex % 2 === 0) {
  344. back = "back-one"
  345. } else if (tab.columnIndex % 2 === 1) {
  346. back = "back-two"
  347. }
  348. }
  349. return back;
  350. },
  351. }
  352. };
  353. </script>
  354. <style lang="scss" scoped>
  355. ::v-deep .el-form-item__error {
  356. display: none !important;
  357. }
  358. ::v-deep .el-form-item {
  359. margin-bottom: 8px !important;
  360. }
  361. ::v-deep .el-table .cell {
  362. padding: 0 2px !important;
  363. .el-form-item {
  364. margin-bottom: 0px !important;
  365. }
  366. }
  367. ::v-deep #out-table .back-one {
  368. background: #ecf5ff !important;
  369. text-align: center;
  370. padding: 4px 0;
  371. }
  372. ::v-deep #out-table .back-two {
  373. background: #ecf5ff !important;
  374. text-align: center;
  375. padding: 4px 0;
  376. }
  377. ::v-deep .el-table--small td,
  378. .el-table--small th {
  379. padding: 2px !important;
  380. }
  381. </style>