完善功能,重写主工作界面、全部资源列表、全部医嘱列表等

main
yanzai 1 year ago
parent 488f077e56
commit c24c563858

@ -23,8 +23,10 @@ class DepartmentController extends Controller
{
$userid = $request->get('userid');//中间件产生的参数
$group = $request->get('role');//中间件产生的参数
$is_all = $request->get('is_all');
$is_all=isset($is_all)?$is_all:false;
$service = new DepartmentService();
return $service->GetEnableList(['userid'=>$userid,'group'=>$group]);
return $service->GetEnableList(['userid'=>$userid,'group'=>$group],$is_all);
}
//保存科室信息

@ -27,11 +27,14 @@ class DepartmentResourceController extends Controller
public function GetEnableList(Request $request)
{
$userid = $request->get('userid');//中间件产生的参数
$res_department_id=$request->get('department_id');
$userInfo = DB::table('users')->where(['id' => $userid])->first();
if(!isset($userInfo->department_id)){
if(!isset($userInfo->department_id) and !isset($res_department_id)){
return \Yz::echoError1('科室信息不存在');
}
$resource=DB::table('s_department_resources')->where(['department_id'=>$userInfo->department_id,'department_resources_status'=>1,'is_del'=>0])->get();
if(isset($userInfo->department_id)) $department_id=$userInfo->department_id;
if(isset($res_department_id)) $department_id=$res_department_id;
$resource=DB::table('s_department_resources')->where(['department_id'=>$department_id,'department_resources_status'=>1,'is_del'=>0])->get();
if(count($resource)>0){
return \Yz::Return(true, '操作成功',$resource);
}else{

@ -0,0 +1,130 @@
<?php
namespace App\Http\Controllers\API\Admin\YeWu;
use App\Http\Controllers\Controller;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\DB;
use Tools;
class EntrustController extends Controller
{
public function GetList(){
$searchInfo = request('searchInfo');
$page = request('page');
$pageSize = request('pageSize');
$list=DB::table('s_list')
->leftJoin('s_period','s_list.reservation_time','=','s_period.id')
->leftJoin('s_department_resources','s_list.reservation_sources','=','s_department_resources.id')
->select('s_list.*','s_period.period_begin_time','s_period.period_end_time','s_department_resources.department_resources_name');
if ($searchInfo['dateRange']!=null and count($searchInfo['dateRange']) == 2) {
$list = $list->where(function ($q) use($searchInfo) {
$q->whereBetween('s_list.entrust_date', $searchInfo['dateRange'])
->orWhereBetween('s_list.reservation_date', $searchInfo['dateRange']);
});
}
if(isset($searchInfo['department_id'])){
$department = DB::table('s_department')->where(['id' => $searchInfo['department_id'],'is_del'=>0])->first();
$list=$list->where(['RISRAcceptDeptCode'=>$department->department_number]);
}
if (isset($searchInfo['list_status'])) {
$list = $list->where('s_list.list_status', $searchInfo['list_status']);
}
if (isset($searchInfo['patient_type'])) {
$list = $list->where('s_list.patient_type', $searchInfo['patient_type']);
}
if (!empty($searchInfo['resources'])) {
$list = $list->whereIn('s_list.reservation_sources', $searchInfo['resources']);
}
if (isset($searchInfo['services_group'])) {
$list = $list->whereRaw("FIND_IN_SET({$searchInfo['services_group']}, s_list.services_group)");
}
if (isset($searchInfo['reg_num'])) {
$list = $list->where('s_list.reg_num', $searchInfo['reg_num']);
}
if (isset($searchInfo['user_name'])) {
$list = $list->where('s_list.user_name', 'like','%'.$searchInfo['user_name'].'%');
}
if (isset($searchInfo['doctor'])) {
$list = $list->where('s_list.docotr', 'like','%'.$searchInfo['doctor'].'%');
}
if (isset($searchInfo['apply_department'])) {
$list = $list->where('s_list.reservation_department', 'like','%'.$searchInfo['apply_department'].'%');
}
$count = $list;
$count = $count->count();
$list=$list->where(['s_list.is_del'=>0,'s_list.is_nullify'=>0])->orderBy('id', 'desc')->limit($pageSize)->skip(($page - 1) * $pageSize) // 跳过前9999条记录
->take($pageSize)->get();
//匹配设备(服务组)
$devices = DB::table('s_devices')->get();
foreach ($list as $key => $value) {
$list[$key]->age = Tools::calculateAgeText($value->user_brithday);
$list[$key]->devices = [];
$array_device_id = explode(",", $value->services_group);
foreach ($devices as $k => $v) {
if (in_array($v->id, $array_device_id)) {
$list[$key]->devices[] = $v;
}
}
}
return \Yz::Return(true,'查询完成',['list'=>$list,'count'=>$count]);
}
//获取医嘱信息 支持多人
public function getMainDetail_duoren()
{
date_default_timezone_set('PRC');
$entrustInfos = request('entrustInfo');
$entrustids = request('entrustid');
$episodeid = request('episodeid');
$appointment_type=request('appointment_type');
if(empty($entrustInfos)) return \Yz::echoError1("entrustInfo不能为空");
$allInfo=[];
foreach ($entrustInfos as $key => $entrustInfo) {
$info = DB::table('s_list as a')->where(['a.reg_num' => $entrustInfo['reg_num'], 'a.episodeid'=>$entrustInfo['episodeid'],'a.is_nullify'=>0])
->select('a.*','c.period_begin_time','c.period_end_time')
->leftJoin('s_period as c','a.reservation_time','=','c.id')
->whereIn('a.entrust_id',$entrustInfo['entrustid'])
->get();
if (count($info)===0) return \Yz::echoError1('登记号'.$entrustInfo['reg_num'].'没有找到对应医嘱信息');
$mainInfo=$info[0];
$itemInfo=[];
foreach ($info as $value){
$ii = DB::table('s_check_item as a')
->leftJoin('s_check_item_device as b','a.id','=','b.item_id')
->where(['a.item_code' => $value->entrust_code,'a.status'=>1,"a.is_del"=>0])->first();
$msg='';
if(!$ii){
$msg="检查项目不可用";
}
if(!!$ii){
if(empty($ii->device_id)){
$msg="检查项目未关联服务组";
}
$qudaos = explode(',', $ii->reservation_method);
if (!in_array($appointment_type, $qudaos)){
$msg=$msg.',该项目不支持在此渠道预约';
}
}
$itemInfo[]=[
'entrust'=>$value,
'item'=>$ii,
'msg'=>$msg,
'selected'=>false
];
}
$allInfo[]=['mainInfo'=>$mainInfo,'itemInfo'=>$itemInfo];
}
return \Yz::Return(true,'查询完成',['today_date'=>date("Y-m-d"),'info'=>$allInfo]);
}
}

@ -194,20 +194,23 @@ class PlanListController extends Controller
$page = request('page');
$pageSize = request('pageSize');
$department_id = 0;
$department_info=false;
$list = DB::table('s_source_roster_detail')
->leftJoin('s_department_resources', 's_source_roster_detail.resources_id', '=', 's_department_resources.id')
// ->leftJoin('s_devices', 's_source_roster_detail.device_id', '=', 's_devices.id')
->leftJoin('s_period', 's_source_roster_detail.period_id', '=', 's_period.id')
->select('s_source_roster_detail.*', 's_department_resources.department_resources_name', 's_period.period_name')
->where(['s_source_roster_detail.is_del' => 0]);
if ($group == 1) {//如果是管理员
if (!empty($searchInfo['department_id'])) {//以前判断的是管理员group==1 改为 (任何角色都能查看了)
if (!empty($searchInfo['department_id'])) {
$department_info=DB::table('s_department')->where(['id' => $searchInfo['department_id']])->first();
$list = $list->where('s_source_roster_detail.department_id', $searchInfo['department_id']);
}
} else {
$userInfo = DB::table('users')->where(['id' => $userid])->get();
$department_id = $userInfo[0]->department_id;
$department_info=DB::table('s_department')->where(['id' => $department_id])->first();
$list = $list->where(['s_source_roster_detail.department_id' => $department_id]);
}
if (!empty($searchInfo['resources_id'])) {
@ -233,6 +236,7 @@ class PlanListController extends Controller
->take($pageSize)->get();
$ids = [];
foreach ($list as $key => $value) {
$list[$key]->department_name = !!$department_info?$department_info->department_name:'' ;
$list[$key]->countsInfo = [];
$ids[] = $value->id;
}

@ -159,6 +159,7 @@ class WorkMainController extends Controller
public function CheckEntrstItemGroup()
{
$list=[];
$rowids=[];
$itemNames=[];
$items= request('items');
if(!empty($items)){
@ -184,6 +185,7 @@ class WorkMainController extends Controller
->leftJoin('s_devices as c','b.device_id','=','c.id')
->whereIn('a.item_name',$itemNames)->where(['a.is_del'=>0,'a.status'=>1,'check_begin_time'=>$FirstItem->check_begin_time])->get();
//按照第一个勾选的检查项目关联的设备进行分组,能在一个设备上进行检查的分在一组
if(!empty($FirstItemDevices)){
$group=[];
foreach ($FirstItemDevices as $f_key=> $value){
@ -192,8 +194,9 @@ class WorkMainController extends Controller
if($v->device_id==$value){
foreach ($items as $item){
if($item['name']==$v->item_name){
$v->rowid=$item['rowid'];
$v->rowid[]=$item['rowid'];
$rowids[]=$item['rowid'];
}
}
@ -206,10 +209,12 @@ class WorkMainController extends Controller
}
return \Yz::Return(true,'查询完成',['group'=>$group]);
return \Yz::Return(true,'查询完成',['group'=>$group,'rowids'=>$rowids]);
}else{
return \Yz::echoError1('当前勾选检查项目不可进行此操作');
}
}else{
return \Yz::echoError1('检查项目不能为空');
}

@ -25,10 +25,10 @@ class DepartmentService
}
return \Yz::Return(true, '查询成功', ['list'=>$l,'count'=>$c]);
}
public function GetEnableList($arr)
public function GetEnableList($arr,$is_all=false)
{
$list=DB::table('s_department');
if($arr['group']!=1){
if(!in_array($arr['group'],[1,5]) and $is_all===false){
$userInfo = DB::table('users')->where(['id'=>$arr['userid']])->get();
$department_id=$userInfo[0]->department_id;
$list= $list->where(['id'=>$department_id]);

@ -24,8 +24,9 @@ class PlanListService
$allDevice = [];//所有医嘱检查项目绑定的设备id
$commPatientType = [];//所有医嘱共同的病人类型
foreach ($entrustids as $key => $entrustid) {
$info = DB::table('s_list')->where(['reg_num' => $regnum, 'entrust_id' => $entrustid, 'episodeid' => $episodeid, 'is_nullify' => 0])->first();
if (!$info) return \Yz::echoError1('没有找到对应医嘱信息');
// $info = DB::table('s_list')->where(['reg_num' => $regnum, 'entrust_id' => $entrustid, 'episodeid' => $episodeid, 'is_nullify' => 0])->first();
$info = DB::table('s_list')->where(['entrust_id' => $entrustid, 'is_nullify' => 0])->first();
if (!$info) return \Yz::echoError1('没有找到对应医嘱信息:'.$entrustid);
$itemInfo = DB::table('s_check_item')->where(['item_name' => $info->entrust, 'status' => 1, "is_del" => 0])->get();
if (count($itemInfo) == 0) return \Yz::echoError1('没有找到可用的检查项目信息');
@ -94,8 +95,9 @@ class PlanListService
// ->whereIn('d.device_id',$commonDevice)
// ->orderBy('a.date')
// ->get();
if(count($commonDevice)==0) return \Yz::echoError1("无可用号源");
$placeholders = implode(',', array_fill(0, count($commonDevice), '?'));
$canshu = array_merge($commonDevice, [$department_id->id, $appointment_date, $appointment_type]);
$plan = DB::select("SELECT
a.*,
@ -169,7 +171,7 @@ WHERE
$planCount = DB::table('s_source_roster_detail_count')->where(['roster_detail_id' => $planid,
'appointment_type_id' => $appointment_type])->first();
if ($planCount->count < ($planCount->used_count + count($mainlistids))) return \Yz::echoError1('当前预约时间名额不足');
$huchiList=[];//互斥item_id对应关系
$oldMainInfos = [];//临时存储原来的主表信息,用于改约
//遍历多个s_list表id,前端多选,一次预约多个检查项目
foreach ($mainlistids as $key_m => $mainlistid) {
@ -222,7 +224,11 @@ WHERE
->where(function ($q) use ($item) {
$q->where(['code1' => $item->item_code])->orWhere('code2', $item->item_code);
})->get();
foreach ($cha_hc as $hc) {
$huchiList[]=[$hc->code1,$hc->code2];
}
if (count($cha_hc) > 0) {
//查询用户预约中的医嘱
$status_1 = DB::table('s_list')
->select('s_check_item.item_code', 's_list.entrust', 's_list.reservation_date', 's_list.reservation_time')
@ -262,8 +268,28 @@ WHERE
}
}
//判断某人这些待预约项目里,是否存在互斥
$userGroup=[];
foreach ($oldMainInfos as $key1 => $value1) {
$reg_num = $value1->reg_num;
if (!isset($userGroup[$reg_num])) {
$userGroup[$reg_num] = [];
}
$userGroup[$reg_num][]=[
'reg_num' => $value1->reg_num,
'user_name' => $value1->user_name,
'entrust_code' => $value1->entrust_code,
'entrust' => $value1->entrust,
];
}
// $huchiList
foreach ($userGroup as $personEntry) {
$ids = array_column($personEntry, 'entrust_code');
if ($this->isMutuallyExclusive($ids, $huchiList)) {
return \Yz::echoError1($personEntry[0]['user_name'].'勾选的项目存在互斥,不可同时预约');
}
}
DB::beginTransaction();
try {
//更新计划明细表使用数量
@ -448,4 +474,14 @@ WHERE
$s->sendMessage($info->user_phone,'测试短信,项目:'.$mainInfo->entrust.',时间:'.$mainInfo->reservation_date.' '.substr($mainInfo->period_begin_time,0,5).'-'.substr($mainInfo->period_end_time,0,5));
}
}
//判断是否在互斥组内
function isMutuallyExclusive($ids, $huchi) {
foreach ($huchi as $pair) {
if (in_array($pair[0], $ids) && in_array($pair[1], $ids)) {
return true;
}
}
return false;
}
}

@ -114,6 +114,8 @@ Route::group(['middleware'=>['log']],function () {
Route::post('admin/NearestEnablePlanDate','App\Http\Controllers\API\Admin\YeWu\PlanListController@NearestEnablePlanDate');//获取最近可用日期
Route::post('testSendMsg','App\Http\Controllers\TestSendMsgController@SendMsg');//测试发送短信
Route::post('admin/GetPersonYuYueList','App\Http\Controllers\API\Admin\YeWu\WorkMainController@GetPersonYuYueList');//医生获取某人全部预约记录
Route::post('admin/EntrustGetList','App\Http\Controllers\API\Admin\YeWu\EntrustController@GetList');//获取医嘱列表,非主工作列表
Route::post('admin/getMainDetail_duoren','App\Http\Controllers\API\Admin\YeWu\EntrustController@getMainDetail_duoren');//获取医嘱信息(支持多人)
Route::post('admin/AutoYuYue','App\Http\Controllers\API\Admin\YeWu\PlanListController@AutoYuYue');//自动预约
});

@ -321,4 +321,32 @@ export const SignIn = (data = {}) => {
//取消签到
export const CancelSign = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'v1/admin/CancelSign', data: data })
}
//获取医嘱列表,非主工作列表
export const EntrustGetList = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/EntrustGetList', data: data })
}
//获取医嘱详情_多人
export const getMainDetail_duoren = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/getMainDetail_duoren', data: data })
}
//获取最近可用日期
export const NearestEnablePlanDate = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/NearestEnablePlanDate', data: data })
}
//获取某日可用号源
export const GetEnablePlan = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/GetEnablePlan', data: data })
}
//获取某日可用号源
export const PlanYuYue = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/PlanYuYue', data: data })
}
////检查当前时段是否有存在已经预约的待检查项目
export const CheckIsDaiJian = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/CheckIsDaiJian', data: data })
}
//医生端取消预约
export const DoctorCancelYuYue = (data = {}) => {
return axios({ url: import.meta.env.VITE_APP_API + 'admin/DoctorCancelYuYue', data: data })
}

