From 29b69c09e65d2b1051e4632ed5f959cad5776d3e Mon Sep 17 00:00:00 2001 From: lizhi <1370025557@qq.com> Date: Fri, 1 Jul 2022 13:51:04 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BB=A3=E7=A0=81=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/platform/system/controller/boxcard.ts | 2 +- src/api/platform/system/controller/doctor.ts | 39 ++-- src/views/equip/boxcard/BoxCardModal.vue | 57 +++++ src/views/equip/boxcard/boxcard.data.ts | 160 ++++++++++++++ src/views/equip/boxcard/index.vue | 94 ++++++++ src/views/institution/address/address.data.ts | 4 +- src/views/institution/doctor/DoctorModal.vue | 119 +++++++---- src/views/institution/doctor/index.vue | 202 +++++++++++------- .../institution/hospital/HospitalModal.vue | 9 +- .../institution/hospital/hospital.data.ts | 9 +- src/views/institution/hospital/index.vue | 6 +- .../institution/InstitutionModal.vue | 12 +- src/views/institution/institution/index.vue | 6 +- .../institution/institution.data.ts | 42 ++-- src/views/institution/office/OfficeModal.vue | 8 +- src/views/institution/office/index.vue | 7 +- src/views/institution/office/office.data.ts | 10 +- src/views/system/area/AreaModal.vue | 78 +++---- src/views/system/dept/index.vue | 112 +++++----- .../system/equip/boxcard/BoxCardModal.vue | 67 ++++++ .../system/equip/boxcard/boxcard.data.ts | 160 ++++++++++++++ src/views/system/equip/boxcard/index.vue | 100 +++++++++ 22 files changed, 1017 insertions(+), 286 deletions(-) create mode 100644 src/views/equip/boxcard/BoxCardModal.vue create mode 100644 src/views/equip/boxcard/boxcard.data.ts create mode 100644 src/views/equip/boxcard/index.vue create mode 100644 src/views/system/equip/boxcard/BoxCardModal.vue create mode 100644 src/views/system/equip/boxcard/boxcard.data.ts create mode 100644 src/views/system/equip/boxcard/index.vue diff --git a/src/api/platform/system/controller/boxcard.ts b/src/api/platform/system/controller/boxcard.ts index 925a681..ee2b11e 100644 --- a/src/api/platform/system/controller/boxcard.ts +++ b/src/api/platform/system/controller/boxcard.ts @@ -1,4 +1,4 @@ -import {BoxCardParams, BoxCardListItem, BoxCardListGetListResult} from '/@/api/platform/system/entity/boxCardModel' +import {BoxCardParams, BoxCardListItem, BoxCardListGetListResult} from '/@/api/platform/system/entity/boxCardModel'; import { defHttp } from '/@/utils/http/axios'; import {isDef} from '/@/utils/is'; diff --git a/src/api/platform/system/controller/doctor.ts b/src/api/platform/system/controller/doctor.ts index 2524836..d5656f2 100644 --- a/src/api/platform/system/controller/doctor.ts +++ b/src/api/platform/system/controller/doctor.ts @@ -2,29 +2,32 @@ import {DoctorParams,DoctorItem,DoctorItemListResult} from '/@/api/platform/syst import { defHttp } from '/@/utils/http/axios'; import {isDef} from '/@/utils/is'; -const prefix = '/system_proxy/system'; + + enum Api { - QueryById = '/doctor/query', - List = '/doctor/list', - Add = '/doctor/add', - Update = '/doctor/update', - Remove = '/doctor/remove' + QueryById = '/system_proxy/system/doctor/query', + list = '/system_proxy/system/doctor/list', + add = '/system_proxy/system/doctor/add', + edit = '/system_proxy/system/doctor/update', + del = '/system_proxy/system/doctor/remove', + get = '/system_proxy/system/doctor' } export const queryById = (params: { id: String }) => - defHttp.get({url: prefix + Api.QueryById + `/${params.id}`}); + defHttp.get({url: Api.QueryById + `/${params.id}`}); + +/** 查询客户端列表 */ +export const listDoctor = (params?: Partial) => defHttp.get({ url: Api.list, params }, { isReturnResultResponse: true }); + +/** 新增客户端 */ +export const addDoctor = (params: Partial) => defHttp.post({ url: Api.add, data: params }); -export const list = (params: DoctorParams) => - defHttp.get({url: prefix + Api.List, params}); +/** 修改客户端 */ +export const editDoctor = (params: Partial) => defHttp.put({ url: Api.edit, data: params }); -export const set = (params: DoctorItem) => { - if (isDef(params.id)){ - defHttp.put({url: prefix + Api.Update, params}); - }else { - defHttp.post({url: prefix + Api.Add, params}); - } -}; +/** 查询客户端详细 */ +export const getDoctor = (id: string) => defHttp.get({ url: `${Api.get}/${id}` }); -export const remove = (params: {ids: String}) => - defHttp.delete({url: prefix + Api.Remove + `/${params.ids}`}); \ No newline at end of file +/** 删除客户端 */ +export const delDoctor = (id: string) => defHttp.delete({ url: `${Api.del}/${id}` }); \ No newline at end of file diff --git a/src/views/equip/boxcard/BoxCardModal.vue b/src/views/equip/boxcard/BoxCardModal.vue new file mode 100644 index 0000000..bb9e785 --- /dev/null +++ b/src/views/equip/boxcard/BoxCardModal.vue @@ -0,0 +1,57 @@ + + + \ No newline at end of file diff --git a/src/views/equip/boxcard/boxcard.data.ts b/src/views/equip/boxcard/boxcard.data.ts new file mode 100644 index 0000000..e75e69c --- /dev/null +++ b/src/views/equip/boxcard/boxcard.data.ts @@ -0,0 +1,160 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: 'iccid', + dataIndex: 'iccid', + width: 120, + }, + { + title: '卡号', + dataIndex: 'card', + width: 120, + }, + { + title: '网卡厂商', + dataIndex: 'company', + width: 120, + customRender: ({ record }) => { + const com = record.company; + switch (com) { + case '1': return '中国移动'; + case '2': return '中国联通'; + case '3': return '中国电信'; + default: return '未知厂商'; + } + } + }, + { + title: '卡是否已使用', + dataIndex: 'isUsed', + width: 120, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'iccid', + label: 'iccid', + component: 'Input', + componentProps: { + placeholder: '请输入唯一标识iccid', + }, + colProps: { span: 5 }, + }, + { + field: 'card', + label: '卡号', + component: 'Input', + componentProps: { + placeholder: '请输入卡号', + }, + colProps: { span: 5 }, + }, + { + field: 'company', + label: '网卡厂商', + component: 'Input', + componentProps: { + placeholder: '请输入网卡厂商', + }, + colProps: { span: 4 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const cardFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'iccid', + label: 'iccid', + component: 'Input', + helpMessage: ['唯一识别号'], + required: true + }, + { + field: 'card', + label: '卡号', + component: 'Input', + required: false, + }, + { + field: 'company', + label: '网卡厂商', + component: 'Select', + required: true, + componentProps: { + options: [ + { label: '中国移动', value: '1' }, + { label: '中国联通', value: '2' }, + { label: '中国电信', value: '3' }, + { label: '未知厂商', value: ''||undefined||null } + ], + + } + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/equip/boxcard/index.vue b/src/views/equip/boxcard/index.vue new file mode 100644 index 0000000..5c26b1b --- /dev/null +++ b/src/views/equip/boxcard/index.vue @@ -0,0 +1,94 @@ + + + \ No newline at end of file diff --git a/src/views/institution/address/address.data.ts b/src/views/institution/address/address.data.ts index 668a7e5..670520b 100644 --- a/src/views/institution/address/address.data.ts +++ b/src/views/institution/address/address.data.ts @@ -8,7 +8,7 @@ import {Tag} from 'ant-design-vue'; export const columns: BasicColumn[] = [ { title: '区域ID', - dataIndex: 'id', + dataIndex: 'code', width: 50, }, { @@ -100,7 +100,7 @@ export const addressFormSchema: FormSchema[] = [ } }, { - field: 'id', + field: 'code', label: '区域ID', component: 'Input', helpMessage: ['区域ID'], diff --git a/src/views/institution/doctor/DoctorModal.vue b/src/views/institution/doctor/DoctorModal.vue index 5efd0c3..d5b305a 100644 --- a/src/views/institution/doctor/DoctorModal.vue +++ b/src/views/institution/doctor/DoctorModal.vue @@ -1,52 +1,79 @@ - \ No newline at end of file + diff --git a/src/views/institution/doctor/index.vue b/src/views/institution/doctor/index.vue index 3120fc0..dc060a2 100644 --- a/src/views/institution/doctor/index.vue +++ b/src/views/institution/doctor/index.vue @@ -1,94 +1,136 @@ \ No newline at end of file + + /** 处理多选框选中数据 */ + function handleSelectionChange(selection?: Recordable) { + const rowSelection = toRaw(selection?.keys) || []; + state.single = rowSelection.length != 1; + state.multiple = !rowSelection.length; + } + + /** 新增按钮操作,行内新增与工具栏局域新增通用 */ + function handleAdd() { + openModal(true,{ _tag: 'add' }); + } + + /** 编辑按钮操作,行内编辑 */ + function handleEdit(record?: Recordable) { + record = record || { id: getSelectRowKeys() }; + openModal(true, { _tag: 'edit', record }); + } + + /** 删除按钮操作,行内删除 */ + async function handleDel(record?: Recordable) { + const id = record?.id || getSelectRowKeys(); + createConfirm({ + iconType: 'warning', + title: '警告', + content: `是否确认删除医生编号为${id}医生吗?`, + onOk: async () => { + await delDoctor(id); + createMessage.success('删除成功!'); + handleRefreshTable(); + } + }); + } + + /** 处理表格刷新 */ + function handleRefreshTable() { + clearSelectedRowKeys(); + reload(); + } + diff --git a/src/views/institution/hospital/HospitalModal.vue b/src/views/institution/hospital/HospitalModal.vue index 5cdb5bc..59445b4 100644 --- a/src/views/institution/hospital/HospitalModal.vue +++ b/src/views/institution/hospital/HospitalModal.vue @@ -1,8 +1,9 @@ @@ -45,7 +46,7 @@ const [registerModal, {setModalProps, closeModal}] = useModalInner( (data) => { ...data.record, }); } -}) +}); //表单标题 const getTitle = computed(() => (!unref(isUpdate) ? '新增医院' : '编辑医院')); async function handleSubmit() { diff --git a/src/views/institution/hospital/hospital.data.ts b/src/views/institution/hospital/hospital.data.ts index 92beee1..909ce75 100644 --- a/src/views/institution/hospital/hospital.data.ts +++ b/src/views/institution/hospital/hospital.data.ts @@ -1,9 +1,8 @@ import { BasicColumn } from '/@/components/Table'; import { FormSchema } from '/@/components/Table'; -import {h} from "vue"; -import {Tag} from "ant-design-vue"; -import {list as addressList} from "/@/api/platform/system/controller/address"; -import {list as institutionList} from "/@/api/platform/system/controller/institution" +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; +import {list as institutionList} from '/@/api/platform/system/controller/institution'; export const columns: BasicColumn[] = [ @@ -215,7 +214,7 @@ export const hospitalFormSchema: FormSchema[] = [ label: '关联机构', component: 'ApiSelect', componentProps: { - mode: "multiple", + mode: 'multiple', resultField: 'list', labelField: 'name', valueField: 'id', diff --git a/src/views/institution/hospital/index.vue b/src/views/institution/hospital/index.vue index 2d9012b..ab2cd6f 100644 --- a/src/views/institution/hospital/index.vue +++ b/src/views/institution/hospital/index.vue @@ -6,7 +6,7 @@ @@ -32,7 +32,7 @@ import {BasicTable, useTable, TableAction} from '/@/components/Table'; import {useModal} from '/@/components/Modal'; import HospitalModal from './HospitalModal.vue'; -import {columns, searchFormSchema} from './hospital.data' +import {columns, searchFormSchema} from './hospital.data'; import {useMessage} from '/@/hooks/web/useMessage'; import {list, remove} from '/@/api/platform/system/controller/hospital'; const {createMessage} = useMessage(); diff --git a/src/views/institution/institution/InstitutionModal.vue b/src/views/institution/institution/InstitutionModal.vue index c3f098a..b26fa17 100644 --- a/src/views/institution/institution/InstitutionModal.vue +++ b/src/views/institution/institution/InstitutionModal.vue @@ -1,5 +1,9 @@ @@ -7,9 +11,9 @@ diff --git a/src/views/system/dept/index.vue b/src/views/system/dept/index.vue index 26542a2..f7d9618 100644 --- a/src/views/system/dept/index.vue +++ b/src/views/system/dept/index.vue @@ -1,42 +1,42 @@ diff --git a/src/views/system/equip/boxcard/BoxCardModal.vue b/src/views/system/equip/boxcard/BoxCardModal.vue new file mode 100644 index 0000000..5692968 --- /dev/null +++ b/src/views/system/equip/boxcard/BoxCardModal.vue @@ -0,0 +1,67 @@ + + + \ No newline at end of file diff --git a/src/views/system/equip/boxcard/boxcard.data.ts b/src/views/system/equip/boxcard/boxcard.data.ts new file mode 100644 index 0000000..e75e69c --- /dev/null +++ b/src/views/system/equip/boxcard/boxcard.data.ts @@ -0,0 +1,160 @@ +import { BasicColumn } from '/@/components/Table'; +import { FormSchema } from '/@/components/Table'; +import {h} from 'vue'; +import {Tag} from 'ant-design-vue'; + + +export const columns: BasicColumn[] = [ + { + title: 'ID', + dataIndex: 'id', + width: 120, + }, + { + title: 'iccid', + dataIndex: 'iccid', + width: 120, + }, + { + title: '卡号', + dataIndex: 'card', + width: 120, + }, + { + title: '网卡厂商', + dataIndex: 'company', + width: 120, + customRender: ({ record }) => { + const com = record.company; + switch (com) { + case '1': return '中国移动'; + case '2': return '中国联通'; + case '3': return '中国电信'; + default: return '未知厂商'; + } + } + }, + { + title: '卡是否已使用', + dataIndex: 'isUsed', + width: 120, + }, + { + title: '状态', + dataIndex: 'status', + width: 100, + customRender: ({ record }) => { + const status = record.status; + const enable = status === '0'; + const color = enable ? 'green' : 'red'; + const text = enable ? '启用' : '禁用'; + return h(Tag, { color: color }, () => text); + }, + }, + { + title: '创建人', + dataIndex: 'createByName', + width: 180, + }, + { + title: '创建时间', + dataIndex: 'createTime', + width: 180, + } +]; + +export const searchFormSchema: FormSchema[] = [ + { + field: 'iccid', + label: 'iccid', + component: 'Input', + componentProps: { + placeholder: '请输入唯一标识iccid', + }, + colProps: { span: 5 }, + }, + { + field: 'card', + label: '卡号', + component: 'Input', + componentProps: { + placeholder: '请输入卡号', + }, + colProps: { span: 5 }, + }, + { + field: 'company', + label: '网卡厂商', + component: 'Input', + componentProps: { + placeholder: '请输入网卡厂商', + }, + colProps: { span: 4 }, + }, + { + field: 'beginTime', + label: '起始时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, + { + field: 'endTime', + label: '截止时间', + component: 'DatePicker', + colProps: { span: 5 }, + }, +]; + +export const cardFormSchema: FormSchema[] = [ + { + field: 'id', + label: 'ID', + component: 'Input', + show: false, + }, + { + field: 'iccid', + label: 'iccid', + component: 'Input', + helpMessage: ['唯一识别号'], + required: true + }, + { + field: 'card', + label: '卡号', + component: 'Input', + required: false, + }, + { + field: 'company', + label: '网卡厂商', + component: 'Select', + required: true, + componentProps: { + options: [ + { label: '中国移动', value: '1' }, + { label: '中国联通', value: '2' }, + { label: '中国电信', value: '3' }, + { label: '未知厂商', value: ''||undefined||null } + ], + + } + }, + { + field: 'status', + label: '状态', + component: 'RadioButtonGroup', + defaultValue: '0', + componentProps: { + options: [ + { label: '启用', value: '0' }, + { label: '禁用', value: '1' }, + ], + }, + }, + { + label: '备注', + field: 'remarks', + component: 'InputTextArea', + } +]; \ No newline at end of file diff --git a/src/views/system/equip/boxcard/index.vue b/src/views/system/equip/boxcard/index.vue new file mode 100644 index 0000000..b62acdb --- /dev/null +++ b/src/views/system/equip/boxcard/index.vue @@ -0,0 +1,100 @@ + + + \ No newline at end of file