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

修改支持晚上排班

...@@ -288,3 +288,10 @@ export const outboundIntention = async (data) => { ...@@ -288,3 +288,10 @@ export const outboundIntention = async (data) => {
method: 'post', method: 'post',
}); });
}; };
export const departmentAll = async () => {
return request({
url: '/diagnose/department/all',
method: 'get',
});
};
...@@ -27,7 +27,7 @@ ...@@ -27,7 +27,7 @@
type="date" type="date"
:clearable="false" :clearable="false"
:disabled="formData.receptionName == ''" :disabled="formData.receptionName == ''"
placeholder="日期-请先选择医生" placeholder="请选择日期"
@change="getNowDate" @change="getNowDate"
/> />
</div> </div>
...@@ -135,122 +135,6 @@ ...@@ -135,122 +135,6 @@
</div> </div>
</div> </div>
</el-dialog> </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 class="mt20">
<span>问诊结束时间:</span>
<div class="date-wrap">
&nbsp;{{ dayFormatWithoutSecond(endTimeValue) }}
</div>
</div>
</div>
<div class="time-wrap">
<span>问诊时长:</span>
<div class="time-range">
<el-radio-group
v-model="timeRange"
@change="timeRangeChange"
>
<div>
<el-radio
border
size="large"
:label="10"
>
10分钟
</el-radio>
</div>
<div class="mt20">
<el-radio
border
size="medium"
: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"
>
自定义时间
</el-radio>
</div>
</el-radio-group>
<div v-show="timeRange == 1234">
<el-input-number
v-model="selfTimeRange"
class="selfTime-input"
type="number"
controls-position="right"
:min="0"
:step="1"
:precision="0"
/>
<el-button
type="primary"
size="small"
@click="selfTimeRangeChange"
>
确定
</el-button>
</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>
</div> </div>
</template> </template>
...@@ -346,8 +230,8 @@ ...@@ -346,8 +230,8 @@
timeChoosetList: [], timeChoosetList: [],
startTime: '', startTime: '',
endTime: '', endTime: '',
todayNum: '', todayNum: 0,
maxTodayNum: '', maxTodayNum: 0,
}; };
}, },
watch: { watch: {
...@@ -367,17 +251,15 @@ ...@@ -367,17 +251,15 @@
}, },
}, },
created() { created() {
// this.startTimeValue = this.rangeTimeData;
console.log('``````', this.formData);
// 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: {
getChooseTimeValue(value, index) { getChooseTimeValue(value, index) {
...@@ -436,8 +318,8 @@ ...@@ -436,8 +318,8 @@
if (res.code == '000000') { if (res.code == '000000') {
vm.cancel(); vm.cancel();
vm.$emit('search'); vm.$emit('search');
this.todayNum = ''; this.todayNum = 0;
this.maxTodayNum = ''; this.maxTodayNum = 0;
this.rateValue = ''; this.rateValue = '';
this.chooseTime = ''; this.chooseTime = '';
this.startTime = ''; this.startTime = '';
...@@ -448,7 +330,8 @@ ...@@ -448,7 +330,8 @@
}) })
.catch(function (err) { .catch(function (err) {
vm.isClick = false; vm.isClick = false;
vm.$message.error(err.message); console.log(err);
// vm.$message.error(err.message);
}); });
}, },
refreshData() { refreshData() {
...@@ -462,8 +345,8 @@ ...@@ -462,8 +345,8 @@
// this.startTimeValue = this.rangeTimeData; // this.startTimeValue = this.rangeTimeData;
// this.endTimeValue = ''; // this.endTimeValue = '';
// this.timeRange = Number(20); // this.timeRange = Number(20);
this.todayNum = ''; this.todayNum = 0;
this.maxTodayNum = ''; this.maxTodayNum = 0;
this.rateValue = ''; this.rateValue = '';
this.chooseTime = ''; this.chooseTime = '';
this.timeChoosetList = []; this.timeChoosetList = [];
...@@ -494,6 +377,8 @@ ...@@ -494,6 +377,8 @@
this.formData.doctorMobile = selected.doctorMobile; this.formData.doctorMobile = selected.doctorMobile;
this.formData.doctorDepartmentId = selected.doctorDepartmentId; this.formData.doctorDepartmentId = selected.doctorDepartmentId;
this.acceptsCeilings(this.formData.receptionId); this.acceptsCeilings(this.formData.receptionId);
const nowDate = dayjs(new Date()).format('YYYY-MM-DD');
this.getNowDate(nowDate);
// debugger; // debugger;
// this.formData.serviceFee = this.priceFilter(selected.serviceFee) // this.formData.serviceFee = this.priceFilter(selected.serviceFee)
} }
...@@ -554,8 +439,8 @@ ...@@ -554,8 +439,8 @@
startTimeConfirm(isCancle) { startTimeConfirm(isCancle) {
console.log('isCancle-', isCancle); console.log('isCancle-', isCancle);
if (isCancle == 'cancel') { if (isCancle == 'cancel') {
this.endTimeValue = ''; this.startTime = '';
this.timeRange = ''; this.endTime = '';
} }
if (isCancle == 'submit') { if (isCancle == 'submit') {
if (String(this.startTimeValue).trim() === '' || !this.startTimeValue) { if (String(this.startTimeValue).trim() === '' || !this.startTimeValue) {
...@@ -626,7 +511,7 @@ ...@@ -626,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;
...@@ -669,15 +554,15 @@ ...@@ -669,15 +554,15 @@
width: 130px; width: 130px;
} }
.open-diagnosis-doctor { .open-diagnosis-doctor {
padding: 10px 40px 40px 40px; padding: 10px 20px 40px 30px;
.choose-diagnosis-doctor { .choose-diagnosis-doctor {
.el-select { .el-select {
margin-right: 30px; margin-right: 30px;
padding-bottom: 20px; padding-bottom: 20px;
.el-input { .el-input {
width: 300px; // width: 300px;
.el-input__inner { .el-input__inner {
width: 300px; // width: 300px;
height: 32px; height: 32px;
background: #ffffff; background: #ffffff;
border-radius: 16px; border-radius: 16px;
...@@ -691,7 +576,7 @@ ...@@ -691,7 +576,7 @@
} }
.el-date-editor { .el-date-editor {
.el-input__inner { .el-input__inner {
width: 180px; max-width: 150px;
height: 32px; height: 32px;
background: #ffffff; background: #ffffff;
border-radius: 16px; border-radius: 16px;
...@@ -859,15 +744,15 @@ ...@@ -859,15 +744,15 @@
} }
.work-info-botton { .work-info-botton {
.contest { .contest {
width: 200px; min-width: 100px;
border-radius: 18px; border-radius: 18px;
} }
.refresh { .refresh {
width: 200px; min-width: 150px;
border-radius: 18px; border-radius: 18px;
} }
.el-button--default { .el-button--default {
width: 150px; min-width: 150px;
border-radius: 18px; border-radius: 18px;
} }
} }
......
...@@ -143,10 +143,13 @@ ...@@ -143,10 +143,13 @@
chooseTimeIndex: 1000, chooseTimeIndex: 1000,
pickerOptionsStart: { pickerOptionsStart: {
disabledDate: (time) => { disabledDate: (time) => {
const month = 28 * 24 * 60 * 60 * 1000; // 限定一个日期范围,这里是28天 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 ( return (
time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() || time.getTime() + 1 * 24 * 60 * 60 * 1000 < new Date() ||
time.getTime() > new Date().getTime() + month time.getTime() > new Date().getTime() + SundayTime
); );
}, },
}, },
...@@ -177,7 +180,13 @@ ...@@ -177,7 +180,13 @@
this.getLeisureTime(this.chooseTime); this.getLeisureTime(this.chooseTime);
}, },
nextChangeData() { nextChangeData() {
const maxDate = dayjs(new Date()).add(27, 'day').unix(); 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) { if (dayjs(this.chooseTime).unix() > maxDate) {
this.$message({ this.$message({
message: '时间不能超过28天', message: '时间不能超过28天',
...@@ -192,12 +201,11 @@ ...@@ -192,12 +201,11 @@
this.getLeisureTime(this.chooseTime); this.getLeisureTime(this.chooseTime);
}, },
getChooseTimeValue(value, index) { getChooseTimeValue(value, index) {
console.log(value, index); if (value.isFull == 0) {
this.startDate = value.startDate;
this.endDate = value.endDate;
if (value.isFull == 2) {
return; return;
} }
this.startDate = value.startDate;
this.endDate = value.endDate;
this.chooseTimeIndex = index; this.chooseTimeIndex = index;
}, },
confirm() { confirm() {
...@@ -225,12 +233,14 @@ ...@@ -225,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);
......
...@@ -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');
}, },
}, },
}; };
......
...@@ -92,7 +92,7 @@ ...@@ -92,7 +92,7 @@
sortable sortable
/> />
<el-table-column <el-table-column
prop="createdId" prop="modifiedId"
label="修改人ID" label="修改人ID"
width="170" width="170"
align="center" align="center"
......
...@@ -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>
...@@ -508,6 +532,7 @@ ...@@ -508,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';
...@@ -632,6 +657,8 @@ ...@@ -632,6 +657,8 @@
userNamePhone: '', userNamePhone: '',
triageDepartment: '', triageDepartment: '',
departmentId: '', departmentId: '',
allTilst: [],
allList: {},
}; };
}, },
watch: { watch: {
...@@ -649,16 +676,72 @@ ...@@ -649,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
......
...@@ -44,6 +44,14 @@ ...@@ -44,6 +44,14 @@
<span>{{ this.schedulingTypeValue.departmentName }}</span> <span>{{ this.schedulingTypeValue.departmentName }}</span>
</div> </div>
</div> </div>
<div class="maxNum-first-show">
<span>每小时接诊上限人数:
<span :class="showMaxNum <= 0 ? 'show-sep-num' : ''">{{
showMaxNum > 0 ? showMaxNum : 0
}}</span>
</span>
<p>优先级: {{ showFirNum }}</p>
</div>
<div <div
v-if="this.schedulingType != 3" v-if="this.schedulingType != 3"
class="reset-doctor-schedu" class="reset-doctor-schedu"
...@@ -117,7 +125,7 @@ ...@@ -117,7 +125,7 @@
<div class="num-input-show"> <div class="num-input-show">
<el-input-number <el-input-number
v-model="maxNumValue" v-model="maxNumValue"
:min="10" :min="0"
:max="20" :max="20"
@change="getMaxNumValue" @change="getMaxNumValue"
/> />
...@@ -248,6 +256,8 @@ ...@@ -248,6 +256,8 @@
copyArr: [], copyArr: [],
centerDialogVisible: false, centerDialogVisible: false,
maxNumValue: '', maxNumValue: '',
showFirNum: '',
showMaxNum: '',
}; };
}, },
computed: {}, computed: {},
...@@ -300,7 +310,7 @@ ...@@ -300,7 +310,7 @@
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;
} }
...@@ -316,6 +326,8 @@ ...@@ -316,6 +326,8 @@
console.log(res, 'res'); console.log(res, 'res');
this.currentIndex = res.data.level; this.currentIndex = res.data.level;
this.maxNumValue = res.data.preNum; this.maxNumValue = res.data.preNum;
(this.showFirNum = res.data.level),
(this.showMaxNum = res.data.preNum);
} }
}); });
}, },
...@@ -360,6 +372,7 @@ ...@@ -360,6 +372,7 @@
console.log(allDayData); console.log(allDayData);
this.calendarOptions.events.push(allDayData); this.calendarOptions.events.push(allDayData);
}); });
this.isDoIt = true;
} }
}, },
getCopyData(lastWeekData) { getCopyData(lastWeekData) {
...@@ -546,12 +559,6 @@ ...@@ -546,12 +559,6 @@
}, },
// 提交优先级和人数 // 提交优先级和人数
submitSetData() { submitSetData() {
if (this.maxNumValue == '') {
return this.$message({
message: '请设置每小时接诊上限人数',
type: 'warning',
});
}
const params = { const params = {
doctorId: this.doctorId, doctorId: this.doctorId,
level: this.currentIndex, level: this.currentIndex,
...@@ -565,6 +572,7 @@ ...@@ -565,6 +572,7 @@
type: 'success', type: 'success',
}); });
this.centerDialogVisible = false; this.centerDialogVisible = false;
this.getLevelAndDayCount();
} }
}); });
}, },
...@@ -663,18 +671,22 @@ ...@@ -663,18 +671,22 @@
saveDutyRoster(saveParms).then((res) => { saveDutyRoster(saveParms).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
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); this.handleInitSearch(true);
} else { } else {
this.$message.error(res.message || '排班保存失败'); this.$message.error(res.message || '排班保存失败');
} }
}); });
if (!this.maxNumValue && this.maxNumValue != 0) {
return this.$message({
message: '请设置优先级和接诊上限设置',
type: 'warning',
});
}
} }
}, },
}, },
......
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
class="serviceSchedule_select" class="serviceSchedule_select"
> >
<div class="agmentSelect-select-left"> <div class="agmentSelect-select-left">
<el-cascader <!-- <el-cascader
v-model="innerform" v-model="innerform"
class="serviceSchedule-cascader" class="serviceSchedule-cascader"
filterable filterable
...@@ -26,7 +26,32 @@ ...@@ -26,7 +26,32 @@
:show-all-levels="false" :show-all-levels="false"
@expand-change="handleItemChange" @expand-change="handleItemChange"
@change="selectApi($event, innerform)" @change="selectApi($event, innerform)"
/> /> -->
<el-cascader
ref="cascader"
v-model="departmentId"
filterable
clearable
class="serviceSchedule-cascader"
:options="allTilst"
placeholder="选择科室"
:show-all-levels="false"
@change="changeDepartment"
>
<template slot-scope="{ data }">
<span :style="{ fontSize: '15px', color: '#606266' }">{{
data.label
}}</span>
<span
:style="{
fontSize: '10px',
color: '#606266',
marginLeft: '10px',
opacity: '0.7',
}"
>{{ data.text }}</span>
</template>
</el-cascader>
<el-date-picker <el-date-picker
v-model="dateTime" v-model="dateTime"
class="serviceSchedule_dateTime" class="serviceSchedule_dateTime"
...@@ -48,8 +73,8 @@ ...@@ -48,8 +73,8 @@
<el-input-number <el-input-number
v-model="maxDiaNum" v-model="maxDiaNum"
:step="1" :step="1"
:min="10" :min="0"
:max="1000000" :max="10000000"
step-strictly step-strictly
@change="getInputNumber" @change="getInputNumber"
/> />
...@@ -81,14 +106,13 @@ ...@@ -81,14 +106,13 @@
</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, setPlatformUpper,
getPlatformUpper, getPlatformUpper,
...@@ -100,7 +124,7 @@ ...@@ -100,7 +124,7 @@
}, },
data() { data() {
return { return {
maxDiaNum: 100, maxDiaNum: 10,
dateTime: '', dateTime: '',
interfaceOptions: [], interfaceOptions: [],
innerform: [], innerform: [],
...@@ -129,7 +153,7 @@ ...@@ -129,7 +153,7 @@
], ],
// timeZone: 'UTC', // timeZone: 'UTC',
locale: 'zh-cn', locale: 'zh-cn',
aspectRatio: 4.5, // 设置日历单元格宽度与高度的比例。 aspectRatio: 2.8, // 设置日历单元格宽度与高度的比例。
schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives', schedulerLicenseKey: 'CC-Attribution-NonCommercial-NoDerivatives',
initialView: 'resourceTimeGridDay', initialView: 'resourceTimeGridDay',
resources: [], resources: [],
...@@ -151,6 +175,7 @@ ...@@ -151,6 +175,7 @@
meridiem: 'short', meridiem: 'short',
hour12: false, // 设置时间为24小时 hour12: false, // 设置时间为24小时
}, },
expandRows: true,
}, },
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0, scrollerHeight: 0,
...@@ -159,11 +184,13 @@ ...@@ -159,11 +184,13 @@
index: 0, index: 0,
getWidth: '100%', getWidth: '100%',
getMaxWidth: '100%', getMaxWidth: '100%',
allTilst: [],
allList: {},
}; };
}, },
watch: {}, watch: {},
created() { created() {
this.getFirstLevelLable(); this.departmentAll();
this.getPlatformUpper(); this.getPlatformUpper();
}, },
mounted() {}, mounted() {},
...@@ -182,6 +209,10 @@ ...@@ -182,6 +209,10 @@
}; };
setPlatformUpper(params).then((res) => { setPlatformUpper(params).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
this.$message({
message: '保存成功',
type: 'success',
});
this.getPlatformUpper(); this.getPlatformUpper();
} }
}); });
...@@ -189,45 +220,57 @@ ...@@ -189,45 +220,57 @@
getInputNumber(value) { getInputNumber(value) {
console.log(value, 'getInputNumbergetInputNumber'); console.log(value, 'getInputNumbergetInputNumber');
}, },
// 通过监听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.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;
...@@ -244,7 +287,7 @@ ...@@ -244,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 {
...@@ -253,7 +296,7 @@ ...@@ -253,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,
...@@ -264,21 +307,24 @@ ...@@ -264,21 +307,24 @@
}; };
} }
); );
const dutyWorkList = res.data.dutyWorkList.map((item, index) => { const dutyWorkList = (res.data.dutyWorkList || []).map(
return { (item, index) => {
id: index, return {
resourceId: item.doctorId, id: index,
end: item.endTime, resourceId: item.doctorId,
start: item.startTime, end: item.endTime,
color: '#E7F4F5', start: item.startTime,
}; color: '#E7F4F5',
}); };
// this.getWidth = this.$refs.agmentSelect.scrollWidth + 'px'; }
// this.getWidth = 3000 + 'px';
this.calendarOptions.events = [].concat(
dutyRosterPreList,
dutyWorkList
); );
if (res.data) {
this.calendarOptions.events = [].concat(
dutyRosterPreList,
dutyWorkList
);
}
const calendarApi = this.$refs.fullCalendar.getApi(); const calendarApi = this.$refs.fullCalendar.getApi();
this.getWidth = `${ this.getWidth = `${
(this.calendarOptions.resources.length + 1) * 150 (this.calendarOptions.resources.length + 1) * 150
...@@ -290,6 +336,9 @@ ...@@ -290,6 +336,9 @@
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 = [];
} }
}); });
}, },
......
...@@ -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>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册