fix: 订单管理新增查看处方功能,接诊页面优化

This commit is contained in:
2025-04-03 16:17:07 +08:00
parent 342f3cbd57
commit 0994dd94d5
16 changed files with 516 additions and 102 deletions

View File

@@ -57,3 +57,13 @@ export async function openPcWindowsApiByStore(id: number) {
id,
});
}
/**
* 开启后台登录
* @param id
*/
export async function openQrCodeApi(id: number) {
return requestClient.post<any>(`${prefix}open-qr-code`, {
id,
});
}

View File

@@ -135,10 +135,6 @@ export const modalFormProps: VbenFormProps = {
componentProps: {
placeholder: '请选省市区',
options: addressOption,
onChange: (value: any) => {
console.log(value);
},
},
fieldName: 'address',
label: '省市区',
@@ -216,6 +212,12 @@ export const modalFormProps: VbenFormProps = {
label: 'x',
rules: 'required',
hideLabel: true,
dependencies: {
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},
renderComponentContent: () => {
return {
default: () => {
@@ -230,6 +232,12 @@ export const modalFormProps: VbenFormProps = {
componentProps: {
placeholder: '请输入开户人姓名',
},
dependencies: {
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},
fieldName: 'bank_user_name',
label: '开户人姓名',
rules: 'required',
@@ -240,6 +248,12 @@ export const modalFormProps: VbenFormProps = {
componentProps: {
placeholder: '请输入银行卡号',
},
dependencies: {
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},
fieldName: 'bank_card',
label: '银行卡号',
rules: 'required',
@@ -250,6 +264,12 @@ export const modalFormProps: VbenFormProps = {
componentProps: {
placeholder: '请输入开户行',
},
dependencies: {
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},
fieldName: 'bank_name',
label: '开户行',
rules: 'required',
@@ -260,6 +280,12 @@ export const modalFormProps: VbenFormProps = {
componentProps: {
placeholder: '请输入银联行号',
},
dependencies: {
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},
fieldName: 'bank_no',
label: '银联行号',
},
@@ -274,8 +300,8 @@ export const modalFormProps: VbenFormProps = {
placeholder: '请选择银行账户类型',
},
dependencies: {
disabled: (values) => {
return values.id != null;
show: (values) => {
return values.id === null;
},
triggerFields: ['id'],
},

View File

@@ -15,6 +15,15 @@ export const formOptions: VbenFormProps = {
fieldName: 'name',
label: '诊所名称',
},
{
component: 'VbenInput',
componentProps: {
placeholder: '输入联系人手机号',
},
defaultValue: '',
fieldName: 'mobile',
label: '联系人手机号',
},
// {
// component: 'RangePicker',
// componentProps: {

View File

@@ -35,8 +35,9 @@ export const gridOptions: VxeGridProps<RowType> = {
// { field: 'erp_id', title: 'erpID' },
// { field: 'shouzimu', title: '诊所首字母' },
{ field: 'position', title: '详细地址' },
{ field: 'contact', title: '联系人' },
{ field: 'mobile', title: '联系电话' },
// { field: 'contact', title: '联系人' },
{ field: 'mobile', title: '联系人、电话', slots: { default: 'mobile' } },
{ field: 'start_time', title: '营业时间', slots: { default: 'start-time' } },
{ field: 'created_at', title: '注册时间' },
{ type: 'html', title: '操作', align: 'right', slots: { default: 'action' } },
],

View File

@@ -5,15 +5,18 @@ import { ref } from 'vue';
import { Page, useVbenModal } from '@vben/common-ui';
import { Button, Image, message } from 'ant-design-vue';
import { Button, Image, message, Tag } from 'ant-design-vue';
import { useVbenVxeGrid } from '#/adapter/vxe-table';
import { TableAction } from '#/components/table-action';
import { deleteStore, openPcWindowsApiByStore } from './api';
import {deleteStore, openPcWindowsApiByStore, openQrCodeApi} from './api';
import { useClipboard } from '@vueuse/core';
import FormModalDemo from './components/modal.vue';
import QrCodePreview from "#/components/modal/QrCodePreview.vue";
import { formOptions } from './config/search';
import { gridOptions } from './config/table';
import {Icon} from "#/components/icon";
const hasTopTableDropDownActions = ref(false);
@@ -36,6 +39,20 @@ const [Grid, gridApi] = useVbenVxeGrid({
gridEvents,
});
const [QrCodePreviewModal, QrCodePreviewApi] = useVbenModal({
connectedComponent: QrCodePreview,
});
const openQrCodeModal = (url, title, address) => {
QrCodePreviewApi.setData({
// 表单值
values: url,
title,
address,
});
QrCodePreviewApi.open();
};
const [FormModal, formModalApi] = useVbenModal({
connectedComponent: FormModalDemo,
});
@@ -71,11 +88,27 @@ function openPcWindows(id) {
gridApi.reload();
});
}
/**
* 开启后台账号
*/
function openQrCode(id) {
openQrCodeApi(id).then(() => {
message.success('操作成功!');
gridApi.reload();
});
}
function copyText(source) {
copy(source);
message.success('复制成功');
}
const { copy } = useClipboard({ legacy: true });
</script>
<template>
<Page auto-content-height title="诊所管理">
<FormModal />
<QrCodePreviewModal />
<Grid>
<template #toolbar-buttons>
<TableAction
@@ -109,8 +142,38 @@ function openPcWindows(id) {
</template>
</TableAction>
</template>
<template #mobile="{ row }">
<div>
诊所联系人:{{ row.contact }}
<Button type="link" @click="copyText(row.contact)">复制</Button>
</div>
<div>
号码:{{ row.mobile }}
<Button type="link" @click="copyText(row.mobile)">复制</Button>
</div>
</template>
<template #qr_code="{ row }">
<Image :src="row.qr_code" height="30" width="30" />
<div class="qr_code">
<Image
:preview="false"
:src="row.qr_code"
height="30"
width="30"
@click="
openQrCodeModal(
row.qr_code,
row.name,
`${row.province.name}${row.city.name}${row.position}`,
)
"
/>
</div>
</template>
<template #start-time="{ row }">
早:<Tag color="success">{{ row.start_time }}</Tag>
<br />
<br />
晚:<Tag color="error">{{ row.end_time }}</Tag>
</template>
<template #toolbar-tools></template>
<template #action="{ row }">
@@ -167,9 +230,26 @@ function openPcWindows(id) {
confirm: openPcWindows.bind(null, row.id),
},
},
{
label: '生成诊所二维码',
type: 'link',
icon: 'uil:edit',
size: 'small',
// auth: ['store', 'sys:role:detail'],
popConfirm: {
title: '确定生成诊所二维码吗?',
confirm: openQrCode.bind(null, row.id),
},
},
]"
/>
</template>
</Grid>
</Page>
</template>
<style scoped>
.qr_code:hover {
cursor: pointer;
}
</style>