selectInsuranceCompany.vue 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582
  1. <template>
  2. <view class="page">
  3. <view class="headerInfo dis f-c ">
  4. <view class="licenseNo dis a-c ">
  5. <image src="/static/image/licensePlateicon.png" mode=""></image>
  6. <text>{{carInfo.licenseNo}}</text>
  7. </view>
  8. <view class="text dis a-c">
  9. <text class="mr-2">被保人</text>
  10. <text>{{insuredPersonInfo.name}}</text>
  11. </view>
  12. </view>
  13. <view class="pad">
  14. <view class="content">
  15. <CarInfoForm :carInfo="carInfo" ref="carForm" :carInfos="carInfo1" :currentPagePath="currentPagePath"
  16. :natureOfVehicleUseoptions="car_nature_codeoptions" :energyTypeoptions="energy_type_codeoptions"
  17. :trafficManagementVehicleTypeoptions="car_type_codeoptions"
  18. :vehicleTypeoptions="car_kind_codeoptions" :businessVehicleUseoptions="vehicle_use_code01options"
  19. :outOfBusinessVehicleUseoptions="vehicle_use_code02options" @toChooseVin="toChooseVin"
  20. @toChooseVehicleType="toChooseVehicleType" />
  21. <view class="insuranceType dis f-c ">
  22. <view class="tip">
  23. <text>险种信息</text>
  24. <text>(选择下方险种信息后,点击下一步可报价)</text>
  25. </view>
  26. <view class="typeSelect dis a-c j-s f-wrap">
  27. <view class="item" v-for="(item,index) in insurance_typeoptions[0]" :key="index"
  28. @click="insuranceTypeclick(item)" :class="{itemactive:productId===item.value}">
  29. {{item.label}}
  30. </view>
  31. </view>
  32. </view>
  33. <view class="insuranceCompany">
  34. <text class="headertitle">可报价的保险公司</text>
  35. <view class="dis f-wrap j-s " style="margin-top: 24rpx;">
  36. <view class="item" v-for="(item,index) in quotableCompanyList" :key="index">
  37. <image :src="item.image" mode=""></image>
  38. </view>
  39. </view>
  40. </view>
  41. </view>
  42. </view>
  43. <view class="footer dis ">
  44. <view class="btn dis a-c j-c " style="margin-right: 20px;" @click="back">
  45. <text>上一步</text>
  46. </view>
  47. <view class="btn dis a-c j-c" @click="next">
  48. <text>下一步</text>
  49. </view>
  50. </view>
  51. </view>
  52. </template>
  53. <script>
  54. import {
  55. dictionaryMatch
  56. } from '@/plugins/utils';
  57. import CarInfoForm from '@/components/commonFormItem/CarInfoForm.vue';
  58. export default {
  59. components: {
  60. CarInfoForm,
  61. },
  62. data() {
  63. return {
  64. currentPagePath: "",
  65. carInfo: {
  66. licenseNo: "", //车牌号
  67. brandName: "", //车辆品牌型号
  68. vinNo: "", //车架号
  69. engineNo: "", //发动机号
  70. modelCode: "", //车型编码
  71. seatCount: "", //核定载客量 核定载人数
  72. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  73. carBrand: "", //车型品牌
  74. ciCarName: "", //行业车型名称
  75. ciModelCode: "", //行业车型编码
  76. completeKerbMass: "", //整备质量
  77. exhaustScale: "", //排量
  78. factory: "", //工厂名称
  79. factoryid: "", //工厂编码
  80. frameNo: "", //车架号
  81. licenseKindCode: "02", //号牌种类
  82. vehicleclass: "", //车辆类型
  83. familyName: "", //车型
  84. modelcname: "", //车型名称
  85. powertypecode: "", //燃料类型编码
  86. vehicleweight: "", //总质量
  87. limitLoad: "", //核定载质量
  88. caryear: "", //年款
  89. carKindCode: "A0", //车辆种类
  90. powertype: "汽油", //燃料类型
  91. energyTypeCode: "0", //能源种类
  92. displacement: "", //排量
  93. powerScale: "", //功率
  94. registerDate: "", //注册日期
  95. issueDate: "", //发证日期
  96. transferFlag: false, //过户标志
  97. transferFlagBi: false, //商业过户标志
  98. transferDate: "", //过户日期
  99. loanStatus: 0, //贷款标志
  100. firstBeneMan: "", //第一受益人
  101. noLicenseFlag: false, //是否新车
  102. carTypeCode: "K33", //客车A0 货车H0          
  103. carNatureCode: "02", //使用性质 家庭自用8A 非营业企业8B 非营业党政机关,事业团体8C 非营业货车8D
  104. propertyCode: "1", //所属性质 1个人 2企业 3个人
  105. outOfInsurance: false, //脱保
  106. usedCar: false, //二手车
  107. vehicleUseCode: "05" //车辆用途
  108. },
  109. carInfo1: {
  110. carNatureCode: "非营业",
  111. energyTypeCode: "燃油",
  112. vehicleUseCode: "家庭自用",
  113. carTypeCode: "轿车",
  114. carKindCode: "客车",
  115. },
  116. //人员信息
  117. ownerInfo: {},
  118. policyHolderInfo: {},
  119. insuredPersonInfo: {},
  120. //影像id
  121. carInfoPositiveList: [], //车辆
  122. ownerInfoPositiveList: [], //车主
  123. policyHolderInfoPositiveList: [], //投保人
  124. insuredPersonInfoPositiveList: [], //被保人
  125. quotableCompanyList: [], //可报价保险公司
  126. productId: "0330",
  127. productName: "单交",
  128. quoteno: "",
  129. //字典
  130. insurance_typeoptions: [], //险种
  131. car_nature_codeoptions: [], //使用性质
  132. vehicle_use_code01options: [], //营业
  133. vehicle_use_code02options: [], //非营业
  134. car_kind_codeoptions: [], //车辆种类
  135. energy_type_codeoptions: [], //能源类型
  136. car_type_codeoptions: [], //车辆类型
  137. companylogoList: [{
  138. name: "中煤财险",
  139. icon: "/static/image/insuranceCompany/zhongmei.png"
  140. }, //华农
  141. {
  142. name: "恒邦财险",
  143. icon: "/static/image/insuranceCompany/hengbang.png"
  144. },
  145. {
  146. name: "安盛天平",
  147. icon: "/static/image/insuranceCompany/ansheng.png"
  148. },
  149. {
  150. name: "中国人寿",
  151. icon: "/static/image/insuranceCompany/renshou.png"
  152. },
  153. {
  154. name: "众安财险",
  155. icon: "/static/image/insuranceCompany/zhongan.png"
  156. },
  157. {
  158. name: "永诚财险",
  159. icon: "/static/image/insuranceCompany/yongcheng.png"
  160. },
  161. {
  162. name: "永安财险",
  163. icon: "/static/image/insuranceCompany/yongan.png"
  164. },
  165. {
  166. name: "紫金财险",
  167. icon: "/static/image/insuranceCompany/zijin.png"
  168. },
  169. {
  170. name: "国任财险",
  171. icon: "/static/image/insuranceCompany/guoren.png"
  172. },
  173. {
  174. name: "华泰财险",
  175. icon: "/static/image/insuranceCompany/huatai.png"
  176. },
  177. {
  178. name: "大家财险",
  179. icon: "/static/image/insuranceCompany/dajia.png"
  180. },
  181. {
  182. name: "太平财险",
  183. icon: "/static/image/insuranceCompany/taiping.png"
  184. },
  185. {
  186. name: "华农财险",
  187. icon: "/static/image/insuranceCompany/huanong.png"
  188. },
  189. {
  190. name: "渤海财险",
  191. icon: "/static/image/insuranceCompany/bohai.png"
  192. },
  193. {
  194. name: "泰康财险",
  195. icon: "/static/image/insuranceCompany/taikang.png"
  196. },
  197. {
  198. name: "诚泰财险",
  199. icon: "/static/image/insuranceCompany/chengtai.png"
  200. },
  201. {
  202. name: "阳光财险",
  203. icon: "/static/image/insuranceCompany/yangguang.png"
  204. },
  205. ]
  206. }
  207. },
  208. onShow() {
  209. },
  210. async onLoad() {
  211. await this.getDicType("insurance_type");
  212. await this.getDicType("car_nature_code"); //使用性质
  213. await this.getDicType("vehicle_use_code", "01"); //营业
  214. await this.getDicType("vehicle_use_code", "02"); //非营业
  215. await this.getDicType("car_kind_code"); //车辆种类
  216. await this.getDicType("energy_type_code"); //能源类型
  217. await this.getDicType("car_type_code"); //车辆类型
  218. const pages = getCurrentPages(); // 获取当前页面栈的数组,数组的第一项是首页,最后一项是当前页面
  219. const currentPage = pages[pages.length - 1]; // 当前页面实例
  220. const currentPagePath = currentPage.$page.fullPath; // 当前页面的完整路径
  221. this.currentPagePath = currentPagePath;
  222. const eventChannel = this.getOpenerEventChannel()
  223. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  224. eventChannel.on('acceptData', (data) => {
  225. console.log(data);
  226. if (data) {
  227. if (data.productId) {
  228. this.productId = data.productId;
  229. this.productName = data.productName;
  230. }
  231. this.quoteno = data.quoteno;
  232. this.carInfo = data.carInfo; //车辆信息
  233. this.ownerInfo = data.ownerInfo; //车主信息
  234. this.policyHolderInfo = data.policyHolderInfo; //投保人信息
  235. this.insuredPersonInfo = data.insuredPersonInfo; //被保人信息
  236. this.carInfoPositiveList = data.carInfoPositiveList; //车辆影像
  237. this.ownerInfoPositiveList = data.ownerInfoPositiveList; //车主影像
  238. this.policyHolderInfoPositiveList = data.policyHolderInfoPositiveList; //投保影像
  239. this.insuredPersonInfoPositiveList = data.insuredPersonInfoPositiveList; //被保人影像
  240. this.carInfo1.carNatureCode = dictionaryMatch(this.car_nature_codeoptions[0], data.carInfo
  241. .carNatureCode)
  242. if (data.carInfo.carNatureCode == '01') {
  243. this.carInfo1.vehicleUseCode = dictionaryMatch(this.vehicle_use_code01options[0], data
  244. .carInfo
  245. .vehicleUseCode)
  246. } else {
  247. this.carInfo1.vehicleUseCode = dictionaryMatch(this.vehicle_use_code02options[0], data
  248. .carInfo
  249. .vehicleUseCode)
  250. }
  251. this.carInfo1.carTypeCode = dictionaryMatch(this.car_type_codeoptions[0], data
  252. .carInfo
  253. .carTypeCode)
  254. this.carInfo1.carKindCode = dictionaryMatch(this.car_kind_codeoptions[0], data.carInfo
  255. .carKindCode)
  256. this.carInfo1.energyTypeCode = dictionaryMatch(this.energy_type_codeoptions[0], data
  257. .carInfo
  258. .energyTypeCode)
  259. }
  260. })
  261. this.ruleFilterCompany();
  262. },
  263. methods: {
  264. async ruleFilterCompany() {
  265. let params = {
  266. carInfo: this.carInfo,
  267. ownerInfo: this.ownerInfo,
  268. applyInfo: this.policyHolderInfo,
  269. insureInfo: this.insuredPersonInfo,
  270. productId: this.productId
  271. }
  272. let res = await this.$http.post('/scheme/ruleFilterCompany', params);
  273. if (res.code == '200') {
  274. this.quotableCompanyList = res.data;
  275. // 遍历 logo数组,检查是否存在匹配
  276. this.companylogoList.forEach(itemA => {
  277. const match = this.quotableCompanyList.find(itemB => itemB.nameSimple === itemA.name);
  278. if (match) {
  279. match.image = itemA.icon;
  280. }
  281. });
  282. } else {
  283. this.quotableCompanyList = [];
  284. uni.showToast({
  285. icon: 'none',
  286. title: res.msg,
  287. });
  288. }
  289. },
  290. async toChooseVin(cctype) {
  291. if (cctype == '' || cctype == null) {
  292. return uni.showToast({
  293. icon: 'none',
  294. title: '请输入车架号',
  295. duration: 1500
  296. });
  297. } else {
  298. if (!this.isFrameno(cctype.trim())) {
  299. return uni.showToast({
  300. title: '请输入正确的车辆识别码',
  301. icon: "none"
  302. });
  303. }
  304. uni.navigateTo({
  305. url: '/pages/quote/queryVehicleModel?frameNo=' + cctype,
  306. })
  307. }
  308. },
  309. //跳转选择车辆类型页面
  310. toChooseVehicleType(cctype) {
  311. if (cctype == '' || cctype == null) {
  312. uni.showToast({
  313. icon: 'none',
  314. title: '请输入车型名称',
  315. duration: 1500
  316. });
  317. } else {
  318. uni.navigateTo({
  319. url: '/pages/quote/queryVehicleModel?modelName=' + cctype,
  320. })
  321. }
  322. },
  323. //验证车架号
  324. isFrameno(str) {
  325. let mPattern = /^([0-9A-Z]){17}$/;
  326. return mPattern.test(str);
  327. },
  328. //数据字典
  329. async getDicType(type, vehicle) {
  330. if (vehicle) {
  331. let res = await this.$http.get(`/dict/get?dictCode=${type}&parentValue=${vehicle}`);
  332. this[type + vehicle + "options"] = [res.data];
  333. } else {
  334. let res = await this.$http.get('/dict/get?dictCode=' + type);
  335. this[type + "options"] = [res.data];
  336. }
  337. },
  338. insuranceTypeclick(item) {
  339. this.productId = item.value;
  340. this.productName = item.label;
  341. this.ruleFilterCompany();
  342. },
  343. back() {
  344. uni.navigateBack(1)
  345. },
  346. next() {
  347. this.$refs.carForm.validate(res => {
  348. if (!res.length) {
  349. if (!this.quotableCompanyList.length) {
  350. return uni.showToast({
  351. title: "暂无可报价保险公司",
  352. icon: 'none',
  353. });
  354. }
  355. uni.navigateTo({
  356. url: '/pages/quote/premiumCalc',
  357. success: (res) => {
  358. res.eventChannel.emit(
  359. "acceptData", {
  360. carInfo: this
  361. .carInfo,
  362. ownerInfo: this
  363. .ownerInfo,
  364. policyHolderInfo: this
  365. .policyHolderInfo,
  366. insuredPersonInfo: this
  367. .insuredPersonInfo,
  368. carInfoPositiveList: this
  369. .carInfoPositiveList, //车辆
  370. ownerInfoPositiveList: this
  371. .ownerInfoPositiveList, //车主
  372. policyHolderInfoPositiveList: this
  373. .policyHolderInfoPositiveList, //投保
  374. insuredPersonInfoPositiveList: this
  375. .insuredPersonInfoPositiveList, //被保人
  376. quotableCompanyList: this.quotableCompanyList, //可报价公司
  377. productId: this.productId, //险种id
  378. productName: this
  379. .productName //险种名字
  380. })
  381. }
  382. }, "navigateTo", true);
  383. } else {
  384. uni.$u.toast('车辆信息校验失败')
  385. }
  386. })
  387. }
  388. }
  389. }
  390. </script>
  391. <style lang="scss" scoped>
  392. page {
  393. background-color: #f8f8f8;
  394. }
  395. .page {
  396. background-color: #f8f8f8;
  397. height: 100vh;
  398. }
  399. .headerInfo {
  400. width: 100%;
  401. padding: 28rpx 30rpx;
  402. box-sizing: border-box;
  403. background: linear-gradient(0, rgba(255, 254, 245, 0.8) 0%, #FFFFFF 100%), #FFFFFF;
  404. border-radius: 0rpx 0rpx 0rpx 0rpx;
  405. backdrop-filter: blur(40rpx);
  406. .licenseNo {
  407. font-size: 36rpx;
  408. font-weight: bold;
  409. color: #333;
  410. margin-bottom: 4rpx;
  411. image {
  412. width: 42rpx;
  413. height: 42rpx;
  414. margin-right: 8rpx;
  415. }
  416. }
  417. .text {
  418. font-size: 30rpx;
  419. color: #666;
  420. }
  421. }
  422. .content {
  423. padding: 40rpx 30rpx;
  424. box-sizing: border-box;
  425. background: #FFFFFF;
  426. border-radius: 10rpx 10rpx 10rpx 10rpx;
  427. margin-bottom: 158rpx;
  428. .insuranceType {
  429. padding: 24rpx 0;
  430. box-sizing: border-box;
  431. border-bottom: 2rpx solid #EEEEEE;
  432. .tip {
  433. text:first-child {
  434. font-size: 30rpx;
  435. color: #333;
  436. margin-right: 8rpx;
  437. }
  438. text:last-child {
  439. font-size: 26rpx;
  440. color: #999;
  441. }
  442. }
  443. .typeSelect {
  444. margin-top: 24rpx;
  445. .item {
  446. padding: 4rpx 24rpx;
  447. box-sizing: border-box;
  448. border-radius: 4rpx 4rpx 4rpx 4rpx;
  449. border: 2rpx solid #EEEEEE;
  450. color: #333;
  451. font-size: 30rpx;
  452. }
  453. .itemactive {
  454. position: relative;
  455. border: 1px solid #FDE935;
  456. border-radius: 4rpx 4rpx 4rpx 4rpx;
  457. &::after {
  458. content: '';
  459. position: absolute;
  460. right: 0;
  461. bottom: 0;
  462. width: 0;
  463. height: 0;
  464. border-style: solid;
  465. border-width: 0 0 24rpx 24rpx;
  466. /* 调整三角形大小 */
  467. border-color: transparent transparent #FDE935 transparent;
  468. /* 黄色三角形 */
  469. }
  470. &::before {
  471. content: '✓';
  472. position: absolute;
  473. right: 3rpx;
  474. /* 微调位置 */
  475. bottom: 0;
  476. font-size: 14rpx;
  477. /* 调整对勾大小 */
  478. color: #333;
  479. /* 对勾颜色 */
  480. z-index: 1;
  481. /* 确保对勾在三角形上方 */
  482. }
  483. }
  484. }
  485. }
  486. .insuranceCompany {
  487. padding-top: 24rpx;
  488. box-sizing: border-box;
  489. .headertitle {
  490. font-size: 30rpx;
  491. color: #333;
  492. }
  493. .item {
  494. image {
  495. width: 194rpx;
  496. height: 60rpx;
  497. margin-bottom: 24rpx;
  498. }
  499. }
  500. }
  501. }
  502. .footer {
  503. width: 100%;
  504. height: 138rpx;
  505. background: linear-gradient(0, #FFFFFF 0%, rgba(255, 254, 245, 0.8) 100%);
  506. border-radius: 0rpx 0rpx 0rpx 0rpx;
  507. padding: 25rpx 30rpx;
  508. box-sizing: border-box;
  509. position: fixed;
  510. bottom: 0;
  511. backdrop-filter: blur(40rpx);
  512. .btn {
  513. width: 50%;
  514. color: #1f1f1f;
  515. font-size: 36rpx;
  516. font-weight: bold;
  517. background: #FDE935;
  518. border-radius: 58rpx 58rpx 58rpx 58rpx;
  519. padding: 18rpx;
  520. box-sizing: border-box;
  521. border: 1rpx solid #FDE935;
  522. }
  523. .btn:first-child {
  524. background: transparent;
  525. }
  526. }
  527. .pad {
  528. padding: 20rpx 30rpx;
  529. box-sizing: border-box;
  530. }
  531. ::v-deep {
  532. .uni-input-input {
  533. text-align: right !important;
  534. font-weight: bold;
  535. }
  536. }
  537. .search {
  538. width: 112rpx;
  539. height: 60rpx;
  540. background: #FDE935;
  541. border-radius: 100rpx 100rpx 100rpx 100rpx;
  542. }
  543. </style>