diff --git a/admin/src/views/PlanMngr/PlanModel.vue b/admin/src/views/PlanMngr/PlanModel.vue
index c0dd9e0..8691954 100644
--- a/admin/src/views/PlanMngr/PlanModel.vue
+++ b/admin/src/views/PlanMngr/PlanModel.vue
@@ -78,15 +78,16 @@
:active-value="1" :inactive-value="0" />
+
+
设为 {{item.name}}-{{item.count}}
+
未选中则为预留号源
-
+
@@ -224,7 +225,7 @@
}
let Info = ref({});
let dialogVisible = ref(false);
- const Add = () => {
+ const Add = async() => {
Info.value = {}
Info.value.id = 0
Info.value.hospital_id=1
@@ -232,24 +233,31 @@
Info.value.TimeRange = ['08:00:00', '12:00:00']
Info.value.interval_time = 5 //间隔,分钟
dialogVisible.value = true
- GetPlanTypeList()
+ await GetPlanTypeList()
GetTimeList()
}
let PlabTypeList = ref([]); //所有可用的号源类型
- const GetPlanTypeList = () => {
+ const GetPlanTypeList = async () => {
loading.value = true
- PlanTypeGetList({
- searchInfo: {
- status: 1
- },
- }).then(res => {
- loading.value = false
- if (res.status) {
- PlabTypeList.value = res.data.list
+ try {
+ const res = await PlanTypeGetList({
+ searchInfo: {
+ status: 1
+ },
+ })
+ if (res.status) {
+ PlabTypeList.value = res.data.list.map(item => ({
+ ...item,
+ count: 0
+ }));
} else {
ElMessage.error(res.msg)
}
- })
+ } catch (error) {
+ ElMessage.error('请求失败')
+ } finally {
+ loading.value = false
+ }
}
const handle = (e) => {
Info.value.interval_time = e
@@ -276,7 +284,6 @@
if (res.status) {
let time_obj = {}
res.data.list.forEach((v, i) => {
-
if (type == 'detail') { //如果是 编辑模式,回显详情
if (Info.value.y_number.includes(i)) {
time_obj = {
@@ -297,6 +304,7 @@
}
timeList.value.push(time_obj)
})
+ console.log('---------',PlabTypeList.value)
} else {
ElMessage.error(res.msg)
}
@@ -340,9 +348,9 @@
}
})
}
- const Edit = (row) => {
+ const Edit = async(row) => {
dialogVisible.value = true
- GetPlanTypeList()
+ await GetPlanTypeList()
GetDetail(row.id)
}
const GetDetail = (id) => {
@@ -356,6 +364,11 @@
//GetTimeList('detail')
timeList.value=Info.value.list
timeList.value.forEach((v,i)=>{
+ PlabTypeList.value.forEach((t_v,t_i)=>{
+ if(v.plan_type_id==t_v.id){
+ t_v.count++
+ }
+ })
if(v.type==1){
timeList.value[i].class = "timelist_button_selected"
}
@@ -443,6 +456,11 @@
if(v.class == "timelist_button_selected" && v.type_color==null){
timeList.value[i].type_color =item.color
timeList.value[i].plan_type_id =item.id
+ PlabTypeList.value.forEach((t_v,t_i)=>{
+ if(item.id==t_v.id){
+ t_v.count++
+ }
+ })
}
})
}
@@ -519,4 +537,9 @@
margin-left: 8px;
cursor: pointer;
}
+ .TypeCount{
+ font-size: 14px;
+ font-weight: 900;
+
+ }
\ No newline at end of file