设置mes编码
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
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
CI / CI OK (push) Has been cancelled
Lock Threads / action (push) Has been cancelled
Issue Close Require / close-issues (push) Has been cancelled
Close stale issues / stale (push) Has been cancelled

This commit is contained in:
李琦
2026-03-26 10:31:19 +08:00
parent 6a8cc0458d
commit 014bf97121
8 changed files with 219 additions and 1 deletions

View File

@@ -79,6 +79,15 @@ export const modalFormProps: VbenFormProps = {
label: 'ERP ID',
rules: 'required',
},
{
component: 'VbenInput',
formItemClass: 'col-span-6',
componentProps: {
placeholder: '请输入药店 MES ID',
},
fieldName: 'mes_id',
label: 'MES ID',
},
// 注意已移除门店类型选择字段因为药店管理固定为type=1
{
// 是否包邮字段(单选)

View File

@@ -65,6 +65,20 @@ export const gridOptions: VxeGridProps<RowType> = {
slots: { default: 'qr_code' },
width: 130,
},
{
field: 'erp_id',
align: 'left',
title: 'ERP ID',
width: 140,
slots: { default: 'erp_id_cell' },
},
{
field: 'mes_id',
align: 'left',
title: 'MES ID',
width: 140,
slots: { default: 'mes_id_cell' },
},
{ field: 'position', title: '详细地址' }, // 详细地址列
{ field: 'new_admin.nick_name', title: '业务员' }, // 业务员列
{ field: 'mobile', title: '联系人、电话', slots: { default: 'mobile' } }, // 联系人电话列

View File

@@ -28,6 +28,7 @@ import {
import FormModalDemo from './components/modal.vue';
// 导入绑定在线复诊配置弹窗使用store的组件
import BindConsultationModal from '#/views/system/store/components/BindConsultationModal.vue';
import StoreExternalFieldModal from '#/views/system/store/components/StoreExternalFieldModal.vue';
// 导入搜索表单配置
import { formOptions } from './config/search';
// 导入表格配置
@@ -99,6 +100,24 @@ const [BindConsultationModalComponent, bindConsultationModalApi] = useVbenModal(
connectedComponent: BindConsultationModal,
});
const [StoreExternalFieldModalComponent, storeExternalFieldModalApi] = useVbenModal({
connectedComponent: StoreExternalFieldModal,
});
const showStoreExternalFieldModal = (
row: any,
field: 'erp_id' | 'mes_id',
label: string,
) => {
storeExternalFieldModalApi.setData({
values: row,
field,
label,
gridApi,
});
storeExternalFieldModalApi.open();
};
/**
* 打开绑定在线复诊配置弹窗
*/
@@ -218,6 +237,7 @@ const batchSyncDrugPrice = () => {
<FormModal />
<QrCodePreviewModal />
<BindConsultationModalComponent />
<StoreExternalFieldModalComponent />
<Grid>
<template #toolbar-buttons>
<TableAction
@@ -295,6 +315,26 @@ const batchSyncDrugPrice = () => {
/>
</div>
</template>
<template #erp_id_cell="{ row }">
<Button
type="link"
size="small"
class="h-auto p-0"
@click="showStoreExternalFieldModal(row, 'erp_id', 'ERP ID')"
>
{{ row.erp_id != null && row.erp_id !== '' ? row.erp_id : '-' }}
</Button>
</template>
<template #mes_id_cell="{ row }">
<Button
type="link"
size="small"
class="h-auto p-0"
@click="showStoreExternalFieldModal(row, 'mes_id', 'MES ID')"
>
{{ row.mes_id != null && row.mes_id !== '' ? row.mes_id : '-' }}
</Button>
</template>
<template #online_consultation_config="{ row }">
<div
v-if="row.is_internet_medical === 1 && row.online_consultation_doctor_name"

View File

@@ -157,3 +157,14 @@ export async function batchSyncDrugPriceApi(ids: number[]) {
export async function updateClinicTypeApi(data: { id: number; clinic_type: number }) {
return requestClient.post<any>(`${prefix}update-clinic-type`, data);
}
/**
* 单独更新 ERP ID 或 MES ID列表快捷编辑
*/
export async function updateStoreExternalFieldApi(data: {
id: number;
field: 'erp_id' | 'mes_id';
value?: number | string | null;
}) {
return requestClient.post<any>(`${prefix}update-store-external-field`, data);
}

View File

@@ -0,0 +1,82 @@
<script lang="ts" setup>
import { ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { Form, FormItem, InputNumber, message } from 'ant-design-vue';
import { updateStoreExternalFieldApi } from '../api';
const storeId = ref(0);
const field = ref<'erp_id' | 'mes_id'>('erp_id');
const fieldLabel = ref('');
const inputValue = ref<null | number>(null);
const gridApiRef = ref<any>(null);
const [Modal, modalApi] = useVbenModal({
fullscreenButton: false,
draggable: true,
onCancel() {
modalApi.close();
},
onConfirm: async () => {
modalApi.setState({ confirmLoading: true });
try {
await updateStoreExternalFieldApi({
id: storeId.value,
field: field.value,
value:
inputValue.value === null || inputValue.value === undefined
? ''
: inputValue.value,
});
message.success('保存成功');
gridApiRef.value?.query?.();
gridApiRef.value?.reload?.();
modalApi.close();
} catch {
message.error('保存失败');
} finally {
modalApi.setState({ confirmLoading: false });
}
},
onOpenChange(isOpen: boolean) {
if (isOpen) {
const data = modalApi.getData<{
field: 'erp_id' | 'mes_id';
gridApi: any;
label: string;
values: Record<string, any>;
}>();
gridApiRef.value = data?.gridApi;
storeId.value = data?.values?.id ?? 0;
field.value = data?.field ?? 'erp_id';
fieldLabel.value = data?.label ?? '';
const f = data?.field ?? 'erp_id';
const raw = data?.values?.[f];
inputValue.value =
raw !== null && raw !== undefined && raw !== '' ? Number(raw) : null;
} else {
storeId.value = 0;
inputValue.value = null;
gridApiRef.value = null;
}
},
});
</script>
<template>
<Modal :title="`编辑${fieldLabel}`" class="w-[400px]">
<Form layout="vertical">
<FormItem :label="fieldLabel">
<InputNumber
v-model:value="inputValue"
allow-clear
class="w-full"
:precision="0"
placeholder="留空表示清空"
/>
</FormItem>
</Form>
</Modal>
</template>

View File

@@ -81,6 +81,15 @@ export const modalFormProps: VbenFormProps = {
label: 'ERP ID',
rules: 'required',
},
{
component: 'VbenInput',
formItemClass: 'col-span-6',
componentProps: {
placeholder: '请输入诊所 MES ID',
},
fieldName: 'mes_id',
label: 'MES ID',
},
{
component: 'Input',
fieldName: 'type',

View File

@@ -61,7 +61,20 @@ export const gridOptions: VxeGridProps<RowType> = {
slots: { default: 'qr_code' },
width: 130,
},
// { field: 'erp_id', title: 'erpID' },
{
field: 'erp_id',
align: 'left',
title: 'ERP ID',
width: 140,
slots: { default: 'erp_id_cell' },
},
{
field: 'mes_id',
align: 'left',
title: 'MES ID',
width: 140,
slots: { default: 'mes_id_cell' },
},
// { field: 'shouzimu', title: '诊所首字母' },
{ field: 'position', title: '详细地址' },
{ field: 'new_admin.nick_name', title: '业务员' },

View File

@@ -27,6 +27,7 @@ import {
import FormModalDemo from './components/modal.vue';
import DrugPriceModal from './components/DrugPriceModal.vue';
import BindConsultationModal from './components/BindConsultationModal.vue';
import StoreExternalFieldModal from './components/StoreExternalFieldModal.vue';
import { formOptions } from './config/search';
import { gridOptions } from './config/table';
@@ -90,6 +91,24 @@ const [BindConsultationModalComponent, bindConsultationModalApi] = useVbenModal(
connectedComponent: BindConsultationModal,
});
const [StoreExternalFieldModalComponent, storeExternalFieldModalApi] = useVbenModal({
connectedComponent: StoreExternalFieldModal,
});
const showStoreExternalFieldModal = (
row: any,
field: 'erp_id' | 'mes_id',
label: string,
) => {
storeExternalFieldModalApi.setData({
values: row,
field,
label,
gridApi,
});
storeExternalFieldModalApi.open();
};
const showModal = (data = {}, isUpdate = false) => {
formModalApi.setData({
// 表单值
@@ -235,6 +254,7 @@ const handleSwitchClinicType = (row: any) => {
<QrCodePreviewModal />
<DrugPriceModalComponent />
<BindConsultationModalComponent />
<StoreExternalFieldModalComponent />
<Grid>
<template #toolbar-buttons>
<TableAction
@@ -313,6 +333,26 @@ const handleSwitchClinicType = (row: any) => {
/>
</div>
</template>
<template #erp_id_cell="{ row }">
<Button
type="link"
size="small"
class="h-auto p-0"
@click="showStoreExternalFieldModal(row, 'erp_id', 'ERP ID')"
>
{{ row.erp_id != null && row.erp_id !== '' ? row.erp_id : '-' }}
</Button>
</template>
<template #mes_id_cell="{ row }">
<Button
type="link"
size="small"
class="h-auto p-0"
@click="showStoreExternalFieldModal(row, 'mes_id', 'MES ID')"
>
{{ row.mes_id != null && row.mes_id !== '' ? row.mes_id : '-' }}
</Button>
</template>
<template #type="{ row }">
</template>
<template #clinic_type="{ row }">