quotation.vue 17 KB

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