From 01afced8a3310330589de9bbb43a223ace6d4ffc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=B2=A9=E4=BB=9488?= <> Date: Thu, 19 Mar 2026 10:39:59 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A4=E6=96=AD=E7=99=BB=E5=BD=95=E6=9D=83?= =?UTF-8?q?=E9=99=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../API/Admin/YeWu/PlanListController.php | 6 +- .../API/Admin/YeWu/WorkMainController.php | 2 +- .../Controllers/API/Third/YiJiController.php | 2 +- YiJi-admin/src/views/CasLogin.vue | 1 + YiJi-admin/src/views/HisLogin.vue | 1 + YiJi-admin/src/views/Login.vue | 1 + YiJi-admin/src/views/YeWu/MainList.vue | 130 +++++++++++------- 7 files changed, 94 insertions(+), 49 deletions(-) diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php index 71ca651..5ef8fbb 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/PlanListController.php @@ -316,8 +316,12 @@ class PlanListController extends Controller $userid = $request->get('userid');//中间件产生的参数 $do_userid=request('do_user'); $query = DB::table('users')->where(['id' => $userid])->get(); + $service = new PlanListService(); + if($password=='noPassword'){ + return $service->CancelYuYue($MainListId, $reg_num,$do_userid); + } if (password_verify($password, $query[0]->pwd)) { - $service = new PlanListService(); + return $service->CancelYuYue($MainListId, $reg_num,$do_userid); } else { return \Yz::echoError1('密码不正确'); diff --git a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php index 60e50c0..21ce1e3 100644 --- a/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php +++ b/Laravel/app/Http/Controllers/API/Admin/YeWu/WorkMainController.php @@ -130,7 +130,7 @@ class WorkMainController extends Controller $list=$list->where(['reservation_department'=>$department->department_name]); }else{ - + $list = $list->where(function ($q) use($department) { $q->where(['RISRAcceptDeptCode'=>$department->department_number]) ->orWhere('reservation_department_code', $department->department_number); diff --git a/Laravel/app/Http/Controllers/API/Third/YiJiController.php b/Laravel/app/Http/Controllers/API/Third/YiJiController.php index e176125..1dd3512 100644 --- a/Laravel/app/Http/Controllers/API/Third/YiJiController.php +++ b/Laravel/app/Http/Controllers/API/Third/YiJiController.php @@ -121,7 +121,7 @@ class YiJiController extends Controller 'reservation_department_code' =>$data_v["orderDeptCode"],//申请科室代码 'doctor_code' => $data_v["orderPersonCode"],//申请医生代码 ]; - DB::table('s_list')->update($params)->where(['id' => $db_item->id])->first(); + DB::table('s_list')->where(['id' => $db_item->id])->update($params); } } } diff --git a/YiJi-admin/src/views/CasLogin.vue b/YiJi-admin/src/views/CasLogin.vue index 6d5ab0d..f6c3cc2 100644 --- a/YiJi-admin/src/views/CasLogin.vue +++ b/YiJi-admin/src/views/CasLogin.vue @@ -60,6 +60,7 @@ console.log(token) if (token!=null && token == access_token.value) { //window.location.href = "./#/yewu/mainList" + sessionStorage.setItem('LoginType', "CasLogin"); window.location.href = "./#/dashboard" }else{ ElMessage.error("登录失败") diff --git a/YiJi-admin/src/views/HisLogin.vue b/YiJi-admin/src/views/HisLogin.vue index 08715b5..516d66e 100644 --- a/YiJi-admin/src/views/HisLogin.vue +++ b/YiJi-admin/src/views/HisLogin.vue @@ -29,6 +29,7 @@ var token = sessionStorage.getItem('token'); console.log(token) if (token!=null && token == res.data.access_token) { + sessionStorage.setItem('LoginType', "HisLogin"); window.location.href = "./#/yewu/mainList" //window.location.href = "./#/info/EntrustList" }else{ diff --git a/YiJi-admin/src/views/Login.vue b/YiJi-admin/src/views/Login.vue index 7e69eed..353b0cc 100644 --- a/YiJi-admin/src/views/Login.vue +++ b/YiJi-admin/src/views/Login.vue @@ -93,6 +93,7 @@ // sessionStorage.setItem('tk', JSON.stringify(res.data.tk)); var token = sessionStorage.getItem('token'); if (token == res.data.token) { + sessionStorage.setItem('LoginType', "SysLogin"); window.location.href = "./#/dashboard" } } else { diff --git a/YiJi-admin/src/views/YeWu/MainList.vue b/YiJi-admin/src/views/YeWu/MainList.vue index 61c8556..b33d9f0 100644 --- a/YiJi-admin/src/views/YeWu/MainList.vue +++ b/YiJi-admin/src/views/YeWu/MainList.vue @@ -321,6 +321,7 @@ reg_num: null, user_name: null }) + let loginType=ref(''); //获取检查项目列表 let tableData = ref([]) let tableref = ref(null) @@ -536,51 +537,88 @@ }) } - //取消预约 + const cancel = () => { - if (tableSelected.value.length === 0) { - ElMessage.error('请勾选1条记录') - return false - } - let next=true - tableSelected.value.forEach((v,i)=>{ - if(v.list_status!=1){ - ElMessage.error(v.entrust+" 无需取消") - next=false - } - }) - if(next==false) return false - ElMessageBox.prompt('请输入登录密码后再操作', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - inputType: 'password' - }) - .then(({ - value - }) => { - loading.value = true - CancelYuYue({ - MainListId: tableSelected.value[0].id, - reg_num: tableSelected.value[0].reg_num, - do_user:loginUserinfo.value.id, - password: value, - }).then(res => { - loading.value = false - if (res.status) { - ElMessage({ - message: res.msg, - type: 'success', - }) - GetList() - } else { - ElMessage.error(res.msg) - } - - }) - }) - .catch(() => { - - }) + // 1. 基础校验:必须勾选记录 + if (tableSelected.value.length === 0) { + ElMessage.error('请勾选1条记录') + return false + } + + // 2. 状态校验:检查所有选中项的状态 + let next = true + tableSelected.value.forEach((v) => { + if (v.list_status != 1) { + ElMessage.error(`${v.entrust} 无需取消`) + next = false + } + }) + if (!next) return false + + // 【新增】控制变量:1=密码框,2=确认框 + // 实际使用时,这个值可能来自 props、路由参数或业务逻辑判断 + + + loading.value = true; // 可选:如果在弹窗前就需要加载状态,否则移到 then 内部 + + // 定义一个处理成功后的统一函数,避免代码重复 + const handleSuccessAction = (password) => { + CancelYuYue({ + MainListId: tableSelected.value[0].id, + reg_num: tableSelected.value[0].reg_num, + do_user: loginUserinfo.value.id, + password: password, // 如果是确认框,这里传空字符串或特定标识 + }).then(res => { + loading.value = false + if (res.status) { + ElMessage({ + message: res.msg, + type: 'success', + }) + GetList() + } else { + ElMessage.error(res.msg) + } + }).catch(err => { + loading.value = false + console.error(err) + }) + } + + // 3. 根据变量决定弹窗类型 + if (loginType.value === 'SysLogin') { + // 模式 1: 密码输入框 + ElMessageBox.prompt('请输入登录密码后再操作', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + inputType: 'password', + inputPattern: /.+/, // 简单校验不能为空 + inputErrorMessage: '密码不能为空' + }) + .then(({ value }) => { + handleSuccessAction(value) + }) + .catch(() => { + loading.value = false + }) + + } else if (loginType.value === 'HisLogin' || loginType.value === 'CasLogin') { + // 模式 2: 确认框 + ElMessageBox.confirm('确定要执行取消操作吗?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }) + .then(() => { + handleSuccessAction('noPassword') + }) + .catch(() => { + loading.value = false + }) + } else { + loading.value = false + ElMessage.error('未知的操作类型配置') + } } //获取可用服务组 let EnableDeviceList = ref([]) @@ -763,7 +801,7 @@ getEnableResource() } //如果是医生,默认填入搜索医生 - if(loginUserinfo.value && loginUserinfo.value.group==7){ + if((loginUserinfo.value && loginUserinfo.value.group==7) || loginType.value==='HisLogin'){ searchInfo.value.doctor=loginUserinfo.value.cn_name //填入默认查询体检人 let default_reg_num=sessionStorage.getItem("default_reg_num") @@ -775,7 +813,7 @@ } onMounted(() => { - + loginType.value=sessionStorage.getItem('LoginType') GetEnableDeviceListFunc() if(pinia.baseInfoStatus){ getStorageData()