人员公示统计

This commit is contained in:
Vergil
2020-04-01 16:23:36 +08:00
parent 0296ff52f6
commit 127983bf9d
3 changed files with 50 additions and 11 deletions

View File

@@ -71,6 +71,51 @@ export function getNowTime1() {
const time = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second const time = date.getFullYear() + '-' + month + '-' + day + ' ' + hour + ':' + minute + ':' + second
return time return time
} }
// 工时统计上个月26-本月25
export function getTime26() {
const date = new Date()
const day = date.getDate()
if (day >= 25) {
var month = zeroFill(date.getMonth() + 1)
if (month === 0) {
month = 12
const day = 26
const time = date.getFullYear() - 1 + '-' + month + '-' + day
return time
} else {
const day = 26
const time = date.getFullYear() + '-' + month + '-' + day
return time
}
} else {
var month2 = zeroFill(date.getMonth() + 1) - 1
if (month2 === 0) {
month2 = 12
const day = 26
const time = date.getFullYear() - 1 + '-' + month2 + '-' + day
return time
} else {
const day = 26
const time = date.getFullYear() + '-' + month2 + '-' + day
return time
}
}
}
export function getTime25() {
const date = new Date()
const day = date.getDate()
if (day >= 25) {
const month = zeroFill(date.getMonth() + 2)
const day2 = 25
const time = date.getFullYear() + '-' + month + '-' + day2
return time
} else {
const month = zeroFill(date.getMonth() + 1)
const day2 = 25
const time = date.getFullYear() + '-' + month + '-' + day2
return time
}
}
// 判断类型 // 判断类型
export function type(target) { export function type(target) {
const ret = typeof (target) const ret = typeof (target)

View File

@@ -139,11 +139,12 @@
</template> </template>
<script> <script>
import { searchtable, searchTable2 } from '@/api/ManufacturingCenter/ManHourStatistics' import { searchtable, searchTable2 } from '@/api/ManufacturingCenter/ManHourStatistics'
import { getTime25, getTime26 } from '@/utils/tool'
export default { export default {
data() { data() {
return { return {
dateRange: '', dateRange: [],
workerName: '', workerName: '',
startTime: '', startTime: '',
endTime: '', endTime: '',
@@ -156,6 +157,8 @@ export default {
} }
}, },
created() { created() {
this.dateRange[0] = getTime26()
this.dateRange[1] = getTime25()
this.searchTable() this.searchTable()
}, },
methods: { methods: {

View File

@@ -32,16 +32,7 @@
</div> </div>
</div> </div>
<el-card> <el-card>
<el-table <el-table v-loading="loading" :data="tableData" :row-class-name="tableRowClassName" height="570" style="width: 1000px; margin: 3px 0" size="mini" border highlight-current-row element-loading-text="拼命加载中">
v-loading="loading"
:data="tableData"
:row-class-name="tableRowClassName"
height="570"
style="width: 1000px; margin: 3px 0"
size="mini"
border
highlight-current-row
element-loading-text="拼命加载中">
<el-table-column label="机床图号" prop="机床图号" align="center" width="140px" show-overflow-tooltip> <el-table-column label="机床图号" prop="机床图号" align="center" width="140px" show-overflow-tooltip>
<template slot-scope="scope"> <template slot-scope="scope">
{{ scope.row.机床图号 }} {{ scope.row.机床图号 }}