|
|
@@ -104,7 +104,7 @@
|
|
|
style="color:#f56c6c">二维码</el-button>
|
|
|
<el-button size="mini" type="text" @click="OrderDetails(scope.row, item)">查看详情
|
|
|
</el-button>
|
|
|
- <!-- <el-button type="text" style="color:rgb(240, 12, 10)" @click="bjdpreview(scope.row.companyId)">报价单</el-button> -->
|
|
|
+ <el-button type="text" style="color:rgb(240, 12, 10)" @click="bjdpreview(item.id)">报价单</el-button>
|
|
|
<!-- <el-button size="mini" type="text" @click="CloseEdit(scope.$index, scope.row)">编辑</el-button> -->
|
|
|
|
|
|
</div>
|
|
|
@@ -1351,7 +1351,7 @@
|
|
|
</span>
|
|
|
</el-dialog>
|
|
|
<!-- 报价单 -->
|
|
|
- <!-- <el-dialog :visible.sync="bjddialogVisible" width="570px" top="1vh">
|
|
|
+ <el-dialog :visible.sync="bjddialogVisible" width="570px" top="1vh" v-if="queryOrders">
|
|
|
<div class="bjdbody" id='pdfContentsDiv'>
|
|
|
<div class="bjdCarMessage">
|
|
|
<div class="bjdCarMessage1">
|
|
|
@@ -1494,7 +1494,7 @@
|
|
|
<el-button size="small" style="width:100px;" @click="copybjd()" >截图</el-button>
|
|
|
<el-button size="small" style="width:100px;" @click="bjddialogVisible = false">关闭</el-button>
|
|
|
</div>
|
|
|
- </el-dialog> -->
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
|
</template>
|
|
|
<script>
|
|
|
@@ -1502,12 +1502,14 @@ import {
|
|
|
pathToBase64,
|
|
|
base64ToPath
|
|
|
} from '@/common/image-tools-base64.js';
|
|
|
+import html2Canvas from 'html2canvas'
|
|
|
+import CommonUtil from "@/utils/comutil.js";
|
|
|
import Cookies from "js-cookie";
|
|
|
import QRCode from "qrcodejs2";
|
|
|
export default {
|
|
|
data() {
|
|
|
return {
|
|
|
- queryOrders:{},
|
|
|
+ queryOrders:"",
|
|
|
logoImg: "",//报价单保险公司logo图
|
|
|
bjddialogVisible:false,
|
|
|
value2: "",
|
|
|
@@ -1633,45 +1635,143 @@ export default {
|
|
|
},
|
|
|
},
|
|
|
methods: {
|
|
|
- // bjdpreview(companyId) {
|
|
|
- // let params = {
|
|
|
- // companyId: companyId
|
|
|
- // };
|
|
|
- // this.$api.letter.getByCompanyId(params).then(res => {
|
|
|
- // if (res.code == "200") {
|
|
|
- // var data = res.data;
|
|
|
- // if (data.kindinfo != null) {
|
|
|
- // data.kindinfo.map((ele, index) => {
|
|
|
- // switch (ele.kindCode) {
|
|
|
- // case "A":
|
|
|
- // if (ele.amount == 1) {
|
|
|
- // ele.amount = "投保"
|
|
|
- // } else {
|
|
|
- // ele.amount = ele.amount
|
|
|
- // }
|
|
|
- // break;
|
|
|
- // case "D4":
|
|
|
- // case "SY_FJ_YBW2":
|
|
|
- // ele.unitAmount = this.toChinesNum(ele.unitAmount);
|
|
|
- // break;
|
|
|
- // case "MJ1":
|
|
|
- // case "MJ2":
|
|
|
- // case "MJ3":
|
|
|
- // case "MJ4":
|
|
|
- // ele.deductibleRate = ele.deductibleRate + "%";
|
|
|
- // break;
|
|
|
- // default:
|
|
|
- // ele.amount = this.toChinesNum(ele.amount);
|
|
|
- // }
|
|
|
- // return ele;
|
|
|
- // });
|
|
|
- // }
|
|
|
- // this.queryOrders = data;
|
|
|
- // this.logoImg = this.iconfftter(res.data.inscompany)
|
|
|
- // this.bjddialogVisible = true;
|
|
|
- // }
|
|
|
- // });
|
|
|
- // },
|
|
|
+ // 截图粘贴
|
|
|
+ copybjd(){
|
|
|
+ let that=this
|
|
|
+ html2Canvas(document.getElementById('pdfContentsDiv') , {
|
|
|
+ allowTaint: true,
|
|
|
+ taintTest: false,
|
|
|
+ }).then(function (canvas) {
|
|
|
+
|
|
|
+ let base64Data = ''
|
|
|
+ let blob = null
|
|
|
+ base64Data = canvas.toDataURL('image/png', 1)
|
|
|
+ var format = 'image/png'
|
|
|
+ //将Base64图片编码转换成blob
|
|
|
+ var base64 = base64Data
|
|
|
+ var code = window.atob(base64.split(',')[1])
|
|
|
+ var aBuffer = new window.ArrayBuffer(code.length)
|
|
|
+ var uBuffer = new window.Uint8Array(aBuffer)
|
|
|
+ for (var i = 0; i < code.length; i++) {
|
|
|
+ uBuffer[i] = code.charCodeAt(i) & 0xff
|
|
|
+ }
|
|
|
+ try {
|
|
|
+ blob = new Blob([uBuffer], { type: format })
|
|
|
+ } catch (e) {
|
|
|
+ window.BlobBuilder =
|
|
|
+ window.BlobBuilder ||
|
|
|
+ window.WebKitBlobBuilder ||
|
|
|
+ window.MozBlobBuilder ||
|
|
|
+ window.MSBlobBuilder
|
|
|
+ if (e.name == 'TypeError' && window.BlobBuilder) {
|
|
|
+ var bb = new window.BlobBuilder()
|
|
|
+ bb.append(uBuffer.buffer)
|
|
|
+ blob = bb.getBlob('image/png')
|
|
|
+ } else if (e.name == 'InvalidStateError') {
|
|
|
+ blob = new Blob([aBuffer], { type: format })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ const clipboardItemInput = new ClipboardItem({
|
|
|
+ 'image/png': blob,
|
|
|
+ })
|
|
|
+ navigator.clipboard.write([clipboardItemInput])
|
|
|
+ that.$message({
|
|
|
+ message: '已截图并复制到粘贴板!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ })
|
|
|
+ },
|
|
|
+ bjdpreview(companyId) {
|
|
|
+ let params = {
|
|
|
+ companyId: companyId
|
|
|
+ };
|
|
|
+ this.$api.letter.getByCompanyId(params).then(res => {
|
|
|
+ if (res.code == "200") {
|
|
|
+ var data = res.data;
|
|
|
+ if (data.kindinfo != null) {
|
|
|
+ data.kindinfo.map((ele, index) => {
|
|
|
+ switch (ele.kindCode) {
|
|
|
+ case "A":
|
|
|
+ if (ele.amount == 1) {
|
|
|
+ ele.amount = "投保"
|
|
|
+ } else {
|
|
|
+ ele.amount = ele.amount
|
|
|
+ }
|
|
|
+ break;
|
|
|
+ case "D4":
|
|
|
+ case "SY_FJ_YBW2":
|
|
|
+ ele.unitAmount = this.toChinesNum(ele.unitAmount);
|
|
|
+ break;
|
|
|
+ case "MJ1":
|
|
|
+ case "MJ2":
|
|
|
+ case "MJ3":
|
|
|
+ case "MJ4":
|
|
|
+ ele.deductibleRate = ele.deductibleRate + "%";
|
|
|
+ break;
|
|
|
+ default:
|
|
|
+ ele.amount = this.toChinesNum(ele.amount);
|
|
|
+ }
|
|
|
+ return ele;
|
|
|
+ });
|
|
|
+ }
|
|
|
+ this.queryOrders = data;
|
|
|
+ this.logoImg = this.iconfftter(res.data.inscompany)
|
|
|
+ this.bjddialogVisible = true;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ toChinesNum(num) {
|
|
|
+ let changeNum = [
|
|
|
+ "零", "1", "2", "3", "4", "5", "6", "7", "8", "9"
|
|
|
+ ];
|
|
|
+ let unit = ["", "0", "00", "000", "0000"];
|
|
|
+ num = parseInt(num);
|
|
|
+ let getWan = temp => {
|
|
|
+ let strArr = temp
|
|
|
+ .toString()
|
|
|
+ .split("")
|
|
|
+ .reverse();
|
|
|
+ let newNum = "";
|
|
|
+ let newArr = [];
|
|
|
+ strArr.forEach((item, index) => {
|
|
|
+ newArr.unshift(
|
|
|
+ item === "0" ? changeNum[item] : changeNum[item] + unit[index]
|
|
|
+ );
|
|
|
+ });
|
|
|
+ let numArr = [];
|
|
|
+ newArr.forEach((m, n) => {
|
|
|
+ if (m !== "零") numArr.push(n);
|
|
|
+ });
|
|
|
+ if (newArr.length > 1) {
|
|
|
+ newArr.forEach((m, n) => {
|
|
|
+ if (newArr[newArr.length - 1] === "零") {
|
|
|
+ if (n <= numArr[numArr.length - 1]) {
|
|
|
+ newNum += m;
|
|
|
+ }
|
|
|
+ } else {
|
|
|
+ newNum += m;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ newNum = newArr[0];
|
|
|
+ }
|
|
|
+ return newNum;
|
|
|
+ };
|
|
|
+ let overWan = Math.floor(num / 10000);
|
|
|
+ let noWan = num % 10000;
|
|
|
+ if (noWan.toString().length < 4) {
|
|
|
+ noWan = "0" + noWan;
|
|
|
+ }
|
|
|
+ return overWan ? getWan(overWan) + "万" + getWan(noWan) : getWan(num);
|
|
|
+ },
|
|
|
+ iconfftter(icon) {
|
|
|
+ return CommonUtil.getDataName({
|
|
|
+ dataList: this.global.insCompanyList,
|
|
|
+ value: "name",
|
|
|
+ label: "icon",
|
|
|
+ data: icon,
|
|
|
+ });
|
|
|
+ },
|
|
|
getRowClass(scope, rowIndex) {
|
|
|
if (scope.row.insAreaCompanyList.length == 0) { //判断当前行是否有子数据或者根据实际情况设置
|
|
|
return 'row-expand-cover'
|
|
|
@@ -2814,4 +2914,75 @@ export default {
|
|
|
padding: 0 20px;
|
|
|
box-sizing: border-box;
|
|
|
}
|
|
|
+.bjdbody {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ background-color: rgb(199, 20, 45);
|
|
|
+ padding: 20px 10px 0 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-radius: 8px;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdCarMessage,
|
|
|
+.bjdCarSum {
|
|
|
+ width: 100%;
|
|
|
+ height: auto;
|
|
|
+ background-color: #fff;
|
|
|
+ border-radius: 8px;
|
|
|
+ margin-bottom: 10px;
|
|
|
+ padding-bottom: 10px;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdfooter {
|
|
|
+ border-top: 1px solid #fff;
|
|
|
+ padding: 10px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ color: #fff;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdCarSum >div{
|
|
|
+ width: 100%;
|
|
|
+ padding: 15px 20px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ font-weight: bold;
|
|
|
+ color: #000;
|
|
|
+ border-bottom: 1px solid #f2f2f2;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdCarMessage1 {
|
|
|
+ height: 80px;
|
|
|
+ padding: 16px;
|
|
|
+ box-sizing: border-box;
|
|
|
+ border-bottom: 1px solid #f2f2f2;
|
|
|
+ display: flex;
|
|
|
+ align-items: center;
|
|
|
+ color: #000;
|
|
|
+
|
|
|
+
|
|
|
+}
|
|
|
+.bjdCarMessage1 > .f-c >span:nth-child(1){
|
|
|
+ font-size: 18px;
|
|
|
+ font-weight: bold;
|
|
|
+ }
|
|
|
+.bjdCarMessage1>img,
|
|
|
+.bjdfooter>img {
|
|
|
+ margin-right: 30px;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdCarMessage1 .f-c>span:nth-child(2),
|
|
|
+.bjdCarMessage1 .f-c>span:nth-child(3) {
|
|
|
+ font-size: 12px;
|
|
|
+ margin-top: 5px;
|
|
|
+}
|
|
|
+
|
|
|
+.bjdCarMessage2_car >span:nth-child(1) {
|
|
|
+ color: #000;
|
|
|
+ font-weight: bold;
|
|
|
+}
|
|
|
+.bjdCarMessage2_car >span:nth-child(2) {
|
|
|
+ color: #999;
|
|
|
+}
|
|
|
+.bjdCarMessage2 >ul>li {
|
|
|
+ margin: 20px 0;
|
|
|
+}
|
|
|
</style>
|