Compare commits

...

47 Commits

Author SHA1 Message Date
helloDy
16186667da merge 2024-04-22 15:20:56 +08:00
helloDy
c7cd6e7b1e 部门换接口 2024-04-22 15:19:35 +08:00
d0eb1d84c8 Merge pull request 'projects/mesxc-zhp' (#344) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #344
2024-04-19 17:02:23 +08:00
‘937886381’
445d8f4818 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-19 17:01:17 +08:00
‘937886381’
46ce982cfc 新增报表 2024-04-19 16:59:47 +08:00
391e06a382 Merge pull request 'projects/mesxc-zjl' (#342) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #342
2024-04-19 11:11:19 +08:00
72e1b4e8f9 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-19 11:10:38 +08:00
b41ba04cb4 Merge pull request 'projects/mesxc-zhp' (#341) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #341
2024-04-19 11:09:12 +08:00
‘937886381’
4482ce0433 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-19 11:07:43 +08:00
‘937886381’
ecf6745c8a 报表新增 2024-04-19 11:07:14 +08:00
c9128ce946 包装40% 2024-04-19 11:03:50 +08:00
ba08175de8 Merge pull request 'projects/mesxc-zhp' (#340) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #340
2024-04-17 16:36:22 +08:00
‘937886381’
22f8322baf Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-17 16:16:37 +08:00
‘937886381’
6f8abc9758 修改ui 2024-04-17 16:15:59 +08:00
59d53b60c7 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-17 13:23:20 +08:00
d448280782 test 2024-04-16 15:29:39 +08:00
0337b54202 Merge pull request 'projects/mesxc-zhp' (#339) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #339
2024-04-16 14:07:17 +08:00
‘937886381’
9dec81e0b2 修改ui 2024-04-16 14:04:43 +08:00
‘937886381’
64de2c50b6 修改bug 2024-04-16 13:52:38 +08:00
‘937886381’
bd0f9e24fd Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-16 13:46:08 +08:00
‘937886381’
f3043ee11f 修改ui 2024-04-16 13:45:38 +08:00
5584a47575 Merge pull request 'projects/mesxc-zjl' (#337) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #337
2024-04-15 14:59:29 +08:00
b0078cb099 1 2024-04-15 14:49:28 +08:00
e5acd497b5 Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-15 09:35:46 +08:00
6b452dce36 能源bug 2024-04-15 09:35:00 +08:00
aacf87f6d3 Merge pull request 'projects/mesxc-zhp' (#336) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #336
2024-04-15 09:31:35 +08:00
‘937886381’
bfa17e422d Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-15 09:29:29 +08:00
‘937886381’
e25f872589 修改ui 2024-04-15 09:28:49 +08:00
83b834d2fc Merge pull request 'projects/mesxc-zjl' (#335) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #335
2024-04-12 17:02:46 +08:00
1b2c16fcdb Merge branch 'projects/mesxc-test' into projects/mesxc-zjl 2024-04-12 17:01:59 +08:00
475ec35ec5 1 2024-04-12 16:59:34 +08:00
1328da9616 Merge pull request 'projects/mesxc-lb' (#334) from projects/mesxc-lb into projects/mesxc-test
Reviewed-on: #334
2024-04-12 16:50:11 +08:00
lb
92b9ec7da7 Merge branch 'projects/mesxc-test' into projects/mesxc-lb 2024-04-12 16:46:20 +08:00
c1af47db81 Merge pull request 'projects/mesxc-zhp' (#333) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #333
2024-04-12 16:44:38 +08:00
lb
15afbcd612 bugfix 特殊设备权限 2024-04-12 16:40:15 +08:00
‘937886381’
dabbc6b63a 修改bug 2024-04-12 15:27:01 +08:00
‘937886381’
cfab3353d3 Merge branch 'projects/mesxc-test' into projects/mesxc-zhp 2024-04-12 15:18:43 +08:00
‘937886381’
2298fc56b6 修改bug 2024-04-12 15:17:21 +08:00
bb77d0f8c6 Merge pull request 'projects/mesxc-zhp' (#332) from projects/mesxc-zhp into projects/mesxc-test
Reviewed-on: #332
2024-04-12 14:58:10 +08:00
‘937886381’
e8938a62eb 解决冲突 2024-04-12 14:31:56 +08:00
‘937886381’
2a599d96b3 修改bug 2024-04-12 14:30:11 +08:00
‘937886381’
6050eb4df5 修改bug 2024-04-12 14:27:51 +08:00
lb
02c3b3db0d Merge branch 'projects/mesxc-test' into projects/mesxc-lb 2024-04-12 13:53:50 +08:00
3308fcbef9 Merge pull request 'projects/mesxc-zjl' (#331) from projects/mesxc-zjl into projects/mesxc-test
Reviewed-on: #331
2024-04-12 11:21:05 +08:00
cb7135bad5 merge test 2024-04-12 11:16:15 +08:00
4a56f92961 Merge pull request 'projects/mesxc-dy' (#330) from projects/mesxc-dy into projects/mesxc-test
Reviewed-on: #330
2024-04-12 11:10:01 +08:00
862fe20760 能源bug 2024-04-12 08:56:32 +08:00
77 changed files with 6312 additions and 1618 deletions

View File

@ -1,8 +1,9 @@
###
# @Author: Do not edit
# @Date: 2023-08-29 09:40:39
# @LastEditTime: 2024-04-11 17:04:05
# @Author: zhp
# @Date: 2024-04-12 14:30:48
# @LastEditTime: 2024-04-22 15:20:42
# @LastEditors: DY
# @Description:
###
# 开发环境配置
@ -12,27 +13,18 @@ ENV = 'development'
VUE_APP_TITLE = MES系统
# 芋道管理系统/开发环境
# VUE_APP_BASE_API = 'http://100.64.0.26:48082'
# VUE_APP_BASE_API = 'http://10.70.2.2:8080'
# VUE_APP_BASE_API = 'http://192.168.1.20:48080'
# VUE_APP_BASE_API = 'http://192.168.2.173:48080'
# VUE_APP_BASE_API = 'http://192.168.1.49:48082'
# VUE_APP_BASE_API = 'http://192.168.1.8:48082'
# VUE_APP_BASE_API = 'http://192.168.4.173:9001'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
VUE_APP_BASE_API = 'http://192.168.0.33:48082'
# VUE_APP_BASE_API = 'http://192.168.1.62:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# VUE_APP_BASE_API = 'http://192.168.1.47:48082'
# VUE_APP_BASE_API = 'http://192.168.1.78:48082'
# socket地址
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
VUE_APP_Socket_Dcs_API = 'ws://192.168.0.33:8080'
# VUE_APP_BASE_API = 'http://192.168.1.104:48082'
# 积木报表指向地址
VUE_APP_JIMU_API = 'http://10.70.2.22:8080'
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
# socket地址(现场)
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# socket地址(公司线上)
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
# socket dcs地址(只有现场)
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# 路由懒加载
VUE_CLI_BABEL_TRANSPILE_MODULES = true

View File

@ -1,11 +1,4 @@
###
# @Author: zhp
# @Date: 2023-11-07 19:11:40
# @LastEditTime: 2023-11-16 16:40:59
# @LastEditors: zhp
# @Description:
###
# 生产环境配置
# 生产环境配置(许昌现场)
ENV = 'production'
# 页面标题

View File

@ -1,4 +1,4 @@
# 生产环境配置
# 公司线上环境33服务器
ENV = 'production'
# 页面标题
@ -7,15 +7,12 @@ VUE_APP_TITLE = MES系统
# 芋道管理系统/生产环境
VUE_APP_BASE_API = '/prod-api'
# dcs地址
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# socket地址
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# 积木报表指向地址
VUE_APP_JIMU_API = 'http://192.168.0.33:48082'
# socket地址
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
# dcs地址只有现场的
VUE_APP_Socket_Dcs_API = 'ws://10.70.180.10:8081'
# 根据服务器或域名修改

View File

@ -1,7 +1,7 @@
/*
* @Author: Do not edit
* @Date: 2023-10-21 11:50:46
* @LastEditTime: 2023-10-30 14:37:28
* @LastEditTime: 2024-04-19 17:13:24
* @LastEditors: DY
* @Description:
*/
@ -65,4 +65,13 @@ export function getCoreDepartmentList(query) {
method: 'get',
params: query
})
}
}
// 设备获得所有列表
export function getDepartmentList(query) {
return request({
url: '/system/dept/list-all-simple',
method: 'get',
params: query
})
}

View File

@ -0,0 +1,48 @@
/*
* @Author: zhp
* @Date: 2024-04-18 09:27:54
* @LastEditTime: 2024-04-19 16:12:49
* @LastEditors: zhp
* @Description:
*/
import request from '@/utils/request'
// 更新质量检测类型基础
export function getOriginalData(data) {
return request({
url: 'extend/customized-reports/original',
method: 'post',
data: data
})
}
export function getIngredientData(data) {
return request({
url: 'extend/customized-reports/materialCost',
method: 'post',
data: data
})
}
export function getCuttingtData(data) {
return request({
url: 'extend/customized-reports/cutting',
method: 'post',
data: data
})
}
export function getAutoDailyData(data) {
return request({
url: 'base/report-auto-daily/listAll',
method: 'post',
data: data
})
}
export function getQualityRecordReport(data) {
return request({
url: 'base/quality-inspection-record/qualityRecordReport',
method: 'get',
data: data
})
}

View File

@ -0,0 +1,138 @@
<!--
filename: index.vue
author: liubin
date: 2024-04-02 09:49:36
description:
-->
<template>
<!-- 按钮切换 -->
<div
v-if="buttonMode"
class="button-nav">
<button
v-for="m in menus"
:key="m"
@click="currentMenu = m"
:data-text="m"
:class="[m === currentMenu ? 'active' : '']"></button>
</div>
<!-- 标签切换 -->
<div
v-else
class="custom-tabs"
style="height: 100%; width: 100%">
<el-tabs
class="tag-nav"
v-model="currentMenu"
style="height: 100%">
<el-tab-pane
v-for="(m, idx) in menus"
:key="m"
:label="idx == 0 ? `\u2002${m}\u2002` : `\u3000${m}\u3000`"
:name="m">
<slot :name="`tab${idx + 1}`"></slot>
</el-tab-pane>
</el-tabs>
</div>
</template>
<script>
export default {
name: 'ButtonNav',
props: {
menus: {
type: Array,
required: true,
default: () => [],
validator: (val) => {
return val.length > 0;
},
},
buttonMode: {
type: Boolean,
default: true,
},
},
data() {
return {
currentMenu: '',
};
},
created() {
this.currentMenu = this.menus[0];
},
watch: {
currentMenu(val) {
this.$emit('change', val);
},
},
};
</script>
<style scoped lang="scss">
.button-nav {
width: 100%;
// padding: 12px 0;
display: flex;
gap: 12px;
* {
user-select: none;
}
button {
cursor: pointer;
appearance: none;
outline: none;
border: none;
background: #fff;
border-radius: 8px;
padding: 20px;
color: #888;
letter-spacing: 2px;
flex: 1;
box-sizing: padding-box;
position: relative;
&::after {
content: attr(data-text);
position: absolute;
top: 10px;
left: 50%;
font-size: 18px;
font-weight: 500;
transform: translate(-50%);
}
&.active {
color: #111;
border-bottom: 4px solid #0b58ff;
}
}
}
</style>
<style scoped>
.custom-tabs >>> .el-tabs__header {
margin-bottom: 8px;
display: inline-block;
/* transform: translateY(-12px); */
}
.custom-tabs >>> .el-tabs__item {
padding-left: 0px !important;
padding-right: 0px !important;
line-height: 36px !important;
height: 36px;
}
.custom-tabs >>> .el-tabs__content {
height: calc(100% - 42px);
}
.custom-tabs >>> .el-tab-pane {
box-sizing: border-box;
height: 100%;
padding: 20px;
border: 10px solid #f002;
}
</style>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-29 16:50:26
* @LastEditTime: 2024-04-11 09:55:04
* @LastEditTime: 2024-04-19 16:06:21
* @LastEditors: zhp
* @Description:
-->
@ -625,8 +625,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.NumFormat(item.productArea) + '㎡' || ''}</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:rgba(255, 209, 96, 1)' : '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>`
])
this.cutConfig.data = cutArr
// this.$nextTick(() => {
@ -635,32 +635,34 @@ export default {
// this.cutConfig.data = cutArr
// this.$refs['cutScrollBoard'].updateRows(cutArr)
} else if (this.cutWsData.type === 'cutting' && this.cutWsData.name === 'chart' && this.cutWsData.dateType === 'day') {
let nameList = []
let nameWasteList = []
let topNameList = []
let productList = []
let wasteList = []
let sumAreaList = []
let yieldList = []
this.coldDetData = this.cutWsData.coldDetData
// this.cutTableDataList =
this.cutWsData.coldDetData.forEach((ele, index) => {
nameList.push(ele.lineName)
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
productList.push(ele.productArea)
wasteList.push(ele.wastArea)
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
sumAreaList.push(ele.sumArea)
yieldList.push(parseFloat((ele.yield * 100).toFixed(0)))
})
this.$nextTick(() => {
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
this.$refs.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]])
this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]])
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
})
if (this.cutWsData.coldDetData.length !== 0) {
let nameList = []
let nameWasteList = []
let topNameList = []
let productList = []
let wasteList = []
let sumAreaList = []
let yieldList = []
this.coldDetData = this.cutWsData.coldDetData
// this.cutTableDataList =
this.cutWsData.coldDetData.forEach((ele, index) => {
nameList.push(ele.lineName)
topNameList.push('产线: ' + ele.lineName + ' ' + '总面积:' + ele.sumArea + '㎡')
productList.push(ele.productArea)
wasteList.push(ele.wastArea)
nameWasteList.push('缺陷面积:' + this.NumFormat(ele.wastArea) + '㎡')
sumAreaList.push(ele.sumArea)
yieldList.push(parseFloat((ele.yield * 100).toFixed(0)))
})
this.$nextTick(() => {
this.$refs.firstPileChart.initChart(nameList, [topNameList[0]], [nameWasteList[0]], [productList[0]], [wasteList[0]])
this.$refs.secondPileChart.initChart(nameList, [topNameList[1]], [nameWasteList[1]], [productList[1]], [wasteList[1]])
this.$refs.thirdPileChart.initChart(nameList, [topNameList[2]], [nameWasteList[2]], [productList[2]], [wasteList[2]])
this.$refs.fourthPileChart.initChart(nameList, [topNameList[3]], [nameWasteList[3]], [productList[3]], [wasteList[3]])
this.$refs.fifthPileChart.initChart(nameList, [topNameList[4]], [nameWasteList[4]], [productList[4]], [wasteList[4]])
this.$refs.productChart.initChart(nameList, yieldList, sumAreaList)
})
}
}
};
// if (typeof (WebSocket) === 'undefined') {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-29 13:45:56
* @LastEditTime: 2024-04-11 11:02:53
* @LastEditTime: 2024-04-17 15:48:21
* @LastEditors: zhp
* @Description:
-->
@ -13,6 +13,7 @@
</template>
<script>
import { position } from '@antv/x6-common/lib/dom/position';
import * as echarts from 'echarts';
// import resize from './../mixins/resize'
// import NotMsg from './../components/NotMsg'
@ -49,29 +50,45 @@ export default {
mounted() {
this.chartData = [
{
name: '细长泡',
name: '0904褶皱/严重',
num: 1112,
yield: 0.97,
},
{
name: '长泡',
name: '0904褶皱/严重',
num: 1112,
yield: 0.97,
},
{
name: '开口泡',
name: '0904褶皱/严重',
num: 1112,
yield: 0.97,
},
{
name: '结石',
name: '0904褶皱/严重',
num: 1112,
yield: 0.97,
}
]
this.updateChart()
},
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() {
console.log('update')
let num = 0
@ -108,46 +125,63 @@ export default {
fontSize: 20,
color: '#fff00',
},
},
legend: {
bottom: '10%',
left: 'center',
itemWidth: 12,
itemHeight:12,
icon: 'roundRect',
textStyle: {
color: '#fff'
},
data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
name:item.name,
itemStyle:{
color: this.colors[index%4]
}
}))
},
},
grid: {
left: '1%',
right: '1%',
bottom: '0',
containLabel: true
},
// legend: {
// bottom: '10%',
// left: 'center',
// itemWidth: 12,
// itemHeight:12,
// icon: 'roundRect',
// textStyle: {
// color: '#fff'
// },
// data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
// name:item.name,
// itemStyle:{
// color: this.colors[index%4]
// }
// }))
// },
series:[{
name: 'ISRA缺陷检测',
type: 'pie',
type: 'pie',
// position:outerHeight,
center: ['50%', '40%'],
radius: ['45%', '70%'],
avoidLabelOverlap: true,
label: {
show: true,
label: {
show: true,
normal: {
alignTo: 'labelLine',
margin: 10,
edgeDistance: 10,
lineHeight: 16,
//
// params: data,
formatter: function (params) {
console.log(params);
return params.value + " | " + params.percent.toFixed(0) + "%" + "\n\n" + params.name;
return ;
},
formatter: (params) => {
//
return this.getEqualNewlineString(params.value + " | " + params.percent.toFixed(0) + "%" + "\n" + params.name,10);
},
textStyle: { //
// color: '#595959',
fontSize: 24.48
fontSize: 18
}
}
},
labelLine: {
show: true,
show: true,
length: 25,
length2: 10,
},
data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({
name:item.name,
@ -185,15 +219,19 @@ export default {
.isra-chart {
width: 100%;
height: 100%;
position: absolute;
top: 7%;
}
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>
<style>
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -2,7 +2,7 @@
<!--
* @Author: zhp
* @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-09 15:24:39
* @LastEditTime: 2024-04-16 13:39:25
* @LastEditors: zhp
* @Description:
-->
@ -156,6 +156,8 @@ export default {
this.chart.setOption({
// color: colors,
tooltip: {
trigger: 'item',
className: "isra-chart-tooltip",
trigger: 'axis',
axisPointer: {
type: 'cross'
@ -318,8 +320,16 @@ export default {
}
</script>
<style>
.coldProductChart{
top: -10px;
}
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-09-21 09:06:28
* @LastEditTime: 2024-04-09 15:24:28
* @LastEditTime: 2024-04-16 13:37:38
* @LastEditors: zhp
* @Description:
-->
@ -162,6 +162,8 @@ export default {
this.chart.setOption({
// color: colors,
tooltip: {
trigger: 'item',
className: "isra-chart-tooltip",
trigger: 'axis',
axisPointer: {
type: 'cross'
@ -327,4 +329,13 @@ export default {
width: 100%;
top: -30px;
}
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -128,6 +128,8 @@ export default {
this.chart.setOption({
tooltip: {
trigger: 'axis',
trigger: 'item',
className: "isra-chart-tooltip",
axisPointer: {
//
type: 'shadow' // 线'line' | 'shadow'
@ -226,4 +228,13 @@ export default {
width: 100%;
top: -30px;
}
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-27 13:54:52
* @LastEditTime: 2024-04-03 18:12:18
* @LastEditTime: 2024-04-19 15:43:08
* @LastEditors: zhp
* @Description:
-->
@ -101,11 +101,14 @@ export default {
});;
},
initChart(nameList, topNameList, nameWasteList, passRateList, wasteList) {
let rawData = []
let colors = ['#0fdedb', '#2359ec']
if (topNameList.length === 0 && nameWasteList.length === 0 && passRateList === 0 && wasteList === 0) {
return
} else {
let rawData = []
let colors = ['#0fdedb', '#2359ec']
rawData.push(passRateList, wasteList)
const totalData = [];
// if (rawData.length != 0 && raw,Data,length != 0) {
const totalData = [];
// if (rawData.length != 0 && raw,Data,length != 0) {
for (let i = 0; i < rawData[0].length; ++i) {
let sum = 0;
for (let j = 0; j < rawData.length; ++j) {
@ -113,150 +116,152 @@ export default {
}
totalData.push(sum);
}
// }
// rawData[1].map((d, did) =>
// console.log((d / totalData[did]).toFixed(3))
// // totalData[did] <= 0 ? 0 : d / totalData[did]
// )
console.log('total', totalData)
const series = [
'良品',
'废品',
// 'Affiliate Ad',
// 'Video Ad',
// 'Search Engine'
].map((name, sid) => {
// console.log(sid)
return {
name,
type: 'bar',
stack: 'total',
barWidth: 12,
// label: {
// show: true,
// formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
// },
color:colors[sid],
data: rawData.length != 0 ? rawData[sid].map((d, did) =>
totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4)
) : []
};
});
// this.charts.resize({
// //width: width,
// //height: height,
// // es6
// width,
// height
// })
this.chart = echarts.init(document.getElementById(this.id))
let isFinished = false // isFinished
this.chart.on('finished', _ => {
if (!isFinished) {
console.log('我只执行一次')
isFinished = true
// this.isLoading = false //loading
this.chart.resize() //charts
}
console.log(113, 'finished')
})
this.chart.setOption({
legend: {
formatter: function (name) {
//name
let singleData = series.filter(function (item) {
return item.name == name
})
return name + parseFloat((singleData[0].data * 100).toFixed(0)) + '%'
},
itemWidth: 12,
itemHeight: 12,
bottom: '20',
left: '20',
icon: 'roundRect',
textStyle: {
color: 'rgba(255,255,255,.9)',
fontSize:12,
// }
// rawData[1].map((d, did) =>
// console.log((d / totalData[did]).toFixed(3))
// // totalData[did] <= 0 ? 0 : d / totalData[did]
// )
console.log('total', totalData)
const series = [
'良品',
'废品',
// 'Affiliate Ad',
// 'Video Ad',
// 'Search Engine'
].map((name, sid) => {
// console.log(sid)
return {
name,
type: 'bar',
stack: 'total',
barWidth: 12,
// label: {
// show: true,
// formatter: (params) => Math.round(params.value * 1000) / 10 + '%'
// },
color: colors[sid],
data: rawData.length != 0 ? rawData[sid].map((d, did) =>
totalData[did] <= 0 ? 0 : (d / totalData[did]).toFixed(4)
) : []
};
});
// this.charts.resize({
// //width: width,
// //height: height,
// // es6
// width,
// height
// })
this.chart = echarts.init(document.getElementById(this.id))
let isFinished = false // isFinished
this.chart.on('finished', _ => {
if (!isFinished) {
console.log('我只执行一次')
isFinished = true
// this.isLoading = false //loading
this.chart.resize() //charts
}
},
grid: {
top:'0',
left: '3%',
right: '4%',
// bottom: '3%',
width: 'auto',
height: '95',
containLabel: true
},
yAxis: [
{
type: 'category',
inverse: true,
splitLine: {
show: false
console.log(113, 'finished')
})
this.chart.setOption({
legend: {
formatter: function (name) {
//name
let singleData = series.filter(function (item) {
return item.name == name
})
return name + parseFloat((singleData[0].data * 100).toFixed(2)) + '%'
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: true,
inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: {
color: 'rgba(255,255,255,.9)',
verticalAlign: 'bottom',
fontSize: 16,
align: 'left',
padding: [0, 0, 10, -5]
}
},
data: topNameList
itemWidth: 12,
itemHeight: 12,
bottom: '20',
left: '20',
icon: 'roundRect',
textStyle: {
color: 'rgba(255,255,255,.9)',
fontSize: 12,
}
},
{
type: 'category',
inverse: true,
splitLine: {
show: false
grid: {
top: '0',
left: '3%',
right: '4%',
// bottom: '3%',
width: 'auto',
height: '95',
containLabel: true
},
yAxis: [
{
type: 'category',
inverse: true,
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: true,
inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: {
color: 'rgba(255,255,255,.9)',
verticalAlign: 'bottom',
fontSize: 16,
align: 'left',
padding: [0, 0, 10, -5]
}
},
data: topNameList
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: true,
inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: {
color: 'rgba(255,255,255,.9)',
verticalAlign: 'bottom',
fontSize: 16,
align: 'right',
padding: [0, 0, 10, -5]
}
},
data: nameWasteList
}
],
xAxis: {
// max: 120,
show: false,
},
series:series
})
this.$nextTick(() => {
setTimeout(() => {
this.resize()
},1000);
})
{
type: 'category',
inverse: true,
splitLine: {
show: false
},
axisTick: {
show: false
},
axisLine: {
show: false
},
axisLabel: {
show: true,
inside: true,
interval: 0, //
splitNumber: 50,
// boundaryGap: [20, 20],
textStyle: {
color: 'rgba(255,255,255,.9)',
verticalAlign: 'bottom',
fontSize: 16,
align: 'right',
padding: [0, 0, 10, -5]
}
},
data: nameWasteList
}
],
xAxis: {
// max: 120,
show: false,
},
series: series
})
this.$nextTick(() => {
setTimeout(() => {
this.resize()
}, 1000);
})
}
// this.chart.resize({
// width: 'auto',
// height: 90

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-07-19 15:18:30
* @LastEditors: zhp
* @LastEditTime: 2024-04-10 16:10:11
* @LastEditTime: 2024-04-18 08:42:00
* @Description:
-->
<template>
@ -42,21 +42,24 @@
<el-row v-for="op in orderList" :key="op.id" style="margin-bottom: .5em;overflow: hidden;">
<!-- <el-col :span="12"> -->
<!-- <div style="height: 34px;"> -->
<span class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</span>
<el-divider class="split" v-if="op.specifications" direction="vertical"></el-divider>
<!-- <span v-if="op.size" class="split"></span> -->
<span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
op.specifications }}</span>
<el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
op.planQuantity }}</span>
<span style="display: inline-block;width: 330px;">
<span class="now-secondary-title" style="font-size: 14px;opacity: calc(.6);">{{ op.name }}</span>
<el-divider class="split" v-if="op.specifications" direction="vertical"></el-divider>
<!-- <span v-if="op.size" class="split"></span> -->
<span v-if="op.specifications" class="orderSize" style="font-size: 14px;opacity: calc(.6);">{{
op.specifications }}</span>
<el-divider class="split" v-if="op.planQuantity" direction="vertical"></el-divider>
<span v-if="op.planQuantity" class="orderPlan" style="font-size: 14px;opacity: calc(.6);">{{
op.planQuantity }}</span>
</span>
<span v-if="op.actualQuantity" class="orderFinish"
style="font-size: 14px;opacity: calc(.6);margin-left: 130px;">{{
style="font-size: 14px;margin-left: 130px;">{{
op.actualQuantity
}}</span>
<el-divider class="split" v-if="op.actualQuantity" direction="vertical"></el-divider>
<el-divider class="split" style="background-color: rgba(0, 255, 247, 1)" v-if="op.actualQuantity"
direction="vertical"></el-divider>
<!-- </div> -->
<el-progress style="width: 620px;" text-color="rgba(255, 255, 255, .6)" :stroke-width="10"
<el-progress style="width: 620px;" text-color="rgba(0, 255, 247, 1)" :stroke-width="10"
define-back-color="rgba(32, 57, 96, 1)" :percentage="op.progressRate" class="custom-progress-bar" />
</el-row>
</div>
@ -108,80 +111,79 @@ const qualityYearList = [
{
name: '翻转机',
code: 'EQ20240110112358000235',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '烘干炉',
code: 'EQ20240110112537000241',
status: '运行',
error: '否',
status: '计划停机',
error: true,
},
{
name: '清洗机',
code: ' EQ20240110112310000232',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '钢化清洗机',
code: 'EQ20240110111700000208',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '固化机',
code: 'EQ20240110111700000201',
status: '运行',
error: '否',
status: '正常',
error: 'true',
},
{
name: '磨边清洗机',
code: ' EQ20240110111700000208',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '预热机',
code: 'EQ20240110111700000205',
status: '故障',
error: '是',
error: true,
},
{
name: '下片机',
code: 'EQ20240115151435000279',
status: '运行',
error: '否',
error: true,
},
{
name: '冷却机',
code: 'EQ20240110111700000203',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: 'A储片机106',
code: 'EQ20240110111700000202',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '二次清洗机',
code: 'EQ20240110111700000209',
status: '运行',
error: '否',
status: '正常',
error: true,
},
{
name: '二次磨边机',
code: ' EQ20240110110927000181',
status: '故障',
error: '是',
status: '正常',
error: true,
},
{
name: '测试设备',
code: 'EQ20240110111700000201',
status: '运行',
error: '否',
status: '正常',
error: true,
},
];
const qualityMonthList = [
@ -230,37 +232,37 @@ const qualityMonthList = [
];
const orderProcessList = [
{
id: '1',
id: 1,
outRate: '.8',
name: '凯盛0322',
},
{
id: '2',
id: 2,
outRate: '.4',
name: '光伏玻璃4.0',
},
{
id: '3',
id: 3,
outRate: '.5',
name: '光伏玻璃3.0',
},
{
id: '4',
id: 4,
outRate: '.3',
name: '光伏玻璃2.0',
},
{
id: '5',
id: 5,
outRate: '.5',
name: '光伏玻璃1.0',
},
{
id: '6',
id: 6,
outRate: '.8',
name: '光伏玻璃',
},
{
id: '7',
id: 7,
outRate: '.8',
name: '统计订单',
},
@ -380,7 +382,7 @@ export default {
progressRate: 0.933333,
specifications: '1100*5554*22',
plan: 11111,
finish:111,
actualQuantity:111,
},
{
id: '2',
@ -388,7 +390,7 @@ export default {
progressRate: 0.932323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '3',
@ -396,7 +398,7 @@ export default {
progressRate: 0.23232,
size: '1100*5554*22',
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '4',
@ -404,7 +406,7 @@ export default {
progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '5',
@ -412,7 +414,7 @@ export default {
progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '6',
@ -420,7 +422,7 @@ export default {
size: '1100*5554*22',
progressRate: 0.32323,
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '7',
@ -428,7 +430,7 @@ export default {
size: '1100*5554*22',
progressRate: 0.32323,
plan: 11111,
finish: 111,
actualQuantity: 111,
},
{
id: '8',
@ -436,7 +438,7 @@ export default {
progressRate: 0.32323,
size: '1100*5554*22',
plan: 11111,
finish: 111,
actualQuantity: 111,
},
// {
// id: '5',
@ -456,7 +458,7 @@ export default {
progressRate: parseFloat((ele.progressRate * 100).toFixed(0)),
specifications: ele.specifications ? '规格' + ele.specifications :null,
planQuantity: ele.plan ? '计划' + ele.plan + '片' : null,
finish: ele.finish + '片',
actualQuantity: ele.actualQuantity + '片',
};
}
});
@ -480,8 +482,8 @@ export default {
<span style="color:rgba(255,255,255,0.5)" >${item.name || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.code || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.status == '运行' ? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 ' : 'box-shadow: 0px 0px 2px 1px #FFBD02;width:6px;height:6px;border-radius: 50%; background-color: #FFBD02;float:left;margin:13px 10px 0 0 '}"></div> ${item.status || ''}</span>`,
`<span style="color:rgba(255,255,255,0.5)"><div style="${item.error == '' ? '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.error || ''}</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>`,
]);
this.eqConfig.data = eqArr;
let data = [
@ -747,8 +749,8 @@ export default {
`<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: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 == '' ? '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.error || ''}</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>`,
]);
this.eqConfig.data = eqArr;
// this.$nextTick(() => {
@ -790,7 +792,23 @@ export default {
outputNumList
);
})
} else if (this.SJGInitWebSocket === 'inspection') {
} else if (this.SJGWsData.type === 'inspection') {
let processArr = this.SJGWsData.detData.map((item, index) => [
`<span style="color:rgba(255,255,255,0.5)" >${index + 1 || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)" >${item.productionLineName || ''}
</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.sectionName || ''
}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.count || ''
}</span>`,
`<span style="color:rgba(255,255,255,0.5)">${item.inspectionTypeName || ''
}</span>`,
]);
this.processConfig.data = processArr;
// this.$nextTick(() => {
this.$refs['processScrollBoard'].updateRows(processArr);
// })
}
};
},
@ -975,7 +993,7 @@ export default {
font-size: 14px;
line-height: 2em;
text-align: right;
color: #fff;
color: rgba(0, 255, 247, 1);
}
.orderPlan {
display: inline-block;

View File

@ -201,7 +201,7 @@
@pagination="getList" /> -->
</div>
<div v-if="this.$auth.hasPermiAnd(['base:material-product-bom-det:query', 'extend:process-flow:query'])">
<div v-if="$auth.hasPermiAnd(['base:material-product-bom-det:query', 'extend:process-flow:query'])">
<div class="card" style="padding-bottom: 16px;">
<div class="boxTitle">
<span class="blueTitle"></span>

View File

@ -1,19 +1,24 @@
<template>
<el-drawer :visible.sync="drawer" :append-to-body="true" size="80%" >
<small-title slot="title" :no-padding="true">
<!-- <template v-for="demo in demoList"> -->
<!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
<!-- {{ $t('module.packingManage.printModelDesign') }} -->
模板设计
<!-- </el-button> -->
<!-- </template> -->
</small-title>
<el-card>
<el-row style="margin-bottom: 10px">
<el-col :span="4">
<!-- 模板选择 -->
<el-drawer
:visible.sync="drawer"
:append-to-body="true"
size="80%">
<small-title
slot="title"
:no-padding="true">
<!-- <template v-for="demo in demoList"> -->
<!-- <el-button :key="demo.name" :type="demo.name === curDemo ? 'primary' : ' '" @click="curDemo = demo.name"> -->
<!-- {{ $t('module.packingManage.printModelDesign') }} -->
模板设计
<!-- </el-button> -->
<!-- </template> -->
</small-title>
<el-card>
<el-row style="margin-bottom: 10px">
<!-- <el-col :span="4"> -->
<!-- 模板选择 -->
<!-- <el-select
<!-- <el-select
v-model="mode"
filterable
:default-value="0"
@ -25,393 +30,469 @@
{{ opt.name }}
</el-option>
</el-select> -->
</el-col>
<el-col :span="20">
<!-- 纸张设置 -->
<el-button-group style="margin:0 10px">
<el-button v-for="(value,type) in paperTypes" :key="type" :type="curPaperType === type ? 'primary' : ' '"
@click="setPaper(type,value)">
{{ type }}
</el-button>
</el-button-group>
<el-input-number style="margin:0 10px" :value="scaleValue " :precision="2" :step="0.1" :min="scaleMin"
:max="scaleMax" @change="changeScale" />
<el-popover v-model="paperPopVisible" placement="bottom" width="300" title="设置纸张宽高(mm)">
<div style="display: flex;align-items: center;justify-content: space-between;margin-bottom: 10px">
<el-input v-model="paperWidth" type="number" style=" width: 100px; text-align: center" place="宽mm" />~
<el-input v-model="paperHeight" type="number" style=" width: 100px; text-align: center" place="高mm" />
</div>
<div>
<el-button type="primary" style="width: 100%" size="mini" @click="otherPaper">确定</el-button>
</div>
<el-button slot="reference" type="primary" style="margin:0 10px">自定义宽高</el-button>
</el-popover>
<!-- </el-col> -->
<el-col :span="24">
<!-- 纸张设置 -->
<el-button-group style="margin: 0 10px">
<el-button
v-for="(value, type) in paperTypes"
:key="type"
:type="curPaperType === type ? 'primary' : ' '"
@click="setPaper(type, value)">
{{ type }}
</el-button>
</el-button-group>
<el-input-number
style="margin: 0 10px; width: 140px"
:value="scaleValue"
:precision="2"
:step="0.1"
:min="scaleMin"
:max="scaleMax"
@change="changeScale" />
<el-popover
v-model="paperPopVisible"
placement="bottom"
width="300"
title="设置纸张宽高(mm)">
<div
style="
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
">
<el-input
v-model="paperWidth"
type="number"
style="width: 100px; text-align: center"
place="宽mm" />
~
<el-input
v-model="paperHeight"
type="number"
style="width: 100px; text-align: center"
place="高mm" />
</div>
<div>
<el-button
type="primary"
style="width: 100%"
size="mini"
@click="otherPaper">
确定
</el-button>
</div>
<el-button
slot="reference"
type="primary"
style="margin: 0 10px">
自定义宽高
</el-button>
</el-popover>
<!-- <a-button-group>-->
<!-- <template v-for="(value,type) in paperTypes">-->
<!-- <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">-->
<!-- {{ type }}-->
<!-- </a-button>-->
<!-- </template>-->
<!-- <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">-->
<!-- <div slot="content">-->
<!-- <a-input-group compact style="margin: 10px 10px">-->
<!-- <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"-->
<!-- placeholder="宽(mm)"/>-->
<!-- <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"-->
<!-- placeholder="~" disabled-->
<!-- />-->
<!-- <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"-->
<!-- placeholder="高(mm)"/>-->
<!-- </a-input-group>-->
<!-- <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>-->
<!-- </div>-->
<!-- <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>-->
<!-- </a-popover>-->
<!-- </a-button-group>-->
<!-- <a-button-group>-->
<!-- <template v-for="(value,type) in paperTypes">-->
<!-- <a-button :type="curPaperType === type ? 'primary' : 'info'" @click="setPaper(type,value)" :key="type">-->
<!-- {{ type }}-->
<!-- </a-button>-->
<!-- </template>-->
<!-- <a-popover v-model="paperPopVisible" title="设置纸张宽高(mm)" trigger="click">-->
<!-- <div slot="content">-->
<!-- <a-input-group compact style="margin: 10px 10px">-->
<!-- <a-input type="number" v-model="paperWidth" style=" width: 100px; text-align: center"-->
<!-- placeholder="宽(mm)"/>-->
<!-- <a-input style=" width: 30px; border-left: 0; pointer-events: none; backgroundColor: #fff"-->
<!-- placeholder="~" disabled-->
<!-- />-->
<!-- <a-input type="number" v-model="paperHeight" style="width: 100px; text-align: center; border-left: 0"-->
<!-- placeholder="高(mm)"/>-->
<!-- </a-input-group>-->
<!-- <a-button type="primary" style="width: 100%" @click="otherPaper">确定</a-button>-->
<!-- </div>-->
<!-- <a-button :type="'other'==curPaperType?'primary':''">自定义纸张</a-button>-->
<!-- </a-popover>-->
<!-- </a-button-group>-->
<!-- 预览/打印 -->
<el-button-group>
<el-button type="primary" icon="redo" @click="rotatePaper()">旋转</el-button>
<el-button type="primary" icon="el-icon-view" @click="preView">
预览
</el-button>
<!-- <el-button type="primary" icon="el-icon-printer" @click="print">
<!-- 预览/打印 -->
<el-button-group>
<el-button
type="primary"
icon="redo"
@click="rotatePaper()">
旋转
</el-button>
<el-button
type="primary"
icon="el-icon-view"
@click="preView">
预览
</el-button>
<!-- <el-button type="primary" icon="el-icon-printer" @click="print">
直接打印
</el-button> -->
<el-button type="primary" icon="el-icon-s-management" @click="save">
保存
</el-button>
<el-button type="danger" icon="el-icon-delete" @click="clearPaper">
清空
</el-button>
</el-button-group>
<!-- 保存/清空 -->
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="4">
<el-card style="height: 100vh">
<el-row>
<el-col :span="24" class="rect-printElement-types hiprintEpContainer" />
</el-row>
</el-card>
</el-col>
<el-col :span="16">
<el-card class="card-design">
<div id="hiprint-printTemplate" class="hiprint-printTemplate" />
</el-card>
</el-col>
<el-col :span="4" class="params_setting_container">
<el-card>
<el-row class="hinnn-layout-sider">
<div id="PrintElementOptionSetting" />
</el-row>
</el-card>
</el-col>
</el-row>
<!-- 预览 -->
<print-preview ref="preView" />
</el-card>
</el-drawer>
<el-button
type="primary"
icon="el-icon-s-management"
@click="save">
保存
</el-button>
<el-button
type="danger"
icon="el-icon-delete"
@click="clearPaper">
清空
</el-button>
</el-button-group>
<!-- 保存/清空 -->
</el-col>
</el-row>
<el-row :gutter="24">
<el-col :span="4">
<el-card style="height: 100vh">
<el-row>
<el-col
:span="24"
class="rect-printElement-types hiprintEpContainer" />
</el-row>
</el-card>
</el-col>
<el-col :span="16">
<el-card class="card-design">
<div
id="hiprint-printTemplate"
class="hiprint-printTemplate" />
</el-card>
</el-col>
<el-col
:span="4"
class="params_setting_container">
<el-card>
<el-row class="hinnn-layout-sider">
<div id="PrintElementOptionSetting" />
</el-row>
</el-card>
</el-col>
</el-row>
<!-- 预览 -->
<print-preview ref="preView" />
</el-card>
</el-drawer>
</template>
<script>
import printPreview from './preview'
import { MessageBox } from 'element-ui'
import { hiprint } from 'vue-plugin-hiprint'
import providers from './providers'
import printPreview from './preview';
import { MessageBox } from 'element-ui';
import { hiprint } from 'vue-plugin-hiprint';
import providers from './providers';
// import printData from './print-data'
import $ from 'jquery'
import SmallTitle from './SmallTitle.vue'
let hiprintTemplate = null
import $ from 'jquery';
import SmallTitle from './SmallTitle.vue';
let hiprintTemplate = null;
export default {
name: 'PrintCustom',
components: { printPreview, SmallTitle },
// props: {
// modelData: {
// type: String,
// default: ''
// }
// },
data() {
return {
// paperPopVisible: false,
//
mode: 0,
template: null,
modeList: [],
//
curPaper: {
// type: 'other',
// width: 220,
// height: 80
},
printData:{},
drawer: false,
//
paperTypes: {
'A3': {
width: 420,
height: 296.6
},
'A4': {
width: 210,
height: 297
},
'A5': {
width: 210,
height: 147.6
},
'B3': {
width: 500,
height: 352.6
},
'B4': {
width: 250,
height: 352.6
},
'B5': {
width: 250,
height: 175.6
}
},
scaleValue: 1,
scaleMax: 5,
scaleMin: 0.5,
//
paperPopVisible: false,
paperWidth: '210',
paperHeight: '297'
}
},
computed: {
curPaperType() {
let type = 'other'
const types = this.paperTypes
for (const key in types) {
const item = types[key]
const { width, height } = this.curPaper
if (item.width === width && item.height === height) {
type = key
}
}
return type
}
},
created() {
// $('.hiprintEpContainer').empty()
},
destroyed () {
$('.hiprintEpContainer').empty()
console.log(11111)
},
methods: {
// handleClose() {
// $('.hiprintEpContainer').empty()
// },
closed() {
$('.hiprintEpContainer').empty()
$('.hiprint-printTemplate').empty()
},
init(data) {
this.drawer = true
this.modelData = data
this.modeList = providers.map((e) => {
return { type: e.type, name: e.name, value: e.value }
})
this.changeMode()
},
changeMode() {
// hiprintTemplate.clear()
// console.log(this.modelData)
this.$nextTick(() => {
const { mode } = this
const provider = providers[mode]
hiprint.init({
providers: [provider.f]
})
name: 'PrintCustom',
components: { printPreview, SmallTitle },
// props: {
// modelData: {
// type: String,
// default: ''
// }
// },
data() {
return {
// paperPopVisible: false,
//
mode: 0,
template: null,
modeList: [],
//
curPaper: {
// type: 'other',
// width: 220,
// height: 80
},
printData: {},
drawer: false,
//
paperTypes: {
A3: {
width: 420,
height: 296.6,
},
A4: {
width: 210,
height: 297,
},
A5: {
width: 210,
height: 147.6,
},
A6: {
width: 95,
height: 125,
},
B3: {
width: 500,
height: 352.6,
},
B4: {
width: 250,
height: 352.6,
},
B5: {
width: 250,
height: 175.6,
},
},
scaleValue: 1,
scaleMax: 5,
scaleMin: 0.5,
//
paperPopVisible: false,
paperWidth: '210',
paperHeight: '297',
};
},
computed: {
curPaperType() {
let type = 'other';
const types = this.paperTypes;
for (const key in types) {
const item = types[key];
const { width, height } = this.curPaper;
if (item.width === width && item.height === height) {
type = key;
}
}
return type;
},
},
created() {
// $('.hiprintEpContainer').empty()
},
destroyed() {
$('.hiprintEpContainer').empty();
console.log(11111);
},
methods: {
// handleClose() {
// $('.hiprintEpContainer').empty()
// },
closed() {
$('.hiprintEpContainer').empty();
$('.hiprint-printTemplate').empty();
},
init(data) {
this.drawer = true;
this.modelData = data;
this.modeList = providers.map((e) => {
return { type: e.type, name: e.name, value: e.value };
});
this.changeMode();
},
changeMode() {
// hiprintTemplate.clear()
// console.log(this.modelData)
this.$nextTick(() => {
const { mode } = this;
const provider = providers[mode];
hiprint.init({
providers: [provider.f],
});
// $('#hiprint-printTemplate').empty()
// console.log(JSON.parse(this.modelData))
hiprint.setConfig()
//
hiprint.setConfig({
movingDistance: 2.5,
text: {
supportOptions: [
{
name: 'styler',
hidden: true
},
{
name: 'formatter',
hidden: true
}
]
}
})
// $('#hiprint-printTemplate').empty()
// console.log(JSON.parse(this.modelData))
hiprint.setConfig();
//
hiprint.setConfig({
movingDistance: 2.5,
text: {
supportOptions: [
{
name: 'styler',
hidden: true,
},
{
name: 'formatter',
hidden: true,
},
],
},
});
// console.log(this.modelData)
// console.log($('#hiprint-printTemplate').empty())
// if () {
// console.log(this.modelData);
// $('.hiprintEpContainer').empty()
// hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
// $('.hiprint-printTemplate').empty()
// hiprintTemplate = new hiprint.PrintTemplate({
// template: JSON.parse(this.modelData),
// settingContainer: '#PrintElementOptionSetting',
// paginationContainer: '.hiprint-printPagination'
// })
// } else {
$('.hiprintEpContainer').empty()
console.log(this.modelData || {});
hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
$('.hiprint-printTemplate').empty()
// const templates = this.$ls.get('KEY_TEMPLATES', {})
const template = provider.value
// console.log(template)
if (this.modelData) {
hiprintTemplate = new hiprint.PrintTemplate({
template: JSON.parse(this.modelData),
settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination'
})
} else {
hiprintTemplate = new hiprint.PrintTemplate({
template:{},
settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination'
})
}
// }
hiprintTemplate.design('#hiprint-printTemplate')
// console.log(hiprintTemplate)
console.log(hiprintTemplate);
// hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
// , zoomtrue
this.scaleValue = hiprintTemplate.editingPanel.scale || 1
// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
})
},
/**
* 设置纸张大小
* @param type [A3, A4, A5, B3, B4, B5, other]
* @param value {width,height} mm
*/
setPaper(type, value) {
try {
if (Object.keys(this.paperTypes).includes(type)) {
this.curPaper = { type: type, width: value.width, height: value.height }
hiprintTemplate.setPaper(value.width, value.height)
} else {
this.curPaper = { type: 'other', width: value.width, height: value.height }
hiprintTemplate.setPaper(value.width, value.height)
}
} catch (error) {
this.$message.error(`操作失败: ${error}`)
}
},
changeScale(currentValue, oldValue) {
let big = false
currentValue <= oldValue ? big = false : big = true
let scaleValue = this.scaleValue
if (big) {
scaleValue += 0.1
if (scaleValue > this.scaleMax) scaleValue = 5
} else {
scaleValue -= 0.1
if (scaleValue < this.scaleMin) scaleValue = 0.5
}
if (hiprintTemplate) {
// scaleValue: , false: (), true,
hiprintTemplate.zoom(scaleValue)
this.scaleValue = scaleValue
}
},
clearPaper() {
MessageBox.confirm('是否确认清空模板信息?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
try {
hiprintTemplate.clear()
} catch (error) {
this.$message.error(`操作失败: ${error}`)
}
}).catch((err) => {
console.log(err)
})
},
otherPaper() {
const value = {}
value.width = this.paperWidth
value.height = this.paperHeight
this.paperPopVisible = false
this.setPaper('other', value)
},
rotatePaper() {
if (hiprintTemplate) {
hiprintTemplate.rotatePaper()
}
},
preView() {
const { width } = this.curPaper
this.$refs.preView.show(hiprintTemplate, this.printData, width)
},
print() {
// if (window.hiwebSocket.opened) {
const printerList = hiprintTemplate.getPrinterList()
console.log(printerList)
hiprintTemplate.print2(this.printData, { printer: '', title: '预览打印' })
// return
// }
// this.$message.error(',')
},
save() {
// console.log(hiprintTemplate.getJson())
const { mode } = this
const provider = providers[mode]
// console.log(hiprintTemplate.getJson())
this.setTemplate({
name: provider.value,
json: hiprintTemplate.getJson()
})
},
setTemplate(payload) {
// const templates = this.$ls.get('KEY_TEMPLATES', {})
// console.log(payload.json)
// templates[payload.name] = payload.json
// this.$ls.set('KEY_TEMPLATES', templates)
this.$message.info('保存成功')
// console.log(JSON.stringify(payload.json))
this.drawer = false
this.$emit('saveData', payload.json)
$('.hiprintEpContainer').empty()
// this.$parent.$parent.getModelData(payload.json)
}
}
}
// console.log(this.modelData)
// console.log($('#hiprint-printTemplate').empty())
// if () {
// console.log(this.modelData);
// $('.hiprintEpContainer').empty()
// hiprint.PrintElementTypeManager.build('.hiprintEpContainer', provider.value)
// $('.hiprint-printTemplate').empty()
// hiprintTemplate = new hiprint.PrintTemplate({
// template: JSON.parse(this.modelData),
// settingContainer: '#PrintElementOptionSetting',
// paginationContainer: '.hiprint-printPagination'
// })
// } else {
$('.hiprintEpContainer').empty();
console.log(this.modelData || {});
hiprint.PrintElementTypeManager.build(
'.hiprintEpContainer',
provider.value
);
$('.hiprint-printTemplate').empty();
// const templates = this.$ls.get('KEY_TEMPLATES', {})
const template = provider.value;
// console.log(template)
if (this.modelData) {
hiprintTemplate = new hiprint.PrintTemplate({
template: JSON.parse(this.modelData),
settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination',
});
} else {
hiprintTemplate = new hiprint.PrintTemplate({
template: {},
settingContainer: '#PrintElementOptionSetting',
paginationContainer: '.hiprint-printPagination',
});
}
// }
hiprintTemplate.design('#hiprint-printTemplate');
// console.log(hiprintTemplate)
console.log(hiprintTemplate);
// hiprintTemplate.design('#hiprint-printTemplate', { grid: true })
// , zoomtrue
this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
// this.scaleValue = hiprintTemplate.editingPanel.scale || 1
});
},
/**
* 设置纸张大小
* @param type [A3, A4, A5, B3, B4, B5, other]
* @param value {width,height} mm
*/
setPaper(type, value) {
try {
if (Object.keys(this.paperTypes).includes(type)) {
this.curPaper = {
type: type,
width: value.width,
height: value.height,
};
hiprintTemplate.setPaper(value.width, value.height);
} else {
this.curPaper = {
type: 'other',
width: value.width,
height: value.height,
};
hiprintTemplate.setPaper(value.width, value.height);
}
} catch (error) {
this.$message.error(`操作失败: ${error}`);
}
},
changeScale(currentValue, oldValue) {
let big = false;
currentValue <= oldValue ? (big = false) : (big = true);
let scaleValue = this.scaleValue;
if (big) {
scaleValue += 0.1;
if (scaleValue > this.scaleMax) scaleValue = 5;
} else {
scaleValue -= 0.1;
if (scaleValue < this.scaleMin) scaleValue = 0.5;
}
if (hiprintTemplate) {
// scaleValue: , false: (), true,
hiprintTemplate.zoom(scaleValue);
this.scaleValue = scaleValue;
}
},
clearPaper() {
MessageBox.confirm('是否确认清空模板信息?', '警告', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning',
})
.then(() => {
try {
hiprintTemplate.clear();
} catch (error) {
this.$message.error(`操作失败: ${error}`);
}
})
.catch((err) => {
console.log(err);
});
},
otherPaper() {
const value = {};
value.width = this.paperWidth;
value.height = this.paperHeight;
this.paperPopVisible = false;
this.setPaper('other', value);
},
rotatePaper() {
if (hiprintTemplate) {
hiprintTemplate.rotatePaper();
}
},
preView() {
const { width } = this.curPaper;
this.$refs.preView.show(hiprintTemplate, this.printData, width);
},
print() {
// if (window.hiwebSocket.opened) {
const printerList = hiprintTemplate.getPrinterList();
console.log(printerList);
hiprintTemplate.print2(this.printData, {
printer: '',
title: '预览打印',
});
// return
// }
// this.$message.error(',')
},
save() {
// console.log(hiprintTemplate.getJson())
const { mode } = this;
const provider = providers[mode];
// console.log(hiprintTemplate.getJson())
this.setTemplate({
name: provider.value,
json: hiprintTemplate.getJson(),
});
},
setTemplate(payload) {
// const templates = this.$ls.get('KEY_TEMPLATES', {})
// console.log(payload.json)
// templates[payload.name] = payload.json
// this.$ls.set('KEY_TEMPLATES', templates)
this.$message.info('保存成功');
// console.log(JSON.stringify(payload.json))
this.drawer = false;
this.$emit('saveData', payload.json);
$('.hiprintEpContainer').empty();
// this.$parent.$parent.getModelData(payload.json)
},
},
};
</script>
<style lang="scss" scoped>
// build
::v-deep .hiprint-printElement-type >li>ul>li>a {
padding: 4px 4px;
color: #1296db;
line-height: 1;
height: auto;
text-overflow: ellipsis;
::v-deep .hiprint-printElement-type > li > ul > li > a {
padding: 4px 4px;
color: #1296db;
line-height: 1;
height: auto;
text-overflow: ellipsis;
}
//
.card-design {
// overflow: hidden;
overflow-x: auto;
overflow-y: auto;
// overflow: hidden;
overflow-x: auto;
overflow-y: auto;
}
</style>

View File

@ -56,14 +56,14 @@
</el-row>
</el-form>
</div>
<div class="attr-list" v-if="idAttrShow && this.$auth.hasPermiAnd(['base:material-product-bom:query', 'base:material-product-bom-det:query'])">
<div class="attr-list" v-if="idAttrShow && $auth.hasPermiAnd(['base:material-product-bom:query', 'base:material-product-bom-det:query'])">
<small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
BOM明细
</small-title>
<div v-if="!isdetail && this.$auth.hasPermi('base:material-product-bom:create')" class="action_btn">
<div v-if="!isdetail && $auth.hasPermi('base:material-product-bom:create')" class="action_btn">
<template>
<span style="display: inline-block;">
<el-button type="text" @click="addNew()" icon="el-icon-plus">添加</el-button>

View File

@ -0,0 +1,45 @@
<template>
<div class="tableInner">
<el-input
v-if="list.isEdit"
type="number"
v-model="list[itemProp]"
@blur="changeInput" />
<span v-else>{{ list[itemProp] }}</span>
</div>
</template>
<script>
export default {
name: 'InputArea',
props: {
injectData: {
type: Object,
default: () => ({}),
},
itemProp: {
type: String,
},
},
data() {
return {
list: {},
};
},
mounted() {
this.initData();
},
watch: {
injectData() {
this.initData();
},
},
methods: {
initData() {
this.list = this.injectData;
},
changeInput() {
this.$emit('emitData', this.list);
},
},
};
</script>

View File

@ -0,0 +1,226 @@
<template>
<div class="other-msg-box">
<el-radio-group
v-model="chooseMsg"
@change="changeChoose">
<el-radio :label="1">
<div style="display: inline-block">
<el-form
:inline="true"
:model="printMsg1"
class="demo-form-inline">
<el-form-item label="客户">
<el-select
size="small"
v-model="printMsg1.customerId"
filterable
placeholder="客户">
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="封箱人员工号">
<el-input
v-model="printMsg1.sealWorker"
size="small"
placeholder="封箱人员工号"></el-input>
</el-form-item>
<el-form-item label="打包人员工号">
<el-input
v-model="printMsg1.packWorker"
size="small"
placeholder="打包人员工号"></el-input>
</el-form-item>
<el-form-item label="流程卡号">
<el-input
v-model="printMsg1.processCard"
size="small"
style="width: 120px"
placeholder="流程卡号"></el-input>
</el-form-item>
<el-form-item label="托盘规格">
<el-input
v-model="printMsg1.pallet"
size="small"
style="width: 120px"
placeholder="托盘规格"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="printMsg1.remark"
size="small"
placeholder="备注"></el-input>
</el-form-item>
</el-form>
</div>
</el-radio>
<el-radio :label="2">
<div style="display: inline-block">
<el-form
:inline="true"
:model="printMsg2"
class="demo-form-inline">
<el-form-item label="客户">
<el-select
size="small"
v-model="printMsg2.customerId"
filterable
placeholder="客户">
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="封箱人员工号">
<el-input
v-model="printMsg2.sealWorker"
size="small"
placeholder="封箱人员工号"></el-input>
</el-form-item>
<el-form-item label="打包人员工号">
<el-input
v-model="printMsg2.packWorker"
size="small"
placeholder="打包人员工号"></el-input>
</el-form-item>
<el-form-item label="流程卡号">
<el-input
v-model="printMsg2.processCard"
size="small"
style="width: 120px"
placeholder="流程卡号"></el-input>
</el-form-item>
<el-form-item label="托盘规格">
<el-input
v-model="printMsg2.pallet"
size="small"
style="width: 120px"
placeholder="托盘规格"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="printMsg2.remark"
size="small"
placeholder="备注"></el-input>
</el-form-item>
</el-form>
</div>
</el-radio>
<el-radio :label="3">
<div style="display: inline-block">
<el-form
:inline="true"
:model="printMsg3"
class="demo-form-inline">
<el-form-item label="客户">
<el-select
size="small"
v-model="printMsg3.customerId"
filterable
placeholder="客户">
<el-option
v-for="item in customerList"
:key="item.id"
:label="item.name"
:value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item label="封箱人员工号">
<el-input
v-model="printMsg3.sealWorker"
size="small"
placeholder="封箱人员工号"></el-input>
</el-form-item>
<el-form-item label="打包人员工号">
<el-input
v-model="printMsg3.packWorker"
size="small"
placeholder="打包人员工号"></el-input>
</el-form-item>
<el-form-item label="流程卡号">
<el-input
v-model="printMsg3.processCard"
size="small"
style="width: 120px"
placeholder="流程卡号"></el-input>
</el-form-item>
<el-form-item label="托盘规格">
<el-input
v-model="printMsg3.pallet"
size="small"
style="width: 120px"
placeholder="托盘规格"></el-input>
</el-form-item>
<el-form-item label="备注">
<el-input
v-model="printMsg3.remark"
size="small"
placeholder="备注"></el-input>
</el-form-item>
</el-form>
</div>
</el-radio>
</el-radio-group>
</div>
</template>
<script>
import { getCustomerList } from '@/api/base/packingInfo';
export default {
name: 'OtherMsg',
props: {
printMsg1: {
type: Object,
default: () => ({}),
},
printMsg2: {
type: Object,
default: () => ({}),
},
printMsg3: {
type: Object,
default: () => ({}),
},
},
data() {
return {
chooseMsg: 1,
customerList: [],
};
},
mounted() {
this.getCList();
},
methods: {
getCList() {
getCustomerList().then((res) => {
console.log(res);
console.log('customer');
this.customerList = res.data;
});
},
changeChoose(val) {
this.$emit('changeChoose', val);
},
},
};
</script>
<style lang="scss" scoped>
.other-msg-box {
.el-radio {
display: block;
line-height: 36px;
.demo-form-inline {
width: 100%;
white-space: normal;
}
.el-form-item {
margin-bottom: 0px;
}
}
}
</style>

View File

@ -0,0 +1,182 @@
<template>
<div class="show-box">
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick2" />
<!-- 列表 -->
<base-table
:page="queryParams2.pageNo"
:limit="queryParams2.pageSize"
:table-props="tableProps"
:table-data="list2">
<method-btn
v-if="tableBtn2.length"
slot="handleBtn"
:width="240"
label="操作"
:method-list="tableBtn2"
@clickBtn="handleClick2" />
</base-table>
<pagination
:page.sync="queryParams2.pageNo"
:limit.sync="queryParams2.pageSize"
:total="total2"
@pagination="getList2" />
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi';
import { getPackingPage } from '@/api/base/packingInfo';
import { getCorePLList } from '@/api/base/coreProductionLine';
const tableProps = [
{
prop: 'packagingCode',
label: '成品周转编号',
minWidth: 180,
showOverflowtooltip: true,
},
{
prop: 'lineId',
label: '产线',
showOverflowtooltip: true,
},
{
prop: 'specifications',
label: '规格',
showOverflowtooltip: true,
},
{
prop: 'check',
label: '判定',
showOverflowtooltip: true,
},
{
prop: 'workStation',
label: '工位号',
showOverflowtooltip: true,
},
{
prop: 'num',
label: '片数',
},
{
prop: 'remark',
label: '备注1',
showOverflowtooltip: true,
},
{
prop: 'printStatus',
label: '打印状态',
filter: (val) => (val == 1 ? '未打印' : '已打印'),
},
{
prop: 'createTime',
label: '时间',
filter: parseTime,
minWidth: 160,
showOverflowtooltip: true,
},
{
prop: 'groupClass',
label: '班次',
showOverflowtooltip: true,
},
];
export default {
name: 'Printed',
data() {
return {
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
filterable: true,
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
//
queryParams2: {
pageNo: 1,
pageSize: 20,
printStatus: '2',
lineId: '',
createTime: [],
},
total2: 0,
tableProps,
list2: [],
tableBtn2: [
this.$auth.hasPermi('base:order-group:update')
? {
type: 'reprint',
btnName: '重打',
}
: undefined,
this.$auth.hasPermi('base:order-group:query')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermiAnd([
'base:order-group:update',
'base:core-product:query',
'base:core-customer:query',
])
? {
type: 'edit',
btnName: '编辑',
}
: undefined,
].filter((v) => v),
};
},
mounted() {
this.getLineList();
},
methods: {
getLineList() {
getCorePLList().then((res) => {
console.log(res);
this.formConfig[0].selectOptions = res.data;
});
},
getList2() {
getPackingPage({ ...this.queryParams2 }).then((res) => {
console.log(res);
this.list2 = res.data.records || [];
this.total2 = res.data.total;
});
},
buttonClick2(val) {
console.log(val);
this.queryParams2.lineId = val.lineId;
this.queryParams2.createTime = val.timeVal;
this.getList2();
},
handleClick2() {},
},
};
</script>

View File

@ -0,0 +1,332 @@
<template>
<div class="show-box">
<!-- 单选 -->
<other-msg
:printMsg1="printMsg1"
:printMsg2="printMsg2"
:printMsg3="printMsg3"
@changeChoose="changeChoose" />
<!-- 搜索工作栏 -->
<search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<!-- 列表 -->
<base-table
:page="queryParams.pageNo"
:limit="queryParams.pageSize"
:table-props="tableProps"
:table-data="list"
@emitFun="inputChange">
<method-btn
v-if="tableBtn.length"
slot="handleBtn"
:width="260"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
:page.sync="queryParams.pageNo"
:limit.sync="queryParams.pageSize"
:total="total"
@pagination="getList" />
<!-- 预览 -->
<print-preview ref="preView" />
</div>
</template>
<script>
import { parseTime } from '@/utils/ruoyi';
import inputArea from './InputArea.vue';
const tableProps = [
{
prop: 'packagingCode',
label: '成品周转编号',
minWidth: 160,
showOverflowtooltip: true,
},
{
prop: 'lineId',
label: '产线',
showOverflowtooltip: true,
},
{
prop: 'specifications',
label: '规格',
showOverflowtooltip: true,
},
{
prop: 'check',
label: '判定',
showOverflowtooltip: true,
},
{
prop: 'workStation',
label: '工位号',
showOverflowtooltip: true,
},
{
prop: 'num',
label: '片数',
subcomponent: inputArea,
minWidth: 120,
},
{
prop: 'remark',
label: '备注1',
showOverflowtooltip: true,
},
{
prop: 'printStatus',
label: '打印状态',
filter: (val) => (val == 1 ? '未打印' : '已打印'),
},
{
prop: 'createTime',
label: '时间',
filter: parseTime,
minWidth: 160,
showOverflowtooltip: true,
},
{
prop: 'groupClass',
label: '班次',
showOverflowtooltip: true,
},
];
import OtherMsg from './OtherMsg';
import { getPackingPage, updatePacking } from '@/api/base/packingInfo';
import { getCorePLList } from '@/api/base/coreProductionLine';
import printPreview from './preview';
import printTemplate from '../print-template';
export default {
name: 'UnPrint',
components: { OtherMsg, printPreview },
data() {
return {
printMsg1: {
customerId: '',
sealWorker: '',
packWorker: '',
processCard: '',
pallet: '',
remark: '',
},
printMsg2: {
customerId: '',
sealWorker: '',
packWorker: '',
processCard: '',
pallet: '',
remark: '',
},
printMsg3: {
customerId: '',
sealWorker: '',
packWorker: '',
processCard: '',
pallet: '',
remark: '',
},
chooseMsg: 1, //
formConfig: [
{
type: 'select',
label: '产线',
selectOptions: [],
param: 'lineId',
filterable: true,
},
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss',
valueFormat: 'yyyy-MM-dd HH:mm:ss',
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'timeVal',
defaultSelect: [],
width: 350,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
],
//
queryParams: {
pageNo: 1,
pageSize: 20,
printStatus: '1',
lineId: '',
createTime: [],
},
total: 0,
tableProps,
list: [],
tableBtn: [
this.$auth.hasPermiAnd([
'base:order:query',
'base:order-con-group-order:create',
])
? {
type: 'view',
btnName: '预览',
}
: undefined,
this.$auth.hasPermi('base:order-group:update')
? {
type: 'print',
btnName: '打印',
}
: undefined,
this.$auth.hasPermi('base:order-group:update')
? {
type: 'printed',
btnName: '已打印',
}
: undefined,
this.$auth.hasPermiAnd([
'base:order-group:update',
'base:core-product:query',
'base:core-customer:query',
])
? {
type: 'edit',
btnName: '编辑',
showParam: {
type: '&',
data: [
{
type: 'unequal',
name: 'isEdit',
value: true,
},
],
},
}
: undefined,
this.$auth.hasPermiAnd([
'base:order-group:update',
'base:core-product:query',
'base:core-customer:query',
])
? {
type: 'save',
btnName: '保存',
showParam: {
type: '&',
data: [
{
type: 'equal',
name: 'isEdit',
value: true,
},
],
},
}
: undefined,
this.$auth.hasPermi('base:order-group:query')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
printData: {},
};
},
mounted() {
this.getLineList();
console.log(printTemplate);
console.log('================printTemplate');
},
methods: {
getLineList() {
getCorePLList().then((res) => {
this.formConfig[0].selectOptions = res.data;
});
},
getList() {
getPackingPage({ ...this.queryParams }).then((res) => {
this.list = res.data.records || [];
this.total = res.data.total;
});
},
//
changeChoose(val) {
this.chooseMsg = val;
},
buttonClick(val) {
this.queryParams.lineId = val.lineId;
this.queryParams.createTime = val.timeVal;
this.getList();
},
handleClick(val) {
console.log(val);
switch (val.type) {
case 'edit':
this.editNum(val.data);
break;
case 'save':
this.saveNum(val.data);
break;
case 'view':
this.preView();
break;
case 'print':
this.printTemp();
break;
default:
}
},
//
editNum(val) {
let obj = this.list[val._pageIndex - 1];
obj.isEdit = true;
this.$set(this.list, val._pageIndex - 1, obj);
},
//
saveNum(val) {
//
updatePacking({ id: val.id, num: val.num }).then(() => {
this.getList();
});
},
// num
inputChange(val) {
this.list[val._pageIndex - 1][val.prop] = val[val.prop];
},
//
preView() {
var hiprintTemplate = new hiprint.PrintTemplate({
template: printTemplate,
});
this.$refs.preView.show(hiprintTemplate);
},
//
printTemp() {
console.log('11');
var printData = {};
let hiprintTemplate = this.$print(
undefined,
printTemplate,
printData,
{},
{
styleHandler: () => {
let css =
'<link href="http://hiprint.io/Content/hiprint/css/print-lock.css" media="print" rel="stylesheet">';
return css;
},
}
);
console.log(hiprintTemplate);
},
},
};
</script>

View File

@ -0,0 +1,69 @@
<template>
<el-form
ref="unPrintEdit"
:rules="rules"
label-width="130px"
:model="form">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="成品周转编号"
prop="packagingCode">
<el-input
readonly
v-model="form.packagingCode"></el-input>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="片数"
prop="num">
<el-input-number
v-model="form.num"
:min="0"
:max="999999"
style="width: 100%"
label="片数"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
</template>
<script>
import { getPacking } from '@/api/base/packingInfo';
export default {
name: 'UnPrintEdit',
data() {
return {
form: {
id: '',
packagingCode: '',
num: null,
},
rules: {
num: [{ required: true, message: '片数不能为空', trigger: 'blur' }],
},
};
},
methods: {
init(id) {
console.log('init');
this.form.id = id;
getPacking(id).then((res) => {
console.log(res);
});
},
submitForm() {
this.$refs['unPrintEdit'].validate((valid) => {
if (valid) {
console.log('保存');
this.$emit('successSubmit');
}
});
},
formClear() {
this.$refs.unPrintEdit.resetFields();
},
},
};
</script>

View File

@ -0,0 +1,100 @@
<template>
<base-dialog
dialogTitle="预览"
:dialogVisible="visible"
width="50%"
@cancel="hideModal"
:before-close="hideModal">
<!-- <div>
<el-button
:loading="waitShowPrinter"
type="primary"
icon="printer"
@click.stop="print">
打印
</el-button>
<el-button
type="primary"
icon="printer"
@click.stop="toPdf">
pdf
</el-button>
</div> -->
<div id="preview_content" />
<template slot="footer">
<el-button
key="close"
@click="hideModal">
关闭
</el-button>
</template>
</base-dialog>
</template>
<script>
export default {
name: 'PrintPreview',
props: {},
data() {
return {
visible: false,
spinning: true,
waitShowPrinter: false,
// mm
width: 0,
//
hiprintTemplate: {},
//
printData: {},
};
},
computed: {},
watch: {},
created() {},
mounted() {},
methods: {
hideModal() {
this.visible = false;
},
show(hiprintTemplate, printData, width = '210') {
this.visible = true;
this.spinning = true;
this.width = width;
this.hiprintTemplate = hiprintTemplate;
this.printData = printData;
console.log(hiprintTemplate);
console.log(printData);
setTimeout(() => {
// eslint-disable-next-line no-undef
$('#preview_content').html(hiprintTemplate.getHtml(printData));
this.spinning = false;
}, 500);
},
print() {
this.waitShowPrinter = true;
this.hiprintTemplate.print(
this.printData,
{},
{
callback: () => {
console.log('callback');
this.waitShowPrinter = false;
},
}
);
},
toPdf() {
this.hiprintTemplate.toPdf({}, '打印预览');
},
},
};
</script>
<!-- <style lang="less" scoped>
/deep/ .ant-modal-body {
padding: 0px;
}
/deep/ .ant-modal-content {
margin-bottom: 24px;
}
</style> -->

View File

@ -0,0 +1,47 @@
<template>
<div class="packagingPrintLog-box">
<div style="width: 100%">
<ButtonNav
:menus="['未打印', '已打印']"
:button-mode="true"
@change="currentMenu"></ButtonNav>
</div>
<!-- 未打印 -->
<UnPrint v-if="activeMenu == '未打印'" />
<!-- 已打印 -->
<Printed v-else />
</div>
</template>
<script>
import ButtonNav from '@/components/ButtonNav';
import UnPrint from './components/UnPrint';
import Printed from './components/Printed';
export default {
name: 'packagingPrintLog',
components: { ButtonNav, UnPrint, Printed },
data() {
return {
activeMenu: '未打印',
};
},
methods: {
currentMenu(val) {
console.log(val);
this.activeMenu = val;
},
},
};
</script>
<style lang="scss" scoped>
.packagingPrintLog-box {
min-height: calc(100vh - 120px - 8px);
background-color: #f2f4f9;
.show-box {
min-height: calc(100vh - 128px - 52px);
margin-top: 8px;
padding: 16px;
border-radius: 8px;
background-color: #fff;
}
}
</style>

View File

@ -0,0 +1,554 @@
export default {
panels: [
{
index: 0,
name: 1,
height: 125,
width: 95,
paperHeader: 0,
paperFooter: 354.33070866141736,
printElements: [
{
options: {
left: 5,
top: 5,
height: 30,
width: 256.5,
right: 262.2421875,
bottom: 34.9921875,
vCenter: 133.9921875,
hCenter: 19.9921875,
coordinateSync: false,
widthHeightSync: false,
borderColor: 'green',
backgroundColor: 'green',
},
printElementType: { title: '矩形', type: 'rect' },
},
{
options: {
left: 35,
top: 15,
height: 20,
width: 195,
title: '厂内镀膜/钢化片周转标签',
coordinateSync: false,
widthHeightSync: false,
fontSize: 16.5,
color: '#ffffff',
qrCodeLevel: 0,
right: 232.9921875,
bottom: 35.24609375,
vCenter: 135.4921875,
hCenter: 25.24609375,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: { left: 50, top: 35, height: 52.5, width: 9 },
printElementType: { title: '竖线', type: 'vline' },
},
{
options: {
left: 5,
top: 35,
height: 309,
width: 256.5,
right: 261.4921875,
bottom: 343.9921875,
vCenter: 133.2421875,
hCenter: 189.4921875,
},
printElementType: { title: '矩形', type: 'rect' },
},
{
options: {
left: 10,
top: 42.5,
height: 18,
width: 36,
title: '线别',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 45.99609375,
bottom: 60.4921875,
vCenter: 27.99609375,
hCenter: 51.4921875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 55,
top: 42.5,
height: 18,
width: 200,
title: '判定:良品/保留/再检',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 93.4921875,
bottom: 59.25,
vCenter: 75.4921875,
hCenter: 50.25,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 62.5,
height: 9,
width: 256.5,
right: 259.9921875,
bottom: 72.4921875,
vCenter: 132.4921875,
hCenter: 67.9921875,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 55,
top: 70,
height: 18,
width: 46,
title: '备注:',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 91.2421875,
bottom: 86.25,
vCenter: 73.2421875,
hCenter: 77.25,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 190,
top: 87.5,
height: 169.5,
width: 9,
right: 199.74609375,
bottom: 255.75,
vCenter: 195.24609375,
hCenter: 171,
},
printElementType: { title: '竖线', type: 'vline' },
},
{
options: {
left: 5,
top: 87.5,
height: 9,
width: 256.5,
right: 260.7421875,
bottom: 96.75,
vCenter: 132.4921875,
hCenter: 92.25,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 77.5,
top: 90,
height: 15,
width: 36,
title: '规格',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 113.49609375,
bottom: 105.4921875,
vCenter: 95.49609375,
hCenter: 97.9921875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 207.5,
top: 100,
height: 18,
width: 36,
title: '用户',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 242.7421875,
bottom: 116.25,
vCenter: 224.7421875,
hCenter: 107.25,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 25,
top: 102.5,
height: 15,
width: 156,
title: '长*宽*厚度单位mm',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 179.25,
bottom: 117.4921875,
vCenter: 101.25,
hCenter: 109.9921875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 117.5,
height: 9,
width: 256.5,
right: 263.7421875,
bottom: 125.7421875,
vCenter: 135.4921875,
hCenter: 121.2421875,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 130,
top: 145,
height: 55.5,
width: 9,
right: 138.99609375,
bottom: 199.5,
vCenter: 134.49609375,
hCenter: 171.75,
},
printElementType: { title: '竖线', type: 'vline' },
},
{
options: {
left: 5,
top: 145,
height: 9,
width: 256.5,
right: 260.25,
bottom: 154.2421875,
vCenter: 132,
hCenter: 149.7421875,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 45,
top: 155,
height: 18,
width: 36,
title: '编号',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 82.2421875,
bottom: 171.75,
vCenter: 64.2421875,
hCenter: 162.75,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 135,
top: 155,
height: 18,
width: 49.5,
title: '工位号',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 186,
bottom: 172.9921875,
vCenter: 161.25,
hCenter: 163.9921875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 197.5,
top: 155,
height: 18,
width: 60,
title: '流程卡号',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 256.74609375,
bottom: 143.7421875,
vCenter: 226.74609375,
hCenter: 134.7421875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 175,
height: 9,
width: 256.5,
right: 259.2421875,
bottom: 183.75,
vCenter: 130.9921875,
hCenter: 179.25,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 50,
top: 200,
height: 58.5,
width: 9,
right: 58.9921875,
bottom: 259.5,
vCenter: 54.4921875,
hCenter: 230.25,
},
printElementType: { title: '竖线', type: 'vline' },
},
{
options: {
left: 110,
top: 200,
height: 58.5,
width: 9,
right: 117.75,
bottom: 256.9921875,
vCenter: 113.25,
hCenter: 227.7421875,
},
printElementType: { title: '竖线', type: 'vline' },
},
{
options: {
left: 5,
top: 200,
height: 9,
width: 256.5,
right: 262.9921875,
bottom: 210.24609375,
vCenter: 134.7421875,
hCenter: 205.74609375,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 10,
top: 210,
height: 18,
width: 36,
title: '日期',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 45.99609375,
bottom: 228,
vCenter: 27.99609375,
hCenter: 219,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 67.5,
top: 210,
height: 18,
width: 36,
title: '班次',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 103.5,
bottom: 228,
vCenter: 85.5,
hCenter: 219,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 207.5,
top: 210,
height: 18,
width: 36,
title: '片数',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 243.4921875,
bottom: 228,
vCenter: 225.4921875,
hCenter: 219,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 230,
height: 9,
width: 256.5,
right: 261.4921875,
bottom: 239.25,
vCenter: 133.2421875,
hCenter: 234.75,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 5,
top: 257.5,
height: 9,
width: 256.5,
right: 261.4921875,
bottom: 266.49609375,
vCenter: 133.2421875,
hCenter: 261.99609375,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 10,
top: 262.5,
height: 18,
width: 87,
title: '封箱人员工号:',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 46.9921875,
bottom: 279.24609375,
vCenter: 28.9921875,
hCenter: 270.24609375,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 280,
height: 9,
width: 256.5,
right: 262.2421875,
bottom: 289.2421875,
vCenter: 133.9921875,
hCenter: 284.7421875,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 10,
top: 285,
height: 18,
width: 87,
title: '打包人员工号:',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 96.4921875,
bottom: 301.74609375,
vCenter: 52.9921875,
hCenter: 292.74609375,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 300,
height: 9,
width: 256.5,
right: 264.4921875,
bottom: 308.49609375,
vCenter: 136.2421875,
hCenter: 303.99609375,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 10,
top: 305,
height: 18,
width: 247.5,
title: '备注1单层镀/双层镀/丝印打孔/打孔钢片',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 96.99609375,
bottom: 322.9921875,
vCenter: 53.49609375,
hCenter: 313.9921875,
},
printElementType: { title: '文本', type: 'text' },
},
{
options: {
left: 5,
top: 322.5,
height: 9,
width: 256.5,
right: 262.2421875,
bottom: 332.7421875,
vCenter: 133.9921875,
hCenter: 328.2421875,
},
printElementType: { title: '横线', type: 'hline' },
},
{
options: {
left: 10,
top: 327.5,
height: 18,
width: 87,
title: '备注2',
coordinateSync: false,
widthHeightSync: false,
fontSize: 12,
qrCodeLevel: 0,
right: 97.9921875,
bottom: 343.74609375,
vCenter: 54.4921875,
hCenter: 334.74609375,
},
printElementType: { title: '文本', type: 'text' },
},
],
paperNumberLeft: 372.5,
paperNumberTop: 337.5,
paperNumberContinue: true,
watermarkOptions: {},
},
]
}

View File

@ -6,138 +6,130 @@
* @Description:
-->
<template>
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="30%" show-close="true">
<small-title slot="title" :no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }}
</small-title>
<el-dialog
class="baseDialog"
:visible.sync="visible"
:show-close="true"
:wrapper-closable="false"
width="50%">
<small-title
slot="title"
:no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="100px"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="模板名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="请输入模板名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="标签类型" prop="typeId">
<el-select v-model="dataForm.typeId" style="width: 100%;" placeholder="请选择标签类型" clearable>
<el-option v-for="dict in typeList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="打印方式" prop="printModel">
<el-select v-model="dataForm.printModel" style="width: 100%;" placeholder="请选择打印方式" clearable>
<el-option v-for="dict in printModelList" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="标签备注" prop="remark">
<el-input v-model="dataForm.remark" clearable placeholder="请输入标签备注" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="模板设计" prop="content">
<el-button icon="el-icon-edit" @click="btnClickDesign()">模板设计</el-button>
</el-form-item>
</el-col>
<!-- <el-col :span="12">
<el-form-item label="单位平方数" prop="area">
<el-input v-model="dataForm.area" placeholder="请输入单位平方数" />
</el-form-item>
</el-col> -->
</el-row>
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="完成单位产品用时" prop="processTime">
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
</el-form-item>
</el-col>
</el-row> -->
</el-form>
<!-- <small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性列表
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="isdetail ? null : '添加属性'"
@emitButtonClick="addNew()"
:table-data="productAttributeList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div> -->
</div>
</div>
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="100px"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="模板名称"
prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="请输入模板名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="标签类型"
prop="typeId">
<el-select
v-model="dataForm.typeId"
style="width: 100%"
placeholder="请选择标签类型"
clearable>
<el-option
v-for="dict in typeList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="打印方式"
prop="printModel">
<el-select
v-model="dataForm.printModel"
style="width: 100%"
placeholder="请选择打印方式"
clearable>
<el-option
v-for="dict in printModelList"
:key="dict.id"
:label="dict.name"
:value="dict.id" />
</el-select>
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="标签备注"
prop="remark">
<el-input
v-model="dataForm.remark"
clearable
placeholder="请输入标签备注" />
</el-form-item>
</el-col>
</el-row>
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="模板设计"
prop="content">
<el-button
icon="el-icon-edit"
@click="btnClickDesign()">
模板设计
</el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<template slot="footer">
<el-button
style=""
@click="goback()">
取消
</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
<el-button
v-if="dataForm.id && !isdetail"
type="primary"
@click="addNew()">
添加属性
</el-button>
</span>
</div> -->
<template slot="footer">
<el-button style="" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</template>
<print-model-design v-if="modelShow" ref="printModelDesign" @saveData="getModelData" />
</el-dialog>
<el-button
type="primary"
@click="dataFormSubmit()">
确定
</el-button>
</template>
<print-model-design
v-if="modelShow"
ref="printModelDesign"
@saveData="getModelData" />
</el-dialog>
</template>
<script>
import {
createPackingModel,
updatePackingModel,
getPackingModel,
// getWorkOrderList,
// getCode,
// getCustomerList,
getTypeList
createPackingModel,
updatePackingModel,
getPackingModel,
getTypeList,
} from '@/api/base/printModel.js';
// import productAttrAdd from './attr-add';
import { parseTime } from '../mixins/code-filter';
import SmallTitle from './SmallTitle';
import printModelDesign from '../custom/index'
import printModelDesign from '../custom/index';
const tableBtn = [
{
@ -166,42 +158,42 @@ const tableProps = [
];
export default {
components: { SmallTitle, printModelDesign },
components: { SmallTitle, printModelDesign },
data() {
return {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
modelShow:false,
typeList:[],
tableProps,
modelShow: false,
typeList: [],
dataForm: {
id: null,
// name: '', //
name: '', //
name: '', //
// area: 0, // (float only)
typeId: null, // id
printModel: null, // (s)
content: '', //
remark: '', // id
},
printModelList: [
{
id: 1,
name:'自动'
},
{
id: 2,
name: '手动'
},
],
typeId: null, // id
printModel: null, // (s)
content: '', //
remark: '', // id
},
printModelList: [
{
id: 1,
name: '自动',
},
{
id: 2,
name: '手动',
},
],
listQuery: {
pageSize: 10,
pageNo: 1,
total: 0,
},
dataRule: {
typeId: [
typeId: [
{
required: true,
message: '打印类型不能为空',
@ -221,7 +213,7 @@ export default {
trigger: 'blur',
},
],
printModel: [
printModel: [
{
required: true,
message: '模板类型不能为空',
@ -229,11 +221,11 @@ export default {
},
],
content: [
{
required: true,
message: '模板不能为空',
trigger: 'blur',
},
{
required: true,
message: '模板不能为空',
trigger: 'blur',
},
],
processTime: [
{
@ -251,30 +243,30 @@ export default {
},
// isdetail: false,
};
},
methods: {
getModelData(data) {
console.log(data)
this.content = JSON.stringify(data)
this.dataForm.content = JSON.stringify(data)
},
btnClickDesign() {
console.log(11111)
this.modelShow = true
this.$nextTick(() => {
this.$refs.printModelDesign.init(this.dataForm.content)
console.log(this.dataForm.content)
})
// this.$router.push({
// path: '/printModelDesign'
// })
},
},
methods: {
getModelData(data) {
console.log(data);
this.content = JSON.stringify(data);
this.dataForm.content = JSON.stringify(data);
},
btnClickDesign() {
console.log(11111);
this.modelShow = true;
this.$nextTick(() => {
this.$refs.printModelDesign.init(this.dataForm.content);
console.log(this.dataForm.content);
});
// this.$router.push({
// path: '/printModelDesign'
// })
},
// initData() {
// this.productAttributeList.splice(0);
// this.listQuery.total = 0;
// },
init(id) {
this.getDict()
init(id) {
this.getDict();
// this.initData();
// this.isdetail = isdetail || false;
this.dataForm.id = id || null;
@ -284,34 +276,34 @@ export default {
this.$refs['dataForm'].resetFields();
if (this.dataForm.id) {
//
getPackingModel(id).then((response) => {
getPackingModel(id).then((response) => {
this.dataForm = response.data;
});
//
// this.getList();
} else {
// getCode().then((res) => {
// this.dataForm.packagingCode = res.data;
// this.dataForm.packagingCode = res.data;
// });
}
});
},
getDict() {
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
getTypeList().then((response) => {
console.log(response);
this.typeList = response.data
// this.listQuery.total = response.data.total;
})
// getWorkOrderList().then((response) => {
// // console.log(response);
// this.workOrderList = response.data
//
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
getTypeList().then((response) => {
console.log(response);
this.typeList = response.data;
// this.listQuery.total = response.data.total;
});
// getWorkOrderList().then((response) => {
// // console.log(response);
// this.workOrderList = response.data
// // this.listQuery.total = response.data.total;
// })
},
@ -353,7 +345,7 @@ export default {
if (valid) {
//
if (this.dataForm.id) {
updatePackingModel(this.dataForm).then((response) => {
updatePackingModel(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
@ -361,7 +353,7 @@ export default {
return;
}
//
createPackingModel(this.dataForm).then((response) => {
createPackingModel(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
@ -439,35 +431,31 @@ export default {
}
</style> -->
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
.baseDialog .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
padding-left: 24px;
padding-right: 24px;
}
.baseDialog .btnTextStyle {
letter-spacing:6px;
padding: 9px 10px 9px 16px;
font-size: 14px;
letter-spacing: 6px;
padding: 9px 10px 9px 16px;
font-size: 14px;
}
</style>

View File

@ -6,106 +6,72 @@
* @Description:
-->
<template>
<el-dialog class="baseDialog" :visible.sync="visible" :show-close="false" :wrapper-closable="false" width="40%" show-close="true">
<small-title slot="title" :no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }}
</small-title>
<el-dialog
class="baseDialog"
:visible.sync="visible"
:show-close="true"
:wrapper-closable="false"
width="50%">
<small-title
slot="title"
:no-padding="true">
{{ !dataForm.id ? '新增' : '编辑' }}
</small-title>
<div class="content">
<div class="visual-part">
<el-form ref="dataForm" :model="dataForm" :rules="dataRule" label-width="auto"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="12">
<el-form-item label="名称" prop="name">
<el-input v-model="dataForm.name" clearable placeholder="名称" />
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="类型描述" prop="description">
<el-input v-model="dataForm.description" clearable placeholder="类型描述" />
</el-form-item>
</el-col>
</el-row>
<!-- <el-row :gutter="20">
<el-col :span="24">
<el-form-item label="完成单位产品用时" prop="processTime">
<el-input v-model="dataForm.processTime" placeholder="请输入完成单位产品用时" />
</el-form-item>
</el-col>
</el-row> -->
</el-form>
<!-- <small-title
style="margin: 16px 0; padding-left: 8px"
:no-padding="true">
产品属性列表
</small-title>
<div class="attr-list">
<base-table
:table-props="tableProps"
:page="listQuery.pageNo"
:limit="listQuery.pageSize"
:add-button-show="isdetail ? null : '添加属性'"
@emitButtonClick="addNew()"
:table-data="productAttributeList">
<method-btn
v-if="!isdetail"
slot="handleBtn"
:width="120"
label="操作"
:method-list="tableBtn"
@clickBtn="handleClick" />
</base-table>
<pagination
v-show="listQuery.total > 0"
:total="listQuery.total"
:page.sync="listQuery.pageNo"
:limit.sync="listQuery.pageSize"
:page-sizes="[5, 10, 15]"
@pagination="getList" />
</div> -->
</div>
</div>
<!-- <div style="position: absolute; bottom: 24px; right: 24px">
<el-button style="margin-right: 10px" @click="goback()">返回</el-button>
<el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
<div class="content">
<div class="visual-part">
<el-form
ref="dataForm"
:model="dataForm"
:rules="dataRule"
label-width="auto"
@keyup.enter.native="dataFormSubmit">
<el-row :gutter="20">
<el-col :span="24">
<el-form-item
label="名称"
prop="name">
<el-input
v-model="dataForm.name"
clearable
placeholder="名称" />
</el-form-item>
</el-col>
<el-col :span="24">
<el-form-item
label="类型描述"
prop="description">
<el-input
v-model="dataForm.description"
clearable
placeholder="类型描述" />
</el-form-item>
</el-col>
</el-row>
</el-form>
</div>
</div>
<template slot="footer">
<el-button
style=""
@click="goback()">
取消
</el-button>
<span v-if="!isdetail">
<el-button type="primary" @click="dataFormSubmit()">保存</el-button>
<el-button
v-if="dataForm.id && !isdetail"
type="primary"
@click="addNew()">
添加属性
</el-button>
</span>
</div> -->
<template slot="footer">
<el-button style="" @click="goback()">取消</el-button>
<!-- <el-button v-if="isdetail" type="primary" @click="goEdit()">
编辑
</el-button> -->
<el-button type="primary" @click="dataFormSubmit()">确定</el-button>
</template>
</el-dialog>
<el-button
type="primary"
@click="dataFormSubmit()">
确定
</el-button>
</template>
</el-dialog>
</template>
<script>
import {
createPackingType,
updatePackingType,
getPackingType,
// getWorkOrderList,
// getCode,
// getCustomerList,
// getModelList
createPackingType,
updatePackingType,
getPackingType,
} from '@/api/base/modelType.js';
// import productAttrAdd from './attr-add';
import { parseTime } from '../mixins/code-filter';
import SmallTitle from './SmallTitle';
@ -142,20 +108,15 @@ export default {
visible: false,
addOrUpdateVisible: false,
tableBtn,
tableProps,
customerList: [],
modelList:[],
workOrderList:[],
tableProps,
customerList: [],
modelList: [],
workOrderList: [],
productAttributeList: [],
dataForm: {
id: null,
// name: '', //
name: '', //
// area: 0, // (float only)
description: null, // id
// workOrderId: null, // (s)
// customerId: '', //
// content: '', // id
name: '', //
description: null, // id
},
listQuery: {
pageSize: 10,
@ -171,18 +132,10 @@ export default {
},
],
},
// isdetail: false,
};
},
},
methods: {
// initData() {
// this.productAttributeList.splice(0);
// this.listQuery.total = 0;
// },
init(id) {
// this.getDict()
// this.initData();
// this.isdetail = isdetail || false;
init(id) {
this.dataForm.id = id || null;
this.visible = true;
@ -191,76 +144,20 @@ export default {
if (this.dataForm.id) {
//
getPackingType(id).then((response) => {
getPackingType(id).then((response) => {
this.dataForm = response.data;
});
//
// this.getList();
} else {
// getCode().then((res) => {
// this.dataForm.packagingCode = res.data;
// });
}
});
},
// getDict() {
// //
// getCustomerList().then((response) => {
// console.log(response);
// this.customerList = response.data
// // this.listQuery.total = response.data.total;
// })
// getModelList().then((response) => {
// console.log(response);
// this.modelList = response.data
// // this.listQuery.total = response.data.total;
// })
// getWorkOrderList().then((response) => {
// // console.log(response);
// this.workOrderList = response.data
// // this.listQuery.total = response.data.total;
// })
// },
// handleClick(raw) {
// if (raw.type === 'delete') {
// this.$confirm(
// `${
// raw.data.name
// ? '[=' + raw.data.name + ']'
// : '[=' + raw.data._pageIndex + ']'
// }?`,
// '',
// {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning',
// }
// )
// .then(() => {
// deleteProductAttr(raw.data.id).then(({ data }) => {
// this.$message({
// message: '',
// type: 'success',
// duration: 1500,
// onClose: () => {
// this.getList();
// },
// });
// });
// })
// .catch(() => {});
// } else {
// this.addNew(raw.data.id);
// }
// },
//
dataFormSubmit() {
this.$refs['dataForm'].validate((valid) => {
if (valid) {
//
if (this.dataForm.id) {
updatePackingType(this.dataForm).then((response) => {
updatePackingType(this.dataForm).then((response) => {
this.$modal.msgSuccess('修改成功');
this.visible = false;
this.$emit('refreshDataList');
@ -268,7 +165,7 @@ export default {
return;
}
//
createPackingType(this.dataForm).then((response) => {
createPackingType(this.dataForm).then((response) => {
this.$modal.msgSuccess('新增成功');
this.visible = false;
this.$emit('refreshDataList');
@ -294,88 +191,32 @@ export default {
},
};
</script>
<!-- <style scoped>
.drawer >>> .el-drawer {
border-radius: 8px 0 0 8px;
display: flex;
flex-direction: column;
}
.drawer >>> .el-form-item__label {
padding: 0;
}
.drawer >>> .el-drawer__header {
margin: 0;
padding: 32px 32px 24px;
border-bottom: 1px solid #dcdfe6;
}
.drawer >>> .el-drawer__body {
flex: 1;
height: 1px;
display: flex;
flex-direction: column;
}
.drawer >>> .content {
padding: 30px 24px;
flex: 1;
display: flex;
flex-direction: column;
/* height: 100%; */
}
.drawer >>> .visual-part {
flex: 1 auto;
max-height: 76vh;
overflow: hidden;
overflow-y: scroll;
padding-right: 10px; /* 调整滚动条样式 */
}
.drawer >>> .el-form,
.drawer >>> .attr-list {
padding: 0 16px;
}
.drawer-body__footer {
display: flex;
justify-content: flex-end;
padding: 18px;
}
</style> -->
<style>
.baseDialog .el-dialog__header {
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
font-size: 16px;
color: rgba(0, 0, 0, 0.85);
font-weight: 500;
padding: 13px 24px;
border-bottom: 1px solid #e9e9e9;
}
.baseDialog .el-dialog__header .titleStyle::before{
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0B58FF;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
.baseDialog .el-dialog__header .titleStyle::before {
content: '';
display: inline-block;
width: 4px;
height: 16px;
background-color: #0b58ff;
border-radius: 1px;
margin-right: 8px;
position: relative;
top: 2px;
}
.baseDialog .el-dialog__body {
padding-left: 24px;
padding-right: 24px;
padding-left: 24px;
padding-right: 24px;
}
.baseDialog .btnTextStyle {
letter-spacing:6px;
padding: 9px 10px 9px 16px;
font-size: 14px;
letter-spacing: 6px;
padding: 9px 10px 9px 16px;
font-size: 14px;
}
</style>

View File

@ -1,138 +1,131 @@
<template>
<div
id="analysischartLine"
style="width: 100%"
:style="{ height: chartHeight + 'px' }"
></div>
<div
id="analysischartLine"
style="width: 100%"
:style="{ height: chartHeight + 'px' }"></div>
</template>
<script>
import * as echarts from 'echarts'
import resize from '@/utils/chartMixins/resize'
import * as echarts from 'echarts';
import resize from '@/utils/chartMixins/resize';
export default {
name: "LineChart",
mixins: [resize],
data() {
return {
chartDom: '',
chart: '',
chartHeight: this.tableHeight(370)
}
},
props: {
chartData: {
type: Array,
required: true,
default: () => {
return []
}
}
},
watch: {
chartData: function () {
this.getChart()
}
},
mounted() {
window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(370)
})
},
methods: {
getChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // Dom
}
this.chartDom = document.getElementById('analysischartLine')
this.chart = echarts.init(this.chartDom)
if (this.chartData.length === 0) {
return false
}
let arr = this.chartData[0].type // []
let keys = Object.keys(this.chartData[0])
let yData = [
{
name: '本期',
type: 'bar',
data: [],
barWidth: 20,
label: {
show: true,
position: 'top'
}
},
{
name: '上期',
type: 'bar',
data: [],
barWidth: 20,
label: {
show: true,
position: 'top'
}
}
]
for (let j = 0; j < arr.length; j++) {
for (let k = 0; k < keys.length; k++) {
if (keys[k].indexOf(arr[j]+'_上期') > -1) {
yData[1].data.push(this.chartData[0][keys[k]])
}
if (keys[k].indexOf(arr[j]+'_能源消耗') > -1) {
yData[0].data.push(this.chartData[0][keys[k]])
}
}
}
var option = {
color:['#288AFF','#8EF0AB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow'
},
formatter: function(params) {
return (
params[0].axisValue +
`<br>` +
params.map((item) => {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${item.color};"></span>`
let seriesNameStr = `<span style="display:inline-block;">${item.seriesName}</span>`
let value = item.value ? item.value : '-'
let valueStr = `<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${value}</span>`
return `<span style="display:flex; justify-content:space-between; margin-bottom: 2px">
name: 'LineChart',
mixins: [resize],
data() {
return {
chartDom: '',
chart: '',
chartHeight: this.tableHeight(370),
};
},
props: {
chartData: {
type: Array,
required: true,
default: () => {
return [];
},
},
},
watch: {
chartData: function () {
this.getChart();
},
},
mounted() {
window.addEventListener('resize', () => {
this.chartHeight = this.tableHeight(370);
});
},
methods: {
getChart() {
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose(); // Dom
}
this.chartDom = document.getElementById('analysischartLine');
this.chart = echarts.init(this.chartDom);
if (this.chartData.length === 0) {
return false;
}
let arr = this.chartData[0].type; // []
let keys = Object.keys(this.chartData[0]);
let yData = [
{
name: '本期',
type: 'bar',
data: [],
barWidth: 20,
},
{
name: '上期',
type: 'bar',
data: [],
barWidth: 20,
},
];
for (let j = 0; j < arr.length; j++) {
for (let k = 0; k < keys.length; k++) {
if (keys[k].indexOf(arr[j] + '_上期') > -1) {
yData[1].data.push(this.chartData[0][keys[k]]);
}
if (keys[k].indexOf(arr[j] + '_能源消耗') > -1) {
yData[0].data.push(this.chartData[0][keys[k]]);
}
}
}
var option = {
color: ['#288AFF', '#8EF0AB'],
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
},
formatter: function (params) {
return (
params[0].axisValue +
`<br>` +
params
.map((item) => {
let str = `<span style="display:inline-block;width:8px;height:8px;margin: 0 8px 0 -3px;border-radius:2px;background-color:${item.color};"></span>`;
let seriesNameStr = `<span style="display:inline-block;">${item.seriesName}</span>`;
let value = item.value ? item.value : '-';
let valueStr = `<span style="display:inline-block;margin-left:10px;color:rgba(0,0,0,0.45);">${value}</span>`;
return `<span style="display:flex; justify-content:space-between; margin-bottom: 2px">
<span>${str}${seriesNameStr}</span>
<span>${valueStr}</span>
</span>`
}).join(``)
)
}
},
legend: {
right: '1%',
icon: 'rect',
itemHeight: 8,
itemWidth: 8
},
grid: {
left: '1%',
right: '1%',
bottom: '3%',
containLabel: true
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01]
},
xAxis: {
type: 'category',
data: arr
},
series: yData
}
option && this.chart.setOption(option);
}
}
}
</script>
</span>`;
})
.join(``)
);
},
},
legend: {
right: '1%',
icon: 'rect',
itemHeight: 8,
itemWidth: 8,
},
grid: {
left: '1%',
right: '1%',
bottom: '3%',
containLabel: true,
},
yAxis: {
type: 'value',
boundaryGap: [0, 0.01],
},
xAxis: {
type: 'category',
data: arr,
},
series: yData,
};
option && this.chart.setOption(option);
},
},
};
</script>

View File

@ -57,10 +57,14 @@ export default {
let listObj = { useNum: '消耗量' }; //
for (let i = 0; i < arr.length; i++) {
let obj = {};
let fName = arr[i].time.slice(0, 4);
let lName = arr[i].time.slice(4, 6);
if (this.timeDim === '3') {
let fName = arr[i].time.slice(0, 4);
let lName = arr[i].time.slice(4, 6);
obj.label = fName + ' 第 ' + lName + ' 周';
} else {
obj.label = arr[i].time;
}
obj.prop = arr[i].time;
obj.label = fName + ' 第 ' + lName + ' 周';
obj.minWidth = 100;
tempX.push(obj);
listObj[arr[i].time] = arr[i].useNum || null;
@ -70,37 +74,20 @@ export default {
},
// excel
exportExl(params) {
exportTrend({ ...params }).then((res) => {
// let fileName = '';
// const contentDisposition = res.headers['content-disposition'];
// if (contentDisposition) {
// fileName = decodeURIComponent(
// contentDisposition.slice(
// contentDisposition.indexOf('filename=') + 9
// )
// );
// }
const blob = new Blob([res.data]);
const reader = new FileReader();
reader.readAsDataURL(blob);
reader.onload = (e) => {
const a = document.createElement('a');
a.download = '走势分析';
a.href = e.target.result;
document.body.appendChild(a);
a.click();
document.body.removeChild(a);
exportTrend({ ...params })
.then((response) => {
this.$download.excel(response, '走势分析.xls');
this.$message.success('导出成功');
};
});
})
.catch(() => {});
},
},
};
</script>
<style lang='scss'>
<style lang="scss">
.trendAnalysisBox {
.trend-out-table {
margin-bottom: 15px;
}
}
</style>
</style>

View File

@ -116,7 +116,7 @@ export default {
},
selectObj(val) {
this.form.bindObjectId = val[val.length - 1];
this.form.bindObjectType = val.length - 1;
this.form.bindObjectType = val.length;
},
submitForm() {
this.$refs['form'].validate((valid) => {
@ -152,4 +152,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -216,10 +216,10 @@ export default {
getEnergyLimit(id).then((res) => {
if (res.code === 0) {
this.form = res.data;
this.form.plcParamId = res.data.plcParamId || '';
this.form.tableName = this.form.tableName
? this.form.tableName + ''
: '';
this.form.plcParamId = res.data.plcParamId || '';
this.form.method = this.form.method ? this.form.method + '' : '';
this.form.limitType = this.form.limitType
? this.form.limitType + ''
@ -231,6 +231,9 @@ export default {
if (this.form.type === 2) {
this.getDetailList();
}
if (this.form.energyTypeId) {
this.getTableNameList(this.form.energyTypeId);
}
}
});
} else {

View File

@ -266,8 +266,9 @@ export default {
},
/** 删除按钮操作 */
handleDelete(row) {
console.log(row);
this.$modal
.confirm('是否确认删除监控对象为"' + row.objName + '"的数据项?')
.confirm('是否确认删除第"' + row._pageIndex + '"条数据项?')
.then(function () {
return deleteEnergyLimit(row.id);
})

View File

@ -103,6 +103,7 @@ export default {
name: 'search',
color: 'primary',
},
{
type: this.$auth.hasPermi('monitoring:energy-statistics:create')
? 'separate'

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-25 15:44:49
* @LastEditTime: 2024-04-22 15:04:40
* @Description:
-->
<template>
@ -165,7 +165,7 @@ import SmallTitle from './SmallTitle';
import { parseTime } from '@/utils/ruoyi';
import attrAdd from './attr-add';
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 { getDictDataLabel } from '@/utils/dict';
@ -289,7 +289,7 @@ export default {
return item
}) || [];
//
const res1 = await getCoreDepartmentList();
const res1 = await getDepartmentList();
this.departmentOptions = res1.data || []
//
let inspectorList = [];

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-15 18:38:52
* @LastEditTime: 2024-04-22 14:56:03
* @Description:
-->
<template>
@ -99,7 +99,7 @@ import {
createCheckOrder,
updateCheckOrder,
} 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 { getDictDataLabel } from '@/utils/dict';
// import { getEquipmentAll } from '@/api/base/equipment'
@ -195,7 +195,7 @@ export default {
},
async getDict() {
//
const res = await getCoreDepartmentList();
const res = await getDepartmentList();
this.departmentOptions = res.data || [];
const res1 = await groupClassesListAll();
this.groupOptions =

View File

@ -320,7 +320,7 @@ export default {
async getList(source = 'department') {
const urls = [
'/base/core-production-line/listAll',
'/base/core-department/listAll',
'/system/dept/list-all-simple',
'/base/core-worker/listAll',
];
let res;

View File

@ -540,7 +540,7 @@ export default {
async getList(source = 'department') {
const urls = [
'/base/core-production-line/listAll',
'/base/core-department/listAll',
'system/dept/list-all-simple',
'/base/core-worker/listAll',
];
let res;

View File

@ -609,7 +609,7 @@ export default {
async getList(source = 'department') {
const urls = [
'/base/core-production-line/listAll',
'/base/core-department/listAll',
'/system/dept/list-all-simple',
'/base/core-worker/listAll',
];
let res;

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: DY
* @LastEditTime: 2024-03-13 15:55:36
* @LastEditTime: 2024-04-19 17:13:45
* @Description:
-->
<template>
@ -114,7 +114,7 @@
import basicAdd from '../../../../core/mixins/basic-add';
// import { getCoreProductAttrPage, deleteCoreProductAttr } from "@/api/base/coreProduct";
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 { getCorePLList } from '@/api/base/coreProductionLine';
import { parseTime } from '../../../../core/mixins/code-filter';
@ -175,7 +175,7 @@ export default {
async getDict() {
//
this.menuOptions = []
const res = await getCoreDepartmentList();
const res = await getDepartmentList();
this.departmentlList = res.data.map(item => {
item.parentId = item.parentId ? item.parentId : 0
return item

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zhp
* @LastEditTime: 2024-04-11 13:35:46
* @LastEditTime: 2024-04-12 14:26:22
* @Description:
-->
<template>
@ -100,20 +100,6 @@ import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
import { publicFormatter } from '@/utils/dict';
const tableBtn = [
{
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:update')
? 'edit'
: '',
btnName: '编辑',
},
{
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:delete')
? 'delete'
: '',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'materialName',
@ -137,22 +123,36 @@ const tableProps = [
label: '备注',
},
];
const topBtnConfig = [
{
type: 'add',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableBtn:[
{
type: this.$auth.hasPermi(
'extend:process-equ-material-bom-det:query'
)
? 'edit'
: '',
btnName: '编辑',
},
{
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:delete')
? 'delete'
: '',
btnName: '删除',
},
],
tableProps,
topBtnConfig,
topBtnConfig:[
{
type: this.$auth.hasPermi('extend:process-equ-material-bom-det:add')
? 'add'
: '',
btnName: 'btn.add'
}
],
addOrUpdateVisible: false,
urlOptions: {
isGetCode: false,

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2021-11-18 14:16:25
* @LastEditors: zhp
* @LastEditTime: 2024-04-11 13:35:42
* @LastEditTime: 2024-04-12 14:28:44
* @Description:
-->
<template>
@ -110,20 +110,6 @@ import { parseTime } from '../../core/mixins/code-filter';
import attrAdd from './attr-add';
// import {DICT_TYPE, getDictDatas} from "@/utils/dict";
const tableBtn = [
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:update')
? 'edit'
: '',
btnName: '编辑',
},
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:delete')
? 'delete'
: '',
btnName: '删除',
},
];
const tableProps = [
{
prop: 'valueName',
@ -157,25 +143,35 @@ const tableProps = [
prop: 'remark',
label: '备注',
},
];
const topBtnConfig = [
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:add')
? 'add'
: '',
btnName: 'btn.add'
}
]
export default {
mixins: [basicAdd],
components: { SmallTitle, attrAdd },
data() {
return {
tableBtn,
tableBtn:[
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:update')
? 'edit'
: '',
btnName: '编辑',
},
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:delete')
? 'delete'
: '',
btnName: '删除',
},
],
tableProps,
topBtnConfig,
topBtnConfig:[
{
type: this.$auth.hasPermi('extend:process-equ-value-bom-det:add')
? 'add'
: '',
btnName: 'btn.add'
}
],
addOrUpdateVisible: false,
enableList: [
{

View File

@ -280,7 +280,7 @@ export default {
},
}
: undefined,
this.$auth.hasPermi('base:order-group:update')
this.$auth.hasPermi('base:order-group:query')
? {
type: 'detail',
btnName: '详情',
@ -483,4 +483,4 @@ export default {
},
},
};
</script>
</script>

View File

@ -25,6 +25,14 @@
</el-select>
</el-form-item>
</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-form-item label="检测内容" prop="inspectionDetIdList"
:rules="[{ required: true, message: '不能为空', trigger: 'change' }]">
@ -109,6 +117,7 @@ export default {
sectionId: null,
productionLineId: null,
inspectionDetIdList:[],
resetMethod: 0
},
disabled:false,
formLoading: true,
@ -143,7 +152,7 @@ export default {
methods: {
init(obj) {
// console.log(productionLineId);
console.log(obj)
console.log('你好打印', obj)
this.getProductionLineList()
this.getQualityInspectionDetList()
this.visible = true
@ -162,6 +171,7 @@ export default {
console.log(res);
this.dataForm.inspectionDetIdList = res.data
this.dataForm.productionLineId = obj.productionLineId
this.dataForm.resetMethod = obj.resetMethod
this.getWorksectionList(obj.productionLineId)
this.dataForm.sectionId = obj.sectionId
})

View File

@ -151,7 +151,8 @@ export default {
productionLineId:item.productionLineId,
productionLineName:item.productionLineName,
sectionId: item.sectionId,
sectionName: item.sectionName
sectionName: item.sectionName,
resetMethod: item.resetMethod
}
})
this.listQuery.total = response.data.total;

View File

@ -103,7 +103,6 @@ export default {
: undefined,
].filter((v) => v),
tableData: [],
tableProps: [
// {
// prop: 'createTime',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-04-10 16:31:48
* @LastEditTime: 2024-04-12 14:12:55
* @Description:
-->
<template>
@ -131,7 +131,7 @@ export default {
width: 250
},
{
type: this.$auth.hasPermi('monitoring:materiel-date-from:query') ? 'button' : '',
type: this.$auth.hasPermi('base:material-use-log:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',
@ -163,13 +163,13 @@ export default {
// },
{
type: this.$auth.hasPermi(
'monitoring:materiel-date-from:export'
'base:material-use-log:export'
)
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('monitoring:materiel-date-from:export') ? 'button' : '',
type: this.$auth.hasPermi('base:material-use-log:export') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'primary',

View File

@ -2,7 +2,7 @@
* @Author: zwq
* @Date: 2023-08-01 14:55:51
* @LastEditors: zhp
* @LastEditTime: 2024-04-07 16:26:56
* @LastEditTime: 2024-04-12 14:16:03
* @Description:
-->
<template>
@ -96,11 +96,14 @@ export default {
// btnName: '',
// }
// : undefined,
{
type: 'processDetail',
{
type: this.$auth.hasPermi(
'extend:process-retrospect:query'
)
? 'button'
: '',
btnName: '查看工艺详情',
},
].filter((v) => v),
list: [],
listQuery: {
@ -137,7 +140,7 @@ export default {
{
type: this.$auth.hasPermi(
'monitoring:process-traceability:query'
'extend:process-retrospect:query'
)
? 'button'
: '',

View File

@ -0,0 +1,237 @@
<!--
* @Author: zhp
* @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-04-18 16:49:31
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<div>
<!-- <el-alert title="自定义 close-text" type="warning" close-text="知道了">
</el-alert> -->
<el-form :model="listQuery" :inline="true" ref="dataForm" class="blueTip">
<el-form-item label="日" prop="time">
<el-date-picker v-model="listQuery.time" value-format="timestamp" type="datetime"
placeholder="选择日期">
</el-date-picker>
</el-form-item>
<el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:query')" type="primary" size="small"
@click="getDataList">查询</el-button>
<el-button v-if="this.$auth.hasPermi('base:report-auto-original-glass:export')" type="primary" size="small"
plain @click="handleExport">导出</el-button>
</el-form-item>
</el-form>
</div>
<inputTable :date="date" :data="tableData" :time="[startTimeStamp]" :sum="all" :type="listQuery.reportType"
@refreshDataList="getDataList" />
<!-- <pagination
:limit.sync="listQuery.pageSize"
:page.sync="listQuery.pageNo"
:total="listQuery.total"
@pagination="getDataList" /> -->
</div>
</template>
<script>
// import { parseTime } from '../../core/mixins/code-filter';
import { getAutoDailyData } from '@/api/report/qcReport';
import inputTable from './inputTable.vue';
// import { getCorePLList } from '@/api/base/coreProductionLine';
import moment from 'moment'
import FileSaver from 'file-saver'
// import * as XLSX from 'xlsx'
export default {
components: { inputTable },
data() {
return {
urlOptions: {
getDataListURL: getAutoDailyData,
// exportURL: exportGlasscExcel
},
listQuery: {
// pageSize: 10,
// pageNo: 1,
// total: 0,
// reportType: 2,
time: ''
},
date: '许昌安彩新能科技有限公司2024年4月份生产日报',
time: '',
startTimeStamp: '',
endTimeStamp: '',
tableData: [],
proLineList: [],
all: {}
};
},
created() {
// this.getDict()
this.getTodayStartTimeAndEndTime()
this.getDataList()
},
methods: {
getTodayStartTimeAndEndTime() {
this.listQuery.time = new Date()
// this.changeTime(this.time)
},
async getDict() {
// 线
// const res = await getCorePLList();
// this.proLineList = res.data;
},
//
multipliedByHundred(str) {
console.log(str);
// console.log(str)
if (str != 0) {
let floatVal = parseFloat(str);
if (isNaN(floatVal)) {
return 0;
}
floatVal = Math.round(str * 10000) / 100;
let strVal = floatVal.toString();
let searchVal = strVal.indexOf('.');
if (searchVal < 0) {
searchVal = strVal.length;
strVal += '.';
}
while (strVal.length <= searchVal + 2) {
strVal += '0';
}
return parseFloat(strVal);
}
},
async getDataList() {
// const res = await getCorePLList()
// this.proLineList = res.data;
this.dataListLoading = true
if (this.listQuery.time.length == 0) {
this.$message({
message: '请选择时间',
type: 'warning'
})
return false
}
await this.urlOptions.getDataListURL(this.listQuery).then(res => {
console.log(res.data.datas);
let arr = res.data.datas
let obj = res.data.reportAutoYdailyRespVO
obj.lineName = '合计'
arr.push(obj)
// this.tableData.push(res.data.reportAutoYdailyRespVO)
this.tableData = arr
this.listQuery.total = res.data.length;
this.dataListLoading = false;
});
},
add0(m) {
return m < 10 ? '0' + m : m
},
format(shijianchuo) {
//shijianchuoparseInt
var time = moment(new Date(shijianchuo)).format('YYYY-MM-DD HH:mm:ss')
// console.log(time)
// var y = time.getFullYear();
// var m = time.getMonth() + 1;
// var d = time.getDate();
// var h = time.getHours();
// var mm = time.getMinutes();
// var s = time.getSeconds();
return time
},
// changeTime(val) {
// if (val) {
// // console.log(val)
// // console.log(val.setHours(7, 0, 0))
// // console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// // let time = this.format(val.setHours(7, 0, 0))
// // this.startTimeStamp = this.format(val.setHours(0, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
// // this.startTimeStamp = this.format(val.setHours(7, 0, 0) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// // console.log(this.listQuery.reportTime);
// this.listQuery.time = this.format(val.setHours(0, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
// // this.listQuery.time[0] = this.format(val.setHours(7, 0, 0) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// // console.log(this.listQuery.reportTime);
// } else {
// this.listQuery.time = ''
// }
// },
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
buttonClick(val) {
this.listQuery.time = val.time ? val.time : undefined;
switch (val.btnName) {
case 'search':
this.listQuery.pageNo = 1;
this.listQuery.pageSize = 10;
this.getDataList();
break;
case 'export':
this.handleExport();
break;
default:
console.log(val);
}
},
/** 导出按钮操作 */
handleExport() {
//
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......
})
},
},
};
</script>
<style scoped>
/* .blueTip { */
/* padding-bottom: 10px; */
/* } */
.blueTip::before {
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
}
</style>

View File

@ -0,0 +1,273 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 15:49:48
* @LastEditTime: 2024-04-18 16:30:42
* @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 :id="id" :data="data" border style="width: 100%">
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
:align="item.align ? item.align : 'left'">
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
:align="item.align ? item.align : 'left'">
<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>
<!-- <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: 'm',
label: '尺寸(长、宽、厚)毫米',
align: 'center',
children: [
{
prop: 'length',
label: '长',
},
{
prop: 'width',
label: '宽',
},
{
prop: 'thick',
label: '高',
}
]
},
{
prop: 'm',
label: '良品数',
align: 'center',
children: [
{
prop: 'earlyNum',
label: '早班',
},
{
prop: 'nightNum',
label: '晚班',
},
{
prop: 'num',
label: '合计',
}
]
},
{
prop: 'weight',
label: '良品重量(吨)',
},
{
prop: 'y',
label: '良品玻璃面积(㎡)',
align: 'center',
children: [
{
prop: 'earlyArea',
label: '早班',
},
{
prop: 'nightArea',
label: '晚班',
},
{
prop: 'area',
label: '合计',
}
]
},
{
prop: 'y',
label: '原片良品率',
align: 'center',
children: [
{
prop: 'earlyRate',
label: '早班',
},
{
prop: 'nightRate',
label: '晚班',
},
{
prop: 'rate',
label: '合计',
}
]
},
{
prop: 'monthArea',
label: '月累计面积',
},
{
prop: 'remark',
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: {
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>

View File

@ -0,0 +1,220 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 16:32:03
* @LastEditTime: 2024-04-18 16:34:49
* @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 :id="id" :data="data" border style="width: 100%">
<el-table-column v-for="(item, index) in cols" :key="index" :prop="item.prop" :label="item.label"
:align="item.align ? item.align : 'left'">
<el-table-column v-for="(it, index1) in item.children" :key="index1" :prop="it.prop" :label="it.label"
:align="item.align ? item.align : 'left'">
<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>
<!-- <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: '拉引速度(米/分)',
label: '班次',
},
{
prop: 'width2',
label: '板宽mm',
},
{
prop: 'weight2',
label: '板重(g)',
},
{
prop: 'lineName',
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: {
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>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2024-01-24 15:15:24
* @LastEditTime: 2024-04-08 11:47:39
* @LastEditTime: 2024-04-12 15:13:43
* @LastEditors: zhp
* @Description:
-->
@ -184,8 +184,8 @@ export default {
// console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0))
this.endTimeStamp = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.startTimeStamp = this.format(val.setHours(7, 0, 1) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.startTimeStamp = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.endTimeStamp = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// console.log(this.listQuery.reportTime);
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000

View File

@ -1,14 +1,15 @@
<!--
* @Author: Do not edit
* @Date: 2023-12-13 14:10:04
* @LastEditTime: 2024-03-29 09:43:52
* @LastEditTime: 2024-04-12 14:21:34
* @LastEditors: zhp
* @Description:
-->
<template>
<div>
<el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!edit" :disabled="noData" size="small" @click="edit = true">编辑</el-button>
<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>

View File

@ -160,8 +160,8 @@ export default {
changeTime(val) {
if(val) {
// let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(new Date(val.getFullYear(), 0, 1, 7, 0, 1).getTime()); //
this.endTimeStamp = this.timeFun(new Date(val.getFullYear(), 11, 31, 7, 0, 0).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 {

View File

@ -0,0 +1,434 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-19 15:11:14
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- <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" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
<el-table-column label="原料样式" align="right" width="150">
<el-table-column prop="className" label="时间" width="120">
</el-table-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" :label="item">
</el-table-column>
</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 {
getIngredientData
} 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: getIngredientData,
// deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel,
},
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14' ],
tableData: [],
listQuery: {
startTime: undefined,
endTime:undefined
},
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: 250
},
{
type:'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type:'button',
btnName: '导出',
name: 'export',
color: 'success',
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.getDataList()
// this.getSpanArr(this.tableData)
// this.getDict();
},
methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
this.tableData.map((item, index) => {
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.className === this.tableData[index - 1].className) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
handleExport() {
//
console.log(this.$refs);
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
import('xlsx').then(excel => {
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() {
this.dataListLoading = true;
this.listQuery.startTime = '1713197388000';
this.listQuery.endTime = '1713254961000';
this.urlOptions.getDataListURL(this.listQuery).then(res => {
// 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>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
.el-table thead.is-group th {
background: none;
}
.el-table thead.is-group tr:first-of-type th:first-of-type {
border-bottom: none;
}
.el-table thead.is-group tr:first-of-type th:first-of-type:before {
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;
}
.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>

View File

@ -0,0 +1,85 @@
<template>
<div class="app-container">
<div>开发中</div>
<!-- 搜索工作栏 -->
<!-- <search-bar
:formConfigs="formConfig"
ref="searchBarForm"
@headBtnClick="buttonClick" />
<div class="report-box">
<div class="top-box">
<div class="left-top">
<base-table
:table-props="tableProp1"
:table-data="tableData"
:span-method="spanMethod"
:max-height="tableH" />
</div>
<div class="right-top"></div>
</div>
<div class="bottom-box">
<div class="left-bottom"></div>
<div class="right-bottom"></div>
</div>
</div> -->
</div>
</template>
<script>
const tableProp1 = [
{
prop: 'col1',
label: '生产线',
fixed: true,
},
];
export default {
name: 'productionDayR',
data() {
return {
formConfig: [
{
type: 'datePicker',
label: '日',
dateType: 'date',
format: 'yyyy-MM-dd',
valueFormat: 'yyyy-MM-dd',
placeholder: '日',
param: 'searchTime',
width: 150,
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'separate',
},
{
type: this.$auth.hasPermi('base:group-classes:create')
? 'button'
: '',
btnName: '导出',
name: 'add',
color: 'primary',
plain: true,
},
],
};
},
mounted() {},
methods: {},
};
</script>
<style lang="scss" scoped>
.report-box {
.left-top,
.right-top,
.left-bottom,
.right-bottom {
display: inline-block;
border: 1px solid red;
}
}
</style>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:24
* @LastEditTime: 2024-04-12 15:15:39
* @LastEditors: zhp
* @Description:
-->
@ -13,11 +13,12 @@
</el-date-picker>
</el-form-item>
<el-button type="primary" @click="getDataList()">查询</el-button>
<el-button v-if="this.$auth.hasPermi('report:glass-month:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" :disabled="noData" size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
@ -28,26 +29,26 @@
<el-table-column :label="'许昌安彩日成品生产汇总' + '(' + timeTips + ')'" align="center">
<el-table-column prop="lineName" label="生产线" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.lineName" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.lineName }} </span>
</template>
</el-table-column>
<el-table-column label="投入数㎡" align="center">
<el-table-column prop="inputNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputNow }} </span>
</template>
</el-table-column>
<el-table-column prop="inputHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.inputHis }} </span>
</template>
</el-table-column>
<el-table-column prop="inputTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ? parseFloat((scope.row.inputTrend *
100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 : null }} </span>
</template>
@ -56,24 +57,24 @@
<el-table-column label="完成良品产量" align="center">
<el-table-column prop="goodProductNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductNow" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductNow }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductHis" :disabled="disabled">
</el-input>
<span v-else>{{ scope.row.goodProductHis }} </span>
</template>
</el-table-column>
<el-table-column prop="goodProductTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null
}} </span>
</template>
@ -82,7 +83,7 @@
<el-table-column label="原片漏检率" align="center">
<el-table-column prop="missCheckNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
@ -91,7 +92,7 @@
</el-table-column>
<el-table-column prop="missCheckHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
@ -100,7 +101,7 @@
</el-table-column>
<el-table-column prop="missCheckTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ? 0 : null
@ -111,7 +112,7 @@
<el-table-column label="综合良品率" align="center">
<el-table-column prop="goodProductPassNow" label="今日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
@ -121,7 +122,7 @@
</el-table-column>
<el-table-column prop="goodProductPassHis" label="昨日" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
@ -131,7 +132,7 @@
</el-table-column>
<el-table-column prop="goodProductPassTrend" label="增减" align="center">
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
@ -485,8 +486,8 @@ export default {
// console.log(val.setHours(7, 0, 0))
// console.log(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000)
// let time = this.format(val.setHours(7, 0, 0))
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1) - 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.listQuery.reportTime[0] = this.format(val.setHours(7, 0, 1)) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = this.format(val.setHours(7, 0, 0) + 24 * 60 * 60 * 1000) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
this.timeTips = this.listQuery.reportTime[0] + ' - ' + this.listQuery.reportTime[1]
// console.log(this.listQuery.reportTime);
} else {

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-08 11:45:52
* @LastEditTime: 2024-04-12 14:22:46
* @LastEditors: zhp
* @Description:
-->
@ -12,13 +12,15 @@
<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('report:auto-production:query')" type="primary" @click="getDataList()">查询
<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('report:auto-production:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" :disabled="noData" size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
@ -51,9 +53,9 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend == 0 ? 0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -77,9 +79,9 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend == 0 ? 0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -88,8 +90,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -97,8 +99,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -107,10 +109,10 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend == 0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -120,8 +122,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -130,8 +132,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -140,11 +142,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-03-29 09:48:41
* @LastEditTime: 2024-04-12 14:22:51
* @LastEditors: zhp
* @Description:
-->
@ -14,13 +14,15 @@
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
<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('report:auto-production:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" :disabled="noData" size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
@ -52,11 +54,11 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -80,11 +82,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -93,8 +95,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -102,8 +104,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -112,11 +114,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -126,8 +128,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -136,8 +138,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -146,11 +148,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -1,7 +1,7 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-08 11:46:49
* @LastEditTime: 2024-04-12 14:22:54
* @LastEditors: zhp
* @Description:
-->
@ -14,15 +14,17 @@
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('report:auto-production:query')" type="primary" @click="getDataList()">查询
<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('report:auto-production:export')" type="primary" size="small" plain
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:export')" type="primary" size="small" plain
@click="handleExport">导出</el-button>
<!-- <el-button type="primary" icon="el-icon-edit-outline" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" type="success" @click="saveDataList()">保存</el-button> -->
</el-form>
<el-row style="float: right; margin-bottom: 5px">
<el-button v-if="!isSave" :disabled="noData" size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="!isSave && this.$auth.hasPermi('base:report-auto-production:update')" :disabled="noData"
size="small" @click="editDataList()">编辑</el-button>
<el-button v-if="isSave" size="small" @click="handleReturn()">返回</el-button>
<el-button size="small" v-if="isSave" @click="saveDataList()">保存</el-button>
</el-row>
@ -55,11 +57,11 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.inputTrend" :disabled="!disabled"></el-input>
<span v-else>{{ scope.row.inputTrend && scope.row.inputTrend != 0 ?
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.inputTrend * 100).toFixed(2)) + '%' : scope.row.inputTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -83,11 +85,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductTrend && scope.row.goodProductTrend != 0 ?
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductTrend * 100).toFixed(2)) + '%' : scope.row.goodProductTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -96,8 +98,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckNow" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckNow ? parseFloat((scope.row.missCheckNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -105,8 +107,8 @@
<template slot-scope="scope">
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckHis" :disabled="disabled"></el-input>
<span v-else>{{ scope.row.missCheckHis ? parseFloat((scope.row.missCheckHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -115,11 +117,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.missCheckTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.missCheckTrend && scope.row.missCheckTrend != 0 ?
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.missCheckTrend * 100).toFixed(2)) + '%' : scope.row.missCheckTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>
@ -129,8 +131,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassNow" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassNow ? parseFloat((scope.row.goodProductPassNow *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -139,8 +141,8 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassHis" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassHis ? parseFloat((scope.row.goodProductPassHis *
100).toFixed(2)) +
'%' : null }}
100).toFixed(2)) +
'%' : null }}
</span>
</template>
</el-table-column>
@ -149,11 +151,11 @@
<el-input v-if="!disabled" type="number" v-model="scope.row.goodProductPassTrend" :disabled="!disabled">
</el-input>
<span v-else>{{ scope.row.goodProductPassTrend && scope.row.goodProductPassTrend != 0 ?
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
parseFloat((scope.row.goodProductPassTrend * 100).toFixed(2)) + '%' : scope.row.goodProductPassTrend ==
0 ?
0 :
null
}} </span>
</template>
</el-table-column>
</el-table-column>

View File

@ -0,0 +1,261 @@
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<base-table :max-height="tableH" v-loading="dataListLoading" :table-props="tableProps" :table-data="tableData">
<!-- <method-btn v-if="tableBtn.length" slot="handleBtn" :width="120" label="操作" :method-list="tableBtn"
@clickBtn="handleClick" /> -->
</base-table>
<!-- <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 {
getOriginalData
} from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver'
// import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'lineName',
label: '产线'
},
{
prop: 'equipmentName',
label: ''
},
{
prop: 'num',
label: '片数'
},
{
prop: 'area',
label: '面积'
},
{
prop: 'countNum',
label: '托数',
// filter: (val) => val == false ? '' : '',
},
{
prop: 'size',
label: '规格',
// filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
},
// {
// prop: 'checkerName',
// label: ''
// },
// {
// prop: 'checkTime',
// label: '',
// filter: parseTime
// },
];
export default {
mixins: [ tableHeightMixin],
data() {
return {
urlOptions: {
getDataListURL: getOriginalData,
// deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel,
},
tableProps,
tableData: [],
listQuery: {
startTime: undefined,
endTime:undefined
},
formConfig: [
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'content',
// },
// {
// type: 'select',
// label: '',
// selectOptions: [],
// labelField: 'name',
// valueField: 'id',
// param: 'materialId',
// filterable: true
// },
{
type: 'datePicker',
label: '时间段',
dateType: 'daterange',
format: 'yyyy-MM-dd HH:mm:ss',
// valueFormat: "yyyy-MM-dd HH:mm:ss",
rangeSeparator: '-',
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
param: 'checkTime',
defaultSelect: [],
width: 250
},
{
type: this.$auth.hasPermi('base:quality-hot-material:query') ? 'button' : '',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
// // type: 'separate',
// },
{
type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'button' : '',
btnName: '导出',
name: 'export',
color: 'success',
plain: true
},
],
};
},
components: {
// AddOrUpdate,
},
created() { },
mounted() {
this.getDataList()
// this.getDict();
},
methods: {
handleExport() {
//
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() {
this.dataListLoading = true;
this.listQuery.startTime = '1711095616000';
this.listQuery.endTime = '1711183743000';
this.urlOptions.getDataListURL(this.listQuery).then(response => {
this.tableData = response.data
// this.listQuery.total = response.data.total;
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) {
switch (val.btnName) {
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.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.getDataList();
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':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>

View File

@ -0,0 +1,435 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 14:08:46
* @LastEditTime: 2024-04-19 15:48:59
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<!-- <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" :span-method="objectSpanMethod" :data="tableData" style="width: 100%">
<el-table-column label="原料样式" align="right" width="150">
<el-table-column prop="className" label="时间" width="120">
</el-table-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" :label="item">
</el-table-column>
</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
} 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,
},
codeList: ['sj1', 'sj2', 'sj3', 'sj4', 'sj5', 'sj7', 'sj8', 'sj10', 'sj11', 'sj12', 'sj13', 'sj14'],
tableData: [],
listQuery: {
"productionLineId": 1696716506443354114, "startTime": "2024-01-19 07:00:00"
},
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: 250
},
{
type: 'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
{
type: 'button',
btnName: '导出',
name: 'export',
color: 'success',
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.getDataList()
// this.getSpanArr(this.tableData)
// this.getDict();
},
methods: {
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
this.tableData.map((item, index) => {
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.className === this.tableData[index - 1].className) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
handleExport() {
//
console.log(this.$refs);
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
import('xlsx').then(excel => {
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() {
this.dataListLoading = true;
// this.listQuery.startTime = '1713197388000';
// this.listQuery.endTime = '1713254961000';
this.urlOptions.getDataListURL(this.listQuery).then(res => {
console.log(res.data);
// 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>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
.el-table thead.is-group th {
background: none;
}
.el-table thead.is-group tr:first-of-type th:first-of-type {
border-bottom: none;
}
.el-table thead.is-group tr:first-of-type th:first-of-type:before {
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;
}
.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>

View File

@ -0,0 +1,384 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 10:01:33
* @LastEditTime: 2024-04-18 16:26:48
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<el-table :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>
<!-- <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 {
getOriginalData
} from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver'
// import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'lineName',
label: '产线'
},
{
prop: 'equipmentName',
label: ''
},
{
prop: 'num',
label: '片数'
},
{
prop: 'area',
label: '面积'
},
{
prop: 'countNum',
label: '托数',
// filter: (val) => val == false ? '' : '',
},
{
prop: 'size',
label: '规格',
// filter: (val) => val == 1 ? 'A' : val == 2 ? 'B' : 'C',
},
// {
// prop: 'checkerName',
// label: ''
// },
// {
// prop: 'checkTime',
// label: '',
// filter: parseTime
// },
];
export default {
mixins: [ tableHeightMixin],
data() {
return {
urlOptions: {
getDataListURL: getOriginalData,
// deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel,
},
tableProps,
tableData: [],
mergeArr: [],//
pos: 0,
listQuery: {
startTime: undefined,
endTime:undefined
},
formConfig: [
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'content',
// },
// {
// type: 'select',
// label: '',
// selectOptions: [],
// labelField: 'name',
// valueField: 'id',
// param: 'materialId',
// filterable: true
// },
{
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: 250
},
{
type:'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
// // type: 'separate',
// },
{
type:'button',
btnName: '导出',
name: 'export',
color: 'success',
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.getDataList()
// this.getSpanArr(this.tableData)
// this.getDict();
},
methods: {
getSummaries(param) {
console.log(columns)
const { columns, data } = param;
const sums = [];
columns.forEach((column, index) => {
if (index === 0) {
sums[index] = '合计';
return;
}
const values = data.map(item => Number(item[column.property]));
// const data = data.map(item => !Number(item[column.property]));
if (!values.every(value => isNaN(value))) {
sums[index] = values.reduce((prev, curr) => {
const value = Number(curr);
if (!isNaN(value)) {
return prev + curr;
} else {
return prev;
}
}, 0);
sums[index] += ' ';
} else {
sums[index] = '-';
}
});
return sums;
},
objectSpanMethod({ row, column, rowIndex, columnIndex }) {
let spanOneArr = [], concatOne = 0;
this.tableData.map((item, index) => {
if (index === 0) {
spanOneArr.push(1);
} else {
//
if (item.lineName === this.tableData[index - 1].lineName) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
handleExport() {
//
console.log(this.$refs);
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
import('xlsx').then(excel => {
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() {
this.dataListLoading = true;
this.listQuery.startTime = '1711095616000';
this.listQuery.endTime = '1711183743000';
this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.getSpanArr(this.tableData)
// response.data.forEach((ele) => {
// console.log(ele.size.substring(2, ele.size.length - 2))
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
this.tableData = response.data.map((ele) => {
return {
area:ele.area,
countNum: ele.countNum,
equipmentName: ele.equipmentName,
lineName: ele.lineName,
num: ele.num,
// size: typeof (ele.size)
size: ele.size.match(/\[(.+?)\]/g) ? ele.size.substring(1, ele.size.length - 1) : ele.size
}
})
let obj = {}
response.data.reduce((prev, curr) => {
console.log(prev, curr)
})
// this.tableData.forEach((ele) => {
// ele.size.substring(2, ele.size.length - 2)
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
// let obj = {}
// this.tableData.forEach(ele => {
// obj.num += ele.num
// obj.area += ele.num
// obj.count += ele.num
// })
// console.log(obj);
// this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 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) {
switch (val.btnName) {
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.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.getDataList();
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':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -0,0 +1,406 @@
<!--
* @Author: zhp
* @Date: 2024-04-18 15:07:53
* @LastEditTime: 2024-04-18 15:26:50
* @LastEditors: zhp
* @Description:
-->
<template>
<div class="app-container">
<search-bar :formConfigs="formConfig" ref="searchBarForm" @headBtnClick="buttonClick" />
<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>
<!-- <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 {
getCuttingtData
} from '@/api/report/qcReport';
import tableHeightMixin from '@/mixins/lb/tableHeightMixin';
import FileSaver from 'file-saver'
// import { getList, } from "@/api/base/qualityScrapType";
const tableProps = [
// {
// prop: 'createTime',
// label: '',
// filter: parseTime
// },
{
prop: 'lineName',
label: '产线'
},
{
prop: 'dataType',
label: ''
},
{
prop: 'type',
label: '类别'
},
{
prop: 'pieces',
label: '片数'
},
{
prop: 'area',
label: '面积'
},
{
prop: 'rate',
label: '占比',
// filter: (val) => val == false ? '' : '',
},
// {
// prop: 'checkerName',
// label: ''
// },
// {
// prop: 'checkTime',
// label: '',
// filter: parseTime
// },
];
export default {
mixins: [ tableHeightMixin],
data() {
return {
urlOptions: {
getDataListURL: getCuttingtData,
// deleteURL: deleteQualityHotMaterial,
// exportURL: exportFactoryExcel,
},
tableProps,
tableData: [],
mergeArr: [],//
pos: 0,
listQuery: {
startTime: undefined,
endTime:undefined
},
formConfig: [
// {
// type: 'input',
// label: '',
// placeholder: '',
// param: 'content',
// },
// {
// type: 'select',
// label: '',
// selectOptions: [],
// labelField: 'name',
// valueField: 'id',
// param: 'materialId',
// filterable: true
// },
{
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: 250
},
{
type:'button',
btnName: '查询',
name: 'search',
color: 'primary',
},
// {
// type: this.$auth.hasPermi('base:quality-hot-material:create') ? 'separate' : '',
// // type: 'separate',
// },
{
type:'button',
btnName: '导出',
name: 'export',
color: 'success',
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.getDataList()
// this.getSpanArr(this.tableData)
// this.getDict();
},
methods: {
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 }) {
let spanOneArr = [], concatOne = 0;
let spanTwoArr = [], concatTwo = 0;
this.tableData.map((item, index) => {
// console.log(inde);
if (index === 0) {
spanOneArr.push(1);
spanTwoArr.push(1);
} else {
//
if (item.lineName === this.tableData[index - 1].lineName) {
spanOneArr[concatOne] += 1;
spanOneArr.push(0);
} else {
spanOneArr.push(1);
concatOne = index;
};
if (item.dataType === this.tableData[index - 1].dataType) {
spanTwoArr[concatTwo] += 1;
spanTwoArr.push(0);
} else {
spanTwoArr.push(1);
concatTwo = index;
};
}
});
if (columnIndex === 0) {
const _row = spanOneArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
if (columnIndex === 1) {
const _row = spanTwoArr[rowIndex];
const _col = _row > 0 ? 1 : 0;
return {
rowspan: _row,
colspan: _col
}
}
},
handleExport() {
//
console.log(this.$refs);
var xlsxParam = { raw: true };
/* 从表生成工作簿对象 */
import('xlsx').then(excel => {
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() {
this.dataListLoading = true;
this.listQuery.startTime = '1706144404000';
this.listQuery.endTime = '1706230804000';
this.urlOptions.getDataListURL(this.listQuery).then(response => {
// this.getSpanArr(this.tableData)
// response.data.forEach((ele) => {
// console.log(ele.size.substring(2, ele.size.length - 2))
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
this.tableData = response.data.map((ele) => {
return {
dataType: ele.dataType == 1 ? '成品' : ele.dataType == 2 ? '取样' : '废版',
code: ele.code,
putNum: ele.putNum,
lineName: ele.lineName,
type: ele.type,
pieces: ele.pieces,
area: ele.area,
rate: ele.rate
// useNum: ele.useNum,
// num: ele.num,
// size: typeof (ele.size)
// size: ele.size.match(/\[(.+?)\]/g) ? ele.size.substring(1, ele.size.length - 1) : ele.size
}
})
// let obj = {}
// response.data.reduce((prev, curr) => {
// console.log(prev, curr)
// })
// this.tableData.forEach((ele) => {
// ele.size.substring(2, ele.size.length - 2)
// // console.log(Object.prototype.toString.call(ele.size))
// // // if (Object.prototype.toString.call(ele.size) === Array) {
// // console.log(11111)
// // console.log();
// // }
// })
// let obj = {}
// this.tableData.forEach(ele => {
// obj.num += ele.num
// obj.area += ele.num
// obj.count += ele.num
// })
// console.log(obj);
// this.listQuery.total = response.data.total;
this.dataListLoading = false;
});
},
// 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) {
switch (val.btnName) {
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.endTime = val.checkTime ? val.checkTime[1] : undefined;
this.getDataList();
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':
this.handleExport();
break;
default:
console.log(val);
}
},
},
};
</script>
<style>
.baseTable .el-table__body tr.current-row>td.el-table__cell {
background-color: #EAF1FC;
}
.baseTable .el-table .el-table__cell {
padding: 0;
height: 35px;
}
</style>

View File

@ -91,13 +91,13 @@
pageSize: 10,
},
tableBtn: [
this.$auth.hasPermi('base:core-equipment-attr:update') // ('se:firefight-attr:update') // TODO 此处需用firefight-attr权限还是core-equipment-attr 权限
this.$auth.hasPermi('base:core-equipment-attr:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('base:core-equipment-attr:delete') // ('se:firefight-attr:delete')
this.$auth.hasPermi('base:core-equipment-attr:delete')
? {
type: 'delete',
btnName: '删除',
@ -142,19 +142,29 @@ export default {
return {
searchBarKeys: ['name', 'code'],
tableBtn: [
this.$auth.hasPermi(`se:firefight:update`)
this.$auth.hasPermiAnd([
'base:core-equipment:query',
'base:core-equipment-attr:query',
])
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('se:firefight:update')
this.$auth.hasPermiAnd([
'base:core-equipment:update',
'base:core-worker:query',
'base:core-equipment:query',
'base:core-equipment-attr:create',
'base:core-equipment-attr:query',
'base:core-equipment-attr:delete',
])
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:firefight:delete')
this.$auth.hasPermi('base:core-equipment:delete')
? {
type: 'delete',
btnName: '删除',
@ -205,17 +215,32 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermi('base:core-equipment:export') ||
this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:firefight:export') ? 'button' : '',
type: this.$auth.hasPermi('base:core-equipment:export')
? 'button'
: '',
btnName: '导出',
name: 'export',
plain: true,
color: 'primary',
},
//
{
type: this.$auth.hasPermi('se:firefight:create') ? 'button' : '',
type: this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,

View File

@ -142,19 +142,29 @@ export default {
return {
searchBarKeys: ['name', 'code'],
tableBtn: [
this.$auth.hasPermi(`se:manage:update`)
this.$auth.hasPermiAnd([
'base:core-equipment:query',
'base:core-equipment-attr:query',
])
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('se:manage:update')
this.$auth.hasPermiAnd([
'base:core-equipment:update',
'base:core-worker:query',
'base:core-equipment:query',
'base:core-equipment-attr:create',
'base:core-equipment-attr:query',
'base:core-equipment-attr:delete',
])
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:manage:delete')
this.$auth.hasPermi('base:core-equipment:delete')
? {
type: 'delete',
btnName: '删除',
@ -204,10 +214,17 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermi('base:core-equipment:export') ||
this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:manage:export')
type: this.$auth.hasPermi('base:core-equipment:export')
? 'button'
: '',
btnName: '导出',
@ -216,7 +233,10 @@ export default {
color: 'primary',
},
{
type: this.$auth.hasPermi('se:manage:create')
type: this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'button'
: '',
btnName: '新增',

View File

@ -141,19 +141,30 @@ export default {
return {
searchBarKeys: ['name', 'code'],
tableBtn: [
this.$auth.hasPermi(`se:safety:update`)
this.$auth.hasPermiAnd([
'base:core-equipment:query',
'base:core-equipment-attr:query',
])
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('se:safety:update')
//
this.$auth.hasPermiAnd([
'base:core-equipment:update',
'base:core-worker:query',
'base:core-equipment:query',
'base:core-equipment-attr:create',
'base:core-equipment-attr:query',
'base:core-equipment-attr:delete',
])
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:safety:delete')
this.$auth.hasPermi('base:core-equipment:delete')
? {
type: 'delete',
btnName: '删除',
@ -203,10 +214,17 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermi('base:core-equipment:export') ||
this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:safety:export')
type: this.$auth.hasPermi('base:core-equipment:export')
? 'button'
: '',
btnName: '导出',
@ -215,7 +233,10 @@ export default {
color: 'primary',
},
{
type: this.$auth.hasPermi('se:safety:create')
type: this.$auth.hasPermiAnd([
'base:core-equipment:create',
'base:core-worker:query',
])
? 'button'
: '',
btnName: '新增',

View File

@ -103,6 +103,7 @@
label="操作">
<template slot-scope="scope">
<el-tooltip
v-if="$auth.hasPermi('equipment:check:update')"
content="确认"
placement="top">
<el-button
@ -114,8 +115,13 @@
</el-button>
</el-tooltip>
<!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<span
v-if="$auth.hasPermi('equipment:check:query')"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb">
|
</span>
<el-tooltip
v-if="$auth.hasPermi('equipment:check:query')"
content="查看详情"
placement="top">
<el-button
@ -126,8 +132,35 @@
</el-button>
</el-tooltip>
<!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<span
v-if="
$auth.hasPermiAnd([
'equipment:check:update',
'base:core-worker:query',
'base:group-classes:query',
'base:core-department:query',
'equipment:check:query',
'equipment:check:create',
'equipment:check:delete',
'base:core-equipment:query',
])
"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb">
|
</span>
<el-tooltip
v-if="
$auth.hasPermiAnd([
'equipment:check:update',
'base:core-worker:query',
'base:group-classes:query',
'base:core-department:query',
'equipment:check:query',
'equipment:check:create',
'equipment:check:delete',
'base:core-equipment:query',
])
"
content="编辑"
placement="top">
<el-button
@ -138,8 +171,13 @@
</el-button>
</el-tooltip>
<!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<span
v-if="$auth.hasPermi('equipment:check:delete')"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb">
|
</span>
<el-tooltip
v-if="$auth.hasPermi('equipment:check:delete')"
content="删除"
placement="top">
<el-button

View File

@ -26,7 +26,7 @@
v-if="tableBtn.length"
slot="handleBtn"
label="操作"
:width="180"
:width="128"
:method-list="tableBtn"
@clickBtn="handleTableBtnClick" />
</base-table>
@ -78,20 +78,29 @@ export default {
addOrEditTitle: '',
searchBarKeys: ['name'],
tableBtn: [
this.$auth.hasPermi('se:check:add-item')
this.$auth.hasPermiAnd([
'equipment:check:create',
'equipment:check:query',
'equipment:check:update',
'equipment:check:delete',
])
? {
type: 'add',
btnName: '添加',
showTip: '添加巡检',
}
: undefined,
this.$auth.hasPermi('se:check:update')
this.$auth.hasPermiAnd([
'equipment:check:update',
'equipment:check:query',
'base:core-department:query',
])
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:check:delete')
this.$auth.hasPermi('equipment:check:delete')
? {
type: 'delete',
btnName: '删除',
@ -164,10 +173,20 @@ export default {
color: 'primary',
},
{
type: 'separate',
type: this.$auth.hasPermiAnd([
'equipment:check:create',
'base:core-department:query',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:check:create') ? 'button' : '',
type: this.$auth.hasPermiAnd([
'equipment:check:create',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,

View File

@ -155,10 +155,25 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermiAnd([
'equipment:check:create',
'base:core-worker:query',
'base:group-classes:query',
'base:core-department:query',
]) ||
this.$auth.hasPermi('equipment:check:export') ||
this.$auth.hasPermi('equipment:check:update')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:check-unconfirm:create')
type: this.$auth.hasPermiAnd([
'equipment:check:create',
'base:core-worker:query',
'base:group-classes:query',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
@ -167,18 +182,14 @@ export default {
color: 'success',
},
{
type: this.$auth.hasPermi('se:check-unconfirm:export')
? 'button'
: '',
type: this.$auth.hasPermi('equipment:check:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'warning',
},
{
type: this.$auth.hasPermi('se:check-unconfirm:confirm-all')
? 'button'
: '',
type: this.$auth.hasPermi('equipment:check:update') ? 'button' : '',
btnName: '批量确认',
name: 'batch-confirm',
plain: true,

View File

@ -71,7 +71,7 @@ export default {
addOrUpdateVisible: false,
searchBarKeys: ['name', 'actualCheckTime'],
tableBtn: [
this.$auth.hasPermi('se:check-record:detail')
this.$auth.hasPermi('equipment:check:query')
? {
type: 'detail',
btnName: '详情',
@ -147,10 +147,10 @@ export default {
color: 'primary',
},
{
type: 'separate',
type: this.$auth.hasPermi('equipment:check:export') ? 'separate' : '',
},
{
type: this.$auth.hasPermi('se:check-record:export') ? 'button' : '',
type: this.$auth.hasPermi('equipment:check:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,

View File

@ -122,20 +122,22 @@ export default {
minWidth: 158,
showOverflowtooltip: true,
},
{
prop: 'opt2',
label: '保养内容',
entryText: '详情',
subcomponent: TableBtn,
width: 100,
},
this.$auth.hasPermi('equipment:plan-config:query')
? {
prop: 'opt2',
label: '保养内容',
entryText: '详情',
subcomponent: TableBtn,
width: 100,
}
: undefined,
{
prop: 'remainDays',
label: '距离下次保养剩余时间(天)',
subcomponent: RemainBox,
minWidth: 210,
},
],
].filter(v => v),
searchBarFormConfig: [
{
type: 'select',
@ -151,10 +153,12 @@ export default {
color: 'primary',
},
{
type: 'separate',
type: this.$auth.hasPermi('equipment:plan-config:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:maintain-plan:export')
type: this.$auth.hasPermi('equipment:plan-config:export')
? 'button'
: '',
btnName: '导出',

View File

@ -83,19 +83,31 @@ export default {
return {
searchBarKeys: ['planName'],
tableBtn: [
this.$auth.hasPermi('se:maintain:update')
this.$auth.hasPermiAnd([
'equipment:plan-config:query',
'equipment:plan-config:create',
'equipment:plan-config:update',
'equipment:plan-config:delete',
'base:core-equipment:query',
])
? {
type: 'addContent',
btnName: '添加内容',
}
: undefined,
this.$auth.hasPermi('se:maintain:update')
this.$auth.hasPermiAnd([
'equipment:plan-config:update',
'equipment:plan-config:query',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:maintain:delete')
this.$auth.hasPermi('equipment:plan-config:delete')
? {
type: 'delete',
btnName: '删除',
@ -166,10 +178,24 @@ export default {
color: 'primary',
},
{
type: 'separate',
type: this.$auth.hasPermiAnd([
'equipment:plan-config:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:maintain:create') ? 'button' : '',
type: this.$auth.hasPermiAnd([
'equipment:plan-config:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,

View File

@ -212,7 +212,7 @@ export default {
},
computed: {},
mounted() {
this.loadEquipments();
// this.loadEquipments();
},
methods: {
/** 确认是否关闭 */

View File

@ -100,26 +100,26 @@ export default {
return {
recordDetailVisible: false,
searchBarKeys: ['maintainPlanId', 'startTime', 'special'],
tableBtn: [
this.$auth.hasPermi('se:maintain-record:update')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('se:maintain-record:update')
? {
type: 'edit',
btnName: '修改',
}
: undefined,
this.$auth.hasPermi('se:maintain-record:delete')
? {
type: 'delete',
btnName: '删除',
}
: undefined,
].filter((v) => v),
// tableBtn: [
// this.$auth.hasPermi('se:maintain-record:update')
// ? {
// type: 'detail',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('se:maintain-record:update')
// ? {
// type: 'edit',
// btnName: '',
// }
// : undefined,
// this.$auth.hasPermi('se:maintain-record:delete')
// ? {
// type: 'delete',
// btnName: '',
// }
// : undefined,
// ].filter((v) => v),
tableProps: [
{
prop: 'maintainOrderNumber',
@ -182,14 +182,16 @@ export default {
filter: (val) =>
val != null ? ['-', '计划型', '非计划型'][val] : '-',
},
{
prop: '_detail',
label: '详情',
entryText: '详情',
minWidth: 60,
subcomponent: TableBtn,
},
],
this.$auth.hasPermi('equipment:maintain-record:query')
? {
prop: '_detail',
label: '详情',
entryText: '详情',
minWidth: 60,
subcomponent: TableBtn,
}
: '',
].filter((v) => v),
searchBarFormConfig: [
{
type: 'select',
@ -222,10 +224,12 @@ export default {
color: 'primary',
},
{
type: 'separate',
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:maintain-record:export')
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',

View File

@ -88,19 +88,19 @@ export default {
'specialType',
],
tableBtn: [
this.$auth.hasPermi('se:repair:finish')
this.$auth.hasPermi('equipment:repair:finish')
? {
type: 'finish',
btnName: '完成',
}
: undefined,
this.$auth.hasPermi('se:repair:update')
this.$auth.hasPermi('equipment:repair:query')
? {
type: 'detail',
btnName: '详情',
}
: undefined,
this.$auth.hasPermi('se:repair:delete')
this.$auth.hasPermi('equipment:repair:delete')
? {
type: 'delete',
btnName: '删除',
@ -212,17 +212,31 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermi('equipment:repair:export') ||
this.$auth.hasPermiAnd([
'equipment:repair:create',
'base:core-worker:query',
'system:user:list',
])
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:repair:export') ? 'button' : '',
type: this.$auth.hasPermi('equipment:repair:export') ? 'button' : '',
btnName: '导出',
name: 'export',
plain: true,
color: 'primary',
},
{
type: this.$auth.hasPermi('se:repair:create') ? 'button' : '',
type: this.$auth.hasPermiAnd([
'equipment:repair:create',
'base:core-worker:query',
'system:user:list',
])
? 'button'
: '',
btnName: '新增',
name: 'add',
plain: true,

View File

@ -147,10 +147,25 @@ export default {
color: 'primary',
},
{
type: 'separate',
type:
this.$auth.hasPermiAnd([
'equipment:maintain-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
]) ||
this.$auth.hasPermi('equipment:maintain-record:update') ||
this.$auth.hasPermi('equipment:maintain-record:export')
? 'separate'
: '',
},
{
type: this.$auth.hasPermi('se:maintain-record-pre:create')
type: this.$auth.hasPermiAnd([
'equipment:maintain-record:create',
'base:core-worker:query',
'base:core-production-line:query',
'base:core-department:query',
])
? 'button'
: '',
btnName: '新增',
@ -159,7 +174,7 @@ export default {
color: 'success',
},
{
type: this.$auth.hasPermi('se:maintain-record-pre:confirm-all')
type: this.$auth.hasPermi('equipment:maintain-record:update')
? 'button'
: '',
btnName: '批量确认',
@ -168,7 +183,7 @@ export default {
plain: true,
},
{
type: this.$auth.hasPermi('se:maintain-record-pre:export')
type: this.$auth.hasPermi('equipment:maintain-record:export')
? 'button'
: '',
btnName: '导出',

View File

@ -144,7 +144,7 @@
label="操作">
<template slot-scope="scope">
<el-tooltip
v-if="$auth.hasPermi('se:maintain-record-pre:confirm')"
v-if="$auth.hasPermi('equipment:maintain-record:update')"
content="确认"
placement="top">
<el-button
@ -158,11 +158,11 @@
<!-- line -->
<span
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
v-if="$auth.hasPermi('se:maintain-record-pre:update')">
v-if="$auth.hasPermi('equipment:maintain-record:query')">
|
</span>
<el-tooltip
v-if="$auth.hasPermi('se:maintain-record-pre:update')"
v-if="$auth.hasPermi('equipment:maintain-record:query')"
content="查看详情"
placement="top">
<el-button
@ -175,11 +175,29 @@
<!-- line -->
<span
style="margin: 0 4px; font-size: 18px; color: #e5e7eb"
v-if="$auth.hasPermi('se:maintain-record-pre:update')">
v-if="
$auth.hasPermiAnd([
'equipment:maintain-record:update',
'base:core-production-line:query',
'base:core-department:query',
'equipment:maintain-record:create',
'equipment:maintain-record:query',
'equipment:maintain-record:delete',
])
">
|
</span>
<el-tooltip
v-if="$auth.hasPermi('se:maintain-record-pre:update')"
v-if="
$auth.hasPermiAnd([
'equipment:maintain-record:update',
'base:core-production-line:query',
'base:core-department:query',
'equipment:maintain-record:create',
'equipment:maintain-record:query',
'equipment:maintain-record:delete',
])
"
content="编辑"
placement="top">
<el-button
@ -190,8 +208,13 @@
</el-button>
</el-tooltip>
<!-- line -->
<span style="margin: 0 4px; font-size: 18px; color: #e5e7eb">|</span>
<span
v-if="$auth.hasPermi('equipment:maintain-record:delete')"
style="margin: 0 4px; font-size: 18px; color: #e5e7eb">
|
</span>
<el-tooltip
v-if="$auth.hasPermi('equipment:maintain-record:delete')"
content="删除"
placement="top">
<el-button