Mixin.js 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637
  1. export default {
  2. data() {
  3. return {
  4. immediateCoverage: "0", //即时起保标识
  5. transferScene: "0", //过户车标识
  6. biTransferScene: "0", //商业过户标识
  7. secondHandCarScene: "0", //二手车标识
  8. immediateCoverageList: [{ //即时起保选项
  9. label: '是',
  10. value: "1",
  11. },
  12. {
  13. label: '否',
  14. value: "0",
  15. },
  16. ],
  17. transferList: [{ //过户车选项
  18. label: '是',
  19. value: "1",
  20. },
  21. {
  22. label: '否',
  23. value: "0",
  24. },
  25. ],
  26. biTransferList: [{ //商业过户选项
  27. label: '是',
  28. value: "1",
  29. },
  30. {
  31. label: '否',
  32. value: "0",
  33. },
  34. ],
  35. secondHandCarList: [{ //商业过户选项
  36. label: '是',
  37. value: "1",
  38. },
  39. {
  40. label: '否',
  41. value: "0",
  42. },
  43. ],
  44. vehicleAndVesselTaxModel: {
  45. taxRelifFlag: "正常交税",
  46. taxpayerIdentifier: "身份证",
  47. relifReason: "",
  48. taxPaidAreaCode: "",
  49. },
  50. // 车船税信息
  51. vehicleAndVesselTaxVo: {
  52. taxRelifFlag: "1", //类型
  53. identifyNumber: "", //纳税人识别号
  54. taxpayerIdentifier: "01", //纳税人证件类型
  55. taxpayerName: "", //纳税人名称
  56. extendChar2: "", //减免税凭证号
  57. paidFreeCertificate: "", //完税凭证号
  58. relifReason: "", //减免税原因
  59. taxComCode: "", //税务机关代码
  60. taxComName: "", ///税务机关名称
  61. taxDocumentDate: "", //完税日期
  62. taxPaidAreaCode: "", //完税凭证地区代码
  63. taxRelief: "", //减税比例
  64. },
  65. carImageListId: [], //车辆影像
  66. ownerImageListId: [], //车主影像
  67. policyHolderImageListId: [], //投保人影像
  68. insuredPersonImageListId: [], //被保人影像
  69. productId: "", //报价险种code
  70. productName: "", //报价险种name
  71. quotableCompanyList: [], //可报价保险公司列表集合
  72. order: {},
  73. costs: {},
  74. accidentalDrivings: {},
  75. ciRiskInfoVo: { //交强险种大类
  76. amount: 0,
  77. endDate: '',
  78. instantFlag: false,
  79. premium: 0,
  80. riskCode: "0507",
  81. startDate: '',
  82. },
  83. biRiskInfoVo: { //商业险种大类
  84. amount: 0,
  85. endDate: '',
  86. instantFlag: false,
  87. premium: 0,
  88. riskCode: "0510",
  89. startDate: '',
  90. },
  91. quoteno: "", //报价号
  92. // 比价表格字段
  93. optimalColumn: [{
  94. name: 'companyName',
  95. label: '保险公司',
  96. fixed: true,
  97. width: 100,
  98. align: "center",
  99. },
  100. {
  101. name: 'A',
  102. label: '车损险',
  103. formatter: true,
  104. align: "center",
  105. sorter: true,
  106. },
  107. {
  108. name: 'B',
  109. label: '三者责任险',
  110. formatter: true,
  111. align: "center",
  112. sorter: true,
  113. },
  114. {
  115. name: 'D3',
  116. label: '司机责任险',
  117. align: "center",
  118. sorter: true,
  119. },
  120. {
  121. name: 'D4',
  122. label: '乘客责任险',
  123. align: "center",
  124. sorter: true,
  125. },
  126. {
  127. name: 'SY_FJ_YBW1',
  128. label: '附加医保外-三者',
  129. align: "center",
  130. width: 140,
  131. sorter: true,
  132. },
  133. {
  134. name: 'SY_FJ_YBW3',
  135. label: '附加医保外-司机',
  136. align: "center",
  137. width: 140,
  138. sorter: true,
  139. },
  140. {
  141. name: 'SY_FJ_YBW2',
  142. label: '附加医保外-乘客',
  143. align: "center",
  144. width: 140,
  145. sorter: true,
  146. },
  147. {
  148. name: 'TY1',
  149. label: '道路救援服务特约条款',
  150. align: "center",
  151. width: 180,
  152. sorter: true,
  153. },
  154. {
  155. name: 'TY1',
  156. label: '车辆安全检测特约条款',
  157. align: "center",
  158. width: 180,
  159. sorter: true,
  160. },
  161. {
  162. name: 'TY3',
  163. label: '代为驾驶服务特约条款',
  164. align: "center",
  165. width: 180,
  166. sorter: true,
  167. },
  168. {
  169. name: 'TY4',
  170. label: '代为送检服务特约条款',
  171. align: "center",
  172. width: 180,
  173. sorter: true,
  174. },
  175. {
  176. name: 'L',
  177. label: '附加车身划痕损失险',
  178. align: "center",
  179. width: 180,
  180. sorter: true,
  181. },
  182. {
  183. name: 'BD',
  184. label: '附加法定节假日限额翻倍险',
  185. align: "center",
  186. width: 220,
  187. sorter: true,
  188. },
  189. {
  190. name: 'MJ1',
  191. label: '附加绝对免赔率特约条款(车损)',
  192. align: "center",
  193. width: 260,
  194. sorter: true,
  195. },
  196. {
  197. name: 'MJ2',
  198. label: '附加绝对免赔率特约条款(机动车第三者责任保险)',
  199. align: "center",
  200. width: 350,
  201. sorter: true,
  202. },
  203. {
  204. name: 'MJ3',
  205. label: '附加绝对免赔率特约条款(机动车车上人员责任保险(司机))',
  206. align: "center",
  207. width: 420,
  208. sorter: true,
  209. },
  210. {
  211. name: 'MJ4',
  212. label: '附加绝对免赔率特约条款(机动车车上人员责任保险(乘客))',
  213. align: "center",
  214. width: 420,
  215. sorter: true,
  216. },
  217. ],
  218. optimalData: [], //比价列表
  219. // 保险公司icon
  220. companylogoList: [{
  221. name: "中煤财险",
  222. icon: "/static/image/insuranceCompany/zhongmei.png"
  223. }, //华农
  224. {
  225. name: "恒邦财险",
  226. icon: "/static/image/insuranceCompany/hengbang.png"
  227. },
  228. {
  229. name: "安盛天平",
  230. icon: "/static/image/insuranceCompany/ansheng.png"
  231. },
  232. {
  233. name: "中国人寿",
  234. icon: "/static/image/insuranceCompany/renshou.png"
  235. },
  236. {
  237. name: "众安财险",
  238. icon: "/static/image/insuranceCompany/zhongan.png"
  239. },
  240. {
  241. name: "永诚财险",
  242. icon: "/static/image/insuranceCompany/yongcheng.png"
  243. },
  244. {
  245. name: "永安财险",
  246. icon: "/static/image/insuranceCompany/yongan.png"
  247. },
  248. {
  249. name: "紫金财险",
  250. icon: "/static/image/insuranceCompany/zijin.png"
  251. },
  252. {
  253. name: "国任财险",
  254. icon: "/static/image/insuranceCompany/guoren.png"
  255. },
  256. {
  257. name: "华泰财险",
  258. icon: "/static/image/insuranceCompany/huatai.png"
  259. },
  260. {
  261. name: "大家财险",
  262. icon: "/static/image/insuranceCompany/dajia.png"
  263. },
  264. {
  265. name: "太平财险",
  266. icon: "/static/image/insuranceCompany/taiping.png"
  267. },
  268. {
  269. name: "华农财险",
  270. icon: "/static/image/insuranceCompany/huanong.png"
  271. },
  272. {
  273. name: "渤海财险",
  274. icon: "/static/image/insuranceCompany/bohai.png"
  275. },
  276. {
  277. name: "泰康财险",
  278. icon: "/static/image/insuranceCompany/taikang.png"
  279. },
  280. {
  281. name: "诚泰财险",
  282. icon: "/static/image/insuranceCompany/chengtai.png"
  283. },
  284. {
  285. name: "阳光财险",
  286. icon: "/static/image/insuranceCompany/yangguang.png"
  287. },
  288. {
  289. name: "太平洋财险",
  290. icon: "/static/image/insuranceCompany/taipingyang.png"
  291. },
  292. {
  293. name: "泰山财险",
  294. icon: "/static/image/insuranceCompany/taishan.png"
  295. },
  296. ]
  297. };
  298. },
  299. watch: {
  300. // 过户车
  301. 'carInfo.transfer': {
  302. handler(val) {
  303. if (val) {
  304. this.transferScene = '1';
  305. } else {
  306. this.transferScene = '0';
  307. }
  308. },
  309. },
  310. // 商业过户
  311. 'carInfo.biTransfer': {
  312. handler(val) {
  313. if (val) {
  314. this.biTransferScene = '1';
  315. } else {
  316. this.biTransferScene = '0';
  317. }
  318. },
  319. },
  320. //二手车
  321. 'carInfo.secondHandCar': {
  322. handler(val) {
  323. if (val) {
  324. this.secondHandCarScene = '1';
  325. } else {
  326. this.secondHandCarScene = '0';
  327. }
  328. },
  329. },
  330. },
  331. methods: {
  332. //与当前日期对比
  333. isDateBeforeToday(date) {
  334. const inputDate = new Date(date); // 将输入的日期转换为 Date 对象
  335. const today = new Date(); // 获取当前日期
  336. // 比较日期是否小于当前日期
  337. if (inputDate < today) {
  338. return true; // 输入日期小于当前日期
  339. } else {
  340. return false; // 输入日期大于等于当前日期
  341. }
  342. },
  343. //更新车辆性质
  344. transferChange(e, name) {
  345. if (e == 1) {
  346. this.carInfo[name] = true;
  347. if (name == 'transfer') { //过户车给转移登记日期赋值
  348. this.carInfo.transferDate = this.carInfo.issueDate;
  349. }
  350. } else {
  351. this.carInfo[name] = false;
  352. if (name == 'transfer') {
  353. this.carInfo.transferDate = "";
  354. }
  355. }
  356. },
  357. // 比价表格数据格式化
  358. tableformatter(row, column, rowIndex, columnIndex) {
  359. return `${row.age}\n${row.id}`
  360. },
  361. // 表格头部样式
  362. cellheaderStyle() {
  363. return {
  364. color: '#333',
  365. fontSize: '28rpx'
  366. }
  367. },
  368. //影像查询
  369. async imageEcho(list) {
  370. list.forEach((keys) => {
  371. switch (keys.imageCode) {
  372. case 'C01':
  373. this.carImageListId.push({
  374. imageBase64List: [{
  375. imageId: keys.imageBase64List[0].imageId
  376. }],
  377. imageCode: keys.imageCode,
  378. })
  379. break;
  380. case 'D01':
  381. this.carImageListId.push({
  382. imageBase64List: [{
  383. imageId: keys.imageBase64List[0].imageId
  384. }],
  385. imageCode: keys.imageCode,
  386. })
  387. break;
  388. case 'C02':
  389. this.ownerImageListId.push({
  390. imageBase64List: [{
  391. imageId: keys.imageBase64List[0].imageId
  392. }],
  393. imageCode: keys.imageCode,
  394. })
  395. break;
  396. case 'D02':
  397. this.ownerImageListId.push({
  398. imageBase64List: [{
  399. imageId: keys.imageBase64List[0].imageId
  400. }],
  401. imageCode: keys.imageCode,
  402. })
  403. break;
  404. case 'C03':
  405. this.policyHolderImageListId.push({
  406. imageBase64List: [{
  407. imageId: keys.imageBase64List[0].imageId
  408. }],
  409. imageCode: keys.imageCode,
  410. })
  411. break;
  412. case 'D03':
  413. this.policyHolderImageListId.push({
  414. imageBase64List: [{
  415. imageId: keys.imageBase64List[0].imageId
  416. }],
  417. imageCode: keys.imageCode,
  418. })
  419. break;
  420. case 'C04':
  421. this.insuredPersonImageListId.push({
  422. imageBase64List: [{
  423. imageId: keys.imageBase64List[0].imageId
  424. }],
  425. imageCode: keys.imageCode,
  426. })
  427. break;
  428. case 'D04':
  429. this.insuredPersonImageListId.push({
  430. imageBase64List: [{
  431. imageId: keys.imageBase64List[0].imageId
  432. }],
  433. imageCode: keys.imageCode,
  434. })
  435. break;
  436. default:
  437. break;
  438. }
  439. });
  440. },
  441. //保险公司数据前置处理
  442. commpanyList(item) {
  443. let quoteRecord = (item && item.insCompanyVo && item.insCompanyVo[0]) || {};
  444. this.quotableCompanyList.map(ele => {
  445. ele["result"] = {};
  446. ele["quoteCode"] = 0;
  447. ele["checked"] = false;
  448. ele["msg"] = "";
  449. ele["lastYearMsg"] = "";
  450. ele["agreementName"] = "";
  451. ele["apiType"] = "";
  452. ele["coefficient"] = "";
  453. ele["discount"] = "";
  454. ele["isInspect"] = false;
  455. ele["syAdjustRate"] = "";
  456. ele["selectShow"] = false;
  457. ele['underwritingDescription'] = "";
  458. ele['isComparableShow'] = false;
  459. ele['isComparableshowHide'] = false;
  460. ele['isComparableDisabled'] = false;
  461. ele['insurancePlanInfo'] = null;
  462. if (quoteRecord.id && ele.id === quoteRecord.id) {
  463. if (quoteRecord.costs && quoteRecord.costs.sumPremium) {
  464. ele.result = item;
  465. ele.insurancePlanInfo = {};
  466. ele.insurancePlanInfo.drivings = item.accidentalDrivings;
  467. ele.insurancePlanInfo.kinds = item.kindInfoVo.filter(item => item.kindCode != 'J1');
  468. ele.quoteCode = 200;
  469. } else {
  470. ele.result = item;
  471. ele.msg = item.errorMessage;
  472. ele.insurancePlanInfo = {};
  473. ele.insurancePlanInfo.drivings = item.accidentalDrivings;
  474. ele.insurancePlanInfo.kinds = item.kindInfoVo.filter(item => item.kindCode != 'J1');
  475. ele.quoteCode = 3;
  476. }
  477. }
  478. return ele;
  479. })
  480. },
  481. //根据报价险种更新险种大类日期
  482. riskTypeEchoProcessing(code) {
  483. switch (code) {
  484. case '0330':
  485. this.ciRiskInfoVo.startDate = this.jqstartDate;
  486. this.ciRiskInfoVo.endDate = this.jqendDate;
  487. break;
  488. case '034001':
  489. case '034002':
  490. this.biRiskInfoVo.startDate = this.systartDate;
  491. this.biRiskInfoVo.endDate = this.syendDate;
  492. break;
  493. case '0330034002':
  494. case '0330034001':
  495. this.ciRiskInfoVo.startDate = this.jqstartDate;
  496. this.ciRiskInfoVo.endDate = this.jqendDate;
  497. this.biRiskInfoVo.startDate = this.systartDate;
  498. this.biRiskInfoVo.endDate = this.syendDate;
  499. break;
  500. }
  501. },
  502. //跳转微信客服
  503. async getWechatCustomer() {
  504. let res = await this.$http.get('/organization/wechat/customerService/manage/find/link')
  505. if (res.code == 200) {
  506. if (plus) { // 确保在App环境下
  507. plus.runtime.openURL(res.data);
  508. }
  509. }
  510. },
  511. //右上角返回主页
  512. home() {
  513. uni.switchTab({
  514. url: '/pages/index/index'
  515. })
  516. },
  517. back() {
  518. uni.navigateBack(-1)
  519. },
  520. // 数字单位转化
  521. convertedValue(num) {
  522. if (num < 10000) {
  523. return num.toString();
  524. } else if (num < 100000000) {
  525. return (Math.floor(num / 10000 * 10) / 10) + '万';
  526. } else {
  527. return (Math.floor(num / 100000000 * 10) / 10) + '亿';
  528. }
  529. },
  530. // 日期格式化
  531. formatter(type, value) {
  532. if (type === 'year') {
  533. return `${value}年`
  534. }
  535. if (type === 'month') {
  536. return `${value}月`
  537. }
  538. if (type === 'day') {
  539. return `${value}日`
  540. }
  541. if (type === 'hour') {
  542. return `${value}时`
  543. }
  544. if (type === 'minute') {
  545. return `${value}分`
  546. }
  547. return value
  548. },
  549. //计算输入时间一年后的的前一天(输入的参数为字符串("2019-03-02")最终输出也为日期的字符串)
  550. oneYearPast(time) {
  551. var date = new Date(time);
  552. date.setSeconds(date.getSeconds() - 1);
  553. date.setFullYear(date.getFullYear() + 1); //一年后
  554. date.setTime(date.getTime()); //一年后的前一天
  555. var strYear = date.getFullYear();
  556. var strDay = date.getDate();
  557. var strMonth = date.getMonth() + 1;
  558. var hh = date.getHours();
  559. var minutes = date.getMinutes(); // 分
  560. var Seconds = date.getSeconds();
  561. if (hh < 10) {
  562. hh = "0" + hh;
  563. }
  564. if (minutes < 10) {
  565. minutes = "0" + minutes;
  566. }
  567. if (Seconds < 10) {
  568. Seconds = "0" + Seconds;
  569. }
  570. if (strMonth < 10) {
  571. strMonth = "0" + strMonth;
  572. }
  573. if (strDay < 10) {
  574. strDay = "0" + strDay;
  575. }
  576. var datastr =
  577. strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + minutes + ":" + Seconds;
  578. return datastr;
  579. },
  580. //次日
  581. nextday() {
  582. var date = new Date();
  583. date.setFullYear(date.getFullYear());
  584. date.setTime(date.getTime() + 24 * 60 * 60 * 1000);
  585. var strYear = date.getFullYear();
  586. var strDay = date.getDate();
  587. var strMonth = date.getMonth() + 1;
  588. var hh = date.getHours();
  589. if (hh < 10) {
  590. hh = "0" + hh;
  591. }
  592. if (strMonth < 10) {
  593. strMonth = "0" + strMonth;
  594. }
  595. if (strDay < 10) {
  596. strDay = "0" + strDay;
  597. }
  598. var datastr = strYear + "-" + strMonth + "-" + strDay + " " + "00:00:00";
  599. return datastr;
  600. },
  601. //时间转换
  602. transformTime(date) {
  603. var d = new Date(date);
  604. var strYear = d.getFullYear();
  605. var strMonth = d.getMonth() + 1;
  606. var strDay = d.getDate();
  607. var hh = d.getHours();
  608. var minutes = d.getMinutes(); // 分
  609. var Seconds = d.getSeconds();
  610. if (hh < 10) {
  611. hh = "0" + hh;
  612. }
  613. if (minutes < 10) {
  614. minutes = "0" + minutes;
  615. }
  616. if (Seconds < 10) {
  617. Seconds = "0" + Seconds;
  618. }
  619. if (strMonth < 10) {
  620. strMonth = "0" + strMonth;
  621. }
  622. if (strDay < 10) {
  623. strDay = "0" + strDay;
  624. }
  625. var datetime =
  626. strYear + "-" + strMonth + "-" + strDay + " " + hh + ":" + minutes + ":" + Seconds;
  627. return datetime;
  628. },
  629. },
  630. computed: {
  631. },
  632. };