|
@@ -2,7 +2,10 @@
|
|
<div class="p-4">
|
|
<div class="p-4">
|
|
<BasicTable @register="registerTable">
|
|
<BasicTable @register="registerTable">
|
|
<template #toolbar>
|
|
<template #toolbar>
|
|
- <a-button v-power="[RoleEnum.COMPANY_ADMIN]" type="primary" @click="handleCreate"
|
|
|
|
|
|
+ <a-button
|
|
|
|
+ v-power="[RoleEnum.COMPANY_ADMIN, RoleEnum.PLAT_ADMIN]"
|
|
|
|
+ type="primary"
|
|
|
|
+ @click="handleCreate"
|
|
>新增</a-button
|
|
>新增</a-button
|
|
>
|
|
>
|
|
</template>
|
|
</template>
|
|
@@ -43,9 +46,9 @@
|
|
/>
|
|
/>
|
|
</template>
|
|
</template>
|
|
</BasicTable>
|
|
</BasicTable>
|
|
- <DetailsModal @register="registerDetail" @ok="reload" />
|
|
|
|
- <SetpaswordModal @register="register" @reload="reload" />
|
|
|
|
- <DelListModal @register="registerDelList" @reload="reload" />
|
|
|
|
|
|
+ <DetailsModal @register="registerDetail" @ok="reloadList" />
|
|
|
|
+ <SetpaswordModal @register="register" @reload="reloadList" />
|
|
|
|
+ <DelListModal @register="registerDelList" @reload="reloadList" />
|
|
</div>
|
|
</div>
|
|
</template>
|
|
</template>
|
|
<script lang="ts">
|
|
<script lang="ts">
|
|
@@ -89,15 +92,9 @@
|
|
const go = useGo();
|
|
const go = useGo();
|
|
const { t } = useI18n();
|
|
const { t } = useI18n();
|
|
onMounted(() => {
|
|
onMounted(() => {
|
|
- getNumByStaff({}).then((res) => {
|
|
|
|
- let { totalSubNum = 0 } = res;
|
|
|
|
- try {
|
|
|
|
- surplusSubNum.value = res.subNum - totalSubNum;
|
|
|
|
- } catch (error) {
|
|
|
|
- surplusSubNum.value = 0;
|
|
|
|
- }
|
|
|
|
- });
|
|
|
|
|
|
+ getNumByStaffData();
|
|
});
|
|
});
|
|
|
|
+
|
|
const columns: BasicColumn[] = [
|
|
const columns: BasicColumn[] = [
|
|
{
|
|
{
|
|
title: 'ID',
|
|
title: 'ID',
|
|
@@ -150,6 +147,7 @@
|
|
{
|
|
{
|
|
title: '操作',
|
|
title: '操作',
|
|
dataIndex: '',
|
|
dataIndex: '',
|
|
|
|
+ ifShow: !getCheckRole('tourist'),
|
|
slots: { customRender: 'action' },
|
|
slots: { customRender: 'action' },
|
|
fixed: 'right',
|
|
fixed: 'right',
|
|
width: 150,
|
|
width: 150,
|
|
@@ -220,11 +218,24 @@
|
|
openModal(true, record);
|
|
openModal(true, record);
|
|
}
|
|
}
|
|
function handleCreate() {
|
|
function handleCreate() {
|
|
|
|
+ if (getCheckRole([RoleEnum.COMPANY_ADMIN]) && surplusSubNum.value == 0) {
|
|
|
|
+ return createMessage.error('新增失败,分配账号数量不足');
|
|
|
|
+ }
|
|
openDetaileModal(true);
|
|
openDetaileModal(true);
|
|
}
|
|
}
|
|
function handleEdit(record: Recordable) {
|
|
function handleEdit(record: Recordable) {
|
|
openDetaileModal(true, record);
|
|
openDetaileModal(true, record);
|
|
}
|
|
}
|
|
|
|
+ function getNumByStaffData() {
|
|
|
|
+ getNumByStaff({}).then((res) => {
|
|
|
|
+ let { totalSubNum = 0 } = res;
|
|
|
|
+ try {
|
|
|
|
+ surplusSubNum.value = res.subNum - totalSubNum;
|
|
|
|
+ } catch (error) {
|
|
|
|
+ surplusSubNum.value = 0;
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
async function handleDelete(record) {
|
|
async function handleDelete(record) {
|
|
let check = await preDelApi(record.id); //
|
|
let check = await preDelApi(record.id); //
|
|
if (Array.isArray(check)) {
|
|
if (Array.isArray(check)) {
|
|
@@ -256,7 +267,10 @@
|
|
createMessage,
|
|
createMessage,
|
|
handDelconfirm,
|
|
handDelconfirm,
|
|
t,
|
|
t,
|
|
- reload,
|
|
|
|
|
|
+ reloadList: function () {
|
|
|
|
+ reload();
|
|
|
|
+ getNumByStaffData();
|
|
|
|
+ },
|
|
go,
|
|
go,
|
|
renderRoleType,
|
|
renderRoleType,
|
|
renderStatus,
|
|
renderStatus,
|
|
@@ -269,6 +283,7 @@
|
|
RoleEnum,
|
|
RoleEnum,
|
|
surplusSubNum,
|
|
surplusSubNum,
|
|
getCheckRole,
|
|
getCheckRole,
|
|
|
|
+ getNumByStaffData,
|
|
};
|
|
};
|
|
},
|
|
},
|
|
});
|
|
});
|