Compare commits
47 Commits
391e06a382
...
projects/m
| Author | SHA1 | Date | |
|---|---|---|---|
| ec0c09a674 | |||
|
|
90e9b179eb | ||
|
|
8e2b332c7b | ||
| f37a12d2e1 | |||
| cb19872012 | |||
|
|
8ba79185d4 | ||
|
|
104cda5a41 | ||
|
|
151c5708c4 | ||
| 837735b7e8 | |||
|
|
e00a08385f | ||
|
|
a8c3d2c585 | ||
| eb097e77bd | |||
|
|
30eecb8bd1 | ||
|
|
f4a6229170 | ||
| ab593bff20 | |||
| 4b01dd3ec3 | |||
| ed3ea7dde8 | |||
| 1d9e272f99 | |||
|
|
43c9153777 | ||
|
|
c6d504583b | ||
|
|
22f3c87f02 | ||
|
|
1f54c9179d | ||
| f7247f5161 | |||
|
|
c8856f34b5 | ||
|
|
42c42abc08 | ||
| 0fffed9b0e | |||
|
|
d251daa3f5 | ||
|
|
ed5120ca97 | ||
|
|
becf34d089 | ||
| f0d64de77b | |||
| 56819176b3 | |||
| d302179f6f | |||
| 8c117fae8e | |||
|
|
b6cf7b2ddc | ||
|
|
2f98b42bd2 | ||
| fb8ae9226a | |||
| 3d3763c4ef | |||
| ea675b9dea | |||
| bda065e4be | |||
|
|
5ea4c219ed | ||
|
|
16186667da | ||
|
|
c7cd6e7b1e | ||
|
|
29c3a9fb72 | ||
|
|
1e1313d090 | ||
| d0eb1d84c8 | |||
|
|
445d8f4818 | ||
|
|
46ce982cfc |
12
.env.dev
12
.env.dev
@@ -1,8 +1,8 @@
|
|||||||
###
|
###
|
||||||
# @Author: zhp
|
# @Author: zhp
|
||||||
# @Date: 2024-04-12 14:30:48
|
# @Date: 2024-04-12 14:30:48
|
||||||
# @LastEditTime: 2024-04-12 14:31:16
|
# @LastEditTime: 2024-04-23 17:25:25
|
||||||
# @LastEditors: zhp
|
# @LastEditors: DY
|
||||||
# @Description:
|
# @Description:
|
||||||
###
|
###
|
||||||
# 开发环境配置
|
# 开发环境配置
|
||||||
@@ -13,14 +13,14 @@ VUE_APP_TITLE = MES系统
|
|||||||
|
|
||||||
# 芋道管理系统/开发环境
|
# 芋道管理系统/开发环境
|
||||||
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
|
VUE_APP_BASE_API = 'http://192.168.0.33: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地址(现场)
|
# socket地址(现场)
|
||||||
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
|
||||||
# socket地址(公司线上)
|
# socket地址(公司线上)
|
||||||
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
|
# VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
|
||||||
# socket dcs地址(只有现场)
|
# socket dcs地址(只有现场)
|
||||||
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-10-21 11:50:46
|
* @Date: 2023-10-21 11:50:46
|
||||||
* @LastEditTime: 2023-10-30 14:37:28
|
* @LastEditTime: 2024-04-19 17:13:24
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@@ -65,4 +65,13 @@ export function getCoreDepartmentList(query) {
|
|||||||
method: 'get',
|
method: 'get',
|
||||||
params: query
|
params: query
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 设备获得所有列表
|
||||||
|
export function getDepartmentList(query) {
|
||||||
|
return request({
|
||||||
|
url: '/system/dept/list-all-simple',
|
||||||
|
method: 'get',
|
||||||
|
params: query
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|||||||
45
src/api/report/customizedReports.js
Normal file
45
src/api/report/customizedReports.js
Normal file
@@ -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
|
* @Author: zhp
|
||||||
* @Date: 2024-04-18 09:27:54
|
* @Date: 2024-04-18 09:27:54
|
||||||
* @LastEditTime: 2024-04-18 16:00:59
|
* @LastEditTime: 2024-04-23 15:16:12
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
*/
|
*/
|
||||||
@@ -38,3 +38,59 @@ export function getAutoDailyData(data) {
|
|||||||
data: data
|
data: 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
|
* @Author: zhp
|
||||||
* @Date: 2024-01-29 16:50:26
|
* @Date: 2024-01-29 16:50:26
|
||||||
* @LastEditTime: 2024-04-16 13:44:14
|
* @LastEditTime: 2024-04-22 09:42:45
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -34,7 +34,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
|
<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'">
|
:title-icon="'energyMonitoring'">
|
||||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||||
<top-radio-group />
|
<top-radio-group />
|
||||||
@@ -53,7 +53,8 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8">
|
<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"
|
<!-- <base-table1 :page="1" :limit="999" :show-index="false" :table-config="ISRATableProps"
|
||||||
:table-data="ISRAList" /> -->
|
:table-data="ISRAList" /> -->
|
||||||
<ISRAChart ref="ISRAChart" />
|
<ISRAChart ref="ISRAChart" />
|
||||||
@@ -64,8 +65,8 @@
|
|||||||
|
|
||||||
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="10" type="flex" class="flex-1">
|
<el-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="10" type="flex" class="flex-1">
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||||
<base-container :no-content-padding="true" :height="256" :title="'废片 缺陷数据'" :size="'eqStatus'"
|
<base-container :show-time="true" :no-content-padding="true" :height="256" :title="'废片 缺陷数据'"
|
||||||
:title-icon="'scrap'">
|
:size="'eqStatus'" :title-icon="'scrap'">
|
||||||
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||||
<top-radio-group />
|
<top-radio-group />
|
||||||
</div> -->
|
</div> -->
|
||||||
@@ -98,7 +99,8 @@
|
|||||||
</base-container>
|
</base-container>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="14">
|
<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;">
|
<!-- <div style="width: 45%;position: absolute; top: 3em; right: 3em;">
|
||||||
<top-radio-group />
|
<top-radio-group />
|
||||||
</div> -->
|
</div> -->
|
||||||
@@ -625,8 +627,8 @@ export default {
|
|||||||
`<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
|
`<span style="color:rgba(255,255,255,0.5)">${this.getSize(item.size) || ''}</span>`,
|
||||||
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`,
|
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.productArea) + '㎡' || ''}</span>`,
|
||||||
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`,
|
`<span style="color:rgba(255,255,255,0.5)">${this.NumFormat(item.wasteArea) + '㎡' || ''}</span>`,
|
||||||
`<div style = "${(item.product * 100).toFixed(0) > 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
|
`<div style = "${(item.product * 100).toFixed(0) >= 91 ? 'display:block;color:#00FFF7' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>
|
||||||
<div style = "${(item.product * 100).toFixed(0) < 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>`
|
<div style = "${(item.product * 100).toFixed(0) <= 91 ? 'display:block; color:rgba(255, 209, 96, 1)' : 'display:none;'}">${(item.product * 100).toFixed(0) + '%' || ''}</div>`
|
||||||
])
|
])
|
||||||
this.cutConfig.data = cutArr
|
this.cutConfig.data = cutArr
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
@@ -652,7 +654,7 @@ export default {
|
|||||||
wasteList.push(ele.wastArea)
|
wasteList.push(ele.wastArea)
|
||||||
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
|
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
|
||||||
sumAreaList.push(ele.sumArea)
|
sumAreaList.push(ele.sumArea)
|
||||||
yieldList.push(parseFloat((ele.yield * 100).toFixed(0)))
|
yieldList.push(parseFloat((ele.yield * 100).toFixed(2)))
|
||||||
})
|
})
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
|
||||||
|
|||||||
@@ -170,11 +170,11 @@ export default {
|
|||||||
},
|
},
|
||||||
formatter: (params) => {
|
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: { // 提示文字的样式
|
textStyle: { // 提示文字的样式
|
||||||
// color: '#595959',
|
// color: '#595959',
|
||||||
fontSize: 18
|
fontSize: 16
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: gtz
|
* @Author: gtz
|
||||||
* @Date: 2022-01-19 15:58:17
|
* @Date: 2022-01-19 15:58:17
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2024-03-29 14:47:29
|
* @LastEditTime: 2024-04-22 09:41:21
|
||||||
* @Description: file content
|
* @Description: file content
|
||||||
* @FilePath: \mt-bus-fe\src\views\OperationalOverview\components\baseContainer\index.vue
|
* @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;">
|
<!-- <span v-if="showTime" style="font-size: 20px;color:#52FFF8;margin-left: 10px;margin-top: 2px;">
|
||||||
{{ time2 +'-'+ time }}
|
{{ time2 +'-'+ time }}
|
||||||
</span> -->
|
</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 }}
|
{{ startTime + '-' + endTime }}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -56,6 +56,10 @@ export default {
|
|||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
},
|
},
|
||||||
|
showTime: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
noPadding: {
|
noPadding: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: false
|
default: false
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-09-21 09:06:28
|
* @Date: 2023-09-21 09:06:28
|
||||||
* @LastEditTime: 2024-04-16 13:39:25
|
* @LastEditTime: 2024-04-23 15:34:56
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -83,6 +83,9 @@ export default {
|
|||||||
this.chart = null
|
this.chart = null
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// getNumLength(num) {
|
||||||
|
// return num.toString().length;
|
||||||
|
// },
|
||||||
initChart(nameList, passRateList, outputNumList) {
|
initChart(nameList, passRateList, outputNumList) {
|
||||||
console.log(nameList, passRateList)
|
console.log(nameList, passRateList)
|
||||||
let series= [
|
let series= [
|
||||||
@@ -97,7 +100,7 @@ export default {
|
|||||||
{ offset: 0.3, color: '#1295FF' }
|
{ offset: 0.3, color: '#1295FF' }
|
||||||
]),
|
]),
|
||||||
label: {
|
label: {
|
||||||
show: true, //开启显示
|
show: false, //开启显示
|
||||||
position: 'top', //在上方显示
|
position: 'top', //在上方显示
|
||||||
textStyle: { //数值样式
|
textStyle: { //数值样式
|
||||||
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
color: 'rgba(255,255,255,0.5)', // 坐标值得具体的颜色
|
||||||
@@ -218,11 +221,10 @@ export default {
|
|||||||
// },
|
// },
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
min: function() { // 取最小值向下取整为最小刻度
|
min: function () { // 取最小值向下取整为最小刻度
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
max: function(value) { // 取最大值向上取整为最大刻度
|
max: function (value) { // 取最大值向上取整为最大刻度
|
||||||
return Math.ceil(value.max)
|
|
||||||
},
|
},
|
||||||
scale: true,
|
scale: true,
|
||||||
type: 'value',
|
type: 'value',
|
||||||
@@ -266,12 +268,17 @@ export default {
|
|||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
min: function() { // 取最小值向下取整为最小刻度
|
min: function () { // 取最小值向下取整为最小刻度
|
||||||
return 0
|
return 0
|
||||||
},
|
},
|
||||||
max: function(value) { // 取最大值向上取整为最大刻度
|
max: function (value) { // 取最大值向上取整为最大刻度
|
||||||
return Math.ceil(value.max)
|
|
||||||
|
// console.log(value.max.toString().length)
|
||||||
|
// String(value.max)[0]
|
||||||
|
// for
|
||||||
|
// return String(value.max)[0] +
|
||||||
},
|
},
|
||||||
|
minInterval: 5,//间隔
|
||||||
scale: true,
|
scale: true,
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '产量/㎡', // y轴上方的单位
|
name: '产量/㎡', // y轴上方的单位
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-09-21 09:06:28
|
* @Date: 2023-09-21 09:06:28
|
||||||
* @LastEditTime: 2024-04-16 13:37:38
|
* @LastEditTime: 2024-04-23 15:36:35
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -217,12 +217,11 @@ export default {
|
|||||||
// },
|
// },
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
// min: function() { // 取最小值向下取整为最小刻度
|
min: function () { // 取最小值向下取整为最小刻度
|
||||||
// return 0
|
return 0
|
||||||
// },
|
},
|
||||||
// max: function(value) { // 取最大值向上取整为最大刻度
|
max: function (value) { // 取最大值向上取整为最大刻度
|
||||||
// return Math.ceil(value.max)
|
},
|
||||||
// },
|
|
||||||
scale: true,
|
scale: true,
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '良品率/%',
|
name: '良品率/%',
|
||||||
@@ -265,12 +264,17 @@ export default {
|
|||||||
// },
|
// },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
// min: function() { // 取最小值向下取整为最小刻度
|
min: function () { // 取最小值向下取整为最小刻度
|
||||||
// return 0
|
return 0
|
||||||
// },
|
},
|
||||||
// max: function(value) { // 取最大值向上取整为最大刻度
|
max: function (value) { // 取最大值向上取整为最大刻度
|
||||||
// return Math.ceil(value.max)
|
|
||||||
// },
|
// console.log(value.max.toString().length)
|
||||||
|
// String(value.max)[0]
|
||||||
|
// for
|
||||||
|
// return String(value.max)[0] +
|
||||||
|
},
|
||||||
|
minInterval: 5,//间隔
|
||||||
scale: true,
|
scale: true,
|
||||||
type: 'value',
|
type: 'value',
|
||||||
name: '产量/片', // y轴上方的单位
|
name: '产量/片', // y轴上方的单位
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-27 13:54:52
|
* @Date: 2023-12-27 13:54:52
|
||||||
* @LastEditTime: 2024-04-16 13:16:34
|
* @LastEditTime: 2024-04-19 15:43:08
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -170,7 +170,7 @@ export default {
|
|||||||
let singleData = series.filter(function (item) {
|
let singleData = series.filter(function (item) {
|
||||||
return item.name == name
|
return item.name == name
|
||||||
})
|
})
|
||||||
return name + parseFloat((singleData[0].data * 100).toFixed(0)) + '%'
|
return name + parseFloat((singleData[0].data * 100).toFixed(2)) + '%'
|
||||||
},
|
},
|
||||||
itemWidth: 12,
|
itemWidth: 12,
|
||||||
itemHeight: 12,
|
itemHeight: 12,
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-07-19 15:18:30
|
* @Date: 2021-07-19 15:18:30
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @LastEditTime: 2024-04-18 08:42:00
|
* @LastEditTime: 2024-04-24 14:48:00
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -25,19 +25,19 @@
|
|||||||
<el-row class="container-main flex-col" type="flex">
|
<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-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%">
|
<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"
|
<dv-scroll-board class="eqTable" :config="eqConfig" style="width: 100%; height: 350px"
|
||||||
ref="eqScrollBoard" />
|
ref="eqScrollBoard" />
|
||||||
</base-container>
|
</base-container>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
|
<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" />
|
<dv-scroll-board :config="processConfig" style="width: 100%; height: 350px" ref="processScrollBoard" />
|
||||||
</base-container>
|
</base-container>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="8" height="100%">
|
<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="false" :height="318" :size="'small'" :title="'工单监控'" :title-icon="'eqMonitoring'">
|
||||||
<div class="order" style="width: 100%; overflow: hidden scroll; height: 350px">
|
<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-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;">
|
||||||
<!-- <el-col :span="12"> -->
|
<!-- <el-col :span="12"> -->
|
||||||
@@ -52,8 +52,7 @@
|
|||||||
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
|
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
|
||||||
op.planQuantity }}</span>
|
op.planQuantity }}</span>
|
||||||
</span>
|
</span>
|
||||||
<span v-if="op.actualQuantity" class="orderFinish"
|
<span v-if="op.actualQuantity" class="orderFinish" style="font-size: 14px;margin-left: 130px;">{{
|
||||||
style="font-size: 14px;margin-left: 130px;">{{
|
|
||||||
op.actualQuantity
|
op.actualQuantity
|
||||||
}}</span>
|
}}</span>
|
||||||
<el-divider class="split" style="background-color: rgba(0, 255, 247, 1)" v-if="op.actualQuantity"
|
<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-row :style="{ padding: '0 ' + 9 + 'px' }" :gutter="12" type="flex" class="flex-1">
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
||||||
<base-container :show-yes-time="true" :no-content-padding="true" :height="256" :size="'eqStatus'"
|
<base-container :show-time="true" :show-yes-time="true" :no-content-padding="true" :height="256"
|
||||||
:title="'能源监控'" :title-icon="'energyMonitoring'">
|
:size="'eqStatus'" :title="'能源监控'" :title-icon="'energyMonitoring'">
|
||||||
<el-row :gutter="9">
|
<el-row :gutter="9">
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
|
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="24">
|
||||||
<linear-bar-chart ref="EnergyMonitoringChart" :name-list="EnergyMonitoringNameList"
|
<linear-bar-chart ref="EnergyMonitoringChart" :name-list="EnergyMonitoringNameList"
|
||||||
@@ -81,7 +80,7 @@
|
|||||||
</base-container>
|
</base-container>
|
||||||
</el-col>
|
</el-col>
|
||||||
<el-col :style="{ margin: 8 + 'px' + ' 0' }" :span="12">
|
<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'">
|
:title="'产线产量及良品率'" :title-icon="'productLine'">
|
||||||
<div class="myLegend">
|
<div class="myLegend">
|
||||||
<div class=" barCircleLegend"></div>
|
<div class=" barCircleLegend"></div>
|
||||||
@@ -136,7 +135,7 @@ const qualityYearList = [
|
|||||||
name: '固化机',
|
name: '固化机',
|
||||||
code: 'EQ20240110111700000201',
|
code: 'EQ20240110111700000201',
|
||||||
status: '正常',
|
status: '正常',
|
||||||
error: 'true',
|
error: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '磨边清洗机',
|
name: '磨边清洗机',
|
||||||
@@ -148,7 +147,7 @@ const qualityYearList = [
|
|||||||
name: '预热机',
|
name: '预热机',
|
||||||
code: 'EQ20240110111700000205',
|
code: 'EQ20240110111700000205',
|
||||||
status: '故障',
|
status: '故障',
|
||||||
error: true,
|
error: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '下片机',
|
name: '下片机',
|
||||||
@@ -159,7 +158,7 @@ const qualityYearList = [
|
|||||||
name: '冷却机',
|
name: '冷却机',
|
||||||
code: 'EQ20240110111700000203',
|
code: 'EQ20240110111700000203',
|
||||||
status: '正常',
|
status: '正常',
|
||||||
error: true,
|
error: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'A储片机106',
|
name: 'A储片机106',
|
||||||
@@ -177,7 +176,7 @@ const qualityYearList = [
|
|||||||
name: '二次磨边机',
|
name: '二次磨边机',
|
||||||
code: ' EQ20240110110927000181',
|
code: ' EQ20240110110927000181',
|
||||||
status: '正常',
|
status: '正常',
|
||||||
error: true,
|
error: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: '测试设备',
|
name: '测试设备',
|
||||||
@@ -483,7 +482,7 @@ export default {
|
|||||||
</span>`,
|
</span>`,
|
||||||
`<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</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.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;
|
this.eqConfig.data = eqArr;
|
||||||
let data = [
|
let data = [
|
||||||
@@ -750,7 +749,7 @@ export default {
|
|||||||
item.code || ''
|
item.code || ''
|
||||||
}</span>`,
|
}</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:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 10px 0 0 '}"></div> ${item.status || ''}</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:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:10px 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:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:10px 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:10px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:10px 10px 0 0 '}"></div> ${item.error == true ?'是' :'否' || ''}</span>`,
|
||||||
]);
|
]);
|
||||||
this.eqConfig.data = eqArr;
|
this.eqConfig.data = eqArr;
|
||||||
// this.$nextTick(() => {
|
// this.$nextTick(() => {
|
||||||
|
|||||||
@@ -1,22 +1,26 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<NotMsg v-show="notMsg"/>
|
<NotMsg v-show="notMsg" />
|
||||||
<div id='gasChart' class="gas-chart" style="width:600px;height:200px;" v-show='!notMsg'></div>
|
<div
|
||||||
|
id="gasChart"
|
||||||
|
class="gas-chart"
|
||||||
|
style="width: 600px; height: 200px"
|
||||||
|
v-show="!notMsg"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import resize from './../mixins/resize'
|
import resize from './../mixins/resize';
|
||||||
import NotMsg from './../components/NotMsg'
|
import NotMsg from './../components/NotMsg';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GasChart',
|
name: 'GasChart',
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
components:{ NotMsg },
|
components: { NotMsg },
|
||||||
props: {
|
props: {
|
||||||
chartType: '', // 能源类型
|
chartType: '', // 能源类型
|
||||||
chartTime: ''
|
chartTime: '',
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
const colors = [
|
const colors = [
|
||||||
@@ -31,159 +35,170 @@ export default {
|
|||||||
];
|
];
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null,
|
||||||
notMsg:false
|
notMsg: false,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
gasChartMsg() {
|
gasChartMsg() {
|
||||||
return this.$store.state.websocket.sumGasInfo
|
return this.$store.state.websocket.sumGasInfo;
|
||||||
},
|
},
|
||||||
energyWeekTrend() {
|
energyWeekTrend() {
|
||||||
return this.$store.state.websocket.energyWeekTrend
|
return this.$store.state.websocket.energyWeekTrend;
|
||||||
},
|
},
|
||||||
energyMonthTrend() {
|
energyMonthTrend() {
|
||||||
return this.$store.state.websocket.energyMonthTrend
|
return this.$store.state.websocket.energyMonthTrend;
|
||||||
},
|
},
|
||||||
energyYearTrend() {
|
energyYearTrend() {
|
||||||
return this.$store.state.websocket.energyYearTrend
|
return this.$store.state.websocket.energyYearTrend;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
energyWeekTrend: {// 监听周电能,更新图
|
energyWeekTrend: {
|
||||||
|
// 监听周电能,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (this.chartTime === '周' && this.chartType === '电耗能') {
|
if (this.chartTime === '周' && this.chartType === '电耗能') {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
this.$emit('emitFun')
|
this.$emit('emitFun');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
energyMonthTrend: {// 监听月电能,更新图
|
energyMonthTrend: {
|
||||||
|
// 监听月电能,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (this.chartTime === '月' && this.chartType === '电耗能') {
|
if (this.chartTime === '月' && this.chartType === '电耗能') {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
this.$emit('emitFun')
|
this.$emit('emitFun');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
energyYearTrend: {// 监听年电能,更新图
|
energyYearTrend: {
|
||||||
|
// 监听年电能,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (this.chartTime === '年' && this.chartType === '电耗能') {
|
if (this.chartTime === '年' && this.chartType === '电耗能') {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
this.$emit('emitFun')
|
this.$emit('emitFun');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
gasChartMsg: {// 监听天然气,更新图
|
gasChartMsg: {
|
||||||
|
// 监听天然气,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
if (this.chartType === '天然气I' || this.chartType === '天然气II') {
|
if (this.chartType === '天然气I' || this.chartType === '天然气II') {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
this.$emit('emitFun')
|
this.$emit('emitFun');
|
||||||
}
|
}
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
chartTime: {// 监听时间变化,更新图
|
chartTime: {
|
||||||
|
// 监听时间变化,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
chartType: {// 监听能源类型变化,更新图
|
chartType: {
|
||||||
|
// 监听能源类型变化,更新图
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.$el.addEventListener('resize', () => {
|
this.$el.addEventListener('resize', () => {
|
||||||
console.log('resziing.....');
|
console.log('resziing.....');
|
||||||
});
|
});
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
updateChart() {
|
updateChart() {
|
||||||
let gasName = ''
|
let gasName = '';
|
||||||
const colors = ['#FFCB59'];
|
const colors = ['#FFCB59'];
|
||||||
let temp = []
|
let temp = [];
|
||||||
let seriesData = []
|
let seriesData = [];
|
||||||
let xData = []
|
let xData = [];
|
||||||
let yData = []
|
let yData = [];
|
||||||
switch (this.chartType) {
|
switch (this.chartType) {
|
||||||
case '电耗能':{
|
case '电耗能': {
|
||||||
gasName = '电耗能'
|
gasName = '电耗能';
|
||||||
if (this.chartTime === '周') {
|
if (this.chartTime === '周') {
|
||||||
temp = this.energyWeekTrend || []
|
temp = this.energyWeekTrend || [];
|
||||||
}else if(this.chartTime === '月') {
|
} else if (this.chartTime === '月') {
|
||||||
temp = this.energyMonthTrend || []
|
temp = this.energyMonthTrend || [];
|
||||||
}else{
|
} else {
|
||||||
temp = this.energyYearTrend || []
|
temp = this.energyYearTrend || [];
|
||||||
}
|
}
|
||||||
temp && temp.map(i => {
|
temp &&
|
||||||
xData.push(i.time)
|
temp.map((i) => {
|
||||||
yData.push(i.qty)
|
xData.push(i.time);
|
||||||
})
|
yData.push(i.qty);
|
||||||
|
});
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case '天然气I':{
|
case '天然气I': {
|
||||||
if (this.chartTime === '周') {
|
if (this.chartTime === '周') {
|
||||||
yData = this.gasChartMsg.hisSumGas1For7Day || []
|
yData = this.gasChartMsg.hisSumGas1For7Day || [];
|
||||||
}else if(this.chartTime === '月') {
|
} else if (this.chartTime === '月') {
|
||||||
yData = this.gasChartMsg.sumGas1ForMonth || []
|
yData = this.gasChartMsg.sumGas1ForMonth || [];
|
||||||
}else{
|
} else {
|
||||||
yData = this.gasChartMsg.sumGas1ForYear || []
|
yData = this.gasChartMsg.sumGas1ForYear || [];
|
||||||
}
|
}
|
||||||
gasName = '天然气I'
|
gasName = '天然气I';
|
||||||
xData = this.getXdata()
|
xData = this.getXdata();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
default:
|
default:
|
||||||
gasName = '天然气II'
|
gasName = '天然气II';
|
||||||
if (this.chartTime === '周') {
|
if (this.chartTime === '周') {
|
||||||
yData = this.gasChartMsg.hisSumGas2For7Day || []
|
yData = this.gasChartMsg.hisSumGas2For7Day || [];
|
||||||
}else if(this.chartTime === '月') {
|
} else if (this.chartTime === '月') {
|
||||||
yData = this.gasChartMsg.sumGas2ForMonth || []
|
yData = this.gasChartMsg.sumGas2ForMonth || [];
|
||||||
}else{
|
} else {
|
||||||
yData = this.gasChartMsg.sumGas2ForYear || []
|
yData = this.gasChartMsg.sumGas2ForYear || [];
|
||||||
}
|
}
|
||||||
xData = this.getXdata()
|
xData = this.getXdata();
|
||||||
}
|
}
|
||||||
if (yData.length === 0) {
|
if (yData.length === 0) {
|
||||||
this.notMsg = true
|
this.notMsg = true;
|
||||||
return
|
return;
|
||||||
} else {
|
} else {
|
||||||
this.notMsg = false
|
this.notMsg = false;
|
||||||
}
|
}
|
||||||
if (yData.length == 0) {
|
if (yData.length == 0) {
|
||||||
seriesData = []
|
seriesData = [];
|
||||||
}else {
|
} else {
|
||||||
seriesData = [{
|
yData = yData.map((item) => {
|
||||||
name: gasName,
|
return (item = Number(item.toFixed(2)));
|
||||||
data: yData,
|
});
|
||||||
type: "line",
|
seriesData = [
|
||||||
areaStyle: {
|
{
|
||||||
|
name: gasName,
|
||||||
|
data: yData,
|
||||||
|
type: 'line',
|
||||||
|
areaStyle: {
|
||||||
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
|
||||||
{ offset: 0, color: '#FFCB59' + "40" },
|
{ offset: 0, color: '#FFCB59' + '40' },
|
||||||
{ offset: 0.5, color: '#FFCB59' + "20" },
|
{ offset: 0.5, color: '#FFCB59' + '20' },
|
||||||
{ offset: 1, color: '#FFCB59' + "00" },
|
{ offset: 1, color: '#FFCB59' + '00' },
|
||||||
]),
|
]),
|
||||||
|
},
|
||||||
|
lineStyle: {
|
||||||
|
width: 1,
|
||||||
|
},
|
||||||
|
symbol: 'circle',
|
||||||
|
symbolSize: 5,
|
||||||
|
emphasis: {
|
||||||
|
focus: 'series',
|
||||||
|
},
|
||||||
},
|
},
|
||||||
lineStyle: {
|
];
|
||||||
width: 1
|
|
||||||
},
|
|
||||||
symbol: 'circle',
|
|
||||||
symbolSize: 5,
|
|
||||||
emphasis: {
|
|
||||||
focus: 'series'
|
|
||||||
}
|
|
||||||
}]
|
|
||||||
|
|
||||||
}
|
}
|
||||||
// 绘图
|
// 绘图
|
||||||
if (
|
if (
|
||||||
this.chart !== null &&
|
this.chart !== null &&
|
||||||
this.chart !== '' &&
|
this.chart !== '' &&
|
||||||
this.chart !== undefined
|
this.chart !== undefined
|
||||||
) {
|
) {
|
||||||
this.chart.dispose() // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
this.chart.dispose(); // 页面多次刷新会出现警告,Dom已经初始化了一个实例,这是销毁实例
|
||||||
}
|
}
|
||||||
this.chart = echarts.init(document.getElementById('gasChart'));
|
this.chart = echarts.init(document.getElementById('gasChart'));
|
||||||
var option = {
|
var option = {
|
||||||
color: colors,
|
color: colors,
|
||||||
@@ -204,7 +219,7 @@ export default {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
yAxis: {
|
yAxis: {
|
||||||
name: this.chartType === '电耗能'?'单位kwh':'单位Nm³',
|
name: this.chartType === '电耗能' ? '单位kwh' : '单位Nm³',
|
||||||
nameTextStyle: {
|
nameTextStyle: {
|
||||||
color: '#fff',
|
color: '#fff',
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
@@ -230,10 +245,10 @@ export default {
|
|||||||
series: seriesData,
|
series: seriesData,
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: 'axis',
|
trigger: 'axis',
|
||||||
className: "gas-tooltip"
|
className: 'gas-tooltip',
|
||||||
},
|
},
|
||||||
}
|
};
|
||||||
option && this.chart.setOption(option)
|
option && this.chart.setOption(option);
|
||||||
},
|
},
|
||||||
getXdata() {
|
getXdata() {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
@@ -242,31 +257,39 @@ export default {
|
|||||||
let days = 30;
|
let days = 30;
|
||||||
if (this.chartTime === '周') {
|
if (this.chartTime === '周') {
|
||||||
return Array(7)
|
return Array(7)
|
||||||
.fill(1)
|
.fill(1)
|
||||||
.map((_, index) => {
|
.map((_, index) => {
|
||||||
const today = new Date();
|
const today = new Date();
|
||||||
const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
|
const dtimestamp = today - (index + 1) * 24 * 60 * 60 * 1000;
|
||||||
return `${new Date(dtimestamp).getMonth()+1}.${new Date(dtimestamp).getDate()}`;}).reverse()
|
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
|
||||||
}else if (this.chartTime == "月") {
|
dtimestamp
|
||||||
|
).getDate()}`;
|
||||||
|
})
|
||||||
|
.reverse();
|
||||||
|
} else if (this.chartTime == '月') {
|
||||||
if (currentMonth in [1, 3, 5, 7, 8, 10, 12]) {
|
if (currentMonth in [1, 3, 5, 7, 8, 10, 12]) {
|
||||||
days = 31;
|
days = 31;
|
||||||
} else if (currentMonth == 2) {
|
} else if (currentMonth == 2) {
|
||||||
days = this.isLeapYear(currentYear) ? 29 : 28;
|
days = this.isLeapYear(currentYear) ? 29 : 28;
|
||||||
}
|
}
|
||||||
return Array(days)
|
return Array(days)
|
||||||
.fill(1)
|
.fill(1)
|
||||||
.map((_, index) => {
|
.map((_, index) => {
|
||||||
return `${currentMonth}.${days - index}`;}).reverse()
|
return `${currentMonth}.${days - index}`;
|
||||||
|
})
|
||||||
|
.reverse();
|
||||||
} else {
|
} else {
|
||||||
return Array(12)
|
return Array(12)
|
||||||
.fill(1)
|
.fill(1)
|
||||||
.map((_, index) => {
|
.map((_, index) => {
|
||||||
return `${12 - index}`;}).reverse()
|
return `${12 - index}`;
|
||||||
|
})
|
||||||
|
.reverse();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
isLeapYear(year) {
|
isLeapYear(year) {
|
||||||
return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
|
return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -278,12 +301,12 @@ export default {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.gas-tooltip {
|
.gas-tooltip {
|
||||||
background: #0a2b4f77 !important;
|
background: #0a2b4f77 !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(12px);
|
||||||
}
|
}
|
||||||
.gas-tooltip * {
|
.gas-tooltip * {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,68 +1,89 @@
|
|||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<NotMsg v-show="notMsg"/>
|
<NotMsg v-show="notMsg" />
|
||||||
<div id="israChart" class="isra-chart" style="width:600px;height:390px;" v-show='!notMsg'></div>
|
<div
|
||||||
|
id="israChart"
|
||||||
|
class="isra-chart"
|
||||||
|
style="width: 600px; height: 390px"
|
||||||
|
v-show="!notMsg"></div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import * as echarts from 'echarts';
|
import * as echarts from 'echarts';
|
||||||
import resize from './../mixins/resize'
|
import resize from './../mixins/resize';
|
||||||
import NotMsg from './../components/NotMsg'
|
import NotMsg from './../components/NotMsg';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ISRAChart',
|
name: 'ISRAChart',
|
||||||
mixins: [resize],
|
mixins: [resize],
|
||||||
components:{ NotMsg },
|
components: { NotMsg },
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chart: null,
|
chart: null,
|
||||||
notMsg:true,
|
notMsg: true,
|
||||||
colors:['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
|
colors: ['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
|
||||||
chartData: []
|
chartData: [],
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
activated() {
|
activated() {},
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
israChartMsg() {
|
israChartMsg() {
|
||||||
return this.$store.state.websocket.israKiln
|
return this.$store.state.websocket.israKiln;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
watch: {
|
watch: {
|
||||||
israChartMsg: {
|
israChartMsg: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
this.chartData = newVal || []
|
this.chartData = newVal || [];
|
||||||
this.updateChart()
|
this.updateChart();
|
||||||
this.$emit('emitFun')
|
this.$emit('emitFun');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
getEqualNewlineString(params, length) {
|
||||||
|
let text = '';
|
||||||
|
let count = Math.ceil(params.length / length); // 向上取整数
|
||||||
|
// 一行展示length个
|
||||||
|
if (count > 1) {
|
||||||
|
for (let z = 1; z <= count; z++) {
|
||||||
|
text += params.substr((z - 1) * length, length);
|
||||||
|
if (z < count) {
|
||||||
|
text += '\n';
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
text += params.substr(0, length);
|
||||||
|
}
|
||||||
|
return text;
|
||||||
|
},
|
||||||
updateChart() {
|
updateChart() {
|
||||||
console.log('update')
|
console.log('update');
|
||||||
let num = 0
|
let num = 0;
|
||||||
this.chartData && this.chartData.length > 0 && this.chartData.map(i => {
|
this.chartData &&
|
||||||
num+=i.num
|
this.chartData.length > 0 &&
|
||||||
})
|
this.chartData.map((i) => {
|
||||||
|
num += i.num;
|
||||||
|
});
|
||||||
if (
|
if (
|
||||||
this.chart !== null &&
|
this.chart !== null &&
|
||||||
this.chart !== '' &&
|
this.chart !== '' &&
|
||||||
this.chart !== undefined
|
this.chart !== undefined
|
||||||
) {
|
) {
|
||||||
this.chart.dispose()
|
this.chart.dispose();
|
||||||
}
|
}
|
||||||
if (this.chartData && this.chartData.length > 0) {
|
if (this.chartData && this.chartData.length > 0) {
|
||||||
this.notMsg = false
|
this.notMsg = false;
|
||||||
} else {
|
} else {
|
||||||
this.notMsg = true
|
this.notMsg = true;
|
||||||
return
|
return;
|
||||||
}
|
}
|
||||||
this.chart = echarts.init(document.getElementById('israChart'));
|
this.chart = echarts.init(document.getElementById('israChart'));
|
||||||
var option = {
|
var option = {
|
||||||
color:this.colors,
|
color: this.colors,
|
||||||
title:{
|
title: {
|
||||||
text: num,
|
text: num,
|
||||||
subtext: '总数',
|
subtext: '总数',
|
||||||
top: '32%',
|
top: '32%',
|
||||||
@@ -81,55 +102,92 @@ export default {
|
|||||||
bottom: '2%',
|
bottom: '2%',
|
||||||
left: 'center',
|
left: 'center',
|
||||||
itemWidth: 18,
|
itemWidth: 18,
|
||||||
itemHeight:18,
|
itemHeight: 18,
|
||||||
icon: 'circle',
|
icon: 'circle',
|
||||||
textStyle: {
|
textStyle: {
|
||||||
color: '#fff'
|
color: '#fff',
|
||||||
},
|
},
|
||||||
data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
|
data:
|
||||||
name:item.name,
|
this.chartData &&
|
||||||
itemStyle:{
|
this.chartData.length > 0 &&
|
||||||
color: this.colors[index%4]
|
this.chartData.map((item, index) => ({
|
||||||
}
|
name: item.name,
|
||||||
}))
|
itemStyle: {
|
||||||
|
color: this.colors[index % 4],
|
||||||
|
},
|
||||||
|
})),
|
||||||
},
|
},
|
||||||
series:[{
|
series: [
|
||||||
|
{
|
||||||
name: 'ISRA缺陷检测',
|
name: 'ISRA缺陷检测',
|
||||||
type: 'pie',
|
type: 'pie',
|
||||||
center: ['50%', '40%'],
|
center: ['50%', '40%'],
|
||||||
radius: ['45%', '70%'],
|
radius: ['45%', '70%'],
|
||||||
avoidLabelOverlap: true,
|
avoidLabelOverlap: true,
|
||||||
|
// label: {
|
||||||
|
// show: true,
|
||||||
|
// },
|
||||||
|
// labelLine: {
|
||||||
|
// show: true,
|
||||||
|
// },
|
||||||
label: {
|
label: {
|
||||||
show: false
|
show: true,
|
||||||
|
normal: {
|
||||||
|
alignTo: 'labelLine',
|
||||||
|
margin: 10,
|
||||||
|
edgeDistance: 10,
|
||||||
|
lineHeight: 16,
|
||||||
|
formatter: (params) => {
|
||||||
|
//调用自定义显示格式
|
||||||
|
return this.getEqualNewlineString(
|
||||||
|
params.value + ' | ' + params.percent.toFixed(0) + '%'
|
||||||
|
);
|
||||||
|
},
|
||||||
|
textStyle: {
|
||||||
|
// 提示文字的样式
|
||||||
|
// color: '#595959',
|
||||||
|
fontSize: 16,
|
||||||
|
},
|
||||||
|
},
|
||||||
},
|
},
|
||||||
labelLine: {
|
labelLine: {
|
||||||
show: true,
|
show: true,
|
||||||
|
length: 25,
|
||||||
|
length2: 10,
|
||||||
},
|
},
|
||||||
data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({
|
data:
|
||||||
name:item.name,
|
this.chartData &&
|
||||||
value: item.num,
|
this.chartData.length > 0 &&
|
||||||
itemStyle:{
|
this.chartData.map((item, index) => ({
|
||||||
color:{
|
name: item.name,
|
||||||
type: 'linear',
|
value: item.num,
|
||||||
x: 1,
|
label: {
|
||||||
y: 1,
|
color: this.colors[index % 4],
|
||||||
x2: 0,
|
},
|
||||||
y2: 0,
|
itemStyle: {
|
||||||
global: false,
|
color: {
|
||||||
colorStops:[
|
type: 'linear',
|
||||||
{offset: 0,color: this.colors[index%4]},
|
x: 1,
|
||||||
{offset: 1,color: this.colors[index%4]+'33'}
|
y: 1,
|
||||||
]
|
x2: 0,
|
||||||
}
|
y2: 0,
|
||||||
}
|
global: false,
|
||||||
}))}],
|
colorStops: [
|
||||||
tooltip: {
|
{ offset: 0, color: this.colors[index % 4] },
|
||||||
trigger: 'item',
|
{ offset: 1, color: this.colors[index % 4] + '33' },
|
||||||
className: "isra-chart-tooltip"
|
],
|
||||||
|
},
|
||||||
|
},
|
||||||
|
})),
|
||||||
},
|
},
|
||||||
}
|
],
|
||||||
|
tooltip: {
|
||||||
|
trigger: 'item',
|
||||||
|
className: 'isra-chart-tooltip',
|
||||||
|
},
|
||||||
|
};
|
||||||
this.chart.setOption(option);
|
this.chart.setOption(option);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
@@ -141,12 +199,12 @@ export default {
|
|||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
<style>
|
<style>
|
||||||
.isra-chart-tooltip {
|
.isra-chart-tooltip {
|
||||||
background: #0a2b4f77 !important;
|
background: #0a2b4f77 !important;
|
||||||
border: none !important;
|
border: none !important;
|
||||||
backdrop-filter: blur(12px);
|
backdrop-filter: blur(12px);
|
||||||
}
|
}
|
||||||
.isra-chart-tooltip * {
|
.isra-chart-tooltip * {
|
||||||
color: #fff !important;
|
color: #fff !important;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,77 +1,93 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="flex: 1;">
|
<div style="flex: 1">
|
||||||
<Container name="设备报警" size="middle" style="">
|
<Container
|
||||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
name="设备报警"
|
||||||
<div style="padding: 5px 10px;">
|
size="middle"
|
||||||
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='eqScrollBoard'/>
|
style="">
|
||||||
</div>
|
<TimePrompt
|
||||||
</Container>
|
class="timeShow"
|
||||||
</div>
|
:timestr="timestr" />
|
||||||
|
<div style="padding: 5px 10px">
|
||||||
|
<dv-scroll-board
|
||||||
|
:config="config"
|
||||||
|
style="width: 575px; height: 380px"
|
||||||
|
ref="eqScrollBoard" />
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Container from '../components/Container.vue';
|
import Container from '../components/Container.vue';
|
||||||
import TimePrompt from '../components/TimePrompt';
|
import TimePrompt from '../components/TimePrompt';
|
||||||
import { switchShowTime } from '../utils'
|
import { switchShowTime } from '../utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'EqAlarm',
|
name: 'EqAlarm',
|
||||||
components: { Container, TimePrompt },
|
components: { Container, TimePrompt },
|
||||||
computed: {
|
computed: {
|
||||||
sjgEquipment() {
|
sjgEquipment() {
|
||||||
return this.$store.state.websocket.sjgEquipment
|
return this.$store.state.websocket.sjgEquipment;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timestr: '',
|
timestr: '',
|
||||||
config: {
|
config: {
|
||||||
header: ['序号', '设备名称', '设备编码','设备状态','是否故障'],
|
header: ['序号', '设备名称', '设备编码', '设备状态', '是否故障'],
|
||||||
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
||||||
columnWidth: [60, 150, 190],
|
columnWidth: [60, 150, 190],
|
||||||
align: ['center'],
|
align: ['center'],
|
||||||
data: [],
|
data: [],
|
||||||
// data: [
|
// data: [
|
||||||
// [1, '四大线3小线铺纸机', 'EQ20240110130909000255', '正常', '否'],
|
// [1, '四大线3小线铺纸机', 'EQ20240110130909000255', '正常', '否'],
|
||||||
// [2, '四大线2小线铺纸机', 'EQ20240110130848000254', '正常', '否'],
|
// [2, '四大线2小线铺纸机', 'EQ20240110130848000254', '正常', '否'],
|
||||||
// [3, '四大线1小线铺纸机', 'EQ20240110130832000253', '正常', '否'],
|
// [3, '四大线1小线铺纸机', 'EQ20240110130832000253', '正常', '否'],
|
||||||
// [4, '12线下片台', 'EQ20240110130817000252', '正常', '否'],
|
// [4, '12线下片台', 'EQ20240110130817000252', '正常', '否'],
|
||||||
// [5, '11线下片台', ' EQ20240110130743000250', '正常', '否'],
|
// [5, '11线下片台', ' EQ20240110130743000250', '正常', '否'],
|
||||||
// [6, '10线下片台', ' EQ20240110130743000250', '正常', '否'],
|
// [6, '10线下片台', ' EQ20240110130743000250', '正常', '否'],
|
||||||
// [7, '4大线五区自动连线柜', 'EQ20240110130731000249', '正常', '否'],
|
// [7, '4大线五区自动连线柜', 'EQ20240110130731000249', '正常', '否'],
|
||||||
// [8, '四大线四区2小线清洗机', 'EQ20240110112716000248', '正常', '否'],
|
// [8, '四大线四区2小线清洗机', 'EQ20240110112716000248', '正常', '否'],
|
||||||
// [9, '四大线四区1小线清洗机', 'EQ20240110112700000247', '正常', '否'],
|
// [9, '四大线四区1小线清洗机', 'EQ20240110112700000247', '正常', '否'],
|
||||||
// [10, '4大线四区自动连线柜', 'EQ20240110112646000246', '正常', '否']
|
// [10, '4大线四区自动连线柜', 'EQ20240110112646000246', '正常', '否']
|
||||||
// ],
|
// ],
|
||||||
rowNum: 10
|
rowNum: 10,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
mounted(){
|
mounted() {
|
||||||
this.timestr = switchShowTime('日')
|
this.timestr = switchShowTime('日');
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
sjgEquipment: {
|
sjgEquipment: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
let outArr = this.sjgEquipment.map((item, index) => [
|
let outArr = this.sjgEquipment.map((item, index) => [
|
||||||
index+1,
|
index + 1,
|
||||||
`<span title=${item.name || ''}>${item.name || ''}</span>`,
|
`<span title=${item.name || ''}>${item.name || ''}</span>`,
|
||||||
`<span title=${item.code || ''}>${item.code || ''}</span>`,
|
`<span title=${item.code || ''}>${item.code || ''}</span>`,
|
||||||
item.status,
|
`<span><div style="${
|
||||||
item.error? '是': '否'
|
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 '
|
||||||
this.config.data = outArr
|
: 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:13px 10px 0 0 '
|
||||||
this.$refs['eqScrollBoard'].updateRows(outArr)
|
}"></div> ${item.status || ''}</span>`,
|
||||||
this.timestr = switchShowTime('日')
|
`<span"><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.config.data = outArr;
|
||||||
|
this.$refs['eqScrollBoard'].updateRows(outArr);
|
||||||
|
this.timestr = switchShowTime('日');
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang="scss" scoped>
|
||||||
.timeShow {
|
.timeShow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
left: 170px;
|
left: 170px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,67 +1,88 @@
|
|||||||
<template>
|
<template>
|
||||||
<Container name="工单监控" size="middle" style="">
|
<Container
|
||||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
name="工单监控"
|
||||||
<div style="padding: 5px 10px;" class="WOMonitoring">
|
size="middle"
|
||||||
<dv-scroll-board :config="config" style="width:900px;height:380px" ref='worderScrollBoard'/>
|
style="">
|
||||||
</div>
|
<TimePrompt
|
||||||
</Container>
|
class="timeShow"
|
||||||
|
:timestr="timestr" />
|
||||||
|
<div
|
||||||
|
style="padding: 5px 10px"
|
||||||
|
class="WOMonitoring">
|
||||||
|
<dv-scroll-board
|
||||||
|
:config="config"
|
||||||
|
style="width: 900px; height: 380px"
|
||||||
|
ref="worderScrollBoard" />
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Container from '../components/Container.vue';
|
import Container from '../components/Container.vue';
|
||||||
import TimePrompt from '../components/TimePrompt';
|
import TimePrompt from '../components/TimePrompt';
|
||||||
import { switchShowTime } from '../utils'
|
import { switchShowTime } from '../utils';
|
||||||
import { formatDate } from '@/utils'
|
import { formatDate } from '@/utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'WorkOrderMonitoring',
|
name: 'WorkOrderMonitoring',
|
||||||
components: { Container, TimePrompt },
|
components: { Container, TimePrompt },
|
||||||
computed: {
|
computed: {
|
||||||
order() {
|
order() {
|
||||||
return this.$store.state.websocket.workOrder
|
return this.$store.state.websocket.workOrder;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timestr: '',
|
timestr: '',
|
||||||
config: {
|
config: {
|
||||||
header: ['序号', '工单名称', '规格','产线','工单状态', '计划完成时间','计划产量','实际产量'],
|
header: [
|
||||||
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
'序号',
|
||||||
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
'工单名称',
|
||||||
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
'规格',
|
||||||
columnWidth: [60, 120, 120, 60, 100, 150],
|
'产线',
|
||||||
align: ['center'],
|
'工单状态',
|
||||||
data: [],
|
'计划完成时间',
|
||||||
rowNum:10
|
'计划产量',
|
||||||
}
|
'实际产量',
|
||||||
}
|
'完成进度',
|
||||||
},
|
],
|
||||||
mounted(){
|
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
this.timestr = switchShowTime('日')
|
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
},
|
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
||||||
watch:{
|
columnWidth: [60, 120, 120, 60, 100, 150],
|
||||||
order: {
|
align: ['center'],
|
||||||
|
data: [],
|
||||||
|
rowNum: 10,
|
||||||
|
},
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.timestr = switchShowTime('日');
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
order: {
|
||||||
handler(newVal, oldVal) {
|
handler(newVal, oldVal) {
|
||||||
let outArr = this.order.map((item, index) => [
|
let outArr = this.order.map((item, index) => [
|
||||||
index+1,
|
index + 1,
|
||||||
`<span title=${item.name || ''}>${item.name || ''}</span>`,
|
`<span title=${item.name || ''}>${item.name || ''}</span>`,
|
||||||
item.specifications,
|
item.specifications,
|
||||||
item.lines,
|
item.lines,
|
||||||
this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
|
this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
|
||||||
formatDate(item.planFinishTime),
|
formatDate(item.planFinishTime),
|
||||||
item.planQuantity,
|
item.planQuantity,
|
||||||
item.planAssignQuantity
|
item.actualQuantity,
|
||||||
]);
|
(item.progressRate * 100).toFixed(0) + '%',
|
||||||
this.config.data = outArr
|
]);
|
||||||
this.$refs['worderScrollBoard'].updateRows(outArr)
|
this.config.data = outArr;
|
||||||
this.timestr = switchShowTime('日')
|
this.$refs['worderScrollBoard'].updateRows(outArr);
|
||||||
}
|
this.timestr = switchShowTime('日');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang="scss" scoped>
|
||||||
.timeShow {
|
.timeShow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
left: 170px;
|
left: 170px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -1,22 +1,24 @@
|
|||||||
<!--
|
|
||||||
filename: MaterialCost.vue
|
|
||||||
author: liubin
|
|
||||||
date: 2023-12-06 09:09:27
|
|
||||||
description:
|
|
||||||
-->
|
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<Container name="能耗" size="middle" style="">
|
<Container
|
||||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
name="能耗"
|
||||||
|
size="middle"
|
||||||
|
style="">
|
||||||
<EnergeTop />
|
<EnergeTop />
|
||||||
<SplitLine :horizontal="true" />
|
<SplitLine :horizontal="true" />
|
||||||
<div class="" style="flex: 2; padding: 8px">
|
<div
|
||||||
|
class=""
|
||||||
|
style="flex: 2; padding: 8px">
|
||||||
<div
|
<div
|
||||||
class="header-line"
|
class="header-line"
|
||||||
style="margin: 8px 0 16px; display: flex; align-items: center">
|
style="margin: 8px 0 16px; display: flex; align-items: center">
|
||||||
<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 12px">
|
<h2
|
||||||
|
class=""
|
||||||
|
style="margin: 0; color: #0ee8fe; margin-right: 12px">
|
||||||
能耗趋势图
|
能耗趋势图
|
||||||
</h2>
|
</h2>
|
||||||
|
<TimePrompt
|
||||||
|
class="timeShow"
|
||||||
|
:timestr="timestr" />
|
||||||
<!-- <Switcher /> -->
|
<!-- <Switcher /> -->
|
||||||
<div>
|
<div>
|
||||||
<!-- <span class="lgd lgd-total">总量</span> -->
|
<!-- <span class="lgd lgd-total">总量</span> -->
|
||||||
@@ -32,11 +34,21 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
">
|
">
|
||||||
<SelectorBtnGroup
|
<SelectorBtnGroup
|
||||||
:options="['电耗能', '天然气I', '天然气II']" @emitFun='toggleType' :active='chartType'/>
|
:options="['电耗能', '天然气I', '天然气II']"
|
||||||
<SelectorBtnGroup :options="['周', '月', '年']" @emitFun='toggleDate' :active='chartTime'/>
|
@emitFun="toggleType"
|
||||||
|
:active="chartType" />
|
||||||
|
<SelectorBtnGroup
|
||||||
|
:options="['周', '月', '年']"
|
||||||
|
@emitFun="toggleDate"
|
||||||
|
:active="chartTime" />
|
||||||
</div>
|
</div>
|
||||||
<div class="chart" style="height: 200px; margin-top: 8px;">
|
<div
|
||||||
<GasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
|
class="chart"
|
||||||
|
style="height: 200px; margin-top: 8px">
|
||||||
|
<GasChart
|
||||||
|
:chartType="chartType"
|
||||||
|
:chartTime="chartTime"
|
||||||
|
@emitFun="dateUpdate" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
@@ -51,7 +63,7 @@ import EnergeTop from './EnergeTop';
|
|||||||
import GasChart from '../components/GasChart.vue';
|
import GasChart from '../components/GasChart.vue';
|
||||||
import SelectorBtnGroup from '../components/SelectorBtnGroup';
|
import SelectorBtnGroup from '../components/SelectorBtnGroup';
|
||||||
import TimePrompt from '../components/TimePrompt';
|
import TimePrompt from '../components/TimePrompt';
|
||||||
import { switchShowTime } from '../utils'
|
import { switchShowTime } from '../utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'EnergeCost',
|
name: 'EnergeCost',
|
||||||
components: {
|
components: {
|
||||||
@@ -61,48 +73,43 @@ export default {
|
|||||||
EnergeTop,
|
EnergeTop,
|
||||||
GasChart,
|
GasChart,
|
||||||
SelectorBtnGroup,
|
SelectorBtnGroup,
|
||||||
TimePrompt
|
TimePrompt,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chartType:'电耗能',
|
chartType: '电耗能',
|
||||||
chartTime:'周',
|
chartTime: '周',
|
||||||
timestr: ''
|
timestr: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.timestr = switchShowTime(this.chartTime)
|
this.timestr = switchShowTime(this.chartTime);
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
gasInfoMsg() {
|
gasInfoMsg() {
|
||||||
return this.$store.state.websocket.gasInfo
|
return this.$store.state.websocket.gasInfo;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 切换能源
|
// 切换能源
|
||||||
toggleType(val) {
|
toggleType(val) {
|
||||||
this.chartType = val
|
this.chartType = val;
|
||||||
},
|
},
|
||||||
// 切换时间
|
// 切换时间
|
||||||
toggleDate(val) {
|
toggleDate(val) {
|
||||||
this.chartTime = val
|
this.chartTime = val;
|
||||||
this.timestr = switchShowTime(val)
|
this.timestr = switchShowTime(val);
|
||||||
},
|
},
|
||||||
// 数据更新
|
// 数据更新
|
||||||
dateUpdate() {
|
dateUpdate() {
|
||||||
this.timestr = switchShowTime(this.chartTime)
|
this.timestr = switchShowTime(this.chartTime);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.timeShow {
|
|
||||||
position: absolute;
|
|
||||||
top: 20px;
|
|
||||||
left: 120px;
|
|
||||||
}
|
|
||||||
.lgd {
|
.lgd {
|
||||||
color: #fff;
|
color: #fff;
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,11 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="gas-handle" style="flex: 2">
|
<div
|
||||||
<Container name="烟气处理" size="large" style="">
|
class="gas-handle"
|
||||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
style="flex: 2">
|
||||||
|
<Container
|
||||||
|
name="烟气处理"
|
||||||
|
size="large"
|
||||||
|
style="">
|
||||||
<div
|
<div
|
||||||
class=""
|
class=""
|
||||||
style="
|
style="
|
||||||
@@ -24,7 +28,13 @@
|
|||||||
">
|
">
|
||||||
氧气含量
|
氧气含量
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.O2_float ? (Number(exhaustGasInfo.O2_float)).toFixed(2) : ''}}%</span>
|
<span style="font-size: 20px; line-height: 1.24; flex: 1">
|
||||||
|
{{
|
||||||
|
exhaustGasInfo?.O2_float
|
||||||
|
? Number(exhaustGasInfo.O2_float).toFixed(2)
|
||||||
|
: ''
|
||||||
|
}}%
|
||||||
|
</span>
|
||||||
</ShadowRect>
|
</ShadowRect>
|
||||||
<ShadowRect>
|
<ShadowRect>
|
||||||
<div
|
<div
|
||||||
@@ -33,13 +43,19 @@
|
|||||||
line-height: 1.24;
|
line-height: 1.24;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding:5px 8px 5px 0;
|
padding: 5px 8px 5px 0;
|
||||||
letter-spacing: 3px;
|
letter-spacing: 3px;
|
||||||
">
|
">
|
||||||
<p style="margin: 0; line-height: inherit">氮氧化物</p>
|
<p style="margin: 0; line-height: inherit">氮氧化物</p>
|
||||||
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
||||||
</div>
|
</div>
|
||||||
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.NOX_float ? (Number(exhaustGasInfo.NOX_float)).toFixed(2) : ''}}mg/m³</span>
|
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
|
||||||
|
{{
|
||||||
|
exhaustGasInfo?.NOX_float
|
||||||
|
? Number(exhaustGasInfo.NOX_float).toFixed(2)
|
||||||
|
: ''
|
||||||
|
}}mg/m³
|
||||||
|
</span>
|
||||||
</ShadowRect>
|
</ShadowRect>
|
||||||
|
|
||||||
<ShadowRect>
|
<ShadowRect>
|
||||||
@@ -49,13 +65,19 @@
|
|||||||
line-height: 1.24;
|
line-height: 1.24;
|
||||||
flex: 1;
|
flex: 1;
|
||||||
text-align: right;
|
text-align: right;
|
||||||
padding:5px 8px 5px 0;
|
padding: 5px 8px 5px 0;
|
||||||
letter-spacing: 3px;
|
letter-spacing: 3px;
|
||||||
">
|
">
|
||||||
<p style="margin: 0; line-height: inherit">二氧化硫</p>
|
<p style="margin: 0; line-height: inherit">二氧化硫</p>
|
||||||
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
<p style="margin: 0; line-height: inherit">排放浓度</p>
|
||||||
</div>
|
</div>
|
||||||
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.SO2_float ? (Number(exhaustGasInfo.SO2_float)).toFixed(2) : ''}}mg/m³</span>
|
<span style="font-size: 20px; line-height: 1.24; flex: 1">
|
||||||
|
{{
|
||||||
|
exhaustGasInfo?.SO2_float
|
||||||
|
? Number(exhaustGasInfo.SO2_float).toFixed(2)
|
||||||
|
: ''
|
||||||
|
}}mg/m³
|
||||||
|
</span>
|
||||||
</ShadowRect>
|
</ShadowRect>
|
||||||
|
|
||||||
<ShadowRect>
|
<ShadowRect>
|
||||||
@@ -70,17 +92,30 @@
|
|||||||
">
|
">
|
||||||
颗粒物浓度
|
颗粒物浓度
|
||||||
</span>
|
</span>
|
||||||
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.dust_float ? (Number(exhaustGasInfo.dust_float)).toFixed(2) : ''}}mg/m³</span>
|
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
|
||||||
|
{{
|
||||||
|
exhaustGasInfo?.dust_float
|
||||||
|
? Number(exhaustGasInfo.dust_float).toFixed(2)
|
||||||
|
: ''
|
||||||
|
}}mg/m³
|
||||||
|
</span>
|
||||||
</ShadowRect>
|
</ShadowRect>
|
||||||
</div>
|
</div>
|
||||||
<KilnLine :horizontal="true" />
|
<KilnLine :horizontal="true" />
|
||||||
<div class="" style="flex: 2; padding: 8px">
|
<div
|
||||||
|
class=""
|
||||||
|
style="flex: 2; padding: 8px">
|
||||||
<div
|
<div
|
||||||
class="header-line"
|
class="header-line"
|
||||||
style="margin-bottom: 10px; display: flex; align-items: center">
|
style="margin-bottom: 10px; display: flex; align-items: center">
|
||||||
<h2 class="" style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
|
<h2
|
||||||
|
class=""
|
||||||
|
style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
|
||||||
烟气趋势图
|
烟气趋势图
|
||||||
</h2>
|
</h2>
|
||||||
|
<TimePrompt
|
||||||
|
class="timeShow"
|
||||||
|
:timestr="timestr" />
|
||||||
<!-- <Switcher /> -->
|
<!-- <Switcher /> -->
|
||||||
<div>
|
<div>
|
||||||
<!-- <span class="lgd lgd-total">总量</span> -->
|
<!-- <span class="lgd lgd-total">总量</span> -->
|
||||||
@@ -96,11 +131,21 @@
|
|||||||
justify-content: space-between;
|
justify-content: space-between;
|
||||||
">
|
">
|
||||||
<SelectorBtnGroup
|
<SelectorBtnGroup
|
||||||
:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']" @emitFun='toggleType' :active='chartType'/>
|
:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']"
|
||||||
<SelectorBtnGroup :options="['日', '周', '月', '年']" @emitFun='toggleDate' :active='chartTime' />
|
@emitFun="toggleType"
|
||||||
|
:active="chartType" />
|
||||||
|
<SelectorBtnGroup
|
||||||
|
:options="['日', '周', '月', '年']"
|
||||||
|
@emitFun="toggleDate"
|
||||||
|
:active="chartTime" />
|
||||||
</div>
|
</div>
|
||||||
<div class="chart" style="height: 250px;margin-top: 10px;">
|
<div
|
||||||
<FlueGasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
|
class="chart"
|
||||||
|
style="height: 250px; margin-top: 10px">
|
||||||
|
<FlueGasChart
|
||||||
|
:chartType="chartType"
|
||||||
|
:chartTime="chartTime"
|
||||||
|
@emitFun="dateUpdate" />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Container>
|
</Container>
|
||||||
@@ -115,7 +160,7 @@ import KilnLine from '../components/line';
|
|||||||
import SelectorBtnGroup from '../components/SelectorBtnGroup';
|
import SelectorBtnGroup from '../components/SelectorBtnGroup';
|
||||||
import FlueGasChart from '../components/FlueGasChart';
|
import FlueGasChart from '../components/FlueGasChart';
|
||||||
import TimePrompt from '../components/TimePrompt';
|
import TimePrompt from '../components/TimePrompt';
|
||||||
import { switchShowTime } from '../utils'
|
import { switchShowTime } from '../utils';
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'GasHandle',
|
name: 'GasHandle',
|
||||||
@@ -125,49 +170,44 @@ export default {
|
|||||||
KilnLine,
|
KilnLine,
|
||||||
SelectorBtnGroup,
|
SelectorBtnGroup,
|
||||||
FlueGasChart,
|
FlueGasChart,
|
||||||
TimePrompt
|
TimePrompt,
|
||||||
},
|
},
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
chartType:'氧气含量',
|
chartType: '氧气含量',
|
||||||
chartTime:'日',
|
chartTime: '日',
|
||||||
timestr: ''
|
timestr: '',
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
exhaustGasInfo() {
|
exhaustGasInfo() {
|
||||||
return this.$store.state.websocket.exhaustGasInfo
|
return this.$store.state.websocket.exhaustGasInfo;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.timestr = switchShowTime(this.chartTime)
|
this.timestr = switchShowTime(this.chartTime);
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 烟气
|
// 烟气
|
||||||
toggleType(val) {
|
toggleType(val) {
|
||||||
console.log('烟气' + val)
|
console.log('烟气' + val);
|
||||||
this.chartType = val
|
this.chartType = val;
|
||||||
},
|
},
|
||||||
// 切换时间
|
// 切换时间
|
||||||
toggleDate(val) {
|
toggleDate(val) {
|
||||||
this.chartTime = val
|
this.chartTime = val;
|
||||||
this.timestr = switchShowTime(val)
|
this.timestr = switchShowTime(val);
|
||||||
},
|
},
|
||||||
// 数据更新
|
// 数据更新
|
||||||
dateUpdate() {
|
dateUpdate() {
|
||||||
this.timestr = switchShowTime(this.chartTime)
|
this.timestr = switchShowTime(this.chartTime);
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss">
|
<style scoped lang="scss">
|
||||||
.timeShow {
|
|
||||||
position: absolute;
|
|
||||||
top: 20px;
|
|
||||||
left: 170px;
|
|
||||||
}
|
|
||||||
.gas-handle {
|
.gas-handle {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,9 @@
|
|||||||
name="原料用量统计"
|
name="原料用量统计"
|
||||||
size="middle"
|
size="middle"
|
||||||
style="">
|
style="">
|
||||||
|
<TimePrompt
|
||||||
|
class="timeShow"
|
||||||
|
:timestr="timestr" />
|
||||||
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
|
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
|
||||||
<div
|
<div
|
||||||
class="absolute"
|
class="absolute"
|
||||||
@@ -10,8 +13,8 @@
|
|||||||
flex: 2;
|
flex: 2;
|
||||||
padding: 12px 12px 0 12px;
|
padding: 12px 12px 0 12px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(2, 1fr);
|
grid-template-columns: repeat(3, 1fr);
|
||||||
grid-auto-rows: repeat(4, 1fr);
|
grid-auto-rows: repeat(3, 1fr);
|
||||||
gap: 8px;
|
gap: 8px;
|
||||||
">
|
">
|
||||||
<ShadowRect
|
<ShadowRect
|
||||||
@@ -22,7 +25,8 @@
|
|||||||
class="material"
|
class="material"
|
||||||
style="
|
style="
|
||||||
flex: 1;
|
flex: 1;
|
||||||
padding-bottom: 3px;
|
padding-bottom: 18px;
|
||||||
|
padding-top: 18px;
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 4px;
|
gap: 4px;
|
||||||
@@ -53,20 +57,33 @@
|
|||||||
<script>
|
<script>
|
||||||
import Container from '../components/Container';
|
import Container from '../components/Container';
|
||||||
import ShadowRect from '../components/ShadowRect.vue';
|
import ShadowRect from '../components/ShadowRect.vue';
|
||||||
|
import TimePrompt from '../components/TimePrompt';
|
||||||
|
import { switchShowTime } from '../utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'MaterialCost',
|
name: 'MaterialCost',
|
||||||
components: { Container, ShadowRect },
|
components: { Container, ShadowRect, TimePrompt },
|
||||||
props: {},
|
props: {},
|
||||||
data() {
|
data() {
|
||||||
return {};
|
return {
|
||||||
|
timestr: '',
|
||||||
|
};
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
materialMsg() {
|
materialMsg() {
|
||||||
return this.$store.state.websocket.material;
|
return this.$store.state.websocket.material;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
mounted() {
|
||||||
|
this.timestr = switchShowTime('日');
|
||||||
|
},
|
||||||
methods: {},
|
methods: {},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped lang="scss"></style>
|
<style lang="scss" scoped>
|
||||||
|
.timeShow {
|
||||||
|
position: absolute;
|
||||||
|
top: 20px;
|
||||||
|
left: 210px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@@ -29,6 +29,8 @@ export const switchShowTime = (type) => {
|
|||||||
}
|
}
|
||||||
if (lastMonth === 12) {
|
if (lastMonth === 12) {
|
||||||
startYear = currentYear - 1
|
startYear = currentYear - 1
|
||||||
|
}else{
|
||||||
|
startYear = currentYear
|
||||||
}
|
}
|
||||||
startTime = startYear+'.'+lastMonth+'.'+day
|
startTime = startYear+'.'+lastMonth+'.'+day
|
||||||
endTime = currentYear+'.'+(nowTime.getMonth()+1)+'.28'
|
endTime = currentYear+'.'+(nowTime.getMonth()+1)+'.28'
|
||||||
|
|||||||
@@ -1,70 +1,94 @@
|
|||||||
<template>
|
<template>
|
||||||
<div style="flex: 1;" class="orderContainer">
|
<div
|
||||||
<Container name="订单完成情况" size="small" style="">
|
style="flex: 1"
|
||||||
<TimePrompt class="timeShow" :timestr="timestr" />
|
class="orderContainer">
|
||||||
<div style="padding: 5px 10px;">
|
<Container
|
||||||
<dv-scroll-board :config="config" style="width:575px;height:230px" ref='orderScrollBoard'/>
|
name="订单完成情况"
|
||||||
</div>
|
size="small"
|
||||||
</Container>
|
style="">
|
||||||
</div>
|
<TimePrompt
|
||||||
|
class="timeShow"
|
||||||
|
:timestr="timestr" />
|
||||||
|
<div style="padding: 5px 10px">
|
||||||
|
<dv-scroll-board
|
||||||
|
:config="config"
|
||||||
|
style="width: 575px; height: 230px"
|
||||||
|
ref="orderScrollBoard" />
|
||||||
|
</div>
|
||||||
|
</Container>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import Container from '../components/Container'
|
import Container from '../components/Container';
|
||||||
import TimePrompt from '../components/TimePrompt';
|
import TimePrompt from '../components/TimePrompt';
|
||||||
import { formatDate } from '@/utils'
|
import { formatDate } from '@/utils';
|
||||||
import { switchShowTime } from '../utils'
|
import { switchShowTime } from '../utils';
|
||||||
export default {
|
export default {
|
||||||
name: 'OrderStatus',
|
name: 'OrderStatus',
|
||||||
components: { Container, TimePrompt },
|
components: { Container, TimePrompt },
|
||||||
computed: {
|
computed: {
|
||||||
order() {
|
order() {
|
||||||
return this.$store.state.websocket.order
|
return this.$store.state.websocket.order;
|
||||||
}
|
},
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timestr: '',
|
timestr: '',
|
||||||
config: {
|
config: {
|
||||||
header: ['上线时间', '客户名称', '规格','完成度'],
|
header: ['上线时间', '客户名称', '规格', '完成度'],
|
||||||
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
headerBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
|
||||||
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
|
||||||
columnWidth: [155, 160, 150],
|
columnWidth: [155, 160, 150],
|
||||||
data: [],
|
data: [],
|
||||||
rowNum: 6
|
rowNum: 6,
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.timestr = switchShowTime('日')
|
this.timestr = switchShowTime('日');
|
||||||
},
|
},
|
||||||
watch:{
|
watch: {
|
||||||
order:{
|
order: {
|
||||||
handler() {
|
handler() {
|
||||||
let outArr = this.order.map((item) => [
|
let outArr = this.order.map((item) => [
|
||||||
formatDate(item.planStartTime) || '',
|
formatDate(item.planStartTime) || '',
|
||||||
`<span title=${item.customerName || ''}>${item.customerName || ''}</span>`,
|
`<span title=${item.customerName || ''}>${
|
||||||
`<span title=${item.specifications || ''}>${item.specifications || ''}</span>`,
|
item.customerName || ''
|
||||||
`<span style="display:inline-block;width:60px;">${item.completeRate?(item.completeRate*100).toFixed(2)+'%':'0%'}</span>
|
}</span>`,
|
||||||
|
`<span title=${item.specifications || ''}>${
|
||||||
|
item.specifications || ''
|
||||||
|
}</span>`,
|
||||||
|
`<span style="display:inline-block;width:60px;">${
|
||||||
|
item.completeRate
|
||||||
|
? (item.completeRate * 100).toFixed(2) + '%'
|
||||||
|
: '0%'
|
||||||
|
}</span>
|
||||||
<div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;">
|
<div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;">
|
||||||
<svg xmlns="http://www.w3.org/200/svg" height="20" width="20">
|
<svg xmlns="http://www.w3.org/200/svg" height="20" width="20">
|
||||||
<circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/>
|
<circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/>
|
||||||
<circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${item.completeRate?item.completeRate.toFixed(2)*37.68+','+((1-item.completeRate.toFixed(2))*37.68):(0+','+37.68)}"/>
|
<circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${
|
||||||
|
item.completeRate
|
||||||
|
? item.completeRate.toFixed(2) * 37.68 +
|
||||||
|
',' +
|
||||||
|
(1 - item.completeRate.toFixed(2)) * 37.68
|
||||||
|
: 0 + ',' + 37.68
|
||||||
|
}"/>
|
||||||
</svg>
|
</svg>
|
||||||
</div>`
|
</div>`,
|
||||||
]);
|
]);
|
||||||
this.config.data = outArr
|
this.config.data = outArr;
|
||||||
this.$refs['orderScrollBoard'].updateRows(outArr)
|
this.$refs['orderScrollBoard'].updateRows(outArr);
|
||||||
this.timestr = switchShowTime('日')
|
this.timestr = switchShowTime('日');
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
},
|
||||||
}
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss' scoped>
|
<style lang="scss" scoped>
|
||||||
.timeShow {
|
.timeShow {
|
||||||
position: absolute;
|
position: absolute;
|
||||||
top: 20px;
|
top: 20px;
|
||||||
left: 210px;
|
left: 210px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @LastEditTime: 2024-03-25 15:44:49
|
* @LastEditTime: 2024-04-22 15:04:40
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -165,7 +165,7 @@ import SmallTitle from './SmallTitle';
|
|||||||
import { parseTime } from '@/utils/ruoyi';
|
import { parseTime } from '@/utils/ruoyi';
|
||||||
import attrAdd from './attr-add';
|
import attrAdd from './attr-add';
|
||||||
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
import {DICT_TYPE, getDictDatas} from "@/utils/dict";
|
||||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
import { getDepartmentList } from "@/api/base/coreDepartment";
|
||||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
|
import { groupClassesListAll } from '@/api/monitoring/teamProduction'
|
||||||
import { getDictDataLabel } from '@/utils/dict';
|
import { getDictDataLabel } from '@/utils/dict';
|
||||||
|
|
||||||
@@ -289,7 +289,7 @@ export default {
|
|||||||
return item
|
return item
|
||||||
}) || [];
|
}) || [];
|
||||||
// 部门列表
|
// 部门列表
|
||||||
const res1 = await getCoreDepartmentList();
|
const res1 = await getDepartmentList();
|
||||||
this.departmentOptions = res1.data || []
|
this.departmentOptions = res1.data || []
|
||||||
// 巡检人
|
// 巡检人
|
||||||
let inspectorList = [];
|
let inspectorList = [];
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @LastEditTime: 2024-03-15 18:38:52
|
* @LastEditTime: 2024-04-22 14:56:03
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -99,7 +99,7 @@ import {
|
|||||||
createCheckOrder,
|
createCheckOrder,
|
||||||
updateCheckOrder,
|
updateCheckOrder,
|
||||||
} from '@/api/equipment/base/inspection/settings';
|
} from '@/api/equipment/base/inspection/settings';
|
||||||
import { getCoreDepartmentList } from '@/api/base/coreDepartment';
|
import { getDepartmentList } from '@/api/base/coreDepartment';
|
||||||
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
import { groupClassesListAll } from '@/api/monitoring/teamProduction';
|
||||||
import { getDictDataLabel } from '@/utils/dict';
|
import { getDictDataLabel } from '@/utils/dict';
|
||||||
// import { getEquipmentAll } from '@/api/base/equipment'
|
// import { getEquipmentAll } from '@/api/base/equipment'
|
||||||
@@ -195,7 +195,7 @@ export default {
|
|||||||
},
|
},
|
||||||
async getDict() {
|
async getDict() {
|
||||||
// 部门列表
|
// 部门列表
|
||||||
const res = await getCoreDepartmentList();
|
const res = await getDepartmentList();
|
||||||
this.departmentOptions = res.data || [];
|
this.departmentOptions = res.data || [];
|
||||||
const res1 = await groupClassesListAll();
|
const res1 = await groupClassesListAll();
|
||||||
this.groupOptions =
|
this.groupOptions =
|
||||||
|
|||||||
@@ -320,7 +320,7 @@ export default {
|
|||||||
async getList(source = 'department') {
|
async getList(source = 'department') {
|
||||||
const urls = [
|
const urls = [
|
||||||
'/base/core-production-line/listAll',
|
'/base/core-production-line/listAll',
|
||||||
'/base/core-department/listAll',
|
'/system/dept/list-all-simple',
|
||||||
'/base/core-worker/listAll',
|
'/base/core-worker/listAll',
|
||||||
];
|
];
|
||||||
let res;
|
let res;
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ export default {
|
|||||||
async getList(source = 'department') {
|
async getList(source = 'department') {
|
||||||
const urls = [
|
const urls = [
|
||||||
'/base/core-production-line/listAll',
|
'/base/core-production-line/listAll',
|
||||||
'/base/core-department/listAll',
|
'system/dept/list-all-simple',
|
||||||
'/base/core-worker/listAll',
|
'/base/core-worker/listAll',
|
||||||
];
|
];
|
||||||
let res;
|
let res;
|
||||||
|
|||||||
@@ -609,7 +609,7 @@ export default {
|
|||||||
async getList(source = 'department') {
|
async getList(source = 'department') {
|
||||||
const urls = [
|
const urls = [
|
||||||
'/base/core-production-line/listAll',
|
'/base/core-production-line/listAll',
|
||||||
'/base/core-department/listAll',
|
'/system/dept/list-all-simple',
|
||||||
'/base/core-worker/listAll',
|
'/base/core-worker/listAll',
|
||||||
];
|
];
|
||||||
let res;
|
let res;
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
* @Author: zwq
|
* @Author: zwq
|
||||||
* @Date: 2021-11-18 14:16:25
|
* @Date: 2021-11-18 14:16:25
|
||||||
* @LastEditors: DY
|
* @LastEditors: DY
|
||||||
* @LastEditTime: 2024-03-13 15:55:36
|
* @LastEditTime: 2024-04-19 17:13:45
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
@@ -114,7 +114,7 @@
|
|||||||
import basicAdd from '../../../../core/mixins/basic-add';
|
import basicAdd from '../../../../core/mixins/basic-add';
|
||||||
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
|
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
|
||||||
import { getWorkerList } from '@/api/base/worker'
|
import { getWorkerList } from '@/api/base/worker'
|
||||||
import { getCoreDepartmentList } from "@/api/base/coreDepartment";
|
import { getDepartmentList } from "@/api/base/coreDepartment";
|
||||||
import { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
|
import { createPlan, updatePlan, getCode, getPlan } from '@/api/equipment/base/maintain/planconfig';
|
||||||
import { getCorePLList } from '@/api/base/coreProductionLine';
|
import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||||
import { parseTime } from '../../../../core/mixins/code-filter';
|
import { parseTime } from '../../../../core/mixins/code-filter';
|
||||||
@@ -175,7 +175,7 @@ export default {
|
|||||||
async getDict() {
|
async getDict() {
|
||||||
// 部门列表
|
// 部门列表
|
||||||
this.menuOptions = []
|
this.menuOptions = []
|
||||||
const res = await getCoreDepartmentList();
|
const res = await getDepartmentList();
|
||||||
this.departmentlList = res.data.map(item => {
|
this.departmentlList = res.data.map(item => {
|
||||||
item.parentId = item.parentId ? item.parentId : 0
|
item.parentId = item.parentId ? item.parentId : 0
|
||||||
return item
|
return item
|
||||||
|
|||||||
@@ -376,7 +376,7 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style lang='scss'>
|
<style lang="scss">
|
||||||
.orderMonitoring {
|
.orderMonitoring {
|
||||||
.el-tabs__nav::after {
|
.el-tabs__nav::after {
|
||||||
content: '';
|
content: '';
|
||||||
@@ -431,4 +431,4 @@ export default {
|
|||||||
vertical-align: bottom;
|
vertical-align: bottom;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -25,6 +25,14 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
<el-col :span="24">
|
||||||
|
<el-form-item label="重置方式" prop="resetMethod" :rules="[{ required: true, message: '不能为空', trigger: 'blur' }]">
|
||||||
|
<el-radio-group v-model="dataForm.resetMethod">
|
||||||
|
<el-radio :label="0">自动</el-radio>
|
||||||
|
<el-radio :label="1">手动</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
</el-form-item>
|
||||||
|
</el-col>
|
||||||
<el-col :span="24">
|
<el-col :span="24">
|
||||||
<el-form-item label="检测内容" prop="inspectionDetIdList"
|
<el-form-item label="检测内容" prop="inspectionDetIdList"
|
||||||
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
|
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
|
||||||
@@ -109,6 +117,7 @@ export default {
|
|||||||
sectionId: null,
|
sectionId: null,
|
||||||
productionLineId: null,
|
productionLineId: null,
|
||||||
inspectionDetIdList:[],
|
inspectionDetIdList:[],
|
||||||
|
resetMethod: 0
|
||||||
},
|
},
|
||||||
disabled:false,
|
disabled:false,
|
||||||
formLoading: true,
|
formLoading: true,
|
||||||
@@ -143,7 +152,7 @@ export default {
|
|||||||
methods: {
|
methods: {
|
||||||
init(obj) {
|
init(obj) {
|
||||||
// console.log(productionLineId);
|
// console.log(productionLineId);
|
||||||
console.log(obj)
|
console.log('你好打印', obj)
|
||||||
this.getProductionLineList()
|
this.getProductionLineList()
|
||||||
this.getQualityInspectionDetList()
|
this.getQualityInspectionDetList()
|
||||||
this.visible = true
|
this.visible = true
|
||||||
@@ -162,6 +171,7 @@ export default {
|
|||||||
console.log(res);
|
console.log(res);
|
||||||
this.dataForm.inspectionDetIdList = res.data
|
this.dataForm.inspectionDetIdList = res.data
|
||||||
this.dataForm.productionLineId = obj.productionLineId
|
this.dataForm.productionLineId = obj.productionLineId
|
||||||
|
this.dataForm.resetMethod = obj.resetMethod
|
||||||
this.getWorksectionList(obj.productionLineId)
|
this.getWorksectionList(obj.productionLineId)
|
||||||
this.dataForm.sectionId = obj.sectionId
|
this.dataForm.sectionId = obj.sectionId
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -151,7 +151,8 @@ export default {
|
|||||||
productionLineId:item.productionLineId,
|
productionLineId:item.productionLineId,
|
||||||
productionLineName:item.productionLineName,
|
productionLineName:item.productionLineName,
|
||||||
sectionId: item.sectionId,
|
sectionId: item.sectionId,
|
||||||
sectionName: item.sectionName
|
sectionName: item.sectionName,
|
||||||
|
resetMethod: item.resetMethod
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.listQuery.total = response.data.total;
|
this.listQuery.total = response.data.total;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-01-24 15:15:24
|
* @Date: 2024-01-24 15:15:24
|
||||||
* @LastEditTime: 2024-04-18 16:49:31
|
* @LastEditTime: 2024-04-23 09:05:08
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -12,20 +12,26 @@
|
|||||||
</el-alert> -->
|
</el-alert> -->
|
||||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||||
<el-form-item label="日" prop="time">
|
<el-form-item label="日" prop="time">
|
||||||
<el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime"
|
<el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime" placeholder="选择日期">
|
||||||
placeholder="选择日期">
|
|
||||||
</el-date-picker>
|
</el-date-picker>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<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>
|
@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>
|
plain @click="handleExport">导出</el-button>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType"
|
<el-col :span="16">
|
||||||
@refreshDataList="getDataList" />
|
<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
|
<!-- <pagination
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
:page.sync="listQuery.pageNo"
|
:page.sync="listQuery.pageNo"
|
||||||
@@ -36,18 +42,21 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
// import { parseTime } from '../../core/mixins/code-filter';
|
// 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 inputTable from './inputTable.vue';
|
||||||
|
import inputTableTwo from './inputTableTwo.vue';
|
||||||
|
|
||||||
// import { getCorePLList } from '@/api/base/coreProductionLine';
|
// import { getCorePLList } from '@/api/base/coreProductionLine';
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
// import * as XLSX from 'xlsx'
|
// import * as XLSX from 'xlsx'
|
||||||
export default {
|
export default {
|
||||||
components: { inputTable },
|
components: { inputTable, inputTableTwo },
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getAutoDailyData,
|
getDataListURL: getAutoDailyData,
|
||||||
|
getChildDataListURL: getProductChildData,
|
||||||
// exportURL: exportGlasscExcel
|
// exportURL: exportGlasscExcel
|
||||||
},
|
},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
@@ -62,6 +71,7 @@ export default {
|
|||||||
startTimeStamp: '',
|
startTimeStamp: '',
|
||||||
endTimeStamp: '',
|
endTimeStamp: '',
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
tableDataChild:[],
|
||||||
proLineList: [],
|
proLineList: [],
|
||||||
all: {}
|
all: {}
|
||||||
};
|
};
|
||||||
@@ -119,12 +129,45 @@ export default {
|
|||||||
console.log(res.data.datas);
|
console.log(res.data.datas);
|
||||||
let arr = res.data.datas
|
let arr = res.data.datas
|
||||||
let obj = res.data.reportAutoYdailyRespVO
|
let obj = res.data.reportAutoYdailyRespVO
|
||||||
obj.lineName = '合计'
|
obj.lineName = '压延线产量合计'
|
||||||
arr.push(obj)
|
arr.push(obj)
|
||||||
// this.tableData.push(res.data.reportAutoYdailyRespVO)
|
// this.tableData.push(res.data.reportAutoYdailyRespVO)
|
||||||
this.tableData = arr
|
this.tableData = arr
|
||||||
this.listQuery.total = res.data.length;
|
this.listQuery.total = res.data.length;
|
||||||
this.dataListLoading = false;
|
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) {
|
add0(m) {
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-18 15:49:48
|
* @Date: 2024-04-18 15:49:48
|
||||||
* @LastEditTime: 2024-04-18 16:30:42
|
* @LastEditTime: 2024-04-22 16:15:08
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -13,18 +13,21 @@
|
|||||||
<el-button v-if="edit" size="small" @click="handleReturn()">返回</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-button v-if="edit" size="small" @click="updateData">保存</el-button>
|
||||||
</el-row>
|
</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"
|
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
|
||||||
:align="item.align ? item.align : 'left'">
|
:align="item.align ? item.align : 'left'">
|
||||||
|
|
||||||
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
|
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
|
||||||
:align="item.align ? item.align : 'left'">
|
: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">
|
<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>
|
</el-table-column>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
@@ -35,7 +38,8 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { updateGlass, updateGlassRemark } from '@/api/report/glass';
|
import { updateAutoDailyData } from '@/api/report/qcReport';
|
||||||
|
|
||||||
|
|
||||||
const cols = [
|
const cols = [
|
||||||
{
|
{
|
||||||
@@ -227,6 +231,45 @@ const cols = [
|
|||||||
// }
|
// }
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
handleReturn() {
|
||||||
this.edit = false
|
this.edit = false
|
||||||
console.log(this.$parent.getDataList());
|
console.log(this.$parent.getDataList());
|
||||||
@@ -234,19 +277,8 @@ const cols = [
|
|||||||
handleChange(e) {
|
handleChange(e) {
|
||||||
},
|
},
|
||||||
updateData() {
|
updateData() {
|
||||||
// let obj = {}
|
let data = this.data.slice(0, -1)
|
||||||
// this.data.forEach((ele, index) => {
|
// console.log(obj)
|
||||||
// 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
|
// let updateArr = this.data
|
||||||
// updateArr.forEach((ele, index) => {
|
// updateArr.forEach((ele, index) => {
|
||||||
// delete ele.dailyOutputTrend
|
// delete ele.dailyOutputTrend
|
||||||
@@ -260,12 +292,12 @@ const cols = [
|
|||||||
// delete ele.actualProductTrend
|
// delete ele.actualProductTrend
|
||||||
// delete ele.originalGlassPassTrend
|
// delete ele.originalGlassPassTrend
|
||||||
// });
|
// });
|
||||||
updateGlass(updateArr).then(response => {
|
updateAutoDailyData(data).then(response => {
|
||||||
updateGlassRemark(obj).then(res => {
|
// updateGlassRemark(obj).then(res => {
|
||||||
this.$modal.msgSuccess("修改成功");
|
this.$modal.msgSuccess("修改成功")
|
||||||
this.edit = false;
|
this.edit = false
|
||||||
this.$emit("refreshDataList");
|
// this.$emit("refreshDataList");
|
||||||
});
|
// });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
252
src/views/report/Environmental/productionDayR/inputTableTwo.vue
Normal file
252
src/views/report/Environmental/productionDayR/inputTableTwo.vue
Normal file
@@ -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>
|
||||||
482
src/views/report/Environmental/sectionProduction/index.vue
Normal file
482
src/views/report/Environmental/sectionProduction/index.vue
Normal file
@@ -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>
|
||||||
141
src/views/report/Product/monthly.vue
Normal file
141
src/views/report/Product/monthly.vue
Normal file
@@ -0,0 +1,141 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2024-04-22 15:49:56
|
||||||
|
* @LastEditTime: 2024-04-23 17:06:16
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="weekly">
|
||||||
|
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||||
|
<el-form-item label="月" prop="reportTime">
|
||||||
|
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
|
||||||
|
@click="handleExport">导出</el-button>
|
||||||
|
</el-form>
|
||||||
|
<monthWeek v-if="glassWeekShow" ref="monthWeek" :product="false" :params="listQuery" />
|
||||||
|
<proMonth v-if="proWeekShow" ref="proMonth" :product="false" :params="listQuery" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import monthWeek from '../glass/month.vue'
|
||||||
|
import proMonth from '../productionMonthReport/index.vue'
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { monthWeek, proMonth },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
listQuery: {
|
||||||
|
// pageSize: 10,
|
||||||
|
// pageNo: 1,
|
||||||
|
// total: 0,
|
||||||
|
reportType: 4,
|
||||||
|
reportTime: []
|
||||||
|
},
|
||||||
|
startTimeStamp: '',
|
||||||
|
endTimeStamp: '',
|
||||||
|
reportTime: '',
|
||||||
|
glassWeekShow: false,
|
||||||
|
proWeekShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCurrentMonthFirst()
|
||||||
|
this.glassWeekShow = true
|
||||||
|
this.proWeekShow = true
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
getCurrentMonthFirst() {
|
||||||
|
const date = new Date();
|
||||||
|
date.setDate(1);
|
||||||
|
this.reportTime = date
|
||||||
|
// console.log(date)
|
||||||
|
this.changeTime(date)
|
||||||
|
// console.log(date.valueOf());
|
||||||
|
},
|
||||||
|
handleExport() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['monthWeek'].handleExport()
|
||||||
|
this.$refs['proMonth'].handleExport()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['monthWeek'].getDataList()
|
||||||
|
this.$refs['proMonth'].getDataList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeTime(val) {
|
||||||
|
console.log(val)
|
||||||
|
if(val) {
|
||||||
|
const timeStamp = val.getMonth(); //标准时间转为时间戳,毫秒级别
|
||||||
|
const fullyear = val.getFullYear()
|
||||||
|
let days = 0
|
||||||
|
switch (timeStamp) {
|
||||||
|
case 0:
|
||||||
|
case 2:
|
||||||
|
case 4:
|
||||||
|
case 6:
|
||||||
|
case 7:
|
||||||
|
case 9:
|
||||||
|
case 11:
|
||||||
|
days = 31
|
||||||
|
break
|
||||||
|
case 3:
|
||||||
|
case 4:
|
||||||
|
case 8:
|
||||||
|
case 10:
|
||||||
|
days = 30
|
||||||
|
break
|
||||||
|
case 1:
|
||||||
|
if ((fullyear % 400 === 0) || (fullyear % 4 === 0 && fullyear % 100 !== 0)) {
|
||||||
|
days = 29
|
||||||
|
} else {
|
||||||
|
days = 28
|
||||||
|
}
|
||||||
|
break
|
||||||
|
}
|
||||||
|
this.startTimeStamp = this.timeFun(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()); //开始时间
|
||||||
|
this.endTimeStamp = this.timeFun(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()); //结束时间
|
||||||
|
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(fullyear, timeStamp, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(fullyear, timeStamp, days, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
} else {
|
||||||
|
this.listQuery.reportTime = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//时间戳转为yy-mm-dd hh:mm:ss
|
||||||
|
timeFun(unixtimestamp) {
|
||||||
|
var unixtimestamp = new Date(unixtimestamp);
|
||||||
|
var year = 1900 + unixtimestamp.getYear();
|
||||||
|
var month = "0" + (unixtimestamp.getMonth() + 1);
|
||||||
|
var date = "0" + unixtimestamp.getDate();
|
||||||
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.weekly {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
.blueTip::before{
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
background: #0B58FF;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8PX;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
171
src/views/report/Product/weekly.vue
Normal file
171
src/views/report/Product/weekly.vue
Normal file
@@ -0,0 +1,171 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2024-04-22 15:49:56
|
||||||
|
* @LastEditTime: 2024-04-23 15:43:36
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="weekly">
|
||||||
|
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||||
|
<el-form-item>
|
||||||
|
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
||||||
|
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||||
|
style="width: 350px" placeholder="选择周">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
|
||||||
|
@click="handleExport">导出</el-button>
|
||||||
|
</el-form>
|
||||||
|
<glassWeek v-if="glassWeekShow" ref="glassWeek" :product="false" :params="listQuery" />
|
||||||
|
<proWeek v-if="proWeekShow" ref="proWeek" :product="false" :params="listQuery" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import glassWeek from '../glass/weekly.vue'
|
||||||
|
import proWeek from '../productionWeekReport/index.vue'
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { glassWeek, proWeek },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
listQuery: {
|
||||||
|
// pageSize: 10,
|
||||||
|
// pageNo: 1,
|
||||||
|
// total: 0,
|
||||||
|
reportType: 3,
|
||||||
|
reportTime: []
|
||||||
|
},
|
||||||
|
startTimeStamp: '',
|
||||||
|
endTimeStamp: '',
|
||||||
|
reportTime: '',
|
||||||
|
glassWeekShow: false,
|
||||||
|
proWeekShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCurrentWeekStartTimeAndEndTime()
|
||||||
|
this.glassWeekShow = true
|
||||||
|
this.proWeekShow = true
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleExport() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['glassWeek'].handleExport()
|
||||||
|
this.$refs['proWeek'].handleExport()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['glassWeek'].getDataList()
|
||||||
|
this.$refs['proWeek'].getDataList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeTime(val) {
|
||||||
|
console.log(val);
|
||||||
|
if(val) {
|
||||||
|
let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
||||||
|
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //开始时间
|
||||||
|
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //结束时间
|
||||||
|
console.log(this.startTimeStamp, this.endTimeStamp)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
} else {
|
||||||
|
this.listQuery.reportTime = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCurrentWeekStartTimeAndEndTime() {
|
||||||
|
this.reportTime = new Date()
|
||||||
|
var weekday = new Array(7);
|
||||||
|
weekday[0] = "Sunday";
|
||||||
|
weekday[1] = "Monday";
|
||||||
|
weekday[2] = "Tuesday";
|
||||||
|
weekday[3] = "Wednesday";
|
||||||
|
weekday[4] = "Thursday";
|
||||||
|
weekday[5] = "Friday";
|
||||||
|
weekday[6] = "Saturday";
|
||||||
|
// console.log(weekday[this.reportTime.getDay()]);
|
||||||
|
if (weekday[this.reportTime.getDay()] === 'Monday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime())
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
|
||||||
|
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
|
||||||
|
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //结束时间
|
||||||
|
// this.changeTime(reportTime)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
//时间戳转为yy-mm-dd hh:mm:ss
|
||||||
|
timeFun(unixtimestamp) {
|
||||||
|
var unixtimestamp = new Date(unixtimestamp);
|
||||||
|
var year = 1900 + unixtimestamp.getYear();
|
||||||
|
var month = "0" + (unixtimestamp.getMonth() + 1);
|
||||||
|
var date = "0" + unixtimestamp.getDate();
|
||||||
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.weekly {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
.blueTip::before{
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
background: #0B58FF;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8PX;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
117
src/views/report/Product/year.vue
Normal file
117
src/views/report/Product/year.vue
Normal file
@@ -0,0 +1,117 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: Do not edit
|
||||||
|
* @Date: 2024-04-22 15:49:56
|
||||||
|
* @LastEditTime: 2024-04-23 17:16:11
|
||||||
|
* @LastEditors: DY
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="weekly">
|
||||||
|
<el-form :inline="true" :model="listQuery" class="blueTip">
|
||||||
|
<el-form-item label="年" prop="reportTime">
|
||||||
|
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
||||||
|
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||||
|
style="width: 350px" placeholder="选择年">
|
||||||
|
</el-date-picker>
|
||||||
|
</el-form-item>
|
||||||
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
|
||||||
|
查询
|
||||||
|
</el-button>
|
||||||
|
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
|
||||||
|
@click="handleExport">导出</el-button>
|
||||||
|
</el-form>
|
||||||
|
<glassYear v-if="glassYearShow" ref="glassYear" :product="false" :params="listQuery" />
|
||||||
|
<proYear v-if="proYearShow" ref="proYear" :product="false" :params="listQuery" />
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import glassYear from '../glass/year.vue'
|
||||||
|
import proYear from '../productionYearReport/index.vue'
|
||||||
|
import { parseTime } from '../../core/mixins/code-filter';
|
||||||
|
|
||||||
|
export default {
|
||||||
|
components: { glassYear, proYear },
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
listQuery: {
|
||||||
|
// pageSize: 10,
|
||||||
|
// pageNo: 1,
|
||||||
|
// total: 0,
|
||||||
|
reportType: 5,
|
||||||
|
reportTime: []
|
||||||
|
},
|
||||||
|
startTimeStamp: '',
|
||||||
|
endTimeStamp: '',
|
||||||
|
reportTime: '',
|
||||||
|
glassYearShow: false,
|
||||||
|
proYearShow: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getCurrentYearFirst()
|
||||||
|
this.glassYearShow = true
|
||||||
|
this.proYearShow = true
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
handleExport() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['glassYear'].handleExport()
|
||||||
|
this.$refs['proYear'].handleExport()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
search() {
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs['glassYear'].getDataList()
|
||||||
|
this.$refs['proYear'].getDataList()
|
||||||
|
})
|
||||||
|
},
|
||||||
|
changeTime(val) {
|
||||||
|
if(val) {
|
||||||
|
// let timeStamp = val.getTime(); //标准时间转为时间戳,毫秒级别
|
||||||
|
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(),11, 31, 7, 0, 0).getTime()); //开始时间
|
||||||
|
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //结束时间
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(val.getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
|
||||||
|
} else {
|
||||||
|
this.listQuery.reportTime = []
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getCurrentYearFirst() {
|
||||||
|
let date = new Date();
|
||||||
|
date.setDate(1);
|
||||||
|
date.setMonth(0);
|
||||||
|
this.reportTime = date;
|
||||||
|
this.startTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 0, 1,7,0,1).getTime()); //开始时间
|
||||||
|
this.endTimeStamp = this.timeFun(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()); //结束时间
|
||||||
|
this.listQuery.reportTime[0] = parseTime(new Date(new Date().getFullYear(), 0, 1, 7, 0, 1).getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
|
||||||
|
this.listQuery.reportTime[1] = parseTime(new Date(new Date().getFullYear(), 11, 31, 7, 0, 0).getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 100
|
||||||
|
},
|
||||||
|
//时间戳转为yy-mm-dd hh:mm:ss
|
||||||
|
timeFun(unixtimestamp) {
|
||||||
|
var unixtimestamp = new Date(unixtimestamp);
|
||||||
|
var year = 1900 + unixtimestamp.getYear();
|
||||||
|
var month = "0" + (unixtimestamp.getMonth() + 1);
|
||||||
|
var date = "0" + unixtimestamp.getDate();
|
||||||
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
.weekly {
|
||||||
|
padding-top: 16px;
|
||||||
|
}
|
||||||
|
.blueTip::before{
|
||||||
|
display: inline-block;
|
||||||
|
content: '';
|
||||||
|
width: 4px;
|
||||||
|
height: 18px;
|
||||||
|
background: #0B58FF;
|
||||||
|
border-radius: 1px;
|
||||||
|
margin-right: 8PX;
|
||||||
|
margin-top: 8px;
|
||||||
|
margin-left: 16px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
@@ -1,13 +1,13 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: Do not edit
|
* @Author: Do not edit
|
||||||
* @Date: 2023-12-13 14:10:04
|
* @Date: 2023-12-13 14:10:04
|
||||||
* @LastEditTime: 2024-04-12 14:21:34
|
* @LastEditTime: 2024-04-23 16:47:21
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<el-row style="float: right; margin-bottom: 5px">
|
<el-row v-if="isShowEdit" style="float: right; margin-bottom: 5px">
|
||||||
<el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
|
<el-button v-if="!edit && this.$auth.hasPermi('base:report-auto-original-glass:update')" :disabled="noData"
|
||||||
size="small" @click="edit = true">编辑</el-button>
|
size="small" @click="edit = true">编辑</el-button>
|
||||||
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
|
<el-button v-if="edit" size="small" @click="handleReturn()">返回</el-button>
|
||||||
@@ -152,6 +152,10 @@ const cols = [
|
|||||||
type: {
|
type: {
|
||||||
type: Number,
|
type: Number,
|
||||||
default: 3,
|
default: 3,
|
||||||
|
},
|
||||||
|
isShowEdit: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
@@ -174,8 +178,9 @@ const cols = [
|
|||||||
},
|
},
|
||||||
time: {
|
time: {
|
||||||
immediate: true,
|
immediate: true,
|
||||||
|
deep: true,
|
||||||
handler(newv, oldv) {
|
handler(newv, oldv) {
|
||||||
if (newv[0] !== '') {
|
if (newv[0] !== '' && newv[0] !== undefined) {
|
||||||
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
|
this.cols[0].label = this.date + '(' + newv[0] + '-' + newv[1] + ')'
|
||||||
} else {
|
} else {
|
||||||
this.cols[0].label = this.date
|
this.cols[0].label = this.date
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div>
|
<div v-if="product">
|
||||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||||
<el-form-item label="月" prop="reportTime">
|
<el-form-item label="月" prop="reportTime">
|
||||||
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||||
@@ -14,7 +14,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
|
<inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
|
||||||
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
||||||
<!-- <pagination
|
<!-- <pagination
|
||||||
:limit.sync="listQuery.pageSize"
|
:limit.sync="listQuery.pageSize"
|
||||||
@@ -33,6 +33,16 @@ import FileSaver from 'file-saver'
|
|||||||
// import * as XLSX from 'xlsx'
|
// import * as XLSX from 'xlsx'
|
||||||
export default {
|
export default {
|
||||||
components: { inputTable },
|
components: { inputTable },
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@@ -40,9 +50,6 @@ export default {
|
|||||||
exportURL: exportGlasscExcel
|
exportURL: exportGlasscExcel
|
||||||
},
|
},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
reportType: 4,
|
reportType: 4,
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
@@ -101,6 +108,9 @@ export default {
|
|||||||
const res = await getCorePLList()
|
const res = await getCorePLList()
|
||||||
this.proLineList = res.data;
|
this.proLineList = res.data;
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
|
if (this?.params) {
|
||||||
|
this.listQuery = {...this.params}
|
||||||
|
}
|
||||||
if (this.listQuery.reportTime.length == 0) {
|
if (this.listQuery.reportTime.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请选择时间',
|
message: '请选择时间',
|
||||||
|
|||||||
@@ -4,7 +4,7 @@
|
|||||||
:formConfigs="formConfig"
|
:formConfigs="formConfig"
|
||||||
ref="searchBarForm"
|
ref="searchBarForm"
|
||||||
@headBtnClick="buttonClick" /> -->
|
@headBtnClick="buttonClick" /> -->
|
||||||
<div>
|
<div v-if="product">
|
||||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||||
<el-form-item label="周" prop="reportTime">
|
<el-form-item label="周" prop="reportTime">
|
||||||
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
|
<inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
|
||||||
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -35,6 +35,16 @@ import FileSaver from 'file-saver'
|
|||||||
// import * as XLSX from 'xlsx'
|
// import * as XLSX from 'xlsx'
|
||||||
export default {
|
export default {
|
||||||
components: { inputTable },
|
components: { inputTable },
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@@ -42,9 +52,6 @@ export default {
|
|||||||
exportURL: exportGlasscExcel
|
exportURL: exportGlasscExcel
|
||||||
},
|
},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 10,
|
|
||||||
pageNo: 1,
|
|
||||||
total: 0,
|
|
||||||
reportType: 3,
|
reportType: 3,
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
@@ -89,11 +96,12 @@ export default {
|
|||||||
},
|
},
|
||||||
created () {
|
created () {
|
||||||
// this.getDict()
|
// this.getDict()
|
||||||
|
this.getCurrentWeekStartTimeAndEndTime()
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// const day = new Date().getDay()
|
// const day = new Date().getDay()
|
||||||
// console.log('周四', day)
|
// console.log('周四', day)
|
||||||
this.getCurrentWeekStartTimeAndEndTime()
|
// this.getCurrentWeekStartTimeAndEndTime()
|
||||||
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
|
// this.changeTime(new Date(new Date().getTime() - day * 24 * 60 * 60 * 1000))
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
},
|
},
|
||||||
@@ -190,6 +198,10 @@ export default {
|
|||||||
const res = await getCorePLList()
|
const res = await getCorePLList()
|
||||||
this.proLineList = res.data;
|
this.proLineList = res.data;
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
|
if (this?.params) {
|
||||||
|
this.listQuery = {...this.params}
|
||||||
|
// this.$set(this.listQuery, 'reportTime', this.params.reportTime)
|
||||||
|
}
|
||||||
if (this.listQuery.reportTime.length == 0) {
|
if (this.listQuery.reportTime.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请选择时间',
|
message: '请选择时间',
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<div>
|
<div v-if="product">
|
||||||
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
|
||||||
<el-form-item label="年" prop="reportTime">
|
<el-form-item label="年" prop="reportTime">
|
||||||
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
||||||
@@ -16,7 +16,7 @@
|
|||||||
</el-form-item>
|
</el-form-item>
|
||||||
</el-form>
|
</el-form>
|
||||||
</div>
|
</div>
|
||||||
<inputTable :date="date" :data="tableData" :time="[startTimeStamp, endTimeStamp]" :sum="all"
|
<inputTable :date="date" :data="tableData" :isShowEdit="product" :time="listQuery.reportTime" :sum="all" :key="listQuery.reportTime[0]"
|
||||||
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
:type="listQuery.reportType" @refreshDataList="getDataList" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
@@ -30,6 +30,16 @@ import FileSaver from 'file-saver'
|
|||||||
// import * as XLSX from 'xlsx'
|
// import * as XLSX from 'xlsx'
|
||||||
export default {
|
export default {
|
||||||
components: { inputTable },
|
components: { inputTable },
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
@@ -37,9 +47,9 @@ export default {
|
|||||||
exportURL: exportGlasscExcel
|
exportURL: exportGlasscExcel
|
||||||
},
|
},
|
||||||
listQuery: {
|
listQuery: {
|
||||||
pageSize: 10,
|
// pageSize: 10,
|
||||||
pageNo: 1,
|
// pageNo: 1,
|
||||||
total: 0,
|
// total: 0,
|
||||||
reportType: 5,
|
reportType: 5,
|
||||||
reportTime: []
|
reportTime: []
|
||||||
},
|
},
|
||||||
@@ -54,11 +64,10 @@ export default {
|
|||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
// this.getDict()
|
// this.getDict()
|
||||||
|
this.getCurrentYearFirst()
|
||||||
},
|
},
|
||||||
mounted () {
|
mounted () {
|
||||||
this.getCurrentYearFirst()
|
this.getDataList();
|
||||||
this.getDataList()
|
|
||||||
;
|
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getCurrentYearFirst() {
|
getCurrentYearFirst() {
|
||||||
@@ -101,6 +110,9 @@ export default {
|
|||||||
const res = await getCorePLList()
|
const res = await getCorePLList()
|
||||||
this.proLineList = res.data;
|
this.proLineList = res.data;
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
|
if (this?.params) {
|
||||||
|
this.listQuery = {...this.params}
|
||||||
|
}
|
||||||
if (this.listQuery.reportTime.length == 0) {
|
if (this.listQuery.reportTime.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
message: '请选择时间',
|
message: '请选择时间',
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-18 14:08:46
|
* @Date: 2024-04-18 14:08:46
|
||||||
* @LastEditTime: 2024-04-19 10:53:21
|
* @LastEditTime: 2024-04-24 13:52:45
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -24,14 +24,34 @@
|
|||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table> -->
|
</el-table> -->
|
||||||
|
|
||||||
<el-table :data="alldata" border style="width: 100%">
|
<el-table class="baseTable" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
|
||||||
<el-table-column prop="category" label="项目及分值" width="180">
|
<el-table-column align="center" prop="" label="配料日报" width="120">
|
||||||
</el-table-column>
|
<el-table-column label="原料样式" align="right" width="150">
|
||||||
<el-table-column prop label="参考标准及评价方法">
|
<el-table-column prop="className" label="时间" width="120">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table-column>
|
||||||
|
<el-table-column align="center" 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="activityName"></el-table-column>
|
||||||
<el-table-column prop="message"></el-table-column>
|
<el-table-column prop="message"></el-table-column>
|
||||||
</el-table-column>
|
</el-table-column> -->
|
||||||
<el-table-column prop="value" label="参考分值">
|
<el-table-column align="center" 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-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
@@ -110,70 +130,13 @@ export default {
|
|||||||
// deleteURL: deleteQualityHotMaterial,
|
// deleteURL: deleteQualityHotMaterial,
|
||||||
// exportURL: exportFactoryExcel,
|
// exportURL: exportFactoryExcel,
|
||||||
},
|
},
|
||||||
// tableProps,
|
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'],
|
||||||
headers,
|
tableData: [],
|
||||||
// tableData: [
|
|
||||||
// {
|
|
||||||
// date: '2016-05-02',
|
|
||||||
// name: '王小虎',
|
|
||||||
// address: '上海市普陀区金沙江路 1518 弄'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// date: '2016-05-04',
|
|
||||||
// name: '王小虎',
|
|
||||||
// address: '上海市普陀区金沙江路 1517 弄'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// date: '2016-05-01',
|
|
||||||
// name: '王小虎',
|
|
||||||
// address: '上海市普陀区金沙江路 1519 弄'
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// date: '2016-05-03',
|
|
||||||
// name: '王小虎',
|
|
||||||
// address: '上海市普陀区金沙江路 1516 弄'
|
|
||||||
// }
|
|
||||||
// ],
|
|
||||||
// tableData: [],
|
|
||||||
listQuery: {
|
listQuery: {
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime:undefined
|
endTime:undefined
|
||||||
},
|
},
|
||||||
originData: [{
|
|
||||||
type: '选择题',
|
|
||||||
num: '5题',
|
|
||||||
average: '3分/题',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '填空题',
|
|
||||||
num: '5题',
|
|
||||||
average: '3分/题',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
type: '选择题',
|
|
||||||
num: '2题',
|
|
||||||
average: '10分/题',
|
|
||||||
}
|
|
||||||
],
|
|
||||||
originTitle: ['题型', '数量', '均分'], // originTitle 该标题为 正常显示的标题, 数组中的顺序就是上面数据源对象中的字段标题对应的顺序
|
|
||||||
transTitle: ['', '学生1', '学生2', '学生3'], // transTitle 该标题为转化后的标题, 注意多一列, 因为原来的标题变成了竖着显示了, 所以多一列标题, 第一个为空即可
|
|
||||||
transData: [],
|
|
||||||
formConfig: [
|
formConfig: [
|
||||||
// {
|
|
||||||
// type: 'input',
|
|
||||||
// label: '报废原因',
|
|
||||||
// placeholder: '报废原因',
|
|
||||||
// param: 'content',
|
|
||||||
// },
|
|
||||||
// {
|
|
||||||
// type: 'select',
|
|
||||||
// label: '原料名称',
|
|
||||||
// selectOptions: [],
|
|
||||||
// labelField: 'name',
|
|
||||||
// valueField: 'id',
|
|
||||||
// param: 'materialId',
|
|
||||||
// filterable: true
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间段',
|
label: '时间段',
|
||||||
@@ -185,7 +148,7 @@ export default {
|
|||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
param: 'checkTime',
|
param: 'checkTime',
|
||||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||||
width: 250
|
width: 350
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type:'button',
|
type:'button',
|
||||||
@@ -193,15 +156,11 @@ export default {
|
|||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
},
|
},
|
||||||
// {
|
|
||||||
// type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
|
|
||||||
// // type: 'separate',
|
|
||||||
// },
|
|
||||||
{
|
{
|
||||||
type:'button',
|
type:'button',
|
||||||
btnName: '导出',
|
btnName: '导出',
|
||||||
name: 'export',
|
name: 'export',
|
||||||
color: 'success',
|
color: 'primary',
|
||||||
plain: true
|
plain: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -211,144 +170,6 @@ export default {
|
|||||||
// AddOrUpdate,
|
// AddOrUpdate,
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
var list = [
|
|
||||||
{
|
|
||||||
"id": "16EE8A54E6917F6479905CDC5B031F22",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "16EE8A54E0C17F647404A2DC7783EE88",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "1",
|
|
||||||
"value": "6",
|
|
||||||
"activityName": "坚定政治立场。",
|
|
||||||
"message": " (1)牢固树立“四个意识”巴拉巴拉",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "2",
|
|
||||||
"value": "8",
|
|
||||||
"activityName": "坚定政治立场。",
|
|
||||||
"message": "(2)严格遵守政治纪律和政治规矩.巴拉啦",
|
|
||||||
"period": "19上半年"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activityName": "1. 坚定政治立场。(10分)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "16EE8A54E4817F64779EF35CC6671C10",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "3",
|
|
||||||
"value": "7",
|
|
||||||
"activityName": "坚持学习提高。",
|
|
||||||
"message": "(1)及时认真参加支部集体学习....",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "4",
|
|
||||||
"value": "3",
|
|
||||||
"activityName": "坚持学习提高。",
|
|
||||||
"message": "(2)每年集中学习培训....",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "5",
|
|
||||||
"value": "5",
|
|
||||||
"activityName": "坚持学习提高。",
|
|
||||||
"message": "(3)有取得更高....位",
|
|
||||||
"period": "19上半年"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activityName": "2.坚持学习提高。(6分)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "16EE8A54E4817F64779EF35CC6671C10",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "6",
|
|
||||||
"value": "7",
|
|
||||||
"activityName": "严格组织生活。",
|
|
||||||
"message": "(1)按季度.....",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "7",
|
|
||||||
"value": "3",
|
|
||||||
"activityName": "严格组织生活。",
|
|
||||||
"message": "(2)按时上党课.......。",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "8",
|
|
||||||
"value": "5",
|
|
||||||
"activityName": "坚持学习提高。",
|
|
||||||
"message": "(3)积极参加",
|
|
||||||
"period": "19上半年"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activityName": "3.严格组织生活。(13分)"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"category": "合格积分\r\n(40分)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "16EE8A54FF617F6491391BD04A0D4E7F",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "16EE8A54EA517F647D257760897C805F",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "8",
|
|
||||||
"value": "10",
|
|
||||||
"activityName": "1.所在基层党组织情况。(10分)",
|
|
||||||
"message": " (1) 根据所在.....",
|
|
||||||
"period": "19上半年"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activityName": "1.所在基层党组织情况。(10分)"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "16EE8A54E8517F647B3DE374CF0D6D93",
|
|
||||||
"activityPointsDOS": [
|
|
||||||
{
|
|
||||||
"id": "10",
|
|
||||||
"value": "3",
|
|
||||||
"activityName": "2.年度评议、考核情况。(10分)",
|
|
||||||
"message": " (1) 在党建....",
|
|
||||||
"period": "19上半年"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"id": "9",
|
|
||||||
"value": "10",
|
|
||||||
"activityName": "2.年度评议、考核情况。(10分)",
|
|
||||||
"message": " (2)在年度.........................................................................",
|
|
||||||
"period": "19上半年"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"activityName": "2.年度评议、考核情况。(10分)"
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"category": "综合积分\r\n(20分)"
|
|
||||||
}
|
|
||||||
];
|
|
||||||
this.alldata = this.handleTableArr(list);
|
|
||||||
let matrixData = this.originData.map((row) => {
|
|
||||||
let arr = []
|
|
||||||
for (let key in row) {
|
|
||||||
console.log(row[key])
|
|
||||||
arr.push(row[key])
|
|
||||||
}
|
|
||||||
return arr
|
|
||||||
})
|
|
||||||
console.log(matrixData)
|
|
||||||
// 加入标题拼接最终的数据
|
|
||||||
this.transData = matrixData[0].map((col, i) => {
|
|
||||||
return [this.originTitle[i], ...matrixData.map((row) => {
|
|
||||||
return row[i]
|
|
||||||
})]
|
|
||||||
})
|
|
||||||
console.log(this.transData)
|
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
// this.formConfig[1].defaultSelect[]
|
// this.formConfig[1].defaultSelect[]
|
||||||
@@ -360,68 +181,6 @@ export default {
|
|||||||
// this.getDict();
|
// this.getDict();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
handleTableArr(data) {
|
|
||||||
let arr = [];
|
|
||||||
for (let i = 0; i < data.length; i++) {
|
|
||||||
let category_info = data[i];
|
|
||||||
let activityPointsDOS = category_info["activityPointsDOS"];
|
|
||||||
let count = 0;
|
|
||||||
for (let j = 0; j < activityPointsDOS.length; j++) {
|
|
||||||
let activityTwo_info = activityPointsDOS[j];
|
|
||||||
let activityTwo_activityPointsDOS = activityPointsDOS[j]["activityPointsDOS"];
|
|
||||||
for (let k = 0; k < activityTwo_activityPointsDOS.length; k++) {
|
|
||||||
count++;
|
|
||||||
let info = {
|
|
||||||
// 确定每天数据的 合并行的数量
|
|
||||||
span_num: k === 0 ? activityTwo_activityPointsDOS.length : 0,
|
|
||||||
value: activityTwo_activityPointsDOS[k]["value"],
|
|
||||||
message: activityTwo_activityPointsDOS[k]["message"],
|
|
||||||
activityName: activityTwo_info["activityName"],
|
|
||||||
category: category_info["category"],
|
|
||||||
};
|
|
||||||
arr.push(info);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
// 第一列的合并数量, 赋值给每个大项的第一个单元格. 比如合格积分要合并 8 行.
|
|
||||||
arr[arr.length - count]["count"] = count;
|
|
||||||
}
|
|
||||||
return arr;
|
|
||||||
},
|
|
||||||
renderHeader(h, { column }) {
|
|
||||||
// 隐藏表头内容
|
|
||||||
column.realLabel = column.label;
|
|
||||||
column.label = '';
|
|
||||||
// 返回一个自定义的表头单元格
|
|
||||||
return h('el-table-column', { props: { width: '50' } }, column.realLabel);
|
|
||||||
},
|
|
||||||
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]));
|
|
||||||
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 }) {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
let spanOneArr = [], concatOne = 0;
|
let spanOneArr = [], concatOne = 0;
|
||||||
this.tableData.map((item, index) => {
|
this.tableData.map((item, index) => {
|
||||||
@@ -429,7 +188,7 @@ export default {
|
|||||||
spanOneArr.push(1);
|
spanOneArr.push(1);
|
||||||
} else {
|
} else {
|
||||||
//第一列需合并相同内容的判断条件
|
//第一列需合并相同内容的判断条件
|
||||||
if (item.code === this.tableData[index - 1].code) {
|
if (item.classType === this.tableData[index - 1].classType) {
|
||||||
spanOneArr[concatOne] += 1;
|
spanOneArr[concatOne] += 1;
|
||||||
spanOneArr.push(0);
|
spanOneArr.push(0);
|
||||||
} else {
|
} else {
|
||||||
@@ -447,6 +206,30 @@ export default {
|
|||||||
colspan: _col
|
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 %2 == 1) {
|
||||||
|
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 % 2 == 0) {
|
||||||
|
return {
|
||||||
|
rowspan: 2,
|
||||||
|
colspan: 1
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
handleExport() {
|
handleExport() {
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
@@ -472,7 +255,7 @@ export default {
|
|||||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||||
new Blob([wbout], { type: "application/octet-stream" }),
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
//设置导出文件名称
|
//设置导出文件名称
|
||||||
"原片各线堆垛表.xlsx"
|
"切割堆垛日报表.xlsx"
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (typeof console !== "undefined") console.log(e, wbout);
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
@@ -494,121 +277,267 @@ export default {
|
|||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.listQuery.startTime = '1713197388000';
|
// this.listQuery.startTime = '1713197388000';
|
||||||
this.listQuery.endTime = '1713254961000';
|
// this.listQuery.endTime = '1713254961000';
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
this.urlOptions.getDataListURL(this.listQuery).then(res => {
|
||||||
console.log(res);
|
// console.log(res)
|
||||||
// this.getSpanArr(this.tableData)
|
// console.log(res.data)
|
||||||
// res.data.forEach((ele) => {
|
let arr = [
|
||||||
// console.log(ele.size.substring(2, ele.size.length - 2))
|
{
|
||||||
// // console.log(Object.prototype.toString.call(ele.size))
|
classType: 1,
|
||||||
// // // if (Object.prototype.toString.call(ele.size) === Array) {
|
className:'白班(8:00-20:00)',
|
||||||
// // console.log(11111)
|
'sj1': null,
|
||||||
// // console.log();
|
'sj2': null,
|
||||||
// // }
|
'sj3': null,
|
||||||
// })
|
'sj4': null,
|
||||||
|
'sj5': null,
|
||||||
console.log(res.data)
|
'sj7': null,
|
||||||
this.tableData = res.data.map((ele) => {
|
'sj8': null,
|
||||||
this.mechanism.push(ele.code)
|
'sj10': null,
|
||||||
return {
|
'sj11': null,
|
||||||
classType: ele.classType == 1 ? '白班' : ele.classType == 2 ? '夜班' : '合计',
|
'sj12': null,
|
||||||
code: ele.code,
|
'sj13': null,
|
||||||
putNum: ele.putNum,
|
'sj14': null,
|
||||||
useNum: ele.useNum,
|
putType: '投入数量'
|
||||||
// num: ele.num,
|
},
|
||||||
// size: typeof (ele.size)
|
{
|
||||||
// size: ele.size.match(/\[(.+?)\]/g) ? ele.size.substring(1, ele.size.length - 1) : ele.size
|
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)',
|
||||||
|
'sj1': null,
|
||||||
|
'sj2': null,
|
||||||
|
'sj3': null,
|
||||||
|
'sj4': null,
|
||||||
|
'sj5': null,
|
||||||
|
'sj7': null,
|
||||||
|
'sj8': null,
|
||||||
|
'sj10': null,
|
||||||
|
'sj11': null,
|
||||||
|
'sj12': null,
|
||||||
|
'sj13': null,
|
||||||
|
'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)',
|
||||||
|
'sj1': null,
|
||||||
|
'sj2': null,
|
||||||
|
'sj3': null,
|
||||||
|
'sj4': null,
|
||||||
|
'sj5': null,
|
||||||
|
'sj7': null,
|
||||||
|
'sj8': null,
|
||||||
|
'sj10': null,
|
||||||
|
'sj11': null,
|
||||||
|
'sj12': null,
|
||||||
|
'sj13': null,
|
||||||
|
'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)',
|
||||||
|
'sj1': null,
|
||||||
|
'sj2': null,
|
||||||
|
'sj3': null,
|
||||||
|
'sj4': null,
|
||||||
|
'sj5': null,
|
||||||
|
'sj7': null,
|
||||||
|
'sj8': null,
|
||||||
|
'sj10': null,
|
||||||
|
'sj11': null,
|
||||||
|
'sj12': null,
|
||||||
|
'sj13': null,
|
||||||
|
'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: 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,
|
||||||
|
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: ''
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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,
|
||||||
|
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) => {
|
||||||
for (let i = 0; i < this.tableData.length - 1; i++) {
|
if (ele.classType === 1 && ele.code == item) {
|
||||||
console.log(this.tableData[j].code.substr(this.tableData[j].code.length - 2, 1));
|
// console.log(arr[0][item])
|
||||||
// 二次循环,注意:再减去外层的循环次数,向后依次两两相互比较转换;
|
arr[0][item] = ele.putNum
|
||||||
for (let j = 0; j < this.tableData.length - i - 1; j++) {
|
arr[2][item] = ele.useNum
|
||||||
// 当前一个值大于后一个值
|
} else if (ele.classType === 2 && ele.code == item) {
|
||||||
if (this.tableData[j].code.substr(this.tableData[j].code.length - 2, 1) > this.tableData[j + 1].code.substr(this.tableData[j + 1].code.length - 2, 1)) {
|
arr[4][item] = ele.putNum
|
||||||
// 定义变量,以赋值的形式前后交换,直到换到最小的在前面,左右再无比较,则循环结束形成排序结果
|
arr[6][item] = ele.useNum
|
||||||
let temp = this.tableData[j];
|
} else if (ele.classType === 3 && ele.code == item) {
|
||||||
this.tableData[j] = this.tableData[j + 1];
|
arr[8][item] = ele.putNum
|
||||||
this.tableData[j + 1] = temp;
|
arr[10][item] = ele.useNum
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
}
|
})
|
||||||
// let obj = {}
|
// console.log(arr)
|
||||||
// res.data.reduce((prev, curr) => {
|
this.tableData = arr
|
||||||
// console.log(prev, curr)
|
console.log(this.tableData);
|
||||||
// })
|
|
||||||
// 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 = res.data.total;
|
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
// deleteHandle(id, name, index, data) {
|
|
||||||
// this.$confirm(`确认要删除序号${index}?`, "提示", {
|
|
||||||
// confirmButtonText: "确定",
|
|
||||||
// cancelButtonText: "取消",
|
|
||||||
// type: "warning",
|
|
||||||
// })
|
|
||||||
// .then(() => {
|
|
||||||
// this.urlOptions.deleteURL(id).then(({ data }) => {
|
|
||||||
// this.$message({
|
|
||||||
// message: "操作成功",
|
|
||||||
// type: "success",
|
|
||||||
// duration: 1500,
|
|
||||||
// onClose: () => {
|
|
||||||
// this.getDataList();
|
|
||||||
// },
|
|
||||||
// });
|
|
||||||
// });
|
|
||||||
// })
|
|
||||||
// .catch(() => { });
|
|
||||||
// },
|
|
||||||
// async getDict() {
|
|
||||||
// // 物料列表
|
|
||||||
// const res = await getHotMaterialAllList();
|
|
||||||
// this.formConfig[0].selectOptions = res.data;
|
|
||||||
// },
|
|
||||||
buttonClick(val) {
|
buttonClick(val) {
|
||||||
switch (val.btnName) {
|
switch (val.btnName) {
|
||||||
case 'search':
|
case 'search':
|
||||||
// this.listQuery.pageNo = 1;
|
|
||||||
// this.listQuery.pageSize = 20;
|
|
||||||
// this.listQuery.materialId = val.materialId ? val.materialId : undefined;
|
|
||||||
// this.listQuery.startTime = '1706144404000';
|
|
||||||
// this.listQuery.endTime = '1706230804000';
|
|
||||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
// case 'reset':
|
|
||||||
// this.$refs.searchBarForm.resetForm();
|
|
||||||
// this.listQuery = {
|
|
||||||
// pageSize: 20,
|
|
||||||
// pageNo: 1,
|
|
||||||
// total: 1,
|
|
||||||
// };
|
|
||||||
// this.getDataList();
|
|
||||||
// break;
|
|
||||||
// case 'add':
|
|
||||||
// this.addOrEditTitle = '新增';
|
|
||||||
// this.addOrUpdateVisible = true;
|
|
||||||
// this.addOrUpdateHandle();
|
|
||||||
// break;
|
|
||||||
case 'export':
|
case 'export':
|
||||||
this.handleExport();
|
this.handleExport();
|
||||||
break;
|
break;
|
||||||
@@ -619,24 +548,26 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style scoped>
|
||||||
.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||||
background-color: #EAF1FC;
|
background-color: #EAF1FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.baseTable .el-table .el-table__cell {
|
::v-deep .baseTable .el-table .el-table__cell {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
.el-table thead.is-group th {
|
::v-deep.el-table thead.is-group th {
|
||||||
background: none;
|
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;
|
||||||
|
} */
|
||||||
|
::v-deep.el-table thead.is-group tr:nth-child(2) th:nth-child(1) {
|
||||||
border-bottom: none;
|
border-bottom: none;
|
||||||
}
|
}
|
||||||
|
::v-deep.el-table thead.is-group tr:nth-child(2) th:first-of-type:before {
|
||||||
.el-table thead.is-group tr:first-of-type th:first-of-type:before {
|
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
@@ -652,7 +583,7 @@ export default {
|
|||||||
transform-origin: top;
|
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:nth-child(3) th:first-of-type:before {
|
||||||
content: '';
|
content: '';
|
||||||
position: absolute;
|
position: absolute;
|
||||||
width: 1px;
|
width: 1px;
|
||||||
|
|||||||
@@ -1,29 +1,31 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-12 14:22:46
|
* @LastEditTime: 2024-04-23 16:58:06
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
<div v-if="product">
|
||||||
<el-form-item label="月" prop="reportTime">
|
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||||
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
<el-form-item label="月" prop="reportTime">
|
||||||
</el-date-picker>
|
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
</el-form-item>
|
||||||
查询
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
||||||
</el-button>
|
查询
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
</el-button>
|
||||||
@click="handleExport">导出</el-button>
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
||||||
</el-form>
|
@click="handleExport">导出</el-button>
|
||||||
<el-row style="float: right; margin-bottom: 5px">
|
</el-form>
|
||||||
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
<el-row style="float: right; margin-bottom: 5px">
|
||||||
size="small" @click="editDataList()">编辑</el-button>
|
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
||||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
size="small" @click="editDataList()">编辑</el-button>
|
||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||||
</el-row>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
@@ -286,6 +288,16 @@ export default {
|
|||||||
// DialogForm,
|
// DialogForm,
|
||||||
// },
|
// },
|
||||||
// mixins: [basicPageMixin],
|
// mixins: [basicPageMixin],
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -653,16 +665,21 @@ export default {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
if (this.monthValue.length > 0) {
|
if (this?.params) {
|
||||||
console.log(this.monthValue)
|
this.dataForm = {...this.params}
|
||||||
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
|
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||||
// this.queryParams.startTime = this.monthValue[0]
|
|
||||||
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
|
|
||||||
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
|
|
||||||
console.log(this.timeTips);
|
|
||||||
} else {
|
} else {
|
||||||
// this.$modal.msgError('月范围不能为空')
|
if (this.monthValue.length > 0) {
|
||||||
// return false
|
console.log(this.monthValue)
|
||||||
|
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
|
||||||
|
// this.queryParams.startTime = this.monthValue[0]
|
||||||
|
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
|
||||||
|
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
|
||||||
|
console.log(this.timeTips);
|
||||||
|
} else {
|
||||||
|
// this.$modal.msgError('月范围不能为空')
|
||||||
|
// return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.dataForm.reportTime.length == 0) {
|
if (this.dataForm.reportTime.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -1,31 +1,33 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-12 14:22:51
|
* @LastEditTime: 2024-04-23 16:58:12
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
<div v-if="product">
|
||||||
<el-form-item>
|
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||||
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
<el-form-item>
|
||||||
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
|
||||||
style="width: 350px" placeholder="选择周">
|
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||||
</el-date-picker>
|
style="width: 350px" placeholder="选择周">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
</el-form-item>
|
||||||
查询
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
||||||
</el-button>
|
查询
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
</el-button>
|
||||||
@click="handleExport">导出</el-button>
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
||||||
</el-form>
|
@click="handleExport">导出</el-button>
|
||||||
<el-row style="float: right; margin-bottom: 5px">
|
</el-form>
|
||||||
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
<el-row style="float: right; margin-bottom: 5px">
|
||||||
size="small" @click="editDataList()">编辑</el-button>
|
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
||||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
size="small" @click="editDataList()">编辑</el-button>
|
||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||||
</el-row>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
@@ -292,6 +294,16 @@ export default {
|
|||||||
// DialogForm,
|
// DialogForm,
|
||||||
// },
|
// },
|
||||||
// mixins: [basicPageMixin],
|
// mixins: [basicPageMixin],
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -622,11 +634,16 @@ export default {
|
|||||||
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
if (this.weekValue1 && this.weekValue2) {
|
if (this?.params) {
|
||||||
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
|
this.dataForm = {...this.params}
|
||||||
// this.queryParams.startTime = this.monthValue[0]
|
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||||
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
|
|
||||||
} else {
|
} else {
|
||||||
|
if (this.weekValue1 && this.weekValue2) {
|
||||||
|
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
|
||||||
|
// this.queryParams.startTime = this.monthValue[0]
|
||||||
|
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
|
||||||
|
} else {
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (this.dataForm.reportTime.length == 0) {
|
if (this.dataForm.reportTime.length == 0) {
|
||||||
this.$message({
|
this.$message({
|
||||||
|
|||||||
@@ -1,33 +1,35 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2023-12-12 13:45:25
|
* @Date: 2023-12-12 13:45:25
|
||||||
* @LastEditTime: 2024-04-12 14:22:54
|
* @LastEditTime: 2024-04-23 17:21:04
|
||||||
* @LastEditors: zhp
|
* @LastEditors: DY
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-form :inline="true" :model="dataForm" class="blueTip">
|
<div v-if="product">
|
||||||
<el-form-item>
|
<el-form :inline="true" :model="dataForm" class="blueTip">
|
||||||
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
<el-form-item>
|
||||||
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
|
||||||
style="width: 350px" placeholder="选择年">
|
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
|
||||||
</el-date-picker>
|
style="width: 350px" placeholder="选择年">
|
||||||
</el-form-item>
|
</el-date-picker>
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
</el-form-item>
|
||||||
查询
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
|
||||||
</el-button>
|
查询
|
||||||
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
</el-button>
|
||||||
@click="handleExport">导出</el-button>
|
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
|
||||||
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
|
@click="handleExport">导出</el-button>
|
||||||
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
|
||||||
</el-form>
|
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
|
||||||
<el-row style="float: right; margin-bottom: 5px">
|
</el-form>
|
||||||
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
<el-row style="float: right; margin-bottom: 5px">
|
||||||
size="small" @click="editDataList()">编辑</el-button>
|
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
|
||||||
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
size="small" @click="editDataList()">编辑</el-button>
|
||||||
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
|
||||||
</el-row>
|
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
|
||||||
|
</el-row>
|
||||||
|
</div>
|
||||||
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
@@ -294,6 +296,16 @@ export default {
|
|||||||
// DialogForm,
|
// DialogForm,
|
||||||
// },
|
// },
|
||||||
// mixins: [basicPageMixin],
|
// mixins: [basicPageMixin],
|
||||||
|
props: {
|
||||||
|
product: {
|
||||||
|
type: Boolean,
|
||||||
|
default: true
|
||||||
|
},
|
||||||
|
params: {
|
||||||
|
type: Object,
|
||||||
|
default: () => {}
|
||||||
|
}
|
||||||
|
},
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
list: [],
|
list: [],
|
||||||
@@ -556,15 +568,20 @@ export default {
|
|||||||
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
|
||||||
},
|
},
|
||||||
async getDataList() {
|
async getDataList() {
|
||||||
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
|
if (this?.params) {
|
||||||
console.log(this.yearValue1);
|
this.dataForm = {...this.params}
|
||||||
if (this.yearValue1 && this.yearValue2) {
|
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
|
||||||
if (this.yearValue2 < this.yearValue1) {
|
} else {
|
||||||
this.$modal.msgError('结束时间不能早于开始时间')
|
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
|
||||||
return false
|
console.log(this.yearValue1);
|
||||||
} else {
|
if (this.yearValue1 && this.yearValue2) {
|
||||||
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
|
if (this.yearValue2 < this.yearValue1) {
|
||||||
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
|
this.$modal.msgError('结束时间不能早于开始时间')
|
||||||
|
return false
|
||||||
|
} else {
|
||||||
|
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
|
||||||
|
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (this.dataForm.reportTime.length == 0) {
|
if (this.dataForm.reportTime.length == 0) {
|
||||||
|
|||||||
@@ -1,10 +1,22 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2024-04-18 10:01:33
|
||||||
|
* @LastEditTime: 2024-04-24 09:34:36
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
|
<el-table :header-cell-style="{
|
||||||
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
|
background: '#F2F4F9',
|
||||||
@clickBtn="handleClick" /> -->
|
color: '#606266'
|
||||||
</base-table>
|
}" 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 :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
@pagination="getDataList" /> -->
|
@pagination="getDataList" /> -->
|
||||||
<!-- <base-dialog
|
<!-- <base-dialog
|
||||||
@@ -24,10 +36,12 @@
|
|||||||
// import basicPage from '../../../core/mixins/basic-page';
|
// import basicPage from '../../../core/mixins/basic-page';
|
||||||
// import { parseTime } from '../../../core/mixins/code-filter';
|
// import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getOriginalData
|
getOriginalLineDataList,
|
||||||
|
getCuttingReportDataList
|
||||||
} from '@/api/report/qcReport';
|
} from '@/api/report/qcReport';
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
|
import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
// import { getList, } from "@/api/base/qualityScrapType";
|
// import { getList, } from "@/api/base/qualityScrapType";
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
// {
|
// {
|
||||||
@@ -36,56 +50,85 @@ const tableProps = [
|
|||||||
// filter: parseTime
|
// filter: parseTime
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
prop: 'lineName',
|
prop: '',
|
||||||
label: '产线'
|
label: '切割堆垛日报',
|
||||||
},
|
children:[
|
||||||
{
|
{
|
||||||
prop: 'equipmentName',
|
prop: 'lineName',
|
||||||
label: ''
|
label: '产线'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'num',
|
prop: 'className',
|
||||||
label: '片数'
|
label: '班组'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'area',
|
prop: 'groupName',
|
||||||
label: '面积'
|
label: '班次'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'countNum',
|
prop: 'size',
|
||||||
label: '托数',
|
label: '规格 mm 长*宽'
|
||||||
// filter: (val) => val == false ? '不合格' : '合格',
|
},
|
||||||
},
|
{
|
||||||
{
|
prop: 'thickness',
|
||||||
prop: 'size',
|
label: '厚度mm'
|
||||||
label: '规格',
|
},
|
||||||
// filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
|
{
|
||||||
},
|
prop: 'glassCode',
|
||||||
// {
|
label: '周转编号',
|
||||||
// prop: 'checkerName',
|
},
|
||||||
// label: '检测人员'
|
{
|
||||||
// },
|
prop: 'stackingType',
|
||||||
// {
|
label: '堆垛方式',
|
||||||
// prop: 'checkTime',
|
// filter: (val) =>
|
||||||
// label: '检测时间',
|
// val != null ? ['集装架', '堵头箱'][val] : '',
|
||||||
// filter: parseTime
|
// filter: ((val) => { val == 1 ? '集装架' : '堵头箱' }),
|
||||||
// },
|
},
|
||||||
|
{
|
||||||
|
prop: 'pieces',
|
||||||
|
label: '片数',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'originCode',
|
||||||
|
label: '堆垛工位',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'endTime',
|
||||||
|
label: '堆垛时间',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'dusting',
|
||||||
|
label: '喷粉情况',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'palletNumber',
|
||||||
|
label: '集装架号',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
prop: 'remark',
|
||||||
|
label: '备注',
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
];
|
];
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
mixins: [ tableHeightMixin],
|
mixins: [tableHeightMixin],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
urlOptions: {
|
urlOptions: {
|
||||||
getDataListURL: getOriginalData,
|
getDataListURL: getCuttingReportDataList,
|
||||||
// deleteURL: deleteQualityHotMaterial,
|
// deleteURL: deleteQualityHotMaterial,
|
||||||
// exportURL: exportFactoryExcel,
|
// exportURL: exportFactoryExcel,
|
||||||
},
|
},
|
||||||
tableProps,
|
tableProps,
|
||||||
tableData: [],
|
tableData: [],
|
||||||
|
mergeArr: [],//记录合并行数
|
||||||
|
pos: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime:undefined
|
endTime: undefined,
|
||||||
|
lineId: null,
|
||||||
},
|
},
|
||||||
formConfig: [
|
formConfig: [
|
||||||
// {
|
// {
|
||||||
@@ -108,16 +151,25 @@ export default {
|
|||||||
label: '时间段',
|
label: '时间段',
|
||||||
dateType: 'daterange',
|
dateType: 'daterange',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
// valueFormat: "yyyy-MM-dd HH:mm:ss",
|
valueFormat: "timestamp",
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
param: 'checkTime',
|
param: 'checkTime',
|
||||||
defaultSelect: [],
|
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||||
width: 250
|
width: 350
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '',
|
type: 'select',
|
||||||
|
label: '产线',
|
||||||
|
selectOptions: [],
|
||||||
|
labelField: 'name',
|
||||||
|
valueField: 'id',
|
||||||
|
param: 'lineId',
|
||||||
|
filterable: true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
btnName: '查询',
|
btnName: '查询',
|
||||||
name: 'search',
|
name: 'search',
|
||||||
color: 'primary',
|
color: 'primary',
|
||||||
@@ -127,7 +179,7 @@ export default {
|
|||||||
// // type: 'separate',
|
// // type: 'separate',
|
||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',
|
type: 'button',
|
||||||
btnName: '导出',
|
btnName: '导出',
|
||||||
name: 'export',
|
name: 'export',
|
||||||
color: 'success',
|
color: 'success',
|
||||||
@@ -141,12 +193,79 @@ export default {
|
|||||||
},
|
},
|
||||||
created() { },
|
created() { },
|
||||||
mounted() {
|
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.getDataList()
|
||||||
|
this.getDict()
|
||||||
|
// this.getSpanArr(this.tableData)
|
||||||
// this.getDict();
|
// this.getDict();
|
||||||
},
|
},
|
||||||
methods: {
|
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() {
|
handleExport() {
|
||||||
// 处理查询参数
|
// 处理查询参数
|
||||||
|
console.log(this.$refs);
|
||||||
var xlsxParam = { raw: true };
|
var xlsxParam = { raw: true };
|
||||||
/* 从表生成工作簿对象 */
|
/* 从表生成工作簿对象 */
|
||||||
import('xlsx').then(excel => {
|
import('xlsx').then(excel => {
|
||||||
@@ -190,10 +309,55 @@ export default {
|
|||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.listQuery.startTime = '1711095616000';
|
// this.listQuery.startTime = '1711095616000';
|
||||||
this.listQuery.endTime = '1711183743000';
|
// this.listQuery.endTime = '1711183743000';
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
this.tableData = response.data
|
// 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.map((ele) => {
|
||||||
|
return {
|
||||||
|
lineName: ele.lineName,
|
||||||
|
className: ele.className,
|
||||||
|
groupName: ele.groupName,
|
||||||
|
size: ele.size,
|
||||||
|
thickness: ele.thickness,
|
||||||
|
glassCode: ele.glassCode,
|
||||||
|
stackingType: ele.stackingType == 1 ? '集装架' : '堵头箱',
|
||||||
|
pieces: ele.pieces,
|
||||||
|
originCode: ele.originCode,
|
||||||
|
endTime: parseTime(ele.endTime),
|
||||||
|
dusting: ele.dusting,
|
||||||
|
palletNumber: ele.palletNumber,
|
||||||
|
remark:ele.remark
|
||||||
|
}
|
||||||
|
})
|
||||||
|
// 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.listQuery.total = response.data.total;
|
||||||
this.dataListLoading = false;
|
this.dataListLoading = false;
|
||||||
});
|
});
|
||||||
@@ -233,6 +397,7 @@ export default {
|
|||||||
// this.listQuery.endTime = '1706230804000';
|
// this.listQuery.endTime = '1706230804000';
|
||||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||||
|
this.listQuery.lineId = val.lineId ? val.lineId : undefined
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
// case 'reset':
|
// case 'reset':
|
||||||
@@ -259,3 +424,13 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||||
|
background-color: #EAF1FC;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .baseTable .el-table .el-table__cell {
|
||||||
|
padding: 0;
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
721
src/views/report/qcReport/fullInspection/index.vue
Normal file
721
src/views/report/qcReport/fullInspection/index.vue
Normal file
@@ -0,0 +1,721 @@
|
|||||||
|
<!--
|
||||||
|
* @Author: zhp
|
||||||
|
* @Date: 2024-04-18 14:08:46
|
||||||
|
* @LastEditTime: 2024-04-24 14:41:01
|
||||||
|
* @LastEditors: zhp
|
||||||
|
* @Description:
|
||||||
|
-->
|
||||||
|
<template>
|
||||||
|
<div class="app-container">
|
||||||
|
<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'
|
||||||
|
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
|
||||||
|
:span-method="objectSpanMethod">
|
||||||
|
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
|
||||||
|
</el-table-column>
|
||||||
|
</el-table> -->
|
||||||
|
<!-- <el-table border style="margin-top: 50px;" :data="transData">
|
||||||
|
<el-table-column v-for="(item, index) in transTitle" :label="item" :key="index" align="center">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
{{scope.row[index]}}
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
|
</el-table> -->
|
||||||
|
|
||||||
|
<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 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.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">
|
||||||
|
<!-- {{ }} -->
|
||||||
|
</el-col>
|
||||||
|
<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" /> -->
|
||||||
|
<!-- <base-dialog
|
||||||
|
:dialogTitle="addOrEditTitle"
|
||||||
|
:dialogVisible="addOrUpdateVisible"
|
||||||
|
@cancel="handleCancel"
|
||||||
|
@confirm="handleConfirm"
|
||||||
|
:before-close="handleCancel"
|
||||||
|
width="30%"> -->
|
||||||
|
<!-- <add-or-update v-if="addOrUpdateVisible" ref="addOrUpdate" @refreshDataList="getDataList" /> -->
|
||||||
|
<!-- </base-dialog> -->
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
// import AddOrUpdate from './add-or-updata';
|
||||||
|
// import basicPage from '../../../core/mixins/basic-page';
|
||||||
|
// import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
|
import {
|
||||||
|
getQualityRecordReport,
|
||||||
|
getCWSectionList
|
||||||
|
} from '@/api/report/qcReport';
|
||||||
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
import FileSaver from 'file-saver'
|
||||||
|
// import { getList, } from "@/api/base/qualityScrapType";
|
||||||
|
const headers = [
|
||||||
|
// {
|
||||||
|
// prop: 'createTime',
|
||||||
|
// label: '添加时间',
|
||||||
|
// filter: parseTime
|
||||||
|
// },
|
||||||
|
{
|
||||||
|
prop: 'classType',
|
||||||
|
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
|
||||||
|
// },
|
||||||
|
];
|
||||||
|
|
||||||
|
export default {
|
||||||
|
mixins: [tableHeightMixin],
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
urlOptions: {
|
||||||
|
getDataListURL: getQualityRecordReport,
|
||||||
|
// deleteURL: deleteQualityHotMaterial,
|
||||||
|
// exportURL: exportFactoryExcel,
|
||||||
|
},
|
||||||
|
listQuery: {
|
||||||
|
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',
|
||||||
|
label: '时间段',
|
||||||
|
dateType: 'daterange',
|
||||||
|
format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
|
valueFormat: "timestamp",
|
||||||
|
rangeSeparator: '-',
|
||||||
|
startPlaceholder: '开始时间',
|
||||||
|
endPlaceholder: '结束时间',
|
||||||
|
param: 'checkTime',
|
||||||
|
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
||||||
|
width: 350
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '查询',
|
||||||
|
name: 'search',
|
||||||
|
color: 'primary',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
type: 'button',
|
||||||
|
btnName: '导出',
|
||||||
|
name: 'export',
|
||||||
|
color: 'primary',
|
||||||
|
plain: true
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
||||||
|
},
|
||||||
|
components: {
|
||||||
|
// AddOrUpdate,
|
||||||
|
},
|
||||||
|
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.listQuery.startTime = new Date(new Date().setHours(1, 9, 0, 0)).getTime()
|
||||||
|
this.getDataList()
|
||||||
|
this.getDict()
|
||||||
|
// this.getSpanArr(this.tableData)
|
||||||
|
// this.getDict();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
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
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
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) {
|
||||||
|
let str = this.listQuery.startTime
|
||||||
|
// console.log(str);
|
||||||
|
this.listQuery.startTime = new Date(new Date(str).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 {
|
||||||
|
let str = this.listQuery.startTime
|
||||||
|
// console.log(str);
|
||||||
|
this.listQuery.startTime = new Date(new Date(str).setHours(0, 7, 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() {
|
||||||
|
// 处理查询参数
|
||||||
|
console.log(this.$refs);
|
||||||
|
var xlsxParam = { raw: true };
|
||||||
|
/* 从表生成工作簿对象 */
|
||||||
|
import('xlsx').then(excel => {
|
||||||
|
var wb = excel.utils.table_to_book(
|
||||||
|
document.querySelector("#exportTable"),
|
||||||
|
xlsxParam
|
||||||
|
);
|
||||||
|
/* 获取二进制字符串作为输出 */
|
||||||
|
var wbout = excel.write(wb, {
|
||||||
|
bookType: "xlsx",
|
||||||
|
bookSST: true,
|
||||||
|
type: "array",
|
||||||
|
});
|
||||||
|
try {
|
||||||
|
FileSaver.saveAs(
|
||||||
|
//Blob 对象表示一个不可变、原始数据的类文件对象。
|
||||||
|
//Blob 表示的不一定是JavaScript原生格式的数据。
|
||||||
|
//File 接口基于Blob,继承了 blob 的功能并将其扩展使其支持用户系统上的文件。
|
||||||
|
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||||
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
|
//设置导出文件名称
|
||||||
|
"原片各线堆垛表.xlsx"
|
||||||
|
);
|
||||||
|
} catch (e) {
|
||||||
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
|
}
|
||||||
|
return wbout;
|
||||||
|
//do something......
|
||||||
|
})
|
||||||
|
|
||||||
|
},
|
||||||
|
// otherMethods(val) {
|
||||||
|
// if (val.type === 'detail') {
|
||||||
|
// this.addOrUpdateVisible = true;
|
||||||
|
// this.addOrEditTitle = "详情";
|
||||||
|
// this.$nextTick(() => {
|
||||||
|
// this.$refs.addOrUpdate.init(val.data.id, true);
|
||||||
|
// });
|
||||||
|
// }
|
||||||
|
// },
|
||||||
|
// 获取数据列表
|
||||||
|
getDataList() {
|
||||||
|
if (this.radio === '晚班查询') {
|
||||||
|
let str = this.listQuery.startTime
|
||||||
|
// console.log(str);
|
||||||
|
this.listQuery.startTime = new Date(new Date(str).setHours(1, 9, 0, 0)).getTime()
|
||||||
|
} else {
|
||||||
|
let str = this.listQuery.startTime
|
||||||
|
// console.log(str);
|
||||||
|
this.listQuery.startTime = new Date(new Date(str).setHours(0, 7, 0, 0)).getTime()
|
||||||
|
}
|
||||||
|
this.dataListLoading = true;
|
||||||
|
// this.listQuery.startTime = '1713197388000';
|
||||||
|
// this.listQuery.endTime = '1713254961000';
|
||||||
|
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 = [
|
||||||
|
// {
|
||||||
|
// 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,
|
||||||
|
// 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,
|
||||||
|
// putType: '投入次数'
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// classType: 2,
|
||||||
|
// className: '夜班(20:00-8: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,
|
||||||
|
// putType: '投入数量',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// classType: 2,
|
||||||
|
// className: '夜班(20:00-8: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,
|
||||||
|
// putType: '投入次数',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// classType: 1,
|
||||||
|
// 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,
|
||||||
|
// putType: '投入数量',
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// classType: 2,
|
||||||
|
// 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,
|
||||||
|
// putType: '投入次数',
|
||||||
|
// }
|
||||||
|
// ]
|
||||||
|
// res.data.forEach((ele) => {
|
||||||
|
// 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
|
||||||
|
// } 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
|
||||||
|
// }
|
||||||
|
// })
|
||||||
|
// })
|
||||||
|
// // console.log(arr)
|
||||||
|
// this.tableData = arr
|
||||||
|
// this.dataListLoading = false;
|
||||||
|
});
|
||||||
|
},
|
||||||
|
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.getDataList();
|
||||||
|
break;
|
||||||
|
case 'export':
|
||||||
|
this.handleExport();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
console.log(val);
|
||||||
|
}
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
||||||
|
<style scoped>
|
||||||
|
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||||
|
background-color: #EAF1FC;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep .baseTable .el-table .el-table__cell {
|
||||||
|
padding: 0;
|
||||||
|
height: 35px;
|
||||||
|
}
|
||||||
|
::v-deep.el-table thead.is-group th {
|
||||||
|
background: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type {
|
||||||
|
border-bottom: none;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-table thead.is-group tr:first-of-type th:first-of-type:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 75px;
|
||||||
|
/*这里需要自己调整,根据td的宽度和高度*/
|
||||||
|
top: 0;
|
||||||
|
left: 0;
|
||||||
|
background-color: grey;
|
||||||
|
opacity: 0.3;
|
||||||
|
display: block;
|
||||||
|
transform: rotate(-53deg);
|
||||||
|
/*这里需要自己调整,根据线的位置*/
|
||||||
|
transform-origin: top;
|
||||||
|
}
|
||||||
|
|
||||||
|
::v-deep.el-table thead.is-group tr:last-of-type th:first-of-type:before {
|
||||||
|
content: '';
|
||||||
|
position: absolute;
|
||||||
|
width: 1px;
|
||||||
|
height: 75px;
|
||||||
|
/*这里需要自己调整,根据td的宽度和高度*/
|
||||||
|
bottom: 0;
|
||||||
|
right: 0;
|
||||||
|
background-color: grey;
|
||||||
|
opacity: 0.3;
|
||||||
|
display: block;
|
||||||
|
transform: rotate(-54deg);
|
||||||
|
/*这里需要自己调整,根据线的位置*/
|
||||||
|
transform-origin: bottom;
|
||||||
|
}
|
||||||
|
|
||||||
|
</style>
|
||||||
345
src/views/report/qcReport/israLineReport/index.vue
Normal file
345
src/views/report/qcReport/israLineReport/index.vue
Normal file
@@ -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
|
* @Author: zhp
|
||||||
* @Date: 2024-04-18 10:01:33
|
* @Date: 2024-04-18 10:01:33
|
||||||
* @LastEditTime: 2024-04-18 16:26:48
|
* @LastEditTime: 2024-04-24 09:56:20
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
@@ -11,9 +11,10 @@
|
|||||||
<el-table :header-cell-style="{
|
<el-table :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
|
}" class="baseTable" border :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
|
||||||
:span-method="objectSpanMethod">
|
:span-method="objectSpanMethod">
|
||||||
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
|
<el-table-column :width="item.width" v-for="item in tableProps" :prop="item.prop" :label="item.label"
|
||||||
|
align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
@@ -35,9 +36,11 @@
|
|||||||
// import basicPage from '../../../core/mixins/basic-page';
|
// import basicPage from '../../../core/mixins/basic-page';
|
||||||
// import { parseTime } from '../../../core/mixins/code-filter';
|
// import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getOriginalData
|
getOriginalData,
|
||||||
|
getOriginalLineDataList
|
||||||
} from '@/api/report/qcReport';
|
} from '@/api/report/qcReport';
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
|
import { width } from '@antv/x6-common/lib/dom/position';
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
// import { getList, } from "@/api/base/qualityScrapType";
|
// import { getList, } from "@/api/base/qualityScrapType";
|
||||||
const tableProps = [
|
const tableProps = [
|
||||||
@@ -48,11 +51,13 @@ const tableProps = [
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
prop: 'lineName',
|
prop: 'lineName',
|
||||||
label: '产线'
|
label: '产线',
|
||||||
|
width:'100'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'equipmentName',
|
prop: 'equipmentName',
|
||||||
label: ''
|
label: '',
|
||||||
|
width: '200'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'num',
|
prop: 'num',
|
||||||
@@ -98,7 +103,8 @@ export default {
|
|||||||
pos: 0,
|
pos: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime:undefined
|
endTime: undefined,
|
||||||
|
lineId:null,
|
||||||
},
|
},
|
||||||
formConfig: [
|
formConfig: [
|
||||||
// {
|
// {
|
||||||
@@ -120,14 +126,23 @@ export default {
|
|||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间段',
|
label: '时间段',
|
||||||
dateType: 'daterange',
|
dateType: 'daterange',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: "timestamp",
|
valueFormat: "timestamp",
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
param: 'checkTime',
|
param: 'checkTime',
|
||||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
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',
|
type:'button',
|
||||||
@@ -143,7 +158,7 @@ export default {
|
|||||||
type:'button',
|
type:'button',
|
||||||
btnName: '导出',
|
btnName: '导出',
|
||||||
name: 'export',
|
name: 'export',
|
||||||
color: 'success',
|
color: 'primary',
|
||||||
plain: true
|
plain: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -159,39 +174,45 @@ export default {
|
|||||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
|
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
|
this.getDict()
|
||||||
// this.getSpanArr(this.tableData)
|
// this.getSpanArr(this.tableData)
|
||||||
// this.getDict();
|
// this.getDict();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSummaries(param) {
|
async getDict() {
|
||||||
console.log(columns)
|
const res = await getOriginalLineDataList()
|
||||||
|
console.log(res)
|
||||||
const { columns, data } = param;
|
this.formConfig[1].selectOptions = res.data
|
||||||
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;
|
|
||||||
},
|
},
|
||||||
|
// 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 }) {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
let spanOneArr = [], concatOne = 0;
|
let spanOneArr = [], concatOne = 0;
|
||||||
this.tableData.map((item, index) => {
|
this.tableData.map((item, index) => {
|
||||||
@@ -264,8 +285,8 @@ export default {
|
|||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.listQuery.startTime = '1711095616000';
|
// this.listQuery.startTime = '1711095616000';
|
||||||
this.listQuery.endTime = '1711183743000';
|
// this.listQuery.endTime = '1711183743000';
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
// this.getSpanArr(this.tableData)
|
// this.getSpanArr(this.tableData)
|
||||||
// response.data.forEach((ele) => {
|
// response.data.forEach((ele) => {
|
||||||
@@ -346,6 +367,7 @@ export default {
|
|||||||
// this.listQuery.endTime = '1706230804000';
|
// this.listQuery.endTime = '1706230804000';
|
||||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||||
|
this.listQuery.lineId = val.lineId ? val.lineId : undefined
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
// case 'reset':
|
// case 'reset':
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
<!--
|
<!--
|
||||||
* @Author: zhp
|
* @Author: zhp
|
||||||
* @Date: 2024-04-18 15:07:53
|
* @Date: 2024-04-18 15:07:53
|
||||||
* @LastEditTime: 2024-04-18 15:26:50
|
* @LastEditTime: 2024-04-24 09:58:07
|
||||||
* @LastEditors: zhp
|
* @LastEditors: zhp
|
||||||
* @Description:
|
* @Description:
|
||||||
-->
|
-->
|
||||||
<template>
|
<template>
|
||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
|
||||||
<el-table show-summary :header-cell-style="{
|
<el-table :header-cell-style="{
|
||||||
background: '#F2F4F9',
|
background: '#F2F4F9',
|
||||||
color: '#606266'
|
color: '#606266'
|
||||||
}" class="baseTable" :max-height="tableH" id="exportTable" :data="tableData" style="width: 100%"
|
}" class="baseTable" border id="exportTable" :data="tableData" style="width: 100%" :span-method="objectSpanMethod">
|
||||||
:span-method="objectSpanMethod">
|
<el-table-column :width="item.width" v-for="item in tableProps" :prop="item.prop" :label="item.label"
|
||||||
<el-table-column v-for="item in tableProps" :prop="item.prop" :label="item.label" align="center">
|
align="center">
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
</el-table>
|
</el-table>
|
||||||
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
<!-- <pagination :limit.sync="listQuery.pageSize" :page.sync="listQuery.pageNo" :total="listQuery.total"
|
||||||
@@ -35,7 +35,8 @@
|
|||||||
// import basicPage from '../../../core/mixins/basic-page';
|
// import basicPage from '../../../core/mixins/basic-page';
|
||||||
// import { parseTime } from '../../../core/mixins/code-filter';
|
// import { parseTime } from '../../../core/mixins/code-filter';
|
||||||
import {
|
import {
|
||||||
getCuttingtData
|
getCuttingtData,
|
||||||
|
getOriginalLineDataList
|
||||||
} from '@/api/report/qcReport';
|
} from '@/api/report/qcReport';
|
||||||
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
|
||||||
import FileSaver from 'file-saver'
|
import FileSaver from 'file-saver'
|
||||||
@@ -48,11 +49,13 @@ const tableProps = [
|
|||||||
// },
|
// },
|
||||||
{
|
{
|
||||||
prop: 'lineName',
|
prop: 'lineName',
|
||||||
label: '产线'
|
label: '产线',
|
||||||
|
width:'150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'dataType',
|
prop: 'dataType',
|
||||||
label: ''
|
label: '',
|
||||||
|
width: '150',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'type',
|
prop: 'type',
|
||||||
@@ -68,7 +71,7 @@ const tableProps = [
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
prop: 'rate',
|
prop: 'rate',
|
||||||
label: '占比',
|
label: '占比%',
|
||||||
// filter: (val) => val == false ? '不合格' : '合格',
|
// filter: (val) => val == false ? '不合格' : '合格',
|
||||||
},
|
},
|
||||||
// {
|
// {
|
||||||
@@ -97,7 +100,8 @@ export default {
|
|||||||
pos: 0,
|
pos: 0,
|
||||||
listQuery: {
|
listQuery: {
|
||||||
startTime: undefined,
|
startTime: undefined,
|
||||||
endTime:undefined
|
endTime: undefined,
|
||||||
|
lineId:undefined
|
||||||
},
|
},
|
||||||
formConfig: [
|
formConfig: [
|
||||||
// {
|
// {
|
||||||
@@ -119,14 +123,23 @@ export default {
|
|||||||
type: 'datePicker',
|
type: 'datePicker',
|
||||||
label: '时间段',
|
label: '时间段',
|
||||||
dateType: 'daterange',
|
dateType: 'daterange',
|
||||||
format: 'yyyy-MM-dd HH:mm:ss',
|
// format: 'yyyy-MM-dd HH:mm:ss',
|
||||||
valueFormat: "timestamp",
|
valueFormat: "timestamp",
|
||||||
rangeSeparator: '-',
|
rangeSeparator: '-',
|
||||||
startPlaceholder: '开始时间',
|
startPlaceholder: '开始时间',
|
||||||
endPlaceholder: '结束时间',
|
endPlaceholder: '结束时间',
|
||||||
param: 'checkTime',
|
param: 'checkTime',
|
||||||
defaultSelect: [Date.now() - 24 * 60 * 60 - 1000, Date.now()],
|
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',
|
type:'button',
|
||||||
@@ -142,7 +155,7 @@ export default {
|
|||||||
type:'button',
|
type:'button',
|
||||||
btnName: '导出',
|
btnName: '导出',
|
||||||
name: 'export',
|
name: 'export',
|
||||||
color: 'success',
|
color: 'primary',
|
||||||
plain: true
|
plain: true
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@@ -158,37 +171,15 @@ export default {
|
|||||||
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
this.listQuery.endTime = this.formConfig[0].defaultSelect[1]
|
||||||
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
|
// this.formConfig[0].defaultSelect[0] = Date.now()-24*60*60-1000
|
||||||
this.getDataList()
|
this.getDataList()
|
||||||
|
this.getDict()
|
||||||
// this.getSpanArr(this.tableData)
|
// this.getSpanArr(this.tableData)
|
||||||
// this.getDict();
|
// this.getDict();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getSummaries(param) {
|
async getDict() {
|
||||||
console.log(columns)
|
const res = await getOriginalLineDataList()
|
||||||
|
console.log(res)
|
||||||
const { columns, data } = param;
|
this.formConfig[1].selectOptions = res.data
|
||||||
const sums = [];
|
|
||||||
columns.forEach((column, index) => {
|
|
||||||
if (index === 0) {
|
|
||||||
sums[index] = '合计';
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
const values = 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 }) {
|
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
|
||||||
let spanOneArr = [], concatOne = 0;
|
let spanOneArr = [], concatOne = 0;
|
||||||
@@ -259,7 +250,7 @@ export default {
|
|||||||
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
//返回一个新创建的 Blob 对象,其内容由参数中给定的数组串联组成。
|
||||||
new Blob([wbout], { type: "application/octet-stream" }),
|
new Blob([wbout], { type: "application/octet-stream" }),
|
||||||
//设置导出文件名称
|
//设置导出文件名称
|
||||||
"原片各线堆垛表.xlsx"
|
"原片各线优化切割堆垛表.xlsx"
|
||||||
);
|
);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (typeof console !== "undefined") console.log(e, wbout);
|
if (typeof console !== "undefined") console.log(e, wbout);
|
||||||
@@ -281,8 +272,8 @@ export default {
|
|||||||
// 获取数据列表
|
// 获取数据列表
|
||||||
getDataList() {
|
getDataList() {
|
||||||
this.dataListLoading = true;
|
this.dataListLoading = true;
|
||||||
this.listQuery.startTime = '1706144404000';
|
// this.listQuery.startTime = '1706144404000';
|
||||||
this.listQuery.endTime = '1706230804000';
|
// this.listQuery.endTime = '1706230804000';
|
||||||
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
this.urlOptions.getDataListURL(this.listQuery).then(response => {
|
||||||
// this.getSpanArr(this.tableData)
|
// this.getSpanArr(this.tableData)
|
||||||
// response.data.forEach((ele) => {
|
// response.data.forEach((ele) => {
|
||||||
@@ -302,7 +293,7 @@ export default {
|
|||||||
type: ele.type,
|
type: ele.type,
|
||||||
pieces: ele.pieces,
|
pieces: ele.pieces,
|
||||||
area: ele.area,
|
area: ele.area,
|
||||||
rate: ele.rate
|
rate: (ele.rate * 100).toFixed(2)
|
||||||
// useNum: ele.useNum,
|
// useNum: ele.useNum,
|
||||||
// num: ele.num,
|
// num: ele.num,
|
||||||
// size: typeof (ele.size)
|
// size: typeof (ele.size)
|
||||||
@@ -368,6 +359,7 @@ export default {
|
|||||||
// this.listQuery.endTime = '1706230804000';
|
// this.listQuery.endTime = '1706230804000';
|
||||||
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
this.listQuery.startTime = val.checkTime ? val.checkTime[0] : undefined;
|
||||||
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
this.listQuery.endTime = val.checkTime ? val.checkTime[1] : undefined;
|
||||||
|
this.listQuery.lineId = val.lineId ? val.lineId : undefined
|
||||||
this.getDataList();
|
this.getDataList();
|
||||||
break;
|
break;
|
||||||
// case 'reset':
|
// case 'reset':
|
||||||
@@ -394,13 +386,14 @@ export default {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
<style>
|
<style scoped>
|
||||||
.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
::v-deep.baseTable .el-table__body tr.current-row>td.el-table__cell {
|
||||||
background-color: #EAF1FC;
|
background-color: #EAF1FC;
|
||||||
}
|
}
|
||||||
|
|
||||||
.baseTable .el-table .el-table__cell {
|
::v-deep .baseTable .el-table .el-table__cell {
|
||||||
padding: 0;
|
padding: 0;
|
||||||
height: 35px;
|
height: 35px;
|
||||||
}
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -111,7 +111,10 @@ const mesEN = new WsConnect(
|
|||||||
if (msgData == null) return;
|
if (msgData == null) return;
|
||||||
switch (msgData?.type) {
|
switch (msgData?.type) {
|
||||||
case "EnergyInfo": {
|
case "EnergyInfo": {
|
||||||
store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
|
let keys = Object.keys(msgData.data)
|
||||||
|
if (keys.includes('elecQty1') || keys.includes('waterQty')) {
|
||||||
|
store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case "EnergyTrend": {
|
case "EnergyTrend": {
|
||||||
|
|||||||
Reference in New Issue
Block a user