提交 872ef813 authored 作者: 袁伟伟's avatar 袁伟伟
......@@ -31,7 +31,16 @@ const getDistributorId = ({ colProps }) => {
rules: [{ required: true, type: 'object', message: '请选择经销商!' }],
},
table: {
customRender: ({ text, record }) => get(record, 'distributor.name') || text,
customRender: ({ text, record }) => {
const getText = (text) => {
if (text === 0) {
return '供应商创建';
} else {
return '(已删除/不存在)';
}
};
return get(record, 'distributor.name') || getText(text);
},
},
};
};
......
......@@ -3,9 +3,7 @@
*/
import { onActivated, ref } from 'vue';
let reload: () => void;
const activatedReload = () => {
export function useActivatedReload(reload) {
const isOnActivated = ref(false);
onActivated(() => {
if (isOnActivated.value) {
......@@ -14,9 +12,4 @@ const activatedReload = () => {
isOnActivated.value = true;
}
});
};
export function useActivatedReload(reloadFunc) {
reload = reloadFunc;
return activatedReload;
}
......@@ -67,6 +67,12 @@ export const useUserStore = defineStore({
getDistributorId(): number {
return this.userInfo?.distributorId as number;
},
/**
* @description 是否是经销商 true 是 false
*/
getIsDistributor(): boolean {
return this.getDistributorId !== 0;
},
},
actions: {
setToken(info: string | undefined) {
......
......@@ -8,6 +8,7 @@
<span>已选中{{ checkedKeys.length }}条记录</span>
<a-button type="link" @click="checkedKeys = []" size="small">清空</a-button>
<a-popconfirm
v-if="isShowHandleDelete()"
class="ml-4"
title="确定要全部删除吗?"
ok-text="是"
......@@ -17,6 +18,7 @@
<a href="#" class="text-red-500">删除</a>
</a-popconfirm>
<a-popconfirm
v-if="hasPermission('AUTH_SYSTEM_DOCTOR:PASSED')"
class="ml-4"
title="确定要全部通过审核吗?"
ok-text="是"
......@@ -84,6 +86,7 @@
tooltip: '详情',
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
ifShow: hasPermission('AUTH_SYSTEM_DOCTOR:QUERY'),
},
{
tooltip: '删除',
......@@ -113,7 +116,8 @@
getVerifyParams,
StatusValEnum,
} from './schema';
import { onActivated, ref, unref } from 'vue';
const { hasPermission } = usePermission();
import { ref } from 'vue';
import { useGo } from '/@/hooks/web/usePage';
import { BasicTable, useTable, TableAction, TableActionType } from '/@/components/Table';
import { isObject } from '/@/utils/is';
......@@ -127,6 +131,7 @@
import { BatchVerifyParams } from '/@/api/model/doctor';
import { useUserStore } from '/@/store/modules/user';
import { useActivatedReload } from '/@/hooks/myhooks/reLoadHook';
import { usePermission } from '/@/hooks/web/usePermission';
const go = useGo();
const { formConfig, showTableSetting, bordered, showIndexColumn } = componentSetting.table;
const basicTableRef = ref<TableActionType>();
......@@ -166,7 +171,7 @@
},
});
useActivatedReload(reload)();
useActivatedReload(reload);
const handleParams = (params) => {
const { pageNum, pageSize } = params;
......@@ -190,10 +195,8 @@
}
});
// 如果是经销商,只能看到自己的数据
if (userStore.getDistributorId !== 0) {
if (userStore.getIsDistributor) {
handledParams.distributorId = userStore.getDistributorId;
} else if (userStore.getDistributorId == null) {
handledParams.distributorId = -1;
}
return handledParams;
};
......
......@@ -46,7 +46,7 @@ export enum StatusValEnum {
}
export const isShowHandlePassed = (status: string): boolean => {
return hasPermission('AUTH_SYSTEM_DOCTOR:PASSED') && status === 'PENDING_REVIEW';
return (hasPermission('AUTH_SYSTEM_DOCTOR:PASSED') && status === 'PENDING_REVIEW') || status === 'FORBIDDEN';
};
export const isShowHandleReject = (status: string): boolean => {
return hasPermission('AUTH_SYSTEM_DOCTOR:REJECT') && status === 'PENDING_REVIEW';
......
......@@ -8,6 +8,7 @@
<span>已选中{{ checkedKeys.length }}条记录</span>
<a-button type="link" @click="checkedKeys = []" size="small">清空</a-button>
<a-popconfirm
v-if="hasPermission('AUTH_SYSTEM_HOSPITAL:DELETE')"
class="ml-4"
title="确定要全部删除吗?"
ok-text="是"
......@@ -44,6 +45,7 @@
tooltip: '详情',
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
ifShow: hasPermission('AUTH_SYSTEM_HOSPITAL:QUERY'),
},
{
tooltip: '删除',
......@@ -64,7 +66,7 @@
</div>
</template>
<script lang="ts" setup name="AUTH_SYSTEM_HOSPITAL">
import { onActivated, ref } from 'vue';
import { ref } from 'vue';
import { useGo } from '/@/hooks/web/usePage';
import { usePermission } from '/@/hooks/web/usePermission';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
......@@ -116,7 +118,7 @@
},
});
useActivatedReload(reload)();
useActivatedReload(reload);
const handleParams = (params) => {
const { pageNum, pageSize } = params;
......
......@@ -8,6 +8,7 @@
<span>已选中{{ checkedKeys.length }}条记录</span>
<a-button type="link" @click="checkedKeys = []" size="small">清空</a-button>
<a-popconfirm
v-if="isShowHandleDelete()"
class="ml-4"
title="确定要全部删除吗?"
ok-text="是"
......@@ -17,6 +18,7 @@
<a href="#" class="text-red-500">删除</a>
</a-popconfirm>
<a-popconfirm
v-if="hasPermission('AUTH_SYSTEM_RECEIVER:PASSED')"
class="ml-4"
title="确定要全部通过审核吗?"
ok-text="是"
......@@ -83,6 +85,7 @@
tooltip: '详情',
icon: 'ant-design:eye-outlined',
onClick: handleView.bind(null, record),
ifShow: hasPermission('AUTH_SYSTEM_RECEIVER:QUERY'),
},
{
tooltip: '删除',
......@@ -103,6 +106,7 @@
</div>
</template>
<script lang="ts" setup name="AUTH_SYSTEM_RECEIVER">
import { usePermission } from '/@/hooks/web/usePermission';
import { ref } from 'vue';
import { useGo } from '/@/hooks/web/usePage';
import { BasicTable, useTable, TableAction } from '/@/components/Table';
......@@ -127,7 +131,7 @@
import { BatchVerifyParams } from '/@/api/model/doctor';
import { useUserStore } from '/@/store/modules/user';
import { useActivatedReload } from '/@/hooks/myhooks/reLoadHook';
const { hasPermission } = usePermission();
const go = useGo();
const { formConfig, showTableSetting, bordered, showIndexColumn } = componentSetting.table;
const userStore = useUserStore();
......@@ -165,7 +169,7 @@
fixed: 'right',
},
});
useActivatedReload(reload)();
useActivatedReload(reload);
const handleParams = (params) => {
const { pageNum, pageSize } = params;
const handledParams: any = { pageNum, pageSize };
......@@ -188,10 +192,8 @@
}
});
// 如果是经销商,只能看到自己的数据
if (userStore.getDistributorId !== 0) {
if (userStore.getIsDistributor) {
handledParams.distributorId = userStore.getDistributorId;
} else if (userStore.getDistributorId == null) {
handledParams.distributorId = -1;
}
return handledParams;
};
......
......@@ -55,7 +55,7 @@ for (const key in StatusEnum) {
}
export const isShowHandlePassed = (status: string): boolean => {
return hasPermission('AUTH_SYSTEM_RECEIVER:PASSED') && status === 'PENDING_REVIEW';
return (hasPermission('AUTH_SYSTEM_RECEIVER:PASSED') && status === 'PENDING_REVIEW') || status === 'FORBIDDEN';
};
export const isShowHandleReject = (status: string): boolean => {
return hasPermission('AUTH_SYSTEM_RECEIVER:REJECT') && status === 'PENDING_REVIEW';
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论