|
@@ -6,6 +6,9 @@
|
|
|
>新增</a-button
|
|
|
>
|
|
|
</template>
|
|
|
+ <template #headerTop>
|
|
|
+ <Alert :message="`可添加员工数为${surplusSubNum}人`" type="info" />
|
|
|
+ </template>
|
|
|
<template #role="{ record }">
|
|
|
{{ renderRoleType(record.role) }}
|
|
|
</template>
|
|
@@ -49,7 +52,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<script lang="ts">
|
|
|
- import { defineComponent, computed } from 'vue';
|
|
|
+ import { defineComponent, computed, onMounted, ref } from 'vue';
|
|
|
import { BasicTable, useTable, BasicColumn, FormProps, TableAction } from '/@/components/Table';
|
|
|
import { useMessage } from '/@/hooks/web/useMessage';
|
|
|
import { useModal } from '/@/components/Modal';
|
|
@@ -57,9 +60,9 @@
|
|
|
import SetpaswordModal from './setpaswordModal.vue';
|
|
|
import DetailsModal from './detailsModal.vue';
|
|
|
import DelListModal from './delListModal.vue';
|
|
|
- // import { Switch } from 'ant-design-vue';
|
|
|
+ import { Alert } from 'ant-design-vue';
|
|
|
// import { h } from 'vue';
|
|
|
- import { ListApi, delApi, preDelApi } from '/@/api/staff/list';
|
|
|
+ import { ListApi, delApi, preDelApi, getNumByStaff } from '/@/api/staff/list';
|
|
|
import { useI18n } from '/@/hooks/web/useI18n';
|
|
|
// import { useCopyToClipboard } from '/@/hooks/web/useCopyToClipboard';
|
|
|
import { RoleEnum } from '/@/enums/roleEnum';
|
|
@@ -67,9 +70,18 @@
|
|
|
import { Time } from '/@/components/Time';
|
|
|
import { useUserStore } from '/@/store/modules/user';
|
|
|
export default defineComponent({
|
|
|
- components: { BasicTable, TableAction, Time, SetpaswordModal, DetailsModal, DelListModal },
|
|
|
+ components: {
|
|
|
+ BasicTable,
|
|
|
+ TableAction,
|
|
|
+ Time,
|
|
|
+ SetpaswordModal,
|
|
|
+ DetailsModal,
|
|
|
+ DelListModal,
|
|
|
+ Alert,
|
|
|
+ },
|
|
|
setup() {
|
|
|
const [register, { openModal }] = useModal();
|
|
|
+ const surplusSubNum = ref(0);
|
|
|
const [registerDetail, { openModal: openDetaileModal }] = useModal();
|
|
|
const [registerDelList, { openModal: openDelListeModal }] = useModal();
|
|
|
const { createConfirm, createMessage } = useMessage();
|
|
@@ -78,6 +90,12 @@
|
|
|
console.log('getRoleList', roleList);
|
|
|
const go = useGo();
|
|
|
const { t } = useI18n();
|
|
|
+ onMounted(() => {
|
|
|
+ getNumByStaff({}).then((res) => {
|
|
|
+ let { totalSubNum = 0 } = res;
|
|
|
+ surplusSubNum.value = totalSubNum;
|
|
|
+ });
|
|
|
+ });
|
|
|
const columns: BasicColumn[] = [
|
|
|
{
|
|
|
title: 'ID',
|
|
@@ -247,6 +265,7 @@
|
|
|
handleDelete,
|
|
|
uploadApi: uploadApi as any,
|
|
|
RoleEnum,
|
|
|
+ surplusSubNum,
|
|
|
};
|
|
|
},
|
|
|
});
|