生产数据汇总表

This commit is contained in:
helloDy 2024-04-23 17:23:54 +08:00
parent 16186667da
commit c6d504583b
10 changed files with 627 additions and 108 deletions

View File

@ -0,0 +1,141 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-23 17:06:16
* @LastEditors: DY
* @Description:
-->
<template>
<div class="weekly">
<el-form :inline="true" :model="listQuery" class="blueTip">
<el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
查询
</el-button>
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
<proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" />
</div>
</template>
<script>
import monthWeek from '../glass/month.vue'
import proMonth from '../productionMonthReport/index.vue'
import { parseTime } from '../../core/mixins/code-filter';
export default {
components: { monthWeek, proMonth },
data() {
return {
listQuery: {
// pageSize: 10,
// pageNo: 1,
// total: 0,
reportType: 4,
reportTime: []
},
startTimeStamp: '',
endTimeStamp: '',
reportTime: '',
glassWeekShow: false,
proWeekShow: false
}
},
created() {
this.getCurrentMonthFirst()
this.glassWeekShow = true
this.proWeekShow = true
},
methods: {
getCurrentMonthFirst() {
const date = new Date();
date.setDate(1);
this.reportTime = date
// console.log(date)
this.changeTime(date)
// console.log(date.valueOf());
},
handleExport() {
this.$nextTick(() => {
this.$refs['monthWeek'].handleExport()
this.$refs['proMonth'].handleExport()
})
},
search() {
this.$nextTick(() => {
this.$refs['monthWeek'].getDataList()
this.$refs['proMonth'].getDataList()
})
},
changeTime(val) {
console.log(val)
if(val) {
const timeStamp = val.getMonth(); //
const fullyear = val.getFullYear()
let days = 0
switch (timeStamp) {
case 0:
case 2:
case 4:
case 6:
case 7:
case 9:
case 11:
days = 31
break
case 3:
case 4:
case 8:
case 10:
days = 30
break
case 1:
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
days = 29
} else {
days = 28
}
break
}
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.listQuery.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.listQuery.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)
}
}
}
</script>
<style scoped>
.weekly {
padding-top: 16px;
}
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
margin-left: 16px;
}
</style>

View File

@ -0,0 +1,171 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-23 15:43:36
* @LastEditors: DY
* @Description:
-->
<template>
<div class="weekly">
<el-form :inline="true" :model="listQuery" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
查询
</el-button>
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<glassWeek v-if="glassWeekShow" ref="glassWeek" :product="false" :params="listQuery" />
<proWeek v-if="proWeekShow" ref="proWeek" :product="false" :params="listQuery" />
</div>
</template>
<script>
import glassWeek from '../glass/weekly.vue'
import proWeek from '../productionWeekReport/index.vue'
import { parseTime } from '../../core/mixins/code-filter';
export default {
components: { glassWeek, proWeek },
data() {
return {
listQuery: {
// pageSize: 10,
// pageNo: 1,
// total: 0,
reportType: 3,
reportTime: []
},
startTimeStamp: '',
endTimeStamp: '',
reportTime: '',
glassWeekShow: false,
proWeekShow: false
}
},
created() {
this.getCurrentWeekStartTimeAndEndTime()
this.glassWeekShow = true
this.proWeekShow = true
},
methods: {
handleExport() {
this.$nextTick(() => {
this.$refs['glassWeek'].handleExport()
this.$refs['proWeek'].handleExport()
})
},
search() {
this.$nextTick(() => {
this.$refs['glassWeek'].getDataList()
this.$refs['proWeek'].getDataList()
})
},
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.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
} else {
this.listQuery.reportTime = []
}
},
getCurrentWeekStartTimeAndEndTime() {
this.reportTime = new Date()
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)
}
},
//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)
}
}
}
</script>
<style scoped>
.weekly {
padding-top: 16px;
}
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
margin-left: 16px;
}
</style>

View File

