yinsiyu 2 місяці тому
джерело
коміт
5e9d441653
2 змінених файлів з 65 додано та 30 видалено
  1. +54
    -3
      src/enums/index.js
  2. +11
    -27
      src/views/statisticalManage/followupStatistical/listPage/index.vue

+ 54
- 3
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'
}
])

+ 11
- 27
src/views/statisticalManage/followupStatistical/listPage/index.vue Переглянути файл

@@ -38,7 +38,7 @@
>
<el-option label="全部" value=""></el-option>
<el-option
v-for="dict in followItemStatusEnum.options"
v-for="dict in FOLLOWUP_STATUS.options"
:key="dict.value"
:label="dict.label"
:value="dict.value"
@@ -212,18 +212,11 @@
/>
<el-table-column align="center" label="随访状态" width="100">
<template slot-scope="scope">
<span
:style="{
color:
scope.row.status !== undefined
? followItemStatusEnum.enum[scope.row.status].color
: '',
}"
>
<el-tag :type="FOLLOWUP_STATUS.getTagByValue(scope.row.status)">
{{
scope.row.status !== undefined ? followItemStatusEnum.getLabel(scope.row.status) : ""
FOLLOWUP_STATUS.getLabelByValue(scope.row.status)
}}
</span>
</el-tag>
</template>
</el-table-column>
<el-table-column align="center" label="最近任务时间" prop="nextTaskDate" width="180">
@@ -235,19 +228,9 @@
</el-table-column>
<el-table-column align="center" label="任务状态" width="100">
<template slot-scope="scope">
<span
:style="{
color: ![undefined, null].includes(scope.row.nextTaskStatus)
? followItemStatusEnum.enum[scope.row.nextTaskStatus].color
: '',
}"
>
{{
scope.row.nextTaskStatus !== undefined
? followItemStatusEnum.getLabel(scope.row.nextTaskStatus)
: ""
}}
</span>
<el-tag :type="FOLLOWUP_STATUS.getTagByValue(scope.row.nextTaskStatus)">
{{ FOLLOWUP_STATUS.getLabelByValue(scope.row.nextTaskStatus) }}
</el-tag>
</template>
</el-table-column>
<el-table-column
@@ -265,7 +248,7 @@
width="150"
>
<template slot-scope="scope">
{{ scope.row.periodNumber + periodUnitEnum.getLabel(scope.row.periodUnit) }}
{{ scope.row.periodNumber + PERIOD_UNIT.getLabelByValue(scope.row.periodUnit) }}
</template>
</el-table-column>
<el-table-column
@@ -293,7 +276,6 @@
<script>
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,
// 显示搜索条件


Завантаження…
Відмінити
Зберегти