quoteInfo.vue 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852
  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. console.log(data);
  389. this.carInfo = data.carInfo;
  390. this.ownerInfo = data.ownerInfo;
  391. this.policyHolderInfo = data.policyHolderInfo;
  392. this.insuredPersonInfo = data.insuredPersonInfo;
  393. this.carImageListId = data.carImageListId; //车辆
  394. this.ownerImageListId = data.ownerImageListId; //车主
  395. this.policyHolderImageListId = data.policyHolderImageListId; //投保
  396. this.insuredPersonImageListId = data.insuredPersonImageListId; //被保人
  397. this.imageEcho(data.quoteno) // 影像获取完毕
  398. })
  399. }
  400. await this.getDicType("car_nature_code"); //使用性质
  401. await this.getDicType("car_kind_code"); //使用性质
  402. await this.getDicType("vehicle_use_code", "01"); //营业
  403. await this.getDicType("vehicle_use_code", "02"); //非营业
  404. const pages = getCurrentPages(); // 获取当前页面栈的数组,数组的第一项是首页,最后一项是当前页面
  405. const currentPage = pages[pages.length - 1]; // 当前页面实例
  406. const currentPagePath = currentPage.$page.path; // 当前页面的完整路径
  407. this.currentPagePath = currentPagePath;
  408. this.loadingShow = false;
  409. } catch (error) {
  410. this.loadingShow = false;
  411. }
  412. },
  413. methods: {
  414. //影像查询
  415. async imageEcho(quotenos) {
  416. let res = await this.$http.get('/order/taskImages/selectByQuoteNo?quoteNo=' + quotenos);
  417. if (res.code == "200") {
  418. res.data.images.forEach((keys) => {
  419. if (keys.downloadUrl) {
  420. switch (keys.imageType) {
  421. case 'C01':
  422. case 'D01':
  423. this.carInfoImgViewList.push({
  424. img: keys.downloadUrl,
  425. deg: 0,
  426. })
  427. break;
  428. case 'C02':
  429. case 'D02':
  430. this.ownerInfoImgViewList.push({
  431. img: keys.downloadUrl,
  432. deg: 0,
  433. })
  434. break;
  435. case 'C03':
  436. case 'D03':
  437. this.policyHolderInfoImgViewList.push({
  438. img: keys.downloadUrl,
  439. deg: 0,
  440. })
  441. break;
  442. case 'C04':
  443. case 'D04':
  444. this.insuredPersonInfoImgViewList.push({
  445. img: keys.downloadUrl,
  446. deg: 0,
  447. })
  448. break;
  449. default:
  450. break;
  451. }
  452. }
  453. });
  454. }
  455. },
  456. //跳转微信客服
  457. async getWechatCustomer() {
  458. let res = await this.$http.get('/organization/wechat/customerService/manage/find/link')
  459. if (res.code == 200) {
  460. if (plus) { // 确保在App环境下
  461. plus.runtime.openURL(res.data);
  462. }
  463. }
  464. },
  465. //数据字典
  466. async getDicType(type, vehicle) {
  467. if (vehicle) {
  468. let res = await this.$http.get(`/dict/get?dictCode=${type}&parentValue=${vehicle}`);
  469. this[type + vehicle + "options"] = [res.data];
  470. } else {
  471. let res = await this.$http.get('/dict/get?dictCode=' + type);
  472. this[type + "options"] = [res.data];
  473. }
  474. },
  475. //重新上传
  476. reupload(type) {
  477. this.checkType = type;
  478. this.OCRUploadShow = true;
  479. },
  480. //影像识别回调事件
  481. carCallback(obj) {
  482. console.log("🚀 ~ obj:", obj)
  483. this.carInfoImgViewList = [];
  484. if (obj.frontImg) {
  485. this.carInfoImgViewList.push({
  486. img: obj.frontImg,
  487. deg: 0,
  488. })
  489. }
  490. if (obj.backImg) {
  491. this.carInfoImgViewList.push({
  492. img: obj.backImg,
  493. deg: 0,
  494. })
  495. }
  496. this.carImageListId = obj.ImgList;
  497. Object.assign(this.carInfo, obj.Info);
  498. this.OCRUploadShow = false;
  499. },
  500. ownerInfoCallback(obj) {
  501. console.log(obj);
  502. this.ownerInfoImgViewList = [];
  503. if (obj.frontImg) {
  504. this.ownerInfoImgViewList.push({
  505. img: obj.frontImg,
  506. deg: 0,
  507. })
  508. }
  509. if (obj.backImg) {
  510. this.ownerInfoImgViewList.push({
  511. img: obj.backImg,
  512. deg: 0,
  513. })
  514. }
  515. //营业执照图片放入
  516. if (obj.businessLicenseImg) {
  517. this.ownerInfoImgViewList.push({
  518. img: obj.businessLicenseImg,
  519. deg: 0,
  520. })
  521. }
  522. this.ownerImageListId = obj.ImgList;
  523. Object.assign(this.ownerInfo, obj.Info);
  524. console.log(this.ownerInfo);
  525. this.OCRUploadShow = false;
  526. },
  527. applicantInfoCallback(obj) {
  528. this.policyHolderInfoImgViewList = [];
  529. if (obj.frontImg) {
  530. this.policyHolderInfoImgViewList.push({
  531. img: obj.frontImg,
  532. deg: 0,
  533. })
  534. }
  535. if (obj.backImg) {
  536. this.policyHolderInfoImgViewList.push({
  537. img: obj.backImg,
  538. deg: 0,
  539. })
  540. }
  541. //营业执照图片放入
  542. if (obj.businessLicenseImg) {
  543. this.policyHolderInfoImgViewList.push({
  544. img: obj.businessLicenseImg,
  545. deg: 0,
  546. })
  547. }
  548. this.policyHolderImageListId = obj.ImgList;
  549. Object.assign(this.policyHolderInfo, obj.Info);
  550. this.OCRUploadShow = false;
  551. },
  552. InsuredInfoCallback(obj) {
  553. this.insuredPersonInfoImgViewList = [];
  554. if (obj.frontImg) {
  555. this.insuredPersonInfoImgViewList.push({
  556. img: obj.frontImg,
  557. deg: 0,
  558. })
  559. }
  560. if (obj.backImg) {
  561. this.insuredPersonInfoImgViewList.push({
  562. img: obj.backImg,
  563. deg: 0,
  564. })
  565. }
  566. //营业执照图片放入
  567. if (obj.businessLicenseImg) {
  568. this.insuredPersonInfoImgViewList.push({
  569. img: obj.businessLicenseImg,
  570. deg: 0,
  571. })
  572. }
  573. this.insuredPersonImageListId = obj.ImgList;
  574. Object.assign(this.insuredPersonInfo, obj.Info);
  575. this.OCRUploadShow = false;
  576. },
  577. //上传按钮
  578. upload(type) {
  579. this.checkType = type;
  580. this.OCRUploadShow = true;
  581. },
  582. //投保人同车主
  583. async policyHolderholderChange(value) {
  584. console.log(value);
  585. this.policyHolderholder = value;
  586. if (value == '99') {
  587. for (let key in this.policyHolderInfo) {
  588. if (key !== 'identifyType') {
  589. this.policyHolderInfo[key] = '';
  590. }
  591. }
  592. this.policyHolderInfoImgViewList = []
  593. } else {
  594. await this.setPersonInfoAndImageType('owner',
  595. 'policyHolder',
  596. "C03");
  597. this.policyHolderInfo.owner = true;
  598. this.policyHolderInfo = {
  599. ...this.policyHolderInfo
  600. };
  601. }
  602. },
  603. //被保人同车主
  604. async InsuredholderChange(value) {
  605. this.Insuredholder = value;
  606. if (value == '99') {
  607. for (let key in this.insuredPersonInfo) {
  608. if (key !== 'identifyType') {
  609. this.insuredPersonInfo[key] = '';
  610. }
  611. }
  612. this.insuredPersonInfoImgViewList = [];
  613. } else if (value == '1') {
  614. await this.setPersonInfoAndImageType('owner',
  615. 'insuredPerson',
  616. "C04");
  617. this.insuredPersonInfo.owner = true;
  618. this.insuredPersonInfo = {
  619. ...this.insuredPersonInfo
  620. };
  621. } else {
  622. await this.setPersonInfoAndImageType('policyHolder',
  623. 'insuredPerson', "C04");
  624. this.insuredPersonInfo.insuranceHolder = true;
  625. this.insuredPersonInfo = {
  626. ...this.insuredPersonInfo
  627. };
  628. }
  629. },
  630. //图片预览重新上传事件
  631. reviewupload(types) {
  632. console.log(types);
  633. },
  634. //下一步跳转
  635. async next() {
  636. let _this = this;
  637. if (this.policyHolderholder == '1') {
  638. await this.setPersonInfoAndImageType('owner',
  639. 'policyHolder',
  640. "C03");
  641. this.policyHolderInfo.owner = true;
  642. this.policyHolderInfo = {
  643. ...this.policyHolderInfo
  644. };
  645. }
  646. if (this.Insuredholder == '1') {
  647. await this.setPersonInfoAndImageType('owner',
  648. 'insuredPerson',
  649. "C04");
  650. this.insuredPersonInfo.owner = true;
  651. this.insuredPersonInfo = {
  652. ...this.insuredPersonInfo
  653. };
  654. }
  655. if (this.Insuredholder == '2') {
  656. await this.setPersonInfoAndImageType('policyHolder',
  657. 'insuredPerson', "C04");
  658. this.insuredPersonInfo.insuranceHolder = true;
  659. this.insuredPersonInfo = {
  660. ...this.insuredPersonInfo
  661. };
  662. }
  663. this.$refs.carForm.validate(res => {
  664. if (!res.length) {
  665. if (this.activeTab == 0) this.activeTab = 1;
  666. this.$refs.ownerForm.validate(res => {
  667. if (!res.length) {
  668. this.$refs.policyForm.validate(res => {
  669. if (!res.length) {
  670. this.$refs.insuredForm.validate(res => {
  671. if (!res.length) {
  672. uni.navigateTo({
  673. url: '/pages/quote/selectInsuranceCompany',
  674. success: (
  675. res) => {
  676. res.eventChannel
  677. .emit(
  678. "acceptData", {
  679. carInfo: _this
  680. .carInfo,
  681. ownerInfo: _this
  682. .ownerInfo,
  683. policyHolderInfo: _this
  684. .policyHolderInfo,
  685. insuredPersonInfo: _this
  686. .insuredPersonInfo,
  687. riskList: _this
  688. .riskList,
  689. kindList: _this
  690. .kindList,
  691. carImageListId: _this
  692. .carImageListId, //车辆
  693. ownerImageListId: _this
  694. .ownerImageListId, //车主
  695. policyHolderImageListId: _this
  696. .policyHolderImageListId, //投保人
  697. insuredPersonImageListId: _this
  698. .insuredPersonImageListId, //被保人
  699. productId: _this
  700. .productId,
  701. productName: _this
  702. .productName,
  703. quoteno: this
  704. .quoteno
  705. }
  706. )
  707. }
  708. })
  709. } else {
  710. uni.$u.toast('被保人信息校验失败')
  711. }
  712. })
  713. } else {
  714. uni.$u.toast('投保人信息校验失败')
  715. }
  716. })
  717. } else {
  718. uni.$u.toast('车主信息校验失败')
  719. }
  720. })
  721. } else {
  722. uni.$u.toast('车辆信息校验失败')
  723. }
  724. })
  725. },
  726. //(同车主/同投保人)数据处理
  727. setPersonInfoAndImageType(sourceInfo, targetInfo, imageType) {
  728. let obj = JSON.parse(JSON.stringify(this[sourceInfo + 'Info']));
  729. this[targetInfo + 'Info'] = {
  730. ...obj
  731. };
  732. if (this[sourceInfo + 'ImageListId'].length > 0) {
  733. this[targetInfo + 'ImageListId'] = JSON.parse(JSON.stringify(this[sourceInfo +
  734. 'ImageListId']));
  735. if (this[targetInfo + 'ImageListId'].length == 1) {
  736. this[targetInfo + 'ImageListId'][0].imageCode = imageType;
  737. } else {
  738. this[targetInfo + 'ImageListId'][0].imageCode = imageType;
  739. this[targetInfo + 'ImageListId'][1].imageCode = `D${imageType.substr(1)}`;
  740. }
  741. }
  742. },
  743. }
  744. }
  745. </script>
  746. <style lang="scss" scoped>
  747. page {
  748. background-color: #f8f8f8;
  749. }
  750. .page {
  751. background-color: #f8f8f8;
  752. height: 100%;
  753. }
  754. .tabpadding {
  755. padding: 40rpx 30rpx;
  756. box-sizing: border-box;
  757. }
  758. .upload {
  759. height: 88rpx;
  760. border-radius: 58rpx;
  761. border: 2rpx solid #FDE935;
  762. font-size: 36rpx;
  763. color: #1F1F1F;
  764. text {
  765. margin-left: 12rpx;
  766. }
  767. }
  768. .fromregion {
  769. .fromheader {
  770. font-size: 30rpx;
  771. color: #333 !important;
  772. position: relative;
  773. margin-left: 12rpx;
  774. margin-bottom: 12rpx;
  775. text {
  776. font-weight: bold;
  777. }
  778. &::after {
  779. content: '';
  780. display: block;
  781. width: 6rpx;
  782. height: 30rpx;
  783. background: #FDE935;
  784. border-radius: 0rpx 6rpx 6rpx 0rpx;
  785. position: absolute;
  786. left: -12rpx;
  787. top: 50%;
  788. transform: translateY(-50%);
  789. /* 可选圆角 */
  790. }
  791. }
  792. }
  793. .footerBtn {
  794. height: 88rpx;
  795. background: #FDE935;
  796. border-radius: 58rpx 58rpx 58rpx 58rpx;
  797. margin: 30rpx 30rpx 100rpx;
  798. box-sizing: border-box;
  799. font-weight: bold;
  800. font-size: 36rpx;
  801. color: #1F1F1F;
  802. }
  803. ::v-deep {
  804. .uni-input-input {
  805. text-align: right !important;
  806. font-weight: bold;
  807. }
  808. .uni-textarea-textarea {
  809. color: #303133;
  810. font-weight: bold;
  811. }
  812. }
  813. .search {
  814. width: 112rpx;
  815. height: 60rpx;
  816. background: #FDE935;
  817. border-radius: 100rpx 100rpx 100rpx 100rpx;
  818. }
  819. .line {
  820. width: 100%;
  821. height: 10rpx;
  822. background: #FAFAFA;
  823. border-radius: 0rpx 0rpx 0rpx 0rpx;
  824. margin: 24rpx 0;
  825. }
  826. </style>