|
|
|
@ -94,14 +94,6 @@ |
|
|
|
</div> |
|
|
|
<div class="flex-line"></div> |
|
|
|
<div class="flex-right" v-if="form.worktimes"> |
|
|
|
<!-- <GuipFormItem column="column" label="每周出诊安排" :required="true"> |
|
|
|
|
|
|
|
<div class="flex weekPlan" slot="formDom"> |
|
|
|
<GuipSelect v-for="day in weekDays" :key="day.id" v-model="form.worktimes[day.id].plan" |
|
|
|
:options="options_weekPlan" :label="day.name" placeholder="休息"></GuipSelect> |
|
|
|
</div> |
|
|
|
|
|
|
|
</GuipFormItem> --> |
|
|
|
<GuipFormItem column="column" class="mb24" label="工作时间( 下午 )" :required="true"> |
|
|
|
<el-time-picker slot="formDom" style="width:100%" is-range v-model="form.afternoon_worktime" |
|
|
|
range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围" |
|
|
|
@ -350,7 +342,8 @@ |
|
|
|
<div class="header-left"> |
|
|
|
<span class="month-text">{{ formatMonth(currentDay) }}</span> |
|
|
|
<span v-if="isCurrentMonth(currentDay)" class="current-month-badge">(本月)</span> |
|
|
|
<span class="header-tip" v-if="conflictCount > 0">本月有 {{ conflictCount }} 天出诊医院重合,请检查——</span> |
|
|
|
<span class="header-tip" v-if="conflictCount > 0 && !is_allow_coincide">本月有 {{ conflictCount }} |
|
|
|
天出诊医院重合,请检查——</span> |
|
|
|
</div> |
|
|
|
<div class="header-right"> |
|
|
|
<el-button-group> |
|
|
|
@ -372,8 +365,7 @@ |
|
|
|
<el-tooltip placement="bottom" :disabled="hosList.length == 1" |
|
|
|
v-if="hasScheduleData(data.day, date)" popper-class="schedule-tooltip"> |
|
|
|
<!-- getDateCellClass 控制单独医院 的类名--> |
|
|
|
<div class="calendar-date" |
|
|
|
@click="handleDateClick(data.day,$event, date)" |
|
|
|
<div class="calendar-date" @click="handleDateClick(data.day, $event, date, data)" |
|
|
|
:class="[hosList.length == 1 ? getDateCellClass(data.day) : '', (isConflictDate(data.day) && !is_allow_coincide) ? 'conflict-date' : '']"> |
|
|
|
<div class="date-header flex-between"> |
|
|
|
<div class="flex gap12"> |
|
|
|
@ -395,7 +387,9 @@ |
|
|
|
<div v-for="(shiftType, key) in plantype" :key="key"> |
|
|
|
<div v-if="key !== '0' && getDateSchedule(data.day)[key] && getDateSchedule(data.day)[key].length > 0" |
|
|
|
class="schedule-item" :class="getScheduleItemClass(data.day, key)"> |
|
|
|
<span class="shift-type">{{ shiftType }}</span> |
|
|
|
<span class="shift-type" |
|
|
|
:style="(hosList.length == 1 && getDateCellClass(data.day) == 'shift-type-0') ? 'text-decoration:line-through' : ''">{{ |
|
|
|
shiftType }}</span> |
|
|
|
<div class="hospital-tags" v-if="hosList.length > 1"> |
|
|
|
<span v-for="hospital in getDateSchedule(data.day)[key]" |
|
|
|
:key="hospital.hid" |
|
|
|
@ -607,22 +601,74 @@ |
|
|
|
</GuipDialog> |
|
|
|
|
|
|
|
<GuipDialog :dialogVisible="singleHosVisiable" :title="singleHosTitle" :show-close-button="false" width="599px" |
|
|
|
:show-cancel-button="true" @confirm="singleTempCancel" @cancel="singleTempConfirm" ref="singleHosRef"> |
|
|
|
<p class="mb24"> |
|
|
|
:show-cancel-button="true" @confirm="singleTempConfirm" @cancel="singleTempCancel" ref="singleHosRef"> |
|
|
|
<p class="" v-if="isShowDialogDate"> |
|
|
|
{{ currentEditingDate }}{{ isToday(currentEditingDate) ? '(今日)' : '' }} |
|
|
|
</p> |
|
|
|
<div class="flex" v-if="currentEditingHospital"> |
|
|
|
<div class="flex mt24" v-if="currentEditingHospital"> |
|
|
|
<el-radio v-model="currentEditingHospital.currentPlan" :label="'1'">上午出诊</el-radio> |
|
|
|
<el-radio v-model="currentEditingHospital.currentPlan" :label="'2'">下午出诊</el-radio> |
|
|
|
<el-radio v-model="currentEditingHospital.currentPlan" :label="'3'">全天出诊</el-radio> |
|
|
|
<el-radio v-model="currentEditingHospital.currentPlan" :label="'0'">不出诊</el-radio> |
|
|
|
</div> |
|
|
|
</GuipDialog> |
|
|
|
|
|
|
|
<GuipDialog :dialogVisible="moreHosVisiable" title="出诊日历" :show-close-button="false" width="599px" |
|
|
|
:show-cancel-button="true" @cancel="moreTempCancel" @confirm="moreTempConfirm" ref="singleHosRef"> |
|
|
|
<p class="mb24"> |
|
|
|
{{ currentEditingDate }}{{ isToday(currentEditingDate) ? '(今日)' : '' }} |
|
|
|
</p> |
|
|
|
<el-form> |
|
|
|
<div class="flex mb24"> |
|
|
|
<span class="" style="width: 50px;margin-right: 24px;">上午班</span> |
|
|
|
<div class="select-container"> |
|
|
|
<div class="selected-hospitals-display" @click="toggleAfternoonDropdown('morn')"> |
|
|
|
{{ getAfternoonSelectedNames('morningSelectedHospitals') }} |
|
|
|
<i :class="['el-icon-arrow-down', { 'is-reverse': isMornDropdownOpen }]"></i> |
|
|
|
</div> |
|
|
|
<el-select placeholder="请选择" ref="afternoonSelect" class="hidden-select" @visible-change="handleMornVisibleChange"> |
|
|
|
<el-option v-for="item in hosList" :key="item.hid" :label="item.name" disabled |
|
|
|
> |
|
|
|
<div class="flex-between option-content"> |
|
|
|
<span style="color:#333">{{ item.name }}</span> |
|
|
|
<div class="checkbox-wrapper" @click.stop> |
|
|
|
<el-checkbox @change="handleWorkCheckDirect(item, $event,'morningSelectedHospitals')" |
|
|
|
:disabled="!is_allow_coincide" |
|
|
|
:checked="item.morning_plan == '1' ? true : false"></el-checkbox> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div class="flex"> |
|
|
|
<span style="width: 50px;margin-right: 24px;">下午班</span> |
|
|
|
<div class="select-container"> |
|
|
|
<div class="selected-hospitals-display" @click="toggleAfternoonDropdown('after')"> |
|
|
|
{{ getAfternoonSelectedNames('afternoonSelectedHospitals') }} |
|
|
|
<i :class="['el-icon-arrow-down', { 'is-reverse': isAfternoonDropdownOpen }]"></i> |
|
|
|
</div> |
|
|
|
<el-select placeholder="请选择" ref="afternoonSelect" class="hidden-select" @visible-change="handleAfternoonVisibleChange"> |
|
|
|
<el-option v-for="item in hosList" :key="item.hid" :label="item.name" disabled |
|
|
|
> |
|
|
|
<div class="flex-between option-content"> |
|
|
|
<span style="color:#333">{{ item.name }}</span> |
|
|
|
<div class="checkbox-wrapper" @click.stop> |
|
|
|
<el-checkbox @change="handleWorkCheckDirect(item, $event,'afternoonSelectedHospitals')" |
|
|
|
:disabled="!is_allow_coincide" |
|
|
|
:checked="item.afternoon_plan == '1' ? true : false"></el-checkbox> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
|
|
|
|
<div> |
|
|
|
<GuipSelect width="466px" :options="options_weekPlan" label="上午班" placeholder="休息"></GuipSelect> |
|
|
|
<GuipSelect width="466px" :options="options_weekPlan" label="下午班" placeholder="休息"></GuipSelect> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
|
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
</GuipDialog> |
|
|
|
<!-- freeRegVisible --> |
|
|
|
<GuipDialog :dialogVisible="freeRegVisible" title="免挂号费规则" :show-close-button="false" width="599px" |
|
|
|
@ -666,6 +712,7 @@ |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
<script> |
|
|
|
|
|
|
|
import GuipFormItem from '@/components/GuipFormItem.vue'; |
|
|
|
import PromptText from '@/components/PromptText.vue'; |
|
|
|
import BatchProject from '@/components/BatchProject.vue'; |
|
|
|
@ -683,6 +730,7 @@ import CustomDropdown from '@/components/CustomDropdown.vue'; |
|
|
|
import addPay from '@/components/addPay.vue'; |
|
|
|
import { mapState } from 'vuex'; |
|
|
|
import { Object } from 'core-js'; |
|
|
|
// const cityOptions = ['上海', '北京', '广州', '深圳']; |
|
|
|
const PAY_TYPE_WEIXIN = 2; // 微信 |
|
|
|
const PAY_TYPE_ALIPAY = 3; // 支付宝 |
|
|
|
|
|
|
|
@ -708,6 +756,8 @@ export default { |
|
|
|
}, |
|
|
|
data() { |
|
|
|
return { |
|
|
|
afterText: '', |
|
|
|
morningText: '', |
|
|
|
depart_id: false, |
|
|
|
doctor_id: false, |
|
|
|
dialogType: '1', |
|
|
|
@ -894,8 +944,9 @@ export default { |
|
|
|
}, |
|
|
|
weekDaysDesc: ['周日', '周一', '周二', '周三', '周四', '周五', '周六'], |
|
|
|
hosLength: 0, |
|
|
|
singleHosVisiable: false, |
|
|
|
singleHosTitle: '出诊日历', |
|
|
|
singleHosVisiable: false,//单个医院的 |
|
|
|
moreHosVisiable: false,//多个医院 |
|
|
|
singleHosTitle: '出诊日历',//单个医院弹框标题 |
|
|
|
temp_plans: null,//临时调诊 |
|
|
|
hosList: [],//医院信息 |
|
|
|
currentDay: new Date(), |
|
|
|
@ -908,6 +959,30 @@ export default { |
|
|
|
tempAdjustments: {}, // 存储临时调诊数据 {日期: {医院ID: {原班次, 新班次, 状态}}} |
|
|
|
currentEditingHospital: null, // 当前正在编辑的医院 |
|
|
|
currentEditingDate: null, // 当前正在编辑的日期 |
|
|
|
isShowDialogDate: false,//单个医院日期是否显示 |
|
|
|
morning_value: ['双皮奶', '鸡蛋'], |
|
|
|
options: [{ |
|
|
|
value: '选项1', |
|
|
|
label: '黄金糕' |
|
|
|
}, { |
|
|
|
value: '选项2', |
|
|
|
label: '双皮奶' |
|
|
|
}, { |
|
|
|
value: '选项3', |
|
|
|
label: '蚵仔煎' |
|
|
|
}, { |
|
|
|
value: '选项4', |
|
|
|
label: '龙须面' |
|
|
|
}, { |
|
|
|
value: '选项5', |
|
|
|
label: '北京烤鸭' |
|
|
|
}], |
|
|
|
morningSelectedHospitals: [], // 上午班选中的医院ID数组 |
|
|
|
afternoonSelectedHospitals: [], // 下午班选中的医院ID数组 |
|
|
|
// morningSelectedHospitals: [], // 上午班选中的医院ID数组 |
|
|
|
// afternoonSelectedHospitals: [], // 下午班选中的医院ID数组 |
|
|
|
isAfternoonDropdownOpen: false, |
|
|
|
isMornDropdownOpen: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
created() { |
|
|
|
@ -1003,41 +1078,237 @@ export default { |
|
|
|
...mapState(['hosMenuData']) // 从Vuex映射showSidebar状态到组件的计算属性中 |
|
|
|
}, |
|
|
|
methods: { |
|
|
|
toggleAfternoonDropdown() { |
|
|
|
console.log('----09999',this.afternoonSelectedHospitals); |
|
|
|
if (this.isAfternoonDropdownOpen) { |
|
|
|
this.$refs.afternoonSelect.blur(); |
|
|
|
} else { |
|
|
|
this.$refs.afternoonSelect.focus(); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleAfternoonVisibleChange(visible) { |
|
|
|
this.isAfternoonDropdownOpen = visible; |
|
|
|
this.isMornDropdownOpen = false; |
|
|
|
}, |
|
|
|
handleMornVisibleChange(visible) { |
|
|
|
this.isMornDropdownOpen = visible; |
|
|
|
this.isAfternoonDropdownOpen = false; |
|
|
|
}, |
|
|
|
|
|
|
|
getAfternoonSelectedNames(list) { |
|
|
|
if (this[list].length === 0) { |
|
|
|
return '请选择'; |
|
|
|
} |
|
|
|
|
|
|
|
const selectedNames = this[list].map(hid => { |
|
|
|
const hospital = this.hosList.find(item => item.hid === hid); |
|
|
|
return hospital ? hospital.name : ''; |
|
|
|
}).filter(name => name); |
|
|
|
|
|
|
|
return selectedNames.join('、') || '休息'; |
|
|
|
}, |
|
|
|
|
|
|
|
getDateCellClass(dateString) { |
|
|
|
const schedule = this.getDateSchedule(dateString); |
|
|
|
console.log(schedule, 'getDateCellClass-schedule'); |
|
|
|
if (!schedule) return ''; |
|
|
|
for (const key in schedule) { |
|
|
|
if (key !== '0' && schedule[key] && schedule[key].length > 0) { |
|
|
|
let obj = schedule[key][0] |
|
|
|
// 判断当前班次计划是否为休息状态(0表示休息) |
|
|
|
if (obj.currentPlan == '0') { |
|
|
|
return `shift-type-0`; |
|
|
|
} else { |
|
|
|
return `shift-type-${key}`; |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
return ''; |
|
|
|
}, |
|
|
|
|
|
|
|
// 处理上午班checkbox直接变化 |
|
|
|
handleWorkCheckDirect(item, checked,workHos) { |
|
|
|
if (checked) { |
|
|
|
if(workHos == 'afternoonSelectedHospitals'){ |
|
|
|
item.afternoon_plan = '1' |
|
|
|
}else{ |
|
|
|
item.morning_plan = '1' |
|
|
|
} |
|
|
|
this.selectMorningHospital(item.hid,workHos); |
|
|
|
} else { |
|
|
|
if(workHos == 'afternoonSelectedHospitals'){ |
|
|
|
item.afternoon_plan = '0' |
|
|
|
}else{ |
|
|
|
item.morning_plan = '0' |
|
|
|
} |
|
|
|
this.deselectMorningHospital(item.hid,workHos); |
|
|
|
} |
|
|
|
// this.hosList = this.hosList.map(item1 => { |
|
|
|
// if(item1.hid == item.hid){ |
|
|
|
// return { |
|
|
|
// ...item1, |
|
|
|
// morning_plan:checked ? '1' : '0' |
|
|
|
// } |
|
|
|
// } |
|
|
|
// }); // 触发视图更新 |
|
|
|
}, |
|
|
|
// 选中上午班医院 |
|
|
|
selectMorningHospital(hospitalId,workHos) { |
|
|
|
console.log(workHos,hospitalId,'workHos00000'); |
|
|
|
|
|
|
|
if (!this.is_allow_coincide && this[workHos].length >= 1) { |
|
|
|
// 不允许重合时,只能选一个,先清空再添加 |
|
|
|
this[workHos] = [hospitalId]; |
|
|
|
} else { |
|
|
|
// 允许重合或还没有选中任何项 |
|
|
|
if (!this[workHos].includes(hospitalId)) { |
|
|
|
this[workHos].push(hospitalId); |
|
|
|
} |
|
|
|
} |
|
|
|
console.log(this.hosList,this['afternoonSelectedHospitals'],'hos===this.hosList'); |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 取消选中上午班医院 |
|
|
|
deselectMorningHospital(hospitalId,workHos) { |
|
|
|
this[workHos] = this[workHos].filter(id => id !== hospitalId); |
|
|
|
}, |
|
|
|
|
|
|
|
// 日历点击 |
|
|
|
handleDateClick(dateString, event) { |
|
|
|
// 阻止事件冒泡 |
|
|
|
event.stopPropagation(); |
|
|
|
|
|
|
|
// 检查是否有排班数据 |
|
|
|
if (!this.hasScheduleData(dateString)) { |
|
|
|
console.log('该日期无排班数据'); |
|
|
|
return; |
|
|
|
} |
|
|
|
|
|
|
|
console.log('点击日期:', dateString); |
|
|
|
|
|
|
|
// 获取当天对应的周几信息 |
|
|
|
const date1 = new Date(dateString); |
|
|
|
const day = date1.getDay() |
|
|
|
const dayText = day == 0 ? '周日' : this.weekPlan[day] |
|
|
|
this.currentEditingDate = this.formatMonth(dateString, true) + ` ${dayText}` |
|
|
|
this.isShowDialogDate = this.hasTempAdjustments(dateString) |
|
|
|
console.log('点击日期:000', this.isShowDialogDate, '999998888888', date1, this.currentEditingDate, dayText, dateString); |
|
|
|
if (this.isShowDialogDate) { |
|
|
|
this.singleHosTitle = dayText + '出诊规则' |
|
|
|
} |
|
|
|
// 获取该日期的排班信息 |
|
|
|
const schedule = this.getDateSchedule(dateString); |
|
|
|
if (!schedule) return; |
|
|
|
|
|
|
|
// 获取该日期涉及的所有医院 |
|
|
|
const hospitals = this.getHospitalsByDate(dateString); |
|
|
|
console.log(hospitals,'hospitals==='); |
|
|
|
// 重构一下医院数据,增加上下午出诊状态 |
|
|
|
this.hosList = this.hosList.map(item => { |
|
|
|
let hospitalInfo = { |
|
|
|
hid: item.hid, |
|
|
|
name: item.h_depart_name, |
|
|
|
workTime: '已取消', |
|
|
|
originalPlan: '0', |
|
|
|
currentPlan: '0', |
|
|
|
isCancelled: false // 明确标记为取消 |
|
|
|
}; |
|
|
|
hospitals.forEach(hospital => { |
|
|
|
if (hospital.hid === item.hid) { |
|
|
|
hospitalInfo = { ...hospital } |
|
|
|
if (hospital.currentPlan == '1') { |
|
|
|
hospitalInfo.morning_plan = '1' |
|
|
|
} else if (hospital.currentPlan == '2') { |
|
|
|
hospitalInfo.afternoon_plan = '1' |
|
|
|
} else if (hospital.currentPlan == '3') { |
|
|
|
hospitalInfo.morning_plan = '1' |
|
|
|
hospitalInfo.afternoon_plan = '1' |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(hospitalInfo, ' ...hospitalInfo'); |
|
|
|
return { |
|
|
|
morning_plan: '0', |
|
|
|
afternoon_plan: '0', |
|
|
|
...item, |
|
|
|
...hospitalInfo, |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(hospitals, this.hosList, 'hospitals==='); |
|
|
|
|
|
|
|
// 根据医院数量决定弹出哪种对话框 |
|
|
|
if (hospitals.length === 1) { |
|
|
|
// 单医院 - 弹出单医院调整对话框 |
|
|
|
this.currentEditingDate = dateString; |
|
|
|
if (this.hosList.length === 1) { |
|
|
|
// 单医院 |
|
|
|
this.currentEditingHospital = hospitals[0]; |
|
|
|
this.singleHosVisiable = true; |
|
|
|
// this.showSingleHospitalDialog(dateString, hospitals[0]); |
|
|
|
} else { |
|
|
|
// 多医院 - 弹出多医院调整对话框 |
|
|
|
// this.showMultiHospitalDialog(dateString, hospitals); |
|
|
|
this.initSelectedHospitals(this.hosList); |
|
|
|
// 多医院 |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
// 初始化选中医院 |
|
|
|
initSelectedHospitals(hospitals) { |
|
|
|
this.morningSelectedHospitals = []; |
|
|
|
this.afternoonSelectedHospitals = []; |
|
|
|
|
|
|
|
hospitals.forEach(hospital => { |
|
|
|
const { hid, morning_plan, afternoon_plan } = hospital; |
|
|
|
|
|
|
|
if (morning_plan === '1') { |
|
|
|
this.morningSelectedHospitals.push(hid); |
|
|
|
} |
|
|
|
|
|
|
|
if (afternoon_plan === '1') { |
|
|
|
this.afternoonSelectedHospitals.push(hid); |
|
|
|
} |
|
|
|
}); |
|
|
|
this.moreHosVisiable = true; |
|
|
|
// this.morningText = this.morningSelectedHospitals.join(', ') |
|
|
|
// this.afterText = this.afternoonSelectedHospitals.join(', ') |
|
|
|
console.log(this.morningSelectedHospitals, this.afternoonSelectedHospitals, '初始化的喧哗走ing'); |
|
|
|
}, |
|
|
|
|
|
|
|
// 确认多医院临时调诊 |
|
|
|
async moreTempConfirm() { |
|
|
|
try { |
|
|
|
const plans = []; |
|
|
|
console.log('moreTempConfirm:',this.hosList); |
|
|
|
// 处理所有医院,为每个医院生成对应的排班计划 |
|
|
|
this.hosList.forEach(hospital => { |
|
|
|
const { hid } = hospital; |
|
|
|
const isInMorning = this.morningSelectedHospitals.includes(hid); |
|
|
|
const isInAfternoon = this.afternoonSelectedHospitals.includes(hid); |
|
|
|
|
|
|
|
let morning_plan = "0"; |
|
|
|
let afternoon_plan = "0"; |
|
|
|
|
|
|
|
// 设置上午班状态 |
|
|
|
if (isInMorning) { |
|
|
|
morning_plan = "1"; |
|
|
|
} |
|
|
|
|
|
|
|
// 设置下午班状态 |
|
|
|
if (isInAfternoon) { |
|
|
|
afternoon_plan = "1"; |
|
|
|
} |
|
|
|
|
|
|
|
plans.push({ |
|
|
|
depart_id: hid, |
|
|
|
morning_plan: morning_plan, |
|
|
|
afternoon_plan: afternoon_plan |
|
|
|
}); |
|
|
|
}); |
|
|
|
|
|
|
|
console.log('保存的排班数据:', plans); |
|
|
|
|
|
|
|
await this.saveTempAdjustment(this.currentEditingDate, plans); |
|
|
|
this.moreHosVisiable = false; |
|
|
|
} catch (error) { |
|
|
|
console.error('保存多医院调诊失败:', error); |
|
|
|
this.$message.error('保存失败'); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// 设置临时调诊数据---- |
|
|
|
async saveTempAdjustment(dateString, newPlan) { |
|
|
|
console.log(newPlan,'newPlan===='); |
|
|
|
console.log(newPlan, 'newPlan===='); |
|
|
|
try { |
|
|
|
const response = await this.$http('POST', '/api/admin/set_visit_change', { |
|
|
|
doctor_id: this.doctor_id, |
|
|
|
@ -1066,10 +1337,10 @@ export default { |
|
|
|
|
|
|
|
// 遍历所有班次类型收集医院 |
|
|
|
Object.keys(schedule).forEach(shiftType => { |
|
|
|
const list =schedule[shiftType] |
|
|
|
console.log(schedule,list,'schedule----'); |
|
|
|
const list = schedule[shiftType] |
|
|
|
console.log(schedule, list, 'schedule----'); |
|
|
|
if (['_isTempAdjust', '_conflicts', '0'].includes(shiftType)) return; |
|
|
|
if(Array.isArray(list) && list.length>0){ |
|
|
|
if (Array.isArray(list) && list.length > 0) { |
|
|
|
list.map(hospital => { |
|
|
|
// 检查是否已存在 |
|
|
|
const exists = hospitals.some(h => h.hid === hospital.hid); |
|
|
|
@ -1086,10 +1357,11 @@ export default { |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
console.log(hospitals,'hospitals==='); |
|
|
|
console.log(hospitals, 'hospitals==='); |
|
|
|
|
|
|
|
return hospitals; |
|
|
|
}, |
|
|
|
|
|
|
|
// 形成出诊文案 |
|
|
|
getWorkTimeDisplayText(hospital, dateStr, hospitalId) { |
|
|
|
const hospitalData = this.rawScheduleData[hospitalId]; |
|
|
|
@ -1098,9 +1370,9 @@ export default { |
|
|
|
// console.log(hospitalData,hospital,'hospitalData===='); |
|
|
|
|
|
|
|
const { morning_worktime, afternoon_worktime, temp_change_worktime } = hospitalData; |
|
|
|
console.log(morning_worktime,'morning_worktime==='); |
|
|
|
// console.log(morning_worktime, 'morning_worktime==='); |
|
|
|
let allDay_worktime = ''; |
|
|
|
if ((hospital.currentPlan == 3 || hospital.originalPlan ==3) && (morning_worktime && afternoon_worktime)) { |
|
|
|
if ((hospital.currentPlan == 3 || hospital.originalPlan == 3) && (morning_worktime && afternoon_worktime)) { |
|
|
|
allDay_worktime = morning_worktime.slice(0, 5) + '-' + afternoon_worktime.slice(-5); |
|
|
|
} |
|
|
|
// console.log(allDay_worktime,'allDay_worktime==='); |
|
|
|
@ -1411,24 +1683,12 @@ export default { |
|
|
|
}, |
|
|
|
// 修改 getDoctorHosPreview 方法 |
|
|
|
async getDoctorHosPreview() { |
|
|
|
await this.$http('POST', '/api/admin/get_departs_worktimes', { |
|
|
|
doctor_id: this.doctor_id, |
|
|
|
}).then(response => { |
|
|
|
const list = response.msg; |
|
|
|
console.log(list, '原始数据==='); |
|
|
|
|
|
|
|
if (response.code == 0) { |
|
|
|
// 处理医院列表 |
|
|
|
this.hosList = Object.keys(list).map(item => { |
|
|
|
return { |
|
|
|
hid: item, |
|
|
|
h_depart_name: list[item].h_depart_name |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 保存原始数据 |
|
|
|
// this.rawScheduleData = list; |
|
|
|
this.rawScheduleData = { |
|
|
|
// await this.$http('POST', '/api/admin/get_departs_worktimes', { |
|
|
|
// doctor_id: this.doctor_id, |
|
|
|
// }).then(response => { |
|
|
|
// const list = response.msg; |
|
|
|
// console.log(list, '原始数据==='); |
|
|
|
let list = this.rawScheduleData = { |
|
|
|
"7": { |
|
|
|
"h_depart_name": "北京大学第三医院针灸科", |
|
|
|
"worktime_no_fixed": 0, |
|
|
|
@ -1512,22 +1772,110 @@ export default { |
|
|
|
"morning_plan": "0", |
|
|
|
"afternoon_plan": "0", |
|
|
|
"date": "2025-11-12", |
|
|
|
|
|
|
|
"plan": 0, |
|
|
|
"work_paln_desc": "不可预约", |
|
|
|
"date_paln_desc": "11.12休息" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
"4": { |
|
|
|
"h_depart_name": "武丽娜中医针灸中医科", |
|
|
|
"worktime_no_fixed": 0, |
|
|
|
"display_work_days": 0, |
|
|
|
"worktime_list": { |
|
|
|
"1": { |
|
|
|
"id": "92", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "1", |
|
|
|
"plan": "1", |
|
|
|
"work_paln_desc": "上午可约" |
|
|
|
}, |
|
|
|
"2": { |
|
|
|
"id": "93", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "2", |
|
|
|
"plan": "3", |
|
|
|
"work_paln_desc": "全天可约" |
|
|
|
}, |
|
|
|
"3": { |
|
|
|
"id": "94", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "3", |
|
|
|
"plan": "2", |
|
|
|
"work_paln_desc": "下午可约" |
|
|
|
}, |
|
|
|
"4": { |
|
|
|
"id": "95", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "4", |
|
|
|
"plan": "1", |
|
|
|
"work_paln_desc": "上午可约" |
|
|
|
}, |
|
|
|
"5": { |
|
|
|
"id": "96", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "5", |
|
|
|
"plan": "3", |
|
|
|
"work_paln_desc": "全天可约" |
|
|
|
}, |
|
|
|
"6": { |
|
|
|
"id": "97", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "6", |
|
|
|
"plan": "3", |
|
|
|
"work_paln_desc": "全天可约" |
|
|
|
}, |
|
|
|
"7": { |
|
|
|
"id": "98", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"week_day": "7", |
|
|
|
"plan": "0", |
|
|
|
"work_paln_desc": "不可预约" |
|
|
|
} |
|
|
|
}, |
|
|
|
"temp_change_worktime": { |
|
|
|
"2025-11-08": { |
|
|
|
"id": "55", |
|
|
|
"doctor_id": "3", |
|
|
|
"depart_id": "4", |
|
|
|
"morning_plan": "0", |
|
|
|
"afternoon_plan": "0", |
|
|
|
"date": "2025-11-08", |
|
|
|
"plan": 0, |
|
|
|
"work_paln_desc": "不可预约", |
|
|
|
"date_paln_desc": "11.8休息" |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
} |
|
|
|
|
|
|
|
// if (response.code == 0) { |
|
|
|
// 处理医院列表 |
|
|
|
this.hosList = Object.keys(list).map(item => { |
|
|
|
return { |
|
|
|
hid: item, |
|
|
|
h_depart_name: list[item].h_depart_name |
|
|
|
} |
|
|
|
}); |
|
|
|
|
|
|
|
// 保存原始数据 |
|
|
|
// this.rawScheduleData = list; |
|
|
|
|
|
|
|
// 初始化当前月份的排班数据 |
|
|
|
this.generateMonthSchedule(this.currentDay); |
|
|
|
|
|
|
|
this.hosLength = Object.keys(list).length; |
|
|
|
} |
|
|
|
}).catch(error => { |
|
|
|
console.error(error, 'error') |
|
|
|
}) |
|
|
|
// } |
|
|
|
// }).catch(error => { |
|
|
|
// console.error(error, 'error') |
|
|
|
// }) |
|
|
|
}, |
|
|
|
// 根据月份生成排班数据 |
|
|
|
generateMonthSchedule(date) { |
|
|
|
@ -1644,66 +1992,6 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
// addHospitalToSchedule(daySchedule, hospitalId, hospital, plan, workDesc) { |
|
|
|
// const shiftType = plan.toString(); |
|
|
|
// const dateStr = daySchedule._dateStr; |
|
|
|
// const originalPlan = this.getOriginalPlan(dateStr, hospitalId); |
|
|
|
|
|
|
|
// console.log(` - addHospitalToSchedule: 医院=${hospitalId}, 当前计划=${shiftType}, 原计划=${originalPlan}`); |
|
|
|
|
|
|
|
// // 处理临时取消的班次(原计划有班次,临时调整为不出诊) |
|
|
|
// if (shiftType === "0" && originalPlan !== "0") { |
|
|
|
// console.log(` - 检测到临时取消: 医院=${hospitalId}, 原班次=${originalPlan}`); |
|
|
|
|
|
|
|
// // 在对应的原班次类型中添加取消标记 |
|
|
|
// if (!daySchedule[originalPlan]) { |
|
|
|
// daySchedule[originalPlan] = []; |
|
|
|
// } |
|
|
|
|
|
|
|
// const hospitalInfo = { |
|
|
|
// hid: hospitalId, |
|
|
|
// hospital_name: hospital.h_depart_name, |
|
|
|
// workTime: '已取消', |
|
|
|
// originalPlan: originalPlan, |
|
|
|
// currentPlan: shiftType, |
|
|
|
// isCancelled: true // 标记为已取消 |
|
|
|
// }; |
|
|
|
|
|
|
|
// // 检查是否已经存在 |
|
|
|
// const existingIndex = daySchedule[originalPlan].findIndex(item => item.hid === hospitalId); |
|
|
|
// if (existingIndex >= 0) { |
|
|
|
// daySchedule[originalPlan][existingIndex] = hospitalInfo; |
|
|
|
// } else { |
|
|
|
// daySchedule[originalPlan].push(hospitalInfo); |
|
|
|
// } |
|
|
|
// console.log(` - 已添加到 ${originalPlan} 班次:`, hospitalInfo); |
|
|
|
// return; |
|
|
|
// } |
|
|
|
|
|
|
|
// // 正常班次(非取消的) |
|
|
|
// if (shiftType !== "0") { |
|
|
|
// if (!daySchedule[shiftType]) { |
|
|
|
// daySchedule[shiftType] = []; |
|
|
|
// } |
|
|
|
|
|
|
|
// const hospitalInfo = { |
|
|
|
// hid: hospitalId, |
|
|
|
// hospital_name: hospital.h_depart_name, |
|
|
|
// workTime: workDesc, |
|
|
|
// originalPlan: originalPlan, |
|
|
|
// currentPlan: shiftType, |
|
|
|
// isCancelled: false |
|
|
|
// }; |
|
|
|
|
|
|
|
// const existingIndex = daySchedule[shiftType].findIndex(item => item.hid === hospitalId); |
|
|
|
// if (existingIndex >= 0) { |
|
|
|
// daySchedule[shiftType][existingIndex] = hospitalInfo; |
|
|
|
// } else { |
|
|
|
// daySchedule[shiftType].push(hospitalInfo); |
|
|
|
// } |
|
|
|
// console.log(` - 已添加到 ${shiftType} 班次:`, hospitalInfo); |
|
|
|
// } |
|
|
|
// }, |
|
|
|
// 获取排班优先级(数值越高优先级越高) |
|
|
|
getSchedulePriority(hospitalId, plan, dateStr) { |
|
|
|
const status = this.getTempAdjustmentStatus(dateStr, hospitalId, this.getOriginalPlan(dateStr, hospitalId)); |
|
|
|
@ -1836,10 +2124,6 @@ export default { |
|
|
|
// 确认单医院临时调诊 |
|
|
|
singleTempConfirm() { |
|
|
|
this.singleHosVisiable = false |
|
|
|
}, |
|
|
|
// 取消单医院临时调诊 |
|
|
|
singleTempCancel() { |
|
|
|
this.singleHosVisiable = false; |
|
|
|
let plan = this.currentEditingHospital.currentPlan; |
|
|
|
let depart_id = this.currentEditingHospital.hid; |
|
|
|
let plans = { |
|
|
|
@ -1847,23 +2131,31 @@ export default { |
|
|
|
"morning_plan": plan, |
|
|
|
"afternoon_plan": plan, |
|
|
|
} |
|
|
|
if(plan == '0'){ |
|
|
|
if (plan == '0') { |
|
|
|
plans["morning_plan"] = '0'; |
|
|
|
plans["afternoon_plan"] = '0'; |
|
|
|
}else if(plan == '1'){ |
|
|
|
} else if (plan == '1') { |
|
|
|
plans["morning_plan"] = '1'; |
|
|
|
plans["afternoon_plan"] = '0'; |
|
|
|
}else if(plan == '2'){ |
|
|
|
} else if (plan == '2') { |
|
|
|
plans["morning_plan"] = '0'; |
|
|
|
plans["afternoon_plan"] = '1'; |
|
|
|
}else if(plan == '3'){ |
|
|
|
} else if (plan == '3') { |
|
|
|
plans["morning_plan"] = '1'; |
|
|
|
plans["afternoon_plan"] = '1'; |
|
|
|
} |
|
|
|
console.log(plans,'plans'); |
|
|
|
console.log(plans, 'plans'); |
|
|
|
let plansList = [] |
|
|
|
plansList.push(plans) |
|
|
|
this.saveTempAdjustment(this.currentEditingDate,plansList) |
|
|
|
this.saveTempAdjustment(this.currentEditingDate, plansList) |
|
|
|
}, |
|
|
|
// 取消单医院临时调诊 |
|
|
|
singleTempCancel() { |
|
|
|
this.singleHosVisiable = false; |
|
|
|
}, |
|
|
|
// 取消多医院临时调诊 |
|
|
|
moreTempCancel() { |
|
|
|
this.moreHosVisiable = false; |
|
|
|
}, |
|
|
|
isCurrentMonth(date) { |
|
|
|
const current = new Date(); |
|
|
|
@ -1893,11 +2185,15 @@ export default { |
|
|
|
this.generateMonthSchedule(this.currentDay); |
|
|
|
this.countMonthlyConflicts(); // 添加统计 |
|
|
|
}, |
|
|
|
formatMonth(date) { |
|
|
|
formatMonth(date, dayFlag) { |
|
|
|
const d = new Date(date); |
|
|
|
const year = d.getFullYear(); |
|
|
|
const month = d.getMonth() + 1; |
|
|
|
return `${year}年${month}月`; |
|
|
|
let dateDesc = `${year}年${month}月`; |
|
|
|
if (dayFlag) { |
|
|
|
dateDesc += `${d.getDate()}日` |
|
|
|
} |
|
|
|
return dateDesc |
|
|
|
}, |
|
|
|
overrideWeekTitles() { |
|
|
|
this.$nextTick(() => { |
|
|
|
@ -1917,24 +2213,6 @@ export default { |
|
|
|
return today.toDateString() === date.toDateString(); |
|
|
|
}, |
|
|
|
|
|
|
|
// 获取指定日期的排班信息 |
|
|
|
// getDateSchedule(dateString) { |
|
|
|
// // 如果这天还没有生成排班数据,就动态生成 |
|
|
|
// if (!this.calendarList[dateString]) { |
|
|
|
// const date = new Date(dateString); |
|
|
|
// const today = new Date(); |
|
|
|
|
|
|
|
// // 只生成今天及之后的排班 |
|
|
|
// if (date >= today) { |
|
|
|
// const daySchedule = this.getScheduleForDate(date); |
|
|
|
// if (daySchedule) { |
|
|
|
// this.$set(this.calendarList, dateString, daySchedule); |
|
|
|
// } |
|
|
|
// } |
|
|
|
// } |
|
|
|
// // console.log(this.calendarList[dateString],dateString,'====this.calendarList[dateString]'); |
|
|
|
// return this.calendarList[dateString]; |
|
|
|
// }, |
|
|
|
// 检查排班数据是否有实际内容 |
|
|
|
hasActualSchedule(schedule) { |
|
|
|
if (!schedule) return false; |
|
|
|
@ -2936,6 +3214,45 @@ export default { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
// 下拉框定位-- |
|
|
|
.select-container { |
|
|
|
position: relative; |
|
|
|
flex: 1; |
|
|
|
} |
|
|
|
|
|
|
|
.selected-hospitals-display { |
|
|
|
border: 1px solid #DCDFE6; |
|
|
|
border-radius: 4px; |
|
|
|
padding: 0 15px; |
|
|
|
height: 40px; |
|
|
|
line-height: 40px; |
|
|
|
background: white; |
|
|
|
cursor: pointer; |
|
|
|
display: flex; |
|
|
|
justify-content: space-between; |
|
|
|
align-items: center; |
|
|
|
transition: border-color 0.2s; |
|
|
|
} |
|
|
|
|
|
|
|
.selected-hospitals-display:hover { |
|
|
|
border-color: #C0C4CC; |
|
|
|
} |
|
|
|
|
|
|
|
.selected-hospitals-display:focus { |
|
|
|
border-color: #409EFF; |
|
|
|
} |
|
|
|
|
|
|
|
.hidden-select { |
|
|
|
position: absolute; |
|
|
|
top: 0; |
|
|
|
left: 0; |
|
|
|
width: 100%; |
|
|
|
opacity: 0; |
|
|
|
z-index: 1; |
|
|
|
} |
|
|
|
|
|
|
|
// 下拉框定位-- |
|
|
|
|
|
|
|
.tooltip-content { |
|
|
|
.hospital-item { |
|
|
|
font-size: 12px; |
|
|
|
@ -3156,6 +3473,15 @@ export default { |
|
|
|
} |
|
|
|
|
|
|
|
/* 如果需要调整文字颜色 */ |
|
|
|
.shift-type-0 { |
|
|
|
background-color: #F6F7FA !important; |
|
|
|
|
|
|
|
.date-text, |
|
|
|
.shift-type { |
|
|
|
color: #626573; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
.shift-type-1 { |
|
|
|
background-color: #ECF5FF !important; |
|
|
|
|
|
|
|
|