Sfoglia il codice sorgente

add:导出重粉记录

ct 5 giorni fa
parent
commit
fa7ba044fc

+ 9 - 0
src/api/qw/externalContact.js

@@ -341,3 +341,12 @@ export function companyTransfer(data) {
     data: data
   })
 }
+
+// 导出重粉企业微信客户
+export function exportRepeatExternalContact(data) {
+  return request({
+    url: '/qw/externalContact/exportRepeatExternalContact',
+    method: 'post',
+    data: data
+  })
+}

+ 35 - 2
src/views/qw/externalContact/deptIndex.vue

@@ -241,6 +241,17 @@
                 v-hasPermi="['qw:externalContact:add']"
               >同步</el-button>
             </el-col> -->
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportRepeatLoading"
+          @click="handleRepeatExport"
+          v-hasPermi="['qw:externalContact:exportRepeat']"
+        >导出重粉记录</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="success"
@@ -814,7 +825,7 @@ import {
   unBindUserId,
   updateExternalContact,
   getRepeat,
-  updateExternalContactCall, myDeptExtList
+  updateExternalContactCall, myDeptExtList,exportRepeatExternalContact
 } from '../../../api/qw/externalContact'
 import {getMyQwCompanyList,getQwUserListLikeName} from "@/api/qw/user";
 import {getId} from "@/api/store/healthRecord";
@@ -835,7 +846,8 @@ export default {
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,healthRecordDetails,userDetails},
   data() {
     return {
-
+      userIds: [],
+      exportRepeatLoading: false,
       resultDialogVisible: false,
       resultMessage: '',
       resultTitle:'',
@@ -1095,6 +1107,26 @@ export default {
 
   },
   methods: {
+    /** 重粉导出按钮操作 */
+    handleRepeatExport() {
+      const { qwUserName, ...queryParams} = this.queryParams;
+      let finalQueryParams = { ...queryParams };
+      if (this.userIds != null && this.userIds.length > 0) {
+        finalQueryParams = { ...queryParams, userIds: this.userIds };
+      }
+      finalQueryParams = {...finalQueryParams,exportType:"dept"};
+      this.$confirm('是否确认导出所有重粉企业微信客户数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportRepeatLoading = true;
+        return exportRepeatExternalContact(finalQueryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportRepeatLoading = false;
+      }).catch(() => {});
+    },
 
     onQwUserNameClear() {
       this.queryParams.qwUserId = null;  // 同时清空 qwUserId
@@ -1833,6 +1865,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.userIds = selection.map(item => item.fsUserId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },

+ 38 - 4
src/views/qw/externalContact/index.vue

@@ -301,6 +301,17 @@
           v-hasPermi="['qw:externalContact:export']"
         >导出</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportRepeatLoading"
+          @click="handleRepeatExport"
+          v-hasPermi="['qw:externalContact:exportRepeat']"
+        >导出重粉记录</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -939,7 +950,7 @@ import {
   setCustomerCourseSop,
   getCustomerCourseSop,
   setCustomerCourseSopList,
-  unBindUserId, updateExternalContactCall,updateExternalContactStatus,getWatchLogList
+  unBindUserId, updateExternalContactCall,updateExternalContactStatus,getWatchLogList,exportRepeatExternalContact
 } from '@/api/qw/externalContact'
 import {getMyQwUserList, getMyQwCompanyList, updateUser,getQwUserListLikeName} from "@/api/qw/user";
 import {listTag, getTag, searchTags} from "@/api/qw/tag";
@@ -1033,9 +1044,11 @@ export default {
         open:false,
         index:null,
       },
-	  sTime:null,
-	  eTime:null,
-	  createTime:null,
+      sTime:null,
+      eTime:null,
+      createTime:null,
+      userIds: [],
+      exportRepeatLoading: false,
       // 遮罩层
       loading: false,
       // 导出遮罩层
@@ -1987,6 +2000,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.userIds = selection.map(item => item.fsUserId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },
@@ -2268,6 +2282,26 @@ export default {
           this.exportLoading = false;
         }).catch(() => {});
     },
+    /** 重粉导出按钮操作 */
+    handleRepeatExport() {
+      const { qwUserName, ...queryParams } = this.queryParams;
+      let finalQueryParams = { ...queryParams };
+      if (this.userIds != null && this.userIds.length > 0) {
+        finalQueryParams = { ...queryParams, userIds: this.userIds };
+      }
+      finalQueryParams = {...finalQueryParams,exportType:"index"};
+      this.$confirm('是否确认导出所有重粉企业微信客户数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportRepeatLoading = true;
+        return exportRepeatExternalContact(finalQueryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportRepeatLoading = false;
+      }).catch(() => {});
+    },
     handleBatchUpdateNotesFilter() {
       this.notesOpen.open = true;
       this.notesOpen.filter = true;

+ 34 - 0
src/views/qw/externalContact/myExternalContact.vue

@@ -275,6 +275,17 @@
           v-hasPermi="['qw:externalContact:myExport']"
         >导出</el-button>
       </el-col>
+      <el-col :span="1.5">
+        <el-button
+          type="warning"
+          plain
+          icon="el-icon-download"
+          size="mini"
+          :loading="exportRepeatLoading"
+          @click="handleRepeatExport"
+          v-hasPermi="['qw:externalContact:exportRepeat']"
+        >导出重粉记录</el-button>
+      </el-col>
       <el-col :span="1.5">
         <el-button
           type="primary"
@@ -1010,6 +1021,7 @@ import {
   getCustomerCourseSop,
   setCustomerCourseSopList,
   syncMyExternalContact, unBindUserId, updateExternalContactCall,exportMyExternalContact,updateExternalContactStatus,getWatchLogList
+  ,exportRepeatExternalContact
 } from '@/api/qw/externalContact'
 import info from "@/views/qw/externalContact/info.vue";
 import {getMyQwUserList, getMyQwCompanyList, handleInputAuthAppKey, updateUser} from "@/api/qw/user";
@@ -1032,6 +1044,8 @@ export default {
   components:{PaginationMore, mycustomer,customerDetails,SopDialog,selectUser,info,Collection,userDetails},
   data() {
     return {
+      userIds: [],
+      exportRepeatLoading: false,
       member:{
         title:"客户详情",
         open:false,
@@ -1297,6 +1311,25 @@ export default {
 
   },
   methods: {
+    /** 重粉导出按钮操作 */
+    handleRepeatExport() {
+      let finalQueryParams = this.queryParams
+      if (this.userIds != null && this.userIds.length > 0) {
+        finalQueryParams = { ...finalQueryParams, userIds: this.userIds };
+      }
+      finalQueryParams = {...finalQueryParams,exportType:"my"};
+      this.$confirm('是否确认导出所有重粉企业微信客户数据项?', "警告", {
+        confirmButtonText: "确定",
+        cancelButtonText: "取消",
+        type: "warning"
+      }).then(() => {
+        this.exportRepeatLoading = true;
+        return exportRepeatExternalContact(finalQueryParams);
+      }).then(response => {
+        this.download(response.msg);
+        this.exportRepeatLoading = false;
+      }).catch(() => {});
+    },
     /** 重粉查看操作 */
     showLog(row) {
       this.log.queryParams.fsUserId = row.fsUserId;
@@ -2024,6 +2057,7 @@ export default {
     // 多选框选中数据
     handleSelectionChange(selection) {
       this.ids = selection.map(item => item.id)
+      this.userIds = selection.map(item => item.fsUserId)
       this.single = selection.length!==1
       this.multiple = !selection.length
     },