mixin.js 33 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987
  1. import CommonUtil from "@/utils/comutil.js";
  2. export const mixin = { // 导出混入对象
  3. data() {
  4. return {
  5. retrievalFields: [
  6. {
  7. name: 'provinceId',
  8. label: '省机构名称',
  9. type: 'select',
  10. options: []
  11. },
  12. {
  13. name: 'cityId',
  14. label: '市机构名称',
  15. type: 'select',
  16. options: []
  17. },
  18. {
  19. name: 'countyId',
  20. label: '区机构名称',
  21. type: 'select',
  22. options: []
  23. },
  24. {
  25. name: 'houseId',
  26. label: '门店名称',
  27. type: 'select',
  28. options: []
  29. },
  30. {
  31. name: 'taskNo',
  32. label: '任务池号',
  33. type: 'input',
  34. },
  35. {
  36. name: 'orderNo',
  37. label: '订单号',
  38. type: 'input',
  39. },
  40. {
  41. name: 'companyId',
  42. label: '保险公司',
  43. type: 'select',
  44. options: []
  45. },
  46. {
  47. name: 'agreeId',
  48. label: '协议选择',
  49. type: 'select',
  50. options: [],
  51. optionsIabel: "agreementName",
  52. },
  53. {
  54. name: 'licenseNo',
  55. label: '车牌号',
  56. type: 'input',
  57. Retained: true,
  58. },
  59. {
  60. name: 'frameNo',
  61. label: '车架号',
  62. type: 'input',
  63. Retained: true,
  64. },
  65. {
  66. name: 'engineNo',
  67. label: '发动机号',
  68. type: 'input',
  69. Retained: true,
  70. },
  71. {
  72. name: 'riskCode',
  73. label: '投保险种',
  74. type: 'select',
  75. Retained: true,
  76. options: [],
  77. optionsIabel: "dictTag",
  78. optionsValue: "dictTag",
  79. },
  80. {
  81. name: 'operatorId',
  82. label: '代理人工号',
  83. type: 'input',
  84. Retained: true,
  85. },
  86. {
  87. name: 'operatorName',
  88. label: '代理人姓名',
  89. type: 'input',
  90. Retained: true,
  91. },
  92. {
  93. name: 'auditId',
  94. label: '受理人工号',
  95. type: 'input',
  96. Retained: true,
  97. },
  98. {
  99. name: 'insuredName',
  100. label: '被保险人',
  101. type: 'input',
  102. Retained: true,
  103. },
  104. {
  105. name: ["quoteStartDateStr", "quoteEndDateStr"],
  106. label: '报价时间',
  107. type: 'date',
  108. list: 'quoteList'
  109. },
  110. {
  111. name: ["attachStartDateStr", "attachEndDateStr"],
  112. label: '起保时间',
  113. type: 'date',
  114. list: 'attachList'
  115. },
  116. ],
  117. loading: false,
  118. queryFrom: {},
  119. pageResult: {},
  120. columns: [
  121. { prop: "subOrderId", label: "订单号", minWidth: 180 },
  122. { prop: "userid", label: "业务员", minWidth: 160, formatter: this.useridFormatter },
  123. { prop: "managementSource", label: "机构来源", minWidth: 160, formatter: this.managementSourceFormatter },
  124. { prop: "insCompany", label: "保险公司", minWidth: 120 },
  125. { prop: "partnerCompaniesName", label: "合作公司", minWidth: 120 },
  126. { prop: "agreementName", label: "协议", minWidth: 160 },
  127. { prop: "licenseno", label: "车牌号", minWidth: 160 },
  128. { prop: "insuredname", label: "投保人姓名", minWidth: 120 },
  129. { prop: "product", label: "投保险种", minWidth: 100 },
  130. { prop: "createtime", label: "录单日期", minWidth: 160},
  131. ],
  132. statusoptions: "",
  133. dialogVisible: false,
  134. companyList: [], //保险公司
  135. institutionOptions: [], //机构名称列表
  136. options: [],//转发人列表
  137. transmitValue: "", //选中的转发人
  138. orderNo: '', //主订单号
  139. id: '', //子订单号
  140. queryOrders: {},
  141. carImageList: [], //车辆影像
  142. ownerImageList: [], //车主影像
  143. policyImageList: [], //投保人影像
  144. insuredImageList: [], //被保人影像
  145. carCheckImageList: [], //验车照影像
  146. quoteno: "",
  147. oldfileList: [],
  148. orderInfo: {},
  149. forwardingRecordsdialogVisible:false,
  150. gridData:[],
  151. }
  152. },
  153. computed: {
  154. currentDate() {
  155. const today = new Date();
  156. const year = today.getFullYear();
  157. const month = String(today.getMonth() + 1).padStart(2, '0');
  158. const day = String(today.getDate()).padStart(2, '0');
  159. return `${year}-${month}-${day}`;
  160. }
  161. },
  162. created() {
  163. this.pageRequest.quoteStartDateStr=this.currentDate;
  164. this.pageRequest.quoteEndDateStr=this.currentDate;
  165. this.$api.letter.gainTopList().then(res => {
  166. this.companyList = res.data;
  167. });
  168. this.$api.dept.findAllTree().then(res => {
  169. this.institutionOptions = res.data;
  170. });
  171. this.areaqueryList(1, 99, "provinceId");
  172. this.CompanyList();
  173. this.agrmentlist();
  174. this.getDicType("productsType"); //车船税类型
  175. },
  176. methods: {
  177. forwardingRecords(row){
  178. let id=row.row.subOrderId;
  179. this.forwardingRecordsQuery(id);
  180. },
  181. forwardingRecordsQuery(id) {
  182. this.$api.letter.findForwardingListBySubOrderId(id).then((res) => {
  183. if (res.code == '200' && res.data.length) {
  184. this.gridData=res.data;
  185. this.forwardingRecordsdialogVisible=true;
  186. } else {
  187. this.$message({
  188. type: 'error',
  189. message: "没有转发记录",
  190. });
  191. }
  192. });
  193. },
  194. detailFun(row) {
  195. let params = {
  196. companyId: row.row.subOrderId
  197. };
  198. this.$api.letter.getTaskByCompanyId(params).then(res => {
  199. if (res.code == "200") {
  200. var data = res.data;
  201. this.orderInfo = res.data;
  202. this.cpolicy();
  203. this.ImageList();
  204. data.kindinfo.map((ele, index) => {
  205. switch (ele.kindCode) {
  206. case "A":
  207. ele.amount = "投保";
  208. break;
  209. case "D4":
  210. case "SY_FJ_YBW2":
  211. ele.unitAmount = this.toChinesNum(ele.unitAmount);
  212. break;
  213. case "MJ1":
  214. case "MJ2":
  215. case "MJ3":
  216. case "MJ4":
  217. ele.deductibleRate = ele.deductibleRate + "%";
  218. break;
  219. default:
  220. ele.amount = this.toChinesNum(ele.amount);
  221. }
  222. return ele;
  223. });
  224. this.queryOrders = data;
  225. }
  226. });
  227. this.$refs.detailsDialog.setBackupVisible(true);
  228. },
  229. areaSelectChange(obj) {
  230. switch (obj.filed) {
  231. case 'provinceId':
  232. this.areaqueryList(2, obj.id, 'cityId')
  233. break;
  234. case 'cityId':
  235. this.areaqueryList(3, obj.id, 'countyId')
  236. break;
  237. case 'countyId':
  238. this.areaqueryList(4, obj.id, 'houseId')
  239. break;
  240. default:
  241. }
  242. },
  243. //下拉数据匹配
  244. selectDataMatching(files, name, data) {
  245. files.forEach(filed => {
  246. if (filed.name == name) {
  247. filed.options = data;
  248. }
  249. })
  250. },
  251. //获取机构数据
  252. areaqueryList(level, parentId, filed) {
  253. this.$api.task.queryListByParentId(level, parentId).then((res) => {
  254. this.selectDataMatching(this.retrievalFields, filed, res.data);
  255. });
  256. },
  257. CompanyList() {
  258. this.$api.letter.gainTopList().then((res) => {
  259. this.selectDataMatching(this.retrievalFields, 'companyId', res.data);
  260. })
  261. },
  262. agrmentlist() {
  263. this.$api.task.findPtlAgreementList().then((res) => {
  264. this.selectDataMatching(this.retrievalFields, 'agreeId', res.data);
  265. });
  266. },
  267. getDicType(type) {
  268. this.$api.insCompany.dicType(type).then(res => {
  269. if (res.code == 200) {
  270. this.selectDataMatching(this.retrievalFields, 'riskCode', res.data.ddList);
  271. }
  272. });
  273. },
  274. cpolicy() {
  275. if (this.orderInfo.orderstatus == "3") {
  276. this.oldfileList = [];
  277. let businessList = []
  278. let accidentList = []
  279. switch (this.orderInfo.inscompany) {
  280. case "永安财险":
  281. if (this.orderInfo.jqpolicyno) {
  282. this.$api.letter
  283. .getPolicyPrint({
  284. companyId: this.orderInfo.id,
  285. policytype: "jq",
  286. })
  287. .then((res) => {
  288. //交强保单
  289. if (res.data) {
  290. let result = res.data.replace(/[\r\n]/g, "");
  291. let pdfBase64 = `data:application/pdf;base64,${result}`;
  292. base64ToPath(pdfBase64).then((path) => {
  293. if (path) {
  294. this.oldfileList.push({
  295. fileTitle: "交强电子保单",
  296. filename: this.orderInfo.jqpolicyno,
  297. fileurl: path,
  298. });
  299. }
  300. });
  301. }
  302. });
  303. this.$api.letter
  304. .getPolicyPrint2({
  305. companyId: this.orderInfo.id,
  306. policytype: "jq",
  307. })
  308. .then((res) => {
  309. //交强保单
  310. if (res.data) {
  311. let result = res.data.replace(/[\r\n]/g, "");
  312. let pdfBase64 = `data:application/pdf;base64,${result}`;
  313. base64ToPath(pdfBase64).then((path) => {
  314. if (path) {
  315. this.oldfileList.push({
  316. fileTitle: "交强电子标志",
  317. filename: this.orderInfo.jqpolicyno,
  318. fileurl: path,
  319. });
  320. }
  321. });
  322. }
  323. });
  324. }
  325. if (this.orderInfo.sypolicyno) {
  326. this.$api.letter
  327. .getPolicyPrint({
  328. companyId: this.orderInfo.id,
  329. policytype: "sy",
  330. })
  331. .then((res) => {
  332. //商业保单
  333. if (res.data) {
  334. let result = res.data.replace(/[\r\n]/g, "");
  335. let pdfBase64 = `data:application/pdf;base64,${result}`;
  336. base64ToPath(pdfBase64).then((path) => {
  337. if (path) {
  338. businessList.push({
  339. fileTitle: "商业电子保单",
  340. filename: this.orderInfo.sypolicyno,
  341. fileurl: path,
  342. });
  343. }
  344. });
  345. }
  346. });
  347. }
  348. break;
  349. case "华泰财险":
  350. if (this.orderInfo.jqpolicyno) {
  351. this.$api.letter
  352. .HuataigetPolicyPrint({
  353. companyId: this.orderInfo.id,
  354. riskCode: "0507",
  355. type: "2", //2:保单
  356. })
  357. .then((res) => {
  358. if (res.data) {
  359. if (res.data.jqxPolicyUrl) {
  360. this.oldfileList.push({
  361. fileTitle: "交强电子保单",
  362. filename: this.orderInfo.jqpolicyno,
  363. fileurl: res.data.jqxPolicyUrl,
  364. });
  365. }
  366. if (res.data.jqxFlagUrl) {
  367. this.oldfileList.push({
  368. fileTitle: "交强电子标志",
  369. filename: this.orderInfo.jqpolicyno,
  370. fileurl: res.data.jqxFlagUrl,
  371. });
  372. }
  373. } else {
  374. this.$message.error(res.msg);
  375. }
  376. });
  377. }
  378. if (this.orderInfo.sypolicyno) {
  379. this.$api.letter
  380. .HuataigetPolicyPrint({
  381. companyId: this.orderInfo.id,
  382. riskCode: "0510",
  383. type: "2", //2:保单
  384. })
  385. .then((res) => {
  386. if (res.data && res.data.syxPolicyUrl) {
  387. businessList.push({
  388. fileTitle: "商业电子保单",
  389. filename: this.orderInfo.sypolicyno,
  390. fileurl: res.data.syxPolicyUrl,
  391. });
  392. } else {
  393. this.$message.error(res.msg);
  394. }
  395. });
  396. }
  397. break;
  398. case "中煤财险":
  399. if (this.orderInfo.jqpolicyno) {
  400. this.$api.letter
  401. .ZhongmeigetPolicyPrint({
  402. companyId: this.orderInfo.id,
  403. riskCode: "0507",
  404. type: "2", //2:保单
  405. })
  406. .then((res) => {
  407. if (res.data && res.data[0]) {
  408. this.oldfileList.push({
  409. fileTitle: "交强电子保单",
  410. filename: this.orderInfo.jqpolicyno,
  411. fileurl: res.data[0],
  412. });
  413. } else {
  414. this.$message.error(res.msg);
  415. }
  416. });
  417. this.$api.letter
  418. .ZhongmeigetPolicyPrint({
  419. companyId: this.orderInfo.id,
  420. riskCode: "0507",
  421. type: "1", // 1:标志
  422. })
  423. .then((res) => {
  424. if (res.data && res.data[0]) {
  425. this.oldfileList.push({
  426. fileTitle: "交强电子标志",
  427. filename: this.orderInfo.jqpolicyno,
  428. fileurl: res.data[0],
  429. });
  430. } else {
  431. this.$message.error(res.msg);
  432. }
  433. });
  434. }
  435. if (this.orderInfo.sypolicyno) {
  436. this.$api.letter
  437. .ZhongmeigetPolicyPrint({
  438. companyId: this.orderInfo.id,
  439. riskCode: "0510",
  440. type: "2", //2:保单
  441. })
  442. .then((res) => {
  443. if (res.data && res.data[0]) {
  444. businessList.push({
  445. fileTitle: "商业电子保单",
  446. filename: this.orderInfo.sypolicyno,
  447. fileurl: res.data[0],
  448. });
  449. } else {
  450. this.$message.error(res.msg);
  451. }
  452. });
  453. }
  454. if (this.orderInfo.crossInsurance.length > 0) {
  455. this.orderInfo.crossInsurance.map((ele) => {
  456. this.$api.letter
  457. .ZhongmeigetPolicyPrint({
  458. ridePolicyNo: ele.ridePolicyNo,
  459. companyId: this.orderInfo.id,
  460. riskCode: "0513",
  461. type: "2", //2:保单
  462. })
  463. .then((res) => {
  464. if (res.code == 200 && res.data) {
  465. accidentList.push({
  466. fileTitle: "驾意险保单",
  467. filename: this.orderInfo.sypolicyno,
  468. fileurl: res.data[0],
  469. });
  470. } else {
  471. this.$message.error(res.msg);
  472. }
  473. });
  474. });
  475. }
  476. break;
  477. case "永诚财险":
  478. if (this.orderInfo.jqpolicyno) {
  479. this.$api.letter
  480. .yongchenggetPolicyPrint({
  481. companyId: this.orderInfo.id,
  482. riskCode: "0507",
  483. type: "2", //2:保单
  484. })
  485. .then((res) => {
  486. if (res.code == 200 && res.data) {
  487. if (res.data.jqUrl) {
  488. this.oldfileList.push({
  489. fileTitle: "交强电子保单",
  490. filename: this.orderInfo.jqpolicyno,
  491. fileurl: res.data.jqUrl,
  492. });
  493. }
  494. if (res.data.jqFlagUrl) {
  495. this.oldfileList.push({
  496. fileTitle: "交强电子标志",
  497. filename: this.orderInfo.jqpolicyno,
  498. fileurl: res.data.jqFlagUrl,
  499. });
  500. }
  501. } else {
  502. this.$message.error(res.msg);
  503. }
  504. });
  505. }
  506. if (this.orderInfo.sypolicyno) {
  507. this.$api.letter
  508. .yongchenggetPolicyPrint({
  509. companyId: this.orderInfo.id,
  510. riskCode: "0510",
  511. type: "2", //2:保单
  512. })
  513. .then((res) => {
  514. if (res.data && res.data.syUrl) {
  515. businessList.push({
  516. fileTitle: "商业电子保单",
  517. filename: this.orderInfo.sypolicyno,
  518. fileurl: res.data.syUrl,
  519. });
  520. } else {
  521. this.$message.error(res.msg);
  522. }
  523. });
  524. }
  525. if (this.orderInfo.crossInsurance.length > 0) {
  526. this.orderInfo.crossInsurance.map((ele) => {
  527. this.$api.letter
  528. .yongchenggetPolicyPrint({
  529. companyId: this.orderInfo.id,
  530. policyNumber: ele.policyNumber,
  531. riskCode: "0513",
  532. type: "2", //2:保单
  533. })
  534. .then((res) => {
  535. if (res.code == 200 && res.data) {
  536. accidentList.push({
  537. fileTitle: "驾意险保单",
  538. filename: ele.policyNumber,
  539. fileurl: res.data.jyUrl,
  540. });
  541. } else {
  542. this.$message.error(res.msg);
  543. }
  544. });
  545. });
  546. }
  547. break;
  548. case "国任财险":
  549. if (this.orderInfo.jqpolicyno) {
  550. this.$api.letter
  551. .guoRengetPolicyPrint({
  552. companyId: this.orderInfo.id,
  553. riskCode: "0507",
  554. type: "2", //2:保单
  555. })
  556. .then((res) => {
  557. if (res.data) {
  558. this.oldfileList.push({
  559. fileTitle: "交强电子保单",
  560. filename: this.orderInfo.jqpolicyno,
  561. fileurl: res.data,
  562. });
  563. } else {
  564. this.$message.error(res.msg);
  565. }
  566. });
  567. this.$api.letter
  568. .guoRengetPolicyPrint({
  569. companyId: this.orderInfo.id,
  570. riskCode: "0507",
  571. type: "1", //1:标志
  572. })
  573. .then((res) => {
  574. if (res.data) {
  575. this.oldfileList.push({
  576. fileTitle: "交强电子标志",
  577. filename: this.orderInfo.jqpolicyno,
  578. fileurl: res.data,
  579. });
  580. } else {
  581. this.$message.error(res.msg);
  582. }
  583. });
  584. }
  585. if (this.orderInfo.sypolicyno) {
  586. this.$api.letter
  587. .guoRengetPolicyPrint({
  588. companyId: this.orderInfo.id,
  589. riskCode: "0510",
  590. type: "2", //2:保单
  591. })
  592. .then((res) => {
  593. if (res.data) {
  594. businessList.push({
  595. fileTitle: "商业电子保单",
  596. filename: this.orderInfo.sypolicyno,
  597. fileurl: res.data,
  598. });
  599. } else {
  600. this.$message.error(res.msg);
  601. }
  602. });
  603. }
  604. if (this.orderInfo.crossInsurance.length > 0) {
  605. this.orderInfo.crossInsurance.map((ele) => {
  606. this.$api.letter
  607. .guoRengetPolicyPrint({
  608. companyId: this.orderInfo.id,
  609. policyNumber: ele.policyNumber,
  610. riskCode: "0513",
  611. type: "2", //2:保单
  612. })
  613. .then((res) => {
  614. if (res.data) {
  615. accidentList.push({
  616. fileTitle: "驾意险保单",
  617. filename: ele.policyNumber,
  618. fileurl: res.data,
  619. });
  620. } else {
  621. this.$message.error(res.msg);
  622. }
  623. });
  624. });
  625. }
  626. break;
  627. case "紫金财险":
  628. if (this.orderInfo.jqpolicyno) {
  629. this.$api.letter
  630. .zijingetPolicyPrint({
  631. companyId: this.orderInfo.id,
  632. riskCode: "0507",
  633. type: "2", //2:保单
  634. })
  635. .then((res) => {
  636. if (res.data) {
  637. this.oldfileList.push({
  638. fileTitle: "交强电子保单",
  639. filename: this.orderInfo.jqpolicyno,
  640. fileurl: res.data,
  641. });
  642. } else {
  643. this.$message.error(res.msg);
  644. }
  645. });
  646. this.$api.letter
  647. .zijingetPolicyPrint({
  648. companyId: this.orderInfo.id,
  649. riskCode: "0507",
  650. type: "1", //1:标志
  651. })
  652. .then((res) => {
  653. if (res.data) {
  654. this.oldfileList.push({
  655. fileTitle: "交强电子标志",
  656. filename: this.orderInfo.jqpolicyno,
  657. fileurl: res.data,
  658. });
  659. } else {
  660. this.$message.error(res.msg);
  661. }
  662. });
  663. }
  664. if (this.orderInfo.sypolicyno) {
  665. this.$api.letter
  666. .zijingetPolicyPrint({
  667. companyId: this.orderInfo.id,
  668. riskCode: "0510",
  669. type: "2", //2:保单
  670. })
  671. .then((res) => {
  672. if (res.data) {
  673. businessList.push({
  674. fileTitle: "商业电子保单",
  675. filename: this.orderInfo.sypolicyno,
  676. fileurl: res.data,
  677. });
  678. } else {
  679. this.$message.error(res.msg);
  680. }
  681. });
  682. }
  683. if (this.orderInfo.crossInsurance.length > 0) {
  684. this.orderInfo.crossInsurance.map((ele) => {
  685. this.$api.letter
  686. .zijingetPolicyPrint({
  687. companyId: this.orderInfo.id,
  688. policyNumber: ele.policyNumber,
  689. riskCode: "0513",
  690. type: "2", //2:保单
  691. })
  692. .then((res) => {
  693. if (res.data) {
  694. accidentList.push({
  695. fileTitle: "驾意险保单",
  696. filename: ele.policyNumber,
  697. fileurl: res.data,
  698. });
  699. } else {
  700. this.$message.error(res.msg);
  701. }
  702. });
  703. });
  704. }
  705. break;
  706. case "渤海财险":
  707. if (this.orderInfo.jqpolicyno) {
  708. this.$api.letter
  709. .getPolicyPrintboHai({
  710. companyId: this.orderInfo.id,
  711. })
  712. .then((res) => {
  713. if (res.code == 200 && res.data) {
  714. if (res.data.jqxPolicyUrl) {
  715. this.oldfileList.push({
  716. fileTitle: "交强电子保单",
  717. filename: this.orderInfo.jqpolicyno,
  718. fileurl: res.data.jqxPolicyUrl,
  719. });
  720. }
  721. if (res.data.jqxFlagUrl) {
  722. this.oldfileList.push({
  723. fileTitle: "交强电子标志",
  724. filename: this.orderInfo.jqpolicyno,
  725. fileurl: res.data.jqxFlagUrl,
  726. });
  727. }
  728. if (res.data.syxPolicyUrl) {
  729. businessList.push({
  730. fileTitle: "商业电子保单",
  731. filename: this.orderInfo.sypolicyno,
  732. fileurl: res.data.syxPolicyUrl,
  733. });
  734. }
  735. if (
  736. res.data.jyxInfoList &&
  737. res.data.jyxInfoList.length > 0
  738. ) {
  739. res.data.jyxInfoList.forEach((val) => {
  740. accidentList.push({
  741. fileTitle: "驾意险保单",
  742. filename: "驾意险保单",
  743. fileurl: val.jyx_policy_url,
  744. });
  745. });
  746. }
  747. } else {
  748. this.$message.error(res.msg);
  749. }
  750. });
  751. }
  752. break;
  753. case "恒邦财险":
  754. case "安盛天平":
  755. case "中国人寿":
  756. case "太平财险":
  757. case "华农财险":
  758. case "众安财险":
  759. if (this.orderInfo.jqpolicyno || this.orderInfo.sypolicyno) {
  760. this.$api.letter
  761. .pythongetPolicyPrint({
  762. subOrderNo: this.orderInfo.id,
  763. })
  764. .then((res) => {
  765. if (res.code == 200 && res.data) {
  766. if (res.data.jqxPolicyUrl) {
  767. this.oldfileList.push({
  768. fileTitle: "交强电子保单",
  769. filename: this.orderInfo.jqpolicyno,
  770. fileurl: res.data.jqxPolicyUrl,
  771. });
  772. }
  773. if (res.data.jqxFlagUrl) {
  774. this.oldfileList.push({
  775. fileTitle: "交强电子标志",
  776. filename: this.orderInfo.jqpolicyno,
  777. fileurl: res.data.jqxFlagUrl,
  778. });
  779. }
  780. if (res.data.syxPolicyUrl) {
  781. businessList.push({
  782. fileTitle: "商业电子保单",
  783. filename: this.orderInfo.sypolicyno,
  784. fileurl: res.data.syxPolicyUrl,
  785. });
  786. }
  787. if (
  788. res.data.jyxInfoList &&
  789. res.data.jyxInfoList.length > 0
  790. ) {
  791. res.data.jyxInfoList.forEach((val) => {
  792. accidentList.push({
  793. fileTitle: "驾意险保单",
  794. filename: "驾意险保单",
  795. fileurl: val.jyx_policy_url,
  796. });
  797. });
  798. }
  799. } else {
  800. this.$message.error(res.msg);
  801. }
  802. });
  803. }
  804. break;
  805. case "大家财险":
  806. if (this.orderInfo.jqpolicyno) {
  807. this.$api.letter
  808. .obtainWarranty({
  809. companyId: this.orderInfo.id,
  810. riskCode: "0507",
  811. type: "2", //2:保单
  812. })
  813. .then((res) => {
  814. if (res.data) {
  815. this.oldfileList.push({
  816. fileTitle: "交强电子保单",
  817. filename: this.orderInfo.jqpolicyno,
  818. fileurl: res.data,
  819. });
  820. } else {
  821. this.$message.error(res.msg);
  822. }
  823. });
  824. this.$api.letter
  825. .obtainWarranty({
  826. companyId: this.orderInfo.id,
  827. riskCode: "0507",
  828. type: "1", //1:标志
  829. })
  830. .then((res) => {
  831. if (res.data) {
  832. this.oldfileList.push({
  833. fileTitle: "交强电子标志",
  834. filename: this.orderInfo.jqpolicyno,
  835. fileurl: res.data,
  836. });
  837. } else {
  838. this.$message.error(res.msg);
  839. }
  840. });
  841. }
  842. if (this.orderInfo.sypolicyno) {
  843. this.$api.letter
  844. .obtainWarranty({
  845. companyId: this.orderInfo.id,
  846. riskCode: "0510",
  847. type: "2", //2:保单
  848. })
  849. .then((res) => {
  850. if (res.data) {
  851. businessList.push({
  852. fileTitle: "商业电子保单",
  853. filename: this.orderInfo.sypolicyno,
  854. fileurl: res.data,
  855. });
  856. }
  857. });
  858. }
  859. if (this.orderInfo.crossInsurance.length > 0) {
  860. this.orderInfo.crossInsurance.map((ele) => {
  861. this.$api.letter
  862. .zijingetPolicyPrint({
  863. companyId: this.orderInfo.id,
  864. policyNumber: ele.policyNumber,
  865. riskCode: "0513",
  866. type: "2", //2:保单
  867. })
  868. .then((res) => {
  869. if (res.data) {
  870. accidentList.push({
  871. fileTitle: "驾意险保单",
  872. filename: ele.policyNumber,
  873. fileurl: res.data,
  874. });
  875. } else {
  876. this.$message.error(res.msg);
  877. }
  878. });
  879. });
  880. }
  881. break;
  882. default:
  883. }
  884. let obj = {
  885. oldfileList: this.oldfileList,
  886. businessList,
  887. accidentList
  888. }
  889. this.$refs.detailsDialog.warrantyFun(obj);
  890. }
  891. },
  892. ImageList() {
  893. this.carImageList = [];
  894. this.ownerImageList = []; //车主影像
  895. this.policyImageList = []; //投保人影像
  896. this.insuredImageList = []; //被保人影像
  897. this.carCheckImageList = []; //验车照影像
  898. // 获取影像
  899. this.$api.letter.findByQuoteNo(this.orderInfo.quoteno).then((resImage) => {
  900. Object.keys(resImage.data).forEach((keys) => {
  901. if (resImage.data[keys]) {
  902. resImage.data[keys].url = resImage.data[keys].url
  903. ? process.env.BASE_URL + resImage.data[keys].url
  904. : null;
  905. switch (keys) {
  906. case "C01":
  907. case "D01":
  908. resImage.data[keys].url
  909. ? this.carImageList.push(resImage.data[keys].url)
  910. : "";
  911. break;
  912. case "C02":
  913. case "D02":
  914. resImage.data[keys].url
  915. ? this.ownerImageList.push(resImage.data[keys].url)
  916. : "";
  917. break;
  918. case "C03":
  919. case "D03":
  920. resImage.data[keys].url
  921. ? this.policyImageList.push(resImage.data[keys].url)
  922. : "";
  923. break;
  924. case "C04":
  925. case "D04":
  926. resImage.data[keys].url
  927. ? this.insuredImageList.push(resImage.data[keys].url)
  928. : "";
  929. break;
  930. case "XC00":
  931. case "GC00":
  932. case "GX00":
  933. resImage.data[keys].url
  934. ? this.carCheckImageList.push(resImage.data[keys].url)
  935. : "";
  936. break;
  937. default:
  938. break;
  939. }
  940. }
  941. });
  942. let obj = {
  943. carImageList: this.carImageList,
  944. ownerImageList: this.ownerImageList,
  945. policyImageList: this.policyImageList,
  946. insuredImageList: this.insuredImageList,
  947. carCheckImageList: this.carCheckImageList
  948. }
  949. this.$refs.detailsDialog.imageFun(obj);
  950. });
  951. },
  952. toChinesNum(num) {
  953. if (num.toString().length == 4) {
  954. let overQian = Math.floor(num / 1000);
  955. let result = overQian + "千";
  956. return result;
  957. } else {
  958. let overWan = Math.floor(num / 10000);
  959. let result = overWan + "万";
  960. return result;
  961. }
  962. },
  963. useridFormatter(row, column) {
  964. let data = row.username + `(${row.userid})`
  965. return data;
  966. },
  967. managementSourceFormatter(row, column) {
  968. let managementSource = row.managementSource;
  969. switch (managementSource) {
  970. case '渠道':
  971. return <el-tag>渠道</el-tag>
  972. case '个代':
  973. return <el-tag type="success">个代</el-tag>
  974. case '电销':
  975. return <el-tag type="warning">电销</el-tag>
  976. default:
  977. }
  978. }
  979. }
  980. }