diff --git a/apps/web-antd/src/components/form/components/doctor-picker.vue b/apps/web-antd/src/components/form/components/doctor-picker.vue new file mode 100644 index 00000000..b0e050b5 --- /dev/null +++ b/apps/web-antd/src/components/form/components/doctor-picker.vue @@ -0,0 +1,335 @@ + + + + + + + + + + + + {{ (item.name || '?').charAt(0) }} + + + {{ item.name || '-' }} + + {{ item.mobile }} + + {{ item.depart_name }} + + + + + + + + + + + {{ (selectedOption.name || '?').charAt(0) }} + + + {{ selectedOption.name }} + + {{ selectedOption.mobile || `su_id: ${selectedOption.id}` }} + + + + × + + + + + 医生 su_id: {{ mValue }} + + + × + + + + {{ storeId ? '请选择关联医生(可选)' : '请先选择所属诊所' }} + + + + + + + + diff --git a/apps/web-antd/src/components/form/components/store-picker.vue b/apps/web-antd/src/components/form/components/store-picker.vue new file mode 100644 index 00000000..34a3dbe1 --- /dev/null +++ b/apps/web-antd/src/components/form/components/store-picker.vue @@ -0,0 +1,308 @@ + + + + + + + + + + + + {{ (item.name || '?').charAt(0) }} + + + {{ item.name || '-' }} + + {{ item.mobile }} + ID: {{ item.id }} + + + + + + + + + + {{ (selectedOption.name || '?').charAt(0) }} + + + {{ selectedOption.name }} + + {{ selectedOption.mobile || `ID: ${selectedOption.id}` }} + + + + × + + + + + 诊所 #{{ mValue }} + + + × + + + 请选择诊所 + + + + + + + diff --git a/apps/web-antd/src/utils/formatPrice.ts b/apps/web-antd/src/utils/formatPrice.ts new file mode 100644 index 00000000..04cc9500 --- /dev/null +++ b/apps/web-antd/src/utils/formatPrice.ts @@ -0,0 +1,68 @@ +/** + * 与后端 format_price / PrescriptionService 中药计价口径一致 + */ + +export function parsePriceValue(value: unknown): number { + if (value === null || value === undefined || value === '') { + return 0; + } + const num = Number(value); + return Number.isFinite(num) ? num : 0; +} + +/** + * 与后端 format_price 一致:第三位小数非 0 则分位进 1,再保留两位小数 + */ +export function formatPriceLikeBackend(value: unknown): number { + const price = parsePriceValue(value); + let milli = Math.round(price * 1000); + if (milli % 10 > 0) { + milli += 10; + } + milli -= milli % 10; + return Math.round((milli / 1000) * 100) / 100; +} + +/** 模拟 PHP bcmul 在指定 scale 下向零截断 */ +function bcmulScale(a: unknown, b: unknown, scale: number): number { + const product = parsePriceValue(a) * parsePriceValue(b); + const factor = 10 ** scale; + return Math.trunc(product * factor) / factor; +} + +/** 模拟 PHP bcadd 在指定 scale 下向零截断 */ +function bcaddScale(a: number, b: number, scale: number): number { + const sum = a + b; + const factor = 10 ** scale; + return Math.trunc(sum * factor) / factor; +} + +type ChineseDrugLine = { + number?: number | string; + price?: number | string; +}; + +/** + * 中药商品总价(与 PrescriptionService::createChineseReprice 一致) + * 每行:bcmul(dosage, bcmul(price, number, 3), 3),累加后 format_price + */ +export function calculateChineseProductPriceLikeBackend( + drugs: ChineseDrugLine[], + dosage = 7, +): number { + if (!drugs?.length) { + return 0; + } + const dose = parsePriceValue(dosage); + let total = 0; + for (const drug of drugs) { + const linePerDose = bcmulScale(drug.price, drug.number ?? 1, 3); + const lineTotal = bcmulScale(dose, linePerDose, 3); + total = bcaddScale(total, lineTotal, 3); + } + return formatPriceLikeBackend(total); +} + +export function formatPriceDisplay(value: unknown): string { + return formatPriceLikeBackend(value).toFixed(2); +} diff --git a/apps/web-antd/src/views/business/special-prescription/api/index.ts b/apps/web-antd/src/views/business/special-prescription/api/index.ts index a7d15583..d3994d45 100644 --- a/apps/web-antd/src/views/business/special-prescription/api/index.ts +++ b/apps/web-antd/src/views/business/special-prescription/api/index.ts @@ -18,6 +18,14 @@ export async function updateSpecialPrescription(data: Record) { return requestClient.post(`${prefix}update`, data); } +/** 上下架状态切换(列表 Tag 点击) */ +export async function updateSpecialPrescriptionStatus(data: { + id: number; + status: number; +}) { + return requestClient.post(`${prefix}update-status`, data); +} + export async function deleteSpecialPrescription(data: Record) { return requestClient.post(`${prefix}delete`, data); } diff --git a/apps/web-antd/src/views/business/special-prescription/components/EditPrescriptionModal.vue b/apps/web-antd/src/views/business/special-prescription/components/EditPrescriptionModal.vue new file mode 100644 index 00000000..b7ca63e7 --- /dev/null +++ b/apps/web-antd/src/views/business/special-prescription/components/EditPrescriptionModal.vue @@ -0,0 +1,104 @@ + + + + + + + + + + diff --git a/apps/web-antd/src/views/business/special-prescription/config/table.ts b/apps/web-antd/src/views/business/special-prescription/config/table.ts index 67a02276..3f57efc8 100644 --- a/apps/web-antd/src/views/business/special-prescription/config/table.ts +++ b/apps/web-antd/src/views/business/special-prescription/config/table.ts @@ -66,9 +66,15 @@ export const gridOptions: VxeGridProps = { { field: 'price_per_dose', align: 'left', title: '每剂价格', width: 100 }, { field: 'sales_count', align: 'left', title: '销量', width: 80 }, { field: 'sort', align: 'left', title: '排序', width: 80 }, - { field: 'status_txt', align: 'left', title: '状态', width: 80 }, + { + field: 'status', + align: 'left', + title: '状态', + width: 90, + slots: { default: 'status' }, + }, { field: 'created_at', title: '创建时间', width: 180 }, - { type: 'html', title: '操作', slots: { default: 'action' }, width: 160 }, + { type: 'html', title: '操作', slots: { default: 'action' }, width: 220 }, ], keepSource: true, pagerConfig: {}, diff --git a/apps/web-antd/src/views/business/special-prescription/index.vue b/apps/web-antd/src/views/business/special-prescription/index.vue index 794b9644..5de9d24d 100644 --- a/apps/web-antd/src/views/business/special-prescription/index.vue +++ b/apps/web-antd/src/views/business/special-prescription/index.vue @@ -10,12 +10,17 @@ import { Button, Image, message, Tag } from 'ant-design-vue'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { TableAction } from '#/components/table-action'; -import { deleteSpecialPrescription } from './api'; +import { + deleteSpecialPrescription, + updateSpecialPrescriptionStatus, +} from './api'; +import EditPrescriptionModal from './components/EditPrescriptionModal.vue'; import SpecialPrescriptionModal from './components/modal.vue'; import { formOptions as searchFormOptions } from './config/search'; import { gridOptions } from './config/table'; const hasTopTableDropDownActions = ref(false); +const statusLoadingId = ref(null); const gridEvents: VxeGridListeners = { checkboxChange() { @@ -38,6 +43,10 @@ const [FormModal, formModalApi] = useVbenModal({ connectedComponent: SpecialPrescriptionModal, }); +const [EditPrescriptionModalComp, editPrescriptionModalApi] = useVbenModal({ + connectedComponent: EditPrescriptionModal, +}); + const showModal = (data = {}, isUpdate = false) => { formModalApi.setData({ values: data, @@ -47,6 +56,30 @@ const showModal = (data = {}, isUpdate = false) => { formModalApi.open(); }; +const showEditPrescriptionModal = (row: any) => { + editPrescriptionModalApi.setData({ + values: row, + gridApi, + }); + editPrescriptionModalApi.open(); +}; + +/** 点击状态 Tag 切换上下架 */ +const toggleStatus = async (row: any) => { + if (statusLoadingId.value === row.id) { + return; + } + const newStatus = row.status === 1 ? 0 : 1; + statusLoadingId.value = row.id; + try { + await updateSpecialPrescriptionStatus({ id: row.id, status: newStatus }); + message.success(newStatus === 1 ? '已上架' : '已下架'); + gridApi.query(); + } finally { + statusLoadingId.value = null; + } +}; + const deleteApi = (row: any) => { let ids: (string | number)[] = []; if (row) { @@ -64,6 +97,7 @@ const deleteApi = (row: any) => { + { + + + {{ row.status === 1 ? '上架' : '下架' }} + + + { label: '编辑', onClick: () => showModal(row, true), }, + { + label: '编辑药方', + ifShow: row.prescription_sub_type === 1, + onClick: () => showEditPrescriptionModal(row), + }, { label: '删除', color: 'error', diff --git a/apps/web-antd/src/views/business/special-prescription/utils/buildPayload.ts b/apps/web-antd/src/views/business/special-prescription/utils/buildPayload.ts new file mode 100644 index 00000000..89039414 --- /dev/null +++ b/apps/web-antd/src/views/business/special-prescription/utils/buildPayload.ts @@ -0,0 +1,35 @@ +/** + * 组装特色方提交 payload,编辑药方时需原样带回 meta 字段,避免清空介绍图等 + */ +export function buildSpecialPrescriptionPayload( + detail: Record, + drugOverrides?: { + drugs?: any[]; + dosage?: number; + day_dosage?: number; + rule_type?: number; + package_method_id?: number; + }, +) { + const payload: Record = { + id: detail.id, + name: detail.name || '', + category_id: detail.category_id, + cover_image: detail.cover_image || '', + tags: Array.isArray(detail.tags) ? detail.tags : [], + price_per_dose: detail.price_per_dose ?? 0, + sales_count: detail.sales_count ?? 0, + status: detail.status ?? 1, + prescription_type: detail.prescription_type || 'chinese', + intro_text: detail.intro_text || '', + introduction_images: detail.introduction_images || [], + }; + if (drugOverrides?.drugs?.length) { + payload.drugs = drugOverrides.drugs; + payload.dosage = drugOverrides.dosage ?? 7; + payload.day_dosage = drugOverrides.day_dosage ?? 2; + payload.rule_type = drugOverrides.rule_type ?? 1; + payload.package_method_id = drugOverrides.package_method_id ?? 2; + } + return payload; +} diff --git a/apps/web-antd/src/views/doctor/doctor-reception/index.vue b/apps/web-antd/src/views/doctor/doctor-reception/index.vue index e80d4391..4204e8df 100644 --- a/apps/web-antd/src/views/doctor/doctor-reception/index.vue +++ b/apps/web-antd/src/views/doctor/doctor-reception/index.vue @@ -89,6 +89,7 @@ import { formatPriceDiscountLabel, normalizeQuickOptions, } from '#/utils/pricePercentAdjust'; +import { calculateChineseProductPriceLikeBackend } from '#/utils/formatPrice'; interface Patient { id: number; @@ -419,11 +420,11 @@ const totalProductCost = computed(() => { if (currentDrugs.value.length === 0) { return 0; } - // 如果是中药的时候,计算总价格 + // 中药:与后端 PrescriptionService / format_price 口径一致 if (activeCategory.value === 1) { - return currentDrugs.value.reduce( - (sum, drug) => sum + drug.price * (drug.number || 1) * dosage.value, - 0, + return calculateChineseProductPriceLikeBackend( + currentDrugs.value, + dosage.value, ); } return currentDrugs.value.reduce( @@ -2186,34 +2187,39 @@ watch( 历史 - - - {{ patient.user_patient.name }} - - 特色方{{ - patient.special_prescription_patient_record.status === 0 - ? '·待导入' - : '' - }} - - - {{ patient.user_patient.mobile }} - - 推广员:{{ patient.salesperson?.nick_name || '无' }} - - {{ - getRegisterStatus(patient.status) - }} - {{ patient.updated_at }} + + + + + {{ patient.user_patient.name }} + + 特色方{{ + patient.special_prescription_patient_record.status === 0 + ? '·待导入' + : '' + }} + + + {{ patient.user_patient.mobile }} + + 推广员:{{ patient.salesperson?.nick_name || '无' }} + + {{ + getRegisterStatus(patient.status) + }} + {{ patient.updated_at }} + diff --git a/apps/web-antd/src/views/doctor/doctor/api/card.ts b/apps/web-antd/src/views/doctor/doctor/api/card.ts index f0d95e66..58d153b9 100644 --- a/apps/web-antd/src/views/doctor/doctor/api/card.ts +++ b/apps/web-antd/src/views/doctor/doctor/api/card.ts @@ -71,3 +71,13 @@ export async function updateDoctorCredentialsApi(data: Record) { export async function updateDoctorSignatureByAdminApi(data: Record) { return requestClient.post(`${prefix}update-signature-by-admin`, data); } + +/** 超管/系统管理员更新医生 service_user 账号资料 */ +export async function updateDoctorServiceUserApi(data: { + su_id: number; + mobile?: string; + nickname?: string; + avatar?: string; +}) { + return requestClient.post(`${prefix}update-service-user`, data); +} diff --git a/apps/web-antd/src/views/doctor/doctor/components/DoctorCardModal.vue b/apps/web-antd/src/views/doctor/doctor/components/DoctorCardModal.vue index b702b735..e89c0639 100644 --- a/apps/web-antd/src/views/doctor/doctor/components/DoctorCardModal.vue +++ b/apps/web-antd/src/views/doctor/doctor/components/DoctorCardModal.vue @@ -1,6 +1,7 @@ + + + + + + + 从已报备银行卡导入 + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/apps/web-antd/src/views/system/store-bank-card/config/constants.ts b/apps/web-antd/src/views/system/store-bank-card/config/constants.ts index b5acf075..30a177aa 100644 --- a/apps/web-antd/src/views/system/store-bank-card/config/constants.ts +++ b/apps/web-antd/src/views/system/store-bank-card/config/constants.ts @@ -8,3 +8,16 @@ export const EPL_TRANSFER_ACCOUNT_TYPE_OPTIONS = [ export const USE_TYPE_TRANSFER = '2'; export const USE_TYPE_TRANSFER_TEXT = '转账卡'; + +/** 易票联报备修改入口文案 */ +export const LABEL_UPDATE_REPORT_BANK_CARD = '修改报备银行卡'; + +/** 系统门店银行卡字段编辑入口文案 */ +export const LABEL_UPDATE_STORE_BANK_CARD = '修改银行卡'; + +/** yii_store 银行账户类型选项 */ +export const STORE_BANK_ACCOUNT_TYPE_OPTIONS = [ + { label: '对公', value: 1 }, + { label: '对私', value: 2 }, + { label: '存折', value: 5 }, +]; diff --git a/apps/web-antd/src/views/system/store-bank-card/utils/bankCardImport.ts b/apps/web-antd/src/views/system/store-bank-card/utils/bankCardImport.ts new file mode 100644 index 00000000..f070e8bf --- /dev/null +++ b/apps/web-antd/src/views/system/store-bank-card/utils/bankCardImport.ts @@ -0,0 +1,64 @@ +/** 门店银行卡表单字段(yii_store) */ +export type StoreBankFormState = { + bank_user_name: string; + bank_card: string; + bank_name: string; + bank_account_type: number; + bank_no: string; +}; + +export type BankCardSelectableOption = { + value: string; + label: string; + payload: Record; +}; + +/** 卡号脱敏展示(与后端 mask 规则一致) */ +export function maskBankCardForDisplay(bankCard?: string | null): string { + const card = String(bankCard ?? '').trim(); + if (!card) return ''; + if (card.length <= 8) return card; + return `${card.slice(0, 4)}${'*'.repeat(Math.max(0, card.length - 8))}${card.slice(-4)}`; +} + +/** 报备 payload 映射为门店银行卡表单字段 */ +export function mapReportPayloadToStoreBankForm( + payload: Record, +): StoreBankFormState { + return { + bank_user_name: String(payload.bank_user_name ?? ''), + bank_card: String(payload.bank_card ?? ''), + bank_name: String(payload.bank_name ?? ''), + bank_account_type: Number(payload.bank_account_type ?? 2) || 2, + bank_no: String(payload.bank_no ?? ''), + }; +} + +/** 从报备详情构建本门店导入选项 */ +export function buildCurrentStoreReportOption( + detail: Record | null | undefined, +): BankCardSelectableOption | null { + if (!detail?.id) return null; + const bankCard = String(detail.bank_card ?? '').trim(); + const bankUserName = String(detail.bank_user_name ?? '').trim(); + if (!bankCard || !bankUserName) return null; + + const masked = + detail.bank_card_masked || maskBankCardForDisplay(bankCard); + + return { + value: `current_report_${detail.id}`, + label: `本门店报备 #${detail.id}(${masked})`, + payload: mapReportPayloadToStoreBankForm(detail), + }; +} + +/** 合并本店报备与跨店历史报备选项(本店置顶) */ +export function mergeSelectableBankCardOptions( + currentOption: BankCardSelectableOption | null, + remoteOptions: BankCardSelectableOption[] = [], +): BankCardSelectableOption[] { + if (!currentOption) return remoteOptions; + const rest = remoteOptions.filter((item) => item.value !== currentOption.value); + return [currentOption, ...rest]; +} diff --git a/apps/web-antd/src/views/system/store/api/index.ts b/apps/web-antd/src/views/system/store/api/index.ts index d929e9a3..5356f2cf 100644 --- a/apps/web-antd/src/views/system/store/api/index.ts +++ b/apps/web-antd/src/views/system/store/api/index.ts @@ -198,3 +198,17 @@ export async function updateStoreExternalFieldApi(data: { }) { return requestClient.post(`${prefix}update-store-external-field`, data); } + +/** + * 仅更新系统门店银行卡字段(不触发易票联报备) + */ +export async function updateStoreBankInfoApi(data: { + id: number; + bank_user_name: string; + bank_card: string; + bank_name: string; + bank_account_type: number; + bank_no?: string; +}) { + return requestClient.post(`${prefix}update-store-bank-info`, data); +} diff --git a/apps/web-antd/src/views/system/store/components/BindSpecialPrescriptionDoctorModal.vue b/apps/web-antd/src/views/system/store/components/BindSpecialPrescriptionDoctorModal.vue index 16b0283d..5239be0b 100644 --- a/apps/web-antd/src/views/system/store/components/BindSpecialPrescriptionDoctorModal.vue +++ b/apps/web-antd/src/views/system/store/components/BindSpecialPrescriptionDoctorModal.vue @@ -3,32 +3,18 @@ import { ref } from 'vue'; import { useVbenModal } from '@vben/common-ui'; -import { Form, FormItem, message, Select } from 'ant-design-vue'; +import { Form, FormItem, message } from 'ant-design-vue'; -import { getDoctorOptionApi, updateSpecialPrescriptionDoctorApi } from '../api'; +import DoctorPicker from '#/components/form/components/doctor-picker.vue'; + +import { updateSpecialPrescriptionDoctorApi } from '../api'; const formState = ref({ id: undefined as number | undefined, special_prescription_doctor_id: undefined as number | undefined, }); -const doctorOptions = ref>([]); const gridApiRef = ref(null); -const loading = ref(false); - -async function loadDoctorOptions(storeId?: number) { - if (!storeId) { - doctorOptions.value = []; - return; - } - try { - const doctors = await getDoctorOptionApi(storeId); - doctorOptions.value = doctors || []; - } catch (error) { - console.error('获取医生列表失败:', error); - doctorOptions.value = []; - } -} const [Modal, modalApi] = useVbenModal({ fullscreenButton: false, @@ -37,7 +23,6 @@ const [Modal, modalApi] = useVbenModal({ modalApi.close(); }, onConfirm: async () => { - loading.value = true; modalApi.setState({ confirmLoading: true }); try { await updateSpecialPrescriptionDoctorApi({ @@ -50,11 +35,10 @@ const [Modal, modalApi] = useVbenModal({ } catch { message.error('绑定失败'); } finally { - loading.value = false; modalApi.setState({ confirmLoading: false }); } }, - async onOpenChange(isOpen: boolean) { + onOpenChange(isOpen: boolean) { if (isOpen) { const { values, gridApi } = modalApi.getData>(); gridApiRef.value = gridApi; @@ -62,24 +46,18 @@ const [Modal, modalApi] = useVbenModal({ id: values?.id, special_prescription_doctor_id: values?.special_prescription_doctor_id || undefined, }; - await loadDoctorOptions(formState.value.id); } }, }); - + - diff --git a/apps/web-antd/src/views/system/store/components/cells/StoreConfigTogglesCell.vue b/apps/web-antd/src/views/system/store/components/cells/StoreConfigTogglesCell.vue index f2d108d3..94fff00d 100644 --- a/apps/web-antd/src/views/system/store/components/cells/StoreConfigTogglesCell.vue +++ b/apps/web-antd/src/views/system/store/components/cells/StoreConfigTogglesCell.vue @@ -7,6 +7,8 @@ defineProps<{ showClinicType?: boolean; showInsurance?: boolean; showSalespersonSeePrice?: boolean; + /** 是否可点击银行卡报备 Tag(超管/系统管理员) */ + canManageBankCard?: boolean; getBankCardReportTagColor: (status: number) => string; getBankCardReportTagText: (row: Record) => string; onShippingFree: (id: number) => void; @@ -18,6 +20,15 @@ defineProps<{ onAllowInsurance?: (id: number) => void; onSalespersonSeePrice?: (id: number) => void; }>(); + +function handleBankCardTagClick( + row: Record, + canManageBankCard: boolean | undefined, + onBankCardReport: (row: Record) => void, +) { + if (!canManageBankCard) return; + onBankCardReport(row); +} @@ -93,8 +104,8 @@ defineProps<{ {{ getBankCardReportTagText(row) }} @@ -146,8 +157,8 @@ defineProps<{ {{ getBankCardReportTagText(row) }} @@ -228,6 +239,11 @@ defineProps<{ text-overflow: ellipsis; } +.config-item__tag--readonly { + cursor: default; + opacity: 0.85; +} + .clinic-type-tag { transition: all 0.2s ease; user-select: none; diff --git a/apps/web-antd/src/views/system/store/config/table.ts b/apps/web-antd/src/views/system/store/config/table.ts index 94b88ebd..df9266b8 100644 --- a/apps/web-antd/src/views/system/store/config/table.ts +++ b/apps/web-antd/src/views/system/store/config/table.ts @@ -41,7 +41,7 @@ export const gridOptions: VxeGridProps = { field: 'special_prescription_config', align: 'left', title: '特色方配置', - width: 140, + width: 180, slots: { default: 'special_prescription_config' }, }, { diff --git a/apps/web-antd/src/views/system/store/index.vue b/apps/web-antd/src/views/system/store/index.vue index 4121907e..6882ab71 100644 --- a/apps/web-antd/src/views/system/store/index.vue +++ b/apps/web-antd/src/views/system/store/index.vue @@ -8,13 +8,14 @@ import { Page, useVbenModal } from '@vben/common-ui'; import { useUserStore } from '@vben/stores'; import { useClipboard } from '@vueuse/core'; -import { Button, Image, message, Modal, Tag } from 'ant-design-vue'; +import { Button, Image, message, Modal, Tag, Avatar } from 'ant-design-vue'; import { useVbenVxeGrid } from '#/adapter/vxe-table'; import { Icon } from '#/components/icon'; import QrCodePreview from '#/components/modal/QrCodePreview.vue'; import PromoterInfoCard from '#/components/promoter/PromoterInfoCard.vue'; import { TableAction } from '#/components/table-action'; +import { resolveAvatarUrl } from '#/views/system/store-input/utils/inputUser'; import { batchSyncDrugPriceApi, @@ -39,9 +40,11 @@ import StoreExternalFieldModal from './components/StoreExternalFieldModal.vue'; import SalespersonCommissionDrawer from './components/SalespersonCommissionDrawer.vue'; import BankCardReportModal from '#/views/system/store-bank-card/components/BankCardReportModal.vue'; import BankCardStatusModal from '#/views/system/store-bank-card/components/BankCardStatusModal.vue'; +import BankCardStoreEditModal from '#/views/system/store-bank-card/components/BankCardStoreEditModal.vue'; import { getStoreBankCardReportDetail } from '#/views/system/store-bank-card/api'; import { formOptions } from './config/search'; import { gridOptions } from './config/table'; +import { canManageStoreBankCard } from '#/views/system/admin/_shared/platform-admin-role'; const userStore = useUserStore(); const router = useRouter(); @@ -51,6 +54,10 @@ const isPlatformAdmin = computed(() => { return userStore?.userInfo?.roles?.user_type === 2; }); +const canManageBankCard = computed(() => + canManageStoreBankCard(userStore.userInfo), +); + // 跳转到审核页面 const goToAudit = () => { router.push('/system/store-input/audit'); @@ -120,6 +127,19 @@ const [BankCardStatusModalComponent, bankCardStatusModalApi] = useVbenModal({ connectedComponent: BankCardStatusModal, }); +const [BankCardStoreEditModalComponent, bankCardStoreEditModalApi] = useVbenModal({ + connectedComponent: BankCardStoreEditModal, +}); + +const openBankCardStoreEdit = (row: any) => { + bankCardStoreEditModalApi.setData({ + storeId: row.id, + storeName: row.name, + gridApi, + }); + bankCardStoreEditModalApi.open(); +}; + const openBankCardReport = async (row: any, update = false) => { let report = null; try { @@ -169,6 +189,7 @@ function getBankCardReportTagText(row: any) { } function handleBankCardReportColumnClick(row: any) { + if (!canManageBankCard.value) return; const status = Number(row.bank_card_report_status ?? 0); if (status === 1 || status === 2) { openBankCardStatus(row); @@ -380,6 +401,7 @@ const handleSwitchClinicType = (row: any) => { + @@ -449,6 +471,7 @@ const handleSwitchClinicType = (row: any) => { { show-clinic-type show-insurance show-salesperson-see-price + :can-manage-bank-card="canManageBankCard" :get-bank-card-report-tag-color="getBankCardReportTagColor" :get-bank-card-report-tag-text="getBankCardReportTagText" :on-shipping-free="updateShippingFree" @@ -530,10 +554,14 @@ const handleSwitchClinicType = (row: any) => { - 医生ID:{{ row.special_prescription_doctor_id }} + + {{ row.special_prescription_doctor_name || '未知医生' }} { icon: 'ant-design:credit-card-outlined', size: 'small', auth: ['Super Admin', 'Admin'], + onClick: () => openBankCardStoreEdit(row), + }, + { + label: '修改报备银行卡', + type: 'link', + icon: 'ant-design:file-protect-outlined', + size: 'small', + auth: ['Super Admin', 'Admin'], onClick: () => openBankCardReport(row, true), }, // {
{{ patient.user_patient.mobile }}
- 推广员:{{ patient.salesperson?.nick_name || '无' }} -
+ 推广员:{{ patient.salesperson?.nick_name || '无' }} +