瀏覽代碼

new 手机号

sunyize 2 年之前
父節點
當前提交
0f2023cdfd

+ 34 - 138
src/views/networkAccess/registration.vue

@@ -475,48 +475,22 @@
           <div>
             <a-list size="large" bordered>
               <a-list-item>
-
-                <a-col :span="10">
-                <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"  :disabled="isDisabled"></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" :disabled="isDisabled"></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":disabled="isDisabled"></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" :disabled="isDisabled"></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" :disabled="isDisabled"></a-input>
-                      <!--                    </a-radio-group>-->
-                    </a-form-model-item>
-                  </div>
-
+                <a-col :span="8" >
+                  <a-button type="primary" style="margin-left: 200px" @click="add">添加</a-button>
                 </a-col>
-                <a-col :span="2" >
-                  <a-button type="link" danger @click="addPhone()"  :disabled="isDisabled">(+)</a-button>
-                  <a-button type="link" danger @click="delPhone()"  :disabled="isDisabled">(-)</a-button>
+                <a-col :span="20">
+                  <div>
+
+                    <a-form ref="form" :model="model"  label-width="80px">
+                      <!-- 这个的v-for是核心是重点,一定要明白! -->
+                      <div v-for="(item,index) in array" :key="index">
+                        <a-form-item>
+                          <a-input style="width:20%;margin-right:10px" v-model="form.value[index]" placeholder="请输入新办号码"></a-input>
+                          <a-button type="danger" size="small" icon="PlusOutlined" circle @click="del(index)"></a-button>
+                        </a-form-item>
+                      </div>
+                    </a-form>
+                  </div>
                 </a-col>
                 <a-col :span="18">
                 </a-col>