@ -0,0 +1,598 @@
<template>
<div>
<div class="main" v-if="MainInfo!=null">
<div class="main_left">
<div class="k_title">医嘱列表 </div>
<div v-for="(MainInfo_item,index1) in MainInfo" :key="index1">
<div v-for="(item,index) in MainInfo_item.itemInfo" :key="index">
<div :class="(item.selected==true)?'entrust_selected k_entrust':' k_entrust' ">
<div style="display: flex;">
<div class="l_title">医嘱项 </div>
<div class="l_value">{{item.entrust.entrust}}</div>
</div>
<div style="display: flex;">
<div class="l_title">状态</div>
<div class="l_value">
<el-tag v-if="item.entrust.list_status===0" class="ml-2" type="info"></el-tag>
<el-tag v-if="item.entrust.list_status===1" class="ml-2" type="success"></el-tag>
<el-tag v-if="item.entrust.list_status===2" class="ml-2"></el-tag>
<el-tag v-if="item.entrust.list_status===3" class="ml-2" type="warning"></el-tag>
</div>
</div>
<div style="display: flex;">
<div><span class="l_title">医生</span><span
class="l_value">{{item.entrust.docotr}}</span>
</div>
<div style="margin-left: 12px;"><span class="l_title">是否空腹</span><span
class="l_value"><span v-if=" item.item.limosis==1"></span><span
v-else></span></span>
</div>
</div>
<div style="display: flex;" v-if="item.entrust.list_status>0">
<div class="l_title">预约时间</div>
<div class="l_value">{{item.entrust.reservation_date}}
{{item.entrust.period_begin_time.substring(0,5)}}-{{item.entrust.period_end_time.substring(0,5)}}
</div>
</div>
<div style="display: flex;" v-if="item.msg">
<div class="l_title">提示</div>
<div class="l_value">{{item.msg}}</div>
</div>
</div>
</div>
</div>
</div>
<div class="main_right">
<div style="margin-bottom: 12px;">
<div class="k_title">用户信息</div>
<div class="userinfo" v-for="(item,index) in MainInfo" :key="index">
<span class="l_title">姓名</span>
<span class="l_value2">{{item.mainInfo.user_name}} </span>
<span class="l_title"> 登记号</span>
<span class="l_value2">{{item.mainInfo.reg_num}} </span>
<span class="l_title"> 性别</span>
<span class="l_value2"><span v-if="item.mainInfo.user_sex==1"></span><span
v-if="item.mainInfo.user_sex==2"></span> </span>
<span class="l_title"> 年龄</span>
<span class="l_value2">12</span>
<span class="l_title"> 电话</span>
<span class="l_value2">{{item.mainInfo.user_phone}}</span>
</div>
</div>
<div style="">
<el-form disabled :inline="true" label-width="100px" v-loading="loading"
style="padding-right: 40px;">
<el-form-item style="width: 30%;" label="预约日期:">
<el-input v-model="startYuYueInfo.planInfo.date" />
</el-form-item>
<el-form-item style="width: 30%;" label="预约时段:">
<el-input v-model="startYuYueInfo.planInfo.timeRange" />
</el-form-item>
<el-form-item style="width: 30%;" label="资源:">
<el-input v-model="startYuYueInfo.planInfo.department_resources_name" />
</el-form-item>
<el-form-item style="width: 90%;" label="检查项目:">
<el-input type="textarea" v-model="startYuYueInfo.entrustItems" />
</el-form-item>
</el-form>
</div>
<div style="margin-bottom: 12px;display: flex;">
<el-button v-if="YuYueInfo.dotype==1" type="success" @click.prevent="StartYuYue(1)"> </el-button>
<el-button v-if="YuYueInfo.appointment_type==1" type="danger"
@click="DoctorCancelYuYueFunc()">取消预约</el-button>
<el-button v-if="YuYueInfo.dotype==2" type="warning" @click="StartYuYue(2)"></el-button>
<el-button type="primary" @click="GetEntrustDetail()"> </el-button>
<el-button @click="ButtonDateChange(1)"></el-button>
<el-button @click="ButtonDateChange(2)"></el-button>
<el-button style="display: none;" ref="print_shenqingdan_button"
v-print="'#shenqingdan'">打印申请单隐藏按钮</el-button>
<el-button @click="print_shenqingdan()"></el-button>
<el-checkbox-group v-model="auto_print" style="margin-left: 12px;">
<el-checkbox label="1">预约完成后打印申请单</el-checkbox>
</el-checkbox-group>
</div>
<div style="display: flex; justify-content: space-around;">
<div>
<div class="date">
<div>
<el-date-picker v-model="table_date1" type="date" placeholder="请选择日期" size="large"
@change="table_date_change" value-format="YYYY-MM-DD" />
</div>
<div style="margin-left: 8px;" v-if="tableData1.weekname">{{tableData1.weekname}}</div>
</div>
<div class="plan_table" style="margin-right: 8px;">
<el-table ref="planTable1" highlight-current-row @row-click="PlanClick1"
:data="tableData1.plan_list" border style="width: 100%">
<el-table-column prop="date" label="日期" width="100" />
<el-table-column prop="weekname" label="星期" width="80" />
<el-table-column prop="department_resources_name" label="资源" width="120" />
<el-table-column prop="devices" label="服务组" width="120" />
<el-table-column prop="" label="时段" width="120">
<template #default="scope">
{{scope.row.begin_time.substring(0,5)}}-{{scope.row.end_time.substring(0,5)}}
</template>
</el-table-column>
<el-table-column prop="address" width="90" label="已用/总数">
<template #default="scope">
<span @click="UsedCountClick(scope.row)" style="font-weight: 700;color:cornflowerblue;cursor: pointer;">{{scope.row.used_count}}/{{scope.row.count}}</span>
</template>
</el-table-column>
</el-table>
</div>
</div>
<div>
<div class="date">
<div>
<el-date-picker v-model="table_date2" type="date" placeholder="请选择日期" size="large"
@change="table_date_change" value-format="YYYY-MM-DD" />
</div>
<div style="margin-left: 8px;" v-if="tableData2.weekname">{{tableData2.weekname}}</div>
</div>
<div class="plan_table">
<el-table ref="planTable2" highlight-current-row @row-click="PlanClick2"
:data="tableData2.plan_list" border style="width: 100%">
<el-table-column prop="date" label="日期" width="100" />
<el-table-column prop="weekname" label="星期" width="80" />
<el-table-column prop="department_resources_name" label="资源" width="120" />
<el-table-column prop="devices" label="服务组" width="120" />
<el-table-column prop="" label="时段" width="120">
<template #default="scope">
{{scope.row.begin_time.substring(0,5)}}-{{scope.row.end_time.substring(0,5)}}
</template>
</el-table-column>
<el-table-column prop="address" width="90" label="已用/总数">
<template #default="scope">
{{scope.row.used_count}}/{{scope.row.count}}
</template>
</el-table-column>
</el-table>
</div>
</div>
</div>
</div>
</div>
<el-dialog v-model="UsedListShow" title="号源占用详情" width="50%">
<div>
<el-table :data="UsedList" style="width: 100%;" row-key="id">
<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>
<div id="shenqingdan" v-if="shenqingdan_show">
<div v-for="(item1,index1) in shenqingdan_list" :key="index1">
<div v-for="(item,index) in item1.itemInfo" :key="index">
<div v-if="item.entrust.list_status==1" style="height:100vh;">
<div style="width: 100%;text-align: center;font-size: 14px;">演示医院</div>
<div style="width: 100%;text-align: center;font-size: 18px;font-weight: bold;">检查申请单</div>
<div style="width: 100%; border: 1px solid #ccc;padding: 20px;">
<div>检查项目{{item.entrust.entrust}}</div>
</div>
</div>
</div>
</div>
</div>
</div>
</template>
<script setup>
import {
ref,
onActivated,
onMounted,
nextTick
} from 'vue';
import {
ElMessage,
ElMessageBox
} from 'element-plus'
import {
getMainDetail_duoren,
NearestEnablePlanDate,
GetEnablePlan,
CheckIsDaiJian,
PlanYuYue,
DoctorCancelYuYue,
GetPlanUsedList
} from '@/api/api.js'
const props = defineProps({
YuYueInfo: {
type: Object
},
})
let loading = ref(false)
let MainInfo = ref(null);
let tableData1 = ref([])
let tableData2 = ref([])
let table_date1 = ref('');
let table_date2 = ref('');
let TodayDate = ref('');
let MainInfoKey = ref(0); //key
let shenqingdan_show = ref(false);
let UsedListShow=ref(false);
let UsedList=ref([]); //
let auto_print = ref(['1']);
let EnableGroupItem = ref([]); //,
let planTable1 = ref(null)
let planTable2 = ref(null)
let startYuYueInfo = ref({
planInfo: {
id: 0,
date: '',
timeRange: '',
department_resources_name: ''
},
entrustItems: {},
entrustids: [],
mainListids: [],
});
const GetEntrustDetail = () => {
EnableGroupItem.value = [];
loading.value = true
getMainDetail_duoren({
entrustInfo: props.YuYueInfo.entrustInfo,
appointment_type: props.YuYueInfo.appointment_type,
}).then(res => {
loading.value = false
if (res.status) {
MainInfo.value = res.data.info
TodayDate.value = res.data.today_date
//
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
EnableGroupItem.value.push(v2.item)
})
})
SelectedEntrustFunc()
} else {
ElMessage.error(res.msg)
}
})
}
//
const NearestEnablePlanDateFunc = () => {
loading.value = true
NearestEnablePlanDate({
regnum: MainInfo.value[MainInfoKey.value].mainInfo.reg_num,
entrustid: startYuYueInfo.value.entrustids,
episodeid: MainInfo.value[MainInfoKey.value].mainInfo.episodeid,
appointment_type: props.YuYueInfo.appointment_type,
}).then(res => {
loading.value = false
if (res.status) {
if (res.data.list.length == 1) {
table_date1.value = res.data.list[0]
table_date2.value = getNextDay(table_date1.value,"jia")
}
if (res.data.list.length == 2) {
table_date1.value = res.data.list[0]
table_date2.value = res.data.list[1]
}
GetEnablePlanFunc(table_date1.value, startYuYueInfo.value.entrustids)
GetEnablePlanFunc(table_date2.value, startYuYueInfo.value.entrustids)
} else {
ElMessage.error(res.msg)
}
})
}
//
const GetEnablePlanFunc = (date, entrustids) => {
loading.value = true
GetEnablePlan({
regnum: MainInfo.value[MainInfoKey.value].mainInfo.reg_num,
entrustid: entrustids,
episodeid: MainInfo.value[MainInfoKey.value].mainInfo.episodeid,
appointment_type: props.YuYueInfo.appointment_type,
date: date
}).then(res => {
loading.value = false
if (res.status) {
if (res.data.appointment_date == table_date1.value) {
tableData1.value = res.data
tableData1.value.plan_list.forEach((v, i) => {
if (v.id == MainInfo.value[MainInfoKey.value].mainInfo.roster_id) {
planTable1.value.setCurrentRow(v)
}
})
}
if (res.data.appointment_date == table_date2.value) {
tableData2.value = res.data
tableData2.value.plan_list.forEach((v, i) => {
if (v.id == MainInfo.value[MainInfoKey.value].mainInfo.roster_id) {
planTable2.value.setCurrentRow(v)
}
})
}
} else {
ElMessage.error(res.msg)
}
})
}
//
const SelectedEntrustFunc = () => {
startYuYueInfo.value.entrustItems = ''
startYuYueInfo.value.entrustids = []
startYuYueInfo.value.mainListids = []
MainInfo.value.forEach((v, i) => {
v.itemInfo.forEach((v2, i2) => {
let isok = false;
EnableGroupItem.value.forEach((j, k) => {
if (v2.item.id == j.id) {
isok = true;
}
})
if (isok) {
MainInfo.value[i].itemInfo[i2].selected = true
startYuYueInfo.value.entrustItems += v2.item.item_name + ' , '
startYuYueInfo.value.entrustids.push(v2.entrust.entrust_id)
startYuYueInfo.value.mainListids.push(v2.entrust.id)
}
})
})
NearestEnablePlanDateFunc()
}
//
const table_date_change = (val) => {
GetEnablePlanFunc(val, startYuYueInfo.value.entrustids)
}
//
const PlanClick1 = (val) => {
console.log(val)
planTable2.value.setCurrentRow()
PlanClick(val)
}
const PlanClick2 = (val) => {
console.log(val)
planTable1.value.setCurrentRow()
PlanClick(val)
}
const PlanClick = (val) => {
startYuYueInfo.value.planInfo = val
startYuYueInfo.value.planInfo.timeRange = val.begin_time.substring(0, 5) + '-' + val.end_time.substring(0, 5)
if (val.id != MainInfo.value[MainInfoKey.value].mainInfo.roster_id) {
checkDaiJian()
}
}
//
const checkDaiJian = () => {
loading.value = true
let status = false;
CheckIsDaiJian({
reg_num: MainInfo.value[MainInfoKey.value].mainInfo.reg_num,
planid: startYuYueInfo.value.planInfo.id,
}).then(res => {
loading.value = false
if (res.status) {
status = true
} else {
ElMessage.error(res.msg)
}
})
return status;
}
//
const StartYuYue = (type) => {
if (startYuYueInfo.value.planInfo.id == 0 || startYuYueInfo.value.planInfo.id == '') {
ElMessage.error('请勾选号源')
return false;
}
loading.value = true
PlanYuYue({
mainlistid: startYuYueInfo.value.mainListids,
planid: startYuYueInfo.value.planInfo.id,
appointment_type: props.YuYueInfo.appointment_type,
dotype: type
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: '预约成功',
type: 'success',
})
GetEntrustDetail()
if (auto_print.value.length > 0) {
print_shenqingdan()
}
} else {
ElMessage.error(res.msg)
}
})
}
//
const DoctorCancelYuYueFunc = () => {
if (startYuYueInfo.value.mainListids.length !== 1) {
ElMessage.error('请勾选1条记录')
return false
}
ElMessageBox.confirm(
'确定取消预约吗?',
'提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
)
.then(() => {
loading.value = true
DoctorCancelYuYue({
MainListId: startYuYueInfo.value.mainListids[0],
reg_num: MainInfo.value[MainInfoKey.value].mainInfo.reg_num,
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: '取消成功',
type: 'success',
})
GetEntrustDetail()
} else {
ElMessage.error(res.msg)
}
})
})
}
const ButtonDateChange=(type)=>{
if(type==1){
table_date2.value=getNextDay(table_date1.value,'jian')
table_date1.value=getNextDay(table_date2.value,'jian')
}
if(type==2){
table_date1.value=getNextDay(table_date2.value,'jia')
table_date2.value=getNextDay(table_date1.value,'jia')
}
table_date_change(table_date1.value)
table_date_change(table_date2.value)
}
const UsedCountClick=(row)=>{
UsedListShow.value=true
loading.value = true
GetPlanUsedList({
planid: row.id
}).then(res => {
loading.value = false
if (res.status) {
UsedList.value=res.data
} else {
ElMessage.error(res.msg)
}
})
}
//
const getNextDay = ((dateString,type) => {
const date = new Date(dateString);
if (isNaN(date.getTime())) {
console.error('日期无效');
return null;
}
if(type=='jia'){
date.setDate(date.getDate() + 1);
}
if(type=='jian'){
date.setDate(date.getDate() - 1);
}
return date.toISOString().split('T')[0]; //
})
//
let print_shenqingdan_button = ref(null);
let shenqingdan_list = ref([])
const print_shenqingdan = () => {
console.log('开始打印');
getMainDetail_duoren({
entrustInfo: props.YuYueInfo.entrustInfo,
appointment_type: props.YuYueInfo.appointment_type,
}).then(res => {
if (res.status) {
let enable = true
shenqingdan_list.value = res.data.info
shenqingdan_list.value.forEach((v, i) => {
if (v.mainInfo.list_status != 1) {
ElMessage.error(v.maininfo.entrust + " 不可打印,请重新选择")
enable = false
}
})
if (enable) {
shenqingdan_show.value = true
setTimeout(function() {
print_shenqingdan_button.value.$el.click();
shenqingdan_show.value = false
}, 500)
}
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
GetEntrustDetail()
})
console.log(props.YuYueInfo);
</script>
<style scoped>
.main {
display: flex
}
.main_left {
margin-right: 20px;
width: 250px;
}
.main_right {}
.k_title {
font-size: 16px;
margin-bottom: 8px;
}
.date {
display: flex;
align-items: center;
}
.userinfo {
border: 1px solid #ddd;
padding: 8px;
border-radius: 6px;
}
.plan_table {
margin-top: 8px;
}
.l_title {
font-size: 14px;
}
.l_value {
font-size: 14px;
font-weight: 700;
}
.l_value2 {
font-size: 16px;
font-weight: 700;
color: #31b0d5;
}
.k_entrust {
border: 1px solid #ddd;
border-radius: 6px;
margin-bottom: 8px;
padding: 8px;
cursor: pointer;
}
.entrust_selected {
background-color: #b1f0fe;
color: #5f8b9e;
border: 0px;
}
</style>
<style>
.el-table__body tr.current-row>td.el-table__cell {
background-color: #8cdbf3 !important;
color: #3b5e67;
}
</style>

@ -170,6 +170,20 @@ const router = createRouter({
meta: {
title: '主工作列表(住院)'
}
},{
path: '/info/EntrustList',
name: 'EntrustList',
component: () => import('../views/Info/EntrustList.vue'),
meta: {
title: '医嘱信息列表'
}
},{
path: '/info/PlanList',
name: 'InfoPlanList',
component: () => import('../views/Info/PlanList.vue'),
meta: {
title: '资源信息列表'
}
}]
},

@ -0,0 +1,352 @@
<template>
<div>
<div class="head">
<el-row>
<el-form-item>
<el-date-picker style="margin-left: 8px; width: 300px" v-model="searchInfo.dateRange"
type="daterange" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间"
value-format="YYYY-MM-DD" />
</el-form-item>
<el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.list_status" placeholder="状态"
style="margin-left: 8px;width: 150px;">
<el-option label="申请中" value="0" />
<el-option label="已预约" value="1" />
<el-option label="已报道" value="2" />
<el-option label="已结束" value="3" />
</el-select>
</el-form-item>
<el-form-item>
<el-select :filterable="true" clearable v-model="searchInfo.patient_type" placeholder="患者类型"
style="margin-left: 8px;width: 150px;">
<el-option label="住院" value="0" />
<el-option label="门诊" value="1" />
<el-option label="急诊" value="2" />
<el-option label="体检" value="3" />
</el-select>
</el-form-item>
<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 multiple :filterable="true" clearable v-model="searchInfo.resources" placeholder="资源"
style="margin-left: 8px;width: 250px;">
<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.services_group" 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-input v-model="searchInfo.reg_num" placeholder="登记号" style="width: 200px;margin-left: 8px;" />
</el-form-item>
<el-form-item>
<el-input v-model="searchInfo.user_name" placeholder="患者姓名"
style="width: 200px;margin-left: 8px;" />
</el-form-item>
<el-form-item>
<el-input v-model="searchInfo.apply_department" placeholder="申请科室"
style="width: 200px;margin-left: 8px;" />
</el-form-item>
<el-form-item>
<el-input v-model="searchInfo.doctor" placeholder="医生" style="width: 200px;margin-left: 8px;" />
</el-form-item>
<el-form-item>
<el-button type="primary" @click="GetList()" style="margin-left: 10px;">查询</el-button>
</el-form-item>
</el-row>
<!-- <el-row style="margin: 0px 0px 8px 8px; border-top: 1px solid #ccc;padding-top: 8px">
<el-button type="success" @click.prevent="openIframe(1)"> </el-button>
<el-button type="danger" @click="cancel()"></el-button>
<el-button type="warning" @click="openIframe(2)"></el-button>
<el-button type="primary" @click="SignInFunc()" style="margin-left: 40px;">报到</el-button>
<el-button type="danger" @click="CancelSignFunc()"></el-button>
<el-button style="display: none;" ref="print_shenqingdan_button" v-print="'#shenqingdan'"></el-button>
<el-button @click="print_shenqingdan()" >打印申请单</el-button>
<el-button v-print="'#tablelist'" >打印表格</el-button>
</el-row> -->
</div>
<el-table :data="tableData" id="tablelist" style="width: 100%;" row-key="id" v-loading="loading" ref="tableref"
@select="handleSelect">
<el-table-column type="selection" width="50" />
<el-table-column prop="list_status" label="状态" width="80">
<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="reg_num" label="登记号" width="100" />
<el-table-column prop="user_name" label="姓名" />
<el-table-column prop="user_sex" label="性别" width="60">
<template #default="scope">
<span v-if="scope.row.user_sex==1"></span>
<span v-if="scope.row.user_sex==2"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="115" />
<el-table-column prop="entrust" label="医嘱" width="200" />
<el-table-column prop="is_pay" label="是否交费" width="80">
<template #default="scope">
<span v-if="scope.row.is_pay==1"></span>
<span v-if="scope.row.is_pay==0"></span>
</template>
</el-table-column>
<el-table-column prop="reservation_date" label="预约日期" width="120" />
<el-table-column prop="check_begin_time" label="预约时间" width="120">
<template #default="scope">
<span
v-if="scope.row.period_begin_time && scope.row.period_end_time ">{{scope.row.period_begin_time.substring(0, 5)}}~{{scope.row.period_end_time.substring(0, 5)}}</span>
</template>
</el-table-column>
<el-table-column prop="implement_department" label="预约科室" width="120" />
<el-table-column prop="department_resources_name" label="预约资源" width="120" />
<el-table-column prop="devices" label="服务组">
<template #default="scope">
<div style="white-space: nowrap;">
<span v-for="(item,index) in scope.row.devices" :key="index">
{{ item.device_name+ ' ' }}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="reservation_department" label="申请科室" width="120" />
<el-table-column prop="" label="医嘱时间" width="160">
<template #default="scope">
{{scope.row.entrust_date}} {{scope.row.entrust_time}}
</template>
</el-table-column>
<el-table-column prop="docotr" label="申请医生" width="80" />
<el-table-column prop="patient_type" label="病人类型" width="80">
<template #default="scope">
<span v-if="scope.row.patient_type==0"></span>
<span v-if="scope.row.patient_type==1"></span>
<span v-if="scope.row.patient_type==2"></span>
<span v-if="scope.row.patient_type==3"></span>
</template>
</el-table-column>
<el-table-column prop="user_phone" label="电话" width="120" />
<!-- <el-table-column prop="implement_department" label="执行科室" width="120" /> -->
<el-table-column prop="department_resources_name" label="操作" width="120">
<template #default="scope">
<el-button @click="showLog(scope.row)" size="small">查看日志</el-button>
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
</div>
<el-dialog v-model="LogShow" title="变更记录" width="50%">
<div>
<el-table :data="LogList" style="width: 100%;" row-key="id">
<el-table-column prop="list_status" label="状态" width="100">
<template #default="scope">
<el-tag v-if="scope.row.new_status==0" class="ml-2" type="info"></el-tag>
<el-tag v-if="scope.row.new_status==1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.new_status==2" class="ml-2"></el-tag>
<el-tag v-if="scope.row.new_status==3" class="ml-2" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column prop="reg_num" label="登记号" />
<el-table-column prop="note" label="说明" />
<el-table-column prop="created_at" label="记录时间" />
<el-table-column prop="data" label="状态" width="100">
<template #default="scope">
<el-button @click="showLogJson(scope.row.data)" size="small">查看data</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<el-dialog v-model="LogDataShow" title="查看dataJson" width="40%">
<div style="word-break: break-all">
{{LogDataJson}}
</div>
</el-dialog>
</div>
</template>
<script setup>
import {
ref,
onMounted,
nextTick
} from 'vue'
import {
EntrustGetList,
GetEnableDepartmentList,
CancelYuYue,
GetEnableDeviceList,
DepartmentResourceGetEnableList,
GetServiceDateTime,
GetLoglist,
CheckEntrstItemGroup,
getMainDetail,
SignIn,
CancelSign
} from '@/api/api.js'
import {
ElMessage,
ElMessageBox
} from 'element-plus'
let AutoGroup = ref(true); //
let shenqingdan_show = ref(false);
let do_type = ref(0) //12
let loading = ref(false)
let searchInfo = ref({})
let tableData = ref([])
let tableref = ref(null)
let currentPage = ref(1) //
let pageSize = ref(15) //
let total = 0 //
const GetList = () => {
loading.value = true
EntrustGetList({
searchInfo: searchInfo.value,
page: currentPage.value,
pageSize: pageSize.value
}).then(res => {
loading.value = false
if (res.status) {
tableData.value = res.data.list
total = res.data.count
} else {
ElMessage.error(res.msg)
}
})
}
const PageSizeChange = (e) => { //
pageSize.value = e
GetList()
}
const PageCurrentChange = (e) => { //
currentPage.value = e
GetList()
}
let tableSelected = ref([])
const handleSelect = (e) => {
//console.log('', tableSelected.value)
let select_qian = tableSelected.value ? tableSelected.value.length : 0
SelectClear();
// console.log(e)
autoSeleted([e[e.length - 1]])
// console.log('', tableSelected.value)
if (select_qian > tableSelected.value.length) {
} else {
FindMatchItem()
}
}
const DepartmentChange = () => {
enableResourceList.value = []
if (searchInfo.value.department_id > 0)
getEnableResource()
}
//
let LogShow = ref(false);
let LogList = ref(null);
let LogDataShow = ref(false);
const showLog = (row) => {
LogShow.value = true
GetLoglist({
id: row.id
}).then(res => {
if (res.status) {
LogList.value = res.data
}
})
}
let LogDataJson = ref('');
const showLogJson = (data) => {
LogDataShow.value = true
LogDataJson.value = data
}
//
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)
}
})
}
//
const GetServiceDate = () => {
GetServiceDateTime().then(res => {
if (res.status) {
let datetime = res.data.datetime.substr(0, 10)
searchInfo.value.dateRange = [datetime, datetime]
GetList()
}
})
}
//
let enableResourceList = ref([])
const getEnableResource = () => {
DepartmentResourceGetEnableList({
department_id: searchInfo.value.department_id
}).then(res => {
if (res.status) {
enableResourceList.value = res.data
} else {
ElMessage.error(res.msg)
}
})
}
//
let EnableDepartmentList = ref([])
const GetDepartmentEnableList = () => {
loading.value = true
GetEnableDepartmentList({
is_all: true
}).then(res => {
loading.value = false
if (res.status) {
EnableDepartmentList.value = res.data.list
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
GetDepartmentEnableList()
GetEnableDeviceListFunc()
GetServiceDate()
})
</script>
<style>
</style>

@ -0,0 +1,521 @@
<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: 300px" v-model="searchInfo.dateRange"
type="daterange" range-separator="至" start-placeholder="开始时间" end-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>
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading"
@selection-change="handleSelectionChange">
<el-table-column type="selection" />
<el-table-column prop="id" label="Id" />
<el-table-column prop="date" label="日期" width="100">
<template #default="scope">
<span>{{ scope.row.date.substring(0, 10) }}</span>
</template>
</el-table-column>
<el-table-column prop="weekname" label="星期" />
<el-table-column prop="resources_id" label="" v-if="false" />
<el-table-column prop="department_name" label="科室" />
<el-table-column prop="department_resources_name" label="资源" />
<el-table-column prop="" label="服务组" show-overflow-tooltip>
<template #default="scope">
<div v-if="scope.row.devices.length>0">
<div v-for="(item,index) in scope.row.devices" :key="index"
:class="(item.status==1 && item.is_del==0) ? '':'hongzi'">{{ item.device_name }}
</div>
</div>
</template>
</el-table-column>
<el-table-column prop="period_name" label="时段" />
<el-table-column prop="begin_time" label="开始时间" />
<el-table-column prop="end_time" label="结束时间" />
<el-table-column prop="end_reservation_time" label="截止时间" />
<el-table-column prop="" label="类型数量" show-overflow-tooltip width="250">
<template #default="scope">
<div v-if="scope.row.countsInfo.length>0">
<div style="font-weight: 700;color:#999">最大数量:{{ scope.row.countsInfo[0].max_total }}</div>
<div v-for="(item,index) in scope.row.countsInfo" :key="index" style="display: flex;">
<div style="font-weight:700;width: 50px;text-align: right;margin-right: 8px">{{ item.name
}}
</div>
<div>:{{ item.count }} 已用: <span @click="GetMingXi(scope.row,item.appointment_type_id)"
class="yiyong">{{ item.used_count }}</span>
:{{ Number(item.count - item.used_count) }}
</div>
</div>
</div>
</template>
</el-table-column>
<!-- <el-table-column prop="time_unit" label="可用时长" width="80" />-->
<el-table-column prop="roster_status" label="状态">
<template #default="scope">
<el-tag v-if="scope.row.status === 1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.status === 0" class="ml-2" type="danger"></el-tag>
</template>
</el-table-column>
<el-table-column prop="" label="操作">
<template #default="scope">
<el-button @click="getDetail(scope.row.id)" size="small" style="margin-left: 10px;">
详情
</el-button>
</template>
</el-table-column>
</el-table>
<div class="page">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
</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="资源:">
{{ PlanDetaiInfo.resources_name }}
</el-form-item>
<el-form-item label="服务组:">
<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" disabled 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 disabled 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 disabled 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>
</div>
</template>
<script setup>
import {
ref,
onMounted
} from 'vue'
import {
PlanListGetList,
GetEnableDepartmentList,
GetEnableDeviceList,
TimePeriodGetEnableList,
DepartmentResourceGetEnableList,
PlanDetailChangeInfo,
PlanListGetDetail,
PlanDetailPlanListDel,
GetPlanUsedList
} from '@/api/api.js'
import {
ElMessage,
ElMessageBox
} from 'element-plus'
let loading = ref(false)
let tableData = ref([])
let currentPage = ref(1) //
let pageSize = ref(15) //
let total = 0 //
const PageSizeChange = (e) => { //
pageSize.value = e
GetList()
}
const PageCurrentChange = (e) => { //
currentPage.value = e
GetList()
}
let tableSelected = ref([])
const handleSelectionChange = (e) => {
tableSelected.value = e
}
let searchInfo = ref({
department_id: null,
resources_id: null,
device_id: null,
xingqi: null,
status: null,
dateRange: []
})
let PlanDetailDialogVisible = ref(false)
const GetList = () => {
PlanListGetList({
page: currentPage.value,
pageSize: pageSize.value,
searchInfo: searchInfo.value
}).then(res => {
tableData.value = res.data.list
total = res.data.count
})
}
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
GetEnableDepartmentList({is_all: true}).then(res => {
loading.value = false
if (res.status) {
EnableDepartmentList.value = res.data.list
} else {
ElMessage.error(res.msg)
}
})
}
// //
// 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([])
const getEnableResource = () => {
DepartmentResourceGetEnableList(
{department_id: searchInfo.value.department_id}
).then(res => {
if (res.status) {
enableResourceList.value = res.data
} 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].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
PlanDetailChangeInfo({
PlanDetaiInfo: PlanDetaiInfo.value
}).then(res => {
loading.value = false
if (res.status) {
PlanDetailDialogVisible.value = false
GetList()
} else {
ElMessage.error(res.msg)
}
})
}
const Del = () => {
if (tableSelected.value.length == 0) {
ElMessage.error("请至少勾选1条记录")
return false
}
let ids = []
tableSelected.value.map((item) => {
ids.push(item.id)
})
ElMessageBox.confirm(
'确定删除吗?',
'提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
}
).then(() => {
loading.value = true
PlanDetailPlanListDel({
ids: ids
}).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)
}
})
}
const DepartmentChange = () => {
enableResourceList.value = []
if (searchInfo.value.department_id > 0)
getEnableResource()
}
onMounted(() => {
GetList()
GetDepartmentEnableList()
GetEnableDeviceListFunc()
})
</script>
<style 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;
}
</style>

