Merge branch 'projects/mesxc-test' into projects/mesxc-zhp

This commit is contained in:
‘937886381’ 2024-04-24 13:49:44 +08:00
commit 30eecb8bd1
30 changed files with 1337 additions and 587 deletions

View File

@ -1,8 +1,8 @@
###
# @Author: zhp
# @Date: 2024-04-12 14:30:48
# @LastEditTime: 2024-04-23 15:43:31
# @LastEditors: zhp
# @LastEditTime: 2024-04-23 17:25:25
# @LastEditors: DY
# @Description:
###
# 开发环境配置
@ -18,9 +18,9 @@ VUE_APP_BASE_API = 'http://192.168.0.33:48082'
VUE_APP_JIMU_API = 'http://192.168.1.101:48082'
# socket地址(现场)
# VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
VUE_APP_Socket_API = 'ws://10.70.2.2:8080'
# socket地址(公司线上)
VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
# VUE_APP_Socket_API = 'ws://192.168.0.33:48082'
# socket 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

@ -1,22 +1,26 @@
<template>
<div>
<NotMsg v-show="notMsg"/>
<div id='gasChart' class="gas-chart" style="width:600px;height:200px;" v-show='!notMsg'></div>
<NotMsg v-show="notMsg" />
<div
id="gasChart"
class="gas-chart"
style="width: 600px; height: 200px"
v-show="!notMsg"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import resize from './../mixins/resize'
import NotMsg from './../components/NotMsg'
import resize from './../mixins/resize';
import NotMsg from './../components/NotMsg';
export default {
name: 'GasChart',
mixins: [resize],
components:{ NotMsg },
components: { NotMsg },
props: {
chartType: '', //
chartTime: ''
chartTime: '',
},
data() {
const colors = [
@ -31,159 +35,170 @@ export default {
];
return {
chart: null,
notMsg:false
notMsg: false,
};
},
computed: {
gasChartMsg() {
return this.$store.state.websocket.sumGasInfo
return this.$store.state.websocket.sumGasInfo;
},
energyWeekTrend() {
return this.$store.state.websocket.energyWeekTrend
return this.$store.state.websocket.energyWeekTrend;
},
energyMonthTrend() {
return this.$store.state.websocket.energyMonthTrend
return this.$store.state.websocket.energyMonthTrend;
},
energyYearTrend() {
return this.$store.state.websocket.energyYearTrend
}
return this.$store.state.websocket.energyYearTrend;
},
},
watch: {
energyWeekTrend: {//
energyWeekTrend: {
//
handler(newVal, oldVal) {
if (this.chartTime === '周' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
this.updateChart();
this.$emit('emitFun');
}
}
},
},
energyMonthTrend: {//
energyMonthTrend: {
//
handler(newVal, oldVal) {
if (this.chartTime === '月' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
this.updateChart();
this.$emit('emitFun');
}
}
},
},
energyYearTrend: {//
energyYearTrend: {
//
handler(newVal, oldVal) {
if (this.chartTime === '年' && this.chartType === '电耗能') {
this.updateChart()
this.$emit('emitFun')
this.updateChart();
this.$emit('emitFun');
}
}
},
},
gasChartMsg: {//
gasChartMsg: {
//
handler(newVal, oldVal) {
if (this.chartType === '天然气I' || this.chartType === '天然气II') {
this.updateChart()
this.$emit('emitFun')
this.updateChart();
this.$emit('emitFun');
}
}
},
},
chartTime: {//
chartTime: {
//
handler(newVal, oldVal) {
this.updateChart()
}
this.updateChart();
},
},
chartType: {//
chartType: {
//
handler(newVal, oldVal) {
this.updateChart()
}
}
this.updateChart();
},
},
},
mounted() {
this.$el.addEventListener('resize', () => {
console.log('resziing.....');
});
this.updateChart()
this.updateChart();
},
methods: {
updateChart() {
let gasName = ''
let gasName = '';
const colors = ['#FFCB59'];
let temp = []
let seriesData = []
let xData = []
let yData = []
let temp = [];
let seriesData = [];
let xData = [];
let yData = [];
switch (this.chartType) {
case '电耗能':{
gasName = '电耗能'
case '电耗能': {
gasName = '电耗能';
if (this.chartTime === '周') {
temp = this.energyWeekTrend || []
}else if(this.chartTime === '月') {
temp = this.energyMonthTrend || []
}else{
temp = this.energyYearTrend || []
temp = this.energyWeekTrend || [];
} else if (this.chartTime === '月') {
temp = this.energyMonthTrend || [];
} else {
temp = this.energyYearTrend || [];
}
temp && temp.map(i => {
xData.push(i.time)
yData.push(i.qty)
})
temp &&
temp.map((i) => {
xData.push(i.time);
yData.push(i.qty);
});
break;
}
case '天然气I':{
case '天然气I': {
if (this.chartTime === '周') {
yData = this.gasChartMsg.hisSumGas1For7Day || []
}else if(this.chartTime === '月') {
yData = this.gasChartMsg.sumGas1ForMonth || []
}else{
yData = this.gasChartMsg.sumGas1ForYear || []
yData = this.gasChartMsg.hisSumGas1For7Day || [];
} else if (this.chartTime === '月') {
yData = this.gasChartMsg.sumGas1ForMonth || [];
} else {
yData = this.gasChartMsg.sumGas1ForYear || [];
}
gasName = '天然气I'
xData = this.getXdata()
gasName = '天然气I';
xData = this.getXdata();
break;
}
default:
gasName = '天然气II'
if (this.chartTime === '周') {
yData = this.gasChartMsg.hisSumGas2For7Day || []
}else if(this.chartTime === '月') {
yData = this.gasChartMsg.sumGas2ForMonth || []
}else{
yData = this.gasChartMsg.sumGas2ForYear || []
gasName = '天然气II';
if (this.chartTime === '周') {
yData = this.gasChartMsg.hisSumGas2For7Day || [];
} else if (this.chartTime === '月') {
yData = this.gasChartMsg.sumGas2ForMonth || [];
} else {
yData = this.gasChartMsg.sumGas2ForYear || [];
}
xData = this.getXdata()
xData = this.getXdata();
}
if (yData.length === 0) {
this.notMsg = true
return
} else {
this.notMsg = false
}
this.notMsg = true;
return;
} else {
this.notMsg = false;
}
if (yData.length == 0) {
seriesData = []
}else {
seriesData = [{
name: gasName,
data: yData,
type: "line",
areaStyle: {
seriesData = [];
} else {
yData = yData.map((item) => {
return (item = Number(item.toFixed(2)));
});
seriesData = [
{
name: gasName,
data: yData,
type: 'line',
areaStyle: {
color: new echarts.graphic.LinearGradient(0, 0, 0, 1, [
{ offset: 0, color: '#FFCB59' + "40" },
{ offset: 0.5, color: '#FFCB59' + "20" },
{ offset: 1, color: '#FFCB59' + "00" },
{ offset: 0, color: '#FFCB59' + '40' },
{ offset: 0.5, color: '#FFCB59' + '20' },
{ offset: 1, color: '#FFCB59' + '00' },
]),
},
lineStyle: {
width: 1,
},
symbol: 'circle',
symbolSize: 5,
emphasis: {
focus: 'series',
},
},
lineStyle: {
width: 1
},
symbol: 'circle',
symbolSize: 5,
emphasis: {
focus: 'series'
}
}]
];
}
//
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose() // Dom
}
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose(); // Dom
}
this.chart = echarts.init(document.getElementById('gasChart'));
var option = {
color: colors,
@ -204,7 +219,7 @@ export default {
},
},
yAxis: {
name: this.chartType === '电耗能'?'单位kwh':'单位Nm³',
name: this.chartType === '电耗能' ? '单位kwh' : '单位Nm³',
nameTextStyle: {
color: '#fff',
fontSize: 10,
@ -230,10 +245,10 @@ export default {
series: seriesData,
tooltip: {
trigger: 'axis',
className: "gas-tooltip"
className: 'gas-tooltip',
},
}
option && this.chart.setOption(option)
};
option && this.chart.setOption(option);
},
getXdata() {
const today = new Date();
@ -242,31 +257,39 @@ export default {
let days = 30;
if (this.chartTime === '周') {
return Array(7)
.fill(1)
.map((_, index) => {
const today = new Date();
const dtimestamp = today - (index+1) * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth()+1}.${new Date(dtimestamp).getDate()}`;}).reverse()
}else if (this.chartTime == "月") {
.fill(1)
.map((_, index) => {
const today = new Date();
const dtimestamp = today - (index + 1) * 24 * 60 * 60 * 1000;
return `${new Date(dtimestamp).getMonth() + 1}.${new Date(
dtimestamp
).getDate()}`;
})
.reverse();
} else if (this.chartTime == '月') {
if (currentMonth in [1, 3, 5, 7, 8, 10, 12]) {
days = 31;
} else if (currentMonth == 2) {
days = this.isLeapYear(currentYear) ? 29 : 28;
}
return Array(days)
.fill(1)
.map((_, index) => {
return `${currentMonth}.${days - index}`;}).reverse()
.fill(1)
.map((_, index) => {
return `${currentMonth}.${days - index}`;
})
.reverse();
} else {
return Array(12)
.fill(1)
.map((_, index) => {
return `${12 - index}`;}).reverse()
.fill(1)
.map((_, index) => {
return `${12 - index}`;
})
.reverse();
}
},
isLeapYear(year) {
return year % 400 == 0 || (year % 4 == 0 && year % 100 != 0);
}
},
},
};
</script>
@ -278,12 +301,12 @@ export default {
}
</style>
<style>
.gas-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.gas-tooltip * {
color: #fff !important;
}
.gas-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.gas-tooltip * {
color: #fff !important;
}
</style>

View File

@ -1,68 +1,89 @@
<template>
<div>
<NotMsg v-show="notMsg"/>
<div id="israChart" class="isra-chart" style="width:600px;height:390px;" v-show='!notMsg'></div>
<NotMsg v-show="notMsg" />
<div
id="israChart"
class="isra-chart"
style="width: 600px; height: 390px"
v-show="!notMsg"></div>
</div>
</template>
<script>
import * as echarts from 'echarts';
import resize from './../mixins/resize'
import NotMsg from './../components/NotMsg'
import resize from './../mixins/resize';
import NotMsg from './../components/NotMsg';
export default {
name: 'ISRAChart',
mixins: [resize],
components:{ NotMsg },
components: { NotMsg },
props: {},
data() {
return {
chart: null,
notMsg:true,
colors:['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
chartData: []
notMsg: true,
colors: ['#2760ff', '#518eec', '#0ee8e4', '#ddb523'],
chartData: [],
};
},
activated() {
},
activated() {},
computed: {
israChartMsg() {
return this.$store.state.websocket.israKiln
}
return this.$store.state.websocket.israKiln;
},
},
watch: {
israChartMsg: {
handler(newVal, oldVal) {
this.chartData = newVal || []
this.updateChart()
this.$emit('emitFun')
}
}
this.chartData = newVal || [];
this.updateChart();
this.$emit('emitFun');
},
},
},
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
this.chartData && this.chartData.length > 0 && this.chartData.map(i => {
num+=i.num
})
console.log('update');
let num = 0;
this.chartData &&
this.chartData.length > 0 &&
this.chartData.map((i) => {
num += i.num;
});
if (
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose()
}
this.chart !== null &&
this.chart !== '' &&
this.chart !== undefined
) {
this.chart.dispose();
}
if (this.chartData && this.chartData.length > 0) {
this.notMsg = false
} else {
this.notMsg = true
return
}
this.notMsg = false;
} else {
this.notMsg = true;
return;
}
this.chart = echarts.init(document.getElementById('israChart'));
var option = {
color:this.colors,
title:{
color: this.colors,
title: {
text: num,
subtext: '总数',
top: '32%',
@ -81,55 +102,92 @@ export default {
bottom: '2%',
left: 'center',
itemWidth: 18,
itemHeight:18,
itemHeight: 18,
icon: 'circle',
textStyle: {
color: '#fff'
color: '#fff',
},
data:this.chartData && this.chartData.length > 0 && this.chartData.map((item,index)=>({
name:item.name,
itemStyle:{
color: this.colors[index%4]
}
}))
data:
this.chartData &&
this.chartData.length > 0 &&
this.chartData.map((item, index) => ({
name: item.name,
itemStyle: {
color: this.colors[index % 4],
},
})),
},
series:[{
series: [
{
name: 'ISRA缺陷检测',
type: 'pie',
center: ['50%', '40%'],
radius: ['45%', '70%'],
avoidLabelOverlap: true,
// label: {
// show: true,
// },
// labelLine: {
// show: true,
// },
label: {
show: false
show: true,
normal: {
alignTo: 'labelLine',
margin: 10,
edgeDistance: 10,
lineHeight: 16,
formatter: (params) => {
//
return this.getEqualNewlineString(
params.value + ' | ' + params.percent.toFixed(0) + '%'
);
},
textStyle: {
//
// color: '#595959',
fontSize: 16,
},
},
},
labelLine: {
show: true,
length: 25,
length2: 10,
},
data: this.chartData && this.chartData.length > 0 && this.chartData.map((item, index) => ({
name:item.name,
value: item.num,
itemStyle:{
color:{
type: 'linear',
x: 1,
y: 1,
x2: 0,
y2: 0,
global: false,
colorStops:[
{offset: 0,color: this.colors[index%4]},
{offset: 1,color: this.colors[index%4]+'33'}
]
}
}
}))}],
tooltip: {
trigger: 'item',
className: "isra-chart-tooltip"
data:
this.chartData &&
this.chartData.length > 0 &&
this.chartData.map((item, index) => ({
name: item.name,
value: item.num,
label: {
color: this.colors[index % 4],
},
itemStyle: {
color: {
type: 'linear',
x: 1,
y: 1,
x2: 0,
y2: 0,
global: false,
colorStops: [
{ offset: 0, color: this.colors[index % 4] },
{ offset: 1, color: this.colors[index % 4] + '33' },
],
},
},
})),
},
}
],
tooltip: {
trigger: 'item',
className: 'isra-chart-tooltip',
},
};
this.chart.setOption(option);
}
},
},
};
</script>
@ -141,12 +199,12 @@ export default {
}
</style>
<style>
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
.isra-chart-tooltip {
background: #0a2b4f77 !important;
border: none !important;
backdrop-filter: blur(12px);
}
.isra-chart-tooltip * {
color: #fff !important;
}
</style>

View File

@ -1,77 +1,93 @@
<template>
<div style="flex: 1;">
<Container name="设备报警" size="middle" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<div style="padding: 5px 10px;">
<dv-scroll-board :config="config" style="width:575px;height:380px" ref='eqScrollBoard'/>
</div>
</Container>
</div>
<div style="flex: 1">
<Container
name="设备报警"
size="middle"
style="">
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div style="padding: 5px 10px">
<dv-scroll-board
:config="config"
style="width: 575px; height: 380px"
ref="eqScrollBoard" />
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container.vue';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
import { switchShowTime } from '../utils';
export default {
name: 'EqAlarm',
components: { Container, TimePrompt },
computed: {
sjgEquipment() {
return this.$store.state.websocket.sjgEquipment
}
},
data() {
return {
timestr: '',
config: {
header: ['序号', '设备名称', '设备编码','设备状态','是否故障'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 150, 190],
align: ['center'],
data: [],
// data: [
// [1, '线3线', 'EQ20240110130909000255', '', ''],
// [2, '线2线', 'EQ20240110130848000254', '', ''],
// [3, '线1线', 'EQ20240110130832000253', '', ''],
// [4, '12线', 'EQ20240110130817000252', '', ''],
// [5, '11线', ' EQ20240110130743000250', '', ''],
// [6, '10线', ' EQ20240110130743000250', '', ''],
// [7, '4线线', 'EQ20240110130731000249', '', ''],
// [8, '线2线', 'EQ20240110112716000248', '', ''],
// [9, '线1线', 'EQ20240110112700000247', '', ''],
// [10, '4线线', 'EQ20240110112646000246', '', '']
// ],
rowNum: 10
}
}
},
mounted(){
this.timestr = switchShowTime('日')
},
watch:{
sjgEquipment: {
name: 'EqAlarm',
components: { Container, TimePrompt },
computed: {
sjgEquipment() {
return this.$store.state.websocket.sjgEquipment;
},
},
data() {
return {
timestr: '',
config: {
header: ['序号', '设备名称', '设备编码', '设备状态', '是否故障'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 150, 190],
align: ['center'],
data: [],
// data: [
// [1, '线3线', 'EQ20240110130909000255', '', ''],
// [2, '线2线', 'EQ20240110130848000254', '', ''],
// [3, '线1线', 'EQ20240110130832000253', '', ''],
// [4, '12线', 'EQ20240110130817000252', '', ''],
// [5, '11线', ' EQ20240110130743000250', '', ''],
// [6, '10线', ' EQ20240110130743000250', '', ''],
// [7, '4线线', 'EQ20240110130731000249', '', ''],
// [8, '线2线', 'EQ20240110112716000248', '', ''],
// [9, '线1线', 'EQ20240110112700000247', '', ''],
// [10, '4线线', 'EQ20240110112646000246', '', '']
// ],
rowNum: 10,
},
};
},
mounted() {
this.timestr = switchShowTime('日');
},
watch: {
sjgEquipment: {
handler(newVal, oldVal) {
let outArr = this.sjgEquipment.map((item, index) => [
index+1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span title=${item.code || ''}>${item.code || ''}</span>`,
item.status,
item.error? '是': '否'
]);
this.config.data = outArr
this.$refs['eqScrollBoard'].updateRows(outArr)
this.timestr = switchShowTime('日')
}
}
}
}
let outArr = this.sjgEquipment.map((item, index) => [
index + 1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
`<span title=${item.code || ''}>${item.code || ''}</span>`,
`<span><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"><div style="${
item.error == false
? 'box-shadow: 0px 0px 2px 1px #2760FF;width:6px;height:6px;border-radius: 50%;background-color: #2760FF;float:left;margin:13px 10px 0 0 '
: 'box-shadow: 0px 0px 2px 1px red;width:6px;height:6px;border-radius: 50%; background-color: red;float:left;margin:13px 10px 0 0 '
}"></div> ${item.error == true ? '是' : '否' || ''}</span>`,
]);
this.config.data = outArr;
this.$refs['eqScrollBoard'].updateRows(outArr);
this.timestr = switchShowTime('日');
},
},
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.timeShow {
position: absolute;
top: 20px;
left: 170px;
position: absolute;
top: 20px;
left: 170px;
}
</style>
</style>