@@ -782,8 +756,11 @@ export default {
   data() {
 
     return {
-      
 
+      array:[1],  //创建一个数组
+      form:{
+        value:[]  //接收每个input框的值
+      },
       riskShow:true,
       columns:[{ title: '证件编号', width: 180, dataIndex: 'cardNo', key: 'cardNo'  },
         { title: '客户名称', width: 150, dataIndex: 'cardName', key: 'cardName' , scopedSlots: {customRender: 'cardName'} },
@@ -801,7 +778,7 @@ export default {
         { title: '一证通查结果', dataIndex: 'operator', key: 'operator', width: 150 },
         { title: '运营商类型', dataIndex: 'operatorType', key: 'operatorType'  ,width: 150},
         { title: '现用号码使用用途', dataIndex: 'phonePurpose', key: 'phonePurpose',width: 150 },
-        { title: '新办手机号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
+        { title: '新办号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
         { title: '后续处理', width: 150, dataIndex: 'numberResults', key: 'numberResults', scopedSlots: {customRender: 'numberResults'}},
        ],
       columns2:[
@@ -1243,7 +1220,14 @@ export default {
   },
 
   methods: {
-
+// 添加按钮
+    add(){
+      this.array.push(1)  //通过添加array的值,增加input的个数
+    },
+    del(index){
+      this.form.value.splice(index,1)   //先删除form中value对应索引的值
+      this.array.splice(index,1)  //然后删除array对应索引的值,实现点击删除按钮,减少input框效果
+    },
     // dataShow(text, column, record, index ){
     //   if (text.record.calltestResults === '未接通' ) {
     //     return text.record.calltestResults= '未接通22'
@@ -1349,21 +1333,7 @@ export default {
       }
       let newPhonesStr='';
       for (var item of  newPhones) {
-        if (item.match(RegExp('newPhone1+')) && item.replace('newPhone1+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone1+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone2+')) && item.replace('newPhone2+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone2+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone3+')) && item.replace('newPhone3+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone3+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone4+')) && item.replace('newPhone4+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone4+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone5+')) && item.replace('newPhone5+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone5+', '')+"  "
-        }
+        newPhonesStr+=item+' '
       }
       result[i].newPhone=newPhonesStr;
       if (result[i].numberResults!==null && result[i].numberResults!==''){
@@ -1479,15 +1449,7 @@ export default {
         this.disabledList.push("4");
       }
     },
-      addPhone(){
-      this.size=this.size+1;
-    },
-    delPhone(){
-      if (this.size!==1){
-        this.size=this.size-1;
-      }
 
-    },
 // 特定范围随机数
     genRandom(min, max) {
       return (Math.random() * (max - min + 1) | 0) + min
@@ -2155,27 +2117,7 @@ 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;
@@ -2849,17 +2791,10 @@ export default {
         }
       }
       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;
+        if (this.form.value.length>0) {
+          this.model.newPhone=this.form.value.join(',');
+        }else {
+          this.$message.warning('新办号码至少选择一项!!!', 3);
         }
       }
 
@@ -3008,46 +2943,7 @@ export default {
 
     check3(data){
       var info = true;
-      if (data==='all' || data==='newPhone'){
-        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==='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){

+ 37 - 137
src/views/networkAccess/registrationSelect.vue

@@ -471,50 +471,23 @@
           :rules="rules"
         >
           <div>
-            <a-list size="large" bordered>
-              <a-list-item>
+            <a-list-item>
+              <a-col :span="8" >
+                <a-button type="primary" style="margin-left: 200px" @click="add">添加</a-button>
+              </a-col>
+              <a-col :span="20">
+                <div>
 
-                <a-col :span="10">
-                <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"  :disabled="isDisabled"></a-input>
-                    <!--                    </a-radio-group>-->
-                  </a-form-model-item>
+                  <a-form ref="form" :model="model"  label-width="80px">
+                    <!-- 这个的v-for是核心是重点,一定要明白! -->
+                    <div v-for="(item,index) in array" :key="index">
+                      <a-form-item>
+                        <a-input style="width:20%;margin-right:10px" v-model="form.value[index]" placeholder="请输入新办号码"></a-input>
+                        <a-button type="danger" size="small" icon="PlusOutlined" circle @click="del(index)"></a-button>
+                      </a-form-item>
+                    </div>
+                  </a-form>
                 </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" :disabled="isDisabled"></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":disabled="isDisabled"></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" :disabled="isDisabled"></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" :disabled="isDisabled"></a-input>
-                      <!--                    </a-radio-group>-->
-                    </a-form-model-item>
-                  </div>
-
-                </a-col>
-                <a-col :span="2" >
-                  <a-button type="link" danger @click="addPhone()"  :disabled="isDisabled">(+)</a-button>
-                  <a-button type="link" danger @click="delPhone()"  :disabled="isDisabled">(-)</a-button>
                 </a-col>
                 <a-col :span="18">
                 </a-col>
@@ -792,7 +765,10 @@ export default {
   data() {
 
     return {
-      
+      array:[1],  //创建一个数组
+      form:{
+        value:[]  //接收每个input框的值
+      },
 
       riskShow:true,
       columns:[{ title: '证件编号', width: 180, dataIndex: 'cardNo', key: 'cardNo'  },
@@ -811,7 +787,7 @@ export default {
         { title: '一证通查结果', dataIndex: 'operator', key: 'operator', width: 150 },
         { title: '运营商类型', dataIndex: 'operatorType', key: 'operatorType'  ,width: 150},
         { title: '现用号码使用用途', dataIndex: 'phonePurpose', key: 'phonePurpose',width: 150 },
-        { title: '新办手机号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
+        { title: '新办号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
         { title: '后续处理', width: 150, dataIndex: 'numberResults', key: 'numberResults', scopedSlots: {customRender: 'numberResults'}},
        ],
       columns2:[
@@ -1281,7 +1257,14 @@ export default {
   },
 
   methods: {
-
+// 添加按钮
+    add(){
+      this.array.push(1)  //通过添加array的值,增加input的个数
+    },
+    del(index){
+      this.form.value.splice(index,1)   //先删除form中value对应索引的值
+      this.array.splice(index,1)  //然后删除array对应索引的值,实现点击删除按钮,减少input框效果
+    },
     // dataShow(text, column, record, index ){
     //   if (text.record.calltestResults === '未接通' ) {
     //     return text.record.calltestResults= '未接通22'
@@ -1387,21 +1370,7 @@ export default {
       }
       let newPhonesStr='';
       for (var item of  newPhones) {
-        if (item.match(RegExp('newPhone1+')) && item.replace('newPhone1+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone1+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone2+')) && item.replace('newPhone2+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone2+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone3+')) && item.replace('newPhone3+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone3+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone4+')) && item.replace('newPhone4+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone4+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone5+')) && item.replace('newPhone5+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone5+', '')+"  "
-        }
+        newPhonesStr+=item+' '
       }
       result[i].newPhone=newPhonesStr;
       if (result[i].numberResults!==null && result[i].numberResults!==''){
@@ -1517,15 +1486,7 @@ export default {
         this.disabledList.push("4");
       }
     },
-      addPhone(){
-      this.size=this.size+1;
-    },
-    delPhone(){
-      if (this.size!==1){
-        this.size=this.size-1;
-      }
 
-    },
 // 特定范围随机数
     genRandom(min, max) {
       return (Math.random() * (max - min + 1) | 0) + min
@@ -2197,25 +2158,8 @@ 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+','')
-                }
+                this.form.value.push(item)
+                this.array.push(1)
               }
                 for (var item of this.sysCompany) {
                   if (item.id === this.model.company) {
@@ -2905,21 +2849,16 @@ export default {
         }
       }
       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;
+        if (this.form.value.length>0) {
+          this.model.newPhone=this.form.value.join(',');
+        }else {
+          this.$message.warning('新办号码至少选择一项!!!', 3);
         }
       }
 
 
+
+
       let data = {
         "sysBusinessHall": this.model.sysBusinessHall,
         "company": this.model.company,
@@ -3064,46 +3003,7 @@ export default {
 
     check3(data){
       var info = true;
-      if (data==='all' || data==='newPhone'){
-        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==='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){

+ 37 - 151
src/views/networkAccess/registrationUpdate.vue

@@ -473,48 +473,23 @@
           <div>
             <a-list size="large" bordered>
               <a-list-item>
+                <a-col :span="8" >
+                  <a-button type="primary" style="margin-left: 200px" @click="add">添加</a-button>
+                </a-col>
+                <a-col :span="20">
 
-                <a-col :span="10">
-                <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"  :disabled="isDisabled"></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" :disabled="isDisabled"></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":disabled="isDisabled"></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" :disabled="isDisabled"></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" :disabled="isDisabled"></a-input>
-                      <!--                    </a-radio-group>-->
-                    </a-form-model-item>
-                  </div>
+                  <div>
 
-                </a-col>
-                <a-col :span="2" >
-                  <a-button type="link" danger @click="addPhone()"  :disabled="isDisabled">(+)</a-button>
-                  <a-button type="link" danger @click="delPhone()"  :disabled="isDisabled">(-)</a-button>
+                    <a-form ref="form" :model="model"  label-width="80px">
+                      <!-- 这个的v-for是核心是重点,一定要明白! -->
+                      <div v-for="(item,index) in array" :key="index">
+                        <a-form-item>
+                          <a-input style="width:20%;margin-right:10px" v-model="form.value[index]" placeholder="请输入新办号码"></a-input>
+                          <a-button type="danger" size="small" icon="PlusOutlined" circle @click="del(index)"></a-button>
+                        </a-form-item>
+                      </div>
+                    </a-form>
+                  </div>
                 </a-col>
                 <a-col :span="18">
                 </a-col>
@@ -584,7 +559,7 @@
 
 
 
-            <a-table :columns="columns2" :data-source="dataRisk" bordered   v-if="showDataLog" >
+            <a-table :columns="columns2" :data-source="dataRisk" bordered   >
               <template #bodyCell="{ column, text }">
                 <template v-if="column.dataIndex === 'name'">
                   <a>{{ text }}</a>
@@ -709,7 +684,7 @@
                   <a-col :span="24">
                     <a-form-model-item label="智能地址研判" prop="userOpenState"  :labelCol="{span:7}"
                                        :wrapperCol="{span:12}">
-                      <a-radio-group v-model="model.judgmentResearch" button-style="solid"  @change="showCheck0('judgmentResearch')" :disabled="isDisabled">
+                      <a-radio-group v-model="model.judgmentResearch" button-style="solid"  @change="showCheck0('judgmentResearch')"  :disabled=true>
                         <a-radio value="1" style="color: red ">智能判研-异常</a-radio>
                         <a-radio value="2">智能判研-正常</a-radio>
                       </a-radio-group>
@@ -794,8 +769,10 @@ export default {
   data() {
 
     return {
-      
-
+      array:[1],  //创建一个数组
+      form:{
+        value:[]  //接收每个input框的值
+      },
       riskShow:true,
       columns:[{ title: '证件编号', width: 180, dataIndex: 'cardNo', key: 'cardNo'  },
         { title: '客户名称', width: 150, dataIndex: 'cardName', key: 'cardName' , scopedSlots: {customRender: 'cardName'} },
@@ -813,7 +790,7 @@ export default {
         { title: '一证通查结果', dataIndex: 'operator', key: 'operator', width: 150 },
         { title: '运营商类型', dataIndex: 'operatorType', key: 'operatorType'  ,width: 150},
         { title: '现用号码使用用途', dataIndex: 'phonePurpose', key: 'phonePurpose',width: 150 },
-        { title: '新办手机号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
+        { title: '新办号', dataIndex: 'newPhone', key: 'newPhone' ,width: 250},
         { title: '后续处理', width: 150, dataIndex: 'numberResults', key: 'numberResults', scopedSlots: {customRender: 'numberResults'}},
        ],
       columns2:[
@@ -893,7 +870,6 @@ export default {
       lnglats: [],
       map: null,
       lnglatMaps: new Map(),
-      lnglatTestList:[],
       zoom: 18,
       center: [118.02, 24.48],
       searchOption: {
@@ -1283,7 +1259,14 @@ export default {
   },
 
   methods: {
-
+    // 添加按钮
+    add(){
+      this.array.push(1)  //通过添加array的值,增加input的个数
+    },
+    del(index){
+      this.form.value.splice(index,1)   //先删除form中value对应索引的值
+      this.array.splice(index,1)  //然后删除array对应索引的值,实现点击删除按钮,减少input框效果
+    },
     // dataShow(text, column, record, index ){
     //   if (text.record.calltestResults === '未接通' ) {
     //     return text.record.calltestResults= '未接通22'
@@ -1389,21 +1372,7 @@ export default {
       }
       let newPhonesStr='';
       for (var item of  newPhones) {
-        if (item.match(RegExp('newPhone1+')) && item.replace('newPhone1+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone1+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone2+')) && item.replace('newPhone2+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone2+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone3+')) && item.replace('newPhone3+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone3+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone4+')) && item.replace('newPhone4+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone4+', '')+"  "
-        }
-        if (item.match(RegExp('newPhone5+')) && item.replace('newPhone5+', '') !== '') {
-          newPhonesStr = newPhonesStr+item.replace('newPhone5+', '')+"  "
-        }
+        newPhonesStr+=item+' '
       }
       result[i].newPhone=newPhonesStr;
       if (result[i].numberResults!==null && result[i].numberResults!==''){
@@ -1519,15 +1488,7 @@ export default {
         this.disabledList.push("4");
       }
     },
-      addPhone(){
-      this.size=this.size+1;
-    },
-    delPhone(){
-      if (this.size!==1){
-        this.size=this.size-1;
-      }
 
-    },
 // 特定范围随机数
     genRandom(min, max) {
       return (Math.random() * (max - min + 1) | 0) + min
@@ -1884,7 +1845,6 @@ export default {
           marker.content = data.get(key + 'name');
           marker.on('click', markerClick);
           marker.emit('click', {target: marker});//默认初始化不出现信息窗体,打开初始化就出现信息窗体
-          this.lnglatTestList.push(marker)
         }
       })
 
@@ -2198,25 +2158,8 @@ 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+','')
-                }
+                 this.form.value.push(item)
+                 this.array.push(1)
               }
                 for (var item of this.sysCompany) {
                   if (item.id === this.model.company) {
@@ -2905,17 +2848,10 @@ export default {
         }
       }
       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;
+        if (this.form.value.length>0) {
+          this.model.newPhone=this.form.value.join(',');
+        }else {
+          this.$message.warning('新办号码至少选择一项!!!', 3);
         }
       }
 
@@ -3064,57 +3000,7 @@ export default {
 
     check3(data){
       var info = true;
-      if (data==='all' || data==='newPhone'){
-        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==='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)) {

+ 3 - 15
src/views/networkAccess/userStatistics.vue

@@ -545,21 +545,9 @@ export default {
       var phone='';
       newPhones = newPhones.split(',');
       for (var item of  newPhones) {
-        if (item.match(RegExp('newPhone1+')) && item.replace('newPhone1+','')!==''){
-          phone=item.replace('newPhone1+','')
-        }
-        if (item.match(RegExp('newPhone2+'))&& item.replace('newPhone2+','')!==''){
-          phone+=item.replace('newPhone2+',' ')
-        }
-        if (item.match(RegExp('newPhone3+'))&& item.replace('newPhone3+','')!==''){
-          phone+=item.replace('newPhone3+',' ')
-        }
-        if (item.match(RegExp('newPhone4+'))&& item.replace('newPhone4+','')!==''){
-          phone+=item.replace('newPhone4+',' ')
-        }
-        if (item.match(RegExp('newPhone5+'))&& item.replace('newPhone5+','')!==''){
-          phone+=item.replace('newPhone5+',' ')
-        }
+
+          phone+=item+' '
+
       }
       return phone
     },