selectInsuranceCompany.vue 15 KB

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