View File

@ -1,67 +1,88 @@
<template>
<Container name="工单监控" size="middle" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<div style="padding: 5px 10px;" class="WOMonitoring">
<dv-scroll-board :config="config" style="width:900px;height:380px" ref='worderScrollBoard'/>
</div>
</Container>
<Container
name="工单监控"
size="middle"
style="">
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div
style="padding: 5px 10px"
class="WOMonitoring">
<dv-scroll-board
:config="config"
style="width: 900px; height: 380px"
ref="worderScrollBoard" />
</div>
</Container>
</template>
<script>
import Container from '../components/Container.vue';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
import { formatDate } from '@/utils'
import { switchShowTime } from '../utils';
import { formatDate } from '@/utils';
export default {
name: 'WorkOrderMonitoring',
components: { Container, TimePrompt },
computed: {
order() {
return this.$store.state.websocket.workOrder
}
},
data() {
return {
timestr: '',
config: {
header: ['序号', '工单名称', '规格','产线','工单状态', '计划完成时间','计划产量','实际产量'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 120, 120, 60, 100, 150],
align: ['center'],
data: [],
rowNum:10
}
}
},
mounted(){
this.timestr = switchShowTime('日')
},
watch:{
order: {
name: 'WorkOrderMonitoring',
components: { Container, TimePrompt },
computed: {
order() {
return this.$store.state.websocket.workOrder;
},
},
data() {
return {
timestr: '',
config: {
header: [
'序号',
'工单名称',
'规格',
'产线',
'工单状态',
'计划完成时间',
'计划产量',
'实际产量',
'完成进度',
],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [60, 120, 120, 60, 100, 150],
align: ['center'],
data: [],
rowNum: 10,
},
};
},
mounted() {
this.timestr = switchShowTime('日');
},
watch: {
order: {
handler(newVal, oldVal) {
let outArr = this.order.map((item, index) => [
index+1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
item.specifications,
item.lines,
this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
formatDate(item.planFinishTime),
item.planQuantity,
item.planAssignQuantity
]);
this.config.data = outArr
this.$refs['worderScrollBoard'].updateRows(outArr)
this.timestr = switchShowTime('日')
}
}
}
}
let outArr = this.order.map((item, index) => [
index + 1,
`<span title=${item.name || ''}>${item.name || ''}</span>`,
item.specifications,
item.lines,
this.getDictDatas(this.DICT_TYPE.ORDER_STATUS)[item.status]?.label,
formatDate(item.planFinishTime),
item.planQuantity,
item.actualQuantity,
(item.progressRate * 100).toFixed(0) + '%',
]);
this.config.data = outArr;
this.$refs['worderScrollBoard'].updateRows(outArr);
this.timestr = switchShowTime('日');
},
},
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.timeShow {
position: absolute;
top: 20px;
left: 170px;
position: absolute;
top: 20px;
left: 170px;
}
</style>
</style>