@ -292,18 +292,28 @@
}
let tableSelected = ref([])
const handleSelect = (e) => {
//console.log('', tableSelected.value)
if (e.length > 1) {
const firstStatus = e[0].list_status;
// ,1
const allEqual = e.every(item => item.list_status === firstStatus);
if (!allEqual) {
SelectClear()
e = [e[e.length - 1]]
}
}
if (e[e.length - 1].list_status != 0) { //1
SelectClear()
e = [e[e.length - 1]]
}
let select_qian = tableSelected.value ? tableSelected.value.length : 0
SelectClear();
// console.log(e)
autoSeleted([e[e.length - 1]])
// console.log('', tableSelected.value)
//SelectClear();
autoSeleted(e)
// console.log('', tableSelected.value)
if (select_qian > tableSelected.value.length) {
} else {
FindMatchItem()
}
}
const handleSelectionChange = (e) => {
// tableSelected.value = e
@ -314,14 +324,14 @@
//Element-PlusclearSelection
tableref.value.clearSelection()
// console.log("==", tableref.value.getSelectionRows())
tableSelected.value = null
tableSelected.value = []
}
const autoSeleted = (rows) => {
// tableref.value.toggleRowSelection(e[0], true)
if (rows) {
rows.forEach((row) => {
tableref.value.toggleRowSelection(row, true)
if(row!=undefined){
tableref.value.toggleRowSelection(row, true)
}
})
tableSelected.value = rows
} else {
@ -333,8 +343,29 @@
let ItemGroup = ref(null);
//
const FindMatchItem = () => {
console.log(tableSelected.value)
tableSelected.value.reverse();
let temp_reg_num=''
let chongzhi=false;
tableSelected.value.forEach((v, i) => {
if(temp_reg_num==''){
temp_reg_num=v.reg_num
}
if(temp_reg_num!='' && temp_reg_num!=v.reg_num){
chongzhi=true
}
})
if(chongzhi===true){
let a=tableSelected.value[0]
SelectClear();
autoSeleted([a])
}
console.log(tableSelected.value)
let list = []
if(tableSelected.value[0].list_status!=0)return false //
tableData.value.forEach((v, i) => {
if (v.list_status == 0 && v.reg_num == tableSelected.value[0].reg_num && v.episodeid ==
tableSelected.value[0].episodeid) {
@ -361,7 +392,7 @@
loading.value = false
if (res.status) {
let group = res.data.group
if (group.length > 1) {
if (group.length > 1000000000) {
ItemGroupShow.value = true;
ItemGroup.value = group
} else {

@ -1,5 +1,8 @@
<template>
<div>
<el-dialog v-model="YuYueDialogVisible" width="100%" @close="YuYueDialogClose()">
<YuYue style="margin-top: -30px;" :key="YuYueKey" :YuYueInfo="YuYueInfo"></YuYue>
</el-dialog>
<div class="head">
<div class="head">
<el-row>
@ -10,40 +13,137 @@
</el-form-item>
<!-- <el-form-item>
<el-input v-model="searchInfo.name" placeholder="请输入类型名称" style="margin-left: 10px;" />
</el-form-item>
<el-button type="primary" @click="GetList()" style="margin-left: 10px;">查询</el-button> -->
</el-form-item> -->
<el-button type="primary" @click="GetList()" style="margin-left: 10px;">查询</el-button>
<el-button type="success" @click="Add()" style="margin-left: 10px;">添加</el-button>
</el-row>
</div>
</div>
<el-table :data="tableData" style="width: 100%;" row-key="id" v-loading="loading">
<el-table-column prop="id" label="Id" width="100" v-if="false" />
<el-table-column prop="name" label="名称" />
<el-table-column prop="" label="操作" width="150">
<el-row style="margin: 0px 0px 8px 8px; border-top: 1px solid #ccc;padding-top: 8px">
<el-button type="success" @click.prevent="openYuYue(1)"> </el-button>
<el-button type="danger" @click="cancel()"></el-button>
<el-button type="warning" @click="openYuYue(2)"></el-button>
<!-- <el-button type="primary" @click="SignInFunc()" style="margin-left: 40px;">报到</el-button>
<el-button type="danger" @click="CancelSignFunc()"></el-button> -->
<el-button style="display: none;" ref="print_shenqingdan_button"
v-print="'#shenqingdan'">打印申请单隐藏按钮</el-button>
<el-button @click="print_shenqingdan()"></el-button>
<el-button v-print="'#tablelist'"></el-button>
<el-checkbox-group v-model="Is_AutoDuoRen" style="margin-left: 12px;">
<el-checkbox label="1">自动选择多人</el-checkbox>
</el-checkbox-group>
</el-row>
<el-table :data="tableData" @select="TableSelectChange" id="tablelist" ref="tableref" style="width: 100%;" row-key="id"
v-loading="loading">
<el-table-column type="selection" width="50" />
<el-table-column prop="list_status" label="状态" width="80">
<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="reg_num" label="登记号" width="100" />
<el-table-column prop="user_name" label="姓名" />
<el-table-column prop="user_sex" label="性别" width="60">
<template #default="scope">
<span v-if="scope.row.user_sex==1"></span>
<span v-if="scope.row.user_sex==2"></span>
</template>
</el-table-column>
<el-table-column prop="age" label="年龄" width="115" />
<el-table-column prop="entrust" label="医嘱" width="200" />
<el-table-column prop="is_pay" label="是否交费" width="80">
<template #default="scope">
<span v-if="scope.row.is_pay==1"></span>
<span v-if="scope.row.is_pay==0"></span>
</template>
</el-table-column>
<el-table-column prop="reservation_date" label="预约日期" width="120" />
<el-table-column prop="check_begin_time" label="预约时间" width="120">
<template #default="scope">
<span
v-if="scope.row.period_begin_time && scope.row.period_end_time ">{{scope.row.period_begin_time.substring(0, 5)}}~{{scope.row.period_end_time.substring(0, 5)}}</span>
</template>
</el-table-column>
<el-table-column prop="department_resources_name" label="预约资源" width="120" />
<el-table-column prop="devices" label="服务组">
<template #default="scope">
<div style="white-space: nowrap;">
<span v-for="(item,index) in scope.row.devices" :key="index">
{{ item.device_name+ ' ' }}
</span>
</div>
</template>
</el-table-column>
<el-table-column prop="reservation_department" label="申请科室" width="120" />
<el-table-column prop="" label="医嘱时间" width="160">
<template #default="scope">
{{scope.row.entrust_date}} {{scope.row.entrust_time}}
</template>
</el-table-column>
<el-table-column prop="docotr" label="申请医生" width="80" />
<el-table-column prop="patient_type" label="病人类型" width="80">
<template #default="scope">
<span v-if="scope.row.patient_type==0"></span>
<span v-if="scope.row.patient_type==1"></span>
<span v-if="scope.row.patient_type==2"></span>
<span v-if="scope.row.patient_type==3"></span>
</template>
</el-table-column>
<el-table-column prop="user_phone" label="电话" width="120" />
<!-- <el-table-column prop="implement_department" label="执行科室" width="120" /> -->
<el-table-column prop="department_resources_name" label="操作" width="120">
<template #default="scope">
<el-button type="primary" @click="Edit(scope.row)" size="small">修改</el-button>
<el-button type="danger" @click="Del(scope.row.id)" size="small">删除</el-button>
<el-button @click="showLog(scope.row)" size="small">查看日志</el-button>
</template>
</el-table-column>
</el-table>
<el-dialog v-model="dialogVisible" title="适应人群设置">
<div class="chuansuokuang" v-loading="loading">
<el-form :model="Info" label-width="80" style="max-width: 600px">
<el-form-item label="名称">
<el-input v-model="Info.name" />
</el-form-item>
</el-form>
<div class="page">
<el-pagination v-model:current-page="currentPage" v-model:page-size="pageSize"
:page-sizes="[15, 50, 100, 200]" layout="total,sizes, prev, pager, next" :total="total"
@size-change="PageSizeChange" @current-change="PageCurrentChange" />
</div>
<el-dialog v-model="LogShow" title="变更记录" width="50%">
<div>
<el-table :data="LogList" style="width: 100%;" row-key="id">
<el-table-column prop="list_status" label="状态" width="100">
<template #default="scope">
<el-tag v-if="scope.row.new_status==0" class="ml-2" type="info"></el-tag>
<el-tag v-if="scope.row.new_status==1" class="ml-2" type="success"></el-tag>
<el-tag v-if="scope.row.new_status==2" class="ml-2"></el-tag>
<el-tag v-if="scope.row.new_status==3" class="ml-2" type="warning"></el-tag>
</template>
</el-table-column>
<el-table-column prop="reg_num" label="登记号" />
<el-table-column prop="note" label="说明" />
<el-table-column prop="created_at" label="记录时间" />
<el-table-column prop="data" label="状态" width="100">
<template #default="scope">
<el-button @click="showLogJson(scope.row.data)" size="small">查看data</el-button>
</template>
</el-table-column>
</el-table>
</div>
<template #footer>
<span class="dialog-footer">
<el-button @click="dialogVisible = false">取消</el-button>
<el-button type="primary" @click="Save()">
确定
</el-button>
</span>
</template>
</el-dialog>
<el-dialog v-model="LogDataShow" title="查看dataJson" width="40%">
<div style="word-break: break-all">
{{LogDataJson}}
</div>
</el-dialog>
<div id="shenqingdan" v-if="shenqingdan_show">
<div v-for="(item,index) in shenqingdan_list" :key="index">
<div style="width: 100%;text-align: center;font-size: 14px;">演示医院</div>
<div style="width: 100%;text-align: center;font-size: 18px;font-weight: bold;">检查申请单</div>
<div style="width: 100%; border: 1px solid #ccc;padding: 20px;">
<div>检查项目{{item.maininfo.entrust}}</div>
</div>
</div>
</div>
</div>
</template>
@ -56,9 +156,13 @@
ElMessage,
ElMessageBox
} from 'element-plus'
import YuYue from '@/components/Yewu/YuYue.vue'
import {
GetMainList,
GetServiceDateTime
CancelYuYue,
GetServiceDateTime,
CheckEntrstItemGroup,
getMainDetail,GetLoglist
} from '@/api/api.js'
let loading = ref(false)
let searchInfo = ref({})
@ -66,6 +170,11 @@
let currentPage = ref(1) //
let pageSize = ref(15) //
let total = 0 //
let YuYueKey = ref(0); //key,
let tableref = ref(null)
let tableSelected = ref([]);
let Is_AutoDuoRen = ref([]); //
let shenqingdan_show = ref(false);
const PageSizeChange = (e) => { //
pageSize.value = e
GetList()
@ -74,8 +183,9 @@
currentPage.value = e
GetList()
}
const GetList = () => {
tableSelected.value = []
loading.value = true
GetMainList({
searchInfo: searchInfo.value,
@ -91,60 +201,276 @@
}
})
}
let Info = ref({});
let dialogVisible = ref(false);
const Add = () => {
Info.value = {}
Info.value.id = 0
Info.value.status = 1
dialogVisible.value = true
let YuYueDialogVisible = ref(false); //
let YuYueInfo = ref({});
const openYuYue = (type) => {
if(tableSelected.value.length==0){
ElMessage.error('请勾选项目')
return false
}
if (type == 1) {
if (!tableSelected.value.every(item => item.list_status === 0)) {
ElMessage.error('当前勾选项目,不能预约')
return false
}
}
if (type == 2) {
if (!tableSelected.value.every(item => item.list_status === 1)) {
ElMessage.error('当前勾选项目,不能改约预约')
return false
}
}
YuYueInfo.value.entrustInfo = mergeByRegNum(tableSelected.value)
YuYueKey.value++;
YuYueInfo.value.dotype = type //12
YuYueInfo.value.appointment_type = 4 //id 4
YuYueDialogVisible.value = true;
}
const Save = () => {
loading.value = true
ComboCrowdSave({
Info: Info.value
}).then(res => {
loading.value = false
if (res.status) {
dialogVisible.value = false
GetList()
} else {
ElMessage.error(res.msg)
//
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,
password: value
}).then(res => {
loading.value = false
if (res.status) {
ElMessage({
message: res.msg,
type: 'success',
})
GetList()
} else {
ElMessage.error(res.msg)
}
})
})
.catch(() => {
})
}
const Edit=(row)=>{
dialogVisible.value = true
Info.value.name =row.name
Info.value.id = row.id
//
const TableSelectChange = (e) => {
if (e.length > 1) {
const firstStatus = e[0].list_status;
// ,1
const allEqual = e.every(item => item.list_status === firstStatus);
if (!allEqual) {
SelectClear()
e = [e[e.length - 1]]
}
}
if (e[e.length - 1].list_status != 0) { //1
SelectClear()
e = [e[e.length - 1]]
}
let select_qian = tableSelected.value ? tableSelected.value.length : 0
//SelectClear()
autoSeleted(e)
if (select_qian > tableSelected.value.length) {
} else {
if (Is_AutoDuoRen.value.length == 0) { //
FindPersonMatchItem()
}
if (Is_AutoDuoRen.value.length == 1) { //
FindAllMatchItem()
}
}
}
//
const GetDetailFunc=(id)=>{
loading.value = true
PlanTypeGetDetail({
id: id
}).then(res => {
loading.value = false
if (res.status) {
Info.value=res.data
} else {
ElMessage.error(res.msg)
//
const SelectClear = () => {
tableref.value.clearSelection()
tableSelected.value = []
}
const autoSeleted = (rows) => {
if (rows) {
rows.forEach((row) => {
if (row != undefined) {
tableref.value.toggleRowSelection(row, true)
}
})
tableSelected.value = rows
} else {
SelectClear()
}
}
//
const FindAllMatchItem = () => {
console.log(tableSelected.value)
tableSelected.value.reverse();
let temp_reg_num = ''
let chongzhi = false;
let list = []
if (tableSelected.value[0].list_status != 0) return false //
tableData.value.forEach((v, i) => {
if (v.list_status == 0) {
if (v.id == tableSelected.value[0].id) {
list.push({
name: v.entrust,
rowid: i,
first: 1
})
} else {
list.push({
name: v.entrust,
rowid: i,
first: 0
})
}
}
})
if (list.length >= 2) {
loading.value = true
CheckEntrstItemGroup({
items: list
}).then(res => {
loading.value = false
if (res.status) {
let group = res.data.group
if (group.length > 1) {
ItemGroupShow.value = true;
ItemGroup.value = group
} else {
SelectClear();
let d = []
group[0].forEach((vv, ii) => {
vv.rowid.forEach((v3, i3) => {
d.push(tableData.value[v3])
})
})
autoSeleted(d)
}
} else {
ElMessage.error(res.msg)
}
})
}
}
const Del=(id)=>{
loading.value = true
ComboCrowdDel({
id: id
}).then(res => {
loading.value = false
if (res.status) {
GetList()
} else {
ElMessage.error(res.msg)
let ItemGroupShow = ref(false);
let ItemGroup = ref(null);
//
const FindPersonMatchItem = () => {
console.log('开始匹配个人项目')
tableSelected.value.reverse();
let temp_reg_num = ''
let chongzhi = false;
tableSelected.value.forEach((v, i) => {
if (temp_reg_num == '') {
temp_reg_num = v.reg_num
}
if (temp_reg_num != '' && temp_reg_num != v.reg_num) {
chongzhi = true
}
})
if (chongzhi === true) {
let a = tableSelected.value[0]
SelectClear();
autoSeleted([a])
}
console.log(tableSelected.value)
let list = []
if (tableSelected.value[0].list_status != 0) return false //
tableData.value.forEach((v, i) => {
if (v.list_status == 0 && v.reg_num == tableSelected.value[0].reg_num && v.episodeid ==
tableSelected.value[0].episodeid) {
if (v.id == tableSelected.value[0].id) {
list.push({
name: v.entrust,
rowid: i,
first: 1
})
} else {
list.push({
name: v.entrust,
rowid: i,
first: 0
})
}
}
})
if (list.length >= 2) {
loading.value = true
CheckEntrstItemGroup({
items: list
}).then(res => {
loading.value = false
if (res.status) {
let group = res.data.group
if (group.length > 10000000) {
ItemGroupShow.value = true;
ItemGroup.value = group
} else {
SelectClear();
let d = []
group[0].forEach((vv, ii) => {
vv.rowid.forEach((v3, i3) => {
d.push(tableData.value[v3])
})
})
autoSeleted(d)
}
} else {
ElMessage.error(res.msg)
}
})
}
}
function mergeByRegNum(items) {
return items.reduce((acc, item) => {
const existingItem = acc.find(i => i.reg_num === item.reg_num);
if (existingItem) {
// reg_numidids
existingItem.entrustid.push(item.entrust_id);
} else {
// reg_num
acc.push({
entrustid: [item.entrust_id],
reg_num: item.reg_num,
episodeid: item.episodeid
});
}
return acc;
}, []);
}
const YuYueDialogClose = () => {
GetList()
}
//
const GetServiceDate = () => {
@ -156,14 +482,68 @@
}
})
}
//
let LogShow = ref(false);
let LogList = ref(null);
let LogDataShow = ref(false);
const showLog = (row) => {
LogShow.value = true
GetLoglist({
id: row.id
}).then(res => {
if (res.status) {
LogList.value = res.data
}
})
}
let LogDataJson = ref('');
const showLogJson = (data) => {
LogDataShow.value = true
LogDataJson.value = data
}
//
let print_shenqingdan_button = ref(null);
let shenqingdan_list = ref([])
const print_shenqingdan = () => {
if (tableSelected.value.length !== 1) {
ElMessage.error('请选择1项进行打印')
return false
}
getMainDetail({
regnum: tableSelected.value[0].reg_num,
entrustid: tableSelected.value[0].entrust_id,
episodeid: tableSelected.value[0].episodeid,
appointment_type: 4
}).then(res => {
if (res.status) {
let enable = true
shenqingdan_list.value = res.data.info
shenqingdan_list.value.forEach((v, i) => {
if (v.maininfo.list_status != 1) {
ElMessage.error(v.maininfo.entrust + " 不可打印,请重新选择")
enable = false
}
})
if (enable) {
shenqingdan_show.value = true
setTimeout(function() {
print_shenqingdan_button.value.$el.click();
shenqingdan_show.value = false
}, 500)
}
} else {
ElMessage.error(res.msg)
}
})
}
onMounted(() => {
GetList()
GetServiceDate()
GetServiceDate()
})
</script>
<style scoped>
.head{
.head {
margin: 10px auto;
}
</style>
Loading…
Cancel
Save