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

feat 问诊排版时间调整

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