View File

@ -1,22 +1,24 @@
<!--
filename: MaterialCost.vue
author: liubin
date: 2023-12-06 09:09:27
description:
-->
<template>
<Container name="能耗" size="middle" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<Container
name="能耗"
size="middle"
style="">
<EnergeTop />
<SplitLine :horizontal="true" />
<div class="" style="flex: 2; padding: 8px">
<div
class=""
style="flex: 2; padding: 8px">
<div
class="header-line"
style="margin: 8px 0 16px; display: flex; align-items: center">
<h2 class="" style="margin: 0; color: #0ee8fe; margin-right: 12px">
<h2
class=""
style="margin: 0; color: #0ee8fe; margin-right: 12px">
能耗趋势图
</h2>
<TimePrompt
class="timeShow"
:timestr="timestr" />
<!-- <Switcher /> -->
<div>
<!-- <span class="lgd lgd-total">总量</span> -->
@ -32,11 +34,21 @@
justify-content: space-between;
">
<SelectorBtnGroup
:options="['电耗能', '天然气I', '天然气II']" @emitFun='toggleType' :active='chartType'/>
<SelectorBtnGroup :options="['周', '月', '年']" @emitFun='toggleDate' :active='chartTime'/>
:options="['电耗能', '天然气I', '天然气II']"
@emitFun="toggleType"
:active="chartType" />
<SelectorBtnGroup
:options="['周', '月', '年']"
@emitFun="toggleDate"
:active="chartTime" />
</div>
<div class="chart" style="height: 200px; margin-top: 8px;">
<GasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
<div
class="chart"
style="height: 200px; margin-top: 8px">
<GasChart
:chartType="chartType"
:chartTime="chartTime"
@emitFun="dateUpdate" />
</div>
</div>
</Container>
@ -51,7 +63,7 @@ import EnergeTop from './EnergeTop';
import GasChart from '../components/GasChart.vue';
import SelectorBtnGroup from '../components/SelectorBtnGroup';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
import { switchShowTime } from '../utils';
export default {
name: 'EnergeCost',
components: {
@ -61,48 +73,43 @@ export default {
EnergeTop,
GasChart,
SelectorBtnGroup,
TimePrompt
TimePrompt,
},
props: {},
data() {
return {
chartType:'电耗能',
chartTime:'周',
timestr: ''
chartType: '电耗能',
chartTime: '周',
timestr: '',
};
},
mounted() {
this.timestr = switchShowTime(this.chartTime)
},
this.timestr = switchShowTime(this.chartTime);
},
computed: {
gasInfoMsg() {
return this.$store.state.websocket.gasInfo
return this.$store.state.websocket.gasInfo;
},
},
methods: {
//
toggleType(val) {
this.chartType = val
this.chartType = val;
},
//
toggleDate(val) {
this.chartTime = val
this.timestr = switchShowTime(val)
this.chartTime = val;
this.timestr = switchShowTime(val);
},
//
dateUpdate() {
this.timestr = switchShowTime(this.chartTime)
}
dateUpdate() {
this.timestr = switchShowTime(this.chartTime);
},
},
};
</script>
<style scoped lang="scss">
.timeShow {
position: absolute;
top: 20px;
left: 120px;
}
.lgd {
color: #fff;

View File

@ -1,7 +1,11 @@
<template>
<div class="gas-handle" style="flex: 2">
<Container name="烟气处理" size="large" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<div
class="gas-handle"
style="flex: 2">
<Container
name="烟气处理"
size="large"
style="">
<div
class=""
style="
@ -24,7 +28,13 @@
">
氧气含量
</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.O2_float ? (Number(exhaustGasInfo.O2_float)).toFixed(2) : ''}}%</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">
{{
exhaustGasInfo?.O2_float
? Number(exhaustGasInfo.O2_float).toFixed(2)
: ''
}}%
</span>
</ShadowRect>
<ShadowRect>
<div
@ -33,13 +43,19 @@
line-height: 1.24;
flex: 1;
text-align: right;
padding:5px 8px 5px 0;
padding: 5px 8px 5px 0;
letter-spacing: 3px;
">
<p style="margin: 0; line-height: inherit">氮氧化物</p>
<p style="margin: 0; line-height: inherit">排放浓度</p>
</div>
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.NOX_float ? (Number(exhaustGasInfo.NOX_float)).toFixed(2) : ''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
{{
exhaustGasInfo?.NOX_float
? Number(exhaustGasInfo.NOX_float).toFixed(2)
: ''
}}mg/
</span>
</ShadowRect>
<ShadowRect>
@ -49,13 +65,19 @@
line-height: 1.24;
flex: 1;
text-align: right;
padding:5px 8px 5px 0;
padding: 5px 8px 5px 0;
letter-spacing: 3px;
">
<p style="margin: 0; line-height: inherit">二氧化硫</p>
<p style="margin: 0; line-height: inherit">排放浓度</p>
</div>
<span style="font-size: 20px; line-height: 1.24; flex: 1">{{exhaustGasInfo?.SO2_float ? (Number(exhaustGasInfo.SO2_float)).toFixed(2) : ''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1">
{{
exhaustGasInfo?.SO2_float
? Number(exhaustGasInfo.SO2_float).toFixed(2)
: ''
}}mg/
</span>
</ShadowRect>
<ShadowRect>
@ -70,17 +92,30 @@
">
颗粒物浓度
</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">{{exhaustGasInfo?.dust_float ? (Number(exhaustGasInfo.dust_float)).toFixed(2) : ''}}mg/</span>
<span style="font-size: 20px; line-height: 1.24; flex: 1.2">
{{
exhaustGasInfo?.dust_float
? Number(exhaustGasInfo.dust_float).toFixed(2)
: ''
}}mg/
</span>
</ShadowRect>
</div>
<KilnLine :horizontal="true" />
<div class="" style="flex: 2; padding: 8px">
<div
class=""
style="flex: 2; padding: 8px">
<div
class="header-line"
style="margin-bottom: 10px; display: flex; align-items: center">
<h2 class="" style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
<h2
class=""
style="margin: 5px 0; color: #0ee8fe; margin-right: 12px">
烟气趋势图
</h2>
<TimePrompt
class="timeShow"
:timestr="timestr" />
<!-- <Switcher /> -->
<div>
<!-- <span class="lgd lgd-total">总量</span> -->
@ -96,11 +131,21 @@
justify-content: space-between;
">
<SelectorBtnGroup
:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']" @emitFun='toggleType' :active='chartType'/>
<SelectorBtnGroup :options="['日', '周', '月', '年']" @emitFun='toggleDate' :active='chartTime' />
:options="['氧气含量', '二氧化硫', '氮氧化物', '颗粒物']"
@emitFun="toggleType"
:active="chartType" />
<SelectorBtnGroup
:options="['日', '周', '月', '年']"
@emitFun="toggleDate"
:active="chartTime" />
</div>
<div class="chart" style="height: 250px;margin-top: 10px;">
<FlueGasChart :chartType='chartType' :chartTime='chartTime' @emitFun='dateUpdate'/>
<div
class="chart"
style="height: 250px; margin-top: 10px">
<FlueGasChart
:chartType="chartType"
:chartTime="chartTime"
@emitFun="dateUpdate" />
</div>
</div>
</Container>
@ -115,7 +160,7 @@ import KilnLine from '../components/line';
import SelectorBtnGroup from '../components/SelectorBtnGroup';
import FlueGasChart from '../components/FlueGasChart';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils'
import { switchShowTime } from '../utils';
export default {
name: 'GasHandle',
@ -125,49 +170,44 @@ export default {
KilnLine,
SelectorBtnGroup,
FlueGasChart,
TimePrompt
TimePrompt,
},
props: {},
data() {
return {
chartType:'氧气含量',
chartTime:'日',
timestr: ''
chartType: '氧气含量',
chartTime: '日',
timestr: '',
};
},
computed: {
exhaustGasInfo() {
return this.$store.state.websocket.exhaustGasInfo
}
return this.$store.state.websocket.exhaustGasInfo;
},
},
mounted() {
this.timestr = switchShowTime(this.chartTime)
},
this.timestr = switchShowTime(this.chartTime);
},
methods: {
//
toggleType(val) {
console.log('烟气' + val)
this.chartType = val
console.log('烟气' + val);
this.chartType = val;
},
//
toggleDate(val) {
this.chartTime = val
this.timestr = switchShowTime(val)
this.chartTime = val;
this.timestr = switchShowTime(val);
},
//
dateUpdate() {
this.timestr = switchShowTime(this.chartTime)
}
dateUpdate() {
this.timestr = switchShowTime(this.chartTime);
},
},
};
</script>
<style scoped lang="scss">
.timeShow {
position: absolute;
top: 20px;
left: 170px;
}
.gas-handle {
}

