提交 ba1a558f 编写于 作者: zhongyao.qiao's avatar zhongyao.qiao

feat 问诊排版时间调整

上级 6f01af85
...@@ -227,7 +227,7 @@ export default { ...@@ -227,7 +227,7 @@ export default {
expandRows: true, expandRows: true,
slotMinWidth: 50, slotMinWidth: 50,
slotDuration: '01:00:00', slotDuration: '01:00:00',
slotMinTime: '06:00', slotMinTime: '01:00',
slotMaxTime: '23:00', slotMaxTime: '23:00',
slotLabelInterval: '', slotLabelInterval: '',
scrollTime: false, scrollTime: false,
...@@ -335,7 +335,7 @@ export default { ...@@ -335,7 +335,7 @@ export default {
const day = dayjs(date).day(); const day = dayjs(date).day();
const dayDate = dayjs(date).date(); const dayDate = dayjs(date).date();
const dayFormat = dayjs(date).format('YYYY-MM-DD'); const dayFormat = dayjs(date).format('YYYY-MM-DD');
let selectDate = dayFormat + ' ' + '06:00:00'; let selectDate = dayFormat + ' ' + '01:00:00';
selectDate = dayjs(selectDate).unix(); selectDate = dayjs(selectDate).unix();
const nowDate = dayjs(new Date()).unix(); const nowDate = dayjs(new Date()).unix();
let isAddAllDay = true; let isAddAllDay = true;
...@@ -357,7 +357,7 @@ export default { ...@@ -357,7 +357,7 @@ export default {
} }
if (isAddAllDay) { if (isAddAllDay) {
// 添加日期 // 添加日期
const selectAllDay = [{ startTime: '06:00:00', endTime: '23:00:00' }]; const selectAllDay = [{ startTime: '01:00:00', endTime: '23:00:00' }];
selectAllDay.forEach((item) => { selectAllDay.forEach((item) => {
const allDayData = {}; const allDayData = {};
allDayData.id = allDayData.id =
......
...@@ -106,244 +106,244 @@ ...@@ -106,244 +106,244 @@
</div> </div>
</template> </template>
<script> <script>
import { departmentAll } from '@/api/diagnosis'; import { departmentAll } from '@/api/diagnosis';
import { import {
getPlatformUpper, getPlatformUpper,
previewWork, previewWork,
setPlatformUpper, setPlatformUpper,
} from '@/api/serviceSchedule'; } from '@/api/serviceSchedule';
import dayGridPlugin from '@fullcalendar/daygrid'; import dayGridPlugin from '@fullcalendar/daygrid';
import interactionPlugin from '@fullcalendar/interaction'; import interactionPlugin from '@fullcalendar/interaction';
import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid'; import resourceTimeGridPlugin from '@fullcalendar/resource-timegrid';
import timeGridPlugin from '@fullcalendar/timegrid'; import timeGridPlugin from '@fullcalendar/timegrid';
import FullCalendar from '@fullcalendar/vue'; import FullCalendar from '@fullcalendar/vue';
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
FullCalendar, FullCalendar,
}, },
data() { data() {
return { return {
maxDiaNum: 10, maxDiaNum: 10,
dateTime: '', dateTime: '',
interfaceOptions: [], interfaceOptions: [],
innerform: [], innerform: [],
props: { props: {
// props定义的值根据接口返回的数据定的 // props定义的值根据接口返回的数据定的
label: 'value', label: 'value',
value: 'no', value: 'no',
children: 'interface', children: 'interface',
}, },
departmentId: '', departmentId: '',
id: '', id: '',
doctorId: '', doctorId: '',
schedulingTypeValue: {}, 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],
calendarOptions: { calendarOptions: {
plugins: [ plugins: [
dayGridPlugin, dayGridPlugin,
interactionPlugin, interactionPlugin,
timeGridPlugin, timeGridPlugin,
resourceTimeGridPlugin, resourceTimeGridPlugin,
], ],
// timeZone: 'UTC', // timeZone: 'UTC',
locale: 'zh-cn', locale: 'zh-cn',
aspectRatio: 2.8, // 设置日历单元格宽度与高度的比例。 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: '01:00:00', slotDuration: '01:00:00',
slotMinTime: '06:00', slotMinTime: '01:00',
slotMaxTime: '23:00', slotMaxTime: '23:00',
slotLabelInterval: '', slotLabelInterval: '',
scrollTime: false, scrollTime: false,
initialDate: '2021-10-31', initialDate: '2021-10-31',
slotLabelFormat: { slotLabelFormat: {
hour: 'numeric', hour: 'numeric',
minute: '2-digit', minute: '2-digit',
meridiem: 'short', meridiem: 'short',
hour12: false, // 设置时间为24小时 hour12: false, // 设置时间为24小时
},
expandRows: true,
}, },
workingTicketVisible: false, // 工作表票详情页面 expandRows: true,
scrollerHeight: 0, },
loading: false, workingTicketVisible: false, // 工作表票详情页面
doctorList: [], scrollerHeight: 0,
index: 0, loading: false,
getWidth: '100%', doctorList: [],
getMaxWidth: '100%', index: 0,
allTilst: [], getWidth: '100%',
allList: {}, getMaxWidth: '100%',
allTilst: [],
allList: {},
};
},
watch: {},
created() {
this.departmentAll();
// this.getPlatformUpper();
},
mounted() {},
methods: {
getPlatformUpper() {
getPlatformUpper().then((res) => {
if (res.code === '000000') {
console.log(res);
this.maxDiaNum = res.data;
}
});
},
setPlatformUpper() {
const params = {
num: this.maxDiaNum,
}; };
setPlatformUpper(params).then((res) => {
if (res.code === '000000') {
this.$message({
message: '保存成功',
type: 'success',
});
this.getPlatformUpper();
}
});
}, },
watch: {}, getInputNumber(value) {
created() { console.log(value, 'getInputNumbergetInputNumber');
this.departmentAll();
// this.getPlatformUpper();
}, },
mounted() {}, departmentAll() {
methods: { departmentAll().then((res) => {
getPlatformUpper() { if (res.code == '000000') {
getPlatformUpper().then((res) => { console.log(res, 'res111');
if (res.code === '000000') { this.allList = res.data || {};
console.log(res); this.showListALL();
this.maxDiaNum = res.data; }
} });
}); },
}, showListALL() {
setPlatformUpper() { const arr = [];
const params = { const { departmentMapList, parentDepartmentList } = this.allList;
num: this.maxDiaNum, parentDepartmentList.map((item) => {
const obj = {
label: item.departmentName,
value: item.departmentId,
children: [],
}; };
setPlatformUpper(params).then((res) => { departmentMapList.map((info) => {
if (res.code === '000000') { if (info.parentDepartmentId === obj.value) {
this.$message({ const children = [];
message: '保存成功', info.diagnoseDepartmentRespList.map((detail) => {
type: 'success', 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);
}); });
this.getPlatformUpper(); obj.children = children;
} }
}); });
}, arr.push(obj);
getInputNumber(value) { });
console.log(value, 'getInputNumbergetInputNumber');
}, console.log(arr);
departmentAll() { this.allTilst = arr;
departmentAll().then((res) => { },
if (res.code == '000000') { // 获取选择的值
console.log(res, 'res111'); changeDepartment() {
this.allList = res.data || {}; const checkedNodes = this.$refs['cascader'].getCheckedNodes();
this.showListALL(); if (checkedNodes.length > 0) {
} this.departmentId = checkedNodes[0].value;
} else {
this.departmentId = '';
}
},
getNowDate(value) {
this.dateTime = value;
},
search() {
if (!this.dateTime || !this.departmentId) {
return this.$message({
message: '科室和时间都需要选择哦!',
type: 'warning',
}); });
}, }
showListALL() { const params = {
const arr = []; dateTime: this.dateTime,
const { departmentMapList, parentDepartmentList } = this.allList; departmentId: this.departmentId,
parentDepartmentList.map((item) => { };
const obj = { previewWork({ ...params }).then((res) => {
label: item.departmentName, if (res.code === '000000' && res.data) {
value: item.departmentId, this.calendarOptions.resources = (res.data.doctorList || []).map(
children: [], (item) => {
}; return {
departmentMapList.map((info) => { id: item.doctorId,
if (info.parentDepartmentId === obj.value) { title: item.doctorName,
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); const dutyRosterPreList = (res.data.dutyRosterPreList || []).map(
}); (item, index) => {
return {
console.log(arr); id: index,
this.allTilst = arr; resourceId: item.doctorId,
}, end: item.endTime,
// 获取选择的值 start: item.startTime,
changeDepartment() { color: '#FFEDE9',
const checkedNodes = this.$refs['cascader'].getCheckedNodes(); };
if (checkedNodes.length > 0) { }
this.departmentId = checkedNodes[0].value; );
} else { const dutyWorkList = (res.data.dutyWorkList || []).map(
this.departmentId = ''; (item, index) => {
} return {
}, id: index,
getNowDate(value) { resourceId: item.doctorId,
this.dateTime = value; end: item.endTime,
}, start: item.startTime,
search() { color: '#E7F4F5',
if (!this.dateTime || !this.departmentId) { };
return this.$message({
message: '科室和时间都需要选择哦!',
type: 'warning',
});
}
const params = {
dateTime: this.dateTime,
departmentId: this.departmentId,
};
previewWork({ ...params }).then((res) => {
if (res.code === '000000' && res.data) {
this.calendarOptions.resources = (res.data.doctorList || []).map(
(item) => {
return {
id: item.doctorId,
title: item.doctorName,
};
}
);
const dutyRosterPreList = (res.data.dutyRosterPreList || []).map(
(item, index) => {
return {
id: index,
resourceId: item.doctorId,
end: item.endTime,
start: item.startTime,
color: '#FFEDE9',
};
}
);
const dutyWorkList = (res.data.dutyWorkList || []).map(
(item, index) => {
return {
id: index,
resourceId: item.doctorId,
end: item.endTime,
start: item.startTime,
color: '#E7F4F5',
};
}
);
if (res.data) {
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
}px`; }px`;
this.getMaxWidth = `${ this.getMaxWidth = `${
this.calendarOptions.resources.length * 150 + 100 this.calendarOptions.resources.length * 150 + 100
}px`; }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 { } else {
this.calendarOptions.events = []; this.calendarOptions.events = [];
this.calendarOptions.resources = []; this.calendarOptions.resources = [];
} }
}); });
},
}, },
}; },
};
</script> </script>
<style lang="scss" scoped> <style lang="scss" scoped>
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册