sunyize 2 лет назад
Родитель
Сommit
74f6aab858
1 измененных файлов с 163 добавлено и 19 удалено
  1. 163 19
      src/views/networkAccess/registration.vue

+ 163 - 19
src/views/networkAccess/registration.vue

@@ -22,6 +22,8 @@
           :rules="rules"
         >
           <div>
+<!--            <registation-Modal ref="registationModel" @ok="modalFormOk2"></registation-Modal>-->
+
             <a-button type="link" @click="keyupInfoSelect()">身份证件号码检索</a-button>
             <a-row>
               <a-col :span="6">
@@ -426,13 +428,41 @@
               <a-list-item>
 
                 <a-col :span="10">
-                <div v-for="(des) in size">
-                  <a-form-model-item label="新办手机号码"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="industry" >
+                <div v-if="size>=1">
+                  <a-form-model-item label="新办手机号码"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="phone" >
                     <!--                    <a-radio-group v-model="model.newPhone" button-style="solid">-->
                     <a-input v-model="model.newPhone" placeholder="新办手机号码" @blur="check3('newPhone')" id="newPhone"></a-input>
                     <!--                    </a-radio-group>-->
                   </a-form-model-item>
                 </div>
+                  <div v-show="size>=2">
+                    <a-form-model-item label="新办手机号码2"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="phone" >
+                      <!--                    <a-radio-group v-model="model.newPhone" button-style="solid">-->
+                      <a-input v-model="model.newPhone2" placeholder="新办手机号码" @blur="check3('newPhone2')" id="newPhone2"></a-input>
+                      <!--                    </a-radio-group>-->
+                    </a-form-model-item>
+                  </div>
+                  <div v-show="size>=3">
+                    <a-form-model-item label="新办手机号码3"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="phone" >
+                      <!--                    <a-radio-group v-model="model.newPhone" button-style="solid">-->
+                      <a-input v-model="model.newPhone3" placeholder="新办手机号码" @blur="check3('newPhone3')" id="newPhone3"></a-input>
+                      <!--                    </a-radio-group>-->
+                    </a-form-model-item>
+                  </div>
+                  <div v-show="size>=4">
+                    <a-form-model-item label="新办手机号码4"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="phone" >
+                      <!--                    <a-radio-group v-model="model.newPhone" button-style="solid">-->
+                      <a-input v-model="model.newPhone4" placeholder="新办手机号码" @blur="check3('newPhone4')" id="newPhone4"></a-input>
+                      <!--                    </a-radio-group>-->
+                    </a-form-model-item>
+                  </div>
+                  <div v-show="size>=5">
+                    <a-form-model-item label="新办手机号码5"    :labelCol="{ span:10 }"   :wrapperCol="{ span:12 }"  prop="phone" >
+                      <!--                    <a-radio-group v-model="model.newPhone" button-style="solid">-->
+                      <a-input v-model="model.newPhone5" placeholder="新办手机号码" @blur="check3('newPhone5')" id="newPhone5"></a-input>
+                      <!--                    </a-radio-group>-->
+                    </a-form-model-item>
+                  </div>
 
                 </a-col>
                 <a-col :span="2" >
@@ -658,7 +688,7 @@ import {JeecgListMixin} from '@/mixins/JeecgListMixin'
 import AMapLoader from '@amap/amap-jsapi-loader'
 import {reactive} from 'vue';
 import axios from 'axios';
-
+//import registationModel from './model/registationModel.vue'
 window._AMapSecurityConfig = {
   securityJsCode: 'c4ab681cb7c3256184ae3557dc5beabb'  //填写你的安全密钥
 };
