鹿和sa0ChunLuyu 3 weeks ago
parent e58c66e13c
commit f22ad70702

@ -30,6 +30,15 @@ public function GetEnableList(Request $request)
$service = new DepartmentService(); $service = new DepartmentService();
return $service->GetEnableList(['userid'=>$userid,'group'=>$group],$is_all); return $service->GetEnableList(['userid'=>$userid,'group'=>$group],$is_all);
} }
//获取筛选后的可用科室列表(仅显示存在执行诊室的科室)
public function GetFilteredEnableList(Request $request)
{
$userid = $request->get('userid');
$group = $request->get('role');
$is_all = $request->get('is_all') ?? false;
$service = new DepartmentService();
return $service->GetFilteredEnableList(['userid' => $userid, 'group' => $group], $is_all);
}
//保存科室信息 //保存科室信息
public function Save() public function Save()

@ -667,4 +667,83 @@ public function SaveLockedCount(Request $request)
return \Yz::echoError1('保存失败:' . $e->getMessage()); return \Yz::echoError1('保存失败:' . $e->getMessage());
} }
} }
// ===== 管理员接口(接受 department_id 参数,不依赖用户绑定科室) =====
//管理员生成计划明细
public function CreateAdmin(Request $request, RosterService $rosterService)
{
$userid = $request->get('userid');
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$dateRange = request('dateRange');
$planModelIds = request('ids');
$HolidayEnable = request('HolidayEnable');
$date_type = request('date_type');
try {
$result = $rosterService->generatePlans(
$dateRange,
$planModelIds,
$userid,
$date_type,
$HolidayEnable
);
return \Yz::Return(true, '执行完成,共计生成计划 ' . $result['count'] . ' 条', $result);
} catch (\Exception $e) {
return \Yz::echoError1($e->getMessage());
}
}
//管理员修改计划详情
public function ChangeInfoAdmin(Request $request)
{
$userid = $request->get('userid');
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$PlanDetaiInfo = request('PlanDetaiInfo');
$check = DB::table('s_source_roster_detail')->where(['id' => $PlanDetaiInfo['id']])
->where('department_id', $department_id)
->where('is_del', 0)
->first();
if (!$check) return \Yz::echoError1('没有权限');
$u1 = DB::table('s_source_roster_detail')->where(['id' => $PlanDetaiInfo['id']])->update([
'status' => $PlanDetaiInfo['status']
]);
$i = 0;
foreach ($PlanDetaiInfo['coutsInfo'] as $key => $value) {
$u2 = DB::table('s_source_roster_detail_count')->where(['id' => $value['id']])->update([
'count' => $value['count']==null?0:$value['count'],
'max_total' => $value['max_total'],
]);
if ($u2) $i++;
}
if ($u1 or $i > 0) {
return \Yz::Return(true, '保存成功', []);
} else {
return \Yz::echoError1('没有数据更新');
}
}
//管理员删除计划明细
public function DelAdmin(Request $request)
{
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$ids = request('ids');
$u1 = DB::table('s_source_roster_detail')->where(['department_id' => $department_id])->whereIn('id', $ids)->update([
'is_del' => 1
]);
if ($u1) {
return \Yz::Return(true, '删除成功', []);
} else {
return \Yz::echoError1('删除失败');
}
}
} }

@ -504,4 +504,207 @@ public function SaveLockedCount(Request $request)
return \Yz::echoError1('保存失败:' . $e->getMessage()); return \Yz::echoError1('保存失败:' . $e->getMessage());
} }
} }
// ===== 管理员接口(接受 department_id 参数,不依赖用户绑定科室) =====
//管理员保存计划模板
public function SaveAdmin(Request $request)
{
$userid = $request->get('userid');
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$date_type = request('date_type');
$planInfo = request('planInfo');
$bitian = array('max_total', 'qudao_total', 'period_id', 'begin_time', 'end_time', 'end_reservation_time', 'resources_id', 'devices', 'patientType');
$bitian_zh = array('当日总量', '渠道数量', '时间段', '开始时间', '结束时间', '停止预约时间', '资源', '设备', '患者类型');
if($date_type==1){
$bitian[]='xingqi';
$bitian_zh[]='星期';
}
foreach ($bitian as $key => $field) {
if (array_key_exists($field, $planInfo) && $planInfo[$field] !== '' && $planInfo[$field] !== null && $planInfo[$field] !== [] && $planInfo[$field] !== 0) {
} else {
return \Yz::echoError1($bitian_zh[$key] . ' 不能为空');
}
}
if($planInfo['end_reservation_time']>$planInfo['end_time']) return \Yz::echoError1('停止预约时间不能超过结束时间');
$type=isset($planInfo['type']) ?$planInfo['type']:0;
$resourceInfo=DB::table('s_department_resources')->where(['id' => $planInfo['resources_id']])->first();
if($resourceInfo->time_mode==1 and $type==0){
return \Yz::echoError1('请选择时令');
}
if($resourceInfo->time_mode==0 and $type != 0){
return \Yz::echoError1('时令配置异常,请刷新页面重试');
}
DB::beginTransaction();
$data = [
'type'=>$type,
'department_id' => $department_id,
'weekname' => '',
'resources_id' => $planInfo['resources_id'],
'device_id' => isset($planInfo['devices']) ? implode(',', $planInfo['devices']) : '',
'period_id' => $planInfo['period_id'],
'patient_type' => isset($planInfo['patientType']) ? implode(',', $planInfo['patientType']) : '',
'begin_time' => $planInfo['begin_time'],
'end_time' => $planInfo['end_time'],
'end_reservation_time' => $planInfo['end_reservation_time'],
'time_unit' => $planInfo['time_unit'],
'status' => $planInfo['status'],
'adduser' => $userid,
'date_type' => $date_type,
];
$param=[
'type'=>$type,
'department_id' => $department_id,
'resources_id' => $planInfo['resources_id'],
'is_del' => 0,
'date_type' => $date_type,
];
if($date_type==1){
foreach ($planInfo['xingqi'] as $key => $value) {
$data['weekname'] = $value;
$param['weekname'] = $value;
$check=$this->Check($planInfo,$param,$value);
if(!$check['status']){
DB::rollBack();
return \Yz::echoError1($check['msg']);
}
if ($planInfo['id'] == 0) {
$roster_id = DB::table('s_source_roster')->insertGetId($data);
if ($roster_id) {
foreach ($planInfo['qudao_total'] as $k => $v) {
$i_c = DB::table('s_source_roster_count')->insert([
'roster_id' => $roster_id,
'appointment_type_id' => $v['id'],
'max_total' => $planInfo['max_total'],
'count' => $v['count'],
]);
if (!$i_c) {
DB::rollBack();
return \Yz::echoError1('保存失败');
}
}
} else {
DB::rollBack();
return \Yz::echoError1('保存失败');
}
}
}
}elseif ($date_type==2){
$check=$this->Check($planInfo,$param,"当前选定的");
if(!$check['status']){
DB::rollBack();
return \Yz::echoError1($check['msg']);
}
if ($planInfo['id'] == 0) {
$roster_id = DB::table('s_source_roster')->insertGetId($data);
if ($roster_id) {
foreach ($planInfo['qudao_total'] as $k => $v) {
$i_c = DB::table('s_source_roster_count')->insert([
'roster_id' => $roster_id,
'appointment_type_id' => $v['id'],
'max_total' => $planInfo['max_total'],
'count' => $v['count'],
]);
if (!$i_c) {
DB::rollBack();
return \Yz::echoError1('保存失败');
}
}
} else {
DB::rollBack();
return \Yz::echoError1('保存失败');
}
}
}
if($planInfo['id'] > 0) {
$data['id'] = $planInfo['id'];
$i = DB::table('s_source_roster')->where(['id' => $planInfo['id'], 'is_del' => 0])->update($data);
foreach ($planInfo['qudao_total'] as $k => $v) {
$i_c = DB::table('s_source_roster_count')->where(['roster_id' => $planInfo['id'], 'appointment_type_id' => $v['appointment_type_id']])->update([
'max_total' => $planInfo['max_total'],
'count' => $v['count'],
]);
}
if ($i or $i_c) {
} else {
DB::rollBack();
return \Yz::echoError1('保存失败');
}
}
DB::commit();
return \Yz::Return(true, '保存成功', []);
}
//管理员删除计划模板
public function DelAdmin(Request $request)
{
$ids = request('ids');
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$d = DB::table('s_source_roster')
->where(['department_id' => $department_id])->whereIn('id', $ids)->update([
'is_del' => 1,
]);
if ($d) {
return \Yz::Return(true, '操作成功', []);
} else {
return \Yz::echoError1('操作失败');
}
}
//管理员获取预约类型比例
public function GetAppointmentRatioAdmin(Request $request)
{
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$appointment_type = DB::table('s_appointment_type')->where(['status' => 1, 'is_del' => 0])->get();
$ratio = DB::table('s_appointment_type_ratio')
->where(['department_id' => $department_id])->get();
foreach ($appointment_type as $key => $value) {
$appointment_type[$key]->ratio = 0;
foreach ($ratio as $k => $v) {
if ($value->id == $v->appointment_type_id) {
$appointment_type[$key]->ratio = $v->ratio;
$appointment_type[$key]->link = json_decode($v->link,true);
}
}
}
return \Yz::Return(true, '操作成功', $appointment_type);
}
//管理员保存预约类型比例
public function SaveAppointmentRatioAdmin(Request $request)
{
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$ratioInfo = request('ratioInfo');
$u = false;
DB::table('s_appointment_type_ratio')->where(['department_id' => $department_id])->delete();
foreach ($ratioInfo as $key => $value) {
$u = DB::table('s_appointment_type_ratio')->insert([
'department_id' => $department_id,
'appointment_type_id' => $value['id'],
'ratio' => $value['ratio'],
'link'=>isset($value['link'])?json_encode($value['link'],JSON_UNESCAPED_UNICODE):null,
]);
}
if ($u) {
return \Yz::Return(true, '操作成功', []);
} else {
return \Yz::echoError1('保存失败,无数据更新');
}
}
} }

