jiangping
2024-05-09 b62578f8b43f15be89b3d14f463f11aed03e6fb9
admin/src/views/business/internalMember.vue
@@ -39,7 +39,7 @@
        <template v-slot:menu>
            <div style="width: 100%; height: 50px; background: rgba(242, 242, 242, 1); line-height: 50px; text-align: center; font-size: 14px;">企业组织架构</div>
            <div style="width: 100%; height: calc(100vh - 170px); overflow-y: scroll;">
                <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'status', children: 'childList', id: 'erpId'}" @callback="callback" />
                <Tree :list="companyTree" :defaultProps="{name: 'name', status: 'fsStatus', children: 'childList', id: 'id'}" @callback="callback" />
            </div>
        </template>
        <!-- 表格和分页 -->
@@ -80,11 +80,12 @@
                    </template>
                </el-table-column>
                <el-table-column label="海康同步状态" min-width="100px">
                    <template slot-scope="{row}">
                 <template slot-scope="{row}">
                        <span v-if="row.hkStatus == 0" style="color: #435EBE">待同步</span>
                        <span v-if="row.hkStatus == 1" style="color: green">同步成功</span>
                        <span v-if="row.hkStatus == 2" style="color: red">同步失败</span>
                    </template>
                        <span v-if="row.hkStatus == 3" style="color: red">不符合下发条件</span>
                </template>
                </el-table-column>
                <el-table-column label="门禁角色" min-width="100px">
                    <template slot-scope="{row}">
@@ -94,6 +95,7 @@
                <el-table-column fixed="right" label="人脸信息" min-width="100px">
                    <template slot-scope="{row}">
                        <el-image
                            v-if="row.faceImg"
                            style="width: 60px; height: 60px"
                            :src="row.faceImg"
                            :preview-src-list="[row.faceImg]">
@@ -102,24 +104,19 @@
                </el-table-column>
                <el-table-column fixed="right" label="卡片信息" min-width="100px">
                    <template slot-scope="{row}">
                        <el-image
                            style="width: 60px; height: 60px"
                            :src="row.faceImg"
                            :preview-src-list="[row.faceImg]">
                        </el-image>
                        <el-button @click="$refs.cardOpeningRecord.open('开卡记录', row.id)" type="text">{{row.memberCardCount || '0'}}</el-button>
                    </template>
                </el-table-column>
<!--                <el-table-column-->
<!--                    v-if="containPermissions(['business:member:update', 'business:member:delete'])"-->
<!--                    label="操作"-->
<!--                    min-width="120"-->
<!--                    fixed="right"-->
<!--                >-->
<!--                    <template slot-scope="{row}">-->
<!--                        <el-button type="text" @click="$refs.operaMemberWindow.open('编辑人员信息表', row)" icon="el-icon-edit" v-permissions="['business:member:update']">编辑</el-button>-->
<!--                        <el-button type="text" @click="deleteById(row)" icon="el-icon-delete" v-permissions="['business:member:delete']">删除</el-button>-->
<!--                    </template>-->
<!--                </el-table-column>-->
                <el-table-column
                    v-if="containPermissions(['business:member:update', 'business:member:delete','business:empower:create'])"
                    label="操作"
                    min-width="120"
                    fixed="right"
                >
                    <template slot-scope="{row}">
                        <el-button type="text" @click="empower(row.id)" v-permissions="['business:empower:create']">重新授权</el-button>
                    </template>
                </el-table-column>
            </el-table>
            <pagination
                @size-change="handleSizeChange"
@@ -127,6 +124,8 @@
                :pagination="tableData.pagination"
            >
            </pagination>
            <!--    查看人员开卡记录    -->
            <cardOpeningRecord ref="cardOpeningRecord" @success="handlePageChange" />
        </template>
    </TableLayout1>
</template>
@@ -135,13 +134,14 @@
import BaseTable from '@/components/base/BaseTable'
import TableLayout1 from '@/layouts/TableLayout1'
import Pagination from '@/components/common/Pagination'
import cardOpeningRecord from '@/components/business/cardOpeningRecord'
import Tree from '@/components/common/Tree'
import { fetchList } from '@/api/business/company'
import { memberSync } from '@/api/business/member'
import { memberSync, roleAuth } from '@/api/business/member'
export default {
  name: 'internalMember',
  extends: BaseTable,
  components: { TableLayout1, Pagination, Tree },
  components: { TableLayout1, Pagination, Tree, cardOpeningRecord },
  data () {
    return {
      TreeList: [],
@@ -172,19 +172,36 @@
    this.getfindCompanyTreePage()
  },
  methods: {
    empower(id) {
      var that = this
      this.$confirm('确定重新授权吗?', '提示', {
        confirmButtonText: '确定',
        cancelButtonText: '取消',
        type: 'warning'
      }).then(() => {
        roleAuth(id)
          .then(res => {
            that.search()
          })
      }).catch(() => {
      });
    },
    // 获取组织树
    getfindCompanyTreePage () {
      fetchList(1)
        .then(res => {
          res[0].fsStatus = 1
          this.companyTree = res
          // this.searchForm.erpOrgId = res[0].erpId
          this.search()
          if (res && res.length > 0) {
            res[0].fsStatus = 1
            this.companyTree = res
            // this.searchForm.erpOrgId = res[0].erpId
            this.search()
          }
        })
    },
    // 同步信息
    async synchronous () {
      this.$dialog.actionConfirm('操作确认提醒', '您确认同步全部信息吗?')
      this.$dialog.actionConfirm('该操作降触发全员信息更新和重新下发!请谨慎操作', '您确认全量同步内部人员信息吗?')
        .then(() => {
          this.loading = true
          memberSync({})
@@ -202,7 +219,6 @@
        .catch(() => {})
    },
    callback (row) {
      console.log(row)
      this.searchForm.erpOrgId = row.erpId
      this.searchForm.companyId = row.id
      this.search()