View File

@ -3,6 +3,9 @@
name="原料用量统计"
size="middle"
style="">
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div style="flex: 1; display: flex; gap: 8px; flex-direction: column">
<div
class="absolute"
@ -10,8 +13,8 @@
flex: 2;
padding: 12px 12px 0 12px;
display: grid;
grid-template-columns: repeat(2, 1fr);
grid-auto-rows: repeat(4, 1fr);
grid-template-columns: repeat(3, 1fr);
grid-auto-rows: repeat(3, 1fr);
gap: 8px;
">
<ShadowRect
@ -22,7 +25,8 @@
class="material"
style="
flex: 1;
padding-bottom: 3px;
padding-bottom: 18px;
padding-top: 18px;
display: flex;
flex-direction: column;
gap: 4px;
@ -53,20 +57,33 @@
<script>
import Container from '../components/Container';
import ShadowRect from '../components/ShadowRect.vue';
import TimePrompt from '../components/TimePrompt';
import { switchShowTime } from '../utils';
export default {
name: 'MaterialCost',
components: { Container, ShadowRect },
components: { Container, ShadowRect, TimePrompt },
props: {},
data() {
return {};
return {
timestr: '',
};
},
computed: {
materialMsg() {
return this.$store.state.websocket.material;
},
},
mounted() {
this.timestr = switchShowTime('日');
},
methods: {},
};
</script>
<style scoped lang="scss"></style>
<style lang="scss" scoped>
.timeShow {
position: absolute;
top: 20px;
left: 210px;
}
</style>