@ -120,4 +120,25 @@ public function Del(Request $request)
return \Yz::echoError1('操作失败'); return \Yz::echoError1('操作失败');
} }
} }
// ===== 管理员接口(接受 department_id 参数,不依赖用户绑定科室) =====
public function GetEnableListAdmin(Request $request)
{
$department_id = request('department_id');
if (!$department_id) {
return \Yz::echoError1('科室信息不存在');
}
$date_type = request('date_type');
$list = DB::table('s_period');
if (isset($date_type)) {
$list = $list->where('date_type', $date_type);
}
$list = $list->where(['department_id' => $department_id, 'period_status' => 1, 'is_del' => 0])->get();
if (count($list) > 0) {
return \Yz::Return(true, '操作成功', $list);
} else {
return \Yz::echoError1('无可用时间段');
}
}
} }

@ -74,6 +74,34 @@ public function GetEnableList($arr,$is_all=false)
$list= $list->where(['is_del'=>0,'department_status'=>1])->get(); $list= $list->where(['is_del'=>0,'department_status'=>1])->get();
return \Yz::Return(true, '查询成功', ['list'=>$list]); return \Yz::Return(true, '查询成功', ['list'=>$list]);
} }
// 获取筛选后的可用科室列表(仅显示存在执行诊室的科室)
public function GetFilteredEnableList($arr, $is_all = false)
{
$list = DB::table('s_department');
if (!in_array($arr['group'], [1, 5]) && $is_all === false) {
$userInfo = DB::table('users')->where(['id' => $arr['userid']])->first();
if ($userInfo) {
$deptIds = [];
if (!empty($userInfo->department_ids)) {
$deptIds = explode(",", $userInfo->department_ids);
} elseif ($userInfo->department_id) {
$deptIds = [$userInfo->department_id];
}
if (count($deptIds) > 0) {
$list = $list->whereIn('id', $deptIds);
}
}
}
// 基础过滤:启用、未删除
$list = $list->where(['is_del' => 0, 'department_status' => 1]);
// 只显示执行科室(在 s_department_resources 表中有记录的科室)
$hasResourceDeptIds = DB::table('s_department_resources')
->where('is_del', 0)
->distinct()
->pluck('department_id');
$list = $list->whereIn('id', $hasResourceDeptIds);
return \Yz::Return(true, '查询成功', ['list' => $list->get()]);
}
public function Save($info) public function Save($info)
{ {
if(isset($info['id'])){ if(isset($info['id'])){

@ -76,6 +76,7 @@
Route::post('admin/SaveDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Save');//保存科室信息 Route::post('admin/SaveDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Save');//保存科室信息
Route::post('admin/DelDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Del');//删除科室信息 Route::post('admin/DelDepartment','App\Http\Controllers\API\Admin\YeWu\DepartmentController@Del');//删除科室信息
Route::post('admin/GetEnableDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetEnableList');//获取启用的科室列表 Route::post('admin/GetEnableDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetEnableList');//获取启用的科室列表
Route::post('admin/GetFilteredDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetFilteredEnableList');//获取筛选后的科室列表(仅显示存在执行诊室的科室)
Route::post('admin/GetDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetChildren');//获取科室已关联的子科室列表 Route::post('admin/GetDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetChildren');//获取科室已关联的子科室列表
Route::post('admin/GetLeafDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetLeafList');//获取可作为诊室的叶子节点科室列表 Route::post('admin/GetLeafDepartmentList','App\Http\Controllers\API\Admin\YeWu\DepartmentController@GetLeafList');//获取可作为诊室的叶子节点科室列表
Route::post('admin/SaveDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@SaveChildren');//保存科室关联诊室关系 Route::post('admin/SaveDepartmentChildren','App\Http\Controllers\API\Admin\YeWu\DepartmentController@SaveChildren');//保存科室关联诊室关系
@ -97,6 +98,15 @@
Route::post('admin/PlanModelDel','App\Http\Controllers\API\Admin\YeWu\PlanModelController@Del');//删除计划模板 Route::post('admin/PlanModelDel','App\Http\Controllers\API\Admin\YeWu\PlanModelController@Del');//删除计划模板
Route::post('admin/SaveAppointmentRatio','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveAppointmentRatio');//保存渠道比例 Route::post('admin/SaveAppointmentRatio','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveAppointmentRatio');//保存渠道比例
Route::post('admin/SavePlanModelLockedCount','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveLockedCount');//保存模板占位数量 Route::post('admin/SavePlanModelLockedCount','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveLockedCount');//保存模板占位数量
// ===== 管理员接口(接受 department_id 参数) =====
Route::post('admin/PlanModelSaveAdmin','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveAdmin');//管理员保存计划模板
Route::post('admin/PlanModelDelAdmin','App\Http\Controllers\API\Admin\YeWu\PlanModelController@DelAdmin');//管理员删除计划模板
Route::post('admin/GetAppointmentRatioAdmin','App\Http\Controllers\API\Admin\YeWu\PlanModelController@GetAppointmentRatioAdmin');//管理员获取预约类型比例
Route::post('admin/SaveAppointmentRatioAdmin','App\Http\Controllers\API\Admin\YeWu\PlanModelController@SaveAppointmentRatioAdmin');//管理员保存渠道比例
Route::post('admin/CreatePlanListAdmin','App\Http\Controllers\API\Admin\YeWu\PlanListController@CreateAdmin');//管理员生成计划明细
Route::post('admin/PlanDetailChangeInfoAdmin','App\Http\Controllers\API\Admin\YeWu\PlanListController@ChangeInfoAdmin');//管理员修改计划详情
Route::post('admin/PlanListDelAdmin','App\Http\Controllers\API\Admin\YeWu\PlanListController@DelAdmin');//管理员删除计划明细
Route::post('admin/TimePeriodGetEnableListAdmin','App\Http\Controllers\API\Admin\YeWu\TimePeriodController@GetEnableListAdmin');//管理员获取可用时间段
Route::post('admin/CreatePlanList','App\Http\Controllers\API\Admin\YeWu\PlanListController@Create');//生成计划明细 Route::post('admin/CreatePlanList','App\Http\Controllers\API\Admin\YeWu\PlanListController@Create');//生成计划明细
Route::post('admin/PlanListGetList','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetList');//生成计划明细 Route::post('admin/PlanListGetList','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetList');//生成计划明细
Route::post('admin/PlanListGetDetail','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetDetail');//计划详情 Route::post('admin/PlanListGetDetail','App\Http\Controllers\API\Admin\YeWu\PlanListController@GetDetail');//计划详情

@ -209,6 +209,10 @@ export const SaveDepartment = (data = {}) => {
export const GetEnableDepartmentList = (data = {}) => { export const GetEnableDepartmentList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetEnableDepartmentList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetEnableDepartmentList', data: data })
} }
//admin获取筛选后的科室列表仅显示存在执行诊室的科室
export const GetFilteredDepartmentList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetFilteredDepartmentList', data: data })
}
//admin获取科室已关联的子科室ID列表 //admin获取科室已关联的子科室ID列表
export const GetDepartmentChildren = (data = {}) => { export const GetDepartmentChildren = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetDepartmentChildren', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetDepartmentChildren', data: data })
@ -264,6 +268,10 @@ export const TimePeriodGetList = (data = {}) => {
export const TimePeriodGetEnableList = (data = {}) => { export const TimePeriodGetEnableList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/TimePeriodGetEnableList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/TimePeriodGetEnableList', data: data })
} }
//admin获取可用时间段管理员接口
export const TimePeriodGetEnableListAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/TimePeriodGetEnableListAdmin', data: data })
}
//admin获取时间段详情 //admin获取时间段详情
export const TimePeriodGetDetail = (data = {}) => { export const TimePeriodGetDetail = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/TimePeriodGetDetail', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/TimePeriodGetDetail', data: data })
@ -280,10 +288,18 @@ export const PlanModelGetList = (data = {}) => {
export const PlanModelSave = (data = {}) => { export const PlanModelSave = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelSave', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelSave', data: data })
} }
//admin保存资源计划模板管理员接口
export const PlanModelSaveAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelSaveAdmin', data: data })
}
//admin保存资源计划模板 //admin保存资源计划模板
export const GetAppointmentRatio = (data = {}) => { export const GetAppointmentRatio = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetAppointmentRatio', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetAppointmentRatio', data: data })
} }
//admin获取预约类型比例管理员接口
export const GetAppointmentRatioAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetAppointmentRatioAdmin', data: data })
}
//admin资源计划详情 //admin资源计划详情
export const GetPlanModelDetailInfo = (data = {}) => { export const GetPlanModelDetailInfo = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetPlanModelDetailInfo', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetPlanModelDetailInfo', data: data })
@ -292,14 +308,26 @@ export const GetPlanModelDetailInfo = (data = {}) => {
export const PlanModelDel = (data = {}) => { export const PlanModelDel = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelDel', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelDel', data: data })
} }
//admin删除计划模板管理员接口
export const PlanModelDelAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanModelDelAdmin', data: data })
}
//admin保存预约类型渠道比例 //admin保存预约类型渠道比例
export const SaveAppointmentRatio = (data = {}) => { export const SaveAppointmentRatio = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/SaveAppointmentRatio', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/SaveAppointmentRatio', data: data })
} }
//admin保存预约类型比例管理员接口
export const SaveAppointmentRatioAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/SaveAppointmentRatioAdmin', data: data })
}
//admin生成计划明细 //admin生成计划明细
export const CreatePlanList = (data = {}) => { export const CreatePlanList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/CreatePlanList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/CreatePlanList', data: data })
} }
//admin生成计划明细管理员接口
export const CreatePlanListAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/CreatePlanListAdmin', data: data })
}
//admin获取计划明细列表 //admin获取计划明细列表
export const PlanListGetList = (data = {}) => { export const PlanListGetList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanListGetList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanListGetList', data: data })
@ -312,10 +340,18 @@ export const PlanListGetDetail = (data = {}) => {
export const PlanDetailChangeInfo = (data = {}) => { export const PlanDetailChangeInfo = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanDetailChangeInfo', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanDetailChangeInfo', data: data })
} }
//admin修改计划详情管理员接口
export const PlanDetailChangeInfoAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanDetailChangeInfoAdmin', data: data })
}
//admin删除计划明细 //admin删除计划明细
export const PlanDetailPlanListDel = (data = {}) => { export const PlanDetailPlanListDel = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanListDel', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanListDel', data: data })
} }
//admin删除计划明细管理员接口
export const PlanDetailPlanListDelAdmin = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/PlanListDelAdmin', data: data })
}
//admin获取主表列表 //admin获取主表列表
export const GetMainList = (data = {}) => { export const GetMainList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetMainList', data: data }) return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/GetMainList', data: data })

