selectInsuranceCompany.vue 15 KB

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