quoteInfo.vue 25 KB

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