提交 57fc3217 编写于 作者: xiaoping.di's avatar xiaoping.di

Merge branch 'release-new' into 'release'

Release new

See merge request !225
......@@ -265,3 +265,33 @@ export const opAck = async (data) => {
method: 'post',
});
};
export const acceptsCeiling = async (data) => {
return request({
url: '/diagnose/admin/diagnose/accepts/ceiling',
params: data,
method: 'get',
});
};
export const getLeisureTime = async (data) => {
return request({
url: '/diagnose/doctor/work/getLeisureTime',
data: data,
method: 'post',
});
};
export const outboundIntention = async (data) => {
return request({
url: '/diagnose/admin/diagnose/outbound/intention',
data: data,
method: 'post',
});
};
export const departmentAll = async () => {
return request({
url: '/diagnose/department/all',
method: 'get',
});
};
......@@ -65,3 +65,30 @@ export const previewWork = async (data) => {
data: data,
});
};
export const setPlatformUpper = async (data) => {
return request({
url: `/diagnose/doctor/work/setPlatformUpper/${data.num}`,
data: data,
method: 'post',
});
};
export const getPlatformUpper = async () => {
return request({
url: '/diagnose/doctor/work/getPlatformUpper',
method: 'post',
});
};
export const saveLevelAndDayCount = async (data) => {
return request({
url: '/diagnose/doctor/work/saveLevelAndDayCount',
data: data,
method: 'post',
});
};
export const getLevelAndDayCount = async (data) => {
return request({
url: `/diagnose/doctor/work/getLevelAndDayCount/${data.workId}`,
data: data,
method: 'post',
});
};
......@@ -6,30 +6,13 @@
@close="cancel"
@open="opendialog"
>
<!-- <el-row :gutter="30" class="row search" type="flex" style="margin-bottom:0;">-->
<el-form
ref="setForm"
:rules="addRules"
:model="formData"
label-width="250px"
label-suffix=":"
label-position="right"
size="mini"
style="width: 100%"
>
<el-form-item
label="接诊医生"
class="required-label"
prop="receptionId"
>
<!-- <el-input v-model="formData.doctorName" placeholder="请选择接诊医生" class="set-width" disabled></el-input>-->
<el-col :span="15">
<div class="open-diagnosis-doctor">
<div class="choose-diagnosis-doctor">
<el-select
v-model="formData.receptionId"
filterable
placeholder="请选择接诊医生"
class="set-width"
style="width: 100%"
@change="doctorChanged($event)"
>
<el-option
......@@ -39,267 +22,126 @@
:value="item.doctorId"
/>
</el-select>
</el-col>
</el-form-item>
<el-form-item label="接诊医生职称">
<el-col :span="15">
<el-input
v-model="formData.doctorTitle"
placeholder="请选择职称"
class="set-width"
disabled
style="width: 100%"
/>
<!-- <el-select v-model="formData.doctorTitle" placeholder="请选择职称" disabled class="set-width">
<el-option v-for="item of sexList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> -->
</el-col>
</el-form-item>
<el-form-item label="接诊医生所在机构">
<el-col :span="15">
<el-input
v-model="formData.doctorHospital"
placeholder="请选择机构"
class="set-width"
disabled
style="width: 100%"
/>
</el-col>
<!-- <el-select v-model="formData.doctorHospital" placeholder="请选择机构" disabled class="set-width">
<el-option v-for="item of sexList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> -->
</el-form-item>
<el-form-item label="接诊医生所在科室">
<el-col :span="15">
<el-input
v-model="formData.doctorDepartment"
placeholder="请选择机构"
class="set-width"
disabled
style="width: 100%"
/>
<!-- <el-select v-model="formData.doctorDepartment" placeholder="请选择科室" disabled class="set-width">
<el-option v-for="item of sexList" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select> -->
</el-col>
</el-form-item>
<el-form-item label="接诊医生电话">
<el-col :span="15">
<el-input
v-model="formData.doctorMobile"
placeholder="请输入接诊医生手机号"
disabled
class="set-width"
style="width: 100%"
/>
</el-col>
</el-form-item>
<el-form-item
v-if="
formData.receptionName == '站外医生' ||
formData.receptionName == '云鹊医助'
"
label="外部医生姓名"
class="required-label"
prop="outsideDoctor"
>
<el-col :span="15">
<el-input
v-model="formData.outsideDoctor"
placeholder="请输入外部医生姓名"
class="set-width"
style="width: 135%"
<el-date-picker
v-model="chooseTime"
type="date"
:clearable="false"
:disabled="formData.receptionName == ''"
placeholder="请选择日期"
@change="getNowDate"
/>
</el-col>
</el-form-item>
<el-form-item
label="问诊时间"
class="required-label"
>
<el-col :span="15">
<div
class="set-width grey-bg"
style="width: 100%"
@click="openDiagnosisStartTimeDialog"
>
<i class="el-icon-alarm-clock" />
<span v-if="!rangeTimeData">请选择问诊时间</span>
<span v-else>
{{
rangeTimeData
? rangeTimeData
: dayFormatWithoutSecond(startTimeValue)
}}
{{
dayFormatWithoutSecond(endTimeValue)
? ' -- ' + dayFormatWithoutSecond(endTimeValue)
: ''
}}</span>
</div>
</el-col>
</el-form-item>
<el-form-item
class="required-label"
prop="diagnoseChannel"
label="问诊方式"
>
<el-col :span="15">
<el-radio-group
v-model="formData.diagnoseChannel"
size="small"
style="line-height: 45px; width: 135%"
<div
v-if="formData.receptionName != ''"
class="doctor-diagnosis-doctor"
>
<el-radio :label="1">
APP问诊(系统发起问诊)
</el-radio>
<el-radio :label="2">
线下问诊(APP不会自动发起问诊)
</el-radio>
</el-radio-group>
</el-col>
</el-form-item>
</el-form>
<!-- </el-row>-->
<div class="doctor-info">
<div class="doctor-info-nameRate">
<span class="name-info">{{ formData.receptionName }}</span>
<span class="name-info-rate">
<span
slot="footer"
class="dialog-footer"
style="text-align: center"
>
<el-button
type="primary"
@click="refreshData"
>刷新数据</el-button>
<el-button @click="cancel">取 消</el-button>
<el-button
type="primary"
:disabled="isClick"
@click="confirm"
>确定</el-button>
class="rate-value"
>优先级<span> {{ rateValue }} </span></span>
</span>
</el-dialog>
<el-dialog
title="问诊开始时间"
:visible.sync="diagnosisStartTimeDialog"
>
<div class="startTime-wrap">
<div class="line-wrap">
<div>
<span>问诊开始时间:</span>
<div class="date-wrap">
<el-date-picker
v-model="startTimeValue"
popper-class="scale-datepicker"
size="large"
type="datetime"
placeholder="选择日期时间"
@change="startTimeChange"
/>
</div>
<div class="doctor-info-phone">
<span>{{ formData.doctorMobile }}</span>
</div>
<div class="mt20">
<span>问诊结束时间:</span>
<div class="date-wrap">
&nbsp;{{ dayFormatWithoutSecond(endTimeValue) }}
<div class="doctor-info-hisDep">
<span>{{ formData.doctorHospital }}</span>
<span class="diasName">{{ formData.doctorDepartment }}</span>
</div>
</div>
<div class="doctor-info-Num">
<div class="doctor-info-NumToday">
<div class="num-info-much">
{{ todayNum }}
</div>
<div class="time-wrap">
<span>问诊时长:</span>
<div class="time-range">
<el-radio-group
v-model="timeRange"
@change="timeRangeChange"
>
<div>
<el-radio
border
size="large"
:label="10"
>
10分钟
</el-radio>
<div>今日接诊人数</div>
</div>
<div class="mt20">
<el-radio
border
size="medium"
:label="15"
>
15分钟
</el-radio>
<div class="doctor-info-maxToday">
<div class="num-info-much">
{{ maxTodayNum }}
</div>
<div class="mt20">
<el-radio
border
size="medium"
:label="20"
>
20分钟
</el-radio>
<div>今日接诊上限人数</div>
</div>
<div class="mt20">
<el-radio
border
size="medium"
:label="30"
>
30分钟
</el-radio>
</div>
<div class="mt20">
<el-radio
border
size="medium"
:label="1234"
>
自定义时间
</el-radio>
</div>
</el-radio-group>
<div v-show="timeRange == 1234">
<el-input-number
v-model="selfTimeRange"
class="selfTime-input"
type="number"
controls-position="right"
:min="0"
:step="1"
:precision="0"
/>
<el-button
type="primary"
size="small"
@click="selfTimeRangeChange"
<div
v-else
class="doctor-diagnosis-none"
>
确定
</el-button>
<span>未选定医生</span>
</div>
<div class="work-info-Num">
<span
class="work-info-Num-span"
>可选排班时间(预约已满需要沟通确定时间)</span>
<div
v-if="timeChoosetList.length > 0"
class="time-list-show"
>
<div
v-for="(itemChild, indexChild) in timeChoosetList"
:key="indexChild"
class="home_grid_item"
>
<div
class="grid_text"
:class="chooseTimeIndex == indexChild && 'choose-time-choose'"
@click="getChooseTimeValue(itemChild, indexChild)"
>
<span
:class="
itemChild.isFull == 1 ? 'show-meet-time' : 'no-meet-time'
"
>{{ itemChild.time }}</span>
<p
:class="
itemChild.isFull == 1 ? 'can-meet-time' : 'canot-meet-time'
"
>
{{ itemChild.isFull == 1 ? '可约' : '已满' }}
</p>
</div>
</div>
</div>
<div
class="startTime-footer"
v-else
class="time-list-showNo"
>
<span> 无可选时间 </span>
</div>
<div class="work-info-botton">
<span
slot="footer"
class="dialog-footer"
style="text-align: center"
>
<el-button @click="startTimeConfirm('cancel')">
取 消
</el-button>
<el-button
class="contest"
type="primary"
:disabled="isClick"
@click="startTimeConfirm('submit')"
>
确定
</el-button>
@click="confirm"
>确定</el-button>
<el-button
class="refresh"
type="primary"
@click="refreshData"
>刷新数据</el-button>
<el-button @click="cancel">取 消</el-button>
</span>
</div>
</div>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateDiagnosis } from '../../utils/diagnosis';
import { manualQueue } from '../../utils/diagnosis';
import dayjs from 'dayjs';
import { getDoctorList } from '@/api/diagnosis';
import { getDoctorList, getLeisureTime, acceptsCeiling } from '@/api/diagnosis';
let vm = null;
export default {
......@@ -324,9 +166,19 @@
type: [Number, String],
default: 0,
},
doctorInfo: {
type: Object,
default: () => {
return {};
},
},
},
data() {
return {
chooseTimeIndex: 1000,
chooseTime: '',
rateValue: 0,
colors: ['#0D9078', '#0D9078', '#0D9078'],
show: false,
title: '设置接诊医生',
confirmTxt: '确定',
......@@ -345,6 +197,7 @@
receptionEndTime: '',
bizType: '',
diagnoseChannel: 1,
doctorDepartmentId: '',
},
doctorList: [],
sessionDoctorList: [],
......@@ -373,6 +226,12 @@
endTimeValue: '',
timeRange: '',
selfTimeRange: '',
giveTimeList: [],
timeChoosetList: [],
startTime: '',
endTime: '',
todayNum: 0,
maxTodayNum: 0,
};
},
watch: {
......@@ -392,80 +251,87 @@
},
},
created() {
// this.startTimeValue = this.rangeTimeData;
console.log('``````', this.rangeTimeData);
// if (this.rangeTimeData) {
// this.timeRange = Number(20);
// this.endTimeValue = dayjs(this.rangeTimeData)
// .add(this.timeRange, 'minute')
// .format('YYYY-MM-DD HH:mm:ss');
// }
console.log('``````', this.rangeTimeData, this.endTimeValue);
vm = this;
this.getDoctorList();
if (
!(this.doctorList || []).some((item) => {
item.doctorId == this.formData.receptionId;
})
) {
this.refreshData();
}
},
methods: {
getChooseTimeValue(value, index) {
this.chooseTimeIndex = index;
this.startTime = value.startDate;
this.endTime = value.endDate;
},
getNowDate(value) {
this.chooseTime = dayjs(value).format('YYYY-MM-DD HH:mm:ss');
this.getLeisureTime(this.chooseTime);
},
getLeisureTime(chooseTime) {
console.log(this.doctorInfo);
const params = {
doctorId: this.formData.receptionId,
weekDay: chooseTime,
};
getLeisureTime(params).then((res) => {
if (res.code == '000000') {
console.log(res);
this.timeChoosetList = res.data || [];
}
});
},
confirm() {
this.$refs.setForm.validate((valid) => {
if (!this.startTimeValue || !this.endTimeValue) {
console.log(this.startTime, 'starrrr');
if (this.formData.receptionName == '') {
this.$message({
message: '请选择问诊时间',
message: '请先选择接诊医生',
type: 'warning',
duration: 1000,
});
return false;
}
if (this.startTime == '') {
this.$message({
message: '请选择排班时间',
type: 'warning',
duration: 1000,
});
return false;
}
if (valid) {
let req = null;
if (
this.formData.receptionName == '站外医生' ||
this.formData.receptionName == '云鹊医助'
) {
this.formData.innerFlag = 2; // 外部
req = {
id: this.diagnoseLogId,
bizType: 9,
innerFlag: this.formData.innerFlag,
receptionId: this.formData.receptionId,
receptionName: this.formData.receptionName,
outsideDoctor: this.formData.outsideDoctor,
// receptionBeginTime:this.rangeTime[0],
// receptionEndTime:this.rangeTime[1],
receptionBeginTime: this.dayFormat(this.startTimeValue),
receptionEndTime: this.endTimeValue,
diagnoseChannel: this.formData.diagnoseChannel,
};
} else {
this.formData.innerFlag = 1; // 内部
req = {
const req = {
id: this.diagnoseLogId,
bizType: 9,
innerFlag: this.formData.innerFlag,
receptionId: this.formData.receptionId,
receptionName: this.formData.receptionName,
// receptionBeginTime:this.rangeTime[0],
// receptionEndTime:this.rangeTime[1],
receptionBeginTime: this.dayFormat(this.startTimeValue),
receptionEndTime: this.endTimeValue,
receptionBeginTime: this.startTime,
receptionEndTime: this.endTime,
diagnoseChannel: this.formData.diagnoseChannel,
};
}
vm.isClick = true;
updateDiagnosis(req)
manualQueue(req)
.then(function (res) {
vm.isClick = false;
if (res.code == '000000') {
vm.cancel();
vm.$emit('search');
this.todayNum = 0;
this.maxTodayNum = 0;
this.rateValue = '';
this.chooseTime = '';
this.startTime = '';
this.endTime = '';
} else {
vm.$message.error(res.message);
}
})
.catch(function (err) {
vm.isClick = false;
vm.$message.error(err.message);
});
}
console.log(err);
// vm.$message.error(err.message);
});
},
refreshData() {
......@@ -479,6 +345,14 @@
// this.startTimeValue = this.rangeTimeData;
// this.endTimeValue = '';
// this.timeRange = Number(20);
this.todayNum = 0;
this.maxTodayNum = 0;
this.rateValue = '';
this.chooseTime = '';
this.timeChoosetList = [];
this.chooseTimeIndex = null;
this.startTime = '';
this.endTime = '';
this.$emit('update:diagnosisDoctorVisible', false);
},
opendialog() {
......@@ -494,15 +368,33 @@
doctorChanged(value) {
const selected = this.doctorList.find((item) => item.doctorId === value);
if (selected) {
console.log(selected, 'selected');
this.formData.receptionId = value;
this.formData.receptionName = selected.doctorName;
this.formData.doctorTitle = selected.doctorTitle;
this.formData.doctorHospital = selected.doctorHospital;
this.formData.doctorDepartment = selected.doctorDepartment;
this.formData.doctorMobile = selected.doctorMobile;
this.formData.doctorDepartmentId = selected.doctorDepartmentId;
this.acceptsCeilings(this.formData.receptionId);
const nowDate = dayjs(new Date()).format('YYYY-MM-DD');
this.getNowDate(nowDate);
// debugger;
// this.formData.serviceFee = this.priceFilter(selected.serviceFee)
}
},
acceptsCeilings(doctorId) {
const params = {
doctorId: doctorId,
};
acceptsCeiling(params).then((res) => {
if (res.code == '000000') {
this.todayNum = res.data.dayAcceptsCount || 0;
this.maxTodayNum = res.data.dayAcceptsCeiling || 0;
this.rateValue = res.data.level;
}
});
},
getDoctorList() {
this.loading = true;
this.listKey = 'sessionDoctorList' + this.diagnoseType;
......@@ -536,7 +428,7 @@
if (!this.startTimeValue) {
this.timeRange = '';
this.endTimeValue = '';
}else{
} else {
this.timeRange = Number(20);
this.endTimeValue = dayjs(this.rangeTimeData)
.add(this.timeRange, 'minute')
......@@ -547,18 +439,8 @@
startTimeConfirm(isCancle) {
console.log('isCancle-', isCancle);
if (isCancle == 'cancel') {
// this.startTimeValue = '';
this.endTimeValue = '';
this.timeRange = '';
// if (!this.startTimeValue) {
// this.timeRange = '';
// this.endTimeValue = '';
// }else{
// this.timeRange = Number(20);
// this.endTimeValue = dayjs(this.rangeTimeData)
// .add(this.timeRange, 'minute')
// .format('YYYY-MM-DD HH:mm:ss');
// }
this.startTime = '';
this.endTime = '';
}
if (isCancle == 'submit') {
if (String(this.startTimeValue).trim() === '' || !this.startTimeValue) {
......@@ -629,7 +511,7 @@
<style lang="scss">
.set-width {
width: 300px;
min-width: 230px;
}
.grey-bg {
padding: 0px 15px;
......@@ -671,4 +553,208 @@
margin-right: 5px;
width: 130px;
}
.open-diagnosis-doctor {
padding: 10px 20px 40px 30px;
.choose-diagnosis-doctor {
.el-select {
margin-right: 30px;
padding-bottom: 20px;
.el-input {
// width: 300px;
.el-input__inner {
// width: 300px;
height: 32px;
background: #ffffff;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
.el-input__suffix {
display: flex;
align-items: center;
}
}
}
.el-date-editor {
.el-input__inner {
max-width: 150px;
height: 32px;
background: #ffffff;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
}
.el-input__prefix {
.el-input__icon {
display: flex;
align-items: center;
}
}
}
}
.doctor-diagnosis-doctor {
background: rgba(240, 242, 245, 0.6);
border-radius: 8px;
height: 120px;
padding: 20px;
display: flex;
.doctor-info {
width: 50%;
.doctor-info-nameRate {
display: flex;
.name-info {
min-width: 54px;
height: 18px;
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
line-height: 18px;
margin-right: 10px;
}
.name-info-rate {
.rate-value {
padding: 5px 10px;
// width: 63px;
height: 18px;
background: #0d9078;
border-radius: 9px;
font-size: 12px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
}
}
}
.doctor-info-phone {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
padding-top: 10px;
}
.doctor-info-hisDep {
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #89888b;
padding-top: 10px;
.diasName {
padding-left: 10px;
}
}
}
.doctor-info-Num {
display: flex;
.doctor-info-NumToday {
text-align: center;
min-width: 85px;
margin-right: 20px;
.num-info-much {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #02120f;
}
}
.doctor-info-maxToday {
text-align: center;
min-width: 120px;
.num-info-much {
font-size: 32px;
font-family: PingFangSC-Medium, PingFang SC;
font-weight: 500;
color: #02120f;
}
}
}
}
.doctor-diagnosis-none {
background: rgba(240, 242, 245, 0.6);
border-radius: 8px;
height: 120px;
padding: 20px;
display: flex;
align-items: center;
justify-content: center;
}
.work-info-Num {
padding-top: 20px;
.work-info-Num-span {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
.time-list-show {
display: flex;
flex-wrap: wrap;
height: 100%;
padding-bottom: 20px;
.home_grid_item {
flex-basis: 17%;
margin-bottom: 10px;
margin-top: 15px;
text-align: center;
padding: 0;
border-radius: 11px;
margin-right: 30px;
.grid_text {
background: #f5f6f8;
border: 1px solid transparent;
padding: 3px;
.show-meet-time {
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #212121;
}
.no-meet-time {
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
.can-meet-time {
font-size: 10px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
padding: 2px;
}
.canot-meet-time {
font-size: 10px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
padding: 2px;
}
}
.choose-time-choose {
padding: 3px;
background: #edfbf9;
border-radius: 4px;
border: 1px solid #a1e1d9;
color: #0d9078;
}
}
}
.time-list-showNo {
height: 100px;
padding-top: 10px;
}
}
.work-info-botton {
.contest {
min-width: 100px;
border-radius: 18px;
}
.refresh {
min-width: 150px;
border-radius: 18px;
}
.el-button--default {
min-width: 150px;
border-radius: 18px;
}
}
}
</style>
<template>
<div>
<div class="setTime-show">
<el-dialog
:title="title"
:visible.sync="diagnosisTimeVisible"
@close="cancel"
>
<el-form
ref="setForm"
:rules="addRules"
:model="model"
label-width="250px"
label-suffix=":"
label-position="right"
size="mini"
style="width: 100%"
>
<el-form-item
label="助诊意向时间"
class="required-label"
prop="rangeTime"
>
<el-col :span="15">
<div class="choose-day-next">
<el-date-picker
v-model="rangeTime"
type="datetimerange"
value-format="yyyy-MM-dd HH:mm:ss"
range-separator="至"
start-placeholder="开始日期"
end-placeholder="结束日期"
:picker-options="pickerOptions1"
style="width: 135%"
/>
</el-col>
</el-form-item>
<el-form-item label="备注">
<el-col :span="15">
<el-input
v-model="model.assistantRemark"
type="textarea"
style="width: 135%"
size="small"
minlength="2"
maxlength="500"
placeholder="请输入备注"
v-model="chooseTime"
type="date"
placeholder="选择日期"
class="set-tiem-picker"
:clearable="false"
:picker-options="pickerOptionsStart"
@change="getNowDate"
/>
</el-col>
</el-form-item>
</el-form>
<!-- </el-row>-->
<el-button
class="next-day-pick"
@click="nextChangeData"
>
下一天
</el-button>
</div>
<div class="doctor-info">
<div class="name-floor">
<span class="name-info-detail">{{ userName }}</span>
<span class="doctor-info-name">基层医生</span>
<p class="info-phone">
{{ userNamePhone }}
</p>
</div>
<div class="daignose-info">
<span>分诊科室:{{ triageDepartment }}</span>
</div>
</div>
<div class="work-info-Num">
<span class="work-info-Num-span">可排班时间</span>
<div class="time-list-show">
<div
v-for="(itemChild, indexChild) in timeChoosetList"
:key="indexChild"
class="home_grid_item"
>
<div
class="grid_text"
:class="
chooseTimeIndex == indexChild &&
itemChild.isFull == 1 &&
'choose-time-choose'
"
@click="getChooseTimeValue(itemChild, indexChild)"
>
<span
:class="
itemChild.isFull == 1 ? 'show-meet-time' : 'no-meet-time'
"
>{{ itemChild.time }}</span>
<p
:class="
itemChild.isFull == 1 ? 'can-meet-time' : 'canot-meet-time'
"
>
{{ itemChild.isFull == 1 ? '可约' : '已满' }}
</p>
</div>
</div>
</div>
</div>
<div class="work-info-botton">
<span
slot="footer"
class="dialog-footer"
style="text-align: center"
>
<el-button @click="cancel">取 消</el-button>
<el-button
class="contest"
type="primary"
:disabled-="isClick"
:disabled="isClick"
@click="confirm"
>确定</el-button>
<el-button
class="cancel-submit"
@click="cancel"
>取 消</el-button>
</span>
</div>
</el-dialog>
</div>
</template>
<script>
import { updateDiagnosis } from '../../utils/diagnosis';
// import { updateDiagnosis } from '../../utils/diagnosis';
import { getLeisureTime, outboundIntention } from '@/api/diagnosis';
import dayjs from 'dayjs';
let vm = null;
export default {
props: {
......@@ -82,15 +108,24 @@
type: Number,
default: 0,
},
userName: {
type: String,
default: '',
},
userNamePhone: {
type: String,
default: '',
},
triageDepartment: {
type: String,
default: '',
},
departmentId: {
type: String,
default: '',
},
},
data() {
// let checkDate = (rule, value, callback) => {
// if(!value) {
// callback(new Error("请选择助诊意向时间"));
// } else {
// callback();
// }
// }
return {
show: false,
title: '设置时间',
......@@ -101,49 +136,94 @@
assistantRemark: '',
},
rangeTime: '',
addRules: {
rangeTime: [
// {type: 'array',required: true, validator: checkDate, trigger: 'blur,change'}
{
type: 'array',
required: true,
// message: "预约时间不能为空",
// validator: checkDate,
trigger: 'change',
fields: {
0: { required: true, type: 'date', message: '开始时间不能为空' },
1: { required: true, type: 'date', message: '结束时间不能为空' },
},
},
],
},
pickerOptions1: {
startDate: '',
endDate: '',
chooseTime: dayjs(new Date()).format('YYYY-MM-DD'),
timeChoosetList: [],
chooseTimeIndex: 1000,
pickerOptionsStart: {
disabledDate: (time) => {
return time.getTime() < Date.now() - 1 * 24 * 3600 * 1000; // 减去一天的时间代表可以选择同一天;
const now = new Date();
const day = now.getDay();
const oneDayTime = 24 * 60 * 60 * 1000;
const SundayTime = (7 - day) * oneDayTime + 21 * 24 * 60 * 60 * 1000;
return (
time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() ||
time.getTime() > new Date().getTime() + SundayTime
);
},
},
};
},
watch: {},
created() {
vm = this;
console.log(this.departmentId, 'bizTypebizTypebizType');
this.getLeisureTime();
},
methods: {
confirm() {
// this.$refs.setForm.validate((valid) => {
// if (valid) {
if (!(this.rangeTime != null && this.rangeTime.length > 0)) {
vm.$message.warning('请选择助诊意向时间');
getLeisureTime(time) {
console.log(this.doctorInfo);
const params = {
departmentId: this.departmentId,
weekDay: time ? time : this.chooseTime,
};
getLeisureTime(params).then((res) => {
if (res.code == '000000') {
console.log(res);
this.timeChoosetList = res.data || [];
}
});
},
getNowDate(value) {
this.chooseTime = dayjs(value).format('YYYY-MM-DD');
this.getLeisureTime(this.chooseTime);
},
nextChangeData() {
const now = new Date();
const day = now.getDay();
const SundayTime = 7 - day;
console.log(SundayTime, 'SundayTime');
const maxDate = dayjs(new Date())
.add(SundayTime + 20, 'day')
.unix();
if (dayjs(this.chooseTime).unix() > maxDate) {
this.$message({
message: '时间不能超过28天',
type: 'warning',
duration: 1000,
});
return false;
}
this.chooseTime = dayjs(this.chooseTime)
.add(1, 'day')
.format('YYYY-MM-DD');
this.getLeisureTime(this.chooseTime);
},
getChooseTimeValue(value, index) {
if (value.isFull == 0) {
return;
}
this.startDate = value.startDate;
this.endDate = value.endDate;
this.chooseTimeIndex = index;
},
confirm() {
if (this.startDate == '') {
this.$message({
message: '请选择排班时间',
type: 'warning',
duration: 1000,
});
return false;
}
vm.isClick = true;
const req = {
id: this.diagnoseLogId,
bizType: this.bizType,
assistantBeginTime: this.rangeTime[0],
assistantEndTime: this.rangeTime[1],
assistantRemark: this.model.assistantRemark,
assistantBeginTime: this.startDate,
assistantEndTime: this.endDate,
};
updateDiagnosis(req)
outboundIntention(req)
.then(function (res) {
vm.isClick = false;
if (res.code == '000000') {
......@@ -153,12 +233,14 @@
vm.$message.error(res.message);
}
})
.catch(function (err) {
.catch(function () {
vm.isClick = false;
vm.$message.error(err.message);
// vm.$message.error(err.message);
});
},
cancel() {
this.startTime = '';
this.endTime = '';
this.rangeTime = '';
this.model.assistantRemark = '';
this.$emit('update:diagnosisTimeVisible', false);
......@@ -167,4 +249,147 @@
};
</script>
<style lang="scss" scoped></style>
<style lang="scss" scoped>
.setTime-show {
/deep/.el-dialog__body {
padding: 30px 50px;
.choose-day-next {
padding: 0 30px 15px 0;
.el-date-editor {
margin-right: 10px;
.el-input__inner {
border-radius: 16px;
}
}
.next-day-pick {
width: 120px;
border-radius: 20px;
border: 1px solid #0d9078;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
}
.doctor-info {
background: #f0f2f5;
border-radius: 8px;
height: 68px;
display: flex;
.name-floor {
width: 50%;
padding: 10px 26px;
.name-info-detail {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
margin-bottom: 8px;
margin-right: 5px;
}
.doctor-info-name {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
margin-bottom: 8px;
}
.info-phone {
font-size: 18px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
}
.daignose-info {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
padding-top: 40px;
}
}
.work-info-Num {
padding-top: 20px;
.work-info-Num-span {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
.time-list-show {
display: flex;
flex-wrap: wrap;
height: 100%;
// justify-content: space-between;
padding-bottom: 20px;
.home_grid_item {
flex-basis: 17%;
margin-bottom: 10px;
margin-top: 15px;
text-align: center;
padding: 0;
border-radius: 11px;
margin-right: 20px;
.grid_text {
background: #f5f6f8;
border: 1px solid transparent;
padding: 3px;
.show-meet-time {
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #212121;
}
.no-meet-time {
font-size: 13px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
}
.can-meet-time {
font-size: 10px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
padding: 2px;
}
.canot-meet-time {
font-size: 10px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #666666;
padding: 2px;
}
}
.choose-time-choose {
padding: 3px;
background: #edfbf9;
border-radius: 4px;
border: 1px solid #a1e1d9;
color: #0d9078;
}
}
}
}
.dialog-footer {
.contest {
width: 180px;
height: 40px;
background: #0d9078;
border-radius: 20px;
}
.cancel-submit {
width: 180px;
height: 40px;
border-radius: 20px;
border: 1px solid #0d9078;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
}
}
}
</style>
......@@ -21,21 +21,30 @@
class="required-label"
prop="triageDepartmentId"
>
<el-select
<el-cascader
ref="cascader"
v-model="model.triageDepartmentId"
placeholder="请选择分诊科室"
clearable
filterable
style="width: 56%; height: 32px; line-height: 32px"
clearable
:options="allTilst"
placeholder="选择科室"
:show-all-levels="false"
@change="change"
>
<el-option
v-for="item in depList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
<template slot-scope="{ data }">
<span :style="{ fontSize: '15px', color: '#606266' }">{{
data.label
}}</span>
<span
:style="{
fontSize: '10px',
color: '#606266',
marginLeft: '10px',
opacity: '0.7',
}"
>{{ data.text }}</span>
</template>
</el-cascader>
</el-form-item>
<el-form-item label="备注">
......@@ -70,6 +79,7 @@
<script>
import { updateDiagnosis, getDepList } from '../../utils/diagnosis';
import { departmentAll } from '@/api/diagnosis';
let vm = null;
export default {
props: {
......@@ -92,6 +102,12 @@
},
data() {
return {
// props: {
// // props定义的值根据接口返回的数据定的
// label: 'departmentId',
// value: 'departmentName',
// children: [],
// },
show: false,
title: '设置分诊科室',
confirmTxt: '确定',
......@@ -107,6 +123,8 @@
{ required: true, message: '请选择分诊科室', trigger: 'change' },
],
},
allTilst: [],
allList: {},
};
},
watch: {
......@@ -125,8 +143,63 @@
created() {
vm = this;
this.getDepList();
this.departmentAll();
},
methods: {
departmentAll() {
departmentAll().then((res) => {
if (res.code == '000000') {
console.log(res, 'res111');
this.allList = res.data || {};
this.showListALL();
}
});
},
getCascaderObj(val, opt) {
return val.map(function (value) {
for (var itm of opt) {
if (itm.value == value) {
opt = itm.children;
return itm;
}
}
return null;
});
},
showListALL() {
const arr = [];
const { departmentMapList, parentDepartmentList } = this.allList;
parentDepartmentList.map((item) => {
const obj = {
label: item.departmentName,
value: item.departmentId,
children: [],
};
departmentMapList.map((info) => {
if (info.parentDepartmentId === obj.value) {
const children = [];
info.diagnoseDepartmentRespList.map((detail) => {
const secondObj = {
label: detail.departmentName,
value: detail.departmentId,
text: '',
};
let secondChildren = '';
(detail.departmentDeseaseRespList || []).map((res) => {
secondChildren += res.deseaseName + ' ';
});
secondObj.text = secondChildren ? `(${secondChildren})` : '';
children.push(secondObj);
});
obj.children = children;
}
});
arr.push(obj);
});
console.log(arr);
this.allTilst = arr;
},
getDepList() {
getDepList()
.then(function (res) {
......@@ -171,15 +244,18 @@
this.model.triageDepartmentId = '';
this.model.triageRemark = '';
this.$emit('update:doctorVisible', false);
// this.doctorVisible = false;
},
change(data) {
for (let i = 0; i < this.depList.length; i++) {
if (data == this.depList[i].id) {
this.model.triageDepartment = this.depList[i].name;
break;
}
change() {
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.model.triageDepartmentId = checkedNodes[0].value;
this.model.triageDepartment = checkedNodes[0].label;
} else {
this.model.triageDepartmentId = '';
this.model.triageDepartment = '';
}
console.log(this.model.triageDepartmentId, 'model.triageDepartmentId');
console.log(this.model.triageDepartment, 'model.triageDepartment');
},
},
};
......
......@@ -9,7 +9,10 @@
>
<template slot="empty">
<div class="nothing-data">
<img src="../../assets/image/nothingData.png" alt="" >
<img
src="../../assets/image/nothingData.png"
alt=""
>
<span class="nothing-data-title">暂未找到符合条件的医生</span>
</div>
</template>
......@@ -88,6 +91,13 @@
align="center"
sortable
/>
<el-table-column
prop="modifiedId"
label="修改人ID"
width="170"
align="center"
sortable
/>
<el-table-column
prop="mobilePhone"
label="联系电话"
......@@ -261,20 +271,20 @@
<style lang="scss" scoped>
.table-serviceSchedule {
.el-table {
.nothing-data{
.nothing-data {
display: inline-grid;
padding-top: 100px;
img{
img {
width: 338px;
height: 159px;
}
.nothing-data-title{
.nothing-data-title {
padding-top: 40px;
padding-bottom: 150px;
font-size: 16px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #89888B;
color: #89888b;
line-height: 22px;
}
}
......
......@@ -68,13 +68,13 @@ const serviceSchedule = (r) =>
() => r(require('@/views/IM/diagnosis-admin/serviceSchedule.vue')),
'serviceSchedule'
);
const addEditSchedule = (r) =>
const addEditSchedule = (r) =>
require.ensure(
[],
() => r(require('@/views/IM/diagnosis-admin/addEditSchedule.vue')),
'addEditSchedule'
);
const overviewScheduling = (r) =>
const overviewScheduling = (r) =>
require.ensure(
[],
() => r(require('@/views/IM/diagnosis-admin/overviewScheduling.vue')),
......
......@@ -16,6 +16,15 @@ export const updateDiagnosis = (params) => {
});
};
export const manualQueue = (params) => {
return fetch({
headers,
url: getBaseUrl('/diagnose/diagnose/manual/queue'),
method: 'post',
data: params,
description: '保存问诊相关信息',
});
};
/* 批量设置运营*/
export const batchSetOperator = (params) => {
return fetch({
......
......@@ -36,7 +36,7 @@
label="分诊科室"
class="t-b"
>
<el-select
<!-- <el-select
v-model="searchParam.triageDepartmentId"
placeholder="请选择科室"
style="width: 220px"
......@@ -48,7 +48,31 @@
:label="item.name"
:value="item.id"
/>
</el-select>
</el-select> -->
<el-cascader
ref="cascader"
v-model="searchParam.triageDepartmentId"
filterable
clearable
:options="allTilst"
placeholder="选择科室"
:show-all-levels="false"
@change="changeDepart"
>
<template slot-scope="{ data }">
<span :style="{ fontSize: '15px', color: '#606266' }">{{
data.label
}}</span>
<span
:style="{
fontSize: '10px',
color: '#606266',
marginLeft: '10px',
opacity: '0.7',
}"
>{{ data.text }}</span>
</template>
</el-cascader>
</el-form-item>
</div>
<div>
......@@ -435,12 +459,13 @@
@search="search"
/>
<diagnosis-doctor
v-if="diagnoseFlag"
v-if="diagnosisDoctorVisible"
:diagnosis-doctor-visible.sync="diagnosisDoctorVisible"
:diagnose-log-id="diagnoseLogId"
:diagnose-type="diagnoseType"
:doctor-id="doctorId"
:range-time-data="rangeTimeData"
:doctor-info="doctorInfo"
@search="search"
@changeStartTime="changeStartTime"
/>
......@@ -451,9 +476,14 @@
@search="search"
/>
<diagnosis-time
v-if="diagnosisTimeVisible"
:diagnosis-time-visible.sync="diagnosisTimeVisible"
:diagnose-log-id="diagnoseLogId"
:biz-type="bizType"
:user-name="userName"
:user-name-phone="userNamePhone"
:triage-department="triageDepartment"
:department-id="departmentId"
@search="search"
/>
<rematching-doctor
......@@ -502,6 +532,7 @@
getDepartments,
diagnoseExport,
diagnoseList,
departmentAll,
} from '@/api/diagnosis';
import MatchComponent from '@/components/common/match';
......@@ -621,6 +652,13 @@
},
timer: null,
fromType: 0, // 1或不传为为预约单列表 2为运营预约单列表 3为分诊台 4为接诊台
doctorInfo: {},
userName: '',
userNamePhone: '',
triageDepartment: '',
departmentId: '',
allTilst: [],
allList: {},
};
},
watch: {
......@@ -638,16 +676,72 @@
},
created() {
vm = this;
this.getDep();
// this.getDep();
},
mounted() {
this.setTableHeight();
this.getOutboundNote();
this.departmentAll();
},
destroyed() {
clearInterval(this.timer);
},
methods: {
departmentAll() {
departmentAll().then((res) => {
if (res.code == '000000') {
console.log(res, 'res111');
this.allList = res.data || {};
this.showListALL();
}
});
},
showListALL() {
const arr = [];
const { departmentMapList, parentDepartmentList } = this.allList;
parentDepartmentList.map((item) => {
const obj = {
label: item.departmentName,
value: item.departmentId,
children: [],
};
departmentMapList.map((info) => {
if (info.parentDepartmentId === obj.value) {
const children = [];
info.diagnoseDepartmentRespList.map((detail) => {
const secondObj = {
label: detail.departmentName,
value: detail.departmentId,
text: '',
};
let secondChildren = '';
(detail.departmentDeseaseRespList || []).map((res) => {
secondChildren += res.deseaseName + ' ';
});
secondObj.text = secondChildren ? `(${secondChildren})` : '';
children.push(secondObj);
});
obj.children = children;
}
});
arr.push(obj);
});
console.log(arr);
this.allTilst = arr;
},
changeDepart() {
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.searchParam.triageDepartmentId = checkedNodes[0].value;
} else {
this.searchParam.triageDepartmentId = '';
}
console.log(
this.searchParam.triageDepartmentId,
'this.searchParam.triageDepartmentId'
);
},
changeStartTime(time) {
this.rangeTimeData = time
? time.time
......@@ -1028,14 +1122,13 @@
},
// 设为待匹配医生
waitMatchDot(row) {
console.log(row, 'doctorData111');
this.doctorData = row;
this.diagnoseLogId = row.diagnoseLogId;
// 待分诊
// if(row.status == 22){
// this.doctorVisible = true;
// this.bizType = 7;
// this.triageDepartmentId = row.triageDepartmentId;
// }
// else {
this.userName = row.userName;
this.userNamePhone = row.userMobile;
this.triageDepartment = row.triageDepartment;
this.departmentId = row.departmentId;
this.diagnosisTimeVisible = true;
this.bizType = 5;
// }
......@@ -1107,10 +1200,10 @@
// 设为待确认时间
waitMatchTime(row) {
console.log(row, 'row');
this.doctorInfo = row;
this.rangeTimeData = row.assistantBeginTime;
this.diagnoseFlag = true;
this.diagnosisDoctorVisible = true;
this.diagnoseLogId = row.diagnoseLogId;
this.diagnoseType = row.diagnoseType;
if (row.doctorId == 0) {
......
.agment-box {
.schedul-box {
width: 100%;
height: auto;
position: relative;
display: flex;
justify-content: space-between;
.agment-box {
height: 100%;
background: #fff;
overflow: hidden;
padding: 20px;
border-radius: 6px;
flex: 3.8;
}
.w2{
/deep/.fc-prev-button{
background:#f4f4f5;
}
.setMaxNum {
display: flex;
justify-content: space-around;
}
.input-value {
width: 100px;
/deep/.el-input-number__decrease {
width: 20px;
}
/deep/.el-input-number__increase {
width: 20px;
}
/deep/.el-input__inner {
padding: 0;
}
}
.list-item {
width: 86px;
height: 25px;
background: #ffffff;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
.list-item-noth {
width: 86px;
height: 25px;
background: red;
border-radius: 16px;
border: 1px solid rgba(0, 0, 0, 0.15);
text-align: center;
}
.w2 {
/deep/.fc-prev-button {
background: #f4f4f5;
cursor: not-allowed;
border:1px solid #d9d9d9;
border: 1px solid #d9d9d9;
}
}
.w3{
/deep/.fc-next-button{
background:#f4f4f5;
border:1px solid #d9d9d9;
}
.w3 {
/deep/.fc-next-button {
background: #f4f4f5;
border: 1px solid #d9d9d9;
cursor: not-allowed;
}
}
/deep/.fc-timegrid-event-harness{
}
/deep/.fc-timegrid-event-harness {
// position: absolute !important;
left: 0 !important;
}
.agment-box-left {
}
.agment-box-left {
flex: 1;
height: 100%;
padding: 20px;
margin-left: 12px;
background: #fff;
border-radius: 6px;
}
.ag-left-change {
text-align: center;
display: flex;
justify-content: center;
}
.el-dialog-show {
.set-agment-maxNum {
.first-show-num {
text-align: center;
padding-bottom: 30px;
}
.num-max {
text-align: center;
.hour-num-title {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #02120f;
}
.num-input-show {
padding-top: 10px;
.el-input {
width: 50%;
/deep/.el-input__inner {
border-radius: 20px;
text-align: center;
}
}
}
}
}
}
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
......@@ -53,57 +120,130 @@
right: 1%;
top: 18px;
}
}
.agment-left-con {
margin-top: 70px;
background: #f0f2f5;
height: auto;
padding: 20px;
overflow: hidden;
border-radius: 8px;
}
.agment-head {
}
.show-work-set {
margin-top: 100px;
}
.agment-left-con {
padding: 15px;
text-align: center;
background: #f2f2f2;
border-radius: 12px;
}
.reset-doctor-schedu {
padding: 30px 15px 5px 15px;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
}
.copy-doctor-schedu {
padding: 5px;
margin: 0 auto;
text-align: center;
.copy-submit {
background: #fff;
border: 1px solid #9ed4ca;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
}
}
.agment-left-copy {
padding: 5px;
margin: 0 auto;
text-align: center;
.copy-reset-schedu {
padding-top: 14px;
.copy-week-schedu {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-right: 5px;
cursor: pointer;
}
.copy-reaset-line {
color: #d9d9d9;
}
.reset-week-schedu {
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
margin-left: 5px;
cursor: pointer;
}
}
}
.first-left-max {
padding: 5px;
margin: 0 auto;
text-align: center;
font-size: 14px;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0d9078;
cursor: pointer;
}
.agment-head {
border-radius: 5px;
display: flex;
justify-content: flex-start;
align-items: flex-end;
}
.agment-head-name {
text-align: center;
}
.agment-head-name {
font-size: 20px;
color: #02120f;
font-weight: 600;
}
.agment-head-phone {
padding: 3px;
}
.agment-head-phone {
font-size: 18px;
margin-left: 16px;
}
.agment-hospital {
}
.agment-hospital {
color: #89888b;
font-size: 16px;
margin-top: 14px;
line-height: 24px;
}
.agment-hospital-ks {
margin-top: 10px;
}
.agment-hospital-show {
margin-right: 10px;
}
.agment-hospital-ks {
margin-top: 8px;
}
.agment-head-title {
}
.agment-head-title {
font-size: 14px;
color: #02120f;
margin-top: 19px;
}
.agment-head-none{
}
.agment-head-none {
background: #fff;
pointer-events: none;
}
.agment-head-priority {
}
.new-max {
text-align: center;
margin-top: 20px;
}
.new-max-none {
text-align: center;
margin-top: 20px;
pointer-events: none;
}
.agment-head-priority {
padding-top: 20px;
display: flex;
justify-content:center;
justify-content: center;
align-items: center;
.item {
width: 42px;
height: 32px;
margin-right:10px;
margin-right: 10px;
border: 1px solid #d9d9d9;
border-radius: 8px;
text-align: center;
......@@ -115,79 +255,101 @@
background: #0d9078;
border: none;
}
}
.agment-left-button {
}
.agment-left-button {
margin-top: 34px;
display: flex;
justify-content: center;
}
.reset-submit{
}
.copy-submit {
background: #0d9078;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #ffffff;
}
.reset-submit {
background: #fff;
border: 1px solid #0D9078;
border: 1px solid #0d9078;
font-family: PingFangSC-Regular, PingFang SC;
font-weight: 400;
color: #0D9078;
}
/deep/.fc-timegrid-event {
color: #0d9078;
}
/deep/.fc-timegrid-event {
border-radius: 1px !important;
}
/deep/thead .fc-scroller-harness {
}
/deep/thead .fc-scroller-harness {
background: #fcfbff;
}
/deep/.fc-col-header-cell-cushion {
}
/deep/.fc-col-header-cell-cushion {
color: #333;
height: 45px;
line-height: 45px;
}
/deep/.fc .fc-highlight {
}
/deep/.fc .fc-highlight {
background: transparent;
}
/deep/.fc-header-toolbar {
}
/deep/.fc-header-toolbar {
position: absolute;
right:1%;
top: 25px;
right: 0;
top: 15px;
padding: 20px;
width: 20%;
}
/deep/.fc-toolbar-title {
}
/deep/.fc-toolbar-title {
font-size: 6px;
}
/deep/.fc-toolbar-chunk{
display:flex;
}
/deep/.fc-button-primary {
}
/deep/.fc-toolbar-chunk {
display: flex;
}
/deep/.fc-button-primary {
background: #fff;
color: #02120f;
border-color: #d9d9d9;
border-radius: 20px;
padding: 6px 16px;
flex-shrink: 0;
}
@media screen and (min-width: 1000px) and (max-width: 1300px){
}
@media screen and (min-width: 1000px) and (max-width: 1300px) {
/deep/.fc-header-toolbar {
right: 6%;
}
.ag-left1 {
width:12% !important;
width: 12% !important;
right: 18% !important;
border:1px solid red !important;
// border: 1px solid red !important;
}
.ag-left2 {
width:12% !important;
width: 12% !important;
right: 1% !important;
}
}
/deep/.fc-myCustomButton-button {
}
/deep/.fc-myCustomButton-button {
padding: 6px 24px;
}
/deep/.fc-button-primary:hover {
}
/deep/.fc-button-primary:hover {
background: #fff;
color: #02120f;
border: 1px solid #0d9078;
}
/deep/.fc-event-time {
}
/deep/.fc-event-time {
font-size: 14px;
color: #0d9078;
word-wrap: break-word;
white-space: normal;
}
/deep/.fc-col-header-cell-cushion {
background: #fff;
border: 1px solid #0d9078;
color: #0d9078;
border-radius: 20px;
height: 30px;
line-height: 25px;
font-size: 14px;
margin: 10px 0;
text-decoration: none;
}
/deep/a:hover {
text-decoration: none;
}
}
<template>
<div
v-loading="loading"
style="
width: 100%;
height: auto;
position: relative;
display: flex;
justifycontent: space-between;
"
class="schedul-box"
>
<div
ref="agment"
class="agment-box"
:class="{'w2':week==2,'w3':week==3}"
:class="{ w2: week == 2, w3: week == 3 }"
>
<FullCalendar :options="calendarOptions" />
</div>
......@@ -25,13 +19,12 @@
v-if="week == 2"
class="ag-left1"
/>
<!-- v-if="week == 2" -->
<div
v-if="week == 3"
v-if="week == 5"
class="ag-left2"
/>
<!-- -->
</div>
<div class="show-work-set">
<div class="agment-left-con">
<div class="agment-head">
<div class="agment-head-name">
......@@ -42,59 +35,118 @@
</div>
</div>
<div class="agment-hospital">
{{ this.schedulingTypeValue.hospital }}
<span
class="agment-hospital-show"
>{{ this.schedulingTypeValue.hospital }}
</span>
</div>
<div class="agment-hospital">
<span>{{ this.schedulingTypeValue.departmentName }}</span>
</div>
<div class="agment-hospital agment-hospital-ks">
{{ this.schedulingTypeValue.departmentName }}
</div>
<div class="maxNum-first-show">
<span>每小时接诊上限人数:
<span :class="showMaxNum <= 0 ? 'show-sep-num' : ''">{{
showMaxNum > 0 ? showMaxNum : 0
}}</span>
</span>
<p>优先级: {{ showFirNum }}</p>
</div>
<div
style="margin-top: 24px"
v-if="this.schedulingType != 3"
class="reset-doctor-schedu"
>
<p class="agment-head-title">
选择匹配优先级
</p>
<div :class="this.schedulingType == 3 ? 'agment-head-none' : '' ">
<div class="agment-head-priority">
<p
v-for="(item, index) in createList"
:key="index"
class="item"
:class="{ active: item == currentIndex }"
@click="handlePriority(item)"
<el-button
round
class="copy-submit"
style="width: 240px"
@click="resetDoctoreScheduling"
>
{{ item }}
</p>
</div>
</div>
重置排班
</el-button>
</div>
<div
v-if="this.schedulingType != 3"
class="agment-left-button"
class="copy-doctor-schedu"
>
<el-button
round
class="reset-submit"
style="width: 110px"
@click="resetDoctoreScheduling"
class="copy-submit"
style="width: 240px"
@click="copyDoctoreScheduling"
>
重置
复制上周排班
</el-button>
</div>
<div
v-if="this.schedulingType != 3"
class="agment-left-copy"
>
<el-button
type="primary"
round
style="width: 110px"
class="copy-submit"
style="width: 240px"
@click="saveDoctoreScheduling(1)"
>
保存
保存全部
</el-button>
</div>
<div
v-if="this.schedulingType != 3"
class="first-left-max"
>
<span @click="centerDialogVisible = true">优先级和接诊上限设置</span>
</div>
</div>
</div>
<el-dialog
:visible.sync="centerDialogVisible"
width="30%"
center
class="el-dialog-show"
>
<div class="set-agment-maxNum">
<div class="first-show-num">
<span class="agment-head-title"> 选择匹配优先级 </span>
<div class="agment-head-priority">
<p
v-for="(item, index) in createList"
:key="index"
class="item"
:class="{ active: item == currentIndex }"
@click="handlePriority(item)"
>
{{ item }}
</p>
</div>
</div>
<div class="num-max">
<span class="hour-num-title">每小时接诊上限人数</span>
<div class="num-input-show">
<el-input-number
v-model="maxNumValue"
:min="0"
:max="20"
@change="getMaxNumValue"
/>
</div>
</div>
</div>
<span
slot="footer"
class="dialog-footer"
>
<el-button @click="centerDialogVisible = false">取 消</el-button>
<el-button
type="primary"
@click="submitSetData"
>确 定</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
// import '@fullcalendar/core/vdom'
// import moment from 'moment';
import dayjs from 'dayjs';
import FullCalendar from '@fullcalendar/vue';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
......@@ -104,23 +156,28 @@
saveDutyRoster,
getLevel,
getDoctorInfo,
saveLevelAndDayCount,
getLevelAndDayCount,
} from '@/api/serviceSchedule';
export default {
name: 'Index',
name: 'Scheduing',
components: {
FullCalendar,
},
data() {
return {
id:'',
doctorId:'',
schedulingTypeValue:{},
maxPreNum: '',
chooseList: true,
id: '',
doctorId: '',
schedulingTypeValue: {},
schedulingType: 1, // 1 新增 2 编辑 3 查看
createList: [],
listDate: [],
week: 1, // 1:当前周 2:上一周 3:下一周
currentIndex: 3,
haveWeek: [1],
businessHours: true,
calendarOptions: {
// 引入的插件,比如fullcalendar/daygrid,fullcalendar/timegrid引入后才可显示月,周,日
plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin],
......@@ -131,7 +188,10 @@
selectOverlap: false,
select: this.selectInfo,
selectMinDistance: 0,
eventResize: this.eventResize,
eventOverlap: false,
navLinks: true,
navLinkDayClick: this.navLinkDayClick,
// eventDurationEditable:false,
eventDrop: this.eventDrop,
editable: true,
overlap: false,
......@@ -166,7 +226,7 @@
},
expandRows: true,
slotMinWidth: 50,
slotDuration: '00:30:00',
slotDuration: '01:00:00',
slotMinTime: '09:00',
slotMaxTime: '21:00',
slotLabelInterval: '',
......@@ -191,17 +251,23 @@
workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0,
loading: false,
isDoIt:false
isDoIt: false,
getStartWeek: '',
copyArr: [],
centerDialogVisible: false,
maxNumValue: '',
showFirNum: '',
showMaxNum: '',
};
},
computed: {},
watch: {
week(newV, oldV) {
console.log(newV, oldV, 'newV, oldV');
if (this.haveWeek.indexOf(newV) == -1) {
this.haveWeek.push(newV);
this.handleInitSearch();
}
if(newV !== oldV) {
if (newV !== oldV) {
this.handleInitSearch();
this.saveDoctoreScheduling(2, oldV);
}
......@@ -210,12 +276,12 @@
created() {
this.schedulingType = this.$route.query.type || 1;
this.id = this.$route.query.id;
this.doctorId = this.$route.query.doctorId,
(this.doctorId = this.$route.query.doctorId),
getDoctorInfo({ id: this.id }).then((res) => {
if (res.code == '000000') {
this.schedulingTypeValue = res.data;
this.currentIndex = res.data.level;
}else{
} else {
this.$toast(res.message);
}
});
......@@ -226,9 +292,7 @@
});
},
mounted() {
console.log(this.calendarOptions.events, 'this.calendarOptions.events');
this.scrollerHeight = this.$refs.agment.clientHeight + 'px';
// console.log(this.$refs.agment.clientHeight, 'this.$refs.agment.offsetHeight;');
this.init();
},
methods: {
......@@ -241,83 +305,216 @@
* view是当前视图对象。
*/
init() {
// schedulingType 1,2 表示编辑新加,其他表示查看
if (this.schedulingType == 1 || this.schedulingType == 2) {
this.calendarOptions.editable = true;
} else {
// 查看
this.calendarOptions.slotDuration = '00:05:00';
this.calendarOptions.slotDuration = '01:00:00';
this.calendarOptions.selectable = false;
this.calendarOptions.editable = false;
}
this.handleInitSearch();
this.getLevelAndDayCount();
},
getLevelAndDayCount(newV) {
const params = {
workId: newV ? newV : this.id,
};
getLevelAndDayCount(params).then((res) => {
if (res.code === '000000') {
console.log(res, 'res');
this.currentIndex = res.data.level;
this.maxNumValue = res.data.preNum;
(this.showFirNum = res.data.level),
(this.showMaxNum = res.data.preNum);
}
});
},
navLinkDayClick(date) {
const day = dayjs(date).day();
const dayDate = dayjs(date).date();
const dayFormat = dayjs(date).format('YYYY-MM-DD');
let selectDate = dayFormat + ' ' + '09:00:00';
selectDate = dayjs(selectDate).unix();
const nowDate = dayjs(new Date()).unix();
let isAddAllDay = true;
const haveSelectDate = this.calendarOptions.events;
const len = haveSelectDate.length;
const differenceTime = ((nowDate - selectDate) / 3600) | 0;
if (differenceTime > 0 && differenceTime >= 24) {
return this.$message.info('你不能添加过去的时间的排班');
}
for (var i = 0; i < len; i++) {
const itemDay = dayjs(haveSelectDate[i].start).day();
if (!haveSelectDate[i].constraint && day === itemDay) {
haveSelectDate[i].allStatus && (isAddAllDay = false);
const index = this.getIdDeleteData(haveSelectDate[i].id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
i--;
}
}
if (isAddAllDay) {
// 添加日期
const selectAllDay = [
{ startTime: '09:00:00', endTime: '12:00:00' },
{ startTime: '13:00:00', endTime: '21:00:00' },
];
selectAllDay.forEach((item) => {
const allDayData = {};
allDayData.id =
dayDate + (this.calendarOptions.events.length + 1) * 10;
allDayData.week = this.week;
allDayData.end = dayFormat + ' ' + item.endTime;
allDayData.start = dayFormat + ' ' + item.startTime;
allDayData.allStatus = true;
console.log(allDayData);
this.calendarOptions.events.push(allDayData);
});
this.isDoIt = true;
}
},
getCopyData(lastWeekData) {
const copyDate = [];
const addDay = 7;
lastWeekData.noAcceptList.map((item) => {
const nowWeekTime = {};
nowWeekTime['startTime'] = dayjs(item.startTime)
.add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss');
nowWeekTime['endTime'] = dayjs(item.endTime)
.add(addDay, 'day')
.format('YYYY-MM-DD HH:mm:ss');
copyDate.push(nowWeekTime);
});
this.calendarOptions.events = [];
lastWeekData.noAcceptList = copyDate;
this.isDoIt = true;
},
handleInitSearch(isReset) {
if (isReset) {
this.calendarOptions.events = this.calendarOptions.events.filter((v) => (v.week !== this.week));
console.log(this.calendarOptions.events);
handleInitSearch(isReset, isLoopLast) {
//
if (isReset && isLoopLast != 1) {
this.calendarOptions.events = this.calendarOptions.events.filter(
(v) => v.week !== this.week
);
}
let copyWeek = '';
if (isLoopLast == 1) {
if (this.week == 1) {
copyWeek = 2;
} else if (this.week == 3) {
copyWeek = 1;
} else if (this.week == 4) {
copyWeek = 3;
} else if (this.week == 5) {
copyWeek = 4;
}
const objParms = {};
objParms.doctorId = this.doctorId;
objParms.week = this.week;
objParms.workId = this.id;
// this.currentIndex = this.schedulingTypeValue.level;
dutyRosterQuery(objParms).then((res) => {
}
const searchLastWeek = {};
searchLastWeek.doctorId = this.doctorId;
searchLastWeek.week = isLoopLast == 1 ? copyWeek : this.week;
// isLoopLast == 1 表示 copy
searchLastWeek.workId = this.id;
dutyRosterQuery(searchLastWeek).then((res) => {
if (res.code == '000000') {
console.log(res.data.noAcceptList, 'res.data.noAcceptList');
if (isLoopLast == 1 && !res.data.noAcceptList.length) {
return this.$toast('没有上周的排班信息可以用');
} else {
this.calendarOptions.events = [];
}
if (isLoopLast == 1 && res.data.noAcceptList.length) {
this.getCopyData(res.data);
}
this.handleInitData(res.data);
} else {
this.$toast(res.message);
}
});
},
handleInitData(data) {
handleInitData(weekData) {
var newDate = null;
if (this.schedulingType != 3) {
newDate = [].concat(data.noAcceptList);
console.log(newDate, 'newDate');
newDate = [].concat(weekData.noAcceptList);
} else {
var acceptList = [];
data.acceptList.forEach((item) => {
weekData.acceptList.forEach((item) => {
item.type = 88;
acceptList.push(item);
});
console.log(data.acceptList, 'data.acceptList');
newDate = [].concat(acceptList, data.noAcceptList);
newDate = [].concat(acceptList, weekData.noAcceptList);
}
// const keyAll = ['end', 'endStr', 'id', 'start', 'startStr'];
newDate.forEach((item) => {
const dataObj = {};
const selectDate = {};
const id = (this.calendarOptions.events.length + 1) * 10;
dataObj['week'] = this.week;
dataObj['id'] = id;
dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime;
console.log(item.type);
dataObj['type'] = item.type;
selectDate['week'] = this.week;
selectDate['id'] = id;
selectDate['end'] = item.endTime;
selectDate['start'] = item.startTime;
selectDate['type'] = item.type;
if (item.type == 88) {
dataObj['color'] = '#FFEDE9';
selectDate['color'] = '#FFEDE9';
}
this.calendarOptions.events.push(dataObj);
this.calendarOptions.events.push(selectDate);
});
this.limmitDateFun();
},
limmitDateFun() {
for (let i = 0; i < 7; i++) {
const limitTime = {};
const day = dayjs(this.getEveryDay)
.add(i, 'day')
.format('YYYY-MM-DD HH:mm:ss');
limitTime.start = dayjs(day)
.add(12, 'hour')
.format('YYYY-MM-DD HH:mm:ss');
limitTime.end = dayjs(day)
.add(13, 'hour')
.format('YYYY-MM-DD HH:mm:ss');
limitTime.constraint = 'businessHours';
limitTime.color = '#ccc';
limitTime.display = 'background';
limitTime.editable = false;
this.calendarOptions.events.push(limitTime);
}
console.log('obj', this.getEveryDay);
},
handleDatesSet(dataInfo) {
const currentTime = new Date().getTime();
const getTime = new Date(dataInfo.startStr).getTime();
const cz = currentTime - getTime;
const oneHour = 1 * 60 * 60 * 1000 * 24;
const timeDifference = (cz / oneHour) | 0;
const headObj = this.calendarOptions.customButtons.myCustomButton;
if (timeDifference >= 0 && timeDifference < 7) {
this.getEveryDay = dayjs(dataInfo.start).format('YYYY-MM-DD HH:mm:ss');
const currentTime = new Date().getTime(); // 今天的时间戳
const getTime = new Date(dataInfo.start).getTime(); // 每周周一的时间戳
const cz = currentTime - getTime; // 每周周一时间戳 - 今天的时间
const oneHour = 1 * 60 * 60 * 1000 * 24; // 一天的时间戳
const timeDifference = (cz / oneHour) | 0; // 每周一时间距离今天时间数量
const weekHeadTitle = this.calendarOptions.customButtons.myCustomButton;
console.log(timeDifference, 'timeDifference', cz / oneHour);
// debugger;
const exactTime = cz / oneHour;
if (timeDifference == 0 && exactTime > 0) {
this.week = 1;
weekHeadTitle.text = '本周';
return;
}
if (timeDifference > 0 && timeDifference <= 6) {
// 过去
this.week = 1;
headObj.text = '本周';
} else if (timeDifference < 0) {
weekHeadTitle.text = '本周';
} else if (timeDifference >= -6 && timeDifference <= 0) {
// 未来
this.week = 3;
headObj.text = '下周';
} else {
weekHeadTitle.text = '下周';
} else if (timeDifference >= -13 && timeDifference <= -7) {
// 未来
this.week = 4;
weekHeadTitle.text = '第二周';
} else if (timeDifference >= -20 && timeDifference <= -14) {
// 未来
this.week = 5;
weekHeadTitle.text = '第三周';
} else if (timeDifference >= 7) {
// 现在
headObj.text = '上周';
weekHeadTitle.text = '上周';
this.week = 2;
}
},
......@@ -337,54 +534,72 @@
this.getHandleTime(dataObj);
},
handleEventClick(event) {
if (!this.calendarOptions.selectable) {
if (!this.calendarOptions.selectable || event.event.constraint) {
return;
}
this.$confirm('你要取消日期吗?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then((_) => {
}).then((_) => {
console.log(_);
const index = this.getIdDeleteData(event.event.id);
this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
console.log(this.calendarOptions.events);
})
.catch((_) => {
console.log(_);
});
// alert("你要取消日期吗");
},
eventDrop(event) {
event.revert();
return;
},
selectInfo(info) {
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
if (startDay != endDay) {
return this.$toast('不能夸天选择排班');
// 每小时接诊上限人数
getMaxNumValue(value) {
console.log(value, 'getMaxNumValue');
this.maxNumValue = value;
},
// 提交优先级和人数
submitSetData() {
const params = {
doctorId: this.doctorId,
level: this.currentIndex,
workId: this.id,
preNum: this.maxNumValue,
};
saveLevelAndDayCount(params).then((res) => {
if (res.code === '000000') {
this.$message({
message: '设置成功',
type: 'success',
});
this.centerDialogVisible = false;
this.getLevelAndDayCount();
}
const id = (this.calendarOptions.events.length + 1) * 10;
});
},
selectInfo(info) {
console.log(info, 'infoinfoinfo');
const day = dayjs(info.start).date();
const id = day + (this.calendarOptions.events.length + 1) * 10;
info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week'];
const dataObj = {};
const keyAll = ['end', 'id', 'start', 'week'];
const selectTime = {};
keyAll.forEach((item) => {
if (item == 'week') {
dataObj[item] = this.week;
selectTime[item] = this.week;
} else {
dataObj[item] = info[item];
selectTime[item] = info[item];
}
});
this.calendarOptions.events.push(dataObj);
console.log(selectTime, 'dataObjdataObj');
this.calendarOptions.events.push(selectTime);
},
selectAllow(info) {
this.isDoIt = true;
const startDay = new Date(info.start).getDay();
const endDay = new Date(info.end).getDay();
if (startDay != endDay) {
const startHour = dayjs(info.start).hour();
console.log(dayjs(info.start).format('YYYY-MM-DD HH:mm:ss'));
if (startDay != endDay || startHour == 12) {
return false;
}
const currentDate = new Date();
......@@ -402,24 +617,24 @@
// 对于排班交叉部分处理
const infoStart = new Date(info.start).getTime();
const infoEnd = new Date(info.end).getTime();
const data = this.calendarOptions.events;
const newDate = [];
let indexObj = false;
data.forEach((item) => {
const d = new Date(item.end).getTime();
const s = new Date(item.start).getTime();
if (s > infoStart && infoEnd >= d) {
indexObj = true;
} else if (s > infoStart && infoEnd >= s) {
indexObj = true;
const haveSelectTime = this.calendarOptions.events;
const correctDate = [];
let isRepeat = false;
haveSelectTime.forEach((item) => {
const selectEndTime = new Date(item.end).getTime();
const selectStartTime = new Date(item.start).getTime();
if (selectStartTime > infoStart && infoEnd >= selectEndTime) {
isRepeat = true;
} else if (selectStartTime > infoStart && infoEnd >= selectStartTime) {
isRepeat = true;
} else {
const id = (newDate.length + 1) * 10;
const id = (correctDate.length + 1) * 10;
item.id = id;
newDate.push(item);
correctDate.push(item);
}
});
this.calendarOptions.events = newDate;
return indexObj;
this.calendarOptions.events = correctDate;
return isRepeat;
},
handlePriority(index) {
this.isDoIt = true;
......@@ -428,70 +643,51 @@
resetDoctoreScheduling() {
this.handleInitSearch(true);
},
copyDoctoreScheduling() {
this.handleInitSearch(true, 1);
},
saveDoctoreScheduling(type, weekV = 0) {
if(this.isDoIt) {
console.log(this.week, 'this.week', weekV);
if (this.isDoIt) {
this.loading = true;
const objParms = {};
objParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id;
objParms.level = this.currentIndex;
objParms.list = [];
const data = this.calendarOptions.events;
console.log(data, 'data');
data.forEach((item) => {
console.log(item.week == (weekV ? weekV : this.week));
const saveParms = {};
saveParms.week = weekV ? weekV : this.week;
saveParms.workId = this.schedulingTypeValue.id;
const lastData = [];
const haveSelectDate = this.calendarOptions.events;
haveSelectDate.forEach((item) => {
if (item.week == (weekV ? weekV : this.week)) {
console.log(item.week, this.week, weekV, 'this.week');
const obj = {};
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start);
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end);
console.log(obj, 'obj');
objParms.list.push(obj);
const saveDate = {};
saveDate.startTime = dayjs(item.start).format(
'YYYY-MM-DD HH:mm:ss'
);
saveDate.endTime = dayjs(item.end).format('YYYY-MM-DD HH:mm:ss');
lastData.push(saveDate);
}
});
saveDutyRoster(objParms).then((res) => {
console.log('saveParms=======', saveParms);
saveParms.list = lastData.filter((item) => {
return item.startTime.split(' ')[1] !== '12:00:00';
});
saveDutyRoster(saveParms).then((res) => {
if (res.code === '000000') {
// this.$toast(res.message);
// this.handleInitSearch(true);
// this.$router.go(0);
this.loading = false;
if(type == 1) {
this.$message({
message: '排班保存成功',
type: 'success'
type: 'success',
});
}
this.isDoIt = false;
this.handleInitSearch(true);
} else {
// this.$toast(res.message);
this.$message.error(res.message || '排班保存失败');
}
});
}
},
dateFormat(fmt, date2) {
const date = new Date(date2);
let ret;
const opt = {
'Y+': date.getFullYear().toString(), // 年
'm+': (date.getMonth() + 1).toString(), // 月
'd+': date.getDate().toString(), // 日
'H+': date.getHours().toString(), // 时
'M+': date.getMinutes().toString(), // 分
'S+': date.getSeconds().toString() || '00', // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
for (const k in opt) {
ret = new RegExp('(' + k + ')').exec(fmt);
if (ret) {
fmt = fmt.replace(
ret[1],
ret[1].length == 1 ? opt[k] : opt[k].padStart(ret[1].length, '0')
);
if (!this.maxNumValue && this.maxNumValue != 0) {
return this.$message({
message: '请设置优先级和接诊上限设置',
type: 'warning',
});
}
}
return fmt;
},
},
};
......
......@@ -14,7 +14,8 @@
ref="agmentSelect"
class="serviceSchedule_select"
>
<el-cascader
<div class="agmentSelect-select-left">
<!-- <el-cascader
v-model="innerform"
class="serviceSchedule-cascader"
filterable
......@@ -25,7 +26,32 @@
:show-all-levels="false"
@expand-change="handleItemChange"
@change="selectApi($event, innerform)"
/>
/> -->
<el-cascader
ref="cascader"
v-model="departmentId"
filterable
clearable
class="serviceSchedule-cascader"
:options="allTilst"
placeholder="选择科室"
:show-all-levels="false"
@change="changeDepartment"
>
<template slot-scope="{ data }">
<span :style="{ fontSize: '15px', color: '#606266' }">{{
data.label
}}</span>
<span
:style="{
fontSize: '10px',
color: '#606266',
marginLeft: '10px',
opacity: '0.7',
}"
>{{ data.text }}</span>
</template>
</el-cascader>
<el-date-picker
v-model="dateTime"
class="serviceSchedule_dateTime"
......@@ -42,13 +68,32 @@
查询
</el-button>
</div>
<div class="agmentSelect-select-right">
设置系统每小时接诊上限
<el-input-number
v-model="maxDiaNum"
:step="1"
:min="0"
:max="10000000"
step-strictly
@change="getInputNumber"
/>
<el-button
type="primary"
class="submit-btn"
@click="setPlatformUpper"
>
保存
</el-button>
</div>
</div>
<div
class="fullCalendar-show"
style="width:100%"
style="width: 100%"
>
<div
class="fullCalendar-show-out"
:style="{width:getWidth}"
:style="{ minWidth: getWidth, maxWidth: getMaxWidth }"
>
<FullCalendar
ref="fullCalendar"
......@@ -61,15 +106,16 @@
</div>
</template>
<script>
import { departmentAll } from '@/api/diagnosis';
import FullCalendar from '@fullcalendar/vue';
import dayGridPlugin from '@fullcalendar/daygrid';
import timeGridPlugin from '@fullcalendar/timegrid';
import interactionPlugin from '@fullcalendar/interaction';
import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
import {
getFirstLevelLable,
childLabelList,
previewWork,
setPlatformUpper,
getPlatformUpper,
} from '@/api/serviceSchedule';
export default {
name: 'Index',
......@@ -78,6 +124,7 @@
},
data() {
return {
maxDiaNum: 10,
dateTime: '',
interfaceOptions: [],
innerform: [],
......@@ -106,17 +153,17 @@
],
// timeZone: 'UTC',
locale: 'zh-cn',
aspectRatio: 2.5, // 设置日历单元格宽度与高度的比例。
aspectRatio: 2.8, // 设置日历单元格宽度与高度的比例。
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
initialView: 'resourceTimeGridDay',
resources: [],
eventColor: '#fff',
eventBackgroundColor: '#fff',
events: [],
slotMinWidth:50,
resourceAreaWidth:'5%',
slotMinWidth: 50,
resourceAreaWidth: '5%',
allDaySlot: false, // 周,日视图时,all-day 不显示
slotDuration: '00:05:00',
slotDuration: '01:00:00',
slotMinTime: '09:00',
slotMaxTime: '21:00',
slotLabelInterval: '',
......@@ -128,70 +175,111 @@
meridiem: 'short',
hour12: false, // 设置时间为24小时
},
expandRows: true,
},
workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0,
loading: false,
doctorList: [],
index: 0,
getWidth:'100%'
getWidth: '100%',
getMaxWidth: '100%',
allTilst: [],
allList: {},
};
},
watch: {},
created() {
this.getFirstLevelLable();
},
mounted() {
this.departmentAll();
this.getPlatformUpper();
},
mounted() {},
methods: {
// 通过监听expand-change事件(当展开节点发生变化时触发)获取第二层数据,组装interfaceOptions数据
handleItemChange(val) {
const value = val[0];
childLabelList(value).then((res) => {
getPlatformUpper() {
getPlatformUpper().then((res) => {
if (res.code === '000000') {
const interfaceArr = (res.data || []).map((item) => {
return {
value: item.name,
no: item.id,
console.log(res);
this.maxDiaNum = res.data;
}
});
},
setPlatformUpper() {
const params = {
num: this.maxDiaNum,
};
setPlatformUpper(params).then((res) => {
if (res.code === '000000') {
this.$message({
message: '保存成功',
type: 'success',
});
this.interfaceOptions.filter((item) => {
if (item.no === value) {
this.$set(item, 'interface', interfaceArr);
this.getPlatformUpper();
}
return;
});
},
getInputNumber(value) {
console.log(value, 'getInputNumbergetInputNumber');
},
departmentAll() {
departmentAll().then((res) => {
if (res.code == '000000') {
console.log(res, 'res111');
this.allList = res.data || {};
this.showListALL();
}
});
},
getFirstLevelLable() {
getFirstLevelLable().then((res) => {
if (res.code === '000000') {
this.interfaceOptions = res.data || [];
this.interfaceOptions.forEach((item, index) => {
// 添加属性
this.$set(this.interfaceOptions[index], 'interface', []);
showListALL() {
const arr = [];
const { departmentMapList, parentDepartmentList } = this.allList;
parentDepartmentList.map((item) => {
const obj = {
label: item.departmentName,
value: item.departmentId,
children: [],
};
departmentMapList.map((info) => {
if (info.parentDepartmentId === obj.value) {
const children = [];
info.diagnoseDepartmentRespList.map((detail) => {
const secondObj = {
label: detail.departmentName,
value: detail.departmentId,
text: '',
};
let secondChildren = '';
(detail.departmentDeseaseRespList || []).map((res) => {
secondChildren += res.deseaseName + ' ';
});
} else {
this.$message({
message: res.msg,
type: 'warning',
secondObj.text = secondChildren ? `(${secondChildren})` : '';
children.push(secondObj);
});
obj.children = children;
}
});
arr.push(obj);
});
console.log(arr);
this.allTilst = arr;
},
// 获取选择的值
selectApi(e, value) {
this.departmentId = value[1];
changeDepartment() {
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.departmentId = checkedNodes[0].value;
} else {
this.departmentId = '';
}
},
getNowDate(value) {
this.dateTime = value;
},
search() {
if(!this.dateTime || !this.departmentId) {
if (!this.dateTime || !this.departmentId) {
return this.$message({
message: '科室和时间都需要选择哦!',
type: 'warning'
type: 'warning',
});
}
const params = {
......@@ -199,7 +287,7 @@
departmentId: this.departmentId,
};
previewWork({ ...params }).then((res) => {
if (res.code === '000000') {
if (res.code === '000000' && res.data) {
this.calendarOptions.resources = (res.data.doctorList || []).map(
(item) => {
return {
......@@ -208,7 +296,7 @@
};
}
);
const dutyRosterPreList = res.data.dutyRosterPreList.map(
const dutyRosterPreList = (res.data.dutyRosterPreList || []).map(
(item, index) => {
return {
id: index,
......@@ -219,7 +307,7 @@
};
}
);
const dutyWorkList = res.data.dutyWorkList.map(
const dutyWorkList = (res.data.dutyWorkList || []).map(
(item, index) => {
return {
id: index,
......@@ -230,14 +318,27 @@
};
}
);
// this.getWidth = this.$refs.agmentSelect.scrollWidth + 'px';
this.getWidth = 3000 + 'px';
this.calendarOptions.events = [].concat(dutyRosterPreList, dutyWorkList);
if (res.data) {
this.calendarOptions.events = [].concat(
dutyRosterPreList,
dutyWorkList
);
}
const calendarApi = this.$refs.fullCalendar.getApi();
this.getWidth = `${
(this.calendarOptions.resources.length + 1) * 150
}px`;
this.getMaxWidth = `${
this.calendarOptions.resources.length * 150 + 100
}px`;
calendarApi.gotoDate(this.dateTime);
console.log(this.calendarOptions.resources);
console.log(this.calendarOptions.events);
} else {
this.calendarOptions.events = [];
this.calendarOptions.resources = [];
}
});
},
......@@ -251,20 +352,24 @@
width: 100%;
}
.agment-box {
height: 100%;
// height: 100%;
padding: 0 25px 25px 25px;
border-radius: 6px;
flex: 3.8;
width: 100%;
overflow:hidden;
overflow: hidden;
.serviceSchedule_select {
width: 100%;
background: #fff;
display: flex;
align-items: center;
padding: 20px 0 0px 20px;
padding: 20px 0 10px 20px;
justify-content: space-between;
.agmentSelect-select-left {
display: flex;
align-items: center;
justify-content: flex-start;
.serviceSchedule-cascader {
// height: 100%;
background: #fff;
margin-right: 15px;
}
......@@ -279,7 +384,24 @@
align-items: center;
}
}
.fullCalendar-show{
.agmentSelect-select-right {
display: flex;
align-items: center;
justify-content: flex-end;
padding-right: 30px;
.el-input-number {
margin: 0 10px;
}
.submit-btn {
height: 32px;
background: #0d9078;
border-radius: 16px;
display: flex;
align-items: center;
}
}
}
.fullCalendar-show {
width: 100%;
overflow: scroll;
// /deep/ .fc-resource{
......@@ -290,24 +412,15 @@
background: #fff;
padding: 20px;
}
.fullCalendar-nothing{
.fullCalendar-nothing {
background: #fff;
padding: 20px;
display: flex;
justify-content: center;
img{
img {
display: flex;
}
}
// /deep/.fc-col-header-cell{
// width: 100px !important;
// }
// /deep/.fc-day-mon{
// width: 100px !important;
// }
// /deep/.fc-timegrid-col-frame{
// width: 100px !important;
// }
}
.w2 {
......@@ -317,10 +430,10 @@
border: 1px solid #d9d9d9;
}
}
/deep/ .fc-timegrid-col-frame{
/deep/ .fc-timegrid-col-frame {
// width: 100px !important;
background: #fff !important;
}
}
.w3 {
/deep/.fc-next-button {
background: #f4f4f5;
......@@ -332,6 +445,9 @@
// position: absolute !important;
left: 0 !important;
}
/deep/.fc-resource {
width: 150px;
}
.agment-box-left {
flex: 1;
height: 100%;
......@@ -341,12 +457,6 @@
border-radius: 6px;
}
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
// width:100%;
// display:flex;
// z-index:1;
div {
width: 9%;
height: 55px;
......
......@@ -14,17 +14,30 @@
<div class="serviceSchedule-containerInfo">
<div class="serviceSchedule-containerInfo-left">
<el-cascader
v-model="innerform"
class="serviceSchedule-cascader"
ref="cascader"
v-model="searchParam.departmentId"
filterable
clearable
:options="interfaceOptions"
:props="props"
class="serviceSchedule-cascader"
:options="allTilst"
placeholder="选择科室"
:show-all-levels="false"
@expand-change="handleItemChange"
@change="selectApi($event, innerform)"
/>
@change="changeDepartment"
>
<template slot-scope="{ data }">
<span :style="{ fontSize: '15px', color: '#606266' }">{{
data.label
}}</span>
<span
:style="{
fontSize: '10px',
color: '#606266',
marginLeft: '10px',
opacity: '0.7',
}"
>{{ data.text }}</span>
</template>
</el-cascader>
<el-select
v-model="searchParam.createType"
class="select-first"
......@@ -147,13 +160,12 @@
<script>
import {
getFirstLevelLable,
childLabelList,
workQuery,
switchOpen,
workInStep,
getLevel,
} from '@/api/serviceSchedule';
import { departmentAll } from '@/api/diagnosis';
import TableServiceSchedule from '@/components/list/table-serviceSchedule';
export default {
components: {
......@@ -213,55 +225,68 @@
tableData: [],
loading: false,
newCreateList: [],
allTilst: [],
allList: {},
};
},
watch: {},
created() {
this.getFirstLevelLable();
this.getLevel();
this.departmentAll();
this.search();
},
methods: {
// 通过监听expand-change事件(当展开节点发生变化时触发)获取第二层数据,组装interfaceOptions数据
handleItemChange(val) {
const value = val[0];
childLabelList(value).then((res) => {
if (res.code === '000000') {
const interfaceArr = (res.data || []).map((item) => {
return {
value: item.name,
no: item.id,
};
});
this.interfaceOptions.filter((item) => {
if (item.no === value) {
this.$set(item, 'interface', interfaceArr);
}
return;
});
departmentAll() {
departmentAll().then((res) => {
if (res.code == '000000') {
console.log(res, 'res111');
this.allList = res.data || {};
this.showListALL();
}
});
},
getFirstLevelLable() {
getFirstLevelLable().then((res) => {
if (res.code === '000000') {
this.interfaceOptions = res.data || [];
this.interfaceOptions.forEach((item, index) => {
// 添加属性
this.$set(this.interfaceOptions[index], 'interface', []);
showListALL() {
const arr = [];
const { departmentMapList, parentDepartmentList } = this.allList;
parentDepartmentList.map((item) => {
const obj = {
label: item.departmentName,
value: item.departmentId,
children: [],
};
departmentMapList.map((info) => {
if (info.parentDepartmentId === obj.value) {
const children = [];
info.diagnoseDepartmentRespList.map((detail) => {
const secondObj = {
label: detail.departmentName,
value: detail.departmentId,
text: '',
};
let secondChildren = '';
(detail.departmentDeseaseRespList || []).map((res) => {
secondChildren += res.deseaseName + ' ';
});
} else {
this.$message({
message: res.msg,
type: 'warning',
secondObj.text = secondChildren ? `(${secondChildren})` : '';
children.push(secondObj);
});
obj.children = children;
}
});
arr.push(obj);
});
console.log(arr);
this.allTilst = arr;
},
// 获取选择的值
selectApi(e, value) {
this.searchParam.departmentId = value[1];
this.searchParam.pageNo = 1;
changeDepartment() {
const checkedNodes = this.$refs['cascader'].getCheckedNodes();
if (checkedNodes.length > 0) {
this.searchParam.departmentId = checkedNodes[0].value;
} else {
this.searchParam.departmentId = '';
}
},
getCreateType(value) {
this.searchParam.createType = value;
......
......@@ -4663,7 +4663,7 @@ dateformat@^2.0.0:
resolved "http://192.168.110.93:4873/dateformat/-/dateformat-2.2.0.tgz#4065e2013cf9fb916ddfd82efb506ad4c6769062"
integrity sha1-QGXiATz5+5Ft39gu+1Bq1MZ2kGI=
dayjs@^1.8.30, dayjs@^1.8.31:
dayjs@^1.10.7, dayjs@^1.8.31:
version "1.10.7"
resolved "http://192.168.110.93:4873/dayjs/-/dayjs-1.10.7.tgz#2cf5f91add28116748440866a0a1d26f3a6ce468"
integrity sha1-LPX5Gt0oEWdIRAhmoKHSbzps5Gg=
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册