Просмотр исходного кода

1、选择为过户车,转移登记日期和发证日期一样
2、添加车辆用途字段,选择使用性质为营业使用营业数据
3、添加即时起保按钮,时间为当前时间后两小时整点
4、报价单上添加截图按钮

lihongxiao 2 лет назад
Родитель
Сommit
04bfedec40
3 измененных файлов с 112 добавлено и 29 удалено
  1. 2 2
      config/dev.env.js
  2. 3 0
      src/main.js
  3. 107 27
      src/views/Letter/Letter.vue

+ 2 - 2
config/dev.env.js

@@ -7,8 +7,8 @@ module.exports = merge(prodEnv, {
   ENV_CONFIG:'"dev"',
   // BASE_URL: '"http://39.98.239.48/web-api"',//测试服务器
   // BASE_URL:'"http://sxzgkj.baoxianzhanggui.com/web-api"'//正式服务器
-  // BASE_URL: '"http://192.168.0.111:8080/"' //大哥
-  BASE_URL: '"http://192.168.0.115:8080/"' //凯森
+  BASE_URL: '"http://192.168.0.111:8080/"' //大哥
+  // BASE_URL: '"http://192.168.0.115:8080/"' //凯森
 })
 
 

+ 3 - 0
src/main.js

@@ -11,6 +11,7 @@ import VueSplit from 'vue-split-panel'
 import VueDirectiveWindow from 'vue-directive-window';
 import {dateFormat} from '@/utils/dataformat.js'
 import btnPermission from '@/utils/btnPermission'
+import VueClipboard from 'vue-clipboard2'
 
 import 'element-ui/lib/theme-chalk/index.css'
 // import 'element-ui/lib/'
@@ -34,6 +35,8 @@ Vue.use(Viewer, {
 })
 // ElementUI.Dialog.props.lockScroll.default = false;
 Vue.config.productionTip = false;
+VueClipboard.config.autoSetContainer = true
+Vue.use(VueClipboard)
 //预览图片End
 Vue.use(VueDirectiveWindow);
 Vue.use(VueSplit)

+ 107 - 27
src/views/Letter/Letter.vue

@@ -159,9 +159,21 @@
             </el-form-item>
           </el-col>
           <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell">
-            <el-form-item label="使用性质:" prop="carnature">
-              <el-select v-model="carInfo.carnature" placeholder="请选择使用性质">
-                <el-option :label="item.label" :value="item.id" v-for="(item, index) in carnatureList"
+            <el-form-item label="使用性质:" prop="carnature" >
+              <el-select v-model="carInfo.carnature" placeholder="请选择使用性质" @change="natureFun">
+                <el-option :label="item.dictTag" :value="item.dictValue" v-for="(item, index) in natureOfVehicleUseoptions"
+                  :key="index"></el-option>
+              </el-select>
+            </el-form-item>
+          </el-col>
+          <el-col :xs="xscell" :sm="smcell" :md="mdcell" :lg="lgcell" :xl="xlcell" >
+            <el-form-item label="车辆用途:" prop="vehicleUse" >
+              <el-select v-if="carInfo.carnature=='02'" v-model="carInfo.vehicleUse" placeholder="请选择使车辆用途" >
+                <el-option :label="item.dictTag" :value="item.dictValue" v-for="(item, index) in outOfBusinessVehicleUseoptions"
+                  :key="index"></el-option>
+              </el-select>
+              <el-select v-if="carInfo.carnature=='01'" v-model="carInfo.vehicleUse" placeholder="请选择使车辆用途" >
+                <el-option :label="item.dictTag" :value="item.dictValue" v-for="(item, index) in businessVehicleUseoptions"
                   :key="index"></el-option>
               </el-select>
             </el-form-item>
@@ -468,6 +480,14 @@
         <div class="flex j-s a-c color" id="insurance">
           <img src="../../../src/icon/salesman.png" alt class="icon-img" />
           <span style="margin-left:10px;">投保信息</span>
+          <el-switch
+          style="margin:0 10px 0 30px;"
+          @change="immediatelyChange"
+          v-model="immediatelyValue"
+          active-color="#ee7000">
+        </el-switch>
+        <span style="font-weight:normal;font-size: 13px;">即使投保</span>
+
         </div>
       </div>
       <el-form class="back demo-ruleForm" :inline="true" :model="Carinsurance" label-width="150px" size="small"
@@ -1038,7 +1058,7 @@
           <el-descriptions-item label="座位数">{{ queryOrders.carinfo.seatCount }}</el-descriptions-item>
           <el-descriptions-item label="新车购置价">{{ queryOrders.carinfo.purchasePrice }}</el-descriptions-item>
           <el-descriptions-item label="使用性质">