View File

@ -29,6 +29,8 @@ export const switchShowTime = (type) => {
}
if (lastMonth === 12) {
startYear = currentYear - 1
}else{
startYear = currentYear
}
startTime = startYear+'.'+lastMonth+'.'+day
endTime = currentYear+'.'+(nowTime.getMonth()+1)+'.28'

View File

@ -1,70 +1,94 @@
<template>
<div style="flex: 1;" class="orderContainer">
<Container name="订单完成情况" size="small" style="">
<TimePrompt class="timeShow" :timestr="timestr" />
<div style="padding: 5px 10px;">
<dv-scroll-board :config="config" style="width:575px;height:230px" ref='orderScrollBoard'/>
</div>
</Container>
</div>
<div
style="flex: 1"
class="orderContainer">
<Container
name="订单完成情况"
size="small"
style="">
<TimePrompt
class="timeShow"
:timestr="timestr" />
<div style="padding: 5px 10px">
<dv-scroll-board
:config="config"
style="width: 575px; height: 230px"
ref="orderScrollBoard" />
</div>
</Container>
</div>
</template>
<script>
import Container from '../components/Container'
import Container from '../components/Container';
import TimePrompt from '../components/TimePrompt';
import { formatDate } from '@/utils'
import { switchShowTime } from '../utils'
import { formatDate } from '@/utils';
import { switchShowTime } from '../utils';
export default {
name: 'OrderStatus',
components: { Container, TimePrompt },
computed: {
order() {
return this.$store.state.websocket.order
}
},
data() {
return {
timestr: '',
config: {
header: ['上线时间', '客户名称', '规格','完成度'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [155, 160, 150],
data: [],
rowNum: 6
}
}
},
mounted() {
this.timestr = switchShowTime('日')
},
watch:{
order:{
handler() {
let outArr = this.order.map((item) => [
formatDate(item.planStartTime) || '',
`<span title=${item.customerName || ''}>${item.customerName || ''}</span>`,
`<span title=${item.specifications || ''}>${item.specifications || ''}</span>`,
`<span style="display:inline-block;width:60px;">${item.completeRate?(item.completeRate*100).toFixed(2)+'%':'0%'}</span>
name: 'OrderStatus',
components: { Container, TimePrompt },
computed: {
order() {
return this.$store.state.websocket.order;
},
},
data() {
return {
timestr: '',
config: {
header: ['上线时间', '客户名称', '规格', '完成度'],
headerBGC: 'rgba(32, 55, 96, 0.8)',
oddRowBGC: 'rgba(32, 55, 96, 0.8)',
evenRowBGC: 'rgba(14, 32, 62, 0.8)',
columnWidth: [155, 160, 150],
data: [],
rowNum: 6,
},
};
},
mounted() {
this.timestr = switchShowTime('日');
},
watch: {
order: {
handler() {
let outArr = this.order.map((item) => [
formatDate(item.planStartTime) || '',
`<span title=${item.customerName || ''}>${
item.customerName || ''
}</span>`,
`<span title=${item.specifications || ''}>${
item.specifications || ''
}</span>`,
`<span style="display:inline-block;width:60px;">${
item.completeRate
? (item.completeRate * 100).toFixed(2) + '%'
: '0%'
}</span>
<div style="display:inline-block;height:20px;margin-top:-5px;vertical-align:middle;">
<svg xmlns="http://www.w3.org/200/svg" height="20" width="20">
<circle cx="10" cy="10" r="6" fill="none" stroke="#283851" stroke-width="4" stroke-linecap="round"/>
<circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${item.completeRate?item.completeRate.toFixed(2)*37.68+','+((1-item.completeRate.toFixed(2))*37.68):(0+','+37.68)}"/>
<circle style="transform-origin: center;transform: rotate(-90deg);" id="J_progress_bar" cx="10" cy="10" r="6" fill="none" stroke="#47FF27" stroke-width="4" stroke-dasharray="${
item.completeRate
? item.completeRate.toFixed(2) * 37.68 +
',' +
(1 - item.completeRate.toFixed(2)) * 37.68
: 0 + ',' + 37.68
}"/>
</svg>
</div>`
]);
this.config.data = outArr
this.$refs['orderScrollBoard'].updateRows(outArr)
this.timestr = switchShowTime('日')
}
}
}
}
</div>`,
]);
this.config.data = outArr;
this.$refs['orderScrollBoard'].updateRows(outArr);
this.timestr = switchShowTime('日');
},
},
},
};
</script>
<style lang='scss' scoped>
<style lang="scss" scoped>
.timeShow {
position: absolute;
top: 20px;
left: 210px;
position: absolute;
top: 20px;
left: 210px;
}
</style>
</style>

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

