1. 业务员查看维度增加
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
Some checks failed
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Test (windows-latest) (push) Has been cancelled
CI / Lint (ubuntu-latest) (push) Has been cancelled
CI / Lint (windows-latest) (push) Has been cancelled
CI / Check (ubuntu-latest) (push) Has been cancelled
CI / Check (windows-latest) (push) Has been cancelled
CI / CI OK (push) Has been cancelled
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
Deploy Website on push / Deploy Push Playground Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Docs Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Antd Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Element Ftp (push) Has been cancelled
Deploy Website on push / Deploy Push Naive Ftp (push) Has been cancelled
Release Drafter / update_release_draft (push) Has been cancelled
This commit is contained in:
@@ -27,6 +27,7 @@ import { formatAddressDisplay } from '#/util/address-index';
|
||||
import { createAdminGridOptions } from './table-config';
|
||||
import { getRoleMeta } from './role-meta';
|
||||
import DoctorCardModal from '#/views/doctor/doctor/components/DoctorCardModal.vue';
|
||||
import PromoterInfoCard from '#/components/promoter/PromoterInfoCard.vue';
|
||||
import { resolveAvatarUrl } from '#/views/system/store-input/utils/inputUser';
|
||||
|
||||
function formatAdminRegion(row: {
|
||||
@@ -243,6 +244,18 @@ const copyToClipboard = async (text: string) => {
|
||||
<template #avatar="{ row }">
|
||||
<Image :src="row.avatar" height="30" width="30" />
|
||||
</template>
|
||||
<template #promoter_info="{ row }">
|
||||
<PromoterInfoCard
|
||||
:admin="{
|
||||
id: Number(row.id),
|
||||
nick_name: row.nick_name,
|
||||
avatar: row.avatar,
|
||||
phone: row.phone,
|
||||
code: row.code,
|
||||
}"
|
||||
size="compact"
|
||||
/>
|
||||
</template>
|
||||
<template #nick_name="{ row }">
|
||||
<Button
|
||||
v-if="meta.formType === 'doctor' && row.doctor_id"
|
||||
|
||||
@@ -3,6 +3,7 @@ import type { VxeGridProps } from '#/adapter/vxe-table';
|
||||
import { getAdminList } from '#/views/system/admin/api';
|
||||
|
||||
import type { AdminFormType } from './role-meta';
|
||||
import { ROLE_SALESPERSON } from './role-meta';
|
||||
|
||||
interface RowType {
|
||||
id: string;
|
||||
@@ -29,21 +30,41 @@ interface RowType {
|
||||
city_id?: number;
|
||||
}
|
||||
|
||||
function buildColumns(formType: AdminFormType) {
|
||||
function buildColumns(formType: AdminFormType, roleId: number) {
|
||||
const isSalespersonList = roleId === ROLE_SALESPERSON;
|
||||
const cols: VxeGridProps<RowType>['columns'] = [
|
||||
{ type: 'checkbox', width: 60 },
|
||||
{ field: 'id', align: 'left', title: 'ID', width: 100 },
|
||||
{ field: 'nick_name', align: 'left', title: '名称', ...(formType === 'doctor' ? { slots: { default: 'nick_name' } } : {}) },
|
||||
{
|
||||
field: 'avatar',
|
||||
align: 'left',
|
||||
title: '头像',
|
||||
slots: { default: 'avatar' },
|
||||
width: 130,
|
||||
},
|
||||
{ field: 'open_id', title: 'Open ID' },
|
||||
];
|
||||
|
||||
if (isSalespersonList) {
|
||||
cols.push({
|
||||
field: 'nick_name',
|
||||
align: 'left',
|
||||
title: '业务员',
|
||||
minWidth: 180,
|
||||
slots: { default: 'promoter_info' },
|
||||
});
|
||||
} else {
|
||||
cols.push(
|
||||
{
|
||||
field: 'nick_name',
|
||||
align: 'left',
|
||||
title: '名称',
|
||||
...(formType === 'doctor' ? { slots: { default: 'nick_name' } } : {}),
|
||||
},
|
||||
{
|
||||
field: 'avatar',
|
||||
align: 'left',
|
||||
title: '头像',
|
||||
slots: { default: 'avatar' },
|
||||
width: 130,
|
||||
},
|
||||
);
|
||||
}
|
||||
|
||||
cols.push({ field: 'open_id', title: 'Open ID' });
|
||||
|
||||
if (formType === 'address' || formType === 'supplier') {
|
||||
cols.push({ field: 'code', title: '业务推广码' });
|
||||
}
|
||||
@@ -119,7 +140,7 @@ export function createAdminGridOptions(
|
||||
rowConfig: {
|
||||
useKey: true,
|
||||
},
|
||||
columns: buildColumns(formType),
|
||||
columns: buildColumns(formType, roleId),
|
||||
keepSource: true,
|
||||
pagerConfig: {},
|
||||
proxyConfig: {
|
||||
|
||||
Reference in New Issue
Block a user