Bläddra i källkod

1.入网登记批量上传新办手机号和用户编号

“liuhy” 2 år sedan
förälder
incheckning
af7bd32230

BIN
public/static/newPhoneAndUserId.xlsx


+ 53 - 17
src/views/networkAccess/registration.vue

@@ -625,23 +625,36 @@
           :rules="rules"
         >
           <div>
+            <div style="height: 45px">
+              <a-upload v-has="'netWork:newPhone:excel:read'" name="file"
+                        :showUploadList="false"
+                        :multiple="false"
+                        :headers="tokenHeader"
+                        :action="url.importExcel"
+                        @change="uploadChange">
+                <a-button type="primary" icon="upload">批量上传新办号码及用户编号</a-button>
+              </a-upload>
+
+              <a-button style="left: 2%" type="primary"
+                        @click="downloadTemplat">下载导入模版
+              </a-button>
+
+<!--              <a-button style="left: 4%" type="default"
+                        @click="downloadTemplat">清空导入
+              </a-button>-->
+
+            </div>
+
+
+
+
+
             <a-list size="large" bordered>
               <a-list-item>
                 <a-col :span="5">
 
                 </a-col>
                 <a-col :span="24">
-<!--                  <div>
-                    <a-upload name="file"
-                              :showUploadList="false"
-                              :multiple="false"
-                              :headers="tokenHeader"
-                              :action="url.importExcel"
-                              @change="uploadChange">
-                      <a-button type="primary" icon="upload">批量上传新办号码及用户编号</a-button>
-                    </a-upload>
-                  </div>-->
-
                   <a-form ref="form" :model="model">
                     <!-- 这个的v-for是核心是重点,一定要明白! -->
                     <div v-for="(item,index) in array" :key="index">
@@ -1589,6 +1602,7 @@ export default {
      * @param result 回调值
      */
     uploadChange(result) {
+      var that = this;
       let file = result.file;
       let event = result.event;
       if (event === undefined && file.status === 'uploading') {
@@ -1604,13 +1618,23 @@ export default {
           this.$message.error(message);
         }
         if (file.status === 'done') {
-          this.dataSource = file.response.result.data;
-          this.errorCount = file.response.result.errorCount;
-          if (this.errorCount > 0) {
-            this.$message.error('导入含有错误项,请检查内容')
-          } else {
-            this.$message.info('上传完成');
+          let resultList = file.response.resultList;
+          if (resultList && resultList.length > 0){
+            let length = that.form.value.length;
+            for (let i in resultList){
+              let newPhone = resultList[i].newPhone;
+              let phoneUserId = resultList[i].phoneUserId;
+              that.form.value[length] = newPhone
+              that.form.phoneUserId[length] = phoneUserId
+              that.add();
+              length = length + 1;
+            }
+
+
           }
+
+
+          this.$message.info('上传完成');
         }
       }
 
@@ -1664,6 +1688,7 @@ export default {
         return this.$message.warning('新办号码保留至少一项!!!', 3);
       }
       this.form.value.splice(index, 1)   //先删除form中value对应索引的值
+      this.form.phoneUserId.splice(index, 1)
       this.array.splice(index, 1)  //然后删除array对应索引的值,实现点击删除按钮,减少input框效果
     },
     // dataShow(text, column, record, index ){
@@ -3677,6 +3702,17 @@ export default {
       this.model = {}
       this.current = 0;
     },
+
+    /**下载模版*/
+    downloadTemplat() {
+      const a = document.createElement('a')
+      a.href = '/web/tnc/static/newPhoneAndUserId.xlsx'
+      a.setAttribute('download', '新办号码及用户编号模版.xlsx')
+      a.click();
+      a.remove();
+    },
+
+
   },
 }
 </script>

Filskillnaden har hållts tillbaka eftersom den är för stor
+ 381 - 261
src/views/networkAccess/registrationUpdate.vue


Vissa filer visades inte eftersom för många filer har ändrats