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

Merge branch 'release-new' into 'release'

Release new

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