|
@@ -22,7 +22,7 @@
|
|
|
<div class="showDateDay">{{ date | dateNewType }}</div>
|
|
|
<div class="schedulingUser">
|
|
|
<template v-for="(item, index) in calendarData">
|
|
|
- <div :key="index" v-if="data.day == item.partrolDate" class="222">
|
|
|
+ <div :key="index" v-if="data.day == item.partrolDate">
|
|
|
<template v-for="itx in item.rosterUserDtos">
|
|
|
<div :key="itx" class="listTime">
|
|
|
<span>{{ itx.partrolTime }}</span>
|
|
@@ -30,10 +30,7 @@
|
|
|
</div>
|
|
|
</template>
|
|
|
<template
|
|
|
- v-if="
|
|
|
- date.getTime() <= $moment($parent.thisObj.endDate).valueOf() &&
|
|
|
- date.getTime() >= $moment(new Date()).valueOf()
|
|
|
- "
|
|
|
+ v-if="date.getTime() <= $moment($parent.thisObj.endDate).valueOf() && thisTimeFF(data, item.rosterUserDtos)"
|
|
|
>
|
|
|
<!-- 每周那几天 -->
|
|
|
<span v-if="thisObj.periodType == 1">
|
|
@@ -141,35 +138,31 @@ export default {
|
|
|
});
|
|
|
},
|
|
|
addItem(da, dateDe, onj) {
|
|
|
- if (da.getTime() <= this.$moment(new Date()).valueOf()) {
|
|
|
- return;
|
|
|
- } else {
|
|
|
- new Promise((resolve) => {
|
|
|
- this.$store.dispatch('addPopup', {
|
|
|
- url: '/patrolManagement/popups/schedulingAdd.vue',
|
|
|
- width: '450px',
|
|
|
- height: '300px',
|
|
|
- props: {
|
|
|
- callback: resolve,
|
|
|
- findUser: this.findUser,
|
|
|
- dateDe,
|
|
|
- onj,
|
|
|
- thisObj: this.thisObj,
|
|
|
- isSingle: true
|
|
|
- },
|
|
|
- title: '排班'
|
|
|
- });
|
|
|
- }).then(() => {
|
|
|
- let newTime = this.$moment(this.monthValue).format('YYYY-MM-DD');
|
|
|
- let timeArr = newTime.split('-');
|
|
|
- let time = new Date(timeArr[0], Number(timeArr[1]), 0);
|
|
|
- this.getShiftInformation({
|
|
|
- patrolRouteId: this.thisObj.id,
|
|
|
- startTime: `${timeArr[0]}-${timeArr[1]}-01`,
|
|
|
- endTime: `${timeArr[0]}-${timeArr[1]}-${time.getDate()}`
|
|
|
- });
|
|
|
+ new Promise((resolve) => {
|
|
|
+ this.$store.dispatch('addPopup', {
|
|
|
+ url: '/patrolManagement/popups/schedulingAdd.vue',
|
|
|
+ width: '450px',
|
|
|
+ height: '300px',
|
|
|
+ props: {
|
|
|
+ callback: resolve,
|
|
|
+ findUser: this.findUser,
|
|
|
+ dateDe,
|
|
|
+ onj,
|
|
|
+ thisObj: this.thisObj,
|
|
|
+ isSingle: true
|
|
|
+ },
|
|
|
+ title: '排班'
|
|
|
});
|
|
|
- }
|
|
|
+ }).then(() => {
|
|
|
+ let newTime = this.$moment(this.monthValue).format('YYYY-MM-DD');
|
|
|
+ let timeArr = newTime.split('-');
|
|
|
+ let time = new Date(timeArr[0], Number(timeArr[1]), 0);
|
|
|
+ this.getShiftInformation({
|
|
|
+ patrolRouteId: this.thisObj.id,
|
|
|
+ startTime: `${timeArr[0]}-${timeArr[1]}-01`,
|
|
|
+ endTime: `${timeArr[0]}-${timeArr[1]}-${time.getDate()}`
|
|
|
+ });
|
|
|
+ });
|
|
|
},
|
|
|
goback() {
|
|
|
this.$emit('initPage');
|
|
@@ -218,19 +211,35 @@ export default {
|
|
|
}
|
|
|
let { startDate } = val;
|
|
|
let thisD = this.$moment(d.day + ' 00:00:00').valueOf();
|
|
|
- if (this.thisTimeTypeShow(this.$moment(startDate).valueOf(), sum).includes(thisD)) {
|
|
|
+ if (this.thisTimeTypeShow(this.$moment(startDate).valueOf(), Number(sum)).includes(thisD)) {
|
|
|
bb = true;
|
|
|
}
|
|
|
}
|
|
|
return bb;
|
|
|
},
|
|
|
thisTimeTypeShow(kai, sum) {
|
|
|
+ // 零点计算 sum天得+1
|
|
|
let oneDay = 86400000,
|
|
|
indU = [];
|
|
|
- for (let x = 0; x <= 30; x++) {
|
|
|
- indU.push(kai + x * sum * oneDay);
|
|
|
+ for (let x = 0; x <= 16; x++) {
|
|
|
+ indU.push(kai + x * (sum + 1) * oneDay);
|
|
|
}
|
|
|
return indU;
|
|
|
+ },
|
|
|
+ thisTimeFF(s, arr) {
|
|
|
+ let thisDate = this.$moment(new Date());
|
|
|
+ let sur = false;
|
|
|
+ arr.map((item, index) => {
|
|
|
+ let timePot = item.partrolTime.split('-');
|
|
|
+ timePot.map((its) => {
|
|
|
+ if (this.$moment(`${s.day} ${its}:00`).valueOf() > thisDate.valueOf()) {
|
|
|
+ sur = true;
|
|
|
+ return sur;
|
|
|
+ }
|
|
|
+ });
|
|
|
+ return sur;
|
|
|
+ });
|
|
|
+ return sur;
|
|
|
}
|
|
|
},
|
|
|
created() {
|