diff --git a/YiJi-admin/src/components/Yewu/YuYue.vue b/YiJi-admin/src/components/Yewu/YuYue.vue index 66f5525..510d57a 100644 --- a/YiJi-admin/src/components/Yewu/YuYue.vue +++ b/YiJi-admin/src/components/Yewu/YuYue.vue @@ -116,7 +116,14 @@ @@ -144,7 +151,13 @@ @@ -341,6 +354,17 @@ //获取某日可用号源 const GetEnablePlanFunc = (date, entrustids) => { loading.value = true + + // 计算当前选中项目所需的总座位数 + let totalUseSeats = 0 + MainInfo.value.forEach((v, i) => { + v.itemInfo.forEach((v2, i2) => { + if (v2.selected && v2.item.use_seats) { + totalUseSeats += v2.item.use_seats + } + }) + }) + GetEnablePlan({ regnum: MainInfo.value[MainInfoKey.value].mainInfo.reg_num, entrustid: entrustids, @@ -350,6 +374,14 @@ }).then(res => { loading.value = false if (res.status) { + // 标记不可用的号源 + res.data.plan_list.forEach((plan, index) => { + // 计算号源可用数量 + const availableCount = plan.count - plan.used_count + // 如果可用数量小于总座位数,则标记为不可用 + plan.isAvailable = availableCount >= totalUseSeats + }) + if (res.data.appointment_date == table_date1.value) { tableData1.value = res.data tableData1.value.plan_list.forEach((v, i) => {