commit 20221024
This commit is contained in:
@@ -14,7 +14,8 @@
|
||||
format="yyyy-MM-dd"
|
||||
range-separator="~"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"/>
|
||||
end-placeholder="结束日期"
|
||||
@change="JudgeDateTime"/>
|
||||
<span style="margin-left: 10px">工位号:</span>
|
||||
<el-select v-model="stationNumberValue" placeholder="请选择工位号" clearable filterable size="small" style="width: 200px; margin-left: 13px">
|
||||
<el-option
|
||||
@@ -138,19 +139,40 @@ export default {
|
||||
}
|
||||
},
|
||||
created() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
this.initialization()
|
||||
this.getStationNumber()
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
methods: {
|
||||
initialization() {
|
||||
var year, month, day, audiTime
|
||||
this.date = new Date() // 修改数据date
|
||||
year = new Date().getFullYear()
|
||||
month = new Date().getMonth() + 1 < 10 ? '0' + (new Date().getMonth() + 1) : new Date().getMonth() + 1
|
||||
day = new Date().getDate() < 10 ? '0' + new Date().getDate() : new Date().getDate()
|
||||
audiTime = year + '-' + month + '-' + day
|
||||
console.log(audiTime, 'audiTime')
|
||||
this.dateTime = [audiTime, audiTime]
|
||||
},
|
||||
DateDiff(sDate1, sDate2) {
|
||||
// sDate1和sDate2是2022-08-18格式
|
||||
var aDate1, aDate2, oDate1, oDate2, iDays
|
||||
aDate1 = sDate1.split('-')
|
||||
oDate1 = new Date(aDate1[1] + '/' + aDate1[2] + '/' + aDate1[0])
|
||||
aDate2 = sDate2.split('-')
|
||||
oDate2 = new Date(aDate2[1] + '/' + aDate2[2] + '/' + aDate2[0])
|
||||
iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24)
|
||||
return iDays
|
||||
},
|
||||
JudgeDateTime() {
|
||||
var n = this.DateDiff(this.dateTime[0], this.dateTime[1])
|
||||
console.log(n, '时间差')
|
||||
if (n > 31) {
|
||||
this.$message.error('时间范围不得超过31天!')
|
||||
this.initialization()
|
||||
}
|
||||
},
|
||||
// 表格颜色变化
|
||||
tableRowClassName({ row, rowIndex }) {
|
||||
// console.log(row, rowIndex)
|
||||
|
||||
Reference in New Issue
Block a user