@ -194,6 +194,20 @@ const router = createRouter({
meta: { meta: {
title: '预约资源明细' title: '预约资源明细'
} }
},{
path: '/appointmentmngr/planmodeladmin',
name: 'AppointmentMngrPlanModelAdmin',
component: () => import('../views/AppointmentMngr/PlanModelAdmin.vue'),
meta: {
title: '号源计划管理'
}
},{
path: '/appointmentmngr/planlistadmin',
name: 'AppointmentMngrPlanListAdmin',
component: () => import('../views/AppointmentMngr/PlanListAdmin.vue'),
meta: {
title: '号源明细管理'
}
},{ },{
path: '/appointmentmngr/holidayMngr', path: '/appointmentmngr/holidayMngr',
name: 'AppointmentMngrHolidayMngr', name: 'AppointmentMngrHolidayMngr',

@ -38,9 +38,11 @@
</el-select> </el-select>
</el-form-item> --> </el-form-item> -->
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
value-format="YYYY-MM-DD" /> <span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-button @click="GetList()" style="margin-left: 10px;">搜索</el-button> <el-button @click="GetList()" style="margin-left: 10px;">搜索</el-button>
<el-button type="danger" @click="Del()" style="margin-left: 10px;">删除</el-button> <el-button type="danger" @click="Del()" style="margin-left: 10px;">删除</el-button>
@ -561,6 +563,7 @@
for (let i = 0; i < qudao_count; i++) { for (let i = 0; i < qudao_count; i++) {
if (PlanDetaiInfo.value.coutsInfo[i].ratio === 0) continue if (PlanDetaiInfo.value.coutsInfo[i].ratio === 0) continue
PlanDetaiInfo.value.coutsInfo[i].max_total = PlanDetaiInfo.value.max_total
PlanDetaiInfo.value.coutsInfo[i].count = Math.round(PlanDetaiInfo.value.max_total * (PlanDetaiInfo.value PlanDetaiInfo.value.coutsInfo[i].count = Math.round(PlanDetaiInfo.value.max_total * (PlanDetaiInfo.value
.coutsInfo[i].ratio / 100)) .coutsInfo[i].ratio / 100))
temp = temp + PlanDetaiInfo.value.coutsInfo[i].count temp = temp + PlanDetaiInfo.value.coutsInfo[i].count

@ -0,0 +1,988 @@
<template>
<div>
<div class="head">
<el-row>
<el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.department_id" placeholder="选择科室"
@change="DepartmentChange" style="margin-left: 8px;width: 150px;">
<el-option v-for="(item,index) in EnableDepartmentList" :key="index"
:label="item.department_name" :value="item.id" />
</el-select>
</el-form-item>
<!-- <el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.resources_id" placeholder="选择资源"
style="margin-left: 8px;width: 150px;">
<el-option v-for="(item,index) in enableResourceList" :key="index"
:label="item.department_resources_name" :value="item.id" />
</el-select>
</el-form-item> -->
<!-- <el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.device_id" placeholder="选择服务组"
style="margin-left: 8px;width: 150px;">
<el-option v-for="(item,index) in EnableDeviceList" :key="index" :label="item.device_name"
:value="item.id" />
</el-select>
</el-form-item>
<el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.xingqi" placeholder="星期"
style="margin-left: 8px;width: 150px;">
<el-option v-for="(item,index) in xingqi" :key="index" :label="item.label"
:value="item.label" />
</el-select>
</el-form-item>
<el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.status" placeholder="状态"
style="margin-left: 8px;width: 150px;">
<el-option label="正常" value="1" />
<el-option label="关闭" value="0" />
</el-select>
</el-form-item> -->
<el-form-item>
<el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
<span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item>
<el-button @click="GetList()" style="margin-left: 10px;">搜索</el-button>
<el-button type="danger" @click="Del()" style="margin-left: 10px;">删除</el-button>
</el-row>
</div>
<div style="display: flex;" class="planInfo">
<div style=" border-right: 1px solid #dadada;padding-right: 4px;">
<div v-for="(item,index) in enableResourceList" :key="index" @click="zhenshiClick(item.id)"
:class="{'zhenshiButton zhenshiButtonActive':item.id===ResourceActive,'zhenshiButton':item.id !==ResourceActive}">
{{item.department_resources_name}}
</div>
</div>
<div v-loading="loading" style="border: 1px solid #efefef;width: 100%; overflow-x: auto;">
<div style="text-align: right; padding: 8px; font-size: 12px; color: #999;">数据格式占位/已用/总数</div>
<table class="planTable" v-if="planTableData.length>0">
<tr style="background-color: #f1f1f1;position: relative;">
<td>
<div style="width: 120px;display: flex;font-size: 12px;justify-content: center;align-items: center;">
<div style="margin-left: 30px;margin-right: 6px;">全选</div>
<div :class="{'plan_checkAllbox plan_checkAllbox_active':PlanSelectedAll===1,'plan_checkAllbox ':PlanSelectedAll===0}"
@click="selectedAllPlanFunc()">
<el-icon v-if="PlanSelectedAll===1" color="#ffffff"><Select /></el-icon>
</div>
</div>
</td>
<td style="min-width: 120px;font-size: 14px;" v-for="(item,index) in date_list">{{item.substring(5,10)}} {{getWeekday(item)}}</td>
</tr>
<tr v-for="(item,index) in planTableData" :key="index">
<td v-for="(item2,index2) in item" :key="index2" @mouseover="showTools(item2.id)"
@mouseleave="hideTools(item2.id)">
<div>
<span v-if="index2=='time_range'">{{item2}}</span>
<div v-if="item2.countsInfo && item2.countsInfo.length>0"
:class="{'planInfo_k':item2.status==1,'planInfo_k planInfo_k_disabled':item2.status==0}">
<div v-if="hoverIndex==item2.id" class="hoverTools" >
<div class="icon_k" @click="getDetail(item2.id)">
<el-icon color="#409eff" size="20">
<Edit />
</el-icon>
</div>
<div class="icon_k" @click="GetMingXi(item2,0)">
<el-icon color="#409eff" size="20">
<Document />
</el-icon>
</div>
<div class="icon_k" @click="OpenZhanWeiDialog(item2)">
<el-icon color="#409eff" size="20">
<Lock />
</el-icon>
</div>
</div>
<div :class="{'plan_checkbox plan_checkbox_active':isSelected(item2.id),'plan_checkbox':!isSelected(item2.id)}"
@click="checkBoxCheckFunc(item2.id)">
<el-icon v-if="isSelected(item2.id)" color="#ffffff"><Select /></el-icon>
</div>
<div class="zong_row"><div class="qudao_title_zong"><span>总数:</span>{{item2.countsInfo[0].max_total}}</div></div>
<div class="qudao_count_row">
<template v-for="(item3,index3) in item2.countsInfo" :key="index3">
<div v-if="item3 && !(item3.count===0 && item3.used_count===0)">
<span> {{item3.jiancheng}}</span><span><span v-if="item3.locked_count" class="yellow bold-text">{{item3.locked_count}}</span><span v-if="item3.locked_count">/</span><span class="font_color">{{item3.used_count}}</span>/{{item3.count}} </span>
</div>
</template>
</div>
<div class="patient_type_row">
<div class="tps" v-for="(item3,index3) in item2.patient_type_label">
{{item3}}
</div>
</div>
</div>
</div>
</td>
</tr>
</table>
<div v-if="planTableData.length==0" style="width: 100%;background-color: #fff;">
<el-empty description="暂无号源" />
</div>
</div>
</div>
<!-- 弹窗修改框-->
<el-dialog v-model="PlanDetailDialogVisible" title="修改" width="40%">
<div v-loading="loading">
<el-form v-if="PlanDetaiInfo" label-width="100px" style="padding-right: 40px;">
<el-form-item label="日期:">
{{ PlanDetaiInfo.date }}
</el-form-item>
<el-form-item label="星期:">
{{ PlanDetaiInfo.weekname }}
</el-form-item>
<el-form-item label="科室:">
{{ PlanDetaiInfo.department_name }}
</el-form-item>
<el-form-item label="资源:" v-if="false">
{{ PlanDetaiInfo.resources_name }}
</el-form-item>
<el-form-item label="服务组:" v-if="false">
<el-tag v-for="(item,index) in PlanDetaiInfo.devices" :key="index"
:type="(item.status===1 && item.is_del===0)?'':'danger'" style="margin-left: 8px">
{{ item.device_name }}
</el-tag>
</el-form-item>
<el-form-item label="病人类型:">
<el-checkbox-group disabled v-model="PlanDetaiInfo.patientType">
<el-checkbox label="0">住院</el-checkbox>
<el-checkbox label="1">门诊</el-checkbox>
<el-checkbox label="2">急诊</el-checkbox>
<el-checkbox label="3">体检</el-checkbox>
</el-checkbox-group>
</el-form-item>
<el-form-item label="时间段:">
开始时间<span style="font-weight: 700;display: inline-block;margin-right: 8px">{{ PlanDetaiInfo.begin_time
}} </span> 结束时间<span
style="font-weight: 700;display: inline-block;margin-right: 8px">{{ PlanDetaiInfo.end_time }}
</span>
停止预约时间<span style="font-weight: 700">{{ PlanDetaiInfo.end_reservation_time }}</span>
</el-form-item>
<el-form-item label="渠道名额:" v-if="PlanDetaiInfo.coutsInfo">
<div style="margin-right: 16px">
<div>当日总量</div>
<div class="qudao_k_input">
<el-input @input="MaxCountChange" type="number" v-model="PlanDetaiInfo.max_total"
:min="1" placeholder="0" oninput="value=value.replace(/^0|[^0-9]/g, '')" />
</div>
<div style="font-size: 12px;color: #999">设置渠道比例可自动分配</div>
</div>
<div>
<div class="qudao_k" v-for="(item,index) in PlanDetaiInfo.coutsInfo" :key="index">
<div style="width: 50px">{{ item.name }}</div>
<div class="qudao_k_input">
<el-input type="number" v-model="PlanDetaiInfo.coutsInfo[index].count" :min="1"
placeholder="0" oninput="value=value.replace(/^0|[^0-9]/g, '')" />
</div>
</div>
</div>
</el-form-item>
<el-form-item label="状态:">
<el-switch v-model="PlanDetaiInfo.status" size="large" active-text="" inactive-text=""
:active-value="1" :inactive-value="0" />
</el-form-item>
<el-form-item label="添加时间:">
{{ PlanDetaiInfo.created_at }}
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="PlanDetailDialogVisible = false">取消</el-button>
<el-button type="primary" @click="SavePlanAction">
确定
</el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="MingXiDialogVisible" title="预约明细" width="60%">
<div>
<div style="text-align: center;font-size: 16px; margin-top: -30px;margin-bottom: 10px;">
{{selectedPlanRow.department_resources_name}}
<span v-for="(item,index) in selectedPlanRow.devices" :key="index"
:class="(item.status==1 && item.is_del==0) ? '':'hongzi'">{{ item.device_name }}
</span>
</div>
<el-form-item label="渠道">
<el-select :filterable="true" clearable v-model="selectecQuDaoid"
@change="GetMingXi(selectedPlanRow,selectecQuDaoid)" placeholder="选择渠道"
style="margin-left: 8px;width: 150px;">
<el-option label="全部" :value="0" />
<el-option v-for="(item1,index1) in selectedPlanRow.countsInfo" :key="index1"
:label="item1.name" :value="item1.appointment_type_id" />
</el-select>
</el-form-item>
<el-table :data="MingXiList" style="width: 100%;" row-key="id" v-loading="MingXiLoading">
<el-table-column prop="list_status" label="状态" width="100">
<template #default="scope">
<el-tag v-if="scope.row.list_status===0" class="ml-2" type="info"></el-tag>
<el-tag v-if="scope.row.list_status===1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.list_status===2" class="ml-2"></el-tag>
<el-tag v-if="scope.row.list_status===3" class="ml-2" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column prop="user_name" label="姓名" />
<el-table-column prop="user_phone" label="电话" />
<el-table-column prop="reg_num" label="登记号" />
<el-table-column prop="reservation_department" label="申请科室" />
<el-table-column prop="entrust" label="项目" />
<el-table-column prop="qudao_name" label="渠道" />
</el-table>
</div>
</el-dialog>
<el-dialog v-model="ZhanWeiDialogVisible" title="占位设置" width="40%">
<div v-loading="loading">
<el-form v-if="ZhanWeiInfo" label-width="120px" style="padding-right: 40px;">
<el-form-item label="日期:">
{{ ZhanWeiInfo.date }}
</el-form-item>
<el-form-item label="星期:">
{{ ZhanWeiInfo.weekname }}
</el-form-item>
<el-form-item label="科室:">
{{ ZhanWeiInfo.department_name }}
</el-form-item>
<el-form-item label="资源:">
{{ ZhanWeiInfo.resources_name }}
</el-form-item>
<el-form-item label="服务组:">
<el-tag v-for="(item,index) in ZhanWeiInfo.devices" :key="index"
:type="(item.status===1 && item.is_del===0)?'':'danger'" style="margin-left: 8px">
{{ item.device_name }}
</el-tag>
</el-form-item>
<el-form-item label="时间段:">
开始时间<span style="font-weight: 700;display: inline-block;margin-right: 8px">{{ ZhanWeiInfo.begin_time }}</span>
结束时间<span style="font-weight: 700">{{ ZhanWeiInfo.end_time }}</span>
</el-form-item>
<el-form-item label="渠道占位:">
<div style="display: flex; flex-direction: column; gap: 10px; width: 100%;">
<template v-if="ZhanWeiInfo.coutsInfo && ZhanWeiInfo.coutsInfo.length > 0">
<template v-for="(item,index) in ZhanWeiInfo.coutsInfo" :key="index">
<div v-if="item && !(item.count===0 && item.used_count===0)"
style="display: flex; align-items: center; gap: 10px;">
<div style="width: 80px;">{{ item.name }}</div>
<div style="flex: 1;">
<el-input type="number" v-model="ZhanWeiInfo.coutsInfo[index].locked_count" placeholder="占位数量" min="0"
oninput="value=value.replace(/[^0-9]/g,'')" />
</div>
<div style="color: #999; font-size: 12px;">
剩余可用: {{ item.count - item.used_count }}
</div>
</div>
</template>
</template>
<div v-else style="color: #999;">
暂无渠道数据
</div>
</div>
</el-form-item>
</el-form>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="ZhanWeiDialogVisible = false">取消</el-button>
<el-button type="primary" @click="SaveZhanWeiAction">
确定
</el-button>
</span>
</template>
</el-dialog>
</div>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import {
PlanListGetList,
GetFilteredDepartmentList,
GetEnableDeviceList,
TimePeriodGetEnableList,
DepartmentResourceGetEnableList,
PlanDetailChangeInfoAdmin,
PlanListGetDetail,
PlanDetailPlanListDelAdmin,
GetPlanUsedList,
SaveLockedCount
} from '@/api/api.js'
import {
ElMessage,
ElMessageBox
} from 'element-plus'
import {
Edit,
Document,
Select,
Lock
} from '@element-plus/icons-vue'
let planTableData = ref([])
let loading = ref(false)
let currentPage = ref(1) //
let pageSize = ref(9999) //
let total = 0 //
let selectedPlanArr = ref([])
let date_list = ref([])
let PlanSelectedAll = ref(0)
let searchInfo = ref({
department_id: null,
resources_id: null,
device_id: null,
xingqi: null,
status: null,
dateRange: []
})
let PlanDetailDialogVisible = ref(false)
const GetList = () => {
searchInfo.value.resources_id = ResourceActive.value
date_list.value = getAllDatesBetweenDates(searchInfo.value.dateRange)
loading.value=true
PlanListGetList({
page: currentPage.value,
pageSize: pageSize.value,
searchInfo: searchInfo.value
}).then(res => {
loading.value=false
if (res.status) {
planTableData.value = []
selectedPlanArr.value = []
let plans = res.data.list
if (plans.length > 0) {
const timeSlotsSet = new Set();
plans.forEach(v => {
if (v.resources_id == ResourceActive.value) {
const timeRange =
`${v.begin_time.substring(0,5)}-${v.end_time.substring(0,5)}`;
timeSlotsSet.add(timeRange);
}
});
const timeSlots = Array.from(timeSlotsSet).sort(); //
// Step 2:
timeSlots.forEach(timeRange => {
const row = {
time_range: timeRange
};
date_list.value.forEach(date => {
const matchingPlan = plans.find(
v =>
`${v.begin_time.substring(0,5)}-${v.end_time.substring(0,5)}` ===
timeRange && v.date === date && v.resources_id ==
ResourceActive.value
);
let plan_enable = false
if (matchingPlan) {
row[date] = {
countsInfo: matchingPlan.countsInfo,
patient_type_label: matchingPlan.patient_type_label,
status: matchingPlan.status,
id: matchingPlan.id,
resources_id: matchingPlan.resources_id
};
}else{
row[date] = {
countsInfo:null,
patient_type_label:null,
status: null,
id:null,
resources_id:null
};
}
});
planTableData.value.push(row);
});
}
} else {
ElMessage.error(res.msg)
}
})
}
const selectedAllPlanFunc = () => {
PlanSelectedAll.value = PlanSelectedAll.value === 0 ? 1 : 0;
if (PlanSelectedAll.value === 0) {
selectedPlanArr.value = []
}
if (PlanSelectedAll.value === 1) {
planTableData.value.forEach((v, i) => {
console.log(v)
for (let key in v) {
if (key != 'time_range') {
selectedPlanArr.value.push(v[key].id)
}
}
})
}
}
const checkBoxCheckFunc = (id) => {
const index = selectedPlanArr.value.indexOf(id);
if (index === -1) {
selectedPlanArr.value.push(id);
} else {
selectedPlanArr.value = selectedPlanArr.value.filter(item => item !== id);
}
};
let hoverIndex = ref(null)
const showTools = (index) => {
hoverIndex.value = index
}
const hideTools = (index) => {
hoverIndex.value = null
}
const zhenshiClick = (zhenshi) => {
ResourceActive.value = zhenshi
PlanSelectedAll.value = 0
selectedPlanArr.value = []
GetList()
}
const isSelected = (id) => {
return selectedPlanArr.value.includes(id)
}
let xingqi = ref([{
label: '星期一',
value: 1
}, {
label: '星期二',
value: 2
}, {
label: '星期三',
value: 3
}, {
label: '星期四',
value: 4
}, {
label: '星期五',
value: 5
}, {
label: '星期六',
value: 6
}, {
label: '星期日',
value: 7
}])
//
let EnableDeviceList = ref([])
const GetEnableDeviceListFunc = () => {
loading.value = true
GetEnableDeviceList().then(res => {
loading.value = false
if (res.status) {
EnableDeviceList.value = res.data
} else {
ElMessage.error(res.msg)
}
})
}
let EnableDepartmentList = ref([])
const GetDepartmentEnableList = () => {
loading.value = true
GetFilteredDepartmentList({}).then(res => {
loading.value = false
if (res.status) {
EnableDepartmentList.value = res.data.list
if (EnableDepartmentList.value.length > 0) {
searchInfo.value.department_id = EnableDepartmentList.value[0].id
getEnableResource()
}
} else {
ElMessage.error(res.msg)
}
})
}
//
const DepartmentChange = () => {
searchInfo.value.resources_id = null
ResourceActive.value = 0
getEnableResource()
}
// //
// let TimePeriodList = ref([])
// const GetEnableTimePeriod = () => {
// loading.value = true
// TimePeriodGetEnableList().then(res => {
// loading.value = false
// if (res.status) {
// TimePeriodList.value = res.data
// } else {
// ElMessage.error(res.msg)
// }
//
// })
// }
//
let enableResourceList = ref([])
let ResourceActive = ref(0)
const getEnableResource = () => {
loading.value = true
DepartmentResourceGetEnableList({department_id: searchInfo.value.department_id}).then(res => {
loading.value = false
if (res.status) {
enableResourceList.value = res.data
if (enableResourceList.value.length > 0 && ResourceActive.value == '') {
ResourceActive.value = enableResourceList.value[0].id
GetList()
}
} else {
ElMessage.error(res.msg)
}
})
}
//
let PlanDetaiInfo = ref('')
const getDetail = (id) => {
PlanDetailDialogVisible.value = true
loading.value = true
PlanListGetDetail({
id: id
}).then(res => {
loading.value = false
if (res.status) {
PlanDetaiInfo.value = res.data
} else {
ElMessage.error(res.msg)
}
})
}
//
const MaxCountChange = (e) => {
console.log(e)
if (e === '' || e == null || e === 0) {
PlanDetaiInfo.value.max_total = 0
}
let temp = 0
let qudao_count = PlanDetaiInfo.value.coutsInfo.length
for (let i = 0; i < qudao_count; i++) {
if (PlanDetaiInfo.value.coutsInfo[i].ratio === 0) continue
PlanDetaiInfo.value.coutsInfo[i].max_total = PlanDetaiInfo.value.max_total
PlanDetaiInfo.value.coutsInfo[i].count = Math.round(PlanDetaiInfo.value.max_total * (PlanDetaiInfo.value
.coutsInfo[i].ratio / 100))
temp = temp + PlanDetaiInfo.value.coutsInfo[i].count
//1
if (i === qudao_count - 1 && temp !== PlanDetaiInfo.value.max_total) {
PlanDetaiInfo.value.coutsInfo[i].count = PlanDetaiInfo.value.coutsInfo[i].count - (temp - PlanDetaiInfo
.value.max_total)
}
}
}
//
const SavePlanAction = () => {
let tempCount = 0
PlanDetaiInfo.value.coutsInfo.forEach((item) => {
tempCount = tempCount + Number(item.count)
})
if (tempCount !== Number(PlanDetaiInfo.value.max_total)) {
ElMessage.error('各个渠道数量之和与当日总量不符')
return false
}
loading.value = true
PlanDetailChangeInfoAdmin({
PlanDetaiInfo: PlanDetaiInfo.value,
department_id: searchInfo.value.department_id
}).then(res => {
loading.value = false
if (res.status) {
PlanDetailDialogVisible.value = false
GetList()
} else {
ElMessage.error(res.msg)
}
})
}
const Del = () => {
if (selectedPlanArr.value.length == 0) {
ElMessage.error("请至少勾选1条记录")
return false
}
ElMessageBox.confirm(
'确定删除吗?',
'提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
loading.value = true
PlanDetailPlanListDelAdmin({
ids: selectedPlanArr.value,
department_id: searchInfo.value.department_id
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: res.msg,
type: 'success',
})
GetList()
} else {
ElMessage.error(res.msg)
}
})
})
}
let MingXiDialogVisible = ref(false);
let MingXiLoading = ref(false)
let MingXiList = ref(null);
let selectedPlanRow = ref(null);
let selectecQuDaoid = ref(null);
const GetMingXi = (row, typeid) => {
selectecQuDaoid.value = typeid
selectedPlanRow.value = row
MingXiDialogVisible.value = true
MingXiLoading.value = true
GetPlanUsedList({
planid: row.id,
qudaoid: typeid
}).then(res => {
MingXiLoading.value = false
if (res.status) {
MingXiList.value = res.data
} else {
ElMessage.error(res.msg)
}
})
}
//
let ZhanWeiDialogVisible = ref(false)
let ZhanWeiInfo = ref(null)
const OpenZhanWeiDialog = (row) => {
ZhanWeiDialogVisible.value = true
loading.value = true
PlanListGetDetail({
id: row.id
}).then(res => {
loading.value = false
if (res.status) {
ZhanWeiInfo.value = res.data
ZhanWeiInfo.value.coutsInfo.forEach(item => {
if (item.locked_count === null) {
item.locked_count = 0
}
})
} else {
ElMessage.error(res.msg)
}
})
}
const SaveZhanWeiAction = () => {
let locked_counts = []
let hasError = false
ZhanWeiInfo.value.coutsInfo.forEach((item) => {
if (hasError) return
const remaining = item.count - item.used_count
if (Number(item.locked_count) > remaining) {
ElMessage.error(`${item.name} 的占位数量不能大于剩余可用数量,最多${remaining}`)
hasError = true
return
}
if (Number(item.locked_count) < 0) {
ElMessage.error(`${item.name} 的占位数量不能为负数`)
hasError = true
return
}
locked_counts.push({
appointment_type_id: item.appointment_type_id,
locked_count: item.locked_count || 0
})
})
if (hasError) return
loading.value = true
SaveLockedCount({
roster_detail_id: ZhanWeiInfo.value.id,
locked_counts: locked_counts
}).then(res => {
loading.value = false
if (res.status) {
ZhanWeiDialogVisible.value = false
GetList()
ElMessage.success('占位设置保存成功')
} else {
ElMessage.error(res.msg)
}
})
}
const getTotalLocked = (countsInfo) => {
if (!countsInfo || !Array.isArray(countsInfo)) return 0
return countsInfo.reduce((total, item) => {
return total + (Number(item.locked_count) || 0)
}, 0)
}
function formatDateLocal(date) {
const year = date.getFullYear();
const month = String(date.getMonth() + 1).padStart(2, '0');
const day = String(date.getDate()).padStart(2, '0');
return `${year}-${month}-${day}`;
}
function getAllDatesBetweenDates(dateArray) {
// Date
const sortedDates = dateArray
.map(dateStr => new Date(dateStr))
.sort((a, b) => a - b);
const startDate = sortedDates[0];
const endDate = sortedDates[sortedDates.length - 1];
const dateList = [];
let currentDate = new Date(startDate);
while (currentDate <= endDate) {
dateList.push(currentDate.toISOString().split('T')[0]); // YYYY-MM-DD
currentDate.setDate(currentDate.getDate() + 1);
}
return dateList;
}
function getWeekday(dateString) {
const date = new Date(dateString);
if (isNaN(date)) {
return "无效日期";
}
const weekdays = [
"周日",
"周一",
"周二",
"周三",
"周四",
"周五",
"周六"
];
return weekdays[date.getDay()];
}
onMounted(() => {
const today = new Date();
const todayStr = formatDateLocal(today);
// 15
const fifteenDaysLater = new Date(today);
fifteenDaysLater.setDate(today.getDate() + 14);
const fifteenDaysLaterStr = formatDateLocal(fifteenDaysLater);
searchInfo.value.dateRange = [todayStr, fifteenDaysLaterStr]
GetDepartmentEnableList()
GetEnableDeviceListFunc()
})
</script>
<style lang="scss" scoped>
.type_count {
display: flex;
}
.type_count div {
white-space: nowrap;
margin-right: 10px;
}
.qudao_k {
display: flex;
}
.qudao_k_input {
width: 150px;
}
.hongzi {
color: #b25252;
}
.yiyong {
font-weight: 700;
color: #f5a96c;
cursor: pointer;
}
.yiyong:hover {
color: #666;
}
.zhenshiButton {
width: 150px;
border: 1px solid #e8e8e8;
text-align: center;
margin-top: 4px;
border-radius: 4px;
cursor: default;
padding: 6px 6px;
}
.zhenshiButtonActive {
background-color: #5bc0de;
color: #fff;
}
.plan_checkAllbox {
height: 20px;
width: 20px;
border: 1px solid #7cccc7;
border-radius: 4px;
}
.plan_checkAllbox_active {
background-color: #409eff;
justify-content: center;
align-items: center;
display: flex;
}
.planInfo_k_disabled{
background-color: #ffd6d2;
}
.planInfo_k {
font-size: 14px;
color: #333;
position: relative;
padding-top: 6px;
padding-bottom: 10px;
padding-right: 8px;
.zong_row{
text-align: right;
.qudao_title_zong {
font-weight: 600;
span {
font-weight: 500;
}
}
}
.plan_checkbox {
position: absolute;
top: 2px;
left: 2px;
height: 16px;
width: 16px;
border: 1px solid #98c4cc;
border-radius: 4px;
}
.plan_checkbox_active {
background-color: #409eff;
justify-content: center;
align-items: center;
display: flex;
}
.hoverTools {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
width: 100%;
background-color: rgba(0, 0, 0, 0.5);
display: flex;
justify-content: center;
align-items: center;
border-radius: 4px;
.icon_k {
height: 30px;
width: 30px;
border-radius: 50%;
display: flex;
justify-content: center;
align-items: center;
border: 1px solid #ccc;
background-color: #fff;
margin-left: 6px;
}
}
.qudao_count_row {
display: flex;
div {
margin-left: 6px;
}
}
}
.planInfo {
.planTable {
width: 100%;
background-color: #fff;
text-align: center;
border: 1px solid #f1f1f1;
border-collapse: collapse;
/* 合并边框 */
color: #333;
td {
border: 1px solid #f1f1f1;
// padding: 6px;
}
td:first-child,
th:first-child {
position: sticky;
left: 0;
background-color: #fafafa;
z-index: 1;
}
}
.table_plan_row td:first-child {
background-color: #f1f1f1;
border-bottom: 1px solid #e8e8e8;
}
.table_plan_row> :not(:first-child):hover {
background-color: #aeebf0;
cursor: pointer;
color: #fff;
}
.planActive {
background-color: #5bc0de;
color: #fff;
}
.plandisable {
pointer-events: none;
opacity: 0.4;
}
.shuxian {
border-left: 1px solid #dfdfdf;
margin-left: 40px;
margin-right: 40px;
}
.do_button {
width: 100px;
}
}
.yellow{
color:#ffaa7f;
}
.red{
color:#c81e00;
}
.bold-text{
font-weight: bold;
}
</style>