@ -0,0 +1,117 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-23 17:16:11
* @LastEditors: DY
* @Description:
-->
<template>
<div class="weekly">
<el-form :inline="true" :model="listQuery" class="blueTip">
<el-form-item label="年" prop="reportTime">
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
查询
</el-button>
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<glassYear v-if="glassYearShow" ref="glassYear" :product="false" :params="listQuery" />
<proYear v-if="proYearShow" ref="proYear" :product="false" :params="listQuery" />
</div>
</template>
<script>
import glassYear from '../glass/year.vue'
import proYear from '../productionYearReport/index.vue'
import { parseTime } from '../../core/mixins/code-filter';
export default {
components: { glassYear, proYear },
data() {
return {
listQuery: {
// pageSize: 10,
// pageNo: 1,
// total: 0,
reportType: 5,
reportTime: []
},
startTimeStamp: '',
endTimeStamp: '',
reportTime: '',
glassYearShow: false,
proYearShow: false
}
},
created() {
this.getCurrentYearFirst()
this.glassYearShow = true
this.proYearShow = true
},
methods: {
handleExport() {
this.$nextTick(() => {
this.$refs['glassYear'].handleExport()
this.$refs['proYear'].handleExport()
})
},
search() {
this.$nextTick(() => {
this.$refs['glassYear'].getDataList()
this.$refs['proYear'].getDataList()
})
},
changeTime(val) {
if(val) {
// let timeStamp = val.getTime(); //
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(),11, 31, 7, 0, 0).getTime()); //
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //
this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.listQuery.reportTime = []
}
},
getCurrentYearFirst() {
let date = new Date();
date.setDate(1);
date.setMonth(0);
this.reportTime = date;
this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1,7,0,1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //
this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
},
//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)
},
}
}
</script>
<style scoped>
.weekly {
padding-top: 16px;
}
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
margin-left: 16px;
}
</style>

View File

