项目互斥

main
yanzai 1 month ago
parent d39fcab0d5
commit cc102ff09d

@ -98,6 +98,7 @@ class ComboItemController extends Controller
'clinic' => $item['科室Id'],
'clinic_name' => $item['科室名称'],
'choose' => $item['可选'],
'beizhu'=> $item['备注']
];
}
return $list;
@ -227,6 +228,7 @@ class ComboItemController extends Controller
$price = 0;
$original_price = 0;
$combo_info = false;
$shuxing=[];//项目属性,用来判断互斥
if (!!$combo) {
$combo_info = self::combo_info($hospital, [
'套餐Id' => $combo,
@ -273,7 +275,7 @@ class ComboItemController extends Controller
]);
}
$item_list_ret = [];
$has_huchi=false;
//如果是团检并且选择了自选
$fenzu=false;
if(!!$group and count($items) != 0){
@ -285,6 +287,17 @@ class ComboItemController extends Controller
}
foreach ($items_list as $item) {
if($item['beizhu']<>'' and $item['beizhu']<>null and json_decode($item['beizhu'],true) ) {
$beizhu=json_decode($item['beizhu'], true);
$item_fenlei=$beizhu['分类'];
if(!in_array($item_fenlei, $shuxing)){
$shuxing[]=$item_fenlei;
}else{
$has_huchi=true;
continue;
}
}
$count++;
if($fenzu !==false and isset($fenzu['分组'])){
$item['price']=$item['price']*$fenzu['分组'][0]['增项折扣'];
@ -351,6 +364,7 @@ class ComboItemController extends Controller
'id' => 0,
'date' => date('Y-m-d'),
],
'has_huchi'=>$has_huchi
]);
}

@ -2,7 +2,7 @@ let url_ = "https://bjgk-api.sixinyun.com";
let report_url_ = "https://bjgk-api.sixinyun.com";
//let report_url_ = "http://192.168.31.106:5173";
let h5_url_ = "https://bjgk-api.sixinyun.com";
const dev =0;
const dev =1;
if (dev === 1) {
url_ = "http://beijingguokang";
report_url_ = "http://192.168.31.106:5173";

@ -4,7 +4,7 @@ import {
import $api from './api.js'
let url_ = "https://bjgk-api.sixinyun.com";
let chat_url = "https://bjgk-api.sixinyun.com"
const dev = 0
const dev = 1
if (dev === 1) {
url_ = "http://beijingguokang"
chat_url = "http://192.168.31.106:5173"

@ -26,6 +26,11 @@
const response = await BuyInfoAction($store.buy_info)
$response(response, () => {
buy_info.value = response.data
if(buy_info.value.has_huchi){
uni.$lu.toast("该项目与已有项目互斥,禁止勾选")
$store.buy_info.items.splice($store.buy_info.items.length-1, 1)
console.log($store.buy_info.items);
}
if (items) BuyItems()
})
}

@ -2,7 +2,7 @@ import {
$post
} from '@/lu/axios.js'
let url_ = "https://bjgk-api.sixinyun.com";
const dev = 1
const dev = 0
if (dev === 1) {
url_ = "http://beijingguokang"
}

Loading…
Cancel
Save