2024-01-24 17:16:05 +08:00
|
|
|
|
<!--
|
|
|
|
|
* @Author: zhp
|
|
|
|
|
* @Date: 2024-01-24 15:15:24
|
2024-03-11 17:06:38 +08:00
|
|
|
|
* @LastEditTime: 2024-03-11 15:51:20
|
2024-01-24 17:16:05 +08:00
|
|
|
|
* @LastEditors: zhp
|
|
|
|
|
* @Description:
|
|
|
|
|
-->
|
|
|
|
|
<template>
|
|
|
|
|
<div class="app-container">
|
|
|
|
|
<div>
|
|
|
|
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
|
|
|
|
<el-form-item label="日" prop="reportTime">
|
|
|
|
|
<el-date-picker v-model="reportTime" @change="changeTime" type="date" placeholder="选择日期">
|
|
|
|
|
</el-date-picker>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
<el-form-item>
|
|
|
|
|
<el-button v-if="this.$auth.hasPermi('report:glass-month:query')" type="primary" size="small"
|
|
|
|
|
@click="getDataList">查询</el-button>
|
|
|
|
|
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
|
|
|
|
|
@click="handleExport">导出</el-button>
|
|
|
|
|
</el-form-item>
|
|
|
|
|
</el-form>
|
|
|
|
|
</div>
|
2024-03-07 16:28:23 +08:00
|
|
|
|
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all" :type="listQuery.reportType"
|
2024-01-24 17:16:05 +08:00
|
|
|
|
@refreshDataList="getDataList" />
|
|
|
|
|
<!-- <pagination
|
|
|
|
|
:limit.sync="listQuery.pageSize"
|
|
|
|
|
:page.sync="listQuery.pageNo"
|
|
|
|
|
:total="listQuery.total"
|
|
|
|
|
@pagination="getDataList" /> -->
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
import { parseTime } from '../../core/mixins/code-filter';
|
|
|
|
|
import { getGlassPage, exportGlasscExcel } from '@/api/report/glass';
|
|
|
|
|
import inputTable from './inputTable.vue';
|
|
|
|
|
import { getCorePLList } from '@/api/base/coreProductionLine';
|
|
|
|
|
import moment from 'moment'
|
|
|
|
|
|
|
|
|
|
export default {
|
|
|
|
|
components: { inputTable },
|
|
|
|
|
data() {
|
|
|
|
|
return {
|
|
|
|
|
urlOptions: {
|
|
|
|
|
getDataListURL: getGlassPage,
|
|
|
|
|
exportURL: exportGlasscExcel
|
|
|
|
|
},
|
|
|
|
|
listQuery: {
|
|
|
|
|
pageSize: 10,
|
|
|
|
|
pageNo: 1,
|
|
|
|
|
total: 0,
|
|
|
|
|
reportType: 2,
|
|
|
|
|
reportTime: []
|
2024-03-07 16:28:23 +08:00
|
|
|
|
},
|
|
|
|
|
date:'许昌安彩日原片生产汇总',
|
2024-01-24 17:16:05 +08:00
|
|
|
|
reportTime: '',
|
|
|
|
|
startTimeStamp: '',
|
|
|
|
|
endTimeStamp: '',
|
|
|
|
|
tableData: [],
|
|
|
|
|
proLineList: [],
|
|
|
|
|
all: {}
|
|
|
|
|
};
|
|
|
|
|
},
|
|
|
|
|
created() {
|
2024-03-05 09:48:16 +08:00
|
|
|
|
this.getDict()
|
|
|
|
|
this.getTodayStartTimeAndEndTime()
|
2024-03-08 16:20:03 +08:00
|
|
|
|
this.getDataList()
|
2024-01-24 17:16:05 +08:00
|
|
|
|
},
|
2024-03-05 09:48:16 +08:00
|
|
|
|
methods: {
|
|
|
|
|
getTodayStartTimeAndEndTime() {
|
|
|
|
|
this.reportTime = new Date()
|
|
|
|
|
this.changeTime(this.reportTime)
|
|
|
|
|
},
|
2024-01-24 17:16:05 +08:00
|
|
|
|
async getDict() {
|
|
|
|
|
// 产线列表
|
|
|
|
|
const res = await getCorePLList();
|
|
|
|
|
this.proLineList = res.data;
|
|
|
|
|
},
|
2024-03-07 16:28:23 +08:00
|
|
|
|
// 获取数据列表
|
|
|
|
|
multipliedByHundred(str) {
|
|
|
|
|
let floatVal = parseFloat(str);
|
|
|
|
|
if (isNaN(floatVal)) {
|
|
|
|
|
return 0;
|
|
|
|
|
}
|
|
|
|
|
floatVal = Math.round(str * 10000) / 100;
|
|
|
|
|
let strVal = floatVal.toString();
|
|
|
|
|
let searchVal = strVal.indexOf('.');
|
|
|
|
|
if (searchVal < 0) {
|
|
|
|
|
searchVal = strVal.length;
|
|
|
|
|
strVal += '.';
|
|
|
|
|
}
|
|
|
|
|
while (strVal.length <= searchVal + 2) {
|
|
|
|
|
strVal += '0';
|
|
|
|
|
}
|
|
|
|
|
return parseFloat(strVal);
|
|
|
|
|
},
|
2024-01-24 17:16:05 +08:00
|
|
|
|
async getDataList() {
|
|
|
|
|
this.dataListLoading = true;
|
|
|
|
|
await this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
|
|
|
|
this.tableData = response.data.filter(item => {
|
|
|
|
|
this.proLineList.forEach(it => {
|
|
|
|
|
if (item.lineId === it.id) {
|
2024-03-07 16:28:23 +08:00
|
|
|
|
item.lineName = it.name
|
2024-03-11 17:06:38 +08:00
|
|
|
|
item.originalGlassStatisticsTrend = item.originalGlassStatisticsTrend ? item.originalGlassStatisticsTrend + '%' : null
|
|
|
|
|
item.actualProductTrend = item.actualProductTrend ? item.actualProductTrend + '%' : null
|
|
|
|
|
item.originalGlassPassTrend = item.originalGlassPassTrend ? item.originalGlassPassTrend * 100 + '%' : null
|
2024-01-24 17:16:05 +08:00
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
if (item.det === false) {
|
|
|
|
|
this.all = {
|
|
|
|
|
id: item.id,
|
|
|
|
|
remark: item.remark
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return item.det === true
|
|
|
|
|
});
|
|
|
|
|
this.listQuery.total = response.data.length;
|
|
|
|
|
this.dataListLoading = false;
|
|
|
|
|
});
|
|
|
|
|
},
|
|
|
|
|
add0(m) {
|
|
|
|
|
return m < 10 ? '0' + m : m
|
|
|
|
|
},
|
|
|
|
|
format(shijianchuo) {
|
|
|
|
|
//shijianchuo是整数,否则要parseInt转换
|
|
|
|
|
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
|
|
|
|
|
// console.log(time)
|
|
|
|
|
// var y = time.getFullYear();
|
|
|
|
|
// var m = time.getMonth() + 1;
|
|
|
|
|
// var d = time.getDate();
|
|
|
|
|
// var h = time.getHours();
|
|
|
|
|
// var mm = time.getMinutes();
|
|
|
|
|
// var s = time.getSeconds();
|
|
|
|
|
return time
|
|
|
|
|
},
|
|
|
|
|
changeTime(val) {
|
|
|
|
|
if (val) {
|
|
|
|
|
// console.log(val)
|
|
|
|
|
// console.log(val.setHours(7, 0, 0))
|
|
|
|
|
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
|
|
|
|
|
// let time = this.format(val.setHours(7, 0, 0))
|
2024-03-11 15:47:46 +08:00
|
|
|
|
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
2024-01-24 17:16:05 +08:00
|
|
|
|
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
|
|
|
|
console.log(this.listQuery.reportTime);
|
|
|
|
|
} 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)
|
|
|
|
|
},
|
|
|
|
|
buttonClick(val) {
|
|
|
|
|
this.listQuery.reportTime = val.reportTime ? val.reportTime : undefined;
|
|
|
|
|
switch (val.btnName) {
|
|
|
|
|
case 'search':
|
|
|
|
|
this.listQuery.pageNo = 1;
|
|
|
|
|
this.listQuery.pageSize = 10;
|
|
|
|
|
this.getDataList();
|
|
|
|
|
break;
|
|
|
|
|
case 'export':
|
|
|
|
|
this.handleExport();
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
console.log(val);
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
/** 导出按钮操作 */
|
|
|
|
|
handleExport() {
|
|
|
|
|
// 处理查询参数
|
|
|
|
|
let params = { ...this.listQuery };
|
|
|
|
|
params.pageNo = undefined;
|
|
|
|
|
params.pageSize = undefined;
|
|
|
|
|
this.$modal.confirm('是否确认导出所有数据项?').then(() => {
|
|
|
|
|
this.exportLoading = true;
|
|
|
|
|
return this.urlOptions.exportURL(params);
|
|
|
|
|
}).then(response => {
|
2024-03-07 16:28:23 +08:00
|
|
|
|
this.$download.excel(response, '原片生产日报.xls');
|
2024-01-24 17:16:05 +08:00
|
|
|
|
this.exportLoading = false;
|
|
|
|
|
}).catch(() => { });
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style scoped>
|
|
|
|
|
/* .blueTip { */
|
|
|
|
|
/* padding-bottom: 10px; */
|
|
|
|
|
/* } */
|
|
|
|
|
.blueTip::before{
|
|
|
|
|
display: inline-block;
|
|
|
|
|
content: '';
|
|
|
|
|
width: 4px;
|
|
|
|
|
height: 18px;
|
|
|
|
|
background: #0B58FF;
|
|
|
|
|
border-radius: 1px;
|
|
|
|
|
margin-right: 8PX;
|
|
|
|
|
margin-top: 8px;
|
|
|
|
|
}
|
|
|
|
|
</style>
|