quotation.vue 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706
  1. <template>
  2. <view style="height: 100vh;position: relative;">
  3. <view class="page" id="panelcanvas">
  4. <image src="../../static/image/car-insure/baojiadan.png" mode=""
  5. style="width: 100%;height: 450px;position: absolute;"></image>
  6. <view class="content">
  7. <view class="price dis a-c j-c">
  8. <image :src="logoimg" mode="" style="width: 20px;height: 20px;">
  9. </image>
  10. <text style="font-weight: bold;margin-left: 6px; font-size: 16px;">{{dataInfo.inscompany}}报价单</text>
  11. </view>
  12. <view
  13. style="background-color: #fff;border-radius:0 0 6px 6px ; box-shadow: 0px 4px 10px 0px rgba(123,160,239,0.2);"
  14. class="dis a-c j-c p-2 ">
  15. <view style="font-size: 15px;font-weight: bold;" class="dis j-s a-c ">
  16. <text style="color: #232832;">订单编号:{{dataInfo.orderno}}</text>
  17. </view>
  18. </view>
  19. </view>
  20. <view style="padding:0 16px;position: relative;">
  21. <view class="information">
  22. <text class="title">车辆信息</text>
  23. <view class="dis j-s a-c">
  24. <text>车牌号:</text>
  25. <text>{{dataInfo.orderno}}</text>
  26. </view>
  27. <view class="dis j-s a-c">
  28. <text>品牌型号:</text>
  29. <text>{{dataInfo.orderno}}</text>
  30. </view>
  31. <view class="dis j-s a-c">
  32. <text>发动机号:</text>
  33. <text>{{carinfo.engineNo}}</text>
  34. </view>
  35. <view class="dis j-s a-c">
  36. <text>座位数:</text>
  37. <text>{{carinfo.seatCount}}</text>
  38. </view>
  39. </view>
  40. <view class="information">
  41. <text class="title">人员信息</text>
  42. <view class="dis j-s a-c">
  43. <text>车主姓名:</text>
  44. <text>{{ownerinfo.name}}</text>
  45. </view>
  46. <view class="dis j-s a-c">
  47. <text>车主身份证号:</text>
  48. <text>{{ownerinfo.identifyNumber}}</text>
  49. </view>
  50. <view class="dis j-s a-c">
  51. <text>投保人姓名:</text>
  52. <text>{{applyinfo.name}}</text>
  53. </view>
  54. <view class="dis j-s a-c">
  55. <text>投保人身份证号:</text>
  56. <text>{{ownerinfo.identifyNumber}}</text>
  57. </view>
  58. <view class="dis j-s a-c">
  59. <text>被保人姓名:</text>
  60. <text>{{insureinfo.name}}</text>
  61. </view>
  62. <view class="dis j-s a-c">
  63. <text>被保人身份证号:</text>
  64. <text>{{ownerinfo.identifyNumber}}</text>
  65. </view>
  66. </view>
  67. <view class="information">
  68. <text class="title">保费信息</text>
  69. <view class="dis j-s f-c" v-if="dataInfo.jqpremium">
  70. <view class="dis j-s a-c">
  71. <text>交强险:</text>
  72. <text>¥{{dataInfo.jqpremium}}</text>
  73. </view>
  74. <view class="dis f-c">
  75. <text style="color: rgba(35,40,50,0.9);">起保日期:{{dataInfo.jqstartdate}}</text>
  76. <text style="color: rgba(35,40,50,0.9);">终保日期:{{dataInfo.jqenddate}}</text>
  77. </view>
  78. <view class="dis f-c" style="background-color: #F9F9F9;border-radius: 10px;padding: 6px;">
  79. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  80. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  81. <text style="color: rgba(35,40,50,0.8)">保额</text>
  82. </view>
  83. <view class="dis j-s a-c" v-for="(item,index) in dataInfo.jqInsuranceType" :key="index"
  84. style="margin-top: 6px;">
  85. <text>{{item.name}}</text>
  86. <text>{{item.amount}}</text>
  87. </view>
  88. </view>
  89. </view>
  90. <view class="dis j-s a-c">
  91. <text>车船税:</text>
  92. <text>{{ownerinfo.identifyNumber}}</text>
  93. </view>
  94. <view class="dis f-c j-s " v-if="dataInfo.sypremium">
  95. <view class="dis j-s a-c">
  96. <text>商业险</text>
  97. <text>¥{{dataInfo.sypremium}}</text>
  98. </view>
  99. <view class="dis f-c">
  100. <text style="color: rgba(35,40,50,0.9);">起保日期:{{dataInfo.systartdate}}</text>
  101. <text style="color: rgba(35,40,50,0.9);">终保日期:{{dataInfo.syenddate}}</text>
  102. </view>
  103. <view class=" dis j-s f-c p-2"
  104. style="border: none;background-color: #F9F9F9;border-radius: 10px;">
  105. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  106. <view class="dis j-start" style="width: 50%;">
  107. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  108. </view>
  109. <view class="dis j-c" style="width: 25%;">
  110. <text style="color: rgba(35,40,50,0.8)">保额</text>
  111. </view>
  112. <view class="dis j-end" style="width: 25%;">
  113. <text style="color: rgba(35,40,50,0.8)">保费(元)</text>
  114. </view>
  115. </view>
  116. <view class="coverage-sum dis j-s" v-for="(item,index) in dataInfo.kindinfo" :key="index"
  117. style="margin-top: 6px;">
  118. <view style="width: 50%;" class="dis a-c j-start">
  119. <text>{{item.kindName}}</text>
  120. </view>
  121. <view style="width: 25%;" class="dis a-c j-c"
  122. v-if="['D4', 'SY_FJ_YBW2'].includes(item.kindCode)">
  123. <text>{{item.unitAmount}}/座*{{dataInfo.carinfo.seatCount-1}}</text>
  124. </view>
  125. <view style="width: 25%;" class="dis a-c j-c"
  126. v-else-if="['MJ1', 'MJ2', 'MJ3', 'MJ4'].includes(item.kindCode)">
  127. <text>{{item.deductibleRate}}</text>
  128. </view>
  129. <view style="width: 25%;" class="dis a-c j-c"
  130. v-else-if="['TY1', 'TY2', 'TY3', 'TY4'].includes(item.kindCode)">
  131. <text>{{item.serviceTimes}}/次</text>
  132. </view>
  133. <view style="width: 25%;" class="dis a-c j-c" v-else>
  134. <text>{{item.amount}}</text>
  135. </view>
  136. <view style="width: 25%;" class="dis a-c j-end">
  137. <text>¥{{item.coveragePremium}}</text>
  138. </view>
  139. </view>
  140. </view>
  141. </view>
  142. <view class="dis f-c j-s " v-if="dataInfo.jypremium">
  143. <view class="dis j-s a-c">
  144. <text>附加险:意外险</text>
  145. <text>¥{{dataInfo.jypremium}}</text>
  146. </view>
  147. <view class=" dis j-s f-c p-2" v-if="dataInfo.accidentInfo.length>0"
  148. style="border: none;background-color: #F9F9F9;border-radius: 10px;">
  149. <view class="dis j-s a-c" style="border-bottom: 1px solid #f2f2f2;">
  150. <view class="dis j-start" style="width: 50%;">
  151. <text style="color: rgba(35,40,50,0.8)">险别/名称</text>
  152. </view>
  153. <view class="dis j-c" style="width: 25%;">
  154. <text style="color: rgba(35,40,50,0.8)">保额</text>
  155. </view>
  156. <view class="dis j-end" style="width: 25%;">
  157. <text style="color: rgba(35,40,50,0.8)">保费(元)</text>
  158. </view>
  159. </view>
  160. <view class="coverage-sum dis j-s" v-for="(item,index) in dataInfo.accidentInfo"
  161. :key="index" style="margin-top: 6px;">
  162. <view style="width: 50%;" class="dis a-c j-start">
  163. <text>{{item.name}}</text>
  164. </view>
  165. <view style="width: 25%;" class="dis a-c j-c">
  166. <text>{{item.amount}}</text>
  167. </view>
  168. <view style="width: 25%;" class="dis a-c j-c">
  169. <text>{{item.premium}}</text>
  170. </view>
  171. </view>
  172. </view>
  173. </view>
  174. <view class="dis j-s a-c">
  175. <text>应缴金额:</text>
  176. <text style="color: #0052FF;font-weight: bold;">¥{{dataInfo.sumpremium}}</text>
  177. </view>
  178. </view>
  179. </view>
  180. <kxj-watermark type="fixation" color="#333" :texts="texts" :count="12"></kxj-watermark>
  181. </view>
  182. <view class="fixed-bottom">
  183. <u-button type="primary" style="background-color:#0052FF ;" @tap="sendPayCode">发送微信</u-button>
  184. </view>
  185. </view>
  186. </template>
  187. <script>
  188. import {
  189. mapState,
  190. mapMutations
  191. } from 'vuex';
  192. import kxjWatermark from '@/components/common/kxj-watermark/kxj-watermark.vue'
  193. import {
  194. pathToBase64,
  195. base64ToPath
  196. } from '@/common/pdf.js'
  197. export default {
  198. components: {
  199. kxjWatermark
  200. },
  201. data() {
  202. return {
  203. texts: [],
  204. payImg: "",
  205. posterUrl: "",
  206. caricon: "", //carlogo
  207. show: false,
  208. companyId: "",
  209. dataInfo: {},
  210. carinfo: {}, //车辆信息
  211. ownerinfo: {}, //车主信息
  212. applyinfo: {}, //投保人信息
  213. insureinfo: {}, //被保人信息
  214. insCompanyList: [{
  215. name: "中煤财险",
  216. icon: "../../static/insuranceicon/zhongmei.png"
  217. }, //华农
  218. {
  219. name: "恒邦财险",
  220. icon: "../../static/insuranceicon/hengbang.png"
  221. },
  222. {
  223. name: "安盛天平",
  224. icon: "../../static/insuranceicon/ansheng.png"
  225. },
  226. {
  227. name: "中国人寿",
  228. icon: "../../static/insuranceicon/renshou.png"
  229. },
  230. {
  231. name: "众安财险",
  232. icon: "../../static/insuranceicon/zhongan.png"
  233. },
  234. {
  235. name: "永诚财险",
  236. icon: "../../static/insuranceicon/yongcheng.png"
  237. },
  238. {
  239. name: "永安财险",
  240. icon: "../../static/insuranceicon/yongan.png"
  241. },
  242. {
  243. name: "紫金财险",
  244. icon: "../../static/insuranceicon/zijin.png"
  245. },
  246. {
  247. name: "国任财险",
  248. icon: "../../static/insuranceicon/guoren.png"
  249. },
  250. {
  251. name: "华泰财险",
  252. icon: "../../static/insuranceicon/huatai.png"
  253. },
  254. {
  255. name: "大家财险",
  256. icon: "../../static/insuranceicon/dajia.png"
  257. },
  258. {
  259. name: "太平财险",
  260. icon: "../../static/insuranceicon/taiping.png"
  261. },
  262. {
  263. name: "华农财险",
  264. icon: "../../static/insuranceicon/huanong.png"
  265. },
  266. {
  267. name: "渤海财险",
  268. icon: "../../static/insuranceicon/bohai.png"
  269. },
  270. ],
  271. logoimg: "",
  272. }
  273. },
  274. computed: {
  275. ...mapState(["userLoginId"])
  276. },
  277. async onLoad(options) {
  278. this.texts = [this.userLoginId]
  279. this.companyId = options.companyId;
  280. let params = {
  281. companyId: options.companyId
  282. };
  283. let res = await this.$http.post('/insurance/order/getByCompanyId', params);
  284. var data = res.data;
  285. data.kindinfo.map((ele, index) => {
  286. switch (ele.kindCode) {
  287. case "A":
  288. if (ele.amount == 1) {
  289. ele.amount = "投保"
  290. } else {
  291. ele.amount = ele.amount
  292. }
  293. break;
  294. case "D4":
  295. case "SY_FJ_YBW2":
  296. ele.unitAmount = this.toChinesNum(ele.unitAmount);
  297. break;
  298. case "MJ1":
  299. case "MJ2":
  300. case "MJ3":
  301. case "MJ4":
  302. ele.deductibleRate = ele.deductibleRate + "%";
  303. break;
  304. default:
  305. ele.amount = this.toChinesNum(ele.amount);
  306. }
  307. return ele;
  308. });
  309. this.insCompanyList.map(ele => {
  310. if (ele.name == data.inscompany) {
  311. uni.getImageInfo({
  312. src: ele.icon,
  313. success: image => {
  314. pathToBase64(image.path)
  315. .then(base64 => {
  316. this.logoimg = base64;
  317. })
  318. .catch(error => {});
  319. },
  320. fail: err => {}
  321. });
  322. }
  323. return ele;
  324. })
  325. this.dataInfo = data;
  326. this.carinfo = data.carinfo;
  327. this.ownerinfo = data.ownerinfo;
  328. this.applyinfo = data.applyinfo;
  329. this.insureinfo = data.insureinfo;
  330. uni.getImageInfo({
  331. src: '../../static/icon/bjdcar.png',
  332. success: image => {
  333. pathToBase64(image.path)
  334. .then(base64 => {
  335. this.caricon = base64
  336. })
  337. .catch(error => {});
  338. },
  339. });
  340. },
  341. methods: {
  342. //页面返回按钮
  343. back() {
  344. uni.navigateBack({
  345. delta: 1, // 返回的页面数,如果是1表示返回上一页
  346. success: function() {}
  347. });
  348. },
  349. //本地图片转换成base64
  350. turnBase64Image() {
  351. this.
  352. uni.getImageInfo({
  353. src: img,
  354. success: image => {
  355. pathToBase64(image.path)
  356. .then(base64 => {
  357. this[key] = base64;
  358. })
  359. .catch(error => {});
  360. },
  361. fail: err => {}
  362. });
  363. },
  364. toChinesNum(num) {
  365. let overWan = Math.floor(num / 10000);
  366. let result = overWan + "万";
  367. return result;
  368. },
  369. //分享图片到微信
  370. sendPayCode() {
  371. if (this.payImg) {
  372. uni.share({
  373. provider: "weixin",
  374. scene: "WXSceneSession",
  375. type: 2,
  376. imageUrl: this.payImg
  377. })
  378. }
  379. },
  380. //页面截图转路径
  381. receiveRenderData(val) {
  382. this.posterUrl = val.replace(/[\r\n]/g, ''); // 去除base64位中的空格
  383. const imageStr = this.posterUrl;
  384. // 将base64转化为临时地址
  385. base64ToPath(imageStr).then(path => {
  386. this.payImg = path
  387. }).catch(error => {});
  388. },
  389. showLoading() {
  390. uni.showLoading({
  391. title: '正在生成图片'
  392. });
  393. },
  394. hideLoading() {
  395. uni.hideLoading();
  396. },
  397. },
  398. }
  399. </script>
  400. <script module="canvasImage" lang="renderjs">
  401. import html2canvas from 'html2canvas'
  402. export default {
  403. data() {
  404. return {
  405. }
  406. },
  407. mounted() {
  408. // #ifdef APP-PLUS
  409. setTimeout(() => {
  410. this.canvasImage.generateImage()
  411. }, 1000);
  412. // #endif
  413. },
  414. methods: {
  415. // #ifdef APP-PLUS
  416. generateImage() {
  417. setTimeout(() => {
  418. this.$ownerInstance.callMethod('showLoading')
  419. const dom = document.getElementById('panelcanvas') // 需要生成图片内容的 dom 节点
  420. html2canvas(dom, {
  421. width: dom.clientWidth, //dom 原始宽度
  422. height: dom.clientHeight,
  423. scrollY: 0, // html2canvas默认绘制视图内的页面,需要把scrollY,scrollX设置为0
  424. scrollX: 0,
  425. useCORS: true, //支持跨域
  426. // allowTaint: false,
  427. scale: 3, // 设置生成图片的像素比例,默认是1,如果生成的图片模糊的话可以开启该配置项
  428. }).then((canvas) => {
  429. // 生成成功
  430. this.$ownerInstance.callMethod('hideLoading')
  431. this.$ownerInstance.callMethod('receiveRenderData', canvas.toDataURL('image/png'))
  432. }).catch(err => {
  433. // 生成失败 弹出提示弹窗
  434. this.$ownerInstance.callMethod('_errAlert', `【生成图片失败,请重试】${err}`)
  435. })
  436. }, 300)
  437. }
  438. // #endif
  439. },
  440. }
  441. </script>
  442. <style lang="scss" scoped>
  443. @import '@/style/mixin.scss';
  444. .page {
  445. background-color: #F8FAFE;
  446. padding-bottom: 100px;
  447. box-sizing: border-box;
  448. }
  449. .fixed-bottom {
  450. position: fixed;
  451. bottom: 0;
  452. width: 100%;
  453. height: 62px;
  454. background-color: #FFFFFF;
  455. padding: 16px;
  456. box-shadow: 0px -4px 10px 0px #DAE3F4;
  457. border-radius: 0px 0px 0px 0px;
  458. }
  459. .content {
  460. width: 100%;
  461. height: auto;
  462. padding: 16px 16px 0;
  463. position: relative;
  464. .price {
  465. width: 100%;
  466. height: 40px;
  467. background: #FFFFFF;
  468. border-radius: 6px 6px 0px 0px;
  469. }
  470. }
  471. .information {
  472. width: 100%;
  473. height: auto;
  474. background-color: #fff;
  475. box-shadow: 0px 4px 10px 0px #DAE3F4;
  476. border-radius: 6px;
  477. margin-top: 10px;
  478. padding: 10px 10px 0;
  479. >view {
  480. padding: 10px 0;
  481. border-bottom: 1px solid #f2f2f2;
  482. text {
  483. font-size: 14px;
  484. color: #232832;
  485. }
  486. }
  487. .title {
  488. font-size: 15px;
  489. color: #232832;
  490. font-weight: bold;
  491. }
  492. :last-child {
  493. border: none;
  494. }
  495. }
  496. .Basic-information {
  497. background-color: white;
  498. width: 100%;
  499. height: auto;
  500. .basic-logo {
  501. padding: 10px 16px;
  502. border-bottom: 1px solid #f2f2f2;
  503. image {
  504. width: 50px;
  505. height: 50px;
  506. margin-right: 20px;
  507. }
  508. text {
  509. font-size: 12px;
  510. }
  511. text:first-child {
  512. font-weight: bold;
  513. font-size: 18px;
  514. }
  515. }
  516. .basic-data {
  517. padding: 16px;
  518. .arrange {
  519. margin: 4px 0;
  520. font-size: 14px;
  521. text:first-child {
  522. font-weight: bold;
  523. margin-right: 5px;
  524. }
  525. text:last-child {
  526. color: #606266;
  527. }
  528. &::before {
  529. content: "·";
  530. color: #606266;
  531. margin-right: 10px;
  532. font-weight: bold;
  533. }
  534. }
  535. }
  536. .bjdCarSum {
  537. padding: 10px 16px;
  538. border-bottom: 1px solid #f2f2f2;
  539. font-weight: bold;
  540. font-size: 14px;
  541. }
  542. .coverage {
  543. padding: 10px 16px;
  544. .coverage-title {
  545. width: 100%;
  546. view:first-child {
  547. border-top-left-radius: 8px;
  548. }
  549. view:last-child {
  550. border-top-right-radius: 8px;
  551. }
  552. view:nth-child(2) {
  553. border-left: none;
  554. border-right: none;
  555. }
  556. view {
  557. width: 33.33%;
  558. text-align: center;
  559. background: #ff8f63;
  560. color: #fff;
  561. padding: 6px 16px;
  562. border: 1px solid #fff;
  563. font-size: 12px;
  564. box-sizing: border-box;
  565. }
  566. }
  567. .coverage-sum {
  568. width: 100%;
  569. view {
  570. font-size: 12px;
  571. padding: 6px 16px;
  572. }
  573. }
  574. }
  575. }
  576. .Circle {
  577. position: relative;
  578. &::before {
  579. display: block;
  580. content: "";
  581. position: absolute;
  582. width: 10px;
  583. height: 10px;
  584. background: #92b5fe;
  585. top: -5px;
  586. left: -15px;
  587. border-radius: 50%;
  588. }
  589. &::after {
  590. content: "";
  591. position: absolute;
  592. width: 10px;
  593. height: 10px;
  594. background: #92b5fe;
  595. top: -5px;
  596. right: -15px;
  597. border-radius: 50%;
  598. }
  599. }
  600. .footer-button {
  601. z-index: 9999;
  602. margin-top: 20px;
  603. position: fixed;
  604. bottom: 0;
  605. width: 100%;
  606. background: white;
  607. padding: 10px 20px;
  608. button {
  609. width: 70%;
  610. cursor: pointer;
  611. }
  612. }
  613. .tip {
  614. width: 100%;
  615. background-color: #fff;
  616. border-radius: 10upx;
  617. font-size: 32upx;
  618. font-weight: bold;
  619. margin: 0 auto;
  620. padding: 20px;
  621. box-sizing: border-box;
  622. position: fixed;
  623. bottom: 0;
  624. }
  625. /* 底部的样式Start */
  626. .infoBottom {
  627. height: 140upx;
  628. position: fixed;
  629. bottom: 0;
  630. left: 0;
  631. right: 0;
  632. background: #ea552d;
  633. border-top: 1upx solid #ea552d;
  634. z-index: 99;
  635. margin-top: 100px;
  636. }
  637. .infoBottom>button {
  638. // font-size: 30upx;
  639. background: #fff;
  640. color: #333;
  641. flex: 1;
  642. margin: 0upx 30px;
  643. font-weight: bold;
  644. }
  645. /* 底部的样式End */
  646. .watermark {
  647. position: fixed;
  648. top: 50%;
  649. left: 50%;
  650. transform: translate(-50%, -50%);
  651. font-size: 24px;
  652. color: rgba(0, 0, 0, 0.3);
  653. pointer-events: none;
  654. z-index: 9999;
  655. }
  656. </style>