-            {{ queryOrders.carinfo.carnature == '8A' ? '家庭自用' : ''
+            {{ queryOrders.carinfo.carnature == '01' ? '营业' : ''
             }}
           </el-descriptions-item>
           <el-descriptions-item label="注册日期">{{ queryOrders.carinfo.registerDate }}</el-descriptions-item>
@@ -1374,7 +1394,7 @@
         </div>
       </div>
       <div class="display">
-        <!-- <el-button size="small" style="width:100px;" @click="copybjd()" >复制</el-button> -->
+        <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>
@@ -1888,6 +1908,7 @@ export default {
     };
     return {
       feeDetailInfo:[],//费用明细信息
+      immediatelyValue:false,
       templateSelection:"",
       areaOption:yongchengData.data,
       actionUrl:process.env.BASE_URL+'ins/taskImage/uploadFile',
@@ -2040,7 +2061,8 @@ export default {
         firstBeneMan: "", //第一受益人
         noLicenseFlag: false, //是否新车
         cartype: "", //客车A0 货车H0
-        carnature: "8A", //使用性质 家庭自用8A  非营业企业8B   非营业党政机关,事业团体8C  非营业货车8D
+        carnature: "02", //使用性质 
+        vehicleUse:'05',
         property: "1" //所属性质 1个人 2企业 3个人
       },
       carform: {
@@ -2134,8 +2156,8 @@ export default {
         taxPaidAreaCode: "",//完税凭证地区代码
         taxRelief: "",//减税比例
       },
-      //使用性质列表
-      carnatureList: [{ label: "家庭自用", id: "8A" }],
+      //车辆用途列表
+      vehicleList: [],
       //能源种类列表
       rules: {
         extendChar2: [
@@ -2984,6 +3006,9 @@ export default {
       relifReasonoptions: [],//减免税原因代码
       relifReasonoptions: [],//减免税原因代码
       provinceSelect: [],
+      natureOfVehicleUseoptions:[],
+      businessVehicleUseoptions:[],
+      outOfBusinessVehicleUseoptions:[],
     };
   },
   watch: {
@@ -3072,6 +3097,9 @@ export default {
     this.getDicType("vehicleType");//车辆种类
     this.getDicType("trafficManagementVehicleType");//车辆类型
     this.getDicType("energyType");//能源种类
+    this.getDicType("natureOfVehicleUse");//车辆使用性质
+    this.getDicType("businessVehicleUse");//(车辆用途)营业
+    this.getDicType("outOfBusinessVehicleUse");//(车辆用途)非营业
     this.$api.letter.queryCompany().then(res => {
       this.continuousCompanyList = res.data;
     });
@@ -3104,7 +3132,16 @@ export default {
       this.bbtbcarShow = false;
       this.bbczcarShow = false;
       const { carinfo, ownerinfo, applyinfo, insureinfo, quoteno, orderno } = _this.paramsEdit;
+
       _this.carInfo = carinfo;
+      if( _this.carInfo.carnature=="8A"){
+        _this.carInfo.carnature='02'
+        _this.carInfo.vehicleUse='05'
+      }
+      else{
+        _this.carInfo.carnature
+        _this.carInfo.vehicleUse
+      }
       _this.ownerInfo = ownerinfo;
       _this.policyHolderInfo = applyinfo;
       _this.insuredPersonInfo = insureinfo;
@@ -3113,7 +3150,6 @@ export default {
       _this.tbczcarShow=applyinfo.owner
       _this.bbczcarShow=insureinfo.owner
       _this.bbtbcarShow=insureinfo.insuranceHolder
-      
       _this.ownerInfo.age = getAgeByIdCard(_this.ownerInfo.identifyNumber)
       _this.policyHolderInfo.age = getAgeByIdCard(_this.policyHolderInfo.identifyNumber)
       _this.insuredPersonInfo.age = getAgeByIdCard(_this.insuredPersonInfo.identifyNumber)
@@ -3214,29 +3250,69 @@ export default {
   methods: {
   
     copybjd(){
-      let _this=this
-      let targetDom = document.getElementById('pdfContentsDiv')  //原本需要截图的div
-      let clonedNode = targetDom.cloneNode(true); //复制一个
-      clonedNode.setAttribute("style",`width: ${targetDom.clientHeight};height: ${targetDom.clientWidth};`) 
-      document.body.appendChild(clonedNode); //放到body后面
-      html2Canvas(clonedNode, {  
+      html2Canvas(document.getElementById('pdfContentsDiv') , {  
               allowTaint: true,  
               taintTest: false,  
           }).then(function (canvas) {
-        let image = new Image();
-        let pageImg= canvas.toDataURL('image/png')
-        image.src = canvas.toDataURL("image/png");
-        // _this.$copyText(pageImg.replace(/[\r\n]/g, "")).then(
-        //         e => {
-        //             console.log('复制成功:', e);
-        //         },
-        //         e => {
-        //             console.log('复制失败:', e);
-        //         }
-        //     )
-        // document.body.removeChild(clonedNode);  //最后记得移除截图时添加的
+        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])
       })
     },
+    // 即时起保
+    immediatelyChange(e){
+      if(e){
+        this.immediatelyValue=true
+        const date = new Date();
+        date.setHours(date.getHours() +2);
+        date.setMinutes(0)
+        date.setSeconds(0)
+        this.jqstartDate=date
+        this.jqendDate = this.oneYearPast1(date);
+      }
+      else{
+        this.immediatelyValue=false
+        this.jqstartDate = this.transformTime1();
+        this.jqendDate = this.oneYearPast1(this.jqstartDate);
+      }
+     
+    },
+    // 使用性质方法
+    natureFun(){
+      if(this.carInfo.carnature=='01'){
+        this.carInfo.vehicleUse=''
+      }
+      console.log(this.carInfo.carnature,111111111)
+    },
     // 点击同步报价后的时间
     syncData(item){
       this.jqstartDate=item.startDateJq?item.startDateJq:this.jqstartDate
@@ -4227,6 +4303,8 @@ export default {
           param.ownerInfo.provinceData==""?[]:param.ownerInfo.provinceData
           param.insuredPersonInfo.provinceData==""?[]:param.insuredPersonInfo.provinceData
           param.policyHolderInfo.provinceData==""?[]:param.policyHolderInfo.provinceData
+
+
           return this.$api.letter.generateOrder(param).then(res => {
             this.yongcheng(num, id);
           });
@@ -5352,8 +5430,10 @@ export default {
     transferFlagChange(e) {
       if (e) {
         this.transferDateShow = true;
+        this.carInfo.transferDate=this.carInfo.issueDate
       } else {
         this.transferDateShow = false;
+        this.carInfo.transferDate=""
       }
     },
     //影像上传