From d79855845c38e3d7bf78fc4af4e2208b3550af48 Mon Sep 17 00:00:00 2001 From: yanzai Date: Tue, 25 Mar 2025 22:41:08 +0800 Subject: [PATCH] =?UTF-8?q?web=E7=AB=AF=E8=B0=83=E6=95=B4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/API/Web/ComboController.php | 1 + .../Controllers/API/Web/ItemController.php | 12 +++++- Laravel/public/tool/register.html | 37 +++++++++++++++---- 3 files changed, 41 insertions(+), 9 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Web/ComboController.php b/Laravel/app/Http/Controllers/API/Web/ComboController.php index 80fe21a..b2709bb 100644 --- a/Laravel/app/Http/Controllers/API/Web/ComboController.php +++ b/Laravel/app/Http/Controllers/API/Web/ComboController.php @@ -189,6 +189,7 @@ select combo_id as c_id,count(*) as sale_count from orders where status in(2,4) $groupedData = []; foreach ($items as $item) { $item->price = $item->price * config('app.globals.ZiXuan_ZheKou');//所有自选项目打8折 + $item->price = number_format( $item->price , 2, '.', ''); //判断套餐项目和自选项目是否冲突 if(isset($combo_items)){ foreach ($combo_items as $comboitem) { diff --git a/Laravel/app/Http/Controllers/API/Web/ItemController.php b/Laravel/app/Http/Controllers/API/Web/ItemController.php index f974616..bf11f32 100644 --- a/Laravel/app/Http/Controllers/API/Web/ItemController.php +++ b/Laravel/app/Http/Controllers/API/Web/ItemController.php @@ -12,13 +12,20 @@ class ItemController extends Controller public function GetList() { $hospital = request('hospital'); + $appointment = request('appointment'); $sex=request('sex'); //查询所有可以自选的项目 - $items=DB::table('items')->where(['is_choose'=>1,'status'=>1])->get(); + $items=DB::table('items'); + if(isset($appointment)){ + $items=$items->where('keshi_id',$appointment); + } + $items=$items->where(['is_choose'=>1,'status'=>1])->get(); $search= request('search'); $list = []; $group_arr = []; $group_list = []; + $keshi_list = []; + $keshi_list=DB::table('items')->select('keshi_id','keshi_name')->where(['is_choose'=>1,'status'=>1])->groupBy('keshi_id','keshi_name')->get(); foreach ($items as $item) { if($item->sex <> $sex and $item->sex<>0){ continue; @@ -52,6 +59,7 @@ class ItemController extends Controller 'children' => [], ]; $group_arr[] = $item->keshi_id; + } $group_list["科室{$item->keshi_id}"]['children'][] = [ @@ -69,6 +77,6 @@ class ItemController extends Controller } } - return \Yz::Return(true,"查询成功",['list'=>$group_list]); + return \Yz::Return(true,"查询成功",['list'=>$group_list,'keshi_list'=>$keshi_list]); } } diff --git a/Laravel/public/tool/register.html b/Laravel/public/tool/register.html index a756a62..c97addf 100644 --- a/Laravel/public/tool/register.html +++ b/Laravel/public/tool/register.html @@ -142,7 +142,7 @@ + ref="combo_table_ref" @row-click="comboRowClick" :row-class-name="comboRowClassName" :default-sort="{ prop: 'price' }"> @@ -151,7 +151,7 @@ - + @@ -225,7 +225,7 @@ - + @@ -240,6 +240,12 @@ + + + + + + 搜索 @@ -291,6 +297,7 @@
合计价格:¥ {{ pay_info.true_price }} + 原价:¥{{ pay_info.original_price }}
清空 @@ -457,6 +464,7 @@ }; const search_input = ref(""); + const search_appointment=ref(""); const select_items_deep = ref(""); const select_data_default = { combo: "", @@ -567,9 +575,9 @@ combo_search_input_deep.value = combo_search_input.value } const searchClick = () => { - if (search_input_deep.value === search_input.value) { - return - } + // if (search_input_deep.value === search_input.value) { + // return + // } search_input_deep.value = search_input.value saveSelectDeep(); if (!!search_input.value) { @@ -593,6 +601,14 @@ } else { item_list_show.value = item_list.value } + if(!!search_appointment.value){ + if(search_appointment.value === "0"){ + + }else{ + item_list_show.value = item_list_show.value.filter(item => item.group_id === search_appointment.value) + } + + } nextTick(() => { let select_deep = JSON.parse(JSON.stringify(select_items_deep.value)).split(',') get_buy_info.value = false @@ -671,9 +687,13 @@ } }) } + let ResKeShilist=ref([]); const getItemGetList = async () => { - const response = await axios.post($api("ItemGetList")); + const response = await axios.post($api("ItemGetList"),{ + appointment: search_appointment.value, + }); window.$response(response.data, () => { + ResKeShilist.value = response.data.data.keshi_list; let il_map = response.data.data.list; let il = []; for (let i in il_map) { @@ -1078,6 +1098,7 @@ return { elZh, + getItemGetList, handleSubmit, PlanDateChange, isEnglishOnly, @@ -1113,7 +1134,9 @@ select_table_computed, item_table_ref, item_list, + ResKeShilist, search_input, + search_appointment, select_data, input_data, button_config,