quoteInfo.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845
  1. <template>
  2. <view class="page">
  3. <u-sticky zIndex="999" customNavHeight="0">
  4. <uni-NavBar headerTitle="完善报价信息" background="#fff" rightText="客服"
  5. iconImage="/static/icon/customerService.png" :isSlot="false" @share="getWechatCustomer"></uni-NavBar>
  6. </u-sticky>
  7. <view class="" style="padding: 20rpx 30rpx 0 ;">
  8. <uni-tab :tabList="tabList" :value="activeTab">
  9. <!-- 第一个标签内容 -->
  10. <template #content0>
  11. <view class=" dis f-c tabpadding">
  12. <view class="">
  13. <uni-documentPreview :images="carInfoImgViewList" v-if="carInfoImgViewList.length>0"
  14. @reupload="reupload" :key="'carInfo-' + carInfoImgViewList.length"
  15. Type="carInfo"></uni-documentPreview>
  16. <view class="upload dis a-c j-c mb-3" v-else @tap="upload('carInfo')">
  17. <u-icon name="plus" color="#1f1f1f" size="36rpx"></u-icon>
  18. <text>上传</text>
  19. </view>
  20. <view class="fromregion">
  21. <view class="fromheader dis a-c j-s">
  22. <text>车辆信息</text>
  23. </view>
  24. <CarInfoForm :carInfo="carInfo" ref="carForm" :carInfos="carInfo1"
  25. :currentPagePath="currentPagePath"
  26. :natureOfVehicleUseoptions="car_nature_codeoptions"
  27. :plateVehicleUseoptions="car_kind_codeoptions"
  28. :businessVehicleUseoptions="vehicle_use_code01options"
  29. :outOfBusinessVehicleUseoptions="vehicle_use_code02options" />
  30. </view>
  31. </view>
  32. </view>
  33. </template>
  34. <!-- 第二个标签内容 -->
  35. <template #content1>
  36. <view class=" dis f-c tabpadding">
  37. <view class="">
  38. <uni-documentPreview :images="ownerInfoImgViewList" v-if="ownerInfoImgViewList.length>0"
  39. :key="'ownerInfo-' + ownerInfoImgViewList.length" @reupload="reupload"
  40. Type="ownerInfo"></uni-documentPreview>
  41. <view class="upload dis a-c j-c mb-3" v-else @tap="upload('ownerInfo')">
  42. <u-icon name="plus" color="#1f1f1f" size="36rpx"></u-icon>
  43. <text>上传</text>
  44. </view>
  45. <view class="fromregion">
  46. <view class="fromheader dis a-c j-s">
  47. <text>车主信息</text>
  48. </view>
  49. <OwnerInfoForm :carInfo="carInfo" :ownerInfo="ownerInfo" ref="ownerForm"
  50. :ownerInfos="ownerInfo1" />
  51. </view>
  52. </view>
  53. <view class="line"></view>
  54. <view class="fromregion">
  55. <view class="fromheader dis a-c j-s">
  56. <text>投保人信息</text>
  57. <view class="dis a-c j-c">
  58. <u-radio-group placement="row" v-model="policyHolderholder"
  59. @change="policyHolderholderChange">
  60. <u-radio v-for="(item, index) in holderstatusList" :key="index"
  61. :label="item.label" :name="item.value" activeColor="#FDE935"
  62. iconColor='#333' labelColor="#333" style="margin-left: 10px">
  63. </u-radio>
  64. </u-radio-group>
  65. </view>
  66. </view>
  67. <view v-show="policyHolderholder=='99'" class="mt-4">
  68. <uni-documentPreview :images="policyHolderInfoImgViewList"
  69. v-if="policyHolderInfoImgViewList.length>0"
  70. :key="'policyHolderInfo-' + policyHolderInfoImgViewList.length" @reupload="reupload"
  71. Type="policyHolderInfo"></uni-documentPreview>
  72. <view class="upload dis a-c j-c mb-3" v-else @tap="upload('policyHolderInfo')">
  73. <u-icon name="plus" color="#1f1f1f" size="36rpx"></u-icon>
  74. <text>上传</text>
  75. </view>
  76. <ApplicantInfoForm :carInfo="carInfo" :policyHolderInfo="policyHolderInfo"
  77. ref="policyForm" :policyHolderInfos="policyHolderInfo1" />
  78. </view>
  79. </view>
  80. <view class="line"></view>
  81. <view class="fromregion">
  82. <view class="fromheader dis a-c j-s">
  83. <text>被保人信息</text>
  84. <view class="dis a-c j-c">
  85. <u-radio-group placement="row" v-model="Insuredholder"
  86. @change="InsuredholderChange">
  87. <u-radio v-for="(item, index) in insuredstatusList" :key="index"
  88. :label="item.label" :name="item.value" activeColor="#FDE935"
  89. iconColor='#333' labelColor="#333" style="margin-left: 10rpx;">
  90. </u-radio>
  91. </u-radio-group>
  92. </view>
  93. </view>
  94. <view v-show="Insuredholder=='99'" class="mt-4">
  95. <uni-documentPreview :images="insuredPersonInfoImgViewList"
  96. v-if="insuredPersonInfoImgViewList.length>0"
  97. :key="'insuredPersonInfo-' + insuredPersonInfoImgViewList.length"
  98. @reupload="reupload" Type="insuredPersonInfo"></uni-documentPreview>
  99. <view class="upload dis a-c j-c mb-3" v-else @tap="upload('insuredPersonInfo')">
  100. <u-icon name="plus" color="#1f1f1f" size="36rpx"></u-icon>
  101. <text>上传</text>
  102. </view>
  103. <InsuredInfoForm :carInfo="carInfo" :insuredPersonInfo="insuredPersonInfo"
  104. ref="insuredForm" :insuredPersonInfos="insuredPersonInfo1" />
  105. </view>
  106. </view>
  107. </view>
  108. </template>
  109. </uni-tab>
  110. </view>
  111. <view class="footerBtn dis a-c j-c mb-5 " @click="next">
  112. <text>下一步</text>
  113. </view>
  114. <uni-OCRUploadPopup :show="OCRUploadShow" :list='carPopuptablist' @close="OCRUploadShow=false"
  115. :checkType="checkType" @carCallback="carCallback" @ownerInfoCallback="ownerInfoCallback"
  116. @applicantInfoCallback="applicantInfoCallback" @InsuredInfoCallback="InsuredInfoCallback">
  117. </uni-OCRUploadPopup>
  118. <!-- 自定义加载动画 -->
  119. <global-loading :show="loadingShow" :text="loadingText"></global-loading>
  120. </view>
  121. </template>
  122. <script>
  123. import CarInfoForm from '@/components/commonFormItem/CarInfoForm.vue';
  124. import OwnerInfoForm from '@/components/commonFormItem/OwnerInfoForm.vue';
  125. import ApplicantInfoForm from '@/components/commonFormItem/ApplicantInfoForm.vue';
  126. import InsuredInfoForm from '@/components/commonFormItem/InsuredInfoForm.vue';
  127. export default {
  128. components: {
  129. CarInfoForm,
  130. OwnerInfoForm,
  131. ApplicantInfoForm,
  132. InsuredInfoForm,
  133. },
  134. data() {
  135. return {
  136. loadingShow: false, //加载
  137. loadingText: '加载中', //加载提示文字
  138. //图片识别
  139. OCRUploadShow: false,
  140. checkType: "carInfo", //信息类型
  141. carPopuptablist: [{
  142. name: '行车本正页',
  143. }, {
  144. name: '行车本副页',
  145. }],
  146. //车辆信息
  147. carInfo: {
  148. licenseNo: "", //车牌号
  149. brandName: "", //车辆品牌型号
  150. vinNo: "", //车架号
  151. engineNo: "", //发动机号
  152. modelCode: "", //车型编码
  153. seatCount: "", //核定载客量 核定载人数
  154. purchasePrice: "", //新车购置价最低,行业实际价值,协商价值
  155. carBrand: "", //车型品牌
  156. ciCarName: "", //行业车型名称
  157. ciModelCode: "", //行业车型编码
  158. completeKerbMass: "", //整备质量
  159. exhaustScale: "", //排量
  160. factory: "", //工厂名称
  161. factoryid: "", //工厂编码
  162. frameNo: "", //车架号
  163. licenseKindCode: "02", //号牌种类
  164. vehicleclass: "", //车辆类型
  165. familyName: "", //车型
  166. modelcname: "", //车型名称
  167. powertypecode: "", //燃料类型编码
  168. vehicleweight: "", //总质量
  169. limitLoad: "", //核定载质量
  170. carYear: "", //年款
  171. carKindCode: "A0", //车辆种类
  172. powertype: "汽油", //燃料类型
  173. energyTypeCode: "0", //能源种类
  174. displacement: "", //排量
  175. powerScale: "", //功率
  176. registerDate: "", //注册日期
  177. issueDate: "", //发证日期
  178. transfer: false, //过户标志
  179. biTransfer: false, //商业过户标志
  180. transferDate: "", //过户日期
  181. loanStatus: 0, //贷款标志
  182. firstBeneMan: "", //第一受益人
  183. noLicenseFlag: false, //是否新车
  184. carTypeCode: "K33", //客车A0 货车H0          
  185. carNatureCode: "02", //使用性质
  186. propertyCode: "1", //所属性质 1个人 2企业 3个人
  187. outOfInsurance: false, //脱保
  188. usedCar: false, //二手车
  189. vehicleUseCode: "05", //车辆用途
  190. property: "1", //所属性质
  191. },
  192. carInfo1: {
  193. property: "个人",
  194. carNatureCode: "非营业",
  195. energyTypeCode: "燃油",
  196. vehicleUseCode: "家庭自用",
  197. carTypeCode: "轿车",
  198. carKindCode: "客车",
  199. },
  200. ownerInfo: {
  201. name: "",
  202. identifyType: "01",
  203. identifyNumber: "",
  204. addr: "",
  205. gender: "", //性别
  206. email: "", //邮箱
  207. mobile: "",
  208. identifyValidDate: "", //有效期起期
  209. identifyValidEndDate: "", //有效期止期
  210. age: "", //年龄
  211. property: '1',
  212. organizationCode: "", //社会信用代码
  213. },
  214. ownerInfo1: {
  215. property: "个人",
  216. identifyType: "身份证",
  217. },
  218. policyHolderInfo1: {
  219. property: "个人",
  220. identifyType: "身份证",
  221. },
  222. insuredPersonInfo1: {
  223. property: "个人",
  224. identifyType: "身份证",
  225. },
  226. policyHolderInfo: {
  227. name: "",
  228. identifyType: "01",
  229. identifyNumber: "",
  230. addr: "",
  231. gender: "", //性别
  232. email: "",
  233. mobile: "",
  234. identifyValidDate: "", //有效期起期
  235. identifyValidEndDate: "", //有效期止期
  236. age: "", //年龄
  237. owner: false,
  238. property: '1',
  239. },
  240. insuredPersonInfo: {
  241. name: "",
  242. identifyType: "01",
  243. identifyNumber: "",
  244. addr: "",
  245. gender: "", //性别
  246. email: "",
  247. mobile: "",
  248. identifyValidDate: "", //有效期起期
  249. identifyValidEndDate: "", //有效期止期
  250. age: "", //年龄
  251. insuranceHolder: false,
  252. owner: false,
  253. property: '1',
  254. },
  255. activeTab: 0, //选项卡默认下标
  256. tabList: [{ //选项卡信息
  257. label: '车辆信息',
  258. id: 0
  259. },
  260. {
  261. label: '关系人信息',
  262. id: 1
  263. }
  264. ],
  265. policyHolderholder: '1',
  266. Insuredholder: '1',
  267. holderstatusList: [{
  268. label: '同车主',
  269. value: "1",
  270. },
  271. {
  272. label: '其他',
  273. value: "99",
  274. },
  275. ],
  276. insuredstatusList: [{
  277. label: '同车主',
  278. value: '1',
  279. },
  280. {
  281. label: '同投保人',
  282. value: '2',
  283. },
  284. {
  285. label: '其他',
  286. value: '99',
  287. },
  288. ],
  289. riskList: [], //交强险和商业险的选择
  290. kindList: [], //商业险险种的选择
  291. //影像id
  292. carImageListId: [], //车辆
  293. ownerImageListId: [], //车主
  294. policyHolderImageListId: [], //投保人
  295. insuredPersonImageListId: [], //被保人
  296. //影像预览
  297. carInfoImgViewList: [],
  298. ownerInfoImgViewList: [],
  299. policyHolderInfoImgViewList: [],
  300. insuredPersonInfoImgViewList: [],
  301. currentPagePath: "", //页面路由
  302. // 字典集合
  303. car_nature_codeoptions: [], //使用性质
  304. car_kind_codeoptions: [], //车辆种类
  305. vehicle_use_code01options: [], //营业
  306. vehicle_use_code02options: [], //非营业
  307. productId: "",
  308. productName: "",
  309. quoteno: "",
  310. }
  311. },
  312. watch: {
  313. checkType: {
  314. handler(val) {
  315. switch (val) {
  316. case 'carInfo':
  317. this.carPopuptablist = [{
  318. name: '行车本正页',
  319. }, {
  320. name: '行车本副页',
  321. }]
  322. break;
  323. default:
  324. this.carPopuptablist = [{
  325. name: '身份证',
  326. }, {
  327. name: '营业执照',
  328. }]
  329. break;
  330. }
  331. },
  332. deep: true
  333. },
  334. //所属性质
  335. 'carInfo.property': {
  336. handler(val) {
  337. switch (val) {
  338. case '1':
  339. //车辆所属性质为个人 修改车主信息
  340. this.ownerInfo.property = "1";
  341. this.policyHolderInfo.property = "1";
  342. this.insuredPersonInfo.property = "1";
  343. this.ownerInfo1.property = "个人";
  344. this.policyHolderInfo1.property = "个人";
  345. this.insuredPersonInfo1.property = "个人";
  346. this.ownerInfo.identifyType = "01";
  347. this.policyHolderInfo.identifyType = "01";
  348. this.insuredPersonInfo.identifyType = "01";
  349. this.ownerInfo1.identifyType = "身份证";
  350. this.policyHolderInfo1.identifyType = "身份证";
  351. this.insuredPersonInfo1.identifyType = "身份证";
  352. break;
  353. case '2':
  354. //车辆所属性质为企业 修改车主信息
  355. this.ownerInfo.property = "2"; //车主类型
  356. this.policyHolderInfo.property = "2";
  357. this.insuredPersonInfo.property = "2";
  358. this.ownerInfo1.property = "法人"; //车主类型
  359. this.policyHolderInfo1.property = "法人";
  360. this.insuredPersonInfo1.property = "法人";
  361. this.ownerInfo.identifyType = "10"; //证件类型
  362. this.policyHolderInfo.identifyType = "10";
  363. this.insuredPersonInfo.identifyType = "10";
  364. this.ownerInfo1.identifyType = "统一社会信用代码"; //证件类型
  365. this.policyHolderInfo1.identifyType = "统一社会信用代码";
  366. this.insuredPersonInfo1.identifyType = "统一社会信用代码";
  367. break;
  368. default:
  369. }
  370. },
  371. deep: true
  372. },
  373. },
  374. onShow() {
  375. },
  376. async onLoad(options) {
  377. this.loadingShow = true;
  378. try {
  379. if (options.info) {
  380. let info = JSON.parse(options.info)
  381. this.carInfo = info.carInfo;
  382. this.carInfoImgViewList = info.carInfoImgViewList;
  383. this.carImageListId = info.carImageListId;
  384. } else {
  385. const eventChannel = this.getOpenerEventChannel()
  386. // 监听acceptData事件,获取上一页面通过eventChannel传送到当前页面的数据
  387. await eventChannel.on('acceptData', (data) => {
  388. this.carInfo = data.carInfo;
  389. this.ownerInfo = data.ownerInfo;
  390. this.policyHolderInfo = data.policyHolderInfo;
  391. this.insuredPersonInfo = data.insuredPersonInfo;
  392. this.carImageListId = data.carImageListId; //车辆
  393. this.ownerImageListId = data.ownerImageListId; //车主
  394. this.policyHolderImageListId = data.policyHolderImageListId; //投保
  395. this.insuredPersonImageListId = data.insuredPersonImageListId; //被保人
  396. this.imageEcho(data.quoteno) // 影像获取完毕
  397. })
  398. }
  399. await this.getDicType("car_nature_code"); //使用性质
  400. await this.getDicType("car_kind_code"); //使用性质
  401. await this.getDicType("vehicle_use_code", "01"); //营业
  402. await this.getDicType("vehicle_use_code", "02"); //非营业
  403. const pages = getCurrentPages(); // 获取当前页面栈的数组,数组的第一项是首页,最后一项是当前页面
  404. const currentPage = pages[pages.length - 1]; // 当前页面实例
  405. const currentPagePath = currentPage.$page.path; // 当前页面的完整路径
  406. this.currentPagePath = currentPagePath;
  407. this.loadingShow = false;
  408. } catch (error) {
  409. this.loadingShow = false;
  410. }
  411. },
  412. methods: {
  413. //影像查询
  414. async imageEcho(quotenos) {
  415. let res = await this.$http.get('/order/taskImages/selectByQuoteNo?quoteNo=' + quotenos);
  416. if (res.code == "200") {
  417. res.data.images.forEach((keys) => {
  418. if (keys.downloadUrl) {
  419. switch (keys.imageType) {
  420. case 'C01':
  421. case 'D01':
  422. this.carInfoImgViewList.push({
  423. img: keys.downloadUrl,
  424. deg: 0,
  425. })
  426. break;
  427. case 'C02':
  428. case 'D02':
  429. this.ownerInfoImgViewList.push({
  430. img: keys.downloadUrl,
  431. deg: 0,
  432. })
  433. break;
  434. case 'C03':
  435. case 'D03':
  436. this.policyHolderInfoImgViewList.push({
  437. img: keys.downloadUrl,
  438. deg: 0,
  439. })
  440. break;
  441. case 'C04':
  442. case 'D04':
  443. this.insuredPersonInfoImgViewList.push({
  444. img: keys.downloadUrl,
  445. deg: 0,
  446. })
  447. break;
  448. default:
  449. break;
  450. }
  451. }
  452. });
  453. }
  454. },
  455. //跳转微信客服
  456. async getWechatCustomer() {
  457. let res = await this.$http.get('/organization/wechat/customerService/manage/find/link')
  458. if (res.code == 200) {
  459. if (plus) { // 确保在App环境下
  460. plus.runtime.openURL(res.data);
  461. }
  462. }
  463. },
  464. //数据字典
  465. async getDicType(type, vehicle) {
  466. if (vehicle) {
  467. let res = await this.$http.get(`/dict/get?dictCode=${type}&parentValue=${vehicle}`);
  468. this[type + vehicle + "options"] = [res.data];
  469. } else {
  470. let res = await this.$http.get('/dict/get?dictCode=' + type);
  471. this[type + "options"] = [res.data];
  472. }
  473. },
  474. //重新上传
  475. reupload(type) {
  476. this.checkType = type;
  477. this.OCRUploadShow = true;
  478. },
  479. //影像识别回调事件
  480. carCallback(obj) {
  481. this.carInfoImgViewList = [];
  482. if (obj.frontImg) {
  483. this.carInfoImgViewList.push({
  484. img: obj.frontImg,
  485. deg: 0,
  486. })
  487. }
  488. if (obj.backImg) {
  489. this.carInfoImgViewList.push({
  490. img: obj.backImg,
  491. deg: 0,
  492. })
  493. }
  494. this.carImageListId = obj.ImgList;
  495. Object.assign(this.carInfo, obj.Info);
  496. this.OCRUploadShow = false;
  497. },
  498. ownerInfoCallback(obj) {
  499. this.ownerInfoImgViewList = [];
  500. if (obj.frontImg) {
  501. this.ownerInfoImgViewList.push({
  502. img: obj.frontImg,
  503. deg: 0,
  504. })
  505. }
  506. if (obj.backImg) {
  507. this.ownerInfoImgViewList.push({
  508. img: obj.backImg,
  509. deg: 0,
  510. })
  511. }
  512. //营业执照图片放入
  513. if (obj.businessLicenseImg) {
  514. this.ownerInfoImgViewList.push({
  515. img: obj.businessLicenseImg,
  516. deg: 0,
  517. })
  518. }
  519. this.ownerImageListId = obj.ImgList;
  520. Object.assign(this.ownerInfo, obj.Info);
  521. this.OCRUploadShow = false;
  522. },
  523. applicantInfoCallback(obj) {
  524. this.policyHolderInfoImgViewList = [];
  525. if (obj.frontImg) {
  526. this.policyHolderInfoImgViewList.push({
  527. img: obj.frontImg,
  528. deg: 0,
  529. })
  530. }
  531. if (obj.backImg) {
  532. this.policyHolderInfoImgViewList.push({
  533. img: obj.backImg,
  534. deg: 0,
  535. })
  536. }
  537. //营业执照图片放入
  538. if (obj.businessLicenseImg) {
  539. this.policyHolderInfoImgViewList.push({
  540. img: obj.businessLicenseImg,
  541. deg: 0,
  542. })
  543. }
  544. this.policyHolderImageListId = obj.ImgList;
  545. Object.assign(this.policyHolderInfo, obj.Info);
  546. this.OCRUploadShow = false;
  547. },
  548. InsuredInfoCallback(obj) {
  549. this.insuredPersonInfoImgViewList = [];
  550. if (obj.frontImg) {
  551. this.insuredPersonInfoImgViewList.push({
  552. img: obj.frontImg,
  553. deg: 0,
  554. })
  555. }
  556. if (obj.backImg) {
  557. this.insuredPersonInfoImgViewList.push({
  558. img: obj.backImg,
  559. deg: 0,
  560. })
  561. }
  562. //营业执照图片放入
  563. if (obj.businessLicenseImg) {
  564. this.insuredPersonInfoImgViewList.push({
  565. img: obj.businessLicenseImg,
  566. deg: 0,
  567. })
  568. }
  569. this.insuredPersonImageListId = obj.ImgList;
  570. Object.assign(this.insuredPersonInfo, obj.Info);
  571. this.OCRUploadShow = false;
  572. },
  573. //上传按钮
  574. upload(type) {
  575. this.checkType = type;
  576. this.OCRUploadShow = true;
  577. },
  578. //投保人同车主
  579. async policyHolderholderChange(value) {
  580. this.policyHolderholder = value;
  581. if (value == '99') {
  582. for (let key in this.policyHolderInfo) {
  583. if (key !== 'identifyType') {
  584. this.policyHolderInfo[key] = '';
  585. }
  586. }
  587. this.policyHolderInfoImgViewList = []
  588. } else {
  589. await this.setPersonInfoAndImageType('owner',
  590. 'policyHolder',
  591. "C03");
  592. this.policyHolderInfo.owner = true;
  593. this.policyHolderInfo = {
  594. ...this.policyHolderInfo
  595. };
  596. }
  597. },
  598. //被保人同车主
  599. async InsuredholderChange(value) {
  600. this.Insuredholder = value;
  601. if (value == '99') {
  602. for (let key in this.insuredPersonInfo) {
  603. if (key !== 'identifyType') {
  604. this.insuredPersonInfo[key] = '';
  605. }
  606. }
  607. this.insuredPersonInfoImgViewList = [];
  608. } else if (value == '1') {
  609. await this.setPersonInfoAndImageType('owner',
  610. 'insuredPerson',
  611. "C04");
  612. this.insuredPersonInfo.owner = true;
  613. this.insuredPersonInfo = {
  614. ...this.insuredPersonInfo
  615. };
  616. } else {
  617. await this.setPersonInfoAndImageType('policyHolder',
  618. 'insuredPerson', "C04");
  619. this.insuredPersonInfo.insuranceHolder = true;
  620. this.insuredPersonInfo = {
  621. ...this.insuredPersonInfo
  622. };
  623. }
  624. },
  625. //图片预览重新上传事件
  626. reviewupload(types) {},
  627. //下一步跳转
  628. async next() {
  629. let _this = this;
  630. if (this.policyHolderholder == '1') {
  631. await this.setPersonInfoAndImageType('owner',
  632. 'policyHolder',
  633. "C03");
  634. this.policyHolderInfo.owner = true;
  635. this.policyHolderInfo = {
  636. ...this.policyHolderInfo
  637. };
  638. }
  639. if (this.Insuredholder == '1') {
  640. await this.setPersonInfoAndImageType('owner',
  641. 'insuredPerson',
  642. "C04");
  643. this.insuredPersonInfo.owner = true;
  644. this.insuredPersonInfo = {
  645. ...this.insuredPersonInfo
  646. };
  647. }
  648. if (this.Insuredholder == '2') {
  649. await this.setPersonInfoAndImageType('policyHolder',
  650. 'insuredPerson', "C04");
  651. this.insuredPersonInfo.insuranceHolder = true;
  652. this.insuredPersonInfo = {
  653. ...this.insuredPersonInfo
  654. };
  655. }
  656. this.$refs.carForm.validate(res => {
  657. if (!res.length) {
  658. if (this.activeTab == 0) this.activeTab = 1;
  659. this.$refs.ownerForm.validate(res => {
  660. if (!res.length) {
  661. this.$refs.policyForm.validate(res => {
  662. if (!res.length) {
  663. this.$refs.insuredForm.validate(res => {
  664. if (!res.length) {
  665. uni.navigateTo({
  666. url: '/pages/quote/selectInsuranceCompany',
  667. success: (
  668. res) => {
  669. res.eventChannel
  670. .emit(
  671. "acceptData", {
  672. carInfo: _this
  673. .carInfo,
  674. ownerInfo: _this
  675. .ownerInfo,
  676. policyHolderInfo: _this
  677. .policyHolderInfo,
  678. insuredPersonInfo: _this
  679. .insuredPersonInfo,
  680. riskList: _this
  681. .riskList,
  682. kindList: _this
  683. .kindList,
  684. carImageListId: _this
  685. .carImageListId, //车辆
  686. ownerImageListId: _this
  687. .ownerImageListId, //车主
  688. policyHolderImageListId: _this
  689. .policyHolderImageListId, //投保人
  690. insuredPersonImageListId: _this
  691. .insuredPersonImageListId, //被保人
  692. productId: _this
  693. .productId,
  694. productName: _this
  695. .productName,
  696. quoteno: this
  697. .quoteno
  698. }
  699. )
  700. }
  701. })
  702. } else {
  703. uni.$u.toast('被保人信息校验失败')
  704. }
  705. })
  706. } else {
  707. uni.$u.toast('投保人信息校验失败')
  708. }
  709. })
  710. } else {
  711. uni.$u.toast('车主信息校验失败')
  712. }
  713. })
  714. } else {
  715. uni.$u.toast('车辆信息校验失败')
  716. }
  717. })
  718. },
  719. //(同车主/同投保人)数据处理
  720. setPersonInfoAndImageType(sourceInfo, targetInfo, imageType) {
  721. let obj = JSON.parse(JSON.stringify(this[sourceInfo + 'Info']));
  722. this[targetInfo + 'Info'] = {
  723. ...obj
  724. };
  725. if (this[sourceInfo + 'ImageListId'].length > 0) {
  726. this[targetInfo + 'ImageListId'] = JSON.parse(JSON.stringify(this[sourceInfo +
  727. 'ImageListId']));
  728. if (this[targetInfo + 'ImageListId'].length == 1) {
  729. this[targetInfo + 'ImageListId'][0].imageCode = imageType;
  730. } else {
  731. this[targetInfo + 'ImageListId'][0].imageCode = imageType;
  732. this[targetInfo + 'ImageListId'][1].imageCode = `D${imageType.substr(1)}`;
  733. }
  734. }
  735. },
  736. }
  737. }
  738. </script>
  739. <style lang="scss" scoped>
  740. page {
  741. background-color: #f8f8f8;
  742. }
  743. .page {
  744. background-color: #f8f8f8;
  745. height: 100%;
  746. }
  747. .tabpadding {
  748. padding: 40rpx 30rpx;
  749. box-sizing: border-box;
  750. }
  751. .upload {
  752. height: 88rpx;
  753. border-radius: 58rpx;
  754. border: 2rpx solid #FDE935;
  755. font-size: 36rpx;
  756. color: #1F1F1F;
  757. text {
  758. margin-left: 12rpx;
  759. }
  760. }
  761. .fromregion {
  762. .fromheader {
  763. font-size: 30rpx;
  764. color: #333 !important;
  765. position: relative;
  766. margin-left: 12rpx;
  767. margin-bottom: 12rpx;
  768. text {
  769. font-weight: bold;
  770. }
  771. &::after {
  772. content: '';
  773. display: block;
  774. width: 6rpx;
  775. height: 30rpx;
  776. background: #FDE935;
  777. border-radius: 0rpx 6rpx 6rpx 0rpx;
  778. position: absolute;
  779. left: -12rpx;
  780. top: 50%;
  781. transform: translateY(-50%);
  782. /* 可选圆角 */
  783. }
  784. }
  785. }
  786. .footerBtn {
  787. height: 88rpx;
  788. background: #FDE935;
  789. border-radius: 58rpx 58rpx 58rpx 58rpx;
  790. margin: 30rpx 30rpx 100rpx;
  791. box-sizing: border-box;
  792. font-weight: bold;
  793. font-size: 36rpx;
  794. color: #1F1F1F;
  795. }
  796. ::v-deep {
  797. .uni-input-input {
  798. text-align: right !important;
  799. font-weight: bold;
  800. }
  801. .uni-textarea-textarea {
  802. color: #303133;
  803. font-weight: bold;
  804. }
  805. }
  806. .search {
  807. width: 112rpx;
  808. height: 60rpx;
  809. background: #FDE935;
  810. border-radius: 100rpx 100rpx 100rpx 100rpx;
  811. }
  812. .line {
  813. width: 100%;
  814. height: 10rpx;
  815. background: #FAFAFA;
  816. border-radius: 0rpx 0rpx 0rpx 0rpx;
  817. margin: 24rpx 0;
  818. }
  819. </style>