团检号源 绑定 单位

main
yanzai 8 months ago
parent ab2b5f591f
commit f520b31d4d

@ -94,6 +94,7 @@ class PlanController extends Controller
'week' => $dayOfWeek,
'time' => $time->time,
'type' => $time->type,
'bind_work_unit_id' => empty($planType)?null:$planType->bind_units,
'plan_number' => substr($cleanTime, 0, 4),
'is_vip' => empty($planType)?null: $planType->is_vip,
'use_type' => empty($planType)?null:$planType->use_type,

@ -17,6 +17,7 @@ class PlanTypeController extends Controller
'use_type' => isset($Info['use_type']) ? $Info['use_type'] : null,
'sex' => isset($Info['sex']) ? $Info['sex'] : null,
'checkup_type_id' => isset($Info['checkup_type_id']) ? json_encode($Info['checkup_type_id']) : null,
'bind_units' => isset($Info['bind_units']) ? json_encode($Info['bind_units']) : null,
'amount_limit1' => isset($Info['amount_limit1']) ? $Info['amount_limit1'] : 0,
'amount_limit2' => isset($Info['amount_limit2']) ? $Info['amount_limit2'] : 0,
'status'=>isset($Info['status']) ? $Info['status'] : 0,
@ -29,6 +30,7 @@ class PlanTypeController extends Controller
return \Yz::echoError1('参数 ' . $field . ' 不能为空');
}
}
$do=false;
$table=DB::table('plan_type');
if($Info['id']==0){
@ -83,6 +85,7 @@ class PlanTypeController extends Controller
$info=DB::table('plan_type')->where(['id'=>$id,'is_del'=>0])->first();
if(!!$info){
$info->checkup_type_id=json_decode($info->checkup_type_id,true);
$info->bind_units=json_decode($info->bind_units,true);
return \Yz::Return(true,'查询完成',$info);
}else{
return \Yz::echoError1('查询失败');

@ -0,0 +1,17 @@
<?php
namespace App\Http\Controllers\API\Admin\YeWu;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
class WorkUnitController extends Controller
{
//获取可用单位列表
public function GetEnableList()
{
$list=DB::table('work_units')->where(['status'=>1,'is_del'=>0])->get();
return \Yz::Return(true,'查询成功',['list'=>$list]);
}
}

@ -97,6 +97,7 @@ class PersonController extends Controller
'combo_id' => $group_info['套餐Id'],
'start_time' => $group_info['预约开始日期'],
'end_time' => $group_info['预约结束日期'],
'danwei_name' => $group_info['单位名称'],
'group_name' => $group_info['单位名称'] . ($group_info['部门名称']),
'bumen_name' => $group_info['部门名称'],
'group_id' => $group_info['预约Id'],

@ -20,6 +20,10 @@ class PlanController extends Controller
$checkup_type_id=request('checkup_type_id');//体检类型表对应id
$amount=request('amount');//总金额
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id=request('danwei_id');//单位id
$first_day_timestamp = strtotime($month . '-01');
$first_day = date('Y-m-d', $first_day_timestamp); //当月第一天
$last_day_timestamp = strtotime($month . '-01 +1 month -1 day');
@ -31,7 +35,18 @@ class PlanController extends Controller
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [json_encode($checkup_type_id)])
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]);
->whereIn('use_type',[0,$use_type])
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
// 如果 $danwei_id 不为空,则添加额外的条件
if (!empty($danwei_id)) {
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
}
});
if(isset($person_id)){
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
if(!!$personInfo){
@ -108,6 +123,9 @@ class PlanController extends Controller
$checkup_type_id=(string)request('checkup_type_id');//体检类型表对应id
$amount=request('amount');//总金额
if(!isset($checkup_type_id)) return \Yz::echoError1("体检类型不能为空");
$danwei_id=request('danwei_id');//单位名称
$personInfo=false;
if(isset($person_id)){
$personInfo=DB::table('web_user_person')->where(['id'=>$person_id])->first();
@ -119,7 +137,20 @@ class PlanController extends Controller
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")',[$checkup_type_id])
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]);
->whereIn('use_type',[0,$use_type])
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
// 如果 $danwei_id 不为空,则添加额外的条件
if (!empty($danwei_id)) {
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
}
});
$comboItemsNmr=[];
if(!!$combo_id){
$comboInfo=DB::table('combos')->where(['combo_id'=>$combo_id])->first();
@ -184,7 +215,20 @@ class PlanController extends Controller
->whereRaw('JSON_CONTAINS(checkup_type_id, ?, "$")', [$checkup_type_id])
->where(['hospital_id'=>$hospital_id,'type'=>1,'is_del'=>0])
->where('is_vip','<>',1)
->whereIn('use_type',[0,$use_type]);
->whereIn('use_type',[0,$use_type])
->where(function ($query) use ($danwei_id) {
// 检查 bind_work_unit_id 为 NULL 或空字符串
$query->whereNull('bind_work_unit_id')
->orWhere('bind_work_unit_id', '=', '');
// 如果 $danwei_id 不为空,则添加额外的条件
if (!empty($danwei_id)) {
$query->orWhereRaw('JSON_CONTAINS(bind_work_unit_id, ?)', [json_encode($danwei_id)]);
}
});
if(count($comboItemsNmr)>0 or count($ItemsNmr)>0 or !empty($er_xian_info)){
//如果有核磁项目11点往后的号源不可用
$weeklist=$weeklist->where('time','<=','11:00');

@ -1,8 +0,0 @@
location / {
# root html;
index index.php index.html index.htm;
try_files $uri $uri/ /index.php$is_args$query_string;
}

@ -137,6 +137,7 @@ Route::group(['middleware' => ['checktoken', 'log'], 'prefix' => 'v1'], function
Route::post('admin/CouponsGetDetail', 'App\Http\Controllers\API\Admin\YeWu\CouponsController@GetDetail');
Route::post('admin/QuestionExport', 'App\Http\Controllers\API\Admin\YeWu\QuestionLogController@Export');//导出回答
Route::post('admin/GetWorkUnitEnableList', 'App\Http\Controllers\API\Admin\YeWu\WorkUnitController@GetEnableList');//获取单位列表

@ -444,4 +444,8 @@ export const QuestionExport = (data = {}) => {
//套餐保存排序
export const ComboSaveOrder = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + `v1/admin/ComboSaveOrder`, data: data })
}
//获取单位可用列表
export const GetWorkUnitEnableList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + `v1/admin/GetWorkUnitEnableList`, data: data })
}

