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

修改排班

上级 25646a28
...@@ -19,6 +19,10 @@ ...@@ -19,6 +19,10 @@
"tinypng": "pica-cli-service tinypng" "tinypng": "pica-cli-service tinypng"
}, },
"dependencies": { "dependencies": {
"@fullcalendar/daygrid": "^5.10.0",
"@fullcalendar/interaction": "^5.10.0",
"@fullcalendar/timegrid": "^5.10.0",
"@fullcalendar/vue": "^5.10.0",
"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",
......
...@@ -12,29 +12,43 @@ export const childLabelList = async (data) => { ...@@ -12,29 +12,43 @@ export const childLabelList = async (data) => {
method: 'get', method: 'get',
}); });
}; };
export const workQuery = async(data) => { export const workQuery = async (data) => {
return request({ return request({
url: '/diagnose/doctor/work/workQuery', url: '/diagnose/doctor/work/workQuery',
data: data, data: data,
method: 'post', method: 'post',
}); });
}; };
export const switchOpen = async(data) => { export const switchOpen = async (data) => {
return request({ return request({
url: '/diagnose/doctor/work/switchOpen', url: '/diagnose/doctor/work/switchOpen',
data: data, data: data,
method: 'post', method: 'post',
}); });
}; };
export const workInStep = async() => { export const workInStep = async () => {
return request({ return request({
url: '/diagnose/doctor/work/inStep', url: '/diagnose/doctor/work/inStep',
method: 'post', method: 'post',
}); });
}; };
export const getLevel = async() => { export const getLevel = async () => {
return request({ return request({
url: '/diagnose/doctor/work/getLevel', url: '/diagnose/doctor/work/getLevel',
method: 'post', method: 'post',
}); });
}; };
\ No newline at end of file export const dutyRosterQuery = async (data) => {
return request({
url: '/diagnose/doctor/work/dutyRosterQuery',
data: data,
method: 'post',
});
};
export const saveDutyRoster = async (data) => {
return request({
url: '/diagnose/doctor/work/saveDutyRoster',
data: data,
method: 'post',
});
};
...@@ -14,6 +14,29 @@ ...@@ -14,6 +14,29 @@
background: #fff; background: #fff;
border-radius: 6px; border-radius: 6px;
} }
.ag-left-change {
// position: relative;
// border:1px solid #ccc;
// height:40px;
// width:100%;
// display:flex;
// z-index:1;
div {
width: 130px;
height: 40px;
border: 1px solid #ccc;
}
.ag-left1 {
position: absolute;
right: 140px;
top: 20px;
}
.ag-left2 {
position: absolute;
right: 20px;
top: 20px;
}
}
.agment-left-con { .agment-left-con {
margin-top: 70px; margin-top: 70px;
background: #f0f2f5; background: #f0f2f5;
...@@ -104,10 +127,14 @@ ...@@ -104,10 +127,14 @@
background: #fff; background: #fff;
color: #02120f; color: #02120f;
border-color: #d9d9d9; border-color: #d9d9d9;
border-radius: 8px; border-radius: 20px;
padding: 1.3px 5px; padding: 6px 16px;
}
/deep/.fc-myCustomButton-button {
padding: 6px 24px;
} }
/deep/.fc-button-primary:hover { /deep/.fc-button-primary:hover {
background: #fff; background: #fff;
color: #02120f; color: #02120f;
border: 1px solid #0d9078;
} }
...@@ -11,21 +11,31 @@ ...@@ -11,21 +11,31 @@
<div class="agment-box"> <div class="agment-box">
<FullCalendar :options="calendarOptions" /> <FullCalendar :options="calendarOptions" />
</div> </div>
<div class="ag-left-change">
<div
v-if="week == 2"
class="ag-left1"
/>
<div
v-if="week == 3"
class="ag-left2"
/>
</div>
<div class="agment-box-left"> <div class="agment-box-left">
<div class="agment-left-con"> <div class="agment-left-con">
<div class="agment-head"> <div class="agment-head">
<div class="agment-head-name"> <div class="agment-head-name">
纵横 {{ this.schedulingTypeValue.doctorName }}
</div> </div>
<div class="agment-head-phone"> <div class="agment-head-phone">
1897653426 {{ this.schedulingTypeValue.mobilePhone }}
</div> </div>
</div> </div>
<div class="agment-hospital"> <div class="agment-hospital">
上海瑞金医院 {{ this.schedulingTypeValue.hospital }}
</div> </div>
<div class="agment-hospital agment-hospital-ks"> <div class="agment-hospital agment-hospital-ks">
普外科 {{ this.schedulingTypeValue.departmentName }}
</div> </div>
</div> </div>
<div style="margin-top: 24px"> <div style="margin-top: 24px">
...@@ -33,26 +43,14 @@ ...@@ -33,26 +43,14 @@
选择匹配优先级 选择匹配优先级
</p> </p>
<div class="agment-head-priority"> <div class="agment-head-priority">
<!-- <el-button type="primary" plain style="color:#FFF;background:#0D9078">1</el-button> <p
<el-button type="primary" plain style="color:#FFF;background:#0D9078">2</el-button> v-for="(item, index) in createList"
<el-button type="primary" plain style="color:#FFF;background:#0D9078">3</el-button> :key="index"
<el-button type="primary" plain style="color:#FFF;background:#0D9078">4</el-button> class="item"
<el-button type="primary" plain style="color:#FFF;background:#0D9078">5</el-button> --> :class="{ active: index == currentIndex }"
@click="handlePriority(index)"
<p class="item active"> >
1 {{ item.value }}
</p>
<p class="item">
2
</p>
<p class="item">
3
</p>
<p class="item">
4
</p>
<p class="item">
5
</p> </p>
</div> </div>
</div> </div>
...@@ -68,6 +66,7 @@ ...@@ -68,6 +66,7 @@
type="primary" type="primary"
round round
style="width: 110px" style="width: 110px"
@click="saveDoctoreScheduling"
> >
保存 保存
</el-button> </el-button>
...@@ -77,10 +76,12 @@ ...@@ -77,10 +76,12 @@
</template> </template>
<script> <script>
// import '@fullcalendar/core/vdom' // import '@fullcalendar/core/vdom'
// 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';
import interactionPlugin from '@fullcalendar/interaction'; import interactionPlugin from '@fullcalendar/interaction';
import { dutyRosterQuery, saveDutyRoster } from '@/api/serviceSchedule';
export default { export default {
name: 'Index', name: 'Index',
components: { components: {
...@@ -95,13 +96,20 @@ ...@@ -95,13 +96,20 @@
}, },
schedulingType: { schedulingType: {
type: String, type: String,
default: '', default: '', // 1 新增 2 编辑 3 查看
},
createList: {
type: Array,
default: () => {
return [];
},
}, },
}, },
data() { data() {
return { return {
listDate: [], listDate: [],
nextBtn: 0, week: 1, // 1:当前周 2:上一周 3:下一周
currentIndex: 2,
calendarOptions: { calendarOptions: {
// 引入的插件,比如fullcalendar/daygrid,fullcalendar/timegrid引入后才可显示月,周,日 // 引入的插件,比如fullcalendar/daygrid,fullcalendar/timegrid引入后才可显示月,周,日
plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin], plugins: [dayGridPlugin, interactionPlugin, timeGridPlugin],
...@@ -120,49 +128,17 @@ ...@@ -120,49 +128,17 @@
datesSet: this.handleDatesSet, datesSet: this.handleDatesSet,
// unselect:this.unSelectInfo, // unselect:this.unSelectInfo,
events: [ events: [
{
title: '黄娇变电站3020开关综合检修',
start: '2021-10-18 09:30:00',
end: '2021-10-18 12:30:00',
color: '#FFEDE9',
editable: false,
}, // 可以拖动但不能缩放,但在周、日视图中是可以进行缩放的
// { // {
// title : '黄娇变电站3020开关综合检修', // title: '黄娇变电站3020开关综合检修',
// start : '2021-10-19 00:30', // start: '2021-10-18 09:30:00',
// end : '2021-10-19 04:30', // end: '2021-10-18 12:30:00',
// color:'#5580EE', // color: '#FFEDE9',
// editable: true // editable: false,
// }, //可以拖动、缩放 // }, // 可以拖动但不能缩放,但在周、日视图中是可以进行缩放的
// {
// title : '准备公司资料',
// start : '2021-10-21 04:00',
// end : '2021-10-21 07:00',
// color: '#EDB378',
// editable: true,
// // overlap: true,
// // display: 'background',
// },
// {
// title : '准备公司资料',
// start: '2021-10-23 04:00',
// end: '2021-10-23 05:00',
// overlap: false,
// // display: 'background',
// color: '#797979'
// }
// 背景色 (添加相同时间的背景色时颜色会重叠) 一点要初始化日期时间 initialDate: '2020-07-10',
], ],
header: { header: {
center: 'month,agendaFourDay', // buttons for switching between views center: 'month,agendaFourDay', // buttons for switching between views
}, },
views: {
agendaFourDay: {
type: 'agenda',
duration: { days: 4 },
buttonText: '4 day',
},
},
firstDay: new Date().getDay(), // 设置一周中显示的第一天是哪天,周日是0,周一是1,类推 firstDay: new Date().getDay(), // 设置一周中显示的第一天是哪天,周日是0,周一是1,类推
locale: 'zh-cn', // 切换语言,当前为中文 locale: 'zh-cn', // 切换语言,当前为中文
eventColor: '#fff', // 全部日历日程背景色3BB2E3 eventColor: '#fff', // 全部日历日程背景色3BB2E3
...@@ -197,10 +173,9 @@ ...@@ -197,10 +173,9 @@
expandRows: true, expandRows: true,
slotMinWidth: 50, slotMinWidth: 50,
slotDuration: '00:30:00', slotDuration: '00:30:00',
slotMinTime: '09:30', slotMinTime: '09:00',
slotMaxTime: '19:30', slotMaxTime: '21:00',
slotLabelInterval: '', slotLabelInterval: '',
dateClick: this.dateClick,
scrollTime: false, scrollTime: false,
slotLabelFormat: { slotLabelFormat: {
hour: 'numeric', hour: 'numeric',
...@@ -223,7 +198,8 @@ ...@@ -223,7 +198,8 @@
}; };
}, },
mounted() { mounted() {
// this.handleEventClick(); console.log(123, this.schedulingType, this.schedulingTypeValue);
this.init();
}, },
methods: { methods: {
/** /**
...@@ -234,13 +210,60 @@ ...@@ -234,13 +210,60 @@
* jsEvent是个javascript事件 * jsEvent是个javascript事件
* view是当前视图对象。 * view是当前视图对象。
*/ */
handleDatesSet(dataInfo) { init() {
console.log(dataInfo); if (this.schedulingType == 1 || this.schedulingType == 2) {
this.handleInitSearch();
} else {
console.log('查看');
}
},
handleInitSearch() {
const objParms = {};
objParms.doctorId = this.schedulingTypeValue.doctorId;
objParms.week = this.week;
objParms.workId = this.schedulingTypeValue.id;
this.currentIndex = this.schedulingTypeValue.level - 1;
dutyRosterQuery(objParms).then((res) => {
if (res.code == '000000') {
this.handleInitData(res.data);
} else {
this.$toast(res.message);
}
});
}, },
prevCustom(mouseEvent, htmlElement) { handleInitData(data) {
alert(1234); const newDate = [].concat(data.acceptList, data.noAcceptList);
console.log(mouseEvent, htmlElement, 'mouseEvent, htmlElement'); // const keyAll = ['end', 'endStr', 'id', 'start', 'startStr'];
// this.defaultDate=; newDate.forEach((item) => {
const dataObj = {};
const id = (this.calendarOptions.events.length + 1) * 10;
dataObj['week'] = this.week;
dataObj['id'] = id;
dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime;
dataObj['type'] = item.type;
this.calendarOptions.events.push(dataObj);
});
console.log(this.calendarOptions.events, 'wokkkwok');
},
handleDatesSet(dataInfo) {
const currentTime = new Date().getTime();
const getTime = new Date(dataInfo.startStr).getTime();
const cz = currentTime - getTime;
const oneHour = 1 * 60 * 60 * 1000 * 24;
const timeDifference = (cz / oneHour) | 0;
if (timeDifference > 0) {
// 过去
this.week = 2;
} else if (timeDifference < 0) {
// 未来
this.week = 3;
this.handleInitSearch();
} else {
// 现在
this.week = 1;
}
// this.handleInitSearch();
}, },
eventResize(event) { eventResize(event) {
const index = this.getIdDeleteData(event.event.id); const index = this.getIdDeleteData(event.event.id);
...@@ -258,20 +281,20 @@ ...@@ -258,20 +281,20 @@
return this.calendarOptions.events.splice(index, 1); return this.calendarOptions.events.splice(index, 1);
// alert("你要取消日期吗"); // alert("你要取消日期吗");
}, },
unSelectInfo(info) {
console.log(info, '0000');
console.log(99);
},
selectInfo(info) { selectInfo(info) {
const id = (this.calendarOptions.events.length + 1) * 10; const id = (this.calendarOptions.events.length + 1) * 10;
info.id = id; info.id = id;
const keyAll = ['end', 'endStr', 'id', 'start', 'startStr']; const keyAll = ['end', 'endStr', 'id', 'start', 'startStr', 'week'];
const dataObj = {}; const dataObj = {};
keyAll.forEach((item) => { keyAll.forEach((item) => {
dataObj[item] = info[item]; if (item == 'week') {
dataObj[item] = this.week;
} else {
dataObj[item] = info[item];
}
}); });
console.log(dataObj, 'dataObjdkdkdkdk');
this.calendarOptions.events.push(dataObj); this.calendarOptions.events.push(dataObj);
console.log(this.calendarOptions.events, '10000');
}, },
selectAllow(info) { selectAllow(info) {
const currentDate = new Date(); const currentDate = new Date();
...@@ -289,9 +312,9 @@ ...@@ -289,9 +312,9 @@
// 对于排班交叉部分处理 // 对于排班交叉部分处理
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();
let indexObj = false;
const data = this.calendarOptions.events; const data = this.calendarOptions.events;
const newDate = []; const newDate = [];
let indexObj = false;
data.forEach((item) => { data.forEach((item) => {
const d = new Date(item.end).getTime(); const d = new Date(item.end).getTime();
const s = new Date(item.start).getTime(); const s = new Date(item.start).getTime();
...@@ -305,11 +328,61 @@ ...@@ -305,11 +328,61 @@
newDate.push(item); newDate.push(item);
} }
}); });
console.log(indexObj);
this.calendarOptions.events = newDate; this.calendarOptions.events = newDate;
console.log(this.calendarOptions.events.length, 'len', indexObj);
}, },
dateClick(info) { handlePriority(index) {
console.log(info, 'info'); this.currentIndex = index;
},
saveDoctoreScheduling() {
const objParms = {};
objParms.week = this.week;
objParms.workId = this.schedulingTypeValue.id;
objParms.level = this.currentIndex + 1;
objParms.list = [];
const data = this.calendarOptions.events;
data.forEach((item) => {
if (item.week == this.week) {
const obj = {};
// const timeFormat = 'YYYY-MM-DD HH:mm:ss';
// const endStr = moment(item.endStr).format(timeFormat);
// const startStr = moment(item.StartStr).format(timeFormat);
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM', item.start);
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM', item.end);
objParms.list.push(obj);
}
});
saveDutyRoster(objParms).then((res) => {
if (res.code === '000000') {
// this.$toast(res.message);
} else {
this.$toast(res.message);
}
console.log(res, '保存结果');
});
},
dateFormat(fmt, date) {
console.log(date, 'datedate');
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(), // 秒
// 有其他格式化字符需求可以继续添加,必须转化成字符串
};
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;
}, },
}, },
}; };
......
...@@ -147,6 +147,7 @@ ...@@ -147,6 +147,7 @@
<div class="serviceSchedule-container"> <div class="serviceSchedule-container">
<div class="serviceSchedule-containerInfo"> <div class="serviceSchedule-containerInfo">
<NewScheduling <NewScheduling
:create-list="newCreateList"
:scheduling-type-value="schedulingTypeValue" :scheduling-type-value="schedulingTypeValue"
:scheduling-type="schedulingType" :scheduling-type="schedulingType"
/> />
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册