diff --git a/src/enums/index.js b/src/enums/index.js index 619721b..d669a4f 100644 --- a/src/enums/index.js +++ b/src/enums/index.js @@ -3,11 +3,11 @@ export default function createEnum(dictList) { const nameToItemMap = {}; dictList.forEach((dictItem) => { nameToItemMap[dictItem["name"]] = dictItem; - valueToDescMap[dictItem["value"]] = dictItem; + valueToItemMap[dictItem["value"]] = dictItem; }); return { - ...nameToValueMap, + ...nameToItemMap, options: dictList, getValueByName(enumName) { return nameToItemMap[enumName].value; @@ -19,7 +19,7 @@ export default function createEnum(dictList) { return nameToItemMap[name].label }, getTagByValue(value) { - return valueToItemMap[name].tag || '' + return valueToItemMap[value].tag || '' } }; } @@ -77,3 +77,54 @@ export const IS_MY_HOSPITAL = createEnum([ name: "no" } ]) +// 随访单状态 +export const FOLLOWUP_STATUS = createEnum([ + { + value: 0, + label: '待开始', + name: 'be_start', + tag: 'warning' + }, + { + value: 1, + label: '进行中', + name: 'underway', + tag: 'success' + }, + { + value: 2, + label: '已完成', + name: 'finished', + tag: 'info' + }, + { + value: 3, + label: '已过期', + name: 'past', + tag: 'info', + }, + { + value: 4, + label: '已终止', + name: 'termination', + tag: 'danger' + } +]) +// 日期单位 +export const PERIOD_UNIT = createEnum([ + { + label: '天', + value: 0, + name: 'day' + }, + { + label: '月', + value: 1, + name: 'month' + }, + { + label: '年', + value: 2, + name: 'year' + } +]) diff --git a/src/views/statisticalManage/followupStatistical/listPage/index.vue b/src/views/statisticalManage/followupStatistical/listPage/index.vue index 1ee9361..8d7b7fb 100644 --- a/src/views/statisticalManage/followupStatistical/listPage/index.vue +++ b/src/views/statisticalManage/followupStatistical/listPage/index.vue @@ -38,7 +38,7 @@ > @@ -235,19 +228,9 @@ import { getDoctorAllList } from "@/api/hospital/index"; import { - statisticalView, statisticalViewData, statisticalPageList, statisticalExport, @@ -301,16 +283,18 @@ import { import { getAllHospital, getTreeHospDeptByPatient } from "@/api/admin"; import ApiButton from "@/components/ApiButton"; import TreeDept from "@/components/TreeDept"; +import { FOLLOWUP_STATUS, PERIOD_UNIT } from '@/enums/index' export default { name: "FollowUpStatistical", - enums: ["followItemStatusEnum", "periodUnitEnum"], components: { ApiButton, TreeDept, }, data() { return { + FOLLOWUP_STATUS, + PERIOD_UNIT, // 遮罩层 loading: true, // 显示搜索条件