Explorar o código

Merge branch 'dev' of http://110.41.163.243:9980/kd-aiot/kd-aiot-frontend into dev

yusheng hai 5 meses
pai
achega
e04e9f4b50

+ 9 - 0
src/api/system/organization/index.js

@@ -187,4 +187,13 @@ export async function exportGroupsAPI() {
     }
   );
   download(res.data, '组织机构列表.xlsx');
+}
+
+// 推送
+export async function employeePush(data) {
+  const res = await request.post('/port/Jd/employeePush', data);
+  if (res.data.code == 0) {
+    return res.data.data;
+  }
+  return Promise.reject(new Error(res.data.message));
 }

+ 30 - 1
src/views/system/organization/components/org-user-list.vue

@@ -53,6 +53,15 @@
           @click="bindingProcess"
           >绑定关键工序</el-button
         >
+        <el-button
+          v-if="$hasPermission('main:user:push')"
+          :disabled="selection?.length === 0"
+          type="primary"
+          size="mini"
+          plain
+          @click="allPushBtn"
+          >批量推送</el-button
+        >
       </template>
       <!-- 角色列 -->
       <template v-slot:roles="{ row }">
@@ -204,7 +213,8 @@
   import {
     getUserPage,
     removePersonnel,
-    unbindLoginName
+    unbindLoginName,
+    employeePush
   } from '@/api/system/organization';
   import { pageUsers, exportUsers } from '@/api/system/user';
   import dictMixins from '@/mixins/dictMixins';
@@ -334,6 +344,16 @@
               return dom ? dom.label : '';
             }
           },
+          {
+            prop: 'code',
+            label: '是否推送',
+            align: 'center',
+            showOverflowTooltip: true,
+            minWidth: 120,
+            formatter: (_row, _column, cellValue) => {
+              return _row.code? '已推送' : '未推送';
+            }
+          },
           {
             prop: 'isEnabled',
             align: 'center',
@@ -461,6 +481,15 @@
       };
     },
     methods: {
+      allPushBtn() {
+        const dataId = this.selection.map((v) => v.id);
+        employeePush(dataId).then((res) => {
+          this.$message.success('推送成功!');
+          this.reload();
+        }).catch(() => {
+          console.log('推送失败!');
+        });
+      },
       async addUsers(row) {
         // this.userRow = null;
         this.currentRow = row;