From c531468b299123af779fd8510716f1be698d92fb Mon Sep 17 00:00:00 2001 From: sa0ChunLuyu Date: Mon, 27 Jul 2026 23:43:44 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Admin/YeWu/PlanModelController.php | 16 ++++++++++++---- .../src/views/AppointmentMngr/PlanModel.vue | 8 ++++---- .../src/views/AppointmentMngr/PlanModelAdmin.vue | 8 ++++---- 3 files changed, 20 insertions(+), 12 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanModelController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanModelController.php index 3e75ba7..e717fe6 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanModelController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanModelController.php @@ -186,8 +186,12 @@ public function Save(Request $request) $bitian_zh[]='星期'; } foreach ($bitian as $key => $field) { //必填项不能为空 - if (array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [] && $planInfo[$field] !== 0) { - } else { + $allowZeroFields = ['max_total']; + $isValid = array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== []; + if (!in_array($field, $allowZeroFields)) { + $isValid = $isValid && $planInfo[$field] !== 0; + } + if (!$isValid) { return \Yz::echoError1($bitian_zh[$key] . ' 不能为空'); } } @@ -524,8 +528,12 @@ public function SaveAdmin(Request $request) $bitian_zh[]='星期'; } foreach ($bitian as $key => $field) { - if (array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [] && $planInfo[$field] !== 0) { - } else { + $allowZeroFields = ['max_total']; + $isValid = array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== []; + if (!in_array($field, $allowZeroFields)) { + $isValid = $isValid && $planInfo[$field] !== 0; + } + if (!$isValid) { return \Yz::echoError1($bitian_zh[$key] . ' 不能为空'); } } diff --git a/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue b/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue index 7dcda01..48885d5 100644 --- a/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue +++ b/YiJi-admin/src/views/AppointmentMngr/PlanModel.vue @@ -188,8 +188,8 @@
+ v-model="PlanInfo.max_total" :min="0" placeholder="0" + oninput="value=value.replace(/[^0-9]/g, '')" /> @@ -200,8 +200,8 @@
{{ item.name }}
- +
{{item.ratio}}%
diff --git a/YiJi-admin/src/views/AppointmentMngr/PlanModelAdmin.vue b/YiJi-admin/src/views/AppointmentMngr/PlanModelAdmin.vue index 9ae7539..79d4b4b 100644 --- a/YiJi-admin/src/views/AppointmentMngr/PlanModelAdmin.vue +++ b/YiJi-admin/src/views/AppointmentMngr/PlanModelAdmin.vue @@ -188,8 +188,8 @@
+ v-model="PlanInfo.max_total" :min="0" placeholder="0" + oninput="value=value.replace(/[^0-9]/g, '')" /> @@ -200,8 +200,8 @@
{{ item.name }}
- +
{{item.ratio}}%