@@ -668,7 +698,9 @@ export default {
   name: "registration",
   inject: ['closeCurrent'],
   mixins: [JeecgListMixin],
-
+  components: {
+    registationModel
+  },
   data() {
 
     return {
@@ -909,7 +941,7 @@ export default {
           {required: true, message: '请输入身份证证件有效期...'}
         ],
         phone: [
-          {required: true, message: '拨测联系电话!', trigger: 'blur'}
+          {required: true, message: '请输入电话!', trigger: 'blur'}, {validator: this.isPhone}
         ],
         modelAddress: [
           {required: true, message: '请输入联电归属地!', trigger: 'blur'}
@@ -1051,7 +1083,12 @@ export default {
         wordAddress: '',
         positionInformation: '',
         businessAddress: '',
-        newPhone: ''
+        newPhone: '',
+        newPhone2: '',
+        newPhone3: '',
+        newPhone4: '',
+        newPhone5: ''
+
       },
       current: 0,
       //步骤条
@@ -1085,6 +1122,15 @@ export default {
   },
 
   methods: {
+    modalFormOk2() {
+      // 新增/修改 成功时,重载列表
+      this.loadData2()
+    },
+    handleEdit2 (record) {
+      this.$refs.registationModel.edit(record)
+      this.$refs.registationModel.title = "新增";
+      this.$refs.registationModel.disableSubmit = false;
+    },
 
     // 复选框禁用
     checkboxT(row, index) {
@@ -1260,7 +1306,14 @@ export default {
         callback("您的身份证格式不正确!");
       }
     },
+    isPhone(rule,value,callback){
+      if (!value || new RegExp(/^1([38][0-9]|4[579]|5[0-3,5-9]|6[6]|7[0135678]|9[89])\d{8}$/).test(value)){
+        callback();
+      }else{
+        callback("您的手机号码格式不正确!");
+      }
 
+    },
 
     getPhoneTypeSize() {
       let data = {
@@ -1726,7 +1779,7 @@ export default {
     },
     keyupInfo(info) {
 
-
+    //  this.handleEdit2()
       //身份证输入查询
       if (this.model.cardNo.length === 15 || this.model.cardNo.length === 18) {
         let that = this;
@@ -1734,18 +1787,25 @@ export default {
           "cardNo": this.model.cardNo,
           "id": this.model.id
         }
+        var newPhones;
         //this.getPhoneTypeSize();
         getAction(that.url.queryByCardNo, data).then((res) => {
           if (res.success) {
             let result = res.result;
             let view = this.model;
             if (result != null) {
-              for (var i in result) {
+              var i=0;
+
                 Object.keys(view).forEach(function (key) {
                   if (key==='company'){
                     that.change(result[0][key]);
                   }
                   view[key] = result[0][key];
+                  if (key==='newPhone'){
+
+                     newPhones = result[0][key].split(',');
+
+                  }
                   if (key==='industry'){
 
                     var a=0;
@@ -1762,7 +1822,27 @@ export default {
                   }
 
                 })
-
+              for (var item of  newPhones) {
+                if (item.match(RegExp('newPhone1+')) && item.replace('newPhone1+','')!==''){
+                  this.model.newPhone=item.replace('newPhone1+','')
+                }
+                if (item.match(RegExp('newPhone2+'))&& item.replace('newPhone2+','')!==''){
+                  that.size=2;
+                  this.model.newPhone2=item.replace('newPhone2+','')
+                }
+                if (item.match(RegExp('newPhone3+'))&& item.replace('newPhone3+','')!==''){
+                  that.size=3;
+                  this.model.newPhone3=item.replace('newPhone3+','')
+                }
+                if (item.match(RegExp('newPhone4+'))&& item.replace('newPhone4+','')!==''){
+                  that.size=4;
+                  this.model.newPhone4=item.replace('newPhone4+','')
+                }
+                if (item.match(RegExp('newPhone5+'))&& item.replace('newPhone5+','')!==''){
+                  that.size=5;
+                  this.model.newPhone5=item.replace('newPhone5+','')
+                }
+              }
                 for (var item of this.sysCompany) {
                   if (item.id === this.model.company) {
                     this.companyName = item.name;
@@ -1776,7 +1856,7 @@ export default {
                     }
                   }
                 }
-                this.isSizeNumberResults = result[i]["isSizeNumberResults"];
+                this.isSizeNumberResults = result[0]["isSizeNumberResults"];
                 // if (this.model.wordAddress!=='' && this.model.wordAddress!==null){
                 //   this.searchKeyWordsysBusinessHall(this.model.wordAddress,'wordAddress');
                 // }
@@ -1790,10 +1870,10 @@ export default {
                 if (info===''){
                   this.model.id=null;
                 }
-              }
+
               this.disabledListAdd()
               this.showCheck0('all');
-              if (result[i]["isSizeNumberResults"] === 'is') {
+              if (result[0]["isSizeNumberResults"] === 'is') {
                 this.$confirm({
                   title: "确认是否继续...",
                   content: '该用户有多个不友好研判结果',
@@ -2062,7 +2142,7 @@ export default {
         let that = this;
         console.info(this.model.calltestResults);
         that.addIng == false
-        let data = this.getData();
+        let data = this.getData('next');
         let id = that.model.id;
         let i = 1;
         let dataMessage = '';
@@ -2164,7 +2244,7 @@ export default {
       }
     },
 
-    getData() {
+    getData(info) {
       var arr = '';
       if (this.model.numberResults instanceof Array){
 
@@ -2178,6 +2258,22 @@ export default {
       if (this.industryQiTa!=='' || this.industryQiTa!==null){
         this.model.industry = this.industryQiTa;
       }
+      if (info==='submit'){
+        if (this.size===2){
+          this.model.newPhone ='newPhone1+'+this.model.newPhone+',newPhone2+'+this.model.newPhone2;
+        }
+        if (this.size===3){
+          this.model.newPhone ='newPhone1+'+this.model.newPhone+',newPhone2+'+this.model.newPhone2+',newPhone3+'+this.model.newPhone3;
+        }
+        if (this.size===4){
+          this.model.newPhone ='newPhone1+'+this.model.newPhone+',newPhone2+'+this.model.newPhone2+',newPhone3+'+this.model.newPhone3+',newPhone4+'+this.model.newPhone4;
+        }
+        if (this.size===5){
+          this.model.newPhone ='newPhone1+'+this.model.newPhone+',newPhone2+'+this.model.newPhone2+',newPhone3+'+this.model.newPhone3+',newPhone4+'+this.model.newPhone4+',newPhone5+'+this.model.newPhone5;
+        }
+      }
+
+
       let data = {
         "sysBusinessHall": this.model.sysBusinessHall,
         "company": this.model.company,
@@ -2255,7 +2351,7 @@ export default {
         "status": '',
         "judgmentResearch":this.model.judgmentResearch,
         "industry":this.model.industry,
-        "newPhone":this.model.newPhone
+        "newPhone": this.model.newPhone
       };
       return data;
     },
@@ -2276,11 +2372,16 @@ export default {
         postAction("/businessReminderCard/add", data).then((res) => {
           if (res.success) {
             this.clearModel()
-            this.$message.success(mes, 7);
+            this.$message.success(mes, 3);
             this.addIng == true
+             location.reload();
+            //this.closeCurrent();
+            //this.$router.replace({ path: this.$route.path })
           } else {
             this.$message.error("提交失败");
-            this.addIng == true;
+             location.reload();
+            // this.closeCurrent();
+            // this.$router.replace({ path: this.$route.path })
           }
         })
       } else {
@@ -2305,7 +2406,7 @@ export default {
     },
     //终止操作
     terminatingOperation() {
-      let data = this.getData();
+      let data = this.getData('submit');
       data['status'] = "0";//中断提交
       this.showInfo = false;
       this.submit(data, this.model.id)
@@ -2322,6 +2423,49 @@ export default {
           document.getElementById('newPhone').style.borderColor = "#d9d9d9";
         }
       }
+      if (data==='all' || data==='newPhone2'){
+        if (this.size>=2){
+          if (this.model.newPhone==='' || this.model.newPhone===null){
+            document.getElementById('newPhone').style.borderColor = "red";
+            info=false;
+          }else {
+            document.getElementById('newPhone').style.borderColor = "#d9d9d9";
+          }
+        }
+      }
+      if (data==='all' || data==='newPhone3'){
+        if (this.size>=3){
+          if (this.model.newPhone3==='' || this.model.newPhone3===null){
+            document.getElementById('newPhone3').style.borderColor = "red";
+            info=false;
+          }else {
+            document.getElementById('newPhone3').style.borderColor = "#d9d9d9";
+          }
+        }
+
+      }
+      if (data==='all' || data==='newPhone4'){
+        if (this.size>=4){
+          if (this.model.newPhone4==='' || this.model.newPhone4===null){
+            document.getElementById('newPhone4').style.borderColor = "red";
+            info=false;
+          }else {
+            document.getElementById('newPhone4').style.borderColor = "#d9d9d9";
+          }
+        }
+
+      }
+      if (data==='all' || data==='newPhone5'){
+        if (this.size>=5){
+          if (this.model.newPhone5==='' || this.model.newPhone5===null){
+            document.getElementById('newPhone5').style.borderColor = "red";
+            info=false;
+          }else {
+            document.getElementById('newPhone5').style.borderColor = "#d9d9d9";
+          }
+        }
+
+      }
       var reg = RegExp(/numberResults/);
 
       if (data==='all' || reg.exec(data)) {
@@ -2366,7 +2510,7 @@ export default {
       }
       let that = this;
       that.addIng == false
-      let data = this.getData();
+      let data = this.getData('submit');
       let id = that.model.id;
       let i = 1;
       let dataMessage = '';