@ -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

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

View File

@ -0,0 +1,171 @@
<!--
* @Author: Do not edit
* @Date: 2024-04-22 15:49:56
* @LastEditTime: 2024-04-23 15:43:36
* @LastEditors: DY
* @Description:
-->
<template>
<div class="weekly">
<el-form :inline="true" :model="listQuery" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" size="small" @click="search()">
查询
</el-button>
<el-button v-if="this.$auth.hasPermiAnd(['base:report-auto-original-glass:export', 'base:report-auto-production:export'])" type="primary" size="small" plain
@click="handleExport">导出</el-button>
</el-form>
<glassWeek v-if="glassWeekShow" ref="glassWeek" :product="false" :params="listQuery" />
<proWeek v-if="proWeekShow" ref="proWeek" :product="false" :params="listQuery" />
</div>
</template>
<script>
import glassWeek from '../glass/weekly.vue'
import proWeek from '../productionWeekReport/index.vue'
import { parseTime } from '../../core/mixins/code-filter';
export default {
components: { glassWeek, proWeek },
data() {
return {
listQuery: {
// pageSize: 10,
// pageNo: 1,
// total: 0,
reportType: 3,
reportTime: []
},
startTimeStamp: '',
endTimeStamp: '',
reportTime: '',
glassWeekShow: false,
proWeekShow: false
}
},
created() {
this.getCurrentWeekStartTimeAndEndTime()
this.glassWeekShow = true
this.proWeekShow = true
},
methods: {
handleExport() {
this.$nextTick(() => {
this.$refs['glassWeek'].handleExport()
this.$refs['proWeek'].handleExport()
})
},
search() {
this.$nextTick(() => {
this.$refs['glassWeek'].getDataList()
this.$refs['proWeek'].getDataList()
})
},
changeTime(val) {
console.log(val);
if(val) {
let timeStamp = val.getTime(); //
this.startTimeStamp = this.timeFun(timeStamp - 24 * 60 * 60 * 1000); //
this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 6); //
console.log(this.startTimeStamp, this.endTimeStamp)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
} else {
this.listQuery.reportTime = []
}
},
getCurrentWeekStartTimeAndEndTime() {
this.reportTime = new Date()
var weekday = new Array(7);
weekday[0] = "Sunday";
weekday[1] = "Monday";
weekday[2] = "Tuesday";
weekday[3] = "Wednesday";
weekday[4] = "Thursday";
weekday[5] = "Friday";
weekday[6] = "Saturday";
// console.log(weekday[this.reportTime.getDay()]);
if (weekday[this.reportTime.getDay()] === 'Monday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 4 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Tuesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 5 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Wednesday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 6 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Thursday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 7 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime())
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Friday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 8 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 1 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Saturday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 9 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() - 2 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
} else if (weekday[this.reportTime.getDay()] === 'Sunday') {
this.startTimeStamp = this.timeFun(new Date().getTime() - 10 * 24 * 60 * 60 * 1000)
this.endTimeStamp = this.timeFun(new Date().getTime() + 3 * 24 * 60 * 60 * 1000)
this.listQuery.reportTime[0] = parseTime(new Date(this.startTimeStamp + ' 07:00:01').getTime()) //+ ' 00:00:00' //new Date(this.startTimeStamp + ' 00:00:00').getTime() / 1000
this.listQuery.reportTime[1] = parseTime(new Date(this.endTimeStamp + ' 07:00:00').getTime()) //+ ' 23:59:59' //new Date(this.endTimeStamp + ' 23:59:59').getTime() / 1000
// this.endTimeStamp = this.timeFun(timeStamp + (24 * 60 * 60 * 1000) * 5); //
// this.changeTime(reportTime)
}
},
//yy-mm-dd hh:mm:ss
timeFun(unixtimestamp) {
var unixtimestamp = new Date(unixtimestamp);
var year = 1900 + unixtimestamp.getYear();
var month = "0" + (unixtimestamp.getMonth() + 1);
var date = "0" + unixtimestamp.getDate();
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
}
}
}
</script>
<style scoped>
.weekly {
padding-top: 16px;
}
.blueTip::before{
display: inline-block;
content: '';
width: 4px;
height: 18px;
background: #0B58FF;
border-radius: 1px;
margin-right: 8PX;
margin-top: 8px;
margin-left: 16px;
}
</style>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -1,29 +1,31 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:46
* @LastEditors: zhp
* @LastEditTime: 2024-04-23 16:58:06
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item label="月" prop="reportTime">
<el-date-picker v-model="reportTime" type="month" size="small" @change="changeTime" placeholder="选择月">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
@ -286,6 +288,16 @@ export default {
// DialogForm,
// },
// mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() {
return {
list: [],
@ -653,16 +665,21 @@ export default {
}
},
async getDataList() {
if (this.monthValue.length > 0) {
console.log(this.monthValue)
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
console.log(this.timeTips);
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
// this.$modal.msgError('')
// return false
if (this.monthValue.length > 0) {
console.log(this.monthValue)
this.dataForm.reportTime[0] = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.monthValue[1]).format('YYYY-MM-DD') + ' 07:00:00'
this.timeTips = moment(this.monthValue[0]).format('YYYY-MM-DD') + ' - ' + moment(this.monthValue[1]).format('YYYY-MM-DD')
console.log(this.timeTips);
} else {
// this.$modal.msgError('')
// return false
}
}
if (this.dataForm.reportTime.length == 0) {
this.$message({

View File

@ -1,31 +1,33 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:51
* @LastEditors: zhp
* @LastEditTime: 2024-04-23 16:58:12
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="week" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 4}" :format="'yyyy 第 WW 周' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择周">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
@ -292,6 +294,16 @@ export default {
// DialogForm,
// },
// mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() {
return {
list: [],
@ -622,11 +634,16 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
async getDataList() {
if (this.weekValue1 && this.weekValue2) {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
if (this.weekValue1 && this.weekValue2) {
this.dataForm.reportTime[0] = moment(this.weekValue1).day(0).format('YYYY-MM-DD') + ' 07:00:01'
// this.queryParams.startTime = this.monthValue[0]
this.dataForm.reportTime[1] = moment(this.weekValue2).day(6).format('YYYY-MM-DD') + ' 07:00:00'
} else {
}
}
if (this.dataForm.reportTime.length == 0) {
this.$message({

View File

@ -1,33 +1,35 @@
<!--
* @Author: zhp
* @Date: 2023-12-12 13:45:25
* @LastEditTime: 2024-04-12 14:22:54
* @LastEditors: zhp
* @LastEditTime: 2024-04-23 17:21:04
* @LastEditors: DY
* @Description:
-->
<template>
<div class="app-container">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
<div v-if="product">
<el-form :inline="true" :model="dataForm" class="blueTip">
<el-form-item>
<el-date-picker v-model="reportTime" type="year" size="small" @change="changeTime"
:picker-options="{firstDayOfWeek: 1}" :format="'yyyy 年' + '\u3000' + startTimeStamp + '-' + endTimeStamp"
style="width: 350px" placeholder="选择年">
</el-date-picker>
</el-form-item>
<el-button v-if="this.$auth.hasPermi('base:report-auto-production:query')" type="primary" @click="getDataList()">
查询
</el-button>
<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 && 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>
</div>
<el-table id="exportTable" :data="list" style="width: 100%" :header-cell-style="{
background: '#F2F4F9',
color: '#606266'
@ -294,6 +296,16 @@ export default {
// DialogForm,
// },
// mixins: [basicPageMixin],
props: {
product: {
type: Boolean,
default: true
},
params: {
type: Object,
default: () => {}
}
},
data() {
return {
list: [],
@ -556,15 +568,20 @@ export default {
return year + "-" + month.substring(month.length - 2, month.length) + "-" + date.substring(date.length - 2, date.length)
},
async getDataList() {
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
console.log(this.yearValue1);
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间')
return false
} else {
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
if (this?.params) {
this.dataForm = {...this.params}
this.timeTips = this.dataForm.reportTime[0] + ' - ' + this.dataForm.reportTime[1]
} else {
this.timeTips = moment(this.dataForm.reportTime[0]).format('YYYY-MM-DD') + " - " + moment(this.dataForm.reportTime[1]).format('YYYY-MM-DD')
console.log(this.yearValue1);
if (this.yearValue1 && this.yearValue2) {
if (this.yearValue2 < this.yearValue1) {
this.$modal.msgError('结束时间不能早于开始时间')
return false
} else {
// this.dataForm.reportTime[0] = this.transformYear(this.yearValue1)
// this.dataForm.reportTime[1] = this.transformYear(this.yearValue2)
}
}
}
if (this.dataForm.reportTime.length == 0) {

View File

@ -111,7 +111,10 @@ const mesEN = new WsConnect(
if (msgData == null) return;
switch (msgData?.type) {
case "EnergyInfo": {
store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
let keys = Object.keys(msgData.data)
if (keys.includes('elecQty1') || keys.includes('waterQty')) {
store.dispatch({ type: "websocket/setEnergyInfo", payload: msgData.data })
}
break;
}
case "EnergyTrend": {