selectInsuranceCompany.vue 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539
  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. console.log(data);
  169. if (data) {
  170. if (data.productId) {
  171. this.productId = data.productId;
  172. this.productName = data.productName;
  173. }
  174. this.quoteno = data.quoteno;
  175. this.carInfo = data.carInfo; //车辆信息
  176. this.ownerInfo = data.ownerInfo; //车主信息
  177. this.policyHolderInfo = data.policyHolderInfo; //投保人信息
  178. this.insuredPersonInfo = data.insuredPersonInfo; //被保人信息
  179. this.carImageListId = data.carImageListId; //车辆影像
  180. this.ownerImageListId = data.ownerImageListId; //车主影像
  181. this.policyHolderImageListId = data.policyHolderImageListId; //投保影像
  182. this.insuredPersonImageListId = data.insuredPersonImageListId; //被保人影像
  183. this.carInfo1.carNatureCode = dictionaryMatch(this.car_nature_codeoptions[0], data
  184. .carInfo
  185. .carNatureCode)
  186. if (data.carInfo.carNatureCode == '01') {
  187. this.carInfo1.vehicleUseCode = dictionaryMatch(this.vehicle_use_code01options[0],
  188. data
  189. .carInfo
  190. .vehicleUseCode)
  191. } else {
  192. this.carInfo1.vehicleUseCode = dictionaryMatch(this.vehicle_use_code02options[0],
  193. data
  194. .carInfo
  195. .vehicleUseCode)
  196. }
  197. this.carInfo1.carTypeCode = dictionaryMatch(this.car_type_codeoptions[0], data
  198. .carInfo
  199. .carTypeCode)
  200. this.carInfo1.carKindCode = dictionaryMatch(this.car_kind_codeoptions[0], data.carInfo
  201. .carKindCode)
  202. this.carInfo1.energyTypeCode = dictionaryMatch(this.energy_type_codeoptions[0], data
  203. .carInfo
  204. .energyTypeCode)
  205. }
  206. })
  207. await this.ruleFilterCompany();
  208. this.loadingShow = false;
  209. } catch (error) {
  210. this.loadingShow = false;
  211. }
  212. },
  213. methods: {
  214. //跳转微信客服
  215. async getWechatCustomer() {
  216. let res = await this.$http.get('/organization/wechat/customerService/manage/find/link')
  217. if (res.code == 200) {
  218. if (plus) { // 确保在App环境下
  219. plus.runtime.openURL(res.data);
  220. }
  221. }
  222. },
  223. async ruleFilterCompany() {
  224. let params = {
  225. carInfo: this.carInfo,
  226. ownerInfo: this.ownerInfo,
  227. applyInfo: this.policyHolderInfo,
  228. insureInfo: this.insuredPersonInfo,
  229. productId: this.productId
  230. }
  231. let res = await this.$http.post('/scheme/ruleFilterCompanyApp', params);
  232. if (res.code == '200') {
  233. this.quotableCompanyList = res.data;
  234. // 遍历 logo数组,检查是否存在匹配
  235. this.companylogoList.forEach(itemA => {
  236. const match = this.quotableCompanyList.find(itemB => itemB.nameSimple === itemA.name);
  237. if (match) {
  238. match.image = itemA.icon;
  239. }
  240. });
  241. } else {
  242. this.quotableCompanyList = [];
  243. uni.showToast({
  244. icon: 'none',
  245. title: res.msg,
  246. });
  247. }
  248. },
  249. async toChooseVin(cctype) {
  250. if (cctype == '' || cctype == null) {
  251. return uni.showToast({
  252. icon: 'none',
  253. title: '请输入车架号',
  254. duration: 1500
  255. });
  256. } else {
  257. if (!this.isFrameno(cctype.trim())) {
  258. return uni.showToast({
  259. title: '请输入正确的车辆识别码',
  260. icon: "none"
  261. });
  262. }
  263. uni.navigateTo({
  264. url: '/pages/quote/queryVehicleModel?frameNo=' + cctype,
  265. })
  266. }
  267. },
  268. //跳转选择车辆类型页面
  269. toChooseVehicleType(cctype) {
  270. if (cctype == '' || cctype == null) {
  271. uni.showToast({
  272. icon: 'none',
  273. title: '请输入车型名称',
  274. duration: 1500
  275. });
  276. } else {
  277. uni.navigateTo({
  278. url: '/pages/quote/queryVehicleModel?modelName=' + cctype,
  279. })
  280. }
  281. },
  282. //验证车架号
  283. isFrameno(str) {
  284. let mPattern = /^([0-9A-Z]){17}$/;
  285. return mPattern.test(str);
  286. },
  287. //数据字典
  288. async getDicType(type, vehicle) {
  289. if (vehicle) {
  290. let res = await this.$http.get(`/dict/get?dictCode=${type}&parentValue=${vehicle}`);
  291. this[type + vehicle + "options"] = [res.data];
  292. } else {
  293. let res = await this.$http.get('/dict/get?dictCode=' + type);
  294. this[type + "options"] = [res.data];
  295. }
  296. },
  297. insuranceTypeclick(item) {
  298. this.productId = item.value;
  299. this.productName = item.label;
  300. this.ruleFilterCompany();
  301. },
  302. back() {
  303. uni.navigateBack(1)
  304. },
  305. next() {
  306. this.$refs.carForm.validate(res => {
  307. if (!res.length) {
  308. if (!this.quotableCompanyList.length) {
  309. return uni.showToast({
  310. title: "暂无可报价保险公司",
  311. icon: 'none',
  312. });
  313. }
  314. uni.navigateTo({
  315. url: '/pages/quote/premiumCalc1',
  316. success: (res) => {
  317. res.eventChannel.emit(
  318. "acceptData", {
  319. carInfo: this
  320. .carInfo,
  321. ownerInfo: this
  322. .ownerInfo,
  323. policyHolderInfo: this
  324. .policyHolderInfo,
  325. insuredPersonInfo: this
  326. .insuredPersonInfo,
  327. carImageListId: this
  328. .carImageListId, //车辆
  329. ownerImageListId: this
  330. .ownerImageListId, //车主
  331. policyHolderImageListId: this
  332. .policyHolderImageListId, //投保
  333. insuredPersonImageListId: this
  334. .insuredPersonImageListId, //被保人
  335. quotableCompanyList: this.quotableCompanyList, //可报价公司
  336. productId: this.productId, //险种id
  337. productName: this
  338. .productName //险种名字
  339. })
  340. }
  341. }, "navigateTo", true);
  342. } else {
  343. uni.$u.toast('车辆信息校验失败')
  344. }
  345. })
  346. }
  347. }
  348. }
  349. </script>
  350. <style lang="scss" scoped>
  351. .page {
  352. background-color: #f8f8f8;
  353. height: 100%;
  354. }
  355. .headerInfo {
  356. width: 100%;
  357. padding: 28rpx 30rpx;
  358. box-sizing: border-box;
  359. background: linear-gradient(0, rgba(255, 254, 245, 0.8) 0%, #FFFFFF 100%), #FFFFFF;
  360. border-radius: 0rpx 0rpx 0rpx 0rpx;
  361. backdrop-filter: blur(40rpx);
  362. .licenseNo {
  363. font-size: 36rpx;
  364. font-weight: bold;
  365. color: #333;
  366. margin-bottom: 4rpx;
  367. image {
  368. width: 42rpx;
  369. height: 42rpx;
  370. margin-right: 8rpx;
  371. }
  372. }
  373. .text {
  374. font-size: 30rpx;
  375. color: #666;
  376. }
  377. }
  378. .content {
  379. padding: 40rpx 30rpx;
  380. box-sizing: border-box;
  381. background: #FFFFFF;
  382. border-radius: 10rpx 10rpx 10rpx 10rpx;
  383. margin-bottom: 138rpx;
  384. .insuranceType {
  385. padding: 24rpx 0;
  386. box-sizing: border-box;
  387. border-bottom: 2rpx solid #EEEEEE;
  388. .tip {
  389. text:first-child {
  390. font-size: 30rpx;
  391. color: #333;
  392. margin-right: 8rpx;
  393. }
  394. text:last-child {
  395. font-size: 26rpx;
  396. color: #999;
  397. }
  398. }
  399. .typeSelect {
  400. margin-top: 24rpx;
  401. .item {
  402. padding: 4rpx 24rpx;
  403. box-sizing: border-box;
  404. border-radius: 4rpx 4rpx 4rpx 4rpx;
  405. border: 2rpx solid #EEEEEE;
  406. color: #333;
  407. font-size: 30rpx;
  408. }
  409. .itemactive {
  410. position: relative;
  411. border: 1px solid #FDE935;
  412. border-radius: 4rpx 4rpx 4rpx 4rpx;
  413. &::after {
  414. content: '';
  415. position: absolute;
  416. right: 0;
  417. bottom: 0;
  418. width: 0;
  419. height: 0;
  420. border-style: solid;
  421. border-width: 0 0 24rpx 24rpx;
  422. /* 调整三角形大小 */
  423. border-color: transparent transparent #FDE935 transparent;
  424. /* 黄色三角形 */
  425. }
  426. &::before {
  427. content: '✓';
  428. position: absolute;
  429. right: 3rpx;
  430. /* 微调位置 */
  431. bottom: 0;
  432. font-size: 14rpx;
  433. /* 调整对勾大小 */
  434. color: #333;
  435. /* 对勾颜色 */
  436. z-index: 1;
  437. /* 确保对勾在三角形上方 */
  438. }
  439. }
  440. }
  441. }
  442. .insuranceCompany {
  443. padding-top: 24rpx;
  444. box-sizing: border-box;
  445. .headertitle {
  446. font-size: 30rpx;
  447. color: #333;
  448. }
  449. .item {
  450. image {
  451. width: 194rpx;
  452. height: 60rpx;
  453. }
  454. }
  455. }
  456. }
  457. .footer {
  458. width: 100%;
  459. height: 138rpx;
  460. background: linear-gradient(0, #FFFFFF 0%, rgba(255, 254, 245, 0.8) 100%);
  461. border-radius: 0rpx 0rpx 0rpx 0rpx;
  462. padding: 25rpx 30rpx;
  463. box-sizing: border-box;
  464. position: fixed;
  465. bottom: 0;
  466. backdrop-filter: blur(40rpx);
  467. .btn {
  468. width: 50%;
  469. color: #1f1f1f;
  470. font-size: 36rpx;
  471. font-weight: bold;
  472. background: #FDE935;
  473. border-radius: 58rpx 58rpx 58rpx 58rpx;
  474. padding: 18rpx;
  475. box-sizing: border-box;
  476. border: 1rpx solid #FDE935;
  477. }
  478. .btn:first-child {
  479. background: transparent;
  480. }
  481. }
  482. .pad {
  483. padding: 20rpx 30rpx;
  484. box-sizing: border-box;
  485. }
  486. ::v-deep {
  487. .uni-input-input {
  488. text-align: right !important;
  489. font-weight: bold;
  490. }
  491. }
  492. .search {
  493. width: 112rpx;
  494. height: 60rpx;
  495. background: #FDE935;
  496. border-radius: 100rpx 100rpx 100rpx 100rpx;
  497. }
  498. </style>