|
@@ -289,7 +289,7 @@ export default {
|
|
|
scheduleData.forEach((item, i) => {
|
|
scheduleData.forEach((item, i) => {
|
|
|
const diff = this.getDaysDifference(item.start_date_, val)
|
|
const diff = this.getDaysDifference(item.start_date_, val)
|
|
|
const dateName = item['d' + diff + '_']
|
|
const dateName = item['d' + diff + '_']
|
|
|
- console.log(diff, item)
|
|
|
|
|
|
|
+ console.log(diff, dateName, item)
|
|
|
const dateArr = dateName.split(',')
|
|
const dateArr = dateName.split(',')
|
|
|
|
|
|
|
|
if (dateArr.length > 1) {
|
|
if (dateArr.length > 1) {
|
|
@@ -306,16 +306,23 @@ export default {
|
|
|
this.list.push({ text: dateArr[0], config: midObj, approver: approver })
|
|
this.list.push({ text: dateArr[0], config: midObj, approver: approver })
|
|
|
}
|
|
}
|
|
|
})
|
|
})
|
|
|
- console.log(midData)
|
|
|
|
|
|
|
+ console.log(this.list, midData)
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
immediate: true
|
|
immediate: true
|
|
|
},
|
|
},
|
|
|
|
|
+ 'form.buKaRiQi': {
|
|
|
|
|
+ handler: async function(val, oldVal) {
|
|
|
|
|
+ this.form.buKaBanCi = ''
|
|
|
|
|
+ },
|
|
|
|
|
+ immediate: true
|
|
|
|
|
+ },
|
|
|
'form.buKaBanCi': {
|
|
'form.buKaBanCi': {
|
|
|
handler: async function(val, oldVal) {
|
|
handler: async function(val, oldVal) {
|
|
|
|
|
+ this.form.buKaShiJian = ''
|
|
|
|
|
+ this.form.buKaLeiXing = ''
|
|
|
if (val === '') {
|
|
if (val === '') {
|
|
|
this.xuanzeTime = null
|
|
this.xuanzeTime = null
|
|
|
- this.form.buKaShiJian = ''
|
|
|
|
|
this.typeList = [
|
|
this.typeList = [
|
|
|
{ text: '上班' },
|
|
{ text: '上班' },
|
|
|
{ text: '下班' }
|
|
{ text: '下班' }
|
|
@@ -424,6 +431,9 @@ export default {
|
|
|
const time = this.$common.getFormatDate('string', 10, e)
|
|
const time = this.$common.getFormatDate('string', 10, e)
|
|
|
this.form.buKaRiQi = time
|
|
this.form.buKaRiQi = time
|
|
|
this.dateShow = false
|
|
this.dateShow = false
|
|
|
|
|
+ if (this.list.length === 0) {
|
|
|
|
|
+ this.$toast(`当前日期没有可选班次`)
|
|
|
|
|
+ }
|
|
|
},
|
|
},
|
|
|
timeShowCallback(e) {
|
|
timeShowCallback(e) {
|
|
|
// const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
|
|
// const nowDate = new Date(e.getTime() + 8 * 60 * 60 * 1000)
|
|
@@ -438,8 +448,8 @@ export default {
|
|
|
this.timeShow = true
|
|
this.timeShow = true
|
|
|
},
|
|
},
|
|
|
getDaysDifference(date1, date2) {
|
|
getDaysDifference(date1, date2) {
|
|
|
- const d1 = new Date(date1)
|
|
|
|
|
- const d2 = new Date(date2)
|
|
|
|
|
|
|
+ const d1 = new Date(this.$common.getFormatDate('string', 10, date1))
|
|
|
|
|
+ const d2 = new Date(this.$common.getFormatDate('string', 10, date2))
|
|
|
const diffTime = Math.abs(d2.getTime() - d1.getTime())
|
|
const diffTime = Math.abs(d2.getTime() - d1.getTime())
|
|
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
|
const diffDays = Math.ceil(diffTime / (1000 * 60 * 60 * 24))
|
|
|
|
|
|