jiangping
2024-02-28 ad6dfb8323ab40ca8fe4fed94722c755d89c3203
admin/src/views/business/internalMember.vue
@@ -39,7 +39,7 @@
        <template v-slot:table-wrap>
            <ul class="toolbar" v-permissions="['business:member:delete']">
                <li><el-button type="primary">门禁授权</el-button></li>
                <li><el-button type="primary" v-permissions="['business:member:sync']">同步</el-button></li>
                <li><el-button type="primary" v-permissions="['business:member:sync']"  @click="synchronous()">同步</el-button></li>
                <li><el-button @click="deleteByIdInBatch" icon="el-icon-delete" v-permissions="['business:member:delete']">删除</el-button></li>
            </ul>
            <el-table
@@ -57,6 +57,7 @@
                        <span v-if="row.sex === 2">女</span>
                    </template>
                </el-table-column>
              <el-table-column prop="companyName" label="所属部门" min-width="100px"></el-table-column>
                <el-table-column prop="status" label="状态" min-width="100px">
                    <template slot-scope="{row}">
                        <span v-if="row.status === 0">正常</span>
@@ -122,6 +123,7 @@
import Pagination from '@/components/common/Pagination'
import Tree from '@/components/common/Tree'
import { fetchList } from '@/api/business/company'
import { memberSync } from '@/api/business/member'
export default {
  name: 'internalMember',
  extends: BaseTable,
@@ -137,6 +139,7 @@
        keyword: '',
        type: 2,
        erpOrgId: '',
        companyId: '',
        hasFace: ''
      },
      companyTree: []
@@ -162,9 +165,29 @@
          this.search()
        })
    },
    // 同步信息
    async synchronous () {
      this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?')
        .then(() => {
          this.isWorking.delete = true
          memberSync({})
            .then(res => {
              this.$tip.apiSuccess(res || '同步成功')
              this.search()
            })
            .catch(e => {
              this.$tip.apiFailed(e)
            })
            .finally(() => {
              this.isWorking.delete = false
            })
        })
        .catch(() => {})
    },
    callback (row) {
      console.log(row)
      this.searchForm.erpOrgId = row.erpId
      this.searchForm.companyId = row.id
      this.search()
    }
  }