Merge pull request 'projects/mesxc-zhp' (#237) from projects/mesxc-zhp into projects/mesxc-test

Reviewed-on: #237
This commit is contained in:
朱菊兰 2024-03-11 17:10:16 +08:00
commit b23d7427bd
9 changed files with 192 additions and 59 deletions

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2024-01-24 15:15:24 * @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-03-11 08:59:40 * @LastEditTime: 2024-03-11 15:51:20
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -102,9 +102,9 @@ export default {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
item.lineName = it.name item.lineName = it.name
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null
item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null
} }
}) })
if (item.det === false) { if (item.det === false) {

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-12-13 14:10:04 * @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-03-11 14:21:40 * @LastEditTime: 2024-03-11 16:10:25
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->

View File

@ -81,9 +81,9 @@ export default {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
item.lineName = it.name item.lineName = it.name
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null
item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null
} }
}) })
if (item.det === false) { if (item.det === false) {

View File

@ -8,7 +8,7 @@
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> <el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="周" prop="reportTime"> <el-form-item label="周" prop="reportTime">
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :picker-options="{firstDayOfWeek: 4}"
:format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp" style="width: 350px" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp" style="width: 350px"
placeholder="选择周"> placeholder="选择周">
</el-date-picker> </el-date-picker>
@ -104,7 +104,65 @@ export default {
}, },
getCurrentWeekStartTimeAndEndTime() { getCurrentWeekStartTimeAndEndTime() {
this.reportTime = new Date() this.reportTime = new Date()
this.changeTime(this.reportTime) var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
// console.log(weekday[this.reportTime.getDay()]);
if (weekday[this.reportTime.getDay()] === 'Monday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime())
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
}, },
// //
async getDataList() { async getDataList() {
@ -114,9 +172,9 @@ export default {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
item.lineName = it.name item.lineName = it.name
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null
item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null
} }
}) })
if (item.det === false) { if (item.det === false) {
@ -136,10 +194,10 @@ export default {
if(val) { if(val) {
let timeStamp = val.getTime(); // let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); // this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); // this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp) console.log(this.startTimeStamp, this.endTimeStamp)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000 this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:01').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000 this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else { } else {
this.listQuery.reportTime = [] this.listQuery.reportTime = []
} }

View File

@ -82,9 +82,9 @@ export default {
this.tableData = response.data.filter(item => { this.tableData = response.data.filter(item => {
this.proLineList.forEach(it => { this.proLineList.forEach(it => {
if (item.lineId === it.id) { if (item.lineId === it.id) {
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? this.multipliedByHundred(item.originalGlassStatisticsTrend) + '%' : null item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null
item.actualProductTrend = item.actualProductTrend ? this.multipliedByHundred(item.actualProductTrend) + '%' : null item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null
item.originalGlassPassTrend = item.originalGlassPassTrend ? this.multipliedByHundred(item.originalGlassPassTrend) * 100 + '%' : null item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null
item.lineName = it.name item.lineName = it.name
} }
}) })

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-11 15:29:49 * @LastEditTime: 2024-03-11 16:13:38
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -47,7 +47,7 @@
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span> <span v-else>{{ scope.row.inputTrend ? scope.row.inputTrend + '%' : undefined}} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -70,7 +70,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span> <span v-else>{{ scope.row.goodProductTrend ? scope.row.goodProductTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -91,7 +91,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span> <span v-else>{{ scope.row.missCheckTrend ? scope.row.missCheckTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -114,7 +114,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span> <span v-else>{{ scope.row.goodProductPassTrend ? scope.row.goodProductPassTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-11 15:46:20 * @LastEditTime: 2024-03-11 16:16:31
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -49,7 +49,7 @@
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend }} </span> <span v-else>{{ scope.row.inputTrend ? scope.row.inputTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -72,7 +72,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend }} </span> <span v-else>{{ scope.row.goodProductTrend ? scope.row.goodProductTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -93,7 +93,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend }} </span> <span v-else>{{ scope.row.missCheckTrend ? scope.row.missCheckTrend +'%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -116,7 +116,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend }} </span> <span v-else>{{ scope.row.goodProductPassTrend ? scope.row.goodProductPassTrend + '%' :undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-11 15:36:25 * @LastEditTime: 2024-03-11 17:05:50
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -9,11 +9,9 @@
<div class="app-container"> <div class="app-container">
<el-form :inline="true" :model="dataForm" class="demo-form-inline"> <el-form :inline="true" :model="dataForm" class="demo-form-inline">
<el-form-item> <el-form-item>
<el-date-picker v-model="weekValue1" type="week" format="yyyy 第 WW 周" style='width:170px;' <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="pickerOptionsWeek" @change="startWeek" :clearable="false" size="small" placeholder="选择周"> :picker-options="{firstDayOfWeek: 5}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
</el-date-picker>- style="width: 350px" placeholder="选择周">
<el-date-picker v-model="weekValue2" type="week" format="yyyy 第 WW 周" :picker-options="pickerOptionsWeek"
style='width:170px;' @change="endWeek" :clearable="false" size="small" placeholder="选择周">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button> <el-button type="primary" @click="getDataList()">查询</el-button>
@ -52,7 +50,7 @@
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend + '%' }} </span> <span v-else>{{ scope.row.inputTrend ? scope.row.inputTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -75,7 +73,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend + '%' }} </span> <span v-else>{{ scope.row.goodProductTrend ? scope.row.goodProductTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -96,7 +94,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend + '%' }} </span> <span v-else>{{ scope.row.missCheckTrend ? scope.row.missCheckTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -119,7 +117,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend + '%' }} </span> <span v-else>{{ scope.row.goodProductPassTrend ? scope.row.goodProductPassTrend + '%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -158,6 +157,7 @@ import {
import moment from 'moment'; import moment from 'moment';
// import DialogForm from './dialogForm.vue'; // import DialogForm from './dialogForm.vue';
import { getCorePLList } from '@/api/base/coreProductionLine' import { getCorePLList } from '@/api/base/coreProductionLine'
import { parseTime } from '../../core/mixins/code-filter';
// import basicPageMixin from '@/mixins/lb/basicPageMixin'; // import basicPageMixin from '@/mixins/lb/basicPageMixin';
const tableProps = [ const tableProps = [
@ -262,7 +262,9 @@ export default {
urlOptions: { urlOptions: {
exportURL: exportProductExcel exportURL: exportProductExcel
}, },
timeTips:'', timeTips: '',
startTimeStamp: '',
endTimeStamp: '',
// dataForm: { // dataForm: {
// reportTime:undefined // reportTime:undefined
// }, // },
@ -328,6 +330,7 @@ export default {
// color: 'success', // color: 'success',
// }, // },
], ],
reportTime:'',
pickerOptionsWeek: { pickerOptionsWeek: {
disabledDate(time) { disabledDate(time) {
let day = Date.now() let day = Date.now()
@ -376,19 +379,66 @@ export default {
this.proLineList = res.data; this.proLineList = res.data;
}, },
getCurrentWeekStartTimeAndEndTime() { getCurrentWeekStartTimeAndEndTime() {
const current = new Date(); this.reportTime = new Date()
// current var weekday = new Array(7);
let nowDayOfWeek = current.getDay(); weekday[0] = "Sunday";
if (nowDayOfWeek === 0) nowDayOfWeek = 7; weekday[1] = "Monday";
const dayNum = 1 * 24 * 60 * 60 * 1000; weekday[2] = "Tuesday";
// weekday[3] = "Wednesday";
const firstDate = new Date(current.valueOf() - (nowDayOfWeek - 1) * dayNum); weekday[4] = "Thursday";
// weekday[5] = "Friday";
const lastDate = new Date(new Date(firstDate).valueOf() + 6 * dayNum); weekday[6] = "Saturday";
// return { // console.log(weekday[this.reportTime.getDay()]);
this.weekValue1 = new Date(firstDate) if (weekday[this.reportTime.getDay()] === 'Monday') {
this.weekValue2 = new Date(lastDate) this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
// }; this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime())
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
}, },
handleExport() { handleExport() {
// //
@ -465,6 +515,28 @@ export default {
this.$modal.msgError('更新失败'); this.$modal.msgError('更新失败');
} }
}, },
changeTime(val) {
console.log(val);
if (val) {
let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.dataForm.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.dataForm.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.dataForm.reportTime = []
}
},
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
async getDataList() { async getDataList() {
if (this.weekValue1 && this.weekValue2) { if (this.weekValue1 && this.weekValue2) {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01' this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'

View File

@ -1,7 +1,7 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-11 15:42:42 * @LastEditTime: 2024-03-11 16:18:07
* @LastEditors: zhp * @LastEditors: zhp
* @Description: * @Description:
--> -->
@ -52,7 +52,7 @@
<el-table-column prop="inputTrend" label="增减" align="center"> <el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input> <el-input v-if="!disabled" v-model="scope.row.inputTrend" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputTrend + '%' }} </span> <span v-else>{{ scope.row.inputTrend ? scope.row.inputTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -75,7 +75,7 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductTrend + '%' }} </span> <span v-else>{{ scope.row.goodProductTrend ? scope.row.goodProductTrend + '%' : undefined }} </span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -96,7 +96,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.missCheckTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.missCheckTrend + '%' }} </span> <span v-else>{{ scope.row.missCheckTrend ? scope.row.missCheckTrend + '%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>
@ -119,7 +120,8 @@
<template slot-scope="scope"> <template slot-scope="scope">
<el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled"> <el-input v-if="!disabled" v-model="scope.row.goodProductPassTrend" :disabled="disabled">
</el-input> </el-input>
<span v-else>{{ scope.row.goodProductPassTrend + '%' }} </span> <span v-else>{{ scope.row.goodProductPassTrend ? scope.row.goodProductPassTrend + '%' : undefined }}
</span>
</template> </template>
</el-table-column> </el-table-column>
</el-table-column> </el-table-column>