From 3cc4abeb92d11d7a8b365928c5aa9452679fe06c Mon Sep 17 00:00:00 2001
From: zhouwx <1175765986@qq.com>
Date: 星期一, 19 八月 2024 09:04:50 +0800
Subject: [PATCH] 责任人增加筛选条件

---
 src/views/Admin/contactBook/contactors.vue |   62 +++++++++++++++++++++++++++---
 1 files changed, 55 insertions(+), 7 deletions(-)

diff --git a/src/views/Admin/contactBook/contactors.vue b/src/views/Admin/contactBook/contactors.vue
index ee6f2b2..c01d159 100644
--- a/src/views/Admin/contactBook/contactors.vue
+++ b/src/views/Admin/contactBook/contactors.vue
@@ -24,16 +24,18 @@
           </div>
         </div>
         <div style="margin: 20px 0;display: flex;justify-content: space-between">
-          <div>
+          <div style="display: flex;align-items: center">
             <a-button  type="primary" style="margin-right: 10px" @click="editData('add',{})">新增</a-button>
             <a-button  type="primary" @click="massImport()">批量导入</a-button>
           </div>
           <a-button type="primary" @click="openExport">批量导出</a-button>
-
-<!--          <download-excel :data="json_data" :fields="json_fields" name="责任人导出.xlsx" >-->
-<!--            <a-button type="primary">批量导出</a-button>-->
-<!--          </download-excel>-->
-
+        </div>
+        <div style="display: flex;align-items: center;margin-bottom: 15px">
+          <a-input v-model="search.searchParams.name" placeholder="请输入姓名" style="width: 250px;margin-right: 10px"></a-input>
+          <a-input v-model="search.searchParams.phone" placeholder="请输入电话" style="width: 250px;margin-right: 10px"></a-input>
+          <a-input v-model="search.searchParams.company" placeholder="请输入单位" style="width: 250px;margin-right: 10px"></a-input>
+          <a-button  type="primary" style="margin-right: 10px" @click="getUserList()">查询</a-button>
+          <a-button   @click="resetSearch()">重置</a-button>
         </div>
 
         <div class="table-cont">
@@ -96,6 +98,11 @@
 
       </a-form-model>
     </a-modal>
+    <a-modal v-model="importDialog" title="导入失败列表" :footer="null" centered :afterClose="closeImportDialog">
+      <span style="margin-bottom: 20px;font-size: 16px">{{errorMsg}}</span>
+      <a-table :columns="errColumns" :data-source="errorData"  :rowKey="record=>record.id" bordered :pagination="false" :scroll="{y:'200px'}">
+      </a-table>
+    </a-modal>
   </div>
 </template>
 
@@ -133,12 +140,14 @@
       unittype: null,
       districtId: null,
       currentKey: [],
+      importDialog:false,
       search:{
         pageIndex: 1,
         pageSize: 10,
         searchParams: {
           name: '',
           phone: '',
+          company: '',
           orgStructureId: null
         }
       },
@@ -208,6 +217,14 @@
         onChange: ( page, pageSize ) => this.onPageChange(page,pageSize),
         showTotal: total => `共 ${total} 条`
       },
+      paginationErr: {
+        current: 1,
+        defaultCurrent: 1,
+        defaultPageSize: 10,
+        total: 0,
+        onChange: ( page, pageSize ) => this.onPageChangeErr(page,pageSize),
+        showTotal: total => `共 ${total} 条`
+      },
       fieldNames:{
         label: 'name',
         value: 'id',
@@ -245,7 +262,21 @@
           }
         },
       },
-      json_data: []
+      json_data: [],
+      errorData: [],
+      errorMsg: '',
+      errColumns:[
+        {
+          title: '姓名',
+          dataIndex: 'name',
+          key: 'name'
+        },
+        {
+          title: '失败原因',
+          dataIndex: 'errorMsg',
+          key: 'errorMsg'
+        },
+      ],
     }
   },
   created() {
@@ -309,6 +340,11 @@
           this.uploadLoading = false
           this.visible = false
           await this.getUserList()
+          if(res.data.data && res.data.data.length>0){
+            this.errorMsg = res.data.msg
+            this.errorData = res.data.data
+            this.importDialog = true;
+          }
         }else{
           this.$message.warning(res.data.msg);
           this.uploadLoading = false
@@ -322,6 +358,11 @@
       this.exportAreaId = null;
       this.json_data = [];
       this.exportDialog = false;
+    },
+    closeImportDialog(){
+      this.errorMsg = '';
+      this.errorData = [];
+      this.importDialog = false;
     },
     async getStructure(){
       const t = this
@@ -392,6 +433,7 @@
         searchParams: {
           name: '',
           phone: '',
+          company: '',
           orgStructureId: null
         }
       }
@@ -423,6 +465,12 @@
       t.search = {
         pageIndex: 1,
         pageSize: 10,
+        searchParams: {
+          name: '',
+          phone: '',
+          company: '',
+          orgStructureId: t.search.searchParams.orgStructureId
+        }
       }
       t.getUserList()
     },

--
Gitblit v1.9.2