File diff suppressed because it is too large Load Diff

@ -2,8 +2,11 @@
<div class="head"> <div class="head">
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange" type="daterange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" value-format="YYYY-MM-DD" /> type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
<span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-button @click="countAppointmentTypeFunc()" style="margin-left: 10px;">搜索</el-button> <el-button @click="countAppointmentTypeFunc()" style="margin-left: 10px;">搜索</el-button>
@ -62,7 +65,8 @@
}); });
let loading = ref(false); let loading = ref(false);
let searchInfo = ref({ let searchInfo = ref({
name: '' name: '',
dateRange: []
}) })
let Info = ref({ let Info = ref({
id: null, id: null,

@ -3,9 +3,11 @@
<div class="head"> <div class="head">
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
value-format="YYYY-MM-DD" /> <span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.list_status" placeholder="状态" <el-select :filterable="true" clearable v-model="searchInfo.list_status" placeholder="状态"
@ -195,7 +197,7 @@
import { import {
EntrustGetList, EntrustGetList,
GetEnableDepartmentList, GetFilteredDepartmentList,
CancelYuYue, CancelYuYue,
GetEnableDeviceList, GetEnableDeviceList,
DepartmentResourceGetEnableList, DepartmentResourceGetEnableList,
@ -214,7 +216,9 @@
let shenqingdan_show = ref(false); let shenqingdan_show = ref(false);
let do_type = ref(0) //12 let do_type = ref(0) //12
let loading = ref(false) let loading = ref(false)
let searchInfo = ref({}) let searchInfo = ref({
dateRange: []
})
let tableData = ref([]) let tableData = ref([])
let tableref = ref(null) let tableref = ref(null)
let currentPage = ref(1) // let currentPage = ref(1) //
@ -326,7 +330,7 @@
let EnableDepartmentList = ref([]) let EnableDepartmentList = ref([])
const GetDepartmentEnableList = () => { const GetDepartmentEnableList = () => {
loading.value = true loading.value = true
GetEnableDepartmentList({ GetFilteredDepartmentList({
is_all: true is_all: true
}).then(res => { }).then(res => {
loading.value = false loading.value = false

@ -2,9 +2,11 @@
<div class="head"> <div class="head">
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
value-format="YYYY-MM-DD" /> <span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-button @click="CountMakeListFunc()" style="margin-left: 10px;">搜索</el-button> <el-button @click="CountMakeListFunc()" style="margin-left: 10px;">搜索</el-button>
@ -37,7 +39,8 @@
}); });
let loading=ref(false); let loading=ref(false);
let searchInfo=ref({ let searchInfo=ref({
name:'' name:'',
dateRange: []
}) })
let Info=ref({ let Info=ref({
id:null, id:null,

@ -38,9 +38,11 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="searchInfo.dateRange[0]"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
value-format="YYYY-MM-DD" /> <span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="searchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-button @click="GetList()" style="margin-left: 10px;">搜索</el-button> <el-button @click="GetList()" style="margin-left: 10px;">搜索</el-button>
<!-- <el-button type="danger" @click="Del()" style="margin-left: 10px;">删除</el-button> --> <!-- <el-button type="danger" @click="Del()" style="margin-left: 10px;">删除</el-button> -->
@ -225,7 +227,7 @@
} from 'vue' } from 'vue'
import { import {
PlanListGetList, PlanListGetList,
GetEnableDepartmentList, GetFilteredDepartmentList,
GetEnableDeviceList, GetEnableDeviceList,
TimePeriodGetEnableList, TimePeriodGetEnableList,
DepartmentResourceGetEnableList, DepartmentResourceGetEnableList,
@ -316,7 +318,7 @@
let EnableDepartmentList = ref([]) let EnableDepartmentList = ref([])
const GetDepartmentEnableList = () => { const GetDepartmentEnableList = () => {
loading.value = true loading.value = true
GetEnableDepartmentList({is_all: true}).then(res => { GetFilteredDepartmentList({is_all: true}).then(res => {
loading.value = false loading.value = false
if (res.status) { if (res.status) {
EnableDepartmentList.value = res.data.list EnableDepartmentList.value = res.data.list

@ -3,9 +3,11 @@
<div class="head"> <div class="head">
<el-row> <el-row>
<el-form-item> <el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="SearchInfo.dateRange" <el-date-picker style="margin-left: 8px; width: 150px" v-model="SearchInfo.dateRange[0]"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" type="date" placeholder="开始时间" value-format="YYYY-MM-DD" />
value-format="YYYY-MM-DD" /> <span style="margin: 0 4px;"></span>
<el-date-picker style="width: 150px" v-model="SearchInfo.dateRange[1]"
type="date" placeholder="结束时间" value-format="YYYY-MM-DD" />
</el-form-item> </el-form-item>
<el-button @click="GetInfo()" style="margin-left: 10px;">搜索</el-button> <el-button @click="GetInfo()" style="margin-left: 10px;">搜索</el-button>
@ -37,7 +39,9 @@
let loading = ref(false) let loading = ref(false)
let tableData = ref([]) let tableData = ref([])
let SearchInfo=ref({}) let SearchInfo=ref({
dateRange: []
})
let PlanAllCount=ref(0) let PlanAllCount=ref(0)
let AllUsedCount=ref(0) let AllUsedCount=ref(0)
// //

@ -91,7 +91,7 @@
onMounted onMounted
} from 'vue' } from 'vue'
import { import {
GetEnableDepartmentList, GetFilteredDepartmentList,
DepartmentResourceGetList, DepartmentResourceGetList,
DepartmentResourceDel, DepartmentResourceDel,
GetEnableDeviceList, GetEnableDeviceList,
@ -155,7 +155,7 @@
let EnableDepartmentList = ref([]); let EnableDepartmentList = ref([]);
const GetDepartmentEnableList = () => { const GetDepartmentEnableList = () => {
loading.value = true loading.value = true
GetEnableDepartmentList({}).then(res => { GetFilteredDepartmentList({}).then(res => {
loading.value = false loading.value = false
if (res.status) { if (res.status) {
EnableDepartmentList.value = res.data.list EnableDepartmentList.value = res.data.list

Loading…
Cancel
Save