更新 检前问卷 套餐拆分成 自选项目。 隐藏材料费前置工作。

main
鹿和sa0ChunLuyu 1 year ago
parent 318a89aeea
commit 8919451085

@ -113,17 +113,41 @@ class QuestionnairesLogsController extends Controller
'jichu' => self::sum_items($items, $check_items_array['jichu']), 'jichu' => self::sum_items($items, $check_items_array['jichu']),
'tuijian' => self::sum_items($items, $check_items_array['tuijian']), 'tuijian' => self::sum_items($items, $check_items_array['tuijian']),
'gaoduan' => self::sum_items($items, $check_items_array['gaoduan']), 'gaoduan' => self::sum_items($items, $check_items_array['gaoduan']),
],
'count' => [
'jichu' => self::item_count($items, $check_items_array['jichu']),
'tuijian' => self::item_count($items, $check_items_array['tuijian']),
'gaoduan' => self::item_count($items, $check_items_array['gaoduan']),
] ]
]); ]);
} }
public function item_count($items, $check_items)
{
$ic = count($items) + count($check_items['items']) + count($check_items['combo_items']);
return $ic;
}
public function sum_items($items, $check_items) public function sum_items($items, $check_items)
{ {
$sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price'); if (count($items)) {
$check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price'); $sum = DB::table('items')->whereIn('item_id', $items)->where('status', 1)->sum('price');
$combo = DB::table('combos')->whereIn('combo_id', [$check_items['combo']])->where('status', 1)->sum('price'); } else {
$sum = 0;
}
if (count($check_items['items'])) {
$check_sum = DB::table('items')->whereIn('item_id', $check_items['items'])->where('status', 1)->sum('price');
} else {
$check_sum = 0;
}
if (count($check_items['combo_items'])) {
$combo = DB::table('items')->whereIn('item_id', $check_items['combo_items'])->where('status', 1)->sum('price');
} else {
$combo = 0;
}
$zhekou = config('app.globals.Wj_ZheKou'); $zhekou = config('app.globals.Wj_ZheKou');
return number_format($combo + (($sum + $check_sum) * $zhekou), 2, '.', ''); return number_format((($combo + $sum + $check_sum) * $zhekou), 2, '.', '');
} }
public function submit(Request $request) public function submit(Request $request)
{ {

@ -77,15 +77,15 @@
const id = question_info.value.check_items_array[type].combo const id = question_info.value.check_items_array[type].combo
const mergedArray = [...new Set([ const mergedArray = [...new Set([
...question_info.value.items, ...question_info.value.items,
...question_info.value.check_items_array[type].items ...question_info.value.check_items_array[type].items,
...question_info.value.check_items_array[type].combo_items,
])] ])]
let query = "?comboId=" + id + '&wj=1';
if (mergedArray.length !== 0) { if (mergedArray.length !== 0) {
query += "&itemIds=" + mergedArray.join(','); let query = "?wj=1&itemIds=" + mergedArray.join(',');
uni.navigateTo({
url: "/pages/main/tj/tjxq" + query,
});
} }
uni.navigateTo({
url: "/pages/main/tj/tjxq" + query,
});
} }
onShow(() => { onShow(() => {
@ -108,10 +108,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">基础推荐方案</view> <view class="items_title_text_wrapper">基础推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.jichu }}</text>
+ question_info.check_items_array.jichu.combo_items.length
+ question_info.check_items_array.jichu.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="20"></uni-icons> <uni-icons type="right" size="20"></uni-icons>
</view> </view>
@ -131,10 +128,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">中等推荐方案</view> <view class="items_title_text_wrapper">中等推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.tuijian }}</text>
+ question_info.check_items_array.tuijian.combo_items.length
+ question_info.check_items_array.tuijian.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="20"></uni-icons> <uni-icons type="right" size="20"></uni-icons>
</view> </view>
@ -154,10 +148,7 @@
<view class="items_title_wrapper"> <view class="items_title_wrapper">
<view class="items_title_text_wrapper">高端推荐方案</view> <view class="items_title_text_wrapper">高端推荐方案</view>
<view class="items_title_count_wrapper"> <view class="items_title_count_wrapper">
<text>{{ question_info.items.length <text>{{ question_info.count.gaoduan }}</text>
+ question_info.check_items_array.gaoduan.combo_items.length
+ question_info.check_items_array.gaoduan.items.length
}}</text>
<view class="count_icon_wrapper"> <view class="count_icon_wrapper">
<uni-icons type="right" size="16"></uni-icons> <uni-icons type="right" size="16"></uni-icons>
</view> </view>

Loading…
Cancel
Save