From 75d48dcb879ebe92d3e8f98ccc3730f656553df0 Mon Sep 17 00:00:00 2001
From: Vergil <974548713@qq.com>
Date: Fri, 13 Mar 2020 11:48:42 +0800
Subject: [PATCH] =?UTF-8?q?=E4=BA=BA=E5=91=98=E5=B7=A5=E6=97=B6=E7=BB=9F?=
=?UTF-8?q?=E8=AE=A1?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
.../ManHourStatistics/index.vue | 56 +++++++------------
1 file changed, 19 insertions(+), 37 deletions(-)
diff --git a/src/views/ManufacturingCenter/ManHourStatistics/index.vue b/src/views/ManufacturingCenter/ManHourStatistics/index.vue
index 22917801..de30f08f 100644
--- a/src/views/ManufacturingCenter/ManHourStatistics/index.vue
+++ b/src/views/ManufacturingCenter/ManHourStatistics/index.vue
@@ -2,20 +2,16 @@
- ~
-
+ format="yyyy-MM-dd"
+ range-separator="~"
+ start-placeholder="开始日期"
+ end-placeholder="结束日期"/>
查询
导出
@@ -23,7 +19,7 @@
-
+
{{ scope.row.姓名 }}
@@ -33,7 +29,7 @@
{{ scope.row.计划工时 }}
-
+
{{ scope.row.实际工时 }}
@@ -43,11 +39,6 @@
{{ scope.row.扫码工时 }}
-
-
- {{ scope.row.辅助工时 }}
-
-
{{ scope.row.工时比值 }}
@@ -152,6 +143,7 @@ import { searchtable, searchTable2 } from '@/api/ManufacturingCenter/ManHourStat
export default {
data() {
return {
+ dateRange: '',
workerName: '',
startTime: '',
endTime: '',
@@ -171,19 +163,14 @@ export default {
searchTable() {
this.loading = true
this.tableData = []
- if (this.startTime && this.endTime) {
- this.timeCheck = 1
- } else {
- this.startTime = ''
- this.endTime = ''
- this.timeCheck = 0
- }
+ let check1
+ this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
if (this.workerName) {
this.workerName_ckeck = 1
} else {
this.workerName_ckeck = 0
}
- searchtable(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime).then(response => {
+ searchtable(this.workerName_ckeck, this.workerName, check1, this.dateRange[0], this.dateRange[1]).then(response => {
response.data.map(v => {
this.$set(v, '工时比值', v.计划工时 === 0 ? 0 : Math.round(v.扫码工时 / v.计划工时 * 100) / 100.00)
})
@@ -194,11 +181,11 @@ export default {
// 导出
exportTable() {
import('./Export2Excel').then(excel => {
- const filterVal1 = ['姓名', '计划工时', '实际工时', '扫码工时', '辅助工时', '工时比值']
+ const filterVal1 = ['姓名', '计划工时', '实际工时', '扫码工时', '工时比值']
const data1 = this.tableData.map(v => filterVal1.map(j => v[j]))
const dataGroup = []
dataGroup.push(data1)
- const headerGroup = [['操作者', '计划工时', '实际工时', '扫码工时', '辅助工时', '工时比值']]
+ const headerGroup = [['操作员', '计划工时', '录入工时', '扫码工时', '工时比值']]
const sheetGroup = ['工时统计表']
excel.export_json_to_excel({
headerGroup: headerGroup,
@@ -214,19 +201,14 @@ export default {
this.loading2 = true
this.tableData2 = []
this.total2 = 0
- if (this.startTime && this.endTime) {
- this.timeCheck = 1
- } else {
- this.startTime = ''
- this.endTime = ''
- this.timeCheck = 0
- }
+ let check1
+ this.dateRange ? check1 = 1 : (check1 = 0, this.dateRange = '')
if (this.workerName) {
this.workerName_ckeck = 1
} else {
this.workerName_ckeck = 0
}
- searchTable2(this.workerName_ckeck, this.workerName, this.timeCheck, this.startTime, this.endTime, this.pageCurrent, this.pageSize).then(response => {
+ searchTable2(this.workerName_ckeck, this.workerName, check1, this.dateRange[0], this.dateRange[1], this.pageCurrent, this.pageSize).then(response => {
console.log(response.data)
this.total2 = response.data.length
this.tableData2 = response.data