Эх сурвалжийг харах

ocr识别错误日期校验

@dongkboy 3 жил өмнө
parent
commit
cd35f6aa3f
1 өөрчлөгдсөн 19 нэмэгдсэн , 11 устгасан
  1. 19 11
      src/views/Letter/Letter.vue

+ 19 - 11
src/views/Letter/Letter.vue

@@ -2731,7 +2731,8 @@ export default {
       import("element-ui/packages/image/src/image-viewer")
   },
   created() {
-    // console.log(this.getAreaByCode('130633199304234747'))
+
+    console.log(this.getAreaByCode('142427199206192411'))
     this.getDicType("vehicleType");//车辆种类
     this.getDicType("trafficManagementVehicleType");//车辆类型
     this.getDicType("energyType");//能源种类
@@ -2870,7 +2871,7 @@ export default {
     getAreaByCode(code) {
       let list = regionData;
       let provinceCode = code.substring(0, 2);
-      let cityCode = code.substring(0, 4) ;
+      let cityCode = code.substring(0, 4);
       let areaCode = code.substring(0, 6);
       // 获取省份信息
       let province = list.filter(function (item) {
@@ -2880,17 +2881,20 @@ export default {
       let city = province[0].children.filter(function (item) {
         return item.value === cityCode;
       });
-      // 获取区/县信息
-      let area = city[0].children.filter(function (item) {
-        return item.value === areaCode;
-      });
-      return province[0].label + city[0].label + area[0].label;
+      if (city.length > 0) {
+        // 获取区/县信息
+        let area = city[0].children.filter(function (item) {
+          return item.value === areaCode;
+        });
+        return province[0].label + city[0].label + area[0].label;
+      }
     },
     //--数据字典 begin --
     getDicType(type) {
       this.$api.insCompany.dicType(type).then(res => {
         if (res.code == 200) {
           this[type + 'options'] = res.data.ddList;
+
         }
       })
     },
@@ -5032,11 +5036,15 @@ export default {
       this.carInfo.vinNo = this.carform.frameNo; //车架号
       this.carInfo.frameNo = this.carform.frameNo; //车架号
       this.carInfo.engineNo = this.carform.engineNo; //发动机号
-      this.carInfo.registerDate = this.carform.registerDate; //车牌号
-      this.carInfo.issueDate = this.carform.issueDate; //车牌号
       this.carInfo.seatCount = this.carform.approvedPassengersCapacity; //核定载客数
       this.carInfo.vehicleweight = this.carform.grossMass; //总质量
       this.carInfo.completeKerbMass = this.carform.unladenMass; //整备质量
+      if(this.timeformat(this.carform.registerDate)!='NaN-NaN-NaN'){
+        this.carInfo.registerDate = this.carform.registerDate; //车牌号
+      }
+      if(this.timeformat(this.carform.issueDate)!='NaN-NaN-NaN'){
+      this.carInfo.issueDate = this.carform.issueDate; //车牌号
+      }
       this.uploadcardialogVisible = false;
     },
     handleRemove(e) {
@@ -5119,8 +5127,8 @@ export default {
               customerInfo.identifyValidEndDate.substring(4, 6) +
               "-" +
               customerInfo.identifyValidEndDate.substring(6, 8);
-              if(customerInfo.identifyValidEndDate=='长期'){
-              this.ownerInfoform.identifyValidEndDate='9999-12-31';
+            if (customerInfo.identifyValidEndDate == '长期') {
+              this.ownerInfoform.identifyValidEndDate = '9999-12-31';
             }
           }
         }