|
@@ -70,23 +70,68 @@
|
|
|
</van-collapse-item>
|
|
</van-collapse-item>
|
|
|
</van-collapse>
|
|
</van-collapse>
|
|
|
</div>
|
|
</div>
|
|
|
- <div v-show="showInfo&&unfoldInfo!=''&&active==='排班'" class="unfoldMessage">
|
|
|
|
|
- <div class="line">
|
|
|
|
|
|
|
+ <div v-show="showInfo&&unfoldInfo&&unfoldInfo.data.length>0&&active==='排班'" class="unfoldMessage">
|
|
|
|
|
+ <div v-for="(item,i) in unfoldInfo.data" :key="'uif'+ i" class="line">
|
|
|
<!-- <div class="iconLine"><van-icon name="label" /></div> -->
|
|
<!-- <div class="iconLine"><van-icon name="label" /></div> -->
|
|
|
<van-icon class="iconLine" name="label" color="rgb(25, 137, 250)" size="125%" />
|
|
<van-icon class="iconLine" name="label" color="rgb(25, 137, 250)" size="125%" />
|
|
|
<div class="contentLine">
|
|
<div class="contentLine">
|
|
|
- {{unfoldInfo.replace(new RegExp(',', 'g'), ',')}}
|
|
|
|
|
|
|
+ <div class="textAll">
|
|
|
|
|
+ <div class="textSty">
|
|
|
|
|
+ <div>班次名称:</div>
|
|
|
|
|
+ <div>{{item.config.name}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="textSty">
|
|
|
|
|
+ <div>班次别名:</div>
|
|
|
|
|
+ <div>{{item.name}}</div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="textSty">
|
|
|
|
|
+ <div>出勤时间:</div>
|
|
|
|
|
+ <div class="timeLine">
|
|
|
|
|
+ <div v-for="(m,n) in item.config.dateRange" :key="'time'+n">
|
|
|
|
|
+ <!-- {{ item.state && item.state.data }} -->
|
|
|
|
|
+ <p>{{m.startTime}} — {{m.isSecondDay==='Y'?'第二天':''}}{{ m.endTime }}</p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="textSty">
|
|
|
|
|
+ <div>出勤时间:</div>
|
|
|
|
|
+ <div class="timeLine">
|
|
|
|
|
+ <p>上班({{ item.state && item.state.data&&item.state.data.da_ka_shi_jian_1_&&item.state.data.da_ka_shi_jian_1_.length===19 ? item.state.data.da_ka_shi_jian_1_.substr(-8,5) : !item.reissue.up?'未打卡':'已有补卡记录'}})
|
|
|
|
|
+ <span v-if="item.reissue&&item.state && item.state.data && !judgeReissueBtn(item.state.data,'am', unfoldInfo.date)&&!item.reissue.up" class="reissueBtn" @click="reissueShow(item,'上班')">补卡</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ <div style="height: 5px;"></div>
|
|
|
|
|
+ <p>下班({{item.state && item.state.data&&item.state.data.shi_fou_kua_ri_==='Y'?'第二天':''}}{{item.state && item.state.data&&item.state.data.da_ka_shi_jian_2_&&item.state.data.da_ka_shi_jian_2_.length===19 ? item.state.data.da_ka_shi_jian_2_.substr(-8,5) : !item.reissue.down?'未打卡':'已有补卡记录'}})
|
|
|
|
|
+ <span v-if="item.reissue&&item.state && item.state.data && !judgeReissueBtn(item.state.data,'pm',unfoldInfo.date)&&!item.reissue.down" class="reissueBtn" @click="reissueShow(item,'下班')">补卡</span>
|
|
|
|
|
+ </p>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div v-if="clockConfig && (unfoldInfo.date === entryDate || (item.config.isSecondDayAll&& unfoldInfo.date === getBeforeDate(entryDate)))" class="textBtn" >
|
|
|
|
|
+ <div class="btnSty" @click="punchTheClockEvent(item.state)">{{clockTypeList[item.state.state].label||clockTypeList.clockIn.label}}</div>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
+ <clock-dialog-vue :visible-show="visibleShow" :dialog-data="dialogData" @controlVisible = "controlVisible"></clock-dialog-vue>
|
|
|
|
|
+ <reissueDialog :show-pop="showPop" :open-type="'schedule'" :reissue-type="reissueType" :reissue-data="reissueData" :select-date="selectDate" @updataSet="updataSet"></reissueDialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
<script>
|
|
<script>
|
|
|
import { findAllByCurrUserId } from '@/api/platform/system/desktop'
|
|
import { findAllByCurrUserId } from '@/api/platform/system/desktop'
|
|
|
|
|
+import clockDialogVue from './components/clockDialog.vue'
|
|
|
|
|
+import { clockConfig } from '@/constant'
|
|
|
|
|
+import meth from './scheduleJson.json'
|
|
|
|
|
+import reissueDialog from '@/views/platform/bpmn/my-reissue/components/reissueDialog'
|
|
|
|
|
+
|
|
|
export default {
|
|
export default {
|
|
|
|
|
+ components: {
|
|
|
|
|
+ clockDialogVue,
|
|
|
|
|
+ reissueDialog
|
|
|
|
|
+ },
|
|
|
data() {
|
|
data() {
|
|
|
const { userId } = this.$store.getters
|
|
const { userId } = this.$store.getters
|
|
|
return {
|
|
return {
|
|
|
|
|
+ clockConfig,
|
|
|
userId,
|
|
userId,
|
|
|
active: '排班',
|
|
active: '排班',
|
|
|
activeArr: ['排班', '日程'],
|
|
activeArr: ['排班', '日程'],
|
|
@@ -96,7 +141,8 @@ export default {
|
|
|
configArr: [],
|
|
configArr: [],
|
|
|
showDateArr: {},
|
|
showDateArr: {},
|
|
|
infoDataArr: [],
|
|
infoDataArr: [],
|
|
|
- unfoldInfo: '',
|
|
|
|
|
|
|
+ unfoldInfo: { date: '', data: {}},
|
|
|
|
|
+ showPop: false,
|
|
|
stateObj: {
|
|
stateObj: {
|
|
|
1: '急',
|
|
1: '急',
|
|
|
2: '重',
|
|
2: '重',
|
|
@@ -108,7 +154,15 @@ export default {
|
|
|
showChange: 0,
|
|
showChange: 0,
|
|
|
showInfo: false,
|
|
showInfo: false,
|
|
|
collapseSelect: [],
|
|
collapseSelect: [],
|
|
|
- calenderVal: ''
|
|
|
|
|
|
|
+ calenderVal: '',
|
|
|
|
|
+ entryDate: this.$common.getDateNow(10),
|
|
|
|
|
+ entryTime: this.$common.getDateNow(19),
|
|
|
|
|
+ visibleShow: false,
|
|
|
|
|
+ dialogData: {},
|
|
|
|
|
+ clockTypeList: meth.clockTypeList,
|
|
|
|
|
+ reissueData: { clock: {}, config: {}, fid: '', name: '', state: {}},
|
|
|
|
|
+ selectDate: '',
|
|
|
|
|
+ reissueType: ''
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
watch: {
|
|
watch: {
|
|
@@ -137,10 +191,11 @@ export default {
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
this.$refs.mySchedule.style.height = document.documentElement.clientHeight + 'px'
|
|
this.$refs.mySchedule.style.height = document.documentElement.clientHeight + 'px'
|
|
|
|
|
+ this.getBeforeDate()
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
// 初始化和tab切换函数
|
|
// 初始化和tab切换函数
|
|
|
- onClickTab(val) {
|
|
|
|
|
|
|
+ async onClickTab(val) {
|
|
|
this.showInfo = false
|
|
this.showInfo = false
|
|
|
if (val === '日程') {
|
|
if (val === '日程') {
|
|
|
const time = this.$common.getFormatDate('string', 7, this.yearMonth.year + '-' + this.yearMonth.month)
|
|
const time = this.$common.getFormatDate('string', 7, this.yearMonth.year + '-' + this.yearMonth.month)
|
|
@@ -172,6 +227,9 @@ export default {
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
} else {
|
|
} else {
|
|
|
|
|
+ const clockData = await this.getpunchTheClockData()
|
|
|
|
|
+ const reissueDataIn = await this.reissue()
|
|
|
|
|
+
|
|
|
this.schedule().then(res => {
|
|
this.schedule().then(res => {
|
|
|
if (res.length > 0) {
|
|
if (res.length > 0) {
|
|
|
const objArr = {}
|
|
const objArr = {}
|
|
@@ -179,20 +237,58 @@ export default {
|
|
|
const dArr = this.generationDate(item.start_date_, item.end_date_)
|
|
const dArr = this.generationDate(item.start_date_, item.end_date_)
|
|
|
// let config = JSON.parse(item.config_)
|
|
// let config = JSON.parse(item.config_)
|
|
|
dArr.forEach((t, n) => {
|
|
dArr.forEach((t, n) => {
|
|
|
|
|
+ const midClockArr = clockData.filter(y => y.ri_qi_ === t && y.pai_ban_id_ === item.fid) || []
|
|
|
|
|
+ const midReissueArr = reissueDataIn.filter(y => y.bu_ka_ri_qi_ === t && y.pai_ban_id_ === item.fid) || []
|
|
|
|
|
+ const isAbnormal = midClockArr.length > 0 ? midClockArr.filter(y => y.kao_qin_zhuang_ta === '异常' || !y.hasOwnProperty('da_ka_shi_jian_1_') || !y.hasOwnProperty('da_ka_shi_jian_2_')).length > 0 : true
|
|
|
|
|
+ const clockDataAll = { isAbnormal: isAbnormal, data: midClockArr }
|
|
|
if (objArr.hasOwnProperty(t)) {
|
|
if (objArr.hasOwnProperty(t)) {
|
|
|
// const strArr = objArr[t].name.split(',')
|
|
// const strArr = objArr[t].name.split(',')
|
|
|
// if (strArr.findIndex(e => e === (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')) === -1) {
|
|
// if (strArr.findIndex(e => e === (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')) === -1) {
|
|
|
- objArr[t].name = objArr[t].name + (item['d' + (n + 1) + '_'] !== '' && objArr[t].name !== '' ? ',' : '') + (item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+ const mid = item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : ''
|
|
|
|
|
+ objArr[t].name = objArr[t].name + (item['d' + (n + 1) + '_'] !== '' && objArr[t].name !== '' ? ',' : '') + mid
|
|
|
|
|
+ // objArr[t].data.push({ name: mid, config: JSON.parse(item.config_) })
|
|
|
|
|
+ if (mid !== '' && mid.split(',').length === 1) {
|
|
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === mid) : ''
|
|
|
|
|
+ const clockState = midClockArr.length > 0 ? this.judgeClockState(midClockArr, mid) : {}
|
|
|
|
|
+ const midUp = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(mid) && y.bu_ka_ban_ci_.includes('上班')) || []
|
|
|
|
|
+ const midDown = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(mid) && y.bu_ka_ban_ci_.includes('下班')) || []
|
|
|
|
|
|
|
|
- // console.log(1, objArr[t].name, item['d' + (n + 1) + '_'], objArr[t].name + ',' + item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '')
|
|
|
|
|
|
|
+ objArr[t].data.push({ name: mid, fid: item.fid, config: midObj, clock: clockDataAll, state: clockState, reissue: { up: midUp.length > 0, down: midDown.length > 0 }})
|
|
|
|
|
+ } else if (mid !== '' && mid.split(',').length > 1) {
|
|
|
|
|
+ mid.split(',').forEach((x, y) => {
|
|
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === x) : ''
|
|
|
|
|
+ const clockState = midClockArr.length > 0 ? this.judgeClockState(midClockArr, x) : {}
|
|
|
|
|
+ const midUp = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(x) && y.bu_ka_ban_ci_.includes('上班')) || []
|
|
|
|
|
+ const midDown = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(x) && y.bu_ka_ban_ci_.includes('下班')) || []
|
|
|
|
|
|
|
|
|
|
+ objArr[t].data.push({ name: x, fid: item.fid, config: midObj, clock: clockDataAll, state: clockState, reissue: { up: midUp.length > 0, down: midDown.length > 0 }})
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+ // }
|
|
|
// let configMsg = config.scheduleStaff.find(d=>{})
|
|
// let configMsg = config.scheduleStaff.find(d=>{})
|
|
|
} else {
|
|
} else {
|
|
|
objArr[t] = { name: item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '' }
|
|
objArr[t] = { name: item['d' + (n + 1) + '_'] ? item['d' + (n + 1) + '_'] : '' }
|
|
|
|
|
+ objArr[t].data = []
|
|
|
|
|
+ if (objArr[t].name !== '' && objArr[t].name.split(',').length === 1) {
|
|
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === objArr[t].name) : ''
|
|
|
|
|
+ const clockState = midClockArr.length > 0 ? this.judgeClockState(midClockArr, objArr[t].name) : {}
|
|
|
|
|
+ const midUp = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(objArr[t].name) && y.bu_ka_ban_ci_.includes('上班')) || []
|
|
|
|
|
+ const midDown = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(objArr[t].name) && y.bu_ka_ban_ci_.includes('下班')) || []
|
|
|
|
|
+
|
|
|
|
|
+ objArr[t].data = [{ name: objArr[t].name, fid: item.fid, config: midObj, clock: clockDataAll, state: clockState, reissue: { up: midUp.length > 0, down: midDown.length > 0 }}]
|
|
|
|
|
+ } else if (objArr[t].name !== '' && objArr[t].name.split(',').length > 1) {
|
|
|
|
|
+ objArr[t].name.split(',').forEach((x, y) => {
|
|
|
|
|
+ const midObj = this.isValidJSON(item.config_) ? JSON.parse(item.config_).scheduleShift.find(d => d.alias === x) : ''
|
|
|
|
|
+ const clockState = midClockArr.length > 0 ? this.judgeClockState(midClockArr, x) : {}
|
|
|
|
|
+ const midUp = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(x) && y.bu_ka_ban_ci_.includes('上班')) || []
|
|
|
|
|
+ const midDown = midReissueArr.filter(y => y.bu_ka_ban_ci_.includes(x) && y.bu_ka_ban_ci_.includes('下班')) || []
|
|
|
|
|
+ objArr[t].data.push({ name: x, fid: item.fid, config: midObj, clock: clockDataAll, state: clockState, reissue: { up: midUp.length > 0, down: midDown.length > 0 }})
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
|
|
+ console.log(objArr)
|
|
|
this.homologousDate(this.dateArr, objArr)
|
|
this.homologousDate(this.dateArr, objArr)
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
@@ -201,9 +297,19 @@ export default {
|
|
|
//
|
|
//
|
|
|
optFor(val) {
|
|
optFor(val) {
|
|
|
const selectDate = this.$common.getFormatDate('string', 10, val)
|
|
const selectDate = this.$common.getFormatDate('string', 10, val)
|
|
|
- if ((this.active === '日程' || this.active === '排班') && this.showDateArr[selectDate] !== '') {
|
|
|
|
|
|
|
+ this.selectDate = selectDate
|
|
|
|
|
+ if (this.active === '日程' && this.showDateArr[selectDate] !== '') {
|
|
|
this.infoDataArr = this.showDateArr[selectDate] ? this.showDateArr[selectDate].dataArr || {} : {}
|
|
this.infoDataArr = this.showDateArr[selectDate] ? this.showDateArr[selectDate].dataArr || {} : {}
|
|
|
- this.unfoldInfo = this.showDateArr[selectDate] ? this.showDateArr[selectDate].name || '' : ''
|
|
|
|
|
|
|
+ this.showInfo = true
|
|
|
|
|
+ } else if (this.active === '排班' && this.showDateArr[selectDate] !== '') {
|
|
|
|
|
+ this.unfoldInfo = this.showDateArr[selectDate] ? { date: selectDate, data: this.showDateArr[selectDate].data } || {} : {}
|
|
|
|
|
+
|
|
|
|
|
+ if (Object.keys(this.unfoldInfo.data).length > 0) {
|
|
|
|
|
+ this.unfoldInfo.data.forEach((m, n) => {
|
|
|
|
|
+ const mid = m.config.dateRange.filter(t => t.isSecondDay === 'Y')
|
|
|
|
|
+ m.config['isSecondDayAll'] = mid.length > 0
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
this.showInfo = true
|
|
this.showInfo = true
|
|
|
} else {
|
|
} else {
|
|
|
this.showInfo = false
|
|
this.showInfo = false
|
|
@@ -225,6 +331,20 @@ export default {
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
|
|
|
|
|
+ // 打卡记录数据请求
|
|
|
|
|
+ async getpunchTheClockData() {
|
|
|
|
|
+ const min = this.$common.getFormatDate('string', 10, this.minDate)
|
|
|
|
|
+ const max = this.$common.getFormatDate('string', 10, this.maxDate)
|
|
|
|
|
+ const sql = `select * FROM t_attendance_detail where yong_hu_id_ = '${this.userId}' and CAST(ri_qi_ AS DATE) between '${min}' and '${max}'`
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
|
|
+ const { data = [] } = res.variables || {}
|
|
|
|
|
+ resolve(data)
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ reject(error)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 日历数据请求
|
|
// 日历数据请求
|
|
|
async calendar() {
|
|
async calendar() {
|
|
|
return new Promise((resolve, reject) => {
|
|
return new Promise((resolve, reject) => {
|
|
@@ -237,7 +357,49 @@ export default {
|
|
|
})
|
|
})
|
|
|
})
|
|
})
|
|
|
},
|
|
},
|
|
|
|
|
+ // 补卡数据请求
|
|
|
|
|
+ async reissue() {
|
|
|
|
|
+ const min = this.$common.getFormatDate('string', 10, this.minDate)
|
|
|
|
|
+ const max = this.$common.getFormatDate('string', 10, this.maxDate)
|
|
|
|
|
+ const sql = `select * FROM t_attendance_reissue WHERE bian_zhi_ren_ = '${this.userId}' AND CAST(bu_ka_ri_qi_ AS DATE) between '${min}' and '${max}' and zhuang_tai_ != '已撤销'`
|
|
|
|
|
+ return new Promise((resolve, reject) => {
|
|
|
|
|
+ this.$common.request('sql', sql).then(res => {
|
|
|
|
|
+ const data = res.variables.data || []
|
|
|
|
|
+ resolve(data)
|
|
|
|
|
+ }).catch(error => {
|
|
|
|
|
+ reject(error)
|
|
|
|
|
+ })
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
|
|
+ // 判断打卡状态:目前只有单时间段判断逻辑,pc后续会隐藏配置多时间段入口
|
|
|
|
|
+ judgeClockState(arr, name) {
|
|
|
|
|
+ // const ind = arr.length - 1
|
|
|
|
|
+ const mid = arr.filter(n => n.ban_ci_bie_ming_ === name)[0]
|
|
|
|
|
+ const obj = { state: 'clockIn', data: mid }
|
|
|
|
|
+ const nowTime = new Date(this.$common.getDateNow(19)).getTime()
|
|
|
|
|
+ const startTime = mid ? new Date(mid.ban_ci_kai_shi_).getTime() : ''
|
|
|
|
|
+ const endTime = mid ? new Date(mid.ban_ci_jie_shu_).getTime() : ''
|
|
|
|
|
|
|
|
|
|
+ if (nowTime <= startTime) {
|
|
|
|
|
+ obj.state = 'beOnButy'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nowTime <= startTime && mid && mid.hasOwnProperty('da_ka_shi_jian_1_')) {
|
|
|
|
|
+ obj.state = 'clockedIn'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nowTime > startTime && nowTime < endTime && mid && !mid.hasOwnProperty('da_ka_shi_jian_1_')) {
|
|
|
|
|
+ obj.state = 'beLate'
|
|
|
|
|
+ }
|
|
|
|
|
+ if ((nowTime > startTime && nowTime < endTime && mid && mid.hasOwnProperty('da_ka_shi_jian_1_'))) {
|
|
|
|
|
+ obj.state = 'timeNotYetUp'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nowTime >= endTime && mid && !mid.hasOwnProperty('da_ka_shi_jian_2_')) {
|
|
|
|
|
+ obj.state = 'getOffwork'
|
|
|
|
|
+ }
|
|
|
|
|
+ if (nowTime >= endTime && mid && mid.hasOwnProperty('da_ka_shi_jian_2_')) {
|
|
|
|
|
+ obj.state = 'upDateTime'
|
|
|
|
|
+ }
|
|
|
|
|
+ return obj
|
|
|
|
|
+ },
|
|
|
// 日历备注赋值
|
|
// 日历备注赋值
|
|
|
formatter(day) {
|
|
formatter(day) {
|
|
|
const formatterDate = this.$common.getFormatDate('string', 10, day.date)
|
|
const formatterDate = this.$common.getFormatDate('string', 10, day.date)
|
|
@@ -245,18 +407,41 @@ export default {
|
|
|
// const year = day.date.getFullYear()
|
|
// const year = day.date.getFullYear()
|
|
|
// const month = day.date.getMonth() + 1
|
|
// const month = day.date.getMonth() + 1
|
|
|
// const date = day.date.getDate()
|
|
// const date = day.date.getDate()
|
|
|
- // if (year === this.yearMonth.nowYear && month === this.yearMonth.nowMonth && date === this.yearMonth.nowDay) {
|
|
|
|
|
- // day.className = 'circle'
|
|
|
|
|
- // day.topInfo = ' '
|
|
|
|
|
- // }
|
|
|
|
|
|
|
+
|
|
|
if (this.active === '排班') {
|
|
if (this.active === '排班') {
|
|
|
|
|
+ let indFT = false
|
|
|
|
|
+ if (this.showDateArr && this.showDateArr[formatterDate] && Object.keys(this.showDateArr[formatterDate]).length > 0 && this.showDateArr[formatterDate].data) {
|
|
|
|
|
+ this.showDateArr[formatterDate].data.forEach((m, n) => {
|
|
|
|
|
+ if (m.clock.isAbnormal === true) {
|
|
|
|
|
+ indFT = true
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if (indFT) {
|
|
|
|
|
+ day.className = 'circleRed'
|
|
|
|
|
+ day.topInfo = ' '
|
|
|
|
|
+ } else if (!indFT && this.showDateArr && this.showDateArr[formatterDate] && this.showDateArr[formatterDate].name !== '') {
|
|
|
|
|
+ day.className = 'circle'
|
|
|
|
|
+ day.topInfo = ' '
|
|
|
|
|
+ }
|
|
|
day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].name ? this.showDateArr[formatterDate].name : '' : ''
|
|
day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].name ? this.showDateArr[formatterDate].name : '' : ''
|
|
|
} else {
|
|
} else {
|
|
|
day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].num ? this.showDateArr[formatterDate].num + '项' : '' : ''
|
|
day.bottomInfo = Object.keys(this.showDateArr).length <= 0 ? '' : this.showDateArr[formatterDate] !== '' && this.showDateArr.hasOwnProperty(formatterDate) ? this.showDateArr[formatterDate].num ? this.showDateArr[formatterDate].num + '项' : '' : ''
|
|
|
}
|
|
}
|
|
|
return day
|
|
return day
|
|
|
},
|
|
},
|
|
|
-
|
|
|
|
|
|
|
+ punchTheClockEvent(val) {
|
|
|
|
|
+ this.visibleShow = true
|
|
|
|
|
+ this.dialogData = val
|
|
|
|
|
+ // this.$set(this, 'dialogData', val)
|
|
|
|
|
+ },
|
|
|
|
|
+ controlVisible(val, type) {
|
|
|
|
|
+ this.visibleShow = val
|
|
|
|
|
+ if (type) {
|
|
|
|
|
+ this.onClickTab('排班')
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
// 部分日期数据对应塞入对应整月日期
|
|
// 部分日期数据对应塞入对应整月日期
|
|
|
homologousDate(all, party) {
|
|
homologousDate(all, party) {
|
|
|
Object.assign(this.showDateArr, {})
|
|
Object.assign(this.showDateArr, {})
|
|
@@ -320,6 +505,53 @@ export default {
|
|
|
stamp = stamp + oneDay
|
|
stamp = stamp + oneDay
|
|
|
}
|
|
}
|
|
|
return dateArr
|
|
return dateArr
|
|
|
|
|
+ },
|
|
|
|
|
+ // compareDates(t1,t2) {
|
|
|
|
|
+ // const t1TimesTamp = new Date(t1).getTime()
|
|
|
|
|
+ // const t2TimesTamp = new Date(t2).getTime()
|
|
|
|
|
+ // return t1TimesTamp
|
|
|
|
|
+ // },
|
|
|
|
|
+ getBeforeDate(d) {
|
|
|
|
|
+ return this.$common.getFormatDate('string', 10, this.$common.getDate('day', -1, d))
|
|
|
|
|
+ },
|
|
|
|
|
+ isValidJSON(text) {
|
|
|
|
|
+ try {
|
|
|
|
|
+ JSON.parse(text)
|
|
|
|
|
+ return true
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ },
|
|
|
|
|
+ judgeReissueBtn(val, type, date) {
|
|
|
|
|
+ const mid = type === 'am' ? ['da_ka_shi_jian_1_', 'ban_ci_kai_shi_', 'zhuang_tai_1_'] : ['da_ka_shi_jian_2_', 'ban_ci_jie_shu_', 'zhuang_tai_2_']
|
|
|
|
|
+ const pickDate = new Date(date).getTime()
|
|
|
|
|
+ const normDate = new Date(this.$common.getFormatDate('string', 10, this.entryDate)).getTime()
|
|
|
|
|
+ const normTime = new Date(this.entryTime).getTime()
|
|
|
|
|
+ const bzTime = val.hasOwnProperty(mid[1]) ? new Date(val[mid[1]]).getTime() : ''
|
|
|
|
|
+ const dkTime = val.hasOwnProperty(mid[0]) ? new Date(val[mid[0]]).getTime() : ''
|
|
|
|
|
+ if (pickDate > normDate) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ } else if (pickDate === normDate && normTime <= bzTime) {
|
|
|
|
|
+ return true
|
|
|
|
|
+ } else if (pickDate === normDate) {
|
|
|
|
|
+ if (type === 'am' && (!val.hasOwnProperty(mid[0]) || (val.hasOwnProperty(mid[0]) && dkTime > bzTime))) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ } else if (type === 'pm' && (!val.hasOwnProperty(mid[0]) || (val.hasOwnProperty(mid[0]) && dkTime < bzTime))) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ } else if (pickDate < normDate && !val.hasOwnProperty(mid[0]) || !val.hasOwnProperty(mid[2])) {
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ return true
|
|
|
|
|
+ },
|
|
|
|
|
+ reissueShow(val, type) {
|
|
|
|
|
+ this.showPop = true
|
|
|
|
|
+ this.reissueData = val
|
|
|
|
|
+ this.reissueType = type
|
|
|
|
|
+ },
|
|
|
|
|
+ updataSet(v) {
|
|
|
|
|
+ this.showPop = v
|
|
|
|
|
+ this.onClickTab('排班')
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -356,6 +588,8 @@ export default {
|
|
|
width: 98%;
|
|
width: 98%;
|
|
|
padding: 1%;
|
|
padding: 1%;
|
|
|
background-color: #fff;
|
|
background-color: #fff;
|
|
|
|
|
+ margin-bottom: 2%;
|
|
|
|
|
+ line-height: normal;
|
|
|
.iconLine{
|
|
.iconLine{
|
|
|
position: absolute;
|
|
position: absolute;
|
|
|
left: 1%;
|
|
left: 1%;
|
|
@@ -368,6 +602,42 @@ export default {
|
|
|
margin-left: 8%;
|
|
margin-left: 8%;
|
|
|
font-size: 75%;
|
|
font-size: 75%;
|
|
|
font-weight: bold;
|
|
font-weight: bold;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: space-between;
|
|
|
|
|
+ .textAll{
|
|
|
|
|
+ width: 80%;
|
|
|
|
|
+ .textSty{
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: baseline;
|
|
|
|
|
+ margin: 3% 0;
|
|
|
|
|
+ .timeLine{
|
|
|
|
|
+ .reissueBtn{
|
|
|
|
|
+ border: 1px solid rgb(25, 137, 250);
|
|
|
|
|
+ color: rgb(25, 137, 250);
|
|
|
|
|
+ border-radius: 4px;
|
|
|
|
|
+ font-size: 0.6rem;
|
|
|
|
|
+ padding: 2px 5px;
|
|
|
|
|
+ margin-left: 5px;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ .textBtn{
|
|
|
|
|
+ width: 20%;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ .btnSty{
|
|
|
|
|
+ width: 10vw;
|
|
|
|
|
+ height: 10vw;
|
|
|
|
|
+ display: flex;
|
|
|
|
|
+ justify-content: center;
|
|
|
|
|
+ align-items: center;
|
|
|
|
|
+ border-radius: 50%;
|
|
|
|
|
+ color: #f56c6c;
|
|
|
|
|
+ border: 2px solid #f56c6c;
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -505,10 +775,17 @@ export default {
|
|
|
::v-deep .circle .van-calendar__top-info{
|
|
::v-deep .circle .van-calendar__top-info{
|
|
|
width: 4px;
|
|
width: 4px;
|
|
|
height: 4px;
|
|
height: 4px;
|
|
|
- margin: 20% auto;
|
|
|
|
|
|
|
+ margin: 0.5rem auto;
|
|
|
background-color: #1989fa;
|
|
background-color: #1989fa;
|
|
|
border-radius: 6px;
|
|
border-radius: 6px;
|
|
|
}
|
|
}
|
|
|
|
|
+ ::v-deep .circleRed .van-calendar__top-info{
|
|
|
|
|
+ width: 4px;
|
|
|
|
|
+ height: 4px;
|
|
|
|
|
+ margin: 0.5rem auto;
|
|
|
|
|
+ background-color: #f56c6c;
|
|
|
|
|
+ border-radius: 6px;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</style>
|
|
</style>
|