Bläddra i källkod

Merge branch 'master' of http://47.100.37.243:10191/wutt/manHourHousekeeper

QuYueTing 2 månader sedan
förälder
incheckning
d51a125b5c
1 ändrade filer med 42 tillägg och 2 borttagningar
  1. 42 2
      fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

+ 42 - 2
fhKeeper/formulahousekeeper/customerBuler-crm/src/pages/team/index.vue

@@ -48,6 +48,7 @@
               <el-dropdown-item @click="addPersone(false)" v-permission="['teamAdd']">添加人员</el-dropdown-item>
               <el-dropdown-item @click="transitionOperation('exportUser', '')" v-permission="['teamExport']">导出人员</el-dropdown-item>
               <el-dropdown-item @click="transitionOperation('importUser', '')" v-permission="['teamImport']">批量导入</el-dropdown-item>
+              <el-dropdown-item v-if="userInfo.userNameNeedTranslate == 1" @click="dialogFrom.newSyncWithCorpWxDayloadVisable = true">同步企微通讯录</el-dropdown-item>
             </el-dropdown-menu>
           </template>
         </el-dropdown>
@@ -240,6 +241,24 @@
       </div>
     </el-dialog>
 
+    <!-- 同步企业微信通讯录 -->
+    <el-dialog v-model="dialogFrom.newSyncWithCorpWxDayloadVisable" width="600" :show-close="false" :before-close="handleClose">
+      <template #header="{ close, titleId, titleClass }">
+        <div class="flex justify-between items-center border-b pb-3 dialog-header">
+          <h4 :id="titleId">同步企微通讯录</h4>
+          <div class="flex">
+            <el-button @click="dialogFrom.newSyncWithCorpWxDayloadVisable = false">取消</el-button>
+            <el-button type="primary" :loading="loadingFrom.newSyncWithCorpWxDayloadLoading" @click="newSyncWithCorpWx()">
+              开始同步
+            </el-button>
+          </div>
+        </div>
+      </template>
+      <div class="pt-4 px-12 py-2">
+        同步前请联系企业微信管理员检查应用授权的可见范围路径:管理企业-应用管理-工时管家-可见范围
+      </div>
+    </el-dialog>
+
     <!-- 新增人员 -->
     <AddPersonnelModal :data="{
       addPersonnelDialogVisible: dialogFrom.addPersonnelDialogVisible,
@@ -256,7 +275,7 @@
 
 <script lang="ts" setup>
 import { ref, reactive, onMounted, onBeforeMount, inject } from 'vue';
-import { UploadRequestOptions, dayjs } from 'element-plus'
+import { UploadRequestOptions, dayjs, ElLoading } from 'element-plus'
 import { Search, CirclePlusFilled, Edit, CirclePlus, Delete } from '@element-plus/icons-vue'
 import { FormInstance, FormRules, ElMessageBox } from 'element-plus'
 import { useStore } from '@/store/index'
@@ -300,7 +319,8 @@ const loadingFrom = reactive({ // 所有加载状态
   deptDialogVisibleLoading: false,
   resignationLoading: false,
   exportUserLoading: false,
-  importLoading: false
+  importLoading: false,
+  newSyncWithCorpWxDayloadLoading: false
 })
 const dialogFrom: any = reactive({ // 所有弹窗状态
   addDeptDialogVisible: false,
@@ -309,6 +329,7 @@ const dialogFrom: any = reactive({ // 所有弹窗状态
   resignationVisible: false,
   exportUserVisible: false,
   importVisible: false,
+  newSyncWithCorpWxDayloadVisable: false
 });
 const allText = reactive({
   batchText: '批量操作'
@@ -355,6 +376,25 @@ const deptRules = reactive<FormRules<typeof deptForm>>({ // 部门表单校验
   name: [{ required: true, trigger: 'blur', message: '请输入部门名称' }]
 })
 
+// 同步企业微信通讯录
+function newSyncWithCorpWx() {
+  const loading = ElLoading.service({
+    lock: true,
+    text: 'Loading',
+    background: 'rgba(0, 0, 0, 0.7)',
+  })
+  post(`/wxcorp/getCorpMembsFromPlatform`, { companyId: userInfo.value.companyId }).then(() => {
+    globalPopup?.showSuccess('同步成功')
+    dialogFrom.newSyncWithCorpWxDayloadVisable = false
+    getRoleList()
+    getUserList()
+    getTableData()
+    getDeptList()
+  }).finally(() => {
+    loading.close();
+  })
+}
+
 // 定义方法
 async function importUser(param: UploadRequestOptions) {
   loadingFrom.importLoading = true