@ -1,13 +1,13 @@
<!-- <!--
* @Author: Do not edit * @Author: Do not edit
* @Date: 2023-12-13 14:10:04 * @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-04-12 14:21:34 * @LastEditTime: 2024-04-23 16:47:21
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div> <div>
<el-row style="float: right; margin-bottom: 5px"> <el-row v-if="isShowEdit" style="float: right; margin-bottom: 5px">
<el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData" <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
size="small" @click="edit = true">编辑</el-button> size="small" @click="edit = true">编辑</el-button>
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
@ -152,6 +152,10 @@ const cols = [
type: { type: {
type: Number, type: Number,
default: 3, default: 3,
},
isShowEdit: {
type: Boolean,
default: true
} }
}, },
data() { data() {
@ -174,8 +178,9 @@ const cols = [
}, },
time: { time: {
immediate: true, immediate: true,
deep: true,
handler(newv, oldv) { handler(newv, oldv) {
if (newv[0] !== '') { if (newv[0] !== '' && newv[0] !== undefined) {
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')' this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
} else { } else {
this.cols[0].label = this.date this.cols[0].label = this.date

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <div v-if="product">
<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="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
@ -14,7 +14,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
:type="listQuery.reportType" @refreshDataList="getDataList" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
<!-- <pagination <!-- <pagination
:limit.sync="listQuery.pageSize" :limit.sync="listQuery.pageSize"
@ -33,6 +33,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -40,9 +50,6 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
reportType: 4, reportType: 4,
reportTime: [] reportTime: []
}, },
@ -101,6 +108,9 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -4,7 +4,7 @@
:formConfigs="formConfig" :formConfigs="formConfig"
ref="searchBarForm" ref="searchBarForm"
@headBtnClick="buttonClick" /> --> @headBtnClick="buttonClick" /> -->
<div> <div v-if="product">
<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"
@ -21,7 +21,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
:type="listQuery.reportType" @refreshDataList="getDataList" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -35,6 +35,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -42,9 +52,6 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
reportType: 3, reportType: 3,
reportTime: [] reportTime: []
}, },
@ -89,11 +96,12 @@ export default {
}, },
created () { created () {
// this.getDict() // this.getDict()
this.getCurrentWeekStartTimeAndEndTime()
}, },
mounted() { mounted() {
// const day = new Date().getDay() // const day = new Date().getDay()
// console.log('', day) // console.log('', day)
this.getCurrentWeekStartTimeAndEndTime() // this.getCurrentWeekStartTimeAndEndTime()
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000)) // this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
this.getDataList() this.getDataList()
}, },
@ -190,6 +198,10 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
// this.$set(this.listQuery, 'reportTime', this.params.reportTime)
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="app-container"> <div class="app-container">
<div> <div v-if="product">
<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="year" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
@ -16,7 +16,7 @@
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" <inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
:type="listQuery.reportType" @refreshDataList="getDataList" /> :type="listQuery.reportType" @refreshDataList="getDataList" />
</div> </div>
</template> </template>
@ -30,6 +30,16 @@ import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx' // import * as XLSX from 'xlsx'
export default { export default {
components: { inputTable }, components: { inputTable },
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
urlOptions: { urlOptions: {
@ -37,9 +47,9 @@ export default {
exportURL: exportGlasscExcel exportURL: exportGlasscExcel
}, },
listQuery: { listQuery: {
pageSize: 10, // pageSize: 10,
pageNo: 1, // pageNo: 1,
total: 0, // total: 0,
reportType: 5, reportType: 5,
reportTime: [] reportTime: []
}, },
@ -54,11 +64,10 @@ export default {
}, },
created() { created() {
// this.getDict() // this.getDict()
this.getCurrentYearFirst()
}, },
mounted () { mounted () {
this.getCurrentYearFirst() this.getDataList();
this.getDataList()
;
}, },
methods: { methods: {
getCurrentYearFirst() { getCurrentYearFirst() {
@ -101,6 +110,9 @@ export default {
const res = await getCorePLList() const res = await getCorePLList()
this.proLineList = res.data; this.proLineList = res.data;
this.dataListLoading = true; this.dataListLoading = true;
if (this?.params) {
this.listQuery = {...this.params}
}
if (this.listQuery.reportTime.length == 0) { if (this.listQuery.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,12 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:46 * @LastEditTime: 2024-04-23 16:58:06
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item label="月" prop="reportTime"> <el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月"> <el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
@ -24,6 +25,7 @@
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -286,6 +288,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -653,6 +665,10 @@ export default {
} }
}, },
async getDataList() { async getDataList() {
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
if (this.monthValue.length > 0) { if (this.monthValue.length > 0) {
console.log(this.monthValue) console.log(this.monthValue)
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01' this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
@ -664,6 +680,7 @@ export default {
// this.$modal.msgError('') // this.$modal.msgError('')
// return false // return false
} }
}
if (this.dataForm.reportTime.length == 0) { if (this.dataForm.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,12 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:51 * @LastEditTime: 2024-04-23 16:58:12
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item> <el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
@ -26,6 +27,7 @@
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -292,6 +294,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -622,12 +634,17 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}, },
async getDataList() { async getDataList() {
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
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'
// this.queryParams.startTime = this.monthValue[0] // this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00' this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
} else { } else {
} }
}
if (this.dataForm.reportTime.length == 0) { if (this.dataForm.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',

View File

@ -1,12 +1,13 @@
<!-- <!--
* @Author: zhp * @Author: zhp
* @Date: 2023-12-12 13:45:25 * @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:54 * @LastEditTime: 2024-04-23 17:21:04
* @LastEditors: zhp * @LastEditors: DY
* @Description: * @Description:
--> -->
<template> <template>
<div class="app-container"> <div class="app-container">
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip"> <el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item> <el-form-item>
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime" <el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
@ -28,6 +29,7 @@
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button> <el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button> <el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row> </el-row>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{ <el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9', background: '#F2F4F9',
color: '#606266' color: '#606266'
@ -294,6 +296,16 @@ export default {
// DialogForm, // DialogForm,
// }, // },
// mixins: [basicPageMixin], // mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() { data() {
return { return {
list: [], list: [],
@ -556,6 +568,10 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length) return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}, },
async getDataList() { async getDataList() {
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD') this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
console.log(this.yearValue1); console.log(this.yearValue1);
if (this.yearValue1 && this.yearValue2) { if (this.yearValue1 && this.yearValue2) {
@ -567,6 +583,7 @@ export default {
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2) // this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
} }
} }
}
if (this.dataForm.reportTime.length == 0) { if (this.dataForm.reportTime.length == 0) {
this.$message({ this.$message({
message: '请选择时间', message: '请选择时间',