@@ -1,9 +1,8 @@ | |||
### | |||
# @Author: zhp | |||
# @Date: 2024-04-12 14:30:48 | |||
# @LastEditTime: 2024-04-22 15:20:42 | |||
# @LastEditTime: 2024-04-23 17:25:25 | |||
# @LastEditors: DY | |||
# @Description: | |||
### | |||
# 开发环境配置 | |||
@@ -14,9 +13,9 @@ VUE_APP_TITLE = MES系统 | |||
# 芋道管理系统/开发环境 | |||
VUE_APP_BASE_API = 'http://192.168.0.33:48082' | |||
# VUE_APP_BASE_API = 'http://192.168.1.104:48082' | |||
# VUE_APP_BASE_API = 'http://192.168.4.176:48082' | |||
# 积木报表指向地址 | |||
VUE_APP_JIMU_API = 'http://192.168.0.33:48082' | |||
VUE_APP_JIMU_API = 'http://192.168.1.101:48082' | |||
# socket地址(现场) | |||
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080' | |||
@@ -0,0 +1,45 @@ | |||
import request from '@/utils/request' | |||
// 原片工段数据 | |||
export function originalSection(data) { | |||
return request({ | |||
url: '/extend/customized-reports/originalSection', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// 原片产线数据 | |||
export function getOriginalLine(query) { | |||
return request({ | |||
url: '/extend/customized-reports/getOriginalLine', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 深加工产线数据 | |||
export function getProcessingLine(query) { | |||
return request({ | |||
url: '/extend/customized-reports/getProcessingLine', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
// 深加工工段数据 | |||
export function processing(data) { | |||
return request({ | |||
url: '/extend/customized-reports/processing', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
// isra数据记录 | |||
export function israData(data) { | |||
return request({ | |||
url: '/extend/customized-reports/isra', | |||
method: 'post', | |||
data: data | |||
}) | |||
} |
@@ -1,7 +1,7 @@ | |||
/* | |||
* @Author: zhp | |||
* @Date: 2024-04-18 09:27:54 | |||
* @LastEditTime: 2024-04-19 16:12:49 | |||
* @LastEditTime: 2024-04-23 15:16:12 | |||
* @LastEditors: zhp | |||
* @Description: | |||
*/ | |||
@@ -42,6 +42,54 @@ export function getAutoDailyData(data) { | |||
export function getQualityRecordReport(data) { | |||
return request({ | |||
url: 'base/quality-inspection-record/qualityRecordReport', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
export function getProductChildData(data) { | |||
return request({ | |||
url: 'base/report-auto-ydaily-det/list', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
export function updateAutoDailyData(data) { | |||
return request({ | |||
url: 'base/report-auto-daily/update', | |||
method: 'put', | |||
data: data | |||
}) | |||
} | |||
export function getCWSectionList(query) { | |||
return request({ | |||
url: 'base/core-production-line/listAll', | |||
method: 'get', | |||
params: query | |||
}) | |||
} | |||
export function getCuttingReportDataList(data) { | |||
return request({ | |||
url: 'extend/customized-reports/cuttingReport', | |||
method: 'post', | |||
data: data | |||
}) | |||
} | |||
export function getProcessingLineDataList(data) { | |||
return request({ | |||
url: 'extend/customized-reports/getProcessingLine', | |||
method: 'get', | |||
data: data | |||
}) | |||
} | |||
export function getOriginalLineDataList(data) { | |||
return request({ | |||
url: 'extend/customized-reports/getOriginalLine', | |||
method: 'get', | |||
data: data | |||
}) | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-01-29 16:50:26 | |||
* @LastEditTime: 2024-04-19 16:06:21 | |||
* @LastEditTime: 2024-04-22 09:42:45 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -34,7 +34,7 @@ | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8"> | |||
<base-container :no-content-padding="true" :title="'产量及良率统计'" :size="'small'" | |||
<base-container :show-time="true" :no-content-padding="true" :title="'产量及良率统计'" :size="'small'" | |||
:title-icon="'energyMonitoring'"> | |||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;"> | |||
<top-radio-group /> | |||
@@ -53,7 +53,8 @@ | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8"> | |||
<base-container :no-content-padding="true" :title="'ISRA 缺陷数据'" :size="'small'" :title-icon="'scrap'"> | |||
<base-container :show-time="true" :no-content-padding="true" :title="'ISRA 缺陷数据'" :size="'small'" | |||
:title-icon="'scrap'"> | |||
<!-- <base-table1 :page="1" :limit="999" :show-index="false" :table-config="ISRATableProps" | |||
:table-data="ISRAList" /> --> | |||
<ISRAChart ref="ISRAChart" /> | |||
@@ -64,8 +65,8 @@ | |||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="10" type="flex" class="flex-1"> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12"> | |||
<base-container :no-content-padding="true" :height="256" :title="'废片 缺陷数据'" :size="'eqStatus'" | |||
:title-icon="'scrap'"> | |||
<base-container :show-time="true" :no-content-padding="true" :height="256" :title="'废片 缺陷数据'" | |||
:size="'eqStatus'" :title-icon="'scrap'"> | |||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;"> | |||
<top-radio-group /> | |||
</div> --> | |||
@@ -98,7 +99,8 @@ | |||
</base-container> | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="14"> | |||
<base-container :height="318 + 338 + 16" :size="'eqStatus'" :title="'设备状态监控'" :title-icon="'eqMonitoring'"> | |||
<base-container :show-time="false" :height="318 + 338 + 16" :size="'eqStatus'" :title="'设备状态监控'" | |||
:title-icon="'eqMonitoring'"> | |||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;"> | |||
<top-radio-group /> | |||
</div> --> | |||
@@ -652,7 +654,7 @@ export default { | |||
wasteList.push(ele.wastArea) | |||
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡') | |||
sumAreaList.push(ele.sumArea) | |||
yieldList.push(parseFloat((ele.yield * 100).toFixed(0))) | |||
yieldList.push(parseFloat((ele.yield * 100).toFixed(2))) | |||
}) | |||
this.$nextTick(() => { | |||
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]]) | |||
@@ -170,11 +170,11 @@ export default { | |||
}, | |||
formatter: (params) => { | |||
//调用自定义显示格式 | |||
return this.getEqualNewlineString(params.value + " | " + params.percent.toFixed(0) + "%" + "\n" + params.name,10); | |||
return this.getEqualNewlineString(params.value + " | " + params.percent.toFixed(0) + "%"); | |||
}, | |||
textStyle: { // 提示文字的样式 | |||
// color: '#595959', | |||
fontSize: 18 | |||
fontSize: 16 | |||
} | |||
} | |||
}, | |||
@@ -2,7 +2,7 @@ | |||
* @Author: gtz | |||
* @Date: 2022-01-19 15:58:17 | |||
* @LastEditors: zhp | |||
* @LastEditTime: 2024-03-29 14:47:29 | |||
* @LastEditTime: 2024-04-22 09:41:21 | |||
* @Description: file content | |||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue | |||
--> | |||
@@ -30,7 +30,7 @@ | |||
<!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;"> | |||
{{ time2 +'-'+ time }} | |||
</span> --> | |||
<span style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;"> | |||
<span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;"> | |||
{{ startTime + '-' + endTime }} | |||
</span> | |||
</div> | |||
@@ -56,6 +56,10 @@ export default { | |||
type: Boolean, | |||
default: true | |||
}, | |||
showTime: { | |||
type: Boolean, | |||
default: true | |||
}, | |||
noPadding: { | |||
type: Boolean, | |||
default: false | |||
@@ -2,7 +2,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2023-09-21 09:06:28 | |||
* @LastEditTime: 2024-04-16 13:39:25 | |||
* @LastEditTime: 2024-04-23 15:34:56 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -83,6 +83,9 @@ export default { | |||
this.chart = null | |||
}, | |||
methods: { | |||
// getNumLength(num) { | |||
// return num.toString().length; | |||
// }, | |||
initChart(nameList, passRateList, outputNumList) { | |||
console.log(nameList, passRateList) | |||
let series= [ | |||
@@ -97,7 +100,7 @@ export default { | |||
{ offset: 0.3, color: '#1295FF' } | |||
]), | |||
label: { | |||
show: true, //开启显示 | |||
show: false, //开启显示 | |||
position: 'top', //在上方显示 | |||
textStyle: { //数值样式 | |||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色 | |||
@@ -218,11 +221,10 @@ export default { | |||
// }, | |||
yAxis: [ | |||
{ | |||
min: function() { // 取最小值向下取整为最小刻度 | |||
min: function () { // 取最小值向下取整为最小刻度 | |||
return 0 | |||
}, | |||
max: function(value) { // 取最大值向上取整为最大刻度 | |||
return Math.ceil(value.max) | |||
max: function (value) { // 取最大值向上取整为最大刻度 | |||
}, | |||
scale: true, | |||
type: 'value', | |||
@@ -266,12 +268,17 @@ export default { | |||
// }, | |||
}, | |||
{ | |||
min: function() { // 取最小值向下取整为最小刻度 | |||
min: function () { // 取最小值向下取整为最小刻度 | |||
return 0 | |||
}, | |||
max: function(value) { // 取最大值向上取整为最大刻度 | |||
return Math.ceil(value.max) | |||
max: function (value) { // 取最大值向上取整为最大刻度 | |||
// console.log(value.max.toString().length) | |||
// String(value.max)[0] | |||
// for | |||
// return String(value.max)[0] + | |||
}, | |||
minInterval: 5,//间隔 | |||
scale: true, | |||
type: 'value', | |||
name: '产量/㎡', // y轴上方的单位 | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2023-09-21 09:06:28 | |||
* @LastEditTime: 2024-04-16 13:37:38 | |||
* @LastEditTime: 2024-04-23 15:36:35 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -217,12 +217,11 @@ export default { | |||
// }, | |||
yAxis: [ | |||
{ | |||
// min: function() { // 取最小值向下取整为最小刻度 | |||
// return 0 | |||
// }, | |||
// max: function(value) { // 取最大值向上取整为最大刻度 | |||
// return Math.ceil(value.max) | |||
// }, | |||
min: function () { // 取最小值向下取整为最小刻度 | |||
return 0 | |||
}, | |||
max: function (value) { // 取最大值向上取整为最大刻度 | |||
}, | |||
scale: true, | |||
type: 'value', | |||
name: '良品率/%', | |||
@@ -265,12 +264,17 @@ export default { | |||
// }, | |||
}, | |||
{ | |||
// min: function() { // 取最小值向下取整为最小刻度 | |||
// return 0 | |||
// }, | |||
// max: function(value) { // 取最大值向上取整为最大刻度 | |||
// return Math.ceil(value.max) | |||
// }, | |||
min: function () { // 取最小值向下取整为最小刻度 | |||
return 0 | |||
}, | |||
max: function (value) { // 取最大值向上取整为最大刻度 | |||
// console.log(value.max.toString().length) | |||
// String(value.max)[0] | |||
// for | |||
// return String(value.max)[0] + | |||
}, | |||
minInterval: 5,//间隔 | |||
scale: true, | |||
type: 'value', | |||
name: '产量/片', // y轴上方的单位 | |||
@@ -2,7 +2,7 @@ | |||
* @Author: zwq | |||
* @Date: 2021-07-19 15:18:30 | |||
* @LastEditors: zhp | |||
* @LastEditTime: 2024-04-18 08:42:00 | |||
* @LastEditTime: 2024-04-22 12:15:49 | |||
* @Description: | |||
--> | |||
<template> | |||
@@ -25,19 +25,19 @@ | |||
<el-row class="container-main flex-col" type="flex"> | |||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="15" type="flex" class="flex-1" style="height: 50%"> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%"> | |||
<base-container :title="'设备报警'" :size="'small'" :height="318" :title-icon="'eqAlarm'"> | |||
<base-container :show-time="true" :title="'设备报警'" :size="'small'" :height="318" :title-icon="'eqAlarm'"> | |||
<dv-scroll-board class="eqTable" :config="eqConfig" style="width: 100%; height: 350px" | |||
ref="eqScrollBoard" /> | |||
</base-container> | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%"> | |||
<base-container :title="'各工序缺陷汇总'" :size="'small'" :title-icon="'scrap'"> | |||
<base-container :show-time="true" :title="'各工序缺陷汇总'" :size="'small'" :title-icon="'scrap'"> | |||
<dv-scroll-board :config="processConfig" style="width: 100%; height: 350px" ref="processScrollBoard" /> | |||
</base-container> | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%"> | |||
<base-container :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'"> | |||
<base-container :show-time="true" :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'"> | |||
<div class="order" style="width: 100%; overflow: hidden scroll; height: 350px"> | |||
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;"> | |||
<!-- <el-col :span="12"> --> | |||
@@ -52,8 +52,7 @@ | |||
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{ | |||
op.planQuantity }}</span> | |||
</span> | |||
<span v-if="op.actualQuantity" class="orderFinish" | |||
style="font-size: 14px;margin-left: 130px;">{{ | |||
<span v-if="op.actualQuantity" class="orderFinish" style="font-size: 14px;margin-left: 130px;">{{ | |||
op.actualQuantity | |||
}}</span> | |||
<el-divider class="split" style="background-color: rgba(0, 255, 247, 1)" v-if="op.actualQuantity" | |||
@@ -70,8 +69,8 @@ | |||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="12" type="flex" class="flex-1"> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12"> | |||
<base-container :show-yes-time="true" :no-content-padding="true" :height="256" :size="'eqStatus'" | |||
:title="'能源监控'" :title-icon="'energyMonitoring'"> | |||
<base-container :show-time="true" :show-yes-time="true" :no-content-padding="true" :height="256" | |||
:size="'eqStatus'" :title="'能源监控'" :title-icon="'energyMonitoring'"> | |||
<el-row :gutter="9"> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24"> | |||
<linear-bar-chart ref="EnergyMonitoringChart" :name-list="EnergyMonitoringNameList" | |||
@@ -81,7 +80,7 @@ | |||
</base-container> | |||
</el-col> | |||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12"> | |||
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'" | |||
<base-container :show-time="true" :no-content-padding="true" :height="318 + 338 + 16" :size="'eqStatus'" | |||
:title="'产线产量及良品率'" :title-icon="'productLine'"> | |||
<div class="myLegend"> | |||
<div class=" barCircleLegend"></div> | |||
@@ -136,7 +135,7 @@ const qualityYearList = [ | |||
name: '固化机', | |||
code: 'EQ20240110111700000201', | |||
status: '正常', | |||
error: 'true', | |||
error: false, | |||
}, | |||
{ | |||
name: '磨边清洗机', | |||
@@ -148,7 +147,7 @@ const qualityYearList = [ | |||
name: '预热机', | |||
code: 'EQ20240110111700000205', | |||
status: '故障', | |||
error: true, | |||
error: false, | |||
}, | |||
{ | |||
name: '下片机', | |||
@@ -159,7 +158,7 @@ const qualityYearList = [ | |||
name: '冷却机', | |||
code: 'EQ20240110111700000203', | |||
status: '正常', | |||
error: true, | |||
error: false, | |||
}, | |||
{ | |||
name: 'A储片机106', | |||
@@ -177,7 +176,7 @@ const qualityYearList = [ | |||
name: '二次磨边机', | |||
code: ' EQ20240110110927000181', | |||
status: '正常', | |||
error: true, | |||
error: false, | |||
}, | |||
{ | |||
name: '测试设备', | |||
@@ -483,7 +482,7 @@ export default { | |||
</span>`, | |||
`<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`, | |||
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '正常' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div> ${item.status || ''}</span>`, | |||
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == 'false' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0 '}"></div> ${item.error == true ? '是' : '否' || ''}</span>`, | |||
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == false ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0 '}"></div> ${item.error == true ? '是' : '否' || ''}</span>`, | |||
]); | |||
this.eqConfig.data = eqArr; | |||
let data = [ | |||
@@ -376,7 +376,7 @@ export default { | |||
}, | |||
}; | |||
</script> | |||
<style lang='scss'> | |||
<style lang="scss"> | |||
.orderMonitoring { | |||
.el-tabs__nav::after { | |||
content: ''; | |||
@@ -431,4 +431,4 @@ export default { | |||
vertical-align: bottom; | |||
} | |||
} | |||
</style> | |||
</style> |
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-01-24 15:15:24 | |||
* @LastEditTime: 2024-04-18 16:49:31 | |||
* @LastEditTime: 2024-04-23 09:05:08 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -12,20 +12,26 @@ | |||
</el-alert> --> | |||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | |||
<el-form-item label="日" prop="time"> | |||
<el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime" | |||
placeholder="选择日期"> | |||
<el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime" placeholder="选择日期"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item> | |||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small" | |||
<el-button type="primary" size="small" | |||
@click="getDataList">查询</el-button> | |||
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small" | |||
<el-button type="primary" size="small" | |||
plain @click="handleExport">导出</el-button> | |||
</el-form-item> | |||
</el-form> | |||
</div> | |||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType" | |||
@refreshDataList="getDataList" /> | |||
<el-col :span="16"> | |||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType" | |||
@refreshDataList="getDataList" /> | |||
</el-col> | |||
<el-col :span="8"> | |||
<inputTableTwo :data="tableDataChild" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType" | |||
@refreshDataList="getDataList" /> | |||
</el-col> | |||
<!-- <pagination | |||
:limit.sync="listQuery.pageSize" | |||
:page.sync="listQuery.pageNo" | |||
@@ -36,18 +42,21 @@ | |||
<script> | |||
// import { parseTime } from '../../core/mixins/code-filter'; | |||
import { getAutoDailyData } from '@/api/report/qcReport'; | |||
import { getAutoDailyData, getProductChildData } from '@/api/report/qcReport'; | |||
import inputTable from './inputTable.vue'; | |||
import inputTableTwo from './inputTableTwo.vue'; | |||
// import { getCorePLList } from '@/api/base/coreProductionLine'; | |||
import moment from 'moment' | |||
import FileSaver from 'file-saver' | |||
// import * as XLSX from 'xlsx' | |||
export default { | |||
components: { inputTable }, | |||
components: { inputTable, inputTableTwo }, | |||
data() { | |||
return { | |||
urlOptions: { | |||
getDataListURL: getAutoDailyData, | |||
getChildDataListURL: getProductChildData, | |||
// exportURL: exportGlasscExcel | |||
}, | |||
listQuery: { | |||
@@ -62,6 +71,7 @@ export default { | |||
startTimeStamp: '', | |||
endTimeStamp: '', | |||
tableData: [], | |||
tableDataChild:[], | |||
proLineList: [], | |||
all: {} | |||
}; | |||
@@ -119,12 +129,45 @@ export default { | |||
console.log(res.data.datas); | |||
let arr = res.data.datas | |||
let obj = res.data.reportAutoYdailyRespVO | |||
obj.lineName = '合计' | |||
obj.lineName = '压延线产量合计' | |||
arr.push(obj) | |||
// this.tableData.push(res.data.reportAutoYdailyRespVO) | |||
this.tableData = arr | |||
this.listQuery.total = res.data.length; | |||
this.dataListLoading = false; | |||
}) | |||
await this.urlOptions.getChildDataListURL(this.listQuery).then(res => { | |||
console.log(res.data.datas) | |||
// res.data.datas.sort((a, b) => { | |||
// if (a['lineName'] != b['lineName']) { | |||
// return a['lineName'].localeCompare(b['lineName']); | |||
// } | |||
// // if (a['groupClasses'] == '白班' && b['groupClasses'] == '夜班' ) { | |||
// // return a['groupClasses'].localeCompare(b['groupClasses']); | |||
// // } | |||
// // if (a['groupClasses'] == '夜班') { | |||
// // return a['groupClasses'].localeCompare(b['groupClasses']); | |||
// // } | |||
// }) | |||
console.log(res.data.datas); | |||
let arr = res.data.datas | |||
this.tableData.forEach(ele => { | |||
res.data.datas.forEach(item => { | |||
if (ele.lineName === item.lineName && item.groupClasses != '小计') { | |||
item.width = ele.width | |||
item.thick = ele.thick | |||
item.length = ele.length | |||
} | |||
}); | |||
}); | |||
let obj = res.data.reportAutoYdailyDetRespVO | |||
// obj.lineName = '合计' | |||
arr.push(obj) | |||
// this.tableChildData.push(res.data.reportAutoYdailyRespVO) | |||
this.tableDataChild = arr | |||
console.log(this.tableDataChild); | |||
// this.listQuery.total = res.data.length; | |||
this.dataListLoading = false; | |||
}); | |||
}, | |||
add0(m) { | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 15:49:48 | |||
* @LastEditTime: 2024-04-18 16:30:42 | |||
* @LastEditTime: 2024-04-22 16:15:08 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -13,18 +13,21 @@ | |||
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button> | |||
<el-button v-if="edit" size="small" @click="updateData">保存</el-button> | |||
</el-row> | |||
<el-table :id="id" :data="data" border style="width: 100%"> | |||
<el-table :span-method="objectSpanMethod" :id="id" :data="data" border style="width: 100%"> | |||
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label" | |||
:align="item.align ? item.align : 'left'"> | |||
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label" | |||
:align="item.align ? item.align : 'left'"> | |||
<template slot-scope="scope"> | |||
<span v-if="!edit">{{ scope.row[it.prop] }}</span> | |||
<el-input @change="handleChange" | |||
:disabled="it.label == '生产线' || it.label == '良品重量(吨)' || it.label == '月累计面积'" v-else | |||
v-model="scope.row[it.prop]"> | |||
</el-input> | |||
</template> | |||
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label"> | |||
<template slot-scope="scope"> | |||
<span v-if="!edit">{{ scope.row[y.prop] }}</span> | |||
<el-input type="number" @change="handleChange" :disabled="y.prop == 'dailyOutputTrend' || y.prop === 'originalGlassStatisticsTrend' | |||
|| y.prop === 'actualProductTrend' || y.prop === 'originalGlassPassTrend' || y.prop === 'originalGlassPassNow' || y.prop === 'originalGlassPassHis' | |||
" v-else v-model="scope.row[y.prop]"></el-input> | |||
</template> | |||
</el-table-column> | |||
</el-table-column> | |||
</el-table-column> | |||
@@ -35,7 +38,8 @@ | |||
</template> | |||
<script> | |||
import { updateGlass, updateGlassRemark } from '@/api/report/glass'; | |||
import { updateAutoDailyData } from '@/api/report/qcReport'; | |||
const cols = [ | |||
{ | |||
@@ -227,6 +231,45 @@ const cols = [ | |||
// } | |||
}, | |||
methods: { | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
let spanOneArr = [], concatOne = 0; | |||
this.data.map((item, index) => { | |||
if (index === 0) { | |||
spanOneArr.push(1); | |||
} else { | |||
//第一列需合并相同内容的判断条件 | |||
if (item.lineName === this.data[index - 1].lineName) { | |||
spanOneArr[concatOne] += 1; | |||
spanOneArr.push(0); | |||
} else { | |||
spanOneArr.push(1); | |||
concatOne = index; | |||
}; | |||
} | |||
}); | |||
if (columnIndex === 0) { | |||
const _row = spanOneArr[rowIndex]; | |||
const _col = _row > 0 ? 1 : 0; | |||
return { | |||
rowspan: _row, | |||
colspan: _col | |||
} | |||
} | |||
// if (columnIndex == 0 ) { | |||
// // if (rowIndex == this.data.length-1) { | |||
// // console.log(rowIndex) | |||
// return { | |||
// rowspan: this.data.length - 1, | |||
// colspan: 3 | |||
// }; | |||
// // } else { | |||
// // return { | |||
// // rowspan: 0, | |||
// // colspan: 0 | |||
// // }; | |||
// } | |||
// } | |||
}, | |||
handleReturn() { | |||
this.edit = false | |||
console.log(this.$parent.getDataList()); | |||
@@ -234,19 +277,8 @@ const cols = [ | |||
handleChange(e) { | |||
}, | |||
updateData() { | |||
// let obj = {} | |||
// this.data.forEach((ele, index) => { | |||
// if (ele.det === false) { | |||
// this.data[index].lineId = '' | |||
// this.data[index].remark = this.remark | |||
// obj = ele | |||
// delete this.data[index].dailyOutputTrend | |||
// delete this.data[index].originalGlassStatisticsTrend | |||
// delete this.data[index].actualProductTrend | |||
// delete this.data[index].originalGlassPassTrend | |||
// this.data.splice(index, 1) | |||
// } | |||
// }) | |||
let data = this.data.slice(0, -1) | |||
// console.log(obj) | |||
// let updateArr = this.data | |||
// updateArr.forEach((ele, index) => { | |||
// delete ele.dailyOutputTrend | |||
@@ -260,12 +292,12 @@ const cols = [ | |||
// delete ele.actualProductTrend | |||
// delete ele.originalGlassPassTrend | |||
// }); | |||
updateGlass(updateArr).then(response => { | |||
updateGlassRemark(obj).then(res => { | |||
this.$modal.msgSuccess("修改成功"); | |||
this.edit = false; | |||
this.$emit("refreshDataList"); | |||
}); | |||
updateAutoDailyData(data).then(response => { | |||
// updateGlassRemark(obj).then(res => { | |||
this.$modal.msgSuccess("修改成功") | |||
this.edit = false | |||
// this.$emit("refreshDataList"); | |||
// }); | |||
}); | |||
} | |||
} | |||
@@ -0,0 +1,252 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-22 13:18:59 | |||
* @LastEditTime: 2024-04-22 16:15:14 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<div> | |||
<el-row style="float: right; margin-bottom: 5px"> | |||
<!-- <el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData" | |||
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="updateData">保存</el-button> --> | |||
</el-row> | |||
<el-table style="margin-top:38px;width: 100%" :span-method="objectSpanMethod" :data="data" :id="id" border> | |||
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label" | |||
:align="item.align ? item.align : 'left'"> | |||
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label" | |||
:align="item.align ? item.align : 'left'"> | |||
<el-table-column v-for="(y, index2) in it.children" :key="index2" :prop="y.prop" :label="y.label"> | |||
<template slot-scope="scope"> | |||
<span v-if="!edit">{{ scope.row[y.prop] }}</span> | |||
<el-input type="number" @change="handleChange" :disabled="false" v-else v-model="scope.row[y.prop]"> | |||
</el-input> | |||
</template> | |||
</el-table-column> | |||
</el-table-column> | |||
</el-table-column> | |||
</el-table> | |||
<!-- <el-input type="textarea" v-model="remark" placeholder="备注" :disabled="!edit" :autosize="{ minRows: 2, maxRows: 6}"> | |||
</el-input> --> | |||
</div> | |||
</template> | |||
<script> | |||
import { updateGlass, updateGlassRemark } from '@/api/report/glass'; | |||
const cols = [ | |||
{ | |||
prop: 'xc', | |||
// label: '许昌安彩新能科技有限公司2024年4月份生产日报', | |||
align: 'center', | |||
children: [ | |||
{ | |||
prop: 'lineName', | |||
label: '产线', | |||
}, | |||
{ | |||
prop: 'groupClasses', | |||
label: '班次', | |||
}, | |||
{ | |||
prop: 'tractionSpeed', | |||
label: '拉引速度(米/分)', | |||
}, | |||
{ | |||
prop: 'width', | |||
label: '板宽(mm)', | |||
}, | |||
{ | |||
prop: 'weight', | |||
label: '板重(g)', | |||
}, | |||
{ | |||
prop: 'pullWeight', | |||
label: '拉引速度(吨/班)', | |||
}, | |||
{ | |||
prop: 'pullArea', | |||
label: '拉引面积(平方米)', | |||
}, | |||
{ | |||
prop: 'm', | |||
label: '尺寸(长、宽、厚)毫米', | |||
align: 'center', | |||
children: [ | |||
{ | |||
prop: 'length', | |||
label: '长', | |||
}, | |||
{ | |||
prop: 'width', | |||
label: '宽', | |||
}, | |||
{ | |||
prop: 'thick', | |||
label: '高', | |||
} | |||
] | |||
} | |||
] | |||
} | |||
] | |||
export default { | |||
props: { | |||
data: { | |||
type: Array, | |||
default: () => [], | |||
}, | |||
id: { | |||
type: String, | |||
default:'exportTable' | |||
}, | |||
time: { | |||
type: Array, | |||
default: () => [], | |||
}, | |||
date: { | |||
type: String, | |||
default:'' | |||
}, | |||
sum: { | |||
type: Object, | |||
default: () => {}, | |||
}, | |||
type: { | |||
type: Number, | |||
default: 3, | |||
} | |||
}, | |||
data() { | |||
return { | |||
cols, | |||
remark:null, | |||
edit: false, | |||
noData:false, | |||
}; | |||
}, | |||
watch: { | |||
data: { | |||
handler(newv, oldv) { | |||
if (newv.length != 0) { | |||
this.noData = false | |||
} else { | |||
this.noData = true | |||
} | |||
} | |||
}, | |||
time: { | |||
immediate: true, | |||
handler(newv, oldv) { | |||
if (newv[0] !== '') { | |||
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')' | |||
} else { | |||
this.cols[0].label = this.date | |||
} | |||
} | |||
}, | |||
// type: { | |||
// immediate: true, | |||
// handler(newv, oldv) { | |||
// let text1 = '', text2 = '', text3 = '' | |||
// if (newv === 3) { | |||
// text1 = '本周' | |||
// text2 = '上周' | |||
// text3 = '原片合计(片/周)' | |||
// } else if (newv === 4) { | |||
// text1 = '本月' | |||
// text2 = '上月' | |||
// text3 = '原片合计(片/月)' | |||
// } else if (newv === 2) { | |||
// text1 = '今日' | |||
// text2 = '昨日' | |||
// text3 = '原片合计(片/日)' | |||
// } else { | |||
// text1 = '本年' | |||
// text2 = '上年' | |||
// text3 = '原片合计(片/年)' | |||
// } | |||
// this.cols[0].children[1].children[0].label = text1 | |||
// this.cols[0].children[1].children[1].label = text2 | |||
// this.cols[0].children[2].children[0].label = text1 | |||
// this.cols[0].children[2].children[1].label = text2 | |||
// this.cols[0].children[3].children[0].label = text1 | |||
// this.cols[0].children[3].children[1].label = text2 | |||
// this.cols[0].children[4].children[0].label = text1 | |||
// this.cols[0].children[4].children[1].label = text2 | |||
// this.cols[0].children[2].label = text3 | |||
// } | |||
// } | |||
}, | |||
methods: { | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
let spanOneArr = [], concatOne = 0; | |||
this.data.map((item, index) => { | |||
if (index === 0) { | |||
spanOneArr.push(1); | |||
} else { | |||
//第一列需合并相同内容的判断条件 | |||
if (item.lineName === this.data[index - 1].lineName) { | |||
spanOneArr[concatOne] += 1; | |||
spanOneArr.push(0); | |||
} else { | |||
spanOneArr.push(1); | |||
concatOne = index; | |||
}; | |||
} | |||
}); | |||
if (columnIndex === 0) { | |||
const _row = spanOneArr[rowIndex]; | |||
const _col = _row > 0 ? 1 : 0; | |||
return { | |||
rowspan: _row, | |||
colspan: _col | |||
} | |||
} | |||
}, | |||
handleReturn() { | |||
this.edit = false | |||
console.log(this.$parent.getDataList()); | |||
}, | |||
handleChange(e) { | |||
}, | |||
updateData() { | |||
// let obj = {} | |||
// this.data.forEach((ele, index) => { | |||
// if (ele.det === false) { | |||
// this.data[index].lineId = '' | |||
// this.data[index].remark = this.remark | |||
// obj = ele | |||
// delete this.data[index].dailyOutputTrend | |||
// delete this.data[index].originalGlassStatisticsTrend | |||
// delete this.data[index].actualProductTrend | |||
// delete this.data[index].originalGlassPassTrend | |||
// this.data.splice(index, 1) | |||
// } | |||
// }) | |||
// let updateArr = this.data | |||
// updateArr.forEach((ele, index) => { | |||
// delete ele.dailyOutputTrend | |||
// delete ele.originalGlassStatisticsTrend | |||
// delete ele.actualProductTrend | |||
// delete ele.originalGlassPassTrend | |||
// }); | |||
// this.data.forEach((ele, index) => { | |||
// delete ele.dailyOutputTrend | |||
// delete ele.originalGlassStatisticsTrend | |||
// delete ele.actualProductTrend | |||
// delete ele.originalGlassPassTrend | |||
// }); | |||
// updateGlass(updateArr).then(response => { | |||
// updateGlassRemark(obj).then(res => { | |||
// this.$modal.msgSuccess("修改成功"); | |||
// this.edit = false; | |||
// this.$emit("refreshDataList"); | |||
// }); | |||
// }); | |||
} | |||
} | |||
}; | |||
</script> |
@@ -0,0 +1,482 @@ | |||
<template> | |||
<div class="app-container sectionProductionReport"> | |||
<!-- 搜索工作栏 --> | |||
<search-bar | |||
:formConfigs="formConfig" | |||
@headBtnClick="buttonClick" /> | |||
<base-table | |||
class="sectionProductionTable1" | |||
ref="sectionProductionTable11" | |||
id="sectionProductionTable1" | |||
:table-props="tableProp" | |||
:table-data="tableData" | |||
:span-method="objectSpanMethod" | |||
:max-height="tableH" /> | |||
<!-- 搜索工作栏 --> | |||
<search-bar | |||
style="margin-top: 10px" | |||
:formConfigs="formConfig2" | |||
@headBtnClick="buttonClick2" /> | |||
<base-table | |||
class="sectionProductionTable2" | |||
ref="sectionProductionTable22" | |||
id="sectionProductionTable2" | |||
:table-props="tableProp2" | |||
:table-data="tableData2" | |||
:span-method="objectSpanMethod2" | |||
:max-height="tableH" /> | |||
</div> | |||
</template> | |||
<script> | |||
const tableProp1 = [ | |||
{ | |||
prop: 'lineName', | |||
label: '生产线', | |||
width: 80, | |||
fixed: true, | |||
}, | |||
{ | |||
label: '时间', | |||
fixed: true, | |||
width: 140, | |||
children: [ | |||
{ | |||
prop: 'procedure', | |||
label: '工序', | |||
fixed: true, | |||
width: 140, | |||
}, | |||
], | |||
}, | |||
]; | |||
import { | |||
originalSection, | |||
getOriginalLine, | |||
getProcessingLine, | |||
processing, | |||
} from '@/api/report/customizedReports'; | |||
import FileSaver from 'file-saver'; | |||
import moment from 'moment'; | |||
export default { | |||
name: 'SectionProduction', | |||
data() { | |||
return { | |||
tableH: this.tableHeight(280) / 2, | |||
formConfig: [ | |||
{ | |||
type: 'select', | |||
label: '生产线', | |||
selectOptions: [], | |||
param: 'lineId', | |||
}, | |||
{ | |||
type: 'select', | |||
label: '时间', | |||
selectOptions: [ | |||
{ id: '1', name: '当前班次' }, | |||
{ id: '2', name: '近24小时' }, | |||
{ id: '3', name: '日报' }, | |||
], | |||
defaultSelect: '1', | |||
param: 'timeType', | |||
clearable: false, | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '查询', | |||
name: 'search', | |||
color: 'primary', | |||
}, | |||
{ | |||
type: 'separate', | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '导出', | |||
name: 'export', | |||
plain: true, | |||
color: 'primary', | |||
}, | |||
], | |||
formConfig2: [ | |||
{ | |||
type: 'select', | |||
label: '生产线', | |||
selectOptions: [], | |||
param: 'lineId', | |||
}, | |||
{ | |||
type: 'select', | |||
label: '时间', | |||
defaultSelect: '1', | |||
selectOptions: [ | |||
{ id: '1', name: '当前班次' }, | |||
{ id: '2', name: '近24小时' }, | |||
{ id: '3', name: '日报' }, | |||
], | |||
param: 'timeType', | |||
clearable: false, | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '查询', | |||
name: 'search', | |||
color: 'primary', | |||
}, | |||
{ | |||
type: 'separate', | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '导出', | |||
name: 'export', | |||
plain: true, | |||
color: 'primary', | |||
}, | |||
], | |||
queryParams: { | |||
startTime: '', | |||
endTime: '', | |||
lineId: '', | |||
}, | |||
queryParams2: { | |||
startTime: '', | |||
endTime: '', | |||
lineId: '', | |||
}, | |||
tableProp1, | |||
tableProp: [], | |||
tableData: [], | |||
tableProp2: [], | |||
tableData2: [], | |||
procedureName: [ | |||
{ name: '压延(拉引量t)', ename: 'calenderingCapacity' }, | |||
{ name: '优化切割(片)', ename: 'cuttingNum' }, | |||
{ name: '堆垛(片)', ename: 'unloadPieces' }, | |||
{ name: '堆垛(托)', ename: 'unloadCount' }, | |||
{ name: '良品率(%)', ename: 'rate' }, | |||
], | |||
span: [], //表2第一列合并 | |||
}; | |||
}, | |||
created() { | |||
window.addEventListener('resize', this._setTableHeight); | |||
}, | |||
destroyed() { | |||
window.removeEventListener('resize', this._setTableHeight); | |||
}, | |||
mounted() { | |||
this.getLine(); | |||
this.tableProp = this.tableProp1; | |||
this.tableProp2 = this.tableProp1; | |||
let arr = this.getTime('1'); | |||
this.queryParams.startTime = arr[0]; | |||
this.queryParams.endTime = arr[1]; | |||
this.queryParams2.startTime = arr[0]; | |||
this.queryParams2.endTime = arr[1]; | |||
this.getList(); | |||
this.getList2(); | |||
}, | |||
methods: { | |||
_setTableHeight() { | |||
this.tableH = this.tableHeight(280) / 2; | |||
}, | |||
getLine() { | |||
getOriginalLine().then((res) => { | |||
this.formConfig[0].selectOptions = res.data || []; | |||
}); | |||
getProcessingLine().then((res) => { | |||
this.formConfig2[0].selectOptions = res.data || []; | |||
}); | |||
}, | |||
getList() { | |||
// 获取数据 | |||
originalSection({ ...this.queryParams }).then((res) => { | |||
let data = res.data; | |||
this.tableProp = []; | |||
let timeArr = this.uniqueTime(data, 'timeStr'); | |||
let arr = []; | |||
timeArr.map((item) => { | |||
let obj = {}; | |||
obj.prop = item.timeStr; | |||
obj.label = item.timeStr; | |||
obj.minWidth = 140; | |||
arr.push(obj); | |||
}); | |||
this.tableProp = this.tableProp1.concat(arr); //表头 | |||
this.transferData(data); | |||
}); | |||
}, | |||
getTime(val) { | |||
let nowTime = moment().valueOf(); | |||
let dTime = moment(moment().format('YYYY-MM-DD') + ' 07:00:00').valueOf(); | |||
switch (val) { | |||
case '1': | |||
let fTime = moment( | |||
moment(moment().valueOf() - 86400000).format('YYYY-MM-DD') + | |||
' 19:00:00' | |||
).valueOf(); | |||
let nTime = moment( | |||
moment().format('YYYY-MM-DD') + ' 19:00:00' | |||
).valueOf(); | |||
if (nowTime <= dTime) { | |||
return [fTime, nowTime]; | |||
} else if (nowTime > dTime && nowTime <= nTime) { | |||
return [dTime, nowTime]; | |||
} else { | |||
return [nTime, nowTime]; | |||
} | |||
break; | |||
case '2': | |||
let lastTime = nowTime - 86400000; | |||
return [lastTime, nowTime]; | |||
break; | |||
default: | |||
let f1Time = dTime - 86400000 * 2; | |||
let f2Time = dTime - 86400000; | |||
if (nowTime <= dTime) { | |||
return [f1Time, f2Time]; | |||
} else { | |||
return [f2Time, dTime]; | |||
} | |||
} | |||
}, | |||
buttonClick(val) { | |||
if (val.btnName === 'search') { | |||
this.queryParams.lineId = val.lineId; | |||
this.queryParams.startTime = this.getTime(val.timeType)[0]; | |||
this.queryParams.endTime = this.getTime(val.timeType)[1]; | |||
this.getList(); | |||
} else { | |||
//导出 | |||
this.exportTable('.sectionProductionTable1', '原片工段数据.xlsx', 0); | |||
} | |||
}, | |||
//导出表格 | |||
exportTable(className, fileName, num) { | |||
// 处理查询参数 | |||
var fix = document.querySelectorAll('.el-table__fixed')[num]; | |||
var table = document.querySelector(className).childNodes[0]; | |||
var wb; | |||
import('xlsx').then((excel) => { | |||
if (fix) { | |||
wb = excel.utils.table_to_book(table.removeChild(fix)); | |||
table.appendChild(fix); | |||
} else { | |||
wb = excel.utils.table_to_book(table); | |||
} | |||
/* 获取二进制字符串作为输出 */ | |||
var wbout = excel.write(wb, { | |||
bookType: 'xlsx', | |||
bookSST: true, | |||
type: 'array', | |||
}); | |||
try { | |||
FileSaver.saveAs( | |||
new Blob([wbout], { type: 'application/octet-stream' }), | |||
//设置导出文件名称 | |||
fileName | |||
); | |||
} catch (e) { | |||
if (typeof console !== 'undefined') console.log(e, wbout); | |||
} | |||
return wbout; | |||
}); | |||
}, | |||
transferData(data) { | |||
let tempData = []; | |||
let lineNum = 0; //第一条产线 | |||
let sumArr = []; | |||
for (let i = 0; i < data.length; i++) { | |||
if (i === 0) { | |||
this.procedureName.map((item) => { | |||
let obj = {}; | |||
obj.lineName = data[i].lineName; | |||
obj.procedure = item.name; | |||
obj.eName = item.ename; | |||
obj[data[i].timeStr] = data[i][item.ename]; | |||
tempData.push(obj); | |||
}); | |||
lineNum++; | |||
} else { | |||
if (data[i].timeStr === '总计') { | |||
sumArr.push(data[i]); | |||
} else { | |||
if (data[i].lineName === data[i - 1].lineName) { | |||
//相同产线,添加列 | |||
let startNum = 5 * (lineNum - 1); | |||
let endNum = 5 * lineNum - 1; | |||
for (let k = startNum; k <= endNum; k++) { | |||
let str = this.procedureName[k % 5]; | |||
tempData[k][data[i].timeStr] = data[i][str.ename]; | |||
} | |||
} else { | |||
//不同产线,同时添加5行 | |||
this.procedureName.map((item) => { | |||
let obj = {}; | |||
obj.lineName = data[i].lineName; | |||
obj.procedure = item.name; | |||
obj.eName = item.ename; | |||
obj[data[i].timeStr] = data[i][item.ename]; | |||
tempData.push(obj); | |||
}); | |||
lineNum++; | |||
} | |||
} | |||
} | |||
} | |||
for (let j = 0; j < tempData.length; j++) { | |||
sumArr.map((item) => { | |||
tempData[j]['总计'] = item[tempData[j].eName]; | |||
}); | |||
} | |||
this.tableData = tempData; | |||
this.$nextTick(() => { | |||
this.reTable1(); | |||
}); | |||
}, | |||
reTable1() { | |||
this.$refs.sectionProductionTable11.doLayout('sectionProductionTable1'); | |||
}, | |||
reTable2() { | |||
this.$refs.sectionProductionTable22.doLayout('sectionProductionTable2'); | |||
}, | |||
// 时间去重 | |||
uniqueTime(arr, prop) { | |||
return arr.filter((value, index, self) => { | |||
return ( | |||
self.findIndex((t) => { | |||
return t[prop] === value[prop]; | |||
}) === index | |||
); | |||
}); | |||
}, | |||
// 合并第一列 | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
if (columnIndex === 0) { | |||
if (rowIndex % 5 === 0) { | |||
return { | |||
rowspan: 5, | |||
colspan: 1, | |||
}; | |||
} else { | |||
return { | |||
rowspan: 0, | |||
colspan: 0, | |||
}; | |||
} | |||
} | |||
}, | |||
getList2() { | |||
// 获取数据 | |||
processing({ ...this.queryParams2 }).then((res) => { | |||
this.tableData2 = []; | |||
let data = res.data; | |||
for (let i = 0; i < data.length; i++) { | |||
for (let j = 0; j < data[i].productDet.length; j++) { | |||
let obj = {}; | |||
obj.lineName = data[i].lineName; | |||
obj.procedure = data[i].productDet[j].name; | |||
data[i].productDet[j].data.map((item) => { | |||
obj[item.timeStr] = item.input || null; | |||
}); | |||
obj.sum = data[i].productDet[j].allInput; | |||
this.tableData2.push(obj); | |||
} | |||
} | |||
let arr = []; | |||
let propsArr = data[0].timeStr || []; | |||
propsArr.map((t) => { | |||
let obj = {}; | |||
obj.prop = t; | |||
obj.label = t; | |||
obj.minWidth = 140; | |||
arr.push(obj); | |||
}); | |||
arr.push({ prop: 'sum', label: '合计' }); | |||
this.tableProp2 = this.tableProp1.concat(arr); //表头 | |||
this.getSpanArr(this.tableData2); | |||
this.$nextTick(() => { | |||
this.reTable2(); | |||
}); | |||
}); | |||
}, | |||
// 表格2 | |||
buttonClick2(val) { | |||
if (val.btnName === 'search') { | |||
this.queryParams2.lineId = val.lineId; | |||
this.queryParams2.startTime = this.getTime(val.timeType)[0]; | |||
this.queryParams2.endTime = this.getTime(val.timeType)[1]; | |||
this.getList2(); | |||
} else { | |||
this.exportTable('.sectionProductionTable2', '深加工工段数据.xlsx', 1); | |||
} | |||
}, | |||
// 获取合并行 | |||
getSpanArr(data) { | |||
this.span = []; | |||
for (var i = 0; i < data.length; i++) { | |||
if (i === 0) { | |||
this.span.push(1); | |||
this.index = 0; | |||
} else { | |||
if (data[i].lineName === data[i - 1].lineName) { | |||
this.span[this.index] += 1; | |||
this.span.push(0); | |||
} else { | |||
this.span.push(1); | |||
this.index = i; | |||
} | |||
} | |||
} | |||
}, | |||
objectSpanMethod2({ rowIndex, columnIndex }) { | |||
if (columnIndex === 0) { | |||
const _row = this.span[rowIndex]; | |||
return { | |||
rowspan: _row, | |||
colspan: 1, | |||
}; | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
<style lang="scss"> | |||
.sectionProductionReport { | |||
.el-table thead.is-group tr:first-of-type th:nth-child(2) { | |||
border-bottom: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:nth-child(2) div.cell { | |||
padding-left: 82px; | |||
} | |||
.el-table th.el-table__cell { | |||
height: 28px; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:nth-child(2):before { | |||
content: ''; | |||
position: absolute; | |||
height: 80px; | |||
top: 0; | |||
left: 0; | |||
background-color: #ebeef5; | |||
transform: rotate(-70deg); | |||
-webkit-transform-origin: top; | |||
transform-origin: top; | |||
width: 1px; | |||
} | |||
.el-table thead.is-group tr:last-of-type th:nth-child(1):before { | |||
content: ''; | |||
position: absolute; | |||
height: 67px; | |||
top: 0; | |||
left: 75px; | |||
background-color: #ebeef5; | |||
transform: rotate(-70deg); | |||
-webkit-transform-origin: top; | |||
transform-origin: top; | |||
width: 1px; | |||
} | |||
} | |||
</style> |
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 14:08:46 | |||
* @LastEditTime: 2024-04-19 15:11:14 | |||
* @LastEditTime: 2024-04-23 16:18:27 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -35,7 +35,20 @@ | |||
<el-table-column prop="activityName"></el-table-column> | |||
<el-table-column prop="message"></el-table-column> | |||
</el-table-column> --> | |||
<el-table-column v-for="(item,index) in codeList " :prop="item" :label="item"> | |||
<el-table-column style="text-align: center;" v-for="(item,index) in codeList " :prop="item" :label="item"> | |||
<!-- <template slot-scope="scope"> | |||
<el-col :span="12"> | |||
{{ codeList[index] }} | |||
</el-col> | |||
<el-col :span="12"> | |||
</el-col> | |||
<el-row> | |||
<el-col :span="24"> | |||
{{ scope.row.sj2 }} | |||
</el-col> | |||
</el-row> | |||
</template> --> | |||
</el-table-column> | |||
</el-table> | |||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" | |||
@@ -114,7 +127,7 @@ export default { | |||
// deleteURL: deleteQualityHotMaterial, | |||
// exportURL: exportFactoryExcel, | |||
}, | |||
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14' ], | |||
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'], | |||
tableData: [], | |||
listQuery: { | |||
startTime: undefined, | |||
@@ -172,7 +185,7 @@ export default { | |||
spanOneArr.push(1); | |||
} else { | |||
//第一列需合并相同内容的判断条件 | |||
if (item.className === this.tableData[index - 1].className) { | |||
if (item.classType === this.tableData[index - 1].classType) { | |||
spanOneArr[concatOne] += 1; | |||
spanOneArr.push(0); | |||
} else { | |||
@@ -190,6 +203,30 @@ export default { | |||
colspan: _col | |||
} | |||
} | |||
if (columnIndex === 1 ) { | |||
if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) { | |||
return { | |||
rowspan: 2, | |||
colspan: 1 | |||
} | |||
} | |||
} | |||
if (columnIndex === 1) { | |||
if (rowIndex === 1 || rowIndex === 3 || rowIndex === 5 || rowIndex === 7 || rowIndex === 9 || rowIndex === 11) { | |||
return { | |||
rowspan: 1, | |||
colspan: 2 | |||
} | |||
} | |||
} | |||
if (columnIndex === 4 || columnIndex === 5 || columnIndex === 6 || columnIndex === 7 || columnIndex === 8 || columnIndex === 9 || columnIndex === 10 || columnIndex === 11 || columnIndex === 12 || columnIndex === 13) { | |||
if (rowIndex === 0 || rowIndex === 2 || rowIndex === 4 || rowIndex === 6 || rowIndex === 8 || rowIndex === 10) { | |||
return { | |||
rowspan: 2, | |||
colspan: 1 | |||
} | |||
} | |||
} | |||
}, | |||
handleExport() { | |||
// 处理查询参数 | |||
@@ -237,8 +274,8 @@ export default { | |||
// 获取数据列表 | |||
getDataList() { | |||
this.dataListLoading = true; | |||
this.listQuery.startTime = '1713197388000'; | |||
this.listQuery.endTime = '1713254961000'; | |||
// this.listQuery.startTime = '1713197388000'; | |||
// this.listQuery.endTime = '1713254961000'; | |||
this.urlOptions.getDataListURL(this.listQuery).then(res => { | |||
// console.log(res) | |||
// console.log(res.data) | |||
@@ -260,6 +297,24 @@ export default { | |||
'sj14': null, | |||
putType: '投入数量' | |||
}, | |||
{ | |||
classType: 1, | |||
className: '白班(8:00-20:00)', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2': null, | |||
putType: '' | |||
}, | |||
{ | |||
classType: 1, | |||
className: '白班(8:00-20:00)', | |||
@@ -277,6 +332,24 @@ export default { | |||
'sj14': null, | |||
putType: '投入次数' | |||
}, | |||
{ | |||
classType: 1, | |||
className: '白班(8:00-20:00)', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2': null, | |||
putType: '' | |||
}, | |||
{ | |||
classType: 2, | |||
className: '夜班(20:00-8:00)', | |||
@@ -294,6 +367,24 @@ export default { | |||
'sj14': null, | |||
putType: '投入数量', | |||
}, | |||
{ | |||
classType: 2, | |||
className: '夜班(8:00-20:00)', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2': null, | |||
putType: '' | |||
}, | |||
{ | |||
classType:2, | |||
className: '夜班(20:00-8:00)', | |||
@@ -312,7 +403,25 @@ export default { | |||
putType: '投入次数', | |||
}, | |||
{ | |||
classType: 1, | |||
classType: 2, | |||
className: '夜班(8:00-20:00)', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2': null, | |||
putType: '' | |||
}, | |||
{ | |||
classType: 3, | |||
className: '全天', | |||
'sj1': null, | |||
'sj2': null, | |||
@@ -329,7 +438,25 @@ export default { | |||
putType: '投入数量', | |||
}, | |||
{ | |||
classType: 2, | |||
classType: 3, | |||
className: '全天', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2':null, | |||
putType: '' | |||
}, | |||
{ | |||
classType: 3, | |||
className: '全天', | |||
'sj1': null, | |||
'sj2': null, | |||
@@ -344,25 +471,60 @@ export default { | |||
'sj13': null, | |||
'sj14': null, | |||
putType: '投入次数', | |||
} | |||
}, | |||
{ | |||
classType: 3, | |||
className: '全天', | |||
'sj1': null, | |||
'sj2': null, | |||
'sj3': null, | |||
'sj4': null, | |||
'sj5': null, | |||
'sj7': null, | |||
'sj8': null, | |||
'sj10': null, | |||
'sj11': null, | |||
'sj12': null, | |||
'sj13': null, | |||
'sj14': null, | |||
'sj1+sj2': null, | |||
putType: '' | |||
}, | |||
] | |||
res.data.forEach((ele) => { | |||
if(ele.classType === 1 && ele.code == 'sj1+sj2') { | |||
arr[1]['putType'] = ele.putNum | |||
arr[3]['putType'] = ele.useNum | |||
// arr[1]['sj2'] = ele.putNum | |||
// arr[3]['sj2'] = ele.useNum | |||
} else if (ele.classType === 2 && ele.code == 'sj1+sj2') { | |||
arr[5]['putType'] = ele.putNum | |||
arr[7]['putType'] = ele.useNum | |||
// arr[5]['sj2'] = ele.putNum | |||
// arr[7]['sj2'] = ele.useNum | |||
} else if (ele.classType === 3 && ele.code == 'sj1+sj2') { | |||
arr[9]['putType'] = ele.putNum | |||
arr[11]['putType'] = ele.useNum | |||
// arr[9]['sj2'] = ele.putNum | |||
// arr[11]['sj2'] = ele.useNum | |||
} | |||
this.codeList.forEach((item) => { | |||
if (ele.classType === 1 && ele.code == item) { | |||
// console.log(arr[0][item]) | |||
arr[0][item] = ele.putNum | |||
arr[1][item] = ele.useNum | |||
arr[2][item] = ele.useNum | |||
} else if (ele.classType === 2 && ele.code == item) { | |||
arr[2][item] = ele.putNum | |||
arr[3][item] = ele.useNum | |||
} else if (ele.classType === 3 && ele.code == item) { | |||
arr[4][item] = ele.putNum | |||
arr[5][item] = ele.useNum | |||
arr[6][item] = ele.useNum | |||
} else if (ele.classType === 3 && ele.code == item) { | |||
arr[8][item] = ele.putNum | |||
arr[10][item] = ele.useNum | |||
} | |||
}) | |||
}) | |||
// console.log(arr) | |||
this.tableData = arr | |||
console.log(this.tableData); | |||
this.dataListLoading = false; | |||
}); | |||
}, | |||
@@ -383,24 +545,24 @@ export default { | |||
}, | |||
}; | |||
</script> | |||
<style> | |||
.baseTable .el-table__body tr.current-row>td.el-table__cell { | |||
<style scoped> | |||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { | |||
background-color: #EAF1FC; | |||
} | |||
.baseTable .el-table .el-table__cell { | |||
::v-deep .baseTable .el-table .el-table__cell { | |||
padding: 0; | |||
height: 35px; | |||
} | |||
.el-table thead.is-group th { | |||
::v-deep.el-table thead.is-group th { | |||
background: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:first-of-type { | |||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type { | |||
border-bottom: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:first-of-type:before { | |||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before { | |||
content: ''; | |||
position: absolute; | |||
width: 1px; | |||
@@ -416,7 +578,7 @@ export default { | |||
transform-origin: top; | |||
} | |||
.el-table thead.is-group tr:last-of-type th:first-of-type:before { | |||
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before { | |||
content: ''; | |||
position: absolute; | |||
width: 1px; | |||
@@ -1,10 +1,22 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 10:01:33 | |||
* @LastEditTime: 2024-04-23 15:15:22 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<div class="app-container"> | |||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | |||
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData"> | |||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn" | |||
@clickBtn="handleClick" /> --> | |||
</base-table> | |||
<el-table :header-cell-style="{ | |||
background: '#F2F4F9', | |||
color: '#606266' | |||
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"> | |||
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center"> | |||
<el-table-column v-for="it in item.children" :prop="it.prop" :label="it.label" align="center"> | |||
</el-table-column> | |||
</el-table-column> | |||
</el-table> | |||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" | |||
@pagination="getDataList" /> --> | |||
<!-- <base-dialog | |||
@@ -24,7 +36,8 @@ | |||
// import basicPage from '../../../core/mixins/basic-page'; | |||
// import { parseTime } from '../../../core/mixins/code-filter'; | |||
import { | |||
getOriginalData | |||
getOriginalLineDataList, | |||
getCuttingReportDataList | |||
} from '@/api/report/qcReport'; | |||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; | |||
import FileSaver from 'file-saver' | |||
@@ -36,56 +49,83 @@ const tableProps = [ | |||
// filter: parseTime | |||
// }, | |||
{ | |||
prop: 'lineName', | |||
label: '产线' | |||
}, | |||
{ | |||
prop: 'equipmentName', | |||
label: '' | |||
}, | |||
{ | |||
prop: 'num', | |||
label: '片数' | |||
}, | |||
{ | |||
prop: 'area', | |||
label: '面积' | |||
}, | |||
{ | |||
prop: 'countNum', | |||
label: '托数', | |||
// filter: (val) => val == false ? '不合格' : '合格', | |||
}, | |||
{ | |||
prop: 'size', | |||
label: '规格', | |||
// filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C', | |||
}, | |||
// { | |||
// prop: 'checkerName', | |||
// label: '检测人员' | |||
// }, | |||
// { | |||
// prop: 'checkTime', | |||
// label: '检测时间', | |||
// filter: parseTime | |||
// }, | |||
prop: '', | |||
label: '切割堆垛日报', | |||
children:[ | |||
{ | |||
prop: 'lineName', | |||
label: '产线' | |||
}, | |||
{ | |||
prop: 'className', | |||
label: '班组' | |||
}, | |||
{ | |||
prop: 'groupName', | |||
label: '班次' | |||
}, | |||
{ | |||
prop: 'size', | |||
label: '规格 mm 长*宽' | |||
}, | |||
{ | |||
prop: 'thickness', | |||
label: '厚度' | |||
}, | |||
{ | |||
prop: 'glassCode', | |||
label: '周转编号', | |||
}, | |||
{ | |||
prop: 'stackingType', | |||
label: '堆垛方式', | |||
filter: (val) => val == 1 ? '集装架' : '堵头箱', | |||
}, | |||
{ | |||
prop: 'pieces', | |||
label: '片数', | |||
}, | |||
{ | |||
prop: 'originCode', | |||
label: '堆垛工位', | |||
}, | |||
{ | |||
prop: 'endTime', | |||
label: '堆垛时间', | |||
}, | |||
{ | |||
prop: 'dusting', | |||
label: '堆垛情况', | |||
}, | |||
{ | |||
prop: 'palletNumber', | |||
label: '堆垛时间', | |||
}, | |||
{ | |||
prop: 'endTime', | |||
label: '集装架号', | |||
}, | |||
] | |||
} | |||
]; | |||
export default { | |||
mixins: [ tableHeightMixin], | |||
mixins: [tableHeightMixin], | |||
data() { | |||
return { | |||
urlOptions: { | |||
getDataListURL: getOriginalData, | |||
getDataListURL: getCuttingReportDataList, | |||
// deleteURL: deleteQualityHotMaterial, | |||
// exportURL: exportFactoryExcel, | |||
}, | |||
tableProps, | |||
tableData: [], | |||
mergeArr: [],//记录合并行数 | |||
pos: 0, | |||
listQuery: { | |||
startTime: undefined, | |||
endTime:undefined | |||
endTime: undefined, | |||
lineId: null, | |||
}, | |||
formConfig: [ | |||
// { | |||
@@ -108,16 +148,25 @@ export default { | |||
label: '时间段', | |||
dateType: 'daterange', | |||
format: 'yyyy-MM-dd HH:mm:ss', | |||
// valueFormat: "yyyy-MM-dd HH:mm:ss", | |||
valueFormat: "timestamp", | |||
rangeSeparator: '-', | |||
startPlaceholder: '开始时间', | |||
endPlaceholder: '结束时间', | |||
param: 'checkTime', | |||
defaultSelect: [], | |||
width: 250 | |||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], | |||
width: 350 | |||
}, | |||
{ | |||
type: 'select', | |||
label: '产线', | |||
selectOptions: [], | |||
labelField: 'name', | |||
valueField: 'id', | |||
param: 'lineId', | |||
filterable: true | |||
}, | |||
{ | |||
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '', | |||
type: 'button', | |||
btnName: '查询', | |||
name: 'search', | |||
color: 'primary', | |||
@@ -127,7 +176,7 @@ export default { | |||
// // type: 'separate', | |||
// }, | |||
{ | |||
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '', | |||
type: 'button', | |||
btnName: '导出', | |||
name: 'export', | |||
color: 'success', | |||
@@ -141,12 +190,79 @@ export default { | |||
}, | |||
created() { }, | |||
mounted() { | |||
// this.formConfig[1].defaultSelect[] | |||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0] | |||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] | |||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 | |||
this.getDataList() | |||
this.getDict() | |||
// this.getSpanArr(this.tableData) | |||
// this.getDict(); | |||
}, | |||
methods: { | |||
async getDict() { | |||
const res = await getOriginalLineDataList() | |||
console.log(res) | |||
this.formConfig[1].selectOptions = res.data | |||
}, | |||
// getSummaries(param) { | |||
// console.log(columns) | |||
// const { columns, data } = param; | |||
// const sums = []; | |||
// columns.forEach((column, index) => { | |||
// if (index === 0) { | |||
// sums[index] = '合计'; | |||
// return; | |||
// } | |||
// const values = data.map(item => Number(item[column.property])); | |||
// // const data = data.map(item => !Number(item[column.property])); | |||
// if (!values.every(value => isNaN(value))) { | |||
// sums[index] = values.reduce((prev, curr) => { | |||
// const value = Number(curr); | |||
// if (!isNaN(value)) { | |||
// return prev + curr; | |||
// } else { | |||
// return prev; | |||
// } | |||
// }, 0); | |||
// sums[index] += ' '; | |||
// } else { | |||
// sums[index] = '-'; | |||
// } | |||
// }); | |||
// return sums; | |||
// }, | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
let spanOneArr = [], concatOne = 0; | |||
this.tableData.map((item, index) => { | |||
if (index === 0) { | |||
spanOneArr.push(1); | |||
} else { | |||
//第一列需合并相同内容的判断条件 | |||
if (item.lineName === this.tableData[index - 1].lineName) { | |||
spanOneArr[concatOne] += 1; | |||
spanOneArr.push(0); | |||
} else { | |||
spanOneArr.push(1); | |||
concatOne = index; | |||
}; | |||
} | |||
}); | |||
if (columnIndex === 0) { | |||
const _row = spanOneArr[rowIndex]; | |||
const _col = _row > 0 ? 1 : 0; | |||
return { | |||
rowspan: _row, | |||
colspan: _col | |||
} | |||
} | |||
}, | |||
handleExport() { | |||
// 处理查询参数 | |||
console.log(this.$refs); | |||
var xlsxParam = { raw: true }; | |||
/* 从表生成工作簿对象 */ | |||
import('xlsx').then(excel => { | |||
@@ -190,10 +306,39 @@ export default { | |||
// 获取数据列表 | |||
getDataList() { | |||
this.dataListLoading = true; | |||
this.listQuery.startTime = '1711095616000'; | |||
this.listQuery.endTime = '1711183743000'; | |||
// this.listQuery.startTime = '1711095616000'; | |||
// this.listQuery.endTime = '1711183743000'; | |||
this.urlOptions.getDataListURL(this.listQuery).then(response => { | |||
// this.getSpanArr(this.tableData) | |||
// response.data.forEach((ele) => { | |||
// console.log(ele.size.substring(2, ele.size.length - 2)) | |||
// // console.log(Object.prototype.toString.call(ele.size)) | |||
// // // if (Object.prototype.toString.call(ele.size) === Array) { | |||
// // console.log(11111) | |||
// // console.log(); | |||
// // } | |||
// }) | |||
this.tableData = response.data | |||
// let obj = {} | |||
// response.data.reduce((prev, curr) => { | |||
// console.log(prev, curr) | |||
// }) | |||
// this.tableData.forEach((ele) => { | |||
// ele.size.substring(2, ele.size.length - 2) | |||
// // console.log(Object.prototype.toString.call(ele.size)) | |||
// // // if (Object.prototype.toString.call(ele.size) === Array) { | |||
// // console.log(11111) | |||
// // console.log(); | |||
// // } | |||
// }) | |||
// let obj = {} | |||
// this.tableData.forEach(ele => { | |||
// obj.num += ele.num | |||
// obj.area += ele.num | |||
// obj.count += ele.num | |||
// }) | |||
// console.log(obj); | |||
// this.listQuery.total = response.data.total; | |||
this.dataListLoading = false; | |||
}); | |||
@@ -233,6 +378,7 @@ export default { | |||
// this.listQuery.endTime = '1706230804000'; | |||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; | |||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; | |||
this.listQuery.lineId = val.lineId ? val.lineId : undefined | |||
this.getDataList(); | |||
break; | |||
// case 'reset': | |||
@@ -259,3 +405,13 @@ export default { | |||
}, | |||
}; | |||
</script> | |||
<style> | |||
.baseTable .el-table__body tr.current-row>td.el-table__cell { | |||
background-color: #EAF1FC; | |||
} | |||
.baseTable .el-table .el-table__cell { | |||
padding: 0; | |||
height: 35px; | |||
} | |||
</style> |
@@ -1,13 +1,35 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 14:08:46 | |||
* @LastEditTime: 2024-04-19 15:48:59 | |||
* @LastEditTime: 2024-04-23 15:08:44 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
<template> | |||
<div class="app-container"> | |||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" /> | |||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip"> | |||
<el-form-item label="日" prop="startTime"> | |||
<el-date-picker v-model="listQuery.startTime" value-format="timestamp" type="date" placeholder="选择日期"> | |||
</el-date-picker> | |||
</el-form-item> | |||
<el-form-item label="产线" prop="productionLineId"> | |||
<el-select v-model="listQuery.productionLineId" placeholder="请选择"> | |||
<el-option v-for="item in lineList" :key="item.id" :label="item.name" :value="item.id"> | |||
</el-option> | |||
</el-select> | |||
</el-form-item> | |||
<el-form-item label="" prop=""> | |||
<el-radio-group v-model="radio" @input="handleGetClass"> | |||
<el-radio-button label="早班查询"></el-radio-button> | |||
<el-radio-button label="晚班查询"></el-radio-button> | |||
</el-radio-group> | |||
</el-form-item> | |||
<el-form-item> | |||
<el-button type="primary" size="small" @click="getDataList">查询</el-button> | |||
<el-button type="primary" size="small" plain @click="handleExport">导出</el-button> | |||
</el-form-item> | |||
</el-form> | |||
<!-- <el-table show-summary :header-cell-style="{ | |||
background: '#F2F4F9', | |||
color: '#606266' | |||
@@ -24,19 +46,29 @@ | |||
</el-table-column> | |||
</el-table> --> | |||
<el-table class="baseTable" :span-method="objectSpanMethod" :data="tableData" style="width: 100%"> | |||
<el-table-column label="原料样式" align="right" width="150"> | |||
<el-table-column prop="className" label="时间" width="120"> | |||
<el-table class="baseTable" :data="tableData" style="width: 100%"> | |||
<el-table-column label="时间" align="right" width="150"> | |||
<el-table-column prop="name" label="缺陷" width="120"> | |||
</el-table-column> | |||
</el-table-column> | |||
<el-table-column prop="putType" label="" width="180"> | |||
</el-table-column> | |||
<!-- <el-table-column prop="putType" label="" width="180"> | |||
</el-table-column> --> | |||
<!-- <el-table-column prop label="参考标准及评价方法"> | |||
<el-table-column prop="activityName"></el-table-column> | |||
<el-table-column prop="message"></el-table-column> | |||
</el-table-column> --> | |||
<el-table-column v-for="(item, index) in codeList " :prop="item" :label="item"> | |||
<el-table-column v-for="(item, index) in codeList " :prop="item.prop" :label="item.label"> | |||
</el-table-column> | |||
<div slot="append" v-if="this.tableData.length != 0" style="text-align: center"> | |||
<!--在此处添加你想要插入在表格最后一行的内容--> | |||
<el-col :span="8"> | |||
合计 | |||
</el-col> | |||
<el-col :span="8"> | |||
{{ sum }} | |||
</el-col> | |||
</div> | |||
</el-table> | |||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total" | |||
@pagination="getDataList" /> --> | |||
@@ -57,7 +89,8 @@ | |||
// import basicPage from '../../../core/mixins/basic-page'; | |||
// import { parseTime } from '../../../core/mixins/code-filter'; | |||
import { | |||
getQualityRecordReport | |||
getQualityRecordReport, | |||
getCWSectionList | |||
} from '@/api/report/qcReport'; | |||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; | |||
import FileSaver from 'file-saver' | |||
@@ -114,11 +147,69 @@ export default { | |||
// deleteURL: deleteQualityHotMaterial, | |||
// exportURL: exportFactoryExcel, | |||
}, | |||
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'], | |||
tableData: [], | |||
listQuery: { | |||
"productionLineId": 1696716506443354114, "startTime": "2024-01-19 07:00:00" | |||
startTime: null, | |||
productionLineId:null, | |||
}, | |||
sum:null, | |||
radio:'晚班查询', | |||
lineList:[], | |||
codeList: [ | |||
{ | |||
label: '19:00', | |||
prop: 'num0' | |||
}, | |||
{ | |||
label: '20:00', | |||
prop: 'num1' | |||
}, | |||
{ | |||
label: '21:00', | |||
prop: 'num2' | |||
}, | |||
{ | |||
label: '22:00', | |||
prop: 'num3' | |||
}, | |||
{ | |||
label: '23:00', | |||
prop: 'num4' | |||
}, | |||
{ | |||
label: '00:00', | |||
prop: 'num5' | |||
}, | |||
{ | |||
label: '01:00', | |||
prop: 'num6' | |||
}, | |||
{ | |||
label: '02:00', | |||
prop: 'num7' | |||
}, | |||
{ | |||
label: '03:00', | |||
prop: 'num8' | |||
}, | |||
{ | |||
label: '04:00', | |||
prop: 'num9' | |||
}, | |||
{ | |||
label: '05:00', | |||
prop: 'num10' | |||
}, | |||
{ | |||
label: '06:00', | |||
prop: 'num11' | |||
}, | |||
{ | |||
label: '合计', | |||
prop: 'sum' | |||
} | |||
], | |||
tableData: [], | |||
formConfig: [ | |||
{ | |||
type: 'datePicker', | |||
@@ -131,7 +222,7 @@ export default { | |||
endPlaceholder: '结束时间', | |||
param: 'checkTime', | |||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], | |||
width: 250 | |||
width: 350 | |||
}, | |||
{ | |||
type: 'button', | |||
@@ -156,38 +247,189 @@ export default { | |||
}, | |||
mounted() { | |||
// this.formConfig[1].defaultSelect[] | |||
this.listQuery.startTime = this.formConfig[0].defaultSelect[0] | |||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] | |||
// this.listQuery.startTime = this.formConfig[0].defaultSelect[0] | |||
// this.listQuery.endTime = this.formConfig[0].defaultSelect[1] | |||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 | |||
this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime() | |||
this.getDataList() | |||
this.getDict() | |||
// this.getSpanArr(this.tableData) | |||
// this.getDict(); | |||
}, | |||
methods: { | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
let spanOneArr = [], concatOne = 0; | |||
this.tableData.map((item, index) => { | |||
if (index === 0) { | |||
spanOneArr.push(1); | |||
} else { | |||
//第一列需合并相同内容的判断条件 | |||
if (item.className === this.tableData[index - 1].className) { | |||
spanOneArr[concatOne] += 1; | |||
spanOneArr.push(0); | |||
} else { | |||
spanOneArr.push(1); | |||
concatOne = index; | |||
}; | |||
} | |||
}); | |||
async getDict() { | |||
const res = await getCWSectionList() | |||
console.log(res) | |||
this.lineList = res.data | |||
}, | |||
// objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
// let spanOneArr = [], concatOne = 0; | |||
// this.tableData.map((item, index) => { | |||
// if (index === 0) { | |||
// spanOneArr.push(1); | |||
// } else { | |||
// //第一列需合并相同内容的判断条件 | |||
// if (item.className === this.tableData[index - 1].className) { | |||
// spanOneArr[concatOne] += 1; | |||
// spanOneArr.push(0); | |||
// } else { | |||
// spanOneArr.push(1); | |||
// concatOne = index; | |||
// }; | |||
// } | |||
// }); | |||
if (columnIndex === 0) { | |||
const _row = spanOneArr[rowIndex]; | |||
const _col = _row > 0 ? 1 : 0; | |||
return { | |||
rowspan: _row, | |||
colspan: _col | |||
} | |||
// if (columnIndex === 0) { | |||
// const _row = spanOneArr[rowIndex]; | |||
// const _col = _row > 0 ? 1 : 0; | |||
// return { | |||
// rowspan: _row, | |||
// colspan: _col | |||
// } | |||
// } | |||
// }, | |||
formatDateTime(time) { | |||
var date = new Date(time); | |||
var y = date.getFullYear(); | |||
var m = date.getMonth() + 1; | |||
m = m < 10 ? ('0' + m) : m; | |||
var d = date.getDate(); | |||
d = d < 10 ? ('0' + d) : d; | |||
var h = date.getHours(); | |||
h = h < 10 ? ('0' + h) : h; | |||
var minute = date.getMinutes(); | |||
var second = date.getSeconds(); | |||
minute = minute < 10 ? ('0' + minute) : minute; | |||
second = second < 10 ? ('0' + second) : second; | |||
return y + '-' + m + '-' + d + ' ' + h + ':' + minute + ':' + second; | |||
}, | |||
handleGetClass(e) { | |||
this.listQuery.startTime = new Date(new Date().setHours(0, 7, 0, 0)).getTime() | |||
// console.log(startTime1) | |||
this.codeList = [] | |||
if (e === '早班查询') { | |||
let arr = [ | |||
{ | |||
label: '07:00', | |||
prop:'num0' | |||
}, | |||
{ | |||
label: '08:00', | |||
prop: 'num1' | |||
}, | |||
{ | |||
label: '09:00', | |||
prop: 'num2' | |||
}, | |||
{ | |||
label: '10:00', | |||
prop: 'num3' | |||
}, | |||
{ | |||
label: '11:00', | |||
prop: 'num4' | |||
}, | |||
{ | |||
label: '12:00', | |||
prop: 'num5' | |||
}, | |||
{ | |||
label: '13:00', | |||
prop: 'num6' | |||
}, | |||
{ | |||
label: '14:00', | |||
prop: 'num7' | |||
}, | |||
{ | |||
label: '15:00', | |||
prop: 'num8' | |||
}, | |||
{ | |||
label: '16:00', | |||
prop: 'num9' | |||
}, | |||
{ | |||
label: '17:00', | |||
prop: 'num10' | |||
}, | |||
{ | |||
label: '18:00', | |||
prop: 'num11' | |||
}, | |||
{ | |||
label: '合计', | |||
prop: 'sum' | |||
} | |||
] | |||
arr.forEach((ele,index) => [ | |||
this.codeList.push(ele) | |||
]) | |||
this.getDataList() | |||
} else { | |||
// this.codeList = [] | |||
this.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime() | |||
let arr = [ | |||
{ | |||
label: '19:00', | |||
prop: 'num0' | |||
}, | |||
{ | |||
label: '20:00', | |||
prop: 'num1' | |||
}, | |||
{ | |||
label: '21:00', | |||
prop: 'num2' | |||
}, | |||
{ | |||
label: '22:00', | |||
prop: 'num3' | |||
}, | |||
{ | |||
label: '23:00', | |||
prop: 'num4' | |||
}, | |||
{ | |||
label: '00:00', | |||
prop: 'num5' | |||
}, | |||
{ | |||
label: '01:00', | |||
prop: 'num6' | |||
}, | |||
{ | |||
label: '02:00', | |||
prop: 'num7' | |||
}, | |||
{ | |||
label: '03:00', | |||
prop: 'num8' | |||
}, | |||
{ | |||
label: '04:00', | |||
prop: 'num9' | |||
}, | |||
{ | |||
label: '05:00', | |||
prop: 'num10' | |||
}, | |||
{ | |||
label: '06:00', | |||
prop: 'num11' | |||
}, | |||
{ | |||
label: '合计', | |||
prop: 'sum' | |||
} | |||
] | |||
arr.forEach((ele, index) => [ | |||
this.codeList.push(ele) | |||
]) | |||
this.getDataList() | |||
} | |||
}, | |||
handleExport() { | |||
@@ -238,8 +480,36 @@ export default { | |||
this.dataListLoading = true; | |||
// this.listQuery.startTime = '1713197388000'; | |||
// this.listQuery.endTime = '1713254961000'; | |||
this.urlOptions.getDataListURL(this.listQuery).then(res => { | |||
console.log(res.data); | |||
this.urlOptions.getDataListURL({ | |||
// productionLineId: '1696716506443354114', | |||
// startTime: '1705618800000' | |||
productionLineId: this.listQuery.productionLineId, | |||
startTime:this.listQuery.startTime | |||
},).then(res => { | |||
let count = 0 | |||
let arr = [] | |||
console.log(res.data) | |||
this.sum = res.data.allSum | |||
for (let i in res.data.qualityInspectionRecordReportLineVOMap) { | |||
count ++, | |||
console.log(res.data.qualityInspectionRecordReportLineVOMap[i]) | |||
// arr.push({ | |||
// }) | |||
// console.log(arr) | |||
let obj = { | |||
name: res.data.qualityInspectionRecordReportLineVOMap[i].content, | |||
sum: res.data.qualityInspectionRecordReportLineVOMap[i].sum, | |||
} | |||
res.data.qualityInspectionRecordReportLineVOMap[i].nums.forEach((ele, index) => { | |||
obj['num' +index] = ele | |||
// console.log(arr[count]) | |||
// arr[count]['num'+index] = ele | |||
}) | |||
arr.push(obj) | |||
} | |||
console.log(arr); | |||
this.tableData = arr | |||
// console.log(res) | |||
// console.log(res.data) | |||
// let arr = [ | |||
@@ -369,8 +639,8 @@ export default { | |||
buttonClick(val) { | |||
switch (val.btnName) { | |||
case 'search': | |||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; | |||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; | |||
// this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; | |||
// this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; | |||
this.getDataList(); | |||
break; | |||
case 'export': | |||
@@ -383,25 +653,24 @@ export default { | |||
}, | |||
}; | |||
</script> | |||
<style> | |||
.baseTable .el-table__body tr.current-row>td.el-table__cell { | |||
<style scoped> | |||
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell { | |||
background-color: #EAF1FC; | |||
} | |||
.baseTable .el-table .el-table__cell { | |||
::v-deep .baseTable .el-table .el-table__cell { | |||
padding: 0; | |||
height: 35px; | |||
} | |||
.el-table thead.is-group th { | |||
::v-deep.el-table thead.is-group th { | |||
background: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:first-of-type { | |||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type { | |||
border-bottom: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:first-of-type:before { | |||
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before { | |||
content: ''; | |||
position: absolute; | |||
width: 1px; | |||
@@ -417,7 +686,7 @@ export default { | |||
transform-origin: top; | |||
} | |||
.el-table thead.is-group tr:last-of-type th:first-of-type:before { | |||
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before { | |||
content: ''; | |||
position: absolute; | |||
width: 1px; | |||
@@ -432,4 +701,5 @@ export default { | |||
/*这里需要自己调整,根据线的位置*/ | |||
transform-origin: bottom; | |||
} | |||
</style> |
@@ -0,0 +1,345 @@ | |||
<template> | |||
<div class="app-container isra-line-report"> | |||
<!-- 搜索工作栏 --> | |||
<search-bar | |||
:formConfigs="formConfig" | |||
@headBtnClick="buttonClick" /> | |||
<base-table | |||
class="israLineReportTable1" | |||
ref="israLineReportTable11" | |||
id="israLineReportTable1" | |||
:table-props="tableProp" | |||
:table-data="tableData" | |||
:span-method="objectSpanMethod" | |||
:max-height="tableH" /> | |||
</div> | |||
</template> | |||
<script> | |||
const tableProp1 = [ | |||
{ | |||
prop: 'dataStr', | |||
label: '日期', | |||
width: 110, | |||
fixed: true, | |||
}, | |||
{ | |||
prop: 'lineName', | |||
label: '生产线', | |||
width: 110, | |||
fixed: true, | |||
}, | |||
{ | |||
label: '类型', | |||
fixed: true, | |||
width: 110, | |||
children: [ | |||
{ | |||
prop: 'className', | |||
label: '班次', | |||
width: 140, | |||
}, | |||
], | |||
}, | |||
]; | |||
import { israData } from '@/api/report/customizedReports'; | |||
import moment from 'moment'; | |||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; | |||
import { getOriginalLine } from '@/api/report/customizedReports'; | |||
import FileSaver from 'file-saver'; | |||
export default { | |||
name: 'IsraLineReport', | |||
mixins: [tableHeightMixin], | |||
data() { | |||
return { | |||
heightNum: 215, | |||
formConfig: [ | |||
{ | |||
type: 'datePicker', | |||
label: '时间段', | |||
dateType: 'daterange', | |||
format: 'yyyy-MM-dd', | |||
valueFormat: 'yyyy-MM-dd', | |||
rangeSeparator: '-', | |||
startPlaceholder: '开始时间', | |||
endPlaceholder: '结束时间', | |||
param: 'timeVal', | |||
defaultSelect: [], | |||
width: 250, | |||
}, | |||
{ | |||
type: 'select', | |||
label: '产线', | |||
selectOptions: [], | |||
param: 'lineId', | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '查询', | |||
name: 'search', | |||
color: 'primary', | |||
}, | |||
{ | |||
type: 'separate', | |||
}, | |||
{ | |||
type: 'button', | |||
btnName: '导出', | |||
name: 'export', | |||
plain: true, | |||
color: 'primary', | |||
}, | |||
], | |||
queryParams: { | |||
startTime: '', | |||
endTime: '', | |||
lineId: '', | |||
}, | |||
tableProp1, | |||
tableProp: [], | |||
tableData: [], | |||
span: [], //表第一列合并 | |||
}; | |||
}, | |||
created() { | |||
this.getLine(); | |||
}, | |||
mounted() { | |||
this.tableProp = this.tableProp1; | |||
let start = moment().format('yyyy-MM-DD'); | |||
let end = moment().format('yyyy-MM-DD'); | |||
this.formConfig[0].defaultSelect = [start, end]; | |||
this.queryParams.startTime = moment(start + ' 00:00:00').valueOf(); | |||
this.queryParams.endTime = moment(end + ' 23:59:59').valueOf(); | |||
this.getList(); | |||
}, | |||
methods: { | |||
getLine() { | |||
getOriginalLine().then((res) => { | |||
this.formConfig[1].selectOptions = res.data || []; | |||
}); | |||
}, | |||
getList() { | |||
israData({ ...this.queryParams }).then((res) => { | |||
this.tableProp = []; | |||
let data = res.data; | |||
if (data.length > 0) { | |||
let typeArr = data[0].allType; | |||
let arr = []; | |||
typeArr && | |||
typeArr.map((item) => { | |||
let obj = {}; | |||
obj.prop = item.name; | |||
obj.label = item.name; | |||
obj.minWidth = 120; | |||
arr.push(obj); | |||
}); | |||
this.tableProp = this.tableProp1.concat(arr); //表头 | |||
this.transformData(data); | |||
} | |||
}); | |||
}, | |||
transformData(data) { | |||
let part1Data = []; | |||
let part2Data = []; | |||
for (let i = 0; i < data.length; i++) { | |||
let obj = {}; | |||
let arr = []; | |||
arr = this.uniqueLine(data[i].allClass, 'lineName'); | |||
obj.dataStr = data[i].dataStr; | |||
obj.dayClass = []; | |||
obj.allClass = []; | |||
obj.nightClass = []; | |||
obj.num = arr.length; | |||
arr.length > 0 && | |||
arr.map((item) => { | |||
// 白班 | |||
let dobj = {}; | |||
dobj.className = '白班'; | |||
dobj.dataStr = data[i].dataStr; | |||
for (let a = 0; a < data[i].dayClass.length; a++) { | |||
dobj.lineName = item.lineName; | |||
if (item.lineName === data[i].dayClass[a].lineName) { | |||
dobj[data[i].dayClass[a].checkType] = | |||
data[i].dayClass[a].checkNum; | |||
} | |||
} | |||
obj.dayClass.push(dobj); | |||
// 夜班 | |||
let nobj = {}; | |||
nobj.className = '夜班'; | |||
nobj.dataStr = data[i].dataStr; | |||
for (let a = 0; a < data[i].nightClass.length; a++) { | |||
nobj.lineName = item.lineName; | |||
if (item.lineName === data[i].nightClass[a].lineName) { | |||
nobj[data[i].nightClass[a].checkType] = | |||
data[i].nightClass[a].checkNum; | |||
} | |||
} | |||
obj.nightClass.push(nobj); | |||
// 合计 | |||
let sobj = {}; | |||
sobj.className = '合计'; | |||
sobj.dataStr = data[i].dataStr; | |||
for (let a = 0; a < data[i].allClass.length; a++) { | |||
sobj.lineName = item.lineName; | |||
if (item.lineName === data[i].allClass[a].lineName) { | |||
sobj[data[i].allClass[a].checkType] = | |||
data[i].allClass[a].checkNum; | |||
} | |||
} | |||
obj.allClass.push(sobj); | |||
}); | |||
part1Data.push(obj); | |||
} | |||
for (let j = 0; j < part1Data.length; j++) { | |||
for (let k = 0; k < part1Data[j].num; k++) { | |||
part2Data.push(part1Data[j].dayClass[k]); | |||
part2Data.push(part1Data[j].nightClass[k]); | |||
part2Data.push(part1Data[j].allClass[k]); | |||
} | |||
} | |||
this.tableData = part2Data; | |||
this.getSpanArr(this.tableData); | |||
this.$nextTick(() => { | |||
this.reTable(); | |||
}); | |||
}, | |||
reTable() { | |||
this.$refs.israLineReportTable11.doLayout('israLineReportTable1'); | |||
}, | |||
// 产线去重 | |||
uniqueLine(arr, prop) { | |||
return arr.filter((value, index, self) => { | |||
return ( | |||
self.findIndex((t) => { | |||
return t[prop] === value[prop]; | |||
}) === index | |||
); | |||
}); | |||
}, | |||
// 获取合并行 | |||
getSpanArr(data) { | |||
this.span = []; | |||
for (var i = 0; i < data.length; i++) { | |||
if (i === 0) { | |||
this.span.push(1); | |||
this.index = 0; | |||
} else { | |||
if (data[i].dataStr === data[i - 1].dataStr) { | |||
this.span[this.index] += 1; | |||
this.span.push(0); | |||
} else { | |||
this.span.push(1); | |||
this.index = i; | |||
} | |||
} | |||
} | |||
}, | |||
buttonClick(val) { | |||
if (val.btnName === 'search') { | |||
if (val.timeVal && val.timeVal.length > 0) { | |||
this.queryParams.startTime = moment( | |||
val.timeVal[0] + ' 00:00:00' | |||
).valueOf(); | |||
this.queryParams.endTime = moment( | |||
val.timeVal[1] + ' 23:59:59' | |||
).valueOf(); | |||
} | |||
this.queryParams.lineId = val.lineId; | |||
this.getList(); | |||
} else { | |||
// 导出 | |||
this.exportTable(); | |||
} | |||
}, | |||
exportTable() { | |||
// 处理查询参数 | |||
var fix = document.querySelectorAll('.el-table__fixed')[0]; | |||
var table = document.querySelector('.israLineReportTable1').childNodes[0]; | |||
var wb; | |||
import('xlsx').then((excel) => { | |||
if (fix) { | |||
wb = excel.utils.table_to_book(table.removeChild(fix)); | |||
table.appendChild(fix); | |||
} else { | |||
wb = excel.utils.table_to_book(table); | |||
} | |||
/* 获取二进制字符串作为输出 */ | |||
var wbout = excel.write(wb, { | |||
bookType: 'xlsx', | |||
bookSST: true, | |||
type: 'array', | |||
}); | |||
try { | |||
FileSaver.saveAs( | |||
new Blob([wbout], { type: 'application/octet-stream' }), | |||
//设置导出文件名称 | |||
'原片各线isra数据.xlsx' | |||
); | |||
} catch (e) { | |||
if (typeof console !== 'undefined') console.log(e, wbout); | |||
} | |||
return wbout; | |||
}); | |||
}, | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
if (columnIndex === 0) { | |||
const _row = this.span[rowIndex]; | |||
return { | |||
rowspan: _row, | |||
colspan: 1, | |||
}; | |||
} else if (columnIndex === 1) { | |||
if (rowIndex % 3 === 0) { | |||
return { | |||
rowspan: 3, | |||
colspan: 1, | |||
}; | |||
} else { | |||
return { | |||
rowspan: 0, | |||
colspan: 0, | |||
}; | |||
} | |||
} | |||
}, | |||
}, | |||
}; | |||
</script> | |||
<style lang="scss"> | |||
.isra-line-report { | |||
.el-table thead.is-group tr:first-of-type th:nth-child(3) { | |||
border-bottom: none; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:nth-child(3) div.cell { | |||
padding-left: 82px; | |||
} | |||
.el-table th.el-table__cell { | |||
height: 28px; | |||
} | |||
.el-table thead.is-group tr:first-of-type th:nth-child(3):before { | |||
content: ''; | |||
position: absolute; | |||
height: 80px; | |||
top: 0; | |||
left: 0; | |||
background-color: #ebeef5; | |||
transform: rotate(-70deg); | |||
-webkit-transform-origin: top; | |||
transform-origin: top; | |||
width: 1px; | |||
} | |||
.el-table thead.is-group tr:last-of-type th:nth-child(1):before { | |||
content: ''; | |||
position: absolute; | |||
height: 67px; | |||
top: 0; | |||
left: 75px; | |||
background-color: #ebeef5; | |||
transform: rotate(-70deg); | |||
-webkit-transform-origin: top; | |||
transform-origin: top; | |||
width: 1px; | |||
} | |||
} | |||
</style> |
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 10:01:33 | |||
* @LastEditTime: 2024-04-18 16:26:48 | |||
* @LastEditTime: 2024-04-23 15:15:45 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -35,7 +35,8 @@ | |||
// import basicPage from '../../../core/mixins/basic-page'; | |||
// import { parseTime } from '../../../core/mixins/code-filter'; | |||
import { | |||
getOriginalData | |||
getOriginalData, | |||
getOriginalLineDataList | |||
} from '@/api/report/qcReport'; | |||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; | |||
import FileSaver from 'file-saver' | |||
@@ -98,7 +99,8 @@ export default { | |||
pos: 0, | |||
listQuery: { | |||
startTime: undefined, | |||
endTime:undefined | |||
endTime: undefined, | |||
lineId:null, | |||
}, | |||
formConfig: [ | |||
// { | |||
@@ -127,7 +129,16 @@ export default { | |||
endPlaceholder: '结束时间', | |||
param: 'checkTime', | |||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], | |||
width: 250 | |||
width: 350 | |||
}, | |||
{ | |||
type: 'select', | |||
label: '产线', | |||
selectOptions: [], | |||
labelField: 'name', | |||
valueField: 'id', | |||
param: 'lineId', | |||
filterable: true | |||
}, | |||
{ | |||
type:'button', | |||
@@ -159,39 +170,45 @@ export default { | |||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] | |||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 | |||
this.getDataList() | |||
this.getDict() | |||
// this.getSpanArr(this.tableData) | |||
// this.getDict(); | |||
}, | |||
methods: { | |||
getSummaries(param) { | |||
console.log(columns) | |||
async getDict() { | |||
const res = await getOriginalLineDataList() | |||
console.log(res) | |||
this.formConfig[1].selectOptions = res.data | |||
}, | |||
// getSummaries(param) { | |||
// console.log(columns) | |||
const { columns, data } = param; | |||
const sums = []; | |||
columns.forEach((column, index) => { | |||
if (index === 0) { | |||
sums[index] = '合计'; | |||
return; | |||
} | |||
const values = data.map(item => Number(item[column.property])); | |||
// const data = data.map(item => !Number(item[column.property])); | |||
if (!values.every(value => isNaN(value))) { | |||
sums[index] = values.reduce((prev, curr) => { | |||
const value = Number(curr); | |||
if (!isNaN(value)) { | |||
return prev + curr; | |||
} else { | |||
return prev; | |||
} | |||
}, 0); | |||
sums[index] += ' '; | |||
} else { | |||
sums[index] = '-'; | |||
} | |||
}); | |||
// const { columns, data } = param; | |||
// const sums = []; | |||
// columns.forEach((column, index) => { | |||
// if (index === 0) { | |||
// sums[index] = '合计'; | |||
// return; | |||
// } | |||
// const values = data.map(item => Number(item[column.property])); | |||
// // const data = data.map(item => !Number(item[column.property])); | |||
// if (!values.every(value => isNaN(value))) { | |||
// sums[index] = values.reduce((prev, curr) => { | |||
// const value = Number(curr); | |||
// if (!isNaN(value)) { | |||
// return prev + curr; | |||
// } else { | |||
// return prev; | |||
// } | |||
// }, 0); | |||
// sums[index] += ' '; | |||
// } else { | |||
// sums[index] = '-'; | |||
// } | |||
// }); | |||
return sums; | |||
}, | |||
// return sums; | |||
// }, | |||
objectSpanMethod({ row, column, rowIndex, columnIndex }) { | |||
let spanOneArr = [], concatOne = 0; | |||
this.tableData.map((item, index) => { | |||
@@ -264,8 +281,8 @@ export default { | |||
// 获取数据列表 | |||
getDataList() { | |||
this.dataListLoading = true; | |||
this.listQuery.startTime = '1711095616000'; | |||
this.listQuery.endTime = '1711183743000'; | |||
// this.listQuery.startTime = '1711095616000'; | |||
// this.listQuery.endTime = '1711183743000'; | |||
this.urlOptions.getDataListURL(this.listQuery).then(response => { | |||
// this.getSpanArr(this.tableData) | |||
// response.data.forEach((ele) => { | |||
@@ -346,6 +363,7 @@ export default { | |||
// this.listQuery.endTime = '1706230804000'; | |||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; | |||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; | |||
this.listQuery.lineId = val.lineId ? val.lineId : undefined | |||
this.getDataList(); | |||
break; | |||
// case 'reset': | |||
@@ -1,7 +1,7 @@ | |||
<!-- | |||
* @Author: zhp | |||
* @Date: 2024-04-18 15:07:53 | |||
* @LastEditTime: 2024-04-18 15:26:50 | |||
* @LastEditTime: 2024-04-23 15:15:52 | |||
* @LastEditors: zhp | |||
* @Description: | |||
--> | |||
@@ -35,7 +35,8 @@ | |||
// import basicPage from '../../../core/mixins/basic-page'; | |||
// import { parseTime } from '../../../core/mixins/code-filter'; | |||
import { | |||
getCuttingtData | |||
getCuttingtData, | |||
getOriginalLineDataList | |||
} from '@/api/report/qcReport'; | |||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin'; | |||
import FileSaver from 'file-saver' | |||
@@ -97,7 +98,8 @@ export default { | |||
pos: 0, | |||
listQuery: { | |||
startTime: undefined, | |||
endTime:undefined | |||
endTime: undefined, | |||
lineId:undefined | |||
}, | |||
formConfig: [ | |||
// { | |||
@@ -126,7 +128,16 @@ export default { | |||
endPlaceholder: '结束时间', | |||
param: 'checkTime', | |||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()], | |||
width: 250 | |||
width: 350 | |||
}, | |||
{ | |||
type: 'select', | |||
label: '产线', | |||
selectOptions: [], | |||
labelField: 'name', | |||
valueField: 'id', | |||
param: 'lineId', | |||
filterable: true | |||
}, | |||
{ | |||
type:'button', | |||
@@ -158,10 +169,16 @@ export default { | |||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1] | |||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000 | |||
this.getDataList() | |||
this.getDict() | |||
// this.getSpanArr(this.tableData) | |||
// this.getDict(); | |||
}, | |||
methods: { | |||
async getDict() { | |||
const res = await getOriginalLineDataList() | |||
console.log(res) | |||
this.formConfig[1].selectOptions = res.data | |||
}, | |||
getSummaries(param) { | |||
console.log(columns) | |||
@@ -281,8 +298,8 @@ export default { | |||
// 获取数据列表 | |||
getDataList() { | |||
this.dataListLoading = true; | |||
this.listQuery.startTime = '1706144404000'; | |||
this.listQuery.endTime = '1706230804000'; | |||
// this.listQuery.startTime = '1706144404000'; | |||
// this.listQuery.endTime = '1706230804000'; | |||
this.urlOptions.getDataListURL(this.listQuery).then(response => { | |||
// this.getSpanArr(this.tableData) | |||
// response.data.forEach((ele) => { | |||
@@ -368,6 +385,7 @@ export default { | |||
// this.listQuery.endTime = '1706230804000'; | |||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined; | |||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined; | |||
this.listQuery.lineId = val.lineId ? val.lineId : undefined | |||
this.getDataList(); | |||
break; | |||
// case 'reset': | |||