init
This commit is contained in:
2025-06-27 17:42:38 +08:00
commit bd6402478b
5317 changed files with 785994 additions and 0 deletions
@@ -0,0 +1,742 @@
<template>
<BasicDrawer @register="registerDrawer" :title="props.title" width="70%" :showFooter="true" @ok="handleSubmit">
<div style="position: absolute; left: 50%; top: 50%; transform: translate3d(-50%, -50%, 0); z-index: 99" v-if="spining">
<a-spin tip="加载中..." />
</div>
<BasicForm @register="registerForm" class="jeecg-form">
<template #first>
<div class="sub">基本信息</div>
</template>
<template #second>
<div class="sub">住院信息</div>
</template>
<template #third>
<div class="sub">分类信息</div>
</template>
<template #A>
<div>
<div class="label-class">A类大病信息</div>
</div>
<div style="flex: 1">
<a-form :model="data1" class="option-form" ref="optionForm">
<a-form-item-rest>
<div class="table-d">
<div class="table-td-d d1">大病名称</div>
<div class="table-td-d d1">确诊年份</div>
<div class="table-td-d d1">确诊医院</div>
<div class="table-td-d d1">大病状态</div>
<div class="table-td-d d1">治疗情况</div>
<div class="table-td-d d1">
<span style="color: #1890ff; cursor: pointer" @click="addItem('a')"> 添加 </span>
</div>
</div>
<template v-for="(item, index) in data1.option" :key="`temp${index}`">
<div class="table-d table-d-d">
<div class="table-td-d tabled-td-d-d d1">
<a-form-item
:name="['option', index, 'name']"
:rules="{
required: true,
// message: `请输入第${index}个大病名称`,
message: '',
}"
>
<JDictSelectTag
style="max-width: 100%"
v-model:value="item.name"
placeholder="请选择大病名称"
dictCode="ill_type"
/>
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d1">
<a-form-item :name="['option', index, 'time']">
<a-date-picker v-model:value="item.time" picker="year" value-format="YYYY" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d1">
<a-form-item :name="['option', index, 'hospital']">
<a-input v-model:value="item.hospital" placeholder="请输入确诊医院" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d1 user-group">
<a-form-item
:name="['option', index, 'status']"
:rules="{
required: true,
// message: `请选择第${index}个大病状态`,
message: '',
}"
>
<JDictSelectTag
style="max-width: 100%"
v-model:value="item.status"
placeholder="请选择大病状态"
dictCode="archives_ill_status"
/>
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d1">
<a-form-item :name="['option', index, 'cure']">
<a-input v-model:value="item.cure" placeholder="请输入治疗情况" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d1">
<span style="color: #1890ff; cursor: pointer" @click="delItem('a', index)"> 删除 </span>
</div>
</div>
</template>
</a-form-item-rest> </a-form
><div style="display: flex"> </div>
</div>
</template>
<template #B>
<div style="display: flex">
<div>
<div class="label-class">B类慢病信息</div>
</div>
<div style="flex: 1">
<a-form :model="data2" class="option-form" ref="optionForm">
<a-form-item-rest>
<div class="table-d">
<div class="table-td-d d2">慢病名称</div>
<div class="table-td-d d2">确诊年份</div>
<div class="table-td-d d2">确诊医院</div>
<div class="table-td-d d2">治疗情况</div>
<div class="table-td-d d2">
<span style="color: #1890ff; cursor: pointer" @click="addItem('b')"> 添加 </span>
</div>
</div>
<template v-for="(item, index) in data2.option" :key="`temp${index}`">
<div class="table-d table-d-d">
<div class="table-td-d tabled-td-d-d d2">
<a-form-item
:name="['option', index, 'name']"
:rules="{
required: true,
// message: `请输入第${index}个大病名称`,
message: '',
}"
>
<JDictSelectTag
style="max-width: 100%"
v-model:value="item.name"
placeholder="请选择慢病名称"
dictCode="hms_disease_type"
/>
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d2">
<a-form-item :name="['option', index, 'time']">
<a-date-picker v-model:value="item.time" picker="year" value-format="YYYY" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d2">
<a-form-item :name="['option', index, 'hospital']">
<a-input v-model:value="item.hospital" placeholder="请输入确诊医院" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d2">
<a-form-item :name="['option', index, 'cure']">
<a-input v-model:value="item.cure" placeholder="请输入治疗情况" />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d2">
<span style="color: #1890ff; cursor: pointer" @click="delItem('b', index)"> 删除 </span>
</div>
</div>
</template>
</a-form-item-rest>
</a-form>
</div>
</div>
</template>
<template #C>
<div style="display: flex">
<div>
<div class="label-class">C类重点指标异常</div>
</div>
<div style="flex: 1">
<a-form :model="data3" class="option-form" ref="optionForm">
<a-form-item-rest>
<div class="table-d">
<div class="table-td-d d3">指标名称</div>
<div class="table-td-d d3">指标值</div>
<div class="table-td-d d3">参考范围</div>
<div class="table-td-d d3">确诊年份</div>
<div class="table-td-d d3">确诊医院</div>
<div class="table-td-d d3">
<span style="color: #1890ff; cursor: pointer" @click="addItem('c')"> 添加 </span>
</div>
</div>
<template v-for="(item, index) in data3.option" :key="`temp${index}`">
<div class="table-d table-d-d">
<div class="table-td-d tabled-td-d-d d3">
<a-input v-model:value="item.name" readonly />
</div>
<div class="table-td-d tabled-td-d-d d3">
<a-input v-model:value="item.value" readonly />
</div>
<div class="table-td-d tabled-td-d-d d3">
<a-input v-model:value="item.scope" readonly />
</div>
<div class="table-td-d tabled-td-d-d d3">
<a-form-item :name="['option', index, 'hospital']">
<a-input v-model:value="item.time" readonly />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d3">
<a-form-item :name="['option', index, 'hospital']">
<a-input v-model:value="item.hospital" readonly />
</a-form-item>
</div>
<div class="table-td-d tabled-td-d-d d3">
<span style="color: #1890ff; cursor: pointer" @click="delItem('c', index)"> 删除 </span>
</div>
</div>
</template>
</a-form-item-rest>
</a-form>
</div>
</div>
</template>
<template #D>
<div style="display: flex">
<div>
<div class="label-class">D类健康风险评估</div>
</div>
<div style="flex: 1">
<a-form :model="data4" class="option-form" ref="optionForm">
<a-form-item-rest>
<div class="table-d">
<div class="table-td-d d4">疾病名称</div>
<div class="table-td-d d4">风险等级</div>
<div class="table-td-d d4">评估年份</div>
<div class="table-td-d d4">
<span style="color: #1890ff; cursor: pointer" @click="addItem('d')"> 添加 </span>
</div>
</div>
<template v-for="(item, index) in data4.option" :key="`temp${index}`">
<div class="table-d table-d-d">
<div class="table-td-d tabled-td-d-d d4">
<a-input v-model:value="item.name" readonly />
</div>
<div class="table-td-d tabled-td-d-d d4">
<a-input v-model:value="item.levelDesc" readonly />
</div>
<div class="table-td-d tabled-td-d-d d4">
<a-input v-model:value="item.time" readonly />
</div>
<div class="table-td-d tabled-td-d-d d4">
<span style="color: #1890ff; cursor: pointer" @click="delItem('d', index)"> 删除 </span>
</div>
</div>
</template>
</a-form-item-rest>
</a-form>
</div>
</div>
</template>
</BasicForm>
<ChooseSome
class="choose-some"
:width="1000"
@register="examinationModal"
@select-some="onSelectUserOk"
title="体检报告"
zIndex="1001"
:tableprops="tableProps"
selection-type="checkbox"
/>
<ChooseSome
class="choose-some"
:width="1000"
@register="examinationModal1"
@select-some="onSelectUserOk1"
title="评估结果"
zIndex="1001"
:tableprops="tableProps1"
selection-type="checkbox"
/>
</BasicDrawer>
</template>
<script setup lang="ts">
import BasicDrawer from '/@/components/Drawer/src/BasicDrawer.vue';
import BasicForm from '/@/components/Form/src/BasicForm.vue';
import { useDrawer, useDrawerInner } from '/@/components/Drawer';
import { useForm } from '/@/components/Form';
import { mSearchSchema, schemas, mColumns, mSearchSchema1, mColumns1 } from '/@/views/archive/fiveClassPeople/index.data';
import { ref } from 'vue';
import JDictSelectTag from '/@/components/Form/src/jeecg/components/JDictSelectTag.vue';
import {
groupUserAApi,
groupUserBApi,
groupUserCApi,
groupUserDApi,
groupUserEApi,
groupUserCLatestReportApi,
groupUserDLatestReportApi,
detailAApi,
detailBApi,
detailCApi,
detailDApi,
groupUserExtByUserIdApi,
editByUserIdApi,
} from '/@/views/archive/fiveClassPeople/index.api';
import ChooseSome from '/@/views/compoents/chooseSome/index.vue';
import { message } from 'ant-design-vue';
const props = defineProps({
title: {
type: String,
default: () => '编辑',
},
});
const spining = ref(false);
const data1 = ref<object>({
option: [],
});
const itemA = ref<object>({
name: '',
time: '',
hospital: '',
status: '',
});
const data2 = ref<object>({
option: [],
});
const itemB = ref<object>({
name: '',
time: '',
hospital: '',
});
const data3 = ref<object>({
option: [],
});
const data4 = ref<object>({
option: [],
});
const [examinationModal, { openDrawer }] = useDrawer();
const [examinationModal1, { openDrawer: openDrawer1 }] = useDrawer();
const tableProps = ref({
tableProps: {
api: groupUserCLatestReportApi,
columns: mColumns,
canResize: false,
immediate: false,
clearSelectOnPageChange: false,
rowKey: (record: Recordable) => {
return JSON.stringify({
peItemName: record?.peItemName,
peResult: record?.peResult,
printContext: record?.printContext,
medicalYear: record?.medicalYear,
hospitalName: record?.hospitalName,
uniItemId: record?.uniItemId,
});
},
beforeFetch: (params) => {
params['userId'] = getFieldsValue()?.userId;
return params;
},
afterFetch: (data) => {
let result: any[] = [];
data.length > 0 &&
data.map((item) => {
if (item?.senResultRes && item?.senResultRes.length > 0) {
item?.senResultRes.map((it) => {
if (it?.thirdResultRes && it?.thirdResultRes.length > 0) {
result = result.concat(it?.thirdResultRes);
}
});
}
});
return result;
},
formConfig: {
schemas: mSearchSchema,
autoSubmitOnEnter: true,
showAdvancedButton: false,
fieldMapToNumber: [],
fieldMapToTime: [],
labelWidth: 140,
baseColProps: {
xs: 12,
sm: 12,
md: 12,
lg: 12,
xl: 12,
xxl: 12,
},
actionColOptions: {
style: {
paddingLeft: '144px',
},
span: 24,
offset: 0,
xs: 12,
sm: 12,
md: 12,
lg: 12,
xl: 12,
xxl: 12,
},
},
showActionColumn: false,
},
});
const tableProps1 = ref({
tableProps: {
api: groupUserDLatestReportApi,
columns: mColumns1,
canResize: false,
immediate: false,
clearSelectOnPageChange: false,
rowKey: (record: Recordable) => {
return JSON.stringify({
name: record?.name,
levelDesc: record?.levelDesc,
level: record?.level,
year: record?.year + '',
});
},
beforeFetch: (params) => {
params['userId'] = getFieldsValue()?.userId;
return params;
},
showTableSetting: true,
tableSetting: {
redo: true,
setting: false,
},
// afterFetch: (data) => {
// let result: any[] = [];
//
// data.length > 0 &&
// data.map((item) => {
// if (item?.senResultRes && item?.senResultRes.length > 0) {
// item?.senResultRes.map((it) => {
// if (it?.thirdResultRes && it?.thirdResultRes.length > 0) {
// result = result.concat(it?.thirdResultRes);
// }
// });
// }
// });
//
// return result;
// },
useSearchForm: false,
formConfig: {
schemas: mSearchSchema1,
autoSubmitOnEnter: true,
showAdvancedButton: false,
fieldMapToNumber: [],
fieldMapToTime: [],
labelWidth: 120,
baseColProps: {
xs: 12,
sm: 12,
md: 12,
lg: 12,
xl: 12,
xxl: 12,
},
actionColOptions: {
style: {
paddingLeft: '122px',
},
span: 24,
offset: 0,
xs: 12,
sm: 12,
md: 12,
lg: 12,
xl: 12,
xxl: 12,
},
},
showActionColumn: false,
},
});
const emit = defineEmits(['success']);
const [registerDrawer, { setDrawerProps, closeDrawer }] = useDrawerInner(async (data) => {
spining.value = true;
await resetFields();
data1.value.option = [];
data2.value.option = [];
data3.value.option = [];
data4.value.option = [];
let res = {};
try {
switch (data.record.userGroup) {
case 'a':
const { records: r1 } = await detailAApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
res = await groupUserExtByUserIdApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
data1.value.option = r1;
break;
case 'b':
const { records: r2 } = await detailBApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
res = await groupUserExtByUserIdApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
data2.value.option = r2;
break;
case 'c':
const { records: r3 } = await detailCApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
data3.value.option = r3;
break;
case 'd':
const { records: r4 } = await detailDApi({ pageNo: 1, pageSize: 9999, userId: data.record.userId });
data4.value.option = r4.map((item: any) => ({
name: item?.name,
levelDesc: item?.levelDesc,
level: item?.level,
time: item?.time,
}));
console.log(data4.value.option);
break;
case 'e':
break;
}
await setFieldsValue({
...data.record,
...res,
});
setDrawerProps({
confirmLoading: false,
});
} finally {
spining.value = false;
}
});
function addItem(type) {
switch (type) {
case 'a':
data1.value?.option.push(JSON.parse(JSON.stringify(itemA.value)));
break;
case 'b':
data2.value?.option.push(JSON.parse(JSON.stringify(itemB.value)));
break;
case 'c':
const list = data3.value.option.map((item: any) => {
return JSON.stringify({
peItemName: item?.name,
peResult: item?.value,
printContext: item?.scope,
medicalYear: item?.time,
hospitalName: item?.hospital,
uniItemId: item?.uniItemId,
});
});
openDrawer(true, {
selectedRowKeys: list,
});
break;
case 'd':
const list1 = data4.value.option.map((item: any) => {
return JSON.stringify({
name: item?.name,
levelDesc: item?.levelDesc,
level: item?.level,
year: item?.time + '',
});
});
console.log(list1);
openDrawer1(true, {
selectedRowKeys: list1,
});
break;
}
}
function delItem(type, index) {
switch (type) {
case 'a':
data1.value?.option.splice(index, 1);
break;
case 'b':
data2.value?.option.splice(index, 1);
break;
case 'c':
data3.value?.option.splice(index, 1);
break;
case 'd':
data4.value?.option.splice(index, 1);
break;
}
}
const [registerForm, { setFieldsValue, resetFields, validate, getFieldsValue }] = useForm({
schemas,
showAdvancedButton: false,
showActionButtonGroup: false,
labelWidth: 130,
});
const optionForm = ref();
async function handleSubmit() {
try {
const values = await validate();
let values1;
// if (values['userGroup'] != 'e') {
if (!['c', 'd', 'e'].includes(values['userGroup'])) {
values1 = await optionForm.value.validate();
}
let params =
values['userGroup'] == 'e'
? { userId: values.userId }
: {
userId: values.userId,
userGroup: values.userGroup,
list: values['userGroup'] === 'c' ? data3.value.option : values['userGroup'] === 'd' ? data4.value.option : values1?.option,
};
console.log(params);
if (values['userGroup'] !== 'e' && (!params?.list || params?.list.length === 0)) return message.warn('请填写分类信息');
setDrawerProps({
confirmLoading: true,
});
switch (values['userGroup']) {
case 'a':
await editByUserIdApi(values);
await groupUserAApi(params);
break;
case 'b':
await editByUserIdApi(values);
await groupUserBApi(params);
break;
case 'c':
await groupUserCApi(params);
break;
case 'd':
await groupUserDApi(params);
break;
case 'e':
await groupUserEApi(params);
break;
}
closeDrawer();
emit('success', values['userGroup']);
} finally {
setDrawerProps({
confirmLoading: false,
});
}
}
function onSelectUserOk(e) {
data3.value.option =
e.length > 0
? e.map((item) => {
return {
name: JSON.parse(item)?.peItemName,
value: JSON.parse(item)?.peResult,
scope: JSON.parse(item)?.printContext,
time: JSON.parse(item)?.medicalYear,
hospital: JSON.parse(item)?.hospitalName,
uniItemId: JSON.parse(item)?.uniItemId,
};
})
: [];
}
function onSelectUserOk1(e) {
console.log(e);
data4.value.option =
e.length > 0
? e.map((item) => {
return {
name: JSON.parse(item)?.name,
levelDesc: JSON.parse(item)?.levelDesc,
level: JSON.parse(item)?.level,
time: JSON.parse(item)?.year,
};
})
: [];
}
</script>
<style scoped lang="less">
.table-d {
width: 100%;
display: flex;
border-top: 1px solid #f0f0f0;
border-right: 1px solid #f0f0f0;
.table-td-d {
border-left: 1px solid #f0f0f0;
border-bottom: 1px solid #f0f0f0;
background-color: #fafafa;
height: 50px;
line-height: 50px !important;
text-align: center;
}
.d1 {
width: calc(100% / 6);
}
.d2 {
width: 20%;
}
.d4 {
width: 25%;
}
.d3 {
width: calc(100% / 6);
}
.table-d-d {
background-color: #ffffff;
display: flex;
align-items: center;
justify-content: center;
}
}
.option-form {
.ant-form-item {
line-height: 50px !important;
}
}
:deep(.user-group .ant-select-selector) {
padding: 0 !important;
}
.sub {
font-size: 16px;
font-weight: bold;
padding-left: 10px;
}
:deep(.ant-form-item-label .form_item_b-class) {
background-color: red;
position: relative;
}
.label-class {
padding-left: 20px;
position: relative;
&::before {
position: absolute;
font-size: 14px;
top: 1px;
left: 10px;
color: #ff4d4f;
content: '*';
font-family: SimSun, sans-serif;
}
}
</style>
@@ -0,0 +1,45 @@
import { defHttp } from '/@/utils/http/axios';
export enum Api {
list = '/health-system/sys/user/listGroupUser',
groupUserCLatestReport = '/health-archives/archives/groupUserC/latestReport',
groupUserDLatestReport = '/health-archives/archives/groupUserD/latestReport',
groupUserA = '/health-archives/archives/groupUserA/addBatch',
groupUserB = '/health-archives/archives/groupUserB/addBatch',
groupUserC = '/health-archives/archives/groupUserC/addBatch',
groupUserD = '/health-archives/archives/groupUserD/addBatch',
groupUserE = '/health-archives/archives/groupUserA/updateUserToE',
groupUserAImportExcel = '/health-archives/archives/groupUserA/importExcel',
groupUserBImportExcel = '/health-archives/archives/groupUserB/importExcel',
groupImportExcel = '/health-archives/archives/groupUserC/importExcelBatchUpdateUserGroup',
autoAddC = '/health-archives/archives/groupUserC/autoAddC',
autoAddD = '/health-archives/archives/groupUserD/autoAddD',
detailA = '/health-archives/archives/groupUserA/list',
groupUserExtByUserId = '/archives/groupUserExt/groupUserExtByUserId',
detailB = '/health-archives/archives/groupUserB/list',
detailC = '/health-archives/archives/groupUserC/list',
detailD = '/health-archives/archives/groupUserD/list',
editByUserId = '/health-archives/archives/groupUserExt/editByUserId',
excelImportTemplate = '/health-archives/archives/groupUserA/excelImportTemplate',
listGroupUserExport = '/health-system/sys/user/listGroupUserExport', // 五类人群导出
}
export const listApi = (params) => defHttp.get({ url: Api.list, params });
export const groupUserCLatestReportApi = (params) => defHttp.get({ url: Api.groupUserCLatestReport, params });
export const groupUserDLatestReportApi = (params) => defHttp.get({ url: Api.groupUserDLatestReport, params });
export const groupUserAApi = (params) => defHttp.post({ url: Api.groupUserA, params });
export const groupUserBApi = (params) => defHttp.post({ url: Api.groupUserB, params });
export const groupUserCApi = (params) => defHttp.post({ url: Api.groupUserC, params });
export const groupUserDApi = (params) => defHttp.post({ url: Api.groupUserD, params });
export const groupUserEApi = (params) => defHttp.post({ url: Api.groupUserE, params }, { joinParamsToUrl: true });
export const autoAddCApi = () => defHttp.post({ url: Api.autoAddC });
export const autoAddDApi = () => defHttp.post({ url: Api.autoAddD });
export const groupUserExtByUserIdApi = (params) => defHttp.get({ url: Api.groupUserExtByUserId, params }, { joinParamsToUrl: true });
export const detailAApi = (params) => defHttp.get({ url: Api.detailA, params }, { joinParamsToUrl: true });
export const detailBApi = (params) => defHttp.get({ url: Api.detailB, params }, { joinParamsToUrl: true });
export const detailCApi = (params) => defHttp.get({ url: Api.detailC, params }, { joinParamsToUrl: true });
export const detailDApi = (params) => defHttp.get({ url: Api.detailD, params }, { joinParamsToUrl: true });
export const editByUserIdApi = (params) => defHttp.post({ url: Api.editByUserId, params }, { successNeedMessage: false });
export const excelImportTemplateUrl = Api.excelImportTemplate;
export const listGroupUserExportApi = (params) => defHttp.get({ url: Api.listGroupUserExport, params }, { joinParamsToUrl: true });
@@ -0,0 +1,274 @@
import { BasicColumn, FormSchema } from '/@/components/Table';
import dayjs from 'dayjs';
import { orgSearchInfo } from '/@/utils/orgSearchInfo';
export const searchFormSchema: FormSchema[] = [
...orgSearchInfo(),
{
label: '身份证号',
field: 'idCard',
component: 'Input',
},
{
label: '健康分类',
field: 'userGroup',
component: 'JDictSelectTag',
componentProps: () => ({ dictCode: 'user_group' }),
},
];
export const mSearchSchema: FormSchema[] = [
{
label: '重点指标项',
field: 'peItemName',
component: 'Input',
},
{
label: '是否异常项',
field: 'colour',
component: 'Select',
componentProps: () => ({
options: [
{ label: '否', value: '0' },
{ label: '是', value: '1' },
],
}),
},
];
export const mSearchSchema1: FormSchema[] = [
{
label: '疾病名称',
field: 'name',
component: 'Input',
},
{
label: '风险等级',
field: 'illName',
component: 'Input',
show: false,
defaultValue: '体重',
},
];
export const columns: BasicColumn[] = [
{
title: '单位',
dataIndex: 'secondDepart',
align: 'center',
},
{
title: '部门',
dataIndex: 'depart',
align: 'center',
},
{
title: '姓名',
dataIndex: 'realName',
align: 'center',
},
{
title: '身份证号',
dataIndex: 'idCard',
align: 'center',
},
{
title: '健康分类',
dataIndex: 'userGroup_dictText',
align: 'center',
width: 100,
},
{
title: '更新时间',
dataIndex: 'userGroupUpdateTime',
align: 'center',
customRender: ({ text }) => {
return text ? dayjs(text).format('YYYY-MM-DD HH:mm:ss') : '';
},
},
];
export const mColumns: BasicColumn[] = [
{
title: '重点指标项',
dataIndex: 'peItemName',
align: 'center',
},
{
title: '指标值',
dataIndex: 'peResult',
align: 'center',
},
{
title: '参考范围',
dataIndex: 'printContext',
align: 'center',
},
{
title: '检查年份',
dataIndex: 'medicalYear',
align: 'center',
},
{
title: '检查医院',
dataIndex: 'hospitalName',
align: 'center',
},
{
title: '是否异常项',
dataIndex: 'colour',
customRender: ({ text }) => (text == '0' ? '否' : '是'),
align: 'center',
},
];
export const mColumns1: BasicColumn[] = [
{
title: '疾病名称',
dataIndex: 'name',
align: 'center',
},
{
title: '风险等级',
dataIndex: 'levelDesc',
align: 'center',
},
{
title: '评估年份',
dataIndex: 'year',
align: 'center',
},
];
export const schemas: FormSchema[] = [
{
label: '',
field: 'first',
component: 'Input',
slot: 'first',
},
{
label: '',
field: 'id',
component: 'Input',
show: false,
},
{
label: '',
field: 'userId',
component: 'Input',
show: false,
},
{
label: '单位',
field: 'secondDepart',
component: 'Input',
componentProps: () => ({ disabled: true }),
},
{
label: '部门',
field: 'depart',
component: 'Input',
componentProps: () => ({ disabled: true }),
},
{
label: '姓名',
field: 'realName',
component: 'Input',
componentProps: () => ({ disabled: true }),
},
{
label: '身份证号',
field: 'idCard',
component: 'Input',
componentProps: () => ({ disabled: true }),
},
{
label: '健康分类',
field: 'userGroup',
component: 'JDictSelectTag',
required: true,
componentProps: () => ({ dictCode: 'user_group' }),
},
{
label: '',
field: 'second',
component: 'Input',
slot: 'second',
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '住院状态',
field: 'status',
component: 'JDictSelectTag',
componentProps: () => ({ dictCode: 'group_user_status' }),
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '所在医院',
field: 'hospital',
component: 'Input',
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '住院时间',
field: 'hospitalTime',
component: 'DatePicker',
componentProps: () => ({ format: 'YYYY-MM-DD', valueFormat: 'YYYY-MM-DD', style: { width: '100%' } }),
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '住院次数',
field: 'hospitalNum',
component: 'InputNumber',
componentProps: () => ({ dictCode: 'user_group', style: { width: '100%' } }),
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '联系人',
field: 'contact',
component: 'Input',
componentProps: () => ({ dictCode: 'user_group' }),
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '联系电话',
field: 'contactMobile',
component: 'Input',
componentProps: () => ({ dictCode: 'user_group' }),
rules: [
// { required: true, message: '请输入联系电话', trigger: 'blur' },
{ pattern: /^1[3456789]\d{9}$/, message: '手机号码格式有误' },
],
ifShow: ({ values }) => ['a', 'b'].includes(values.userGroup),
},
{
label: '',
field: 'third',
component: 'Input',
slot: 'third',
ifShow: ({ values }) => ['a', 'b', 'c', 'd'].includes(values.userGroup),
},
{
label: '',
field: 'idCard',
component: 'Input',
slot: 'A',
ifShow: ({ values }) => values.userGroup == 'a',
},
{
label: '',
field: 'idCard',
component: 'Input',
slot: 'B',
ifShow: ({ values }) => values.userGroup == 'b',
},
{
label: '',
field: 'idCard',
component: 'Input',
slot: 'C',
ifShow: ({ values }) => values.userGroup == 'c',
},
{
label: '',
field: 'idCard',
component: 'Input',
slot: 'D',
ifShow: ({ values }) => values.userGroup == 'd',
},
];
+254
View File
@@ -0,0 +1,254 @@
<template>
<BasicTable @register="registerTable">
<template #tableTitle>
<a-button v-auth="'archives:group_user_batch:big'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate1">
下载大病人员模板</a-button
>
<a-upload
v-auth="'archives:group_user_batch:big'"
name="file"
:showUploadList="false"
:customRequest="onImportXls1"
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
>
<a-button type="primary" preIcon="ant-design:import-outlined" :loading="bigLoading">导入大病人员</a-button>
</a-upload>
<a-button v-auth="'archives:group_user_batch:slow'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate2">
下载慢病人员模板</a-button
>
<a-upload
v-auth="'archives:group_user_batch:slow'"
name="file"
:showUploadList="false"
:customRequest="onImportXls2"
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
>
<a-button type="primary" preIcon="ant-design:import-outlined" :loading="slowLoading">导入慢病人员</a-button>
</a-upload>
<a-button type="primary" preIcon="ant-design:plus-outlined" v-auth="'archives:group_user_batch:automaticAbnormal'" @click="automatic1">
自动添加最新体检异常项
</a-button>
<a-button type="primary" preIcon="ant-design:plus-outlined" v-auth="'archives:group_user_batch:automaticResult'" @click="automatic2">
自动添加评估结果
</a-button>
<a-button v-auth="'archives:group_user_batch:importExcel'" type="primary" preIcon="ant-design:import-outlined" @click="downloadTemplate3">
下载批量修改导入模板
</a-button>
<a-upload
v-auth="'archives:group_user_batch:importExcel'"
name="file"
:showUploadList="false"
:customRequest="onImportXls3"
accept=".xlsx, .xls, application/vnd.ms-excel-=='"
>
<a-button type="primary">批量修改导入</a-button>
</a-upload>
<a-button v-auth="'archives:group_user_batch:exportFivePeople'" type="primary" preIcon="ant-design:export-outlined" @click="exportReport">
导出
</a-button>
<a-button
v-auth="'archives:group_user_batch:exportFivePeopleRecord'"
preIcon="ant-design:search-outlined"
@click="handleLookRecord"
type="primary"
>查看导出记录
</a-button>
<!-- <a-button v-auth="'archives:group_user_batch:importExcel'" @click="handleLookRecord" type="primary"> 查看批量修改导入记录 </a-button>-->
</template>
<!--操作栏-->
<template #action="{ record }">
<TableAction :actions="getTableAction(record)" />
</template>
</BasicTable>
<index-drawer @register="registerDrawer" @success="handleSuccess" />
<!-- <ExportUtil task-code="batchUpdateUserGroup" :params="{ handleType: '2' }" @register="registerExport" />-->
<ExportUtil task-code="groupUserTaskCode" @register="registerExport" />
</template>
<script setup lang="ts">
import BasicTable from '/@/components/Table/src/BasicTable.vue';
import { TableAction } from '/@/components/Table';
import { useListPage } from '/@/hooks/system/useListPage';
import {
listApi,
Api,
autoAddCApi,
autoAddDApi,
excelImportTemplateUrl,
listGroupUserExportApi,
} from '/@/views/archive/fiveClassPeople/index.api';
import { columns, searchFormSchema } from '/@/views/archive/fiveClassPeople/index.data';
import IndexDrawer from '/@/views/archive/fiveClassPeople/components/indexDrawer.vue';
import { useDrawer } from '/@/components/Drawer';
import { useMethods } from '/@/hooks/system/useMethods';
import { downloadExcel } from '/@/views/healthMonitor/healMonitorManage/monitorToll/toolManagement/toolHooks';
import { ref } from 'vue';
import ExportUtil from '/@/utils/export/exportUtil.vue';
import { message } from 'ant-design-vue';
const [registerDrawer, { openDrawer }] = useDrawer();
const [registerExport, { openDrawer: openExportDrawer }] = useDrawer();
function exportReport() {
const val = getForm().getFieldsValue();
listGroupUserExportApi(val);
}
function handleLookRecord() {
openExportDrawer(true, {});
}
const { hasParamsImportXls, handleExportXlsx } = useMethods();
const bigLoading = ref(false);
const slowLoading = ref(false);
function getTableAction(record: Recordable) {
return [
{
label: '编辑',
onclick: handleEdit.bind(null, record),
auth: 'archives:edit-button',
},
];
}
function handleEdit(record: Recordable) {
openDrawer(true, {
record,
});
}
const { tableContext } = useListPage({
tableProps: {
api: listApi,
columns,
canResize: false,
beforeFetch: (params) => {
if (params['orgCode2']) {
params['orgCode'] = params['orgCode2'];
} else {
params['orgCode'] = params['orgCode1'];
}
return params;
},
formConfig: {
schemas: searchFormSchema,
autoSubmitOnEnter: true,
showAdvancedButton: false,
fieldMapToNumber: [],
},
showIndexColumn: true,
indexColumnProps: {
width: 80,
},
actionColumn: {
width: 80,
fixed: 'right',
},
},
});
const [registerTable, { reload, getForm }] = tableContext;
function handleSuccess() {
reload();
}
function onImportXls1(d) {
const size = d.file.size;
const m10 = 1024 * 1024 * 10;
if (size > m10) {
console.log('文件过大');
}
bigLoading.value = true;
console.log(d, 'dddddd');
hasParamsImportXls(d, Api.groupUserAImportExcel, { noMessage: true }, (res) => {
if (res?.code != 200) {
alert(
res?.result
? res?.result
.map((item: any) => {
return item.substring(0, item.length) + ';';
})
.join('\n')
: res?.message
);
}
reload();
}).finally(() => {
bigLoading.value = false;
});
}
function onImportXls2(d) {
const size = d.file.size;
const m10 = 1024 * 1024 * 10;
if (size > m10) {
console.log('文件过大');
}
slowLoading.value = true;
hasParamsImportXls(d, Api.groupUserBImportExcel, { noMessage: true }, (res) => {
alert(
res?.result
? res?.result
.map((item: any) => {
return item.substring(0, item.length) + ';';
})
.join('\n')
: res?.message
);
reload();
}).finally(() => {
slowLoading.value = false;
});
}
function onImportXls3(file) {
hasParamsImportXls(file, Api.groupImportExcel, {}, (res) => {
alert(
res?.result
? res?.result
.map((item: any) => {
return item.substring(0, item.length) + ';';
})
.join('\n')
: res?.message
);
reload();
}).finally(() => {
slowLoading.value = false;
});
}
function downloadTemplate1() {
// downloadExcel('/static/fiveClass/big.xlsx', '大病人员导入模板');
downLoadFile('1');
}
function downloadTemplate2() {
// downloadExcel('/static/fiveClass/slow.xlsx', '慢病人员导入模板');
downLoadFile('2');
}
function downloadTemplate3() {
downloadExcel('/static/fiveClass/large.xlsx', '批量修改导入模板');
}
async function downLoadFile(type) {
await handleExportXlsx(type === '1' ? '大病人员导入模板' : '慢病人员导入模板', excelImportTemplateUrl, { type: type });
// try {
// let res: any = await excelImportTemplateApi({ type: type });
// let blob = new Blob([res], { type: 'application/octet-stream' });
// let link = document.createElement('a');
// link.href = window.URL.createObjectURL(blob);
// link.download = (type === 1 ? '大病人员导入模板' : '慢病人员导入模板') + '.xlsx';
// link.click();
// } catch {}
}
function automatic1() {
autoAddCApi();
}
function automatic2() {
autoAddDApi();
}
</script>
<style scoped lang="less"></style>