@ -88,6 +88,13 @@
<el-option label="团检" :value="2" />
</el-select>
</el-form-item>
<el-form-item label="绑定单位" v-if=" Info.use_type===2" >
<el-select :filterable="true" clearable v-model="Info.bind_units" multiple
placeholder="如需绑定,请选择" >
<el-option v-for="(item,index) in EnableWorkUnitsList" :key="index" :value="item.unit_id" :label="item.name"/>
</el-select>
</el-form-item>
<el-form-item label="性别">
<el-select :filterable="true" clearable v-model="Info.sex" placeholder="选择性别"
>
@ -146,7 +153,8 @@
CheckUpTypeGetEnableList,
PlanTypeSave,
PlanTypeGetDetail,
PlanTypeDel
PlanTypeDel,
GetWorkUnitEnableList
} from '@/api/api.js'
let loading = ref(false)
let searchInfo = ref({})
@ -246,9 +254,24 @@
}
})
}
let EnableWorkUnitsList=ref([]);
const GetWorkUnitEnableListFunc=()=>{
loading.value = true
GetWorkUnitEnableList({
}).then(res => {
loading.value = false
if (res.status) {
EnableWorkUnitsList.value=res.data.list
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
GetList()
GetCheckUpTypeEnableList_Func()
GetWorkUnitEnableListFunc()
})
</script>

@ -326,7 +326,7 @@
</view>
</view>
</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">03281011</view>
<view class="botm_blank_wrapper" style="font-size: 18rpx;color: #ccc;">04042207</view>
</view>
</view>
</template>

@ -160,7 +160,8 @@
amount: amount.value,
combo_id:combo_id.value,
item_ids:item_ids.value,
er_xian_info:er_xian_info.value
er_xian_info:er_xian_info.value,
danwei_id:(use_type.value==2 && $store.getGroupInfo()?.danwei_id)?$store.getGroupInfo()?.danwei_id:null
}
const response = await $api("GetDayPlanList", data);
uni.hideLoading();
@ -354,6 +355,7 @@
use_type: use_type.value,
checkup_type_id: checkup_type_id.value,
amount: amount.value,
danwei_id:(use_type.value==2 && $store.getGroupInfo()?.danwei_id)?$store.getGroupInfo()?.danwei_id:null
}
const response = await $api("GetMonthPlanCount", data);
uni.hideLoading();

Loading…
Cancel
Save