提交 b88bc1e2 编写于 作者: qian.jie's avatar qian.jie

提交代码

上级 95bef419
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
<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>
...@@ -48,11 +48,13 @@ ...@@ -48,11 +48,13 @@
{{ this.schedulingTypeValue.departmentName }} {{ this.schedulingTypeValue.departmentName }}
</div> </div>
</div> </div>
<div style="margin-top: 24px"> <div
style="margin-top: 24px"
>
<p class="agment-head-title"> <p class="agment-head-title">
选择匹配优先级 选择匹配优先级
</p> </p>
<div :class="this.schedulingType == 3 ? 'agment-head-none' : ''"> <div :class="this.schedulingType == 3 ? 'agment-head-none' : '' ">
<div class="agment-head-priority"> <div class="agment-head-priority">
<p <p
v-for="(item, index) in createList" v-for="(item, index) in createList"
...@@ -110,9 +112,9 @@ ...@@ -110,9 +112,9 @@
}, },
data() { data() {
return { return {
id: '', id:'',
doctorId: '', doctorId:'',
schedulingTypeValue: {}, schedulingTypeValue:{},
schedulingType: 1, // 1 新增 2 编辑 3 查看 schedulingType: 1, // 1 新增 2 编辑 3 查看
createList: [], createList: [],
listDate: [], listDate: [],
...@@ -189,30 +191,31 @@ ...@@ -189,30 +191,31 @@
workingTicketVisible: false, // 工作表票详情页面 workingTicketVisible: false, // 工作表票详情页面
scrollerHeight: 0, scrollerHeight: 0,
loading: false, loading: false,
isDoIt: false, isDoIt:false
}; };
}, },
watch: { watch: {
week(newV, oldV) { week(newV, oldV) {
// if (this.haveWeek.indexOf(newV) == -1) { console.log(newV, oldV, 'newV, oldV');
// this.haveWeek.push(newV); if (this.haveWeek.indexOf(newV) == -1) {
// this.handleInitSearch(); this.haveWeek.push(newV);
// } this.handleInitSearch();
if (newV !== oldV) { }
if(newV !== oldV) {
this.handleInitSearch(); this.handleInitSearch();
this.saveDoctoreScheduling(2); this.saveDoctoreScheduling(2, oldV);
} }
}, },
}, },
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);
} }
}); });
...@@ -223,6 +226,7 @@ ...@@ -223,6 +226,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;'); // console.log(this.$refs.agment.clientHeight, 'this.$refs.agment.offsetHeight;');
this.init(); this.init();
...@@ -249,7 +253,8 @@ ...@@ -249,7 +253,8 @@
}, },
handleInitSearch(isReset) { handleInitSearch(isReset) {
if (isReset) { if (isReset) {
this.calendarOptions.events = []; this.calendarOptions.events = this.calendarOptions.events.filter((v) => (v.week !== this.week));
console.log(this.calendarOptions.events);
} }
const objParms = {}; const objParms = {};
objParms.doctorId = this.doctorId; objParms.doctorId = this.doctorId;
...@@ -258,6 +263,7 @@ ...@@ -258,6 +263,7 @@
// this.currentIndex = this.schedulingTypeValue.level; // this.currentIndex = this.schedulingTypeValue.level;
dutyRosterQuery(objParms).then((res) => { dutyRosterQuery(objParms).then((res) => {
if (res.code == '000000') { if (res.code == '000000') {
this.calendarOptions.events = [];
this.handleInitData(res.data); this.handleInitData(res.data);
} else { } else {
this.$toast(res.message); this.$toast(res.message);
...@@ -268,12 +274,14 @@ ...@@ -268,12 +274,14 @@
var newDate = null; var newDate = null;
if (this.schedulingType != 3) { if (this.schedulingType != 3) {
newDate = [].concat(data.noAcceptList); newDate = [].concat(data.noAcceptList);
console.log(newDate, 'newDate');
} else { } else {
var acceptList = []; var acceptList = [];
data.acceptList.forEach((item) => { data.acceptList.forEach((item) => {
item.type = 88; item.type = 88;
acceptList.push(item); acceptList.push(item);
}); });
console.log(data.acceptList, 'data.acceptList');
newDate = [].concat(acceptList, data.noAcceptList); newDate = [].concat(acceptList, data.noAcceptList);
} }
// const keyAll = ['end', 'endStr', 'id', 'start', 'startStr']; // const keyAll = ['end', 'endStr', 'id', 'start', 'startStr'];
...@@ -284,6 +292,7 @@ ...@@ -284,6 +292,7 @@
dataObj['id'] = id; dataObj['id'] = id;
dataObj['end'] = item.endTime; dataObj['end'] = item.endTime;
dataObj['start'] = item.startTime; dataObj['start'] = item.startTime;
console.log(item.type);
dataObj['type'] = item.type; dataObj['type'] = item.type;
if (item.type == 88) { if (item.type == 88) {
dataObj['color'] = '#FFEDE9'; dataObj['color'] = '#FFEDE9';
...@@ -339,7 +348,9 @@ ...@@ -339,7 +348,9 @@
.then((_) => { .then((_) => {
console.log(_); console.log(_);
const index = this.getIdDeleteData(event.event.id); const index = this.getIdDeleteData(event.event.id);
return this.calendarOptions.events.splice(index, 1); this.isDoIt = true;
this.calendarOptions.events.splice(index, 1);
console.log(this.calendarOptions.events);
}) })
.catch((_) => { .catch((_) => {
console.log(_); console.log(_);
...@@ -411,27 +422,33 @@ ...@@ -411,27 +422,33 @@
return indexObj; return indexObj;
}, },
handlePriority(index) { handlePriority(index) {
this.isDoIt = true;
this.currentIndex = index; this.currentIndex = index;
}, },
resetDoctoreScheduling() { resetDoctoreScheduling() {
this.handleInitSearch(true); this.handleInitSearch(true);
}, },
saveDoctoreScheduling(type) { 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 objParms = {};
objParms.week = this.week; objParms.week = weekV ? weekV : this.week;
objParms.workId = this.schedulingTypeValue.id; objParms.workId = this.schedulingTypeValue.id;
objParms.level = this.currentIndex; objParms.level = this.currentIndex;
objParms.list = []; objParms.list = [];
const data = this.calendarOptions.events; const data = this.calendarOptions.events;
console.log(data, 'data');
data.forEach((item) => { data.forEach((item) => {
// if (item.week == this.week) { console.log(item.week == (weekV ? weekV : this.week));
if (item.week == (weekV ? weekV : this.week)) {
console.log(item.week, this.week, weekV, 'this.week');
const obj = {}; const obj = {};
obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start); obj.startTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.start);
obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end); obj.endTime = this.dateFormat('YYYY-mm-dd HH:MM:SS', item.end);
console.log(obj, 'obj');
objParms.list.push(obj); objParms.list.push(obj);
// } }
}); });
saveDutyRoster(objParms).then((res) => { saveDutyRoster(objParms).then((res) => {
if (res.code === '000000') { if (res.code === '000000') {
...@@ -439,10 +456,10 @@ ...@@ -439,10 +456,10 @@
// this.handleInitSearch(true); // this.handleInitSearch(true);
// this.$router.go(0); // this.$router.go(0);
this.loading = false; this.loading = false;
if (type == 1) { if(type == 1) {
this.$message({ this.$message({
message: '排班保存成功', message: '排班保存成功',
type: 'success', type: 'success'
}); });
} }
this.isDoIt = false; this.isDoIt = false;
......
Markdown 格式
0% or
您添加了 0 到此讨论。请谨慎行事。
先完成此消息的编辑!
想要评论请 注册