|
|
|
@ -2,18 +2,18 @@
|
|
|
|
<div class="YuYue202506">
|
|
|
|
<div class="YuYue202506">
|
|
|
|
|
|
|
|
|
|
|
|
<div class="patientInfo" v-if="patientInfo">
|
|
|
|
<div class="patientInfo" v-if="patientInfo">
|
|
|
|
<div class="item"><span class="name">{{patientInfo.user_name}}</span>({{patientInfo.user_sex_label}} {{patientInfo.age}}岁)</div>
|
|
|
|
<div class="item"><span class="name">{{patientInfo.user_name}}</span>({{patientInfo.user_sex_label}} {{patientInfo.age}}岁)</div>
|
|
|
|
<div class="item">登记号:<span class="value">{{patientInfo.reg_num}} </span></div>
|
|
|
|
<div class="item">登记号:<span class="value">{{patientInfo.reg_num}} </span></div>
|
|
|
|
<div class="item">电话:<span class="value">{{patientInfo.user_phone}}</span></div>
|
|
|
|
<div class="item">电话:<span class="value">{{patientInfo.user_phone}}</span></div>
|
|
|
|
<div class="item" v-if="patientInfo.warddesc">病区:<span class="value">{{patientInfo.warddesc}}</span></div>
|
|
|
|
<div class="item" v-if="patientInfo.warddesc">病区:<span class="value">{{patientInfo.warddesc}}</span></div>
|
|
|
|
<div class="item" v-if="patientInfo.bedname">床号:<span class="value">{{patientInfo.bedname}}</span></div>
|
|
|
|
<div class="item" v-if="patientInfo.bedname">床号:<span class="value">{{patientInfo.bedname}}</span></div>
|
|
|
|
<div class="item">诊断:<span class="value">{{patientInfo.diagnosisName}}</span></div>
|
|
|
|
<div class="item">诊断:<span class="value">{{patientInfo.diagnosisName}}</span></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div v-else>
|
|
|
|
<div v-else>
|
|
|
|
获取患者信息失败
|
|
|
|
获取患者信息失败
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<div class="entrustList">
|
|
|
|
<div class="entrustList">
|
|
|
|
<el-alert v-if="hasDifferentBookedDates" title="患者所有检查项目未预约至同一天,请注意是否需手动调整预约" type="danger" :closable="false" show-icon style="margin-bottom: 8px;" />
|
|
|
|
<el-alert v-if="hasDifferentBookedDates" title="患者所有检查项目未预约至同一天,请注意是否需手动调整预约" type="danger" :closable="false" show-icon style="margin-bottom: 8px;" />
|
|
|
|
<el-table :data="entrustTableDate" style="width: 100%;" height="300" row-key="id" v-loading="loading"
|
|
|
|
<el-table :data="entrustTableDate" style="width: 100%;" height="300" row-key="id" v-loading="loading"
|
|
|
|
ref="entrustTableRef" :row-class-name="setRowClassName" @selection-change="handleSelectionChange">
|
|
|
|
ref="entrustTableRef" :row-class-name="setRowClassName" @selection-change="handleSelectionChange">
|
|
|
|
<el-table-column type="selection" width="50" :selectable="selectable" />
|
|
|
|
<el-table-column type="selection" width="50" :selectable="selectable" />
|
|
|
|
@ -105,7 +105,7 @@
|
|
|
|
}" @click="PlanClick(item2.id)"><span
|
|
|
|
}" @click="PlanClick(item2.id)"><span
|
|
|
|
v-if="index2=='time_range'">{{item2}}</span><span>{{item2.use_count}}</span></td>
|
|
|
|
v-if="index2=='time_range'">{{item2}}</span><span>{{item2.use_count}}</span></td>
|
|
|
|
</tr>
|
|
|
|
</tr>
|
|
|
|
|
|
|
|
|
|
|
|
</table>
|
|
|
|
</table>
|
|
|
|
<div v-if="selectedRows.length==0">
|
|
|
|
<div v-if="selectedRows.length==0">
|
|
|
|
<el-empty description="请选择项目" />
|
|
|
|
<el-empty description="请选择项目" />
|
|
|
|
@ -147,7 +147,7 @@
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
ref,
|
|
|
|
ref,
|
|
|
|
onMounted,
|
|
|
|
onMounted,
|
|
|
|
watch,computed
|
|
|
|
watch,computed
|
|
|
|
} from 'vue'
|
|
|
|
} from 'vue'
|
|
|
|
import {
|
|
|
|
import {
|
|
|
|
getMainDetail,
|
|
|
|
getMainDetail,
|
|
|
|
@ -184,7 +184,7 @@
|
|
|
|
},
|
|
|
|
},
|
|
|
|
special_privileges:{
|
|
|
|
special_privileges:{
|
|
|
|
type: Array,
|
|
|
|
type: Array,
|
|
|
|
default: () => []
|
|
|
|
default: () => []
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
let entrustTableRef = ref(null)
|
|
|
|
let entrustTableRef = ref(null)
|
|
|
|
@ -210,7 +210,7 @@
|
|
|
|
let TanChuangMsgDialogVisible=ref(false)
|
|
|
|
let TanChuangMsgDialogVisible=ref(false)
|
|
|
|
const getWeekday = (date1) => {
|
|
|
|
const getWeekday = (date1) => {
|
|
|
|
let days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
|
|
let days = ['周日', '周一', '周二', '周三', '周四', '周五', '周六'];
|
|
|
|
const date = new Date(date1); // 注意:格式可能因浏览器而异
|
|
|
|
const date = new Date(date1); // 注意:格式可能因浏览器而异
|
|
|
|
const dayOfWeek = date.getDay();
|
|
|
|
const dayOfWeek = date.getDay();
|
|
|
|
return days[dayOfWeek]
|
|
|
|
return days[dayOfWeek]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
@ -236,7 +236,7 @@
|
|
|
|
selectedMianListId.value.push(v.id)
|
|
|
|
selectedMianListId.value.push(v.id)
|
|
|
|
selectedEntrustId.value.push(v.entrust_id)
|
|
|
|
selectedEntrustId.value.push(v.entrust_id)
|
|
|
|
})
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
|
|
//遍历已经勾选的项目 如果号源id都相同则 获取可以选定的号源id.------------vvvv
|
|
|
|
//遍历已经勾选的项目 如果号源id都相同则 获取可以选定的号源id.------------vvvv
|
|
|
|
const allPlanIdsSame = selectedRows.value.every(
|
|
|
|
const allPlanIdsSame = selectedRows.value.every(
|
|
|
|
(v) => v.roster_id === selectedRows.value[0]?.roster_id
|
|
|
|
(v) => v.roster_id === selectedRows.value[0]?.roster_id
|
|
|
|
@ -244,7 +244,7 @@
|
|
|
|
if (allPlanIdsSame) {
|
|
|
|
if (allPlanIdsSame) {
|
|
|
|
selectedPlanId.value = selectedRows.value[0]?.roster_id;
|
|
|
|
selectedPlanId.value = selectedRows.value[0]?.roster_id;
|
|
|
|
if(selectedPlanId.value!==0 && selectedPlanId.value){
|
|
|
|
if(selectedPlanId.value!==0 && selectedPlanId.value){
|
|
|
|
|
|
|
|
|
|
|
|
startDate.value=selectedRows.value[0]?.reservation_date
|
|
|
|
startDate.value=selectedRows.value[0]?.reservation_date
|
|
|
|
if(checkDateDifference15Day(getTodayDate(),selectedRows.value[0]?.reservation_date) && !!selectedRows.value[0]?.reservation_date){
|
|
|
|
if(checkDateDifference15Day(getTodayDate(),selectedRows.value[0]?.reservation_date) && !!selectedRows.value[0]?.reservation_date){
|
|
|
|
date_list.value=getDatesAfter(selectedRows.value[0]?.reservation_date)
|
|
|
|
date_list.value=getDatesAfter(selectedRows.value[0]?.reservation_date)
|
|
|
|
@ -257,17 +257,17 @@
|
|
|
|
selectedPlanId.value = 0;
|
|
|
|
selectedPlanId.value = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//--------------------------------------------------------------^^^^^
|
|
|
|
//--------------------------------------------------------------^^^^^
|
|
|
|
|
|
|
|
|
|
|
|
lastSelection.value.forEach(lastRow => {
|
|
|
|
lastSelection.value.forEach(lastRow => {
|
|
|
|
if (!selectedRows.value.find(s => s === lastRow)) {
|
|
|
|
if (!selectedRows.value.find(s => s === lastRow)) {
|
|
|
|
handleType.value = 'cancel'
|
|
|
|
handleType.value = 'cancel'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
});
|
|
|
|
});
|
|
|
|
if(selectedRows.value.length==0){//如果全部取消了,则恢复状态
|
|
|
|
if(selectedRows.value.length==0){//如果全部取消了,则恢复状态
|
|
|
|
handleType.value = 'add'
|
|
|
|
handleType.value = 'add'
|
|
|
|
lastSelection.value=[]
|
|
|
|
lastSelection.value=[]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
console.log(handleType.value)
|
|
|
|
console.log(handleType.value)
|
|
|
|
if (selectedEntrustId.value.length > 0 && isHandlingSelection.value) {
|
|
|
|
if (selectedEntrustId.value.length > 0 && isHandlingSelection.value) {
|
|
|
|
if (handleType.value === 'add' && selectedRows.value[0].list_status==0) {
|
|
|
|
if (handleType.value === 'add' && selectedRows.value[0].list_status==0) {
|
|
|
|
@ -349,20 +349,20 @@
|
|
|
|
//date_list.value = getDatesAfter(entrustTableDate.value[i].reservation_date)
|
|
|
|
//date_list.value = getDatesAfter(entrustTableDate.value[i].reservation_date)
|
|
|
|
activeZhenShi.value=entrustTableDate.value[i].department_resources?.department_resources_name
|
|
|
|
activeZhenShi.value=entrustTableDate.value[i].department_resources?.department_resources_name
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if(onMountedStatus.value){//如果是第一次进入,弹窗提示异常项目的状态
|
|
|
|
if(onMountedStatus.value){//如果是第一次进入,弹窗提示异常项目的状态
|
|
|
|
onMountedStatus.value=false;
|
|
|
|
onMountedStatus.value=false;
|
|
|
|
if(TanChuangMsg.value.length>0){
|
|
|
|
if(TanChuangMsg.value.length>0){
|
|
|
|
console.log('22222222222222',TanChuangMsg.value)
|
|
|
|
console.log('22222222222222',TanChuangMsg.value)
|
|
|
|
TanChuangMsgDialogVisible.value=true;
|
|
|
|
TanChuangMsgDialogVisible.value=true;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
@ -373,7 +373,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const FindAllMatchItem = () => {
|
|
|
|
const FindAllMatchItem = () => {
|
|
|
|
|
|
|
|
|
|
|
|
let list = []
|
|
|
|
let list = []
|
|
|
|
//selectedRows.value.reverse();
|
|
|
|
//selectedRows.value.reverse();
|
|
|
|
let length=selectedRows.value.length
|
|
|
|
let length=selectedRows.value.length
|
|
|
|
@ -471,7 +471,7 @@
|
|
|
|
const timeSlots = Array.from(timeSlotsSet).sort(); // 排序可选
|
|
|
|
const timeSlots = Array.from(timeSlotsSet).sort(); // 排序可选
|
|
|
|
|
|
|
|
|
|
|
|
// Step 2: 构建表格数据
|
|
|
|
// Step 2: 构建表格数据
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
timeSlots.forEach(timeRange => {
|
|
|
|
timeSlots.forEach(timeRange => {
|
|
|
|
const row = {
|
|
|
|
const row = {
|
|
|
|
@ -489,9 +489,6 @@
|
|
|
|
if (matchingPlan) {
|
|
|
|
if (matchingPlan) {
|
|
|
|
if (matchingPlan.count - matchingPlan.used_count >= zhanWeiCount && matchingPlan.plan_enable===true) {
|
|
|
|
if (matchingPlan.count - matchingPlan.used_count >= zhanWeiCount && matchingPlan.plan_enable===true) {
|
|
|
|
plan_enable = true
|
|
|
|
plan_enable = true
|
|
|
|
if(selectedPlanId.value == 0 || selectedPlanId.value == '' || selectedPlanId.value==null && matchingPlan.id==res.data.earliestPlan){
|
|
|
|
|
|
|
|
selectedPlanId.value=matchingPlan.id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if(is_emergency===true && matchingPlan.plan_enable===true && canEmergency.value==true){
|
|
|
|
if(is_emergency===true && matchingPlan.plan_enable===true && canEmergency.value==true){
|
|
|
|
plan_enable = true
|
|
|
|
plan_enable = true
|
|
|
|
@ -512,7 +509,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
planTableData.value.push(row);
|
|
|
|
planTableData.value.push(row);
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 默认选中第一个有号源的 plan(按后端排序:时间最近、号源最多)
|
|
|
|
|
|
|
|
selectedPlanId.value = 0
|
|
|
|
|
|
|
|
const firstAvailable = plans.find(v =>
|
|
|
|
|
|
|
|
v.department_resources_name == activeZhenShi.value &&
|
|
|
|
|
|
|
|
(v.count - v.used_count) >= zhanWeiCount &&
|
|
|
|
|
|
|
|
v.plan_enable === true
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
if (firstAvailable) {
|
|
|
|
|
|
|
|
selectedPlanId.value = firstAvailable.id
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
ElMessage.error(res.msg)
|
|
|
|
@ -547,7 +555,7 @@
|
|
|
|
end_time: record.end_time,
|
|
|
|
end_time: record.end_time,
|
|
|
|
remaining_count: record.remaining_count,
|
|
|
|
remaining_count: record.remaining_count,
|
|
|
|
status: record.status
|
|
|
|
status: record.status
|
|
|
|
// 如果需要,可以在这里添加其他字段
|
|
|
|
// 如果需要,可以在这里添加其他字段
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
@ -555,6 +563,7 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const zhenshiClick = (zhenshi) => {
|
|
|
|
const zhenshiClick = (zhenshi) => {
|
|
|
|
activeZhenShi.value = zhenshi
|
|
|
|
activeZhenShi.value = zhenshi
|
|
|
|
|
|
|
|
selectedPlanId.value = 0
|
|
|
|
GetEnablePlanFunc()
|
|
|
|
GetEnablePlanFunc()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
const PlanClick = (planid) => {
|
|
|
|
const PlanClick = (planid) => {
|
|
|
|
@ -601,10 +610,10 @@
|
|
|
|
ElMessage.error("请选择号源")
|
|
|
|
ElMessage.error("请选择号源")
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
let msg='确定预约此时间吗?'
|
|
|
|
let msg='确定预约此时间吗?'
|
|
|
|
if(type==2){
|
|
|
|
if(type==2){
|
|
|
|
msg='确定改约至此时间吗?'
|
|
|
|
msg='确定改约至此时间吗?'
|
|
|
|
}
|
|
|
|
}
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
msg,
|
|
|
|
msg,
|
|
|
|
@ -663,11 +672,11 @@
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//取消预约(此界面取消预约,不验证密码)
|
|
|
|
//取消预约(此界面取消预约,不验证密码)
|
|
|
|
const CancelYuYueFunc = () => {
|
|
|
|
const CancelYuYueFunc = () => {
|
|
|
|
|
|
|
|
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
ElMessageBox.confirm(
|
|
|
|
'确定取消预约吗?',
|
|
|
|
'确定取消预约吗?',
|
|
|
|
'提示', {
|
|
|
|
'提示', {
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
confirmButtonText: '确定',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
cancelButtonText: '取消',
|
|
|
|
@ -724,11 +733,11 @@
|
|
|
|
OrderNoList: selectedEntrustId.value,
|
|
|
|
OrderNoList: selectedEntrustId.value,
|
|
|
|
}).then(res => {
|
|
|
|
}).then(res => {
|
|
|
|
if(res.status){
|
|
|
|
if(res.status){
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//打印申请单
|
|
|
|
//打印申请单
|
|
|
|
let shenqingdan_list = ref([])
|
|
|
|
let shenqingdan_list = ref([])
|
|
|
|
const print_shenqingdan = () => {
|
|
|
|
const print_shenqingdan = () => {
|
|
|
|
getMainDetail({
|
|
|
|
getMainDetail({
|
|
|
|
@ -742,7 +751,7 @@
|
|
|
|
shenqingdan_list.value = res.data.info
|
|
|
|
shenqingdan_list.value = res.data.info
|
|
|
|
shenqingdan_list.value.forEach((v, i) => {
|
|
|
|
shenqingdan_list.value.forEach((v, i) => {
|
|
|
|
if (v.maininfo.list_status != 1) {
|
|
|
|
if (v.maininfo.list_status != 1) {
|
|
|
|
ElMessage.error(v.maininfo.entrust + " 不可打印,请重新选择")
|
|
|
|
ElMessage.error(v.maininfo.entrust + " 不可打印,请重新选择")
|
|
|
|
enable = false
|
|
|
|
enable = false
|
|
|
|
}
|
|
|
|
}
|
|
|
|
})
|
|
|
|
})
|
|
|
|
@ -796,38 +805,38 @@
|
|
|
|
if (!datePattern.test(dateString)) {
|
|
|
|
if (!datePattern.test(dateString)) {
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// 创建 Date 对象并检查是否为有效日期
|
|
|
|
// 创建 Date 对象并检查是否为有效日期
|
|
|
|
const date = new Date(dateString);
|
|
|
|
const date = new Date(dateString);
|
|
|
|
return date.toString() !== "Invalid Date" &&
|
|
|
|
return date.toString() !== "Invalid Date" &&
|
|
|
|
!isNaN(date.getTime());
|
|
|
|
!isNaN(date.getTime());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
function checkDateDifference15Day(date1, date2) {
|
|
|
|
function checkDateDifference15Day(date1, date2) {
|
|
|
|
// 校验日期格式是否正确
|
|
|
|
// 校验日期格式是否正确
|
|
|
|
if (!isValidDate(date1) || !isValidDate(date2)) {
|
|
|
|
if (!isValidDate(date1) || !isValidDate(date2)) {
|
|
|
|
console.error("日期格式不正确,请使用 YYYY-MM-DD");
|
|
|
|
console.error("日期格式不正确,请使用 YYYY-MM-DD");
|
|
|
|
return false; // 或者抛出异常、提示用户等
|
|
|
|
return false; // 或者抛出异常、提示用户等
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const startDate = new Date(date1);
|
|
|
|
const startDate = new Date(date1);
|
|
|
|
const endDate = new Date(date2);
|
|
|
|
const endDate = new Date(date2);
|
|
|
|
|
|
|
|
|
|
|
|
// 计算时间差(毫秒)
|
|
|
|
// 计算时间差(毫秒)
|
|
|
|
const diffInMs = endDate - startDate;
|
|
|
|
const diffInMs = endDate - startDate;
|
|
|
|
|
|
|
|
|
|
|
|
// 转换为天数
|
|
|
|
// 转换为天数
|
|
|
|
const diffInDays = diffInMs / (1000 * 60 * 60 * 24);
|
|
|
|
const diffInDays = diffInMs / (1000 * 60 * 60 * 24);
|
|
|
|
|
|
|
|
|
|
|
|
return diffInDays > 15;
|
|
|
|
return diffInDays > 15;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
function getTodayDate() {
|
|
|
|
function getTodayDate() {
|
|
|
|
const today = new Date();
|
|
|
|
const today = new Date();
|
|
|
|
|
|
|
|
|
|
|
|
const year = today.getFullYear(); // 年份,如 2025
|
|
|
|
const year = today.getFullYear(); // 年份,如 2025
|
|
|
|
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,所以要 +1
|
|
|
|
const month = String(today.getMonth() + 1).padStart(2, '0'); // 月份从 0 开始,所以要 +1
|
|
|
|
const day = String(today.getDate()).padStart(2, '0'); // 日期
|
|
|
|
const day = String(today.getDate()).padStart(2, '0'); // 日期
|
|
|
|
|
|
|
|
|
|
|
|
return `${year}-${month}-${day}`;
|
|
|
|
return `${year}-${month}-${day}`;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
let onMountedStatus=ref(false)
|
|
|
|
let onMountedStatus=ref(false)
|
|
|
|
|