Merge remote-tracking branch 'origin/master'

master
陈恒杰 8 months ago
commit c96d3248f2

@ -62,3 +62,12 @@ export function syncSAPbp() {
data: data data: data
}); });
} }
// 查询设备小时产量
export function getHourProductionList(query) {
return request({
url: '/mes/reportWork/getHourProductionList',
method: 'get',
params: query
});
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 244 KiB

After

Width:  |  Height:  |  Size: 219 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 244 KiB

@ -83,10 +83,10 @@
生产中 生产中
</div> </div>
<div class="infoModel" :style="`display:${loopIndex === k?'inline-block':''}`"> <div class="infoModel" :style="`display:${loopIndex === k?'inline-block':''}`">
<div class="title">{{ i.equName }}</div> <div class="title">{{ (i||{}).equName }}</div>
<div class="equipmentOutput"><span style="color: #fff9">设备产量:</span> {{ i.quantity }}</div> <div class="equipmentOutput"><span style="color: #fff9">设备产量:</span> {{ (i||{}).quantity }}</div>
<div class="equipmentInfo"><span style="color: #fff9">设备状态:</span> {{ <div class="equipmentInfo"><span style="color: #fff9">设备状态:</span> {{
parseFloat(i.quantity) > 0 ? '运行' : '停机' parseFloat((i||{}).quantity) > 0 ? '运行' : '停机'
}} }}
</div> </div>
</div> </div>
@ -96,10 +96,10 @@
:style="`top: ${equipmentLocation[k].top}%;left: ${equipmentLocation[k].left}%;`"> :style="`top: ${equipmentLocation[k].top}%;left: ${equipmentLocation[k].left}%;`">
<div :class="equipmentLocation[k].isRight?`equipmentName1`:`equipmentName`" <div :class="equipmentLocation[k].isRight?`equipmentName1`:`equipmentName`"
:style="`display:${loopIndex === 18+k?'inline-block':''}`"> :style="`display:${loopIndex === 18+k?'inline-block':''}`">
<div class="title">{{ i.equName }}</div> <div class="title">{{ (i||{}).equName }}</div>
<div class="equipmentOutput"><span style="color: #fff9">设备产量:</span> {{ i.quantity }}</div> <div class="equipmentOutput"><span style="color: #fff9">设备产量:</span> {{ (i||{}).quantity }}</div>
<div class="equipmentInfo"><span style="color: #fff9">设备状态:</span> {{ <div class="equipmentInfo"><span style="color: #fff9">设备状态:</span> {{
parseFloat(i.quantity) > 0 ? '运行' : '停机' parseFloat((i||{}).quantity) > 0 ? '运行' : '停机'
}} }}
</div> </div>
</div> </div>
@ -108,7 +108,7 @@
v-for="(i,k) in ringLocation"></div> v-for="(i,k) in ringLocation"></div>
<div :class="`${i.IsLoad? 'agv2':'agv1'}`" v-for="i in agvData" v-show="i.show" <div :class="`${i.IsLoad? 'agv2':'agv1'}`" v-for="i in agvData" v-show="i.show && !(i.x>0.3&&i.x<0.62 && i.y <0.8)"
:style="`${getLocation(i.x,i.y)}transform: rotate(${parseFloat(i.rotate )- 180}deg);`"></div> :style="`${getLocation(i.x,i.y)}transform: rotate(${parseFloat(i.rotate )- 180}deg);`"></div>
</div> </div>
</div> </div>
@ -350,6 +350,8 @@ export default {
}, },
getData() { getData() {
let time = parseTime(new Date(), '{h}-{i}').split('-') let time = parseTime(new Date(), '{h}-{i}').split('-')
let i = parseFloat(time[0]) || 0 let i = parseFloat(time[0]) || 0
let s = parseFloat(time [1]) || 0 let s = parseFloat(time [1]) || 0
@ -382,6 +384,8 @@ export default {
} }
this.hfData = hfArr this.hfData = hfArr
this.equipmentData = equipmentArr this.equipmentData = equipmentArr
console.log(this.hfData)
console.log(this.equipmentData)
}) })
} }
}, },

@ -2,22 +2,24 @@
<div class="bg"> <div class="bg">
<div class="title">白坯车间数字应用大屏</div> <div class="title">白坯车间数字应用大屏</div>
<div class="modelTitle" style=" top: 15.2%;left: 3%;">烘房状态</div> <div class="modelTitle" style=" top: 15.2%;left: 3%;">烘房状态</div>
<div class="modelTitle" style="top:15.2%;left:32%">设备运行数据</div> <!-- <div class="modelTitle" style="top:15.2%;left:32%">设备运行数据</div>-->
<div class="modelTitle" style="top:15.2%;left:32%">烘房耗电量</div>
<div class="modelTitle" style="top:15.2%;left:71%">烘房白坯质量统计</div> <div class="modelTitle" style="top:15.2%;left:71%">烘房白坯质量统计</div>
<div class="modelTitle" style="top:65%;left:32%">近7天产量</div> <div class="modelTitle" style="top:65%;left:32%">近7天产量</div>
<!-- <div class="modelTitle" style="top:65%;left:32%">烘房耗电量</div>-->
<div class="modelTitle" style="top:65%;left:71%">计划达成率</div> <div class="modelTitle" style="top:65%;left:71%">计划达成率</div>
<div class="title1" style="top:24%;left:34%">成型机产量</div> <!-- <div class="title1" style="top:24%;left:34%">成型机产量</div>-->
<div class="title1" style="top:24%;left:52.5%">烘房产量</div> <!-- <div class="title1" style="top:24%;left:52.5%">烘房产量</div>-->
<div class="title1" style="top:45%;left:34%">烘房耗电量</div> <!-- <div class="title1" style="top:45%;left:34%">烘房耗电量</div>-->
<div class="title1" style="top:45%;left:52.5%">AGV开动数量</div> <!-- <div class="title1" style="top:45%;left:52.5%">AGV开动数量</div>-->
<div class="unit1" style="top: 31.3%;left: 45.5%;"></div> <!-- <div class="unit1" style="top: 31.3%;left: 45.5%;"></div>-->
<div class="unit1" style="top: 31.3%;left: 63.5%"></div> <!-- <div class="unit1" style="top: 31.3%;left: 63.5%"></div>-->
<div class="unit1" style="top: 51.3%;left: 45.5%;">KWh</div> <!-- <div class="unit1" style="top: 51.3%;left: 45.5%;">KWh</div>-->
<div class="unit1" style="top: 51.3%;left: 63.5%;"></div> <!-- <div class="unit1" style="top: 51.3%;left: 63.5%;"></div>-->
<div class="num1" style="top: 31.5%;left: 39.5%;">{{ CData.map(e=>parseFloat(e.quantity)||0).reduce((a,b)=>a+b,0) }}</div> <!-- <div class="num1" style="top: 31.5%;left: 39.5%;">{{ CData.map(e=>parseFloat(e.quantity)||0).reduce((a,b)=>a+b,0) }}</div>-->
<div class="num1" style="top:31.5%;left:57.7%">{{ HData.map(e=>parseFloat(e.quantity)||0).reduce((a,b)=>a+b,0) }}</div> <!-- <div class="num1" style="top:31.5%;left:57.7%">{{ HData.map(e=>parseFloat(e.quantity)||0).reduce((a,b)=>a+b,0) }}</div>-->
<div class="num1" style="top:51.6%;left:39.5%">{{ expend }}</div> <!-- <div class="num1" style="top:51.6%;left:39.5%">{{ expend }}</div>-->
<div class="num1" style="top:51.6%;left:57.7%">{{ agvData.length }}</div> <!-- <div class="num1" style="top:51.6%;left:57.7%">{{ agvData.length }}</div>-->
<div class="title2" style="top: 73.5%;left: 86.8%;">计划生产数量</div> <div class="title2" style="top: 73.5%;left: 86.8%;">计划生产数量</div>
<div class="title2" style="top: 85.3%;left: 86.8%;">实际生产数量</div> <div class="title2" style="top: 85.3%;left: 86.8%;">实际生产数量</div>
<div class="unit2" style="top: 76.5%;left: 95%;"></div> <div class="unit2" style="top: 76.5%;left: 95%;"></div>
@ -75,7 +77,7 @@
</div> </div>
<div <div
class="scrollTable" style="color:#49b2fc"> class="scrollTable" style="color:#49b2fc">
{{ (parseFloat(item.expend/item.yield)||0).toFixed(2) }}KWh {{ (parseFloat(item.expend / item.yield) || 0).toFixed(2) }}KWh
</div> </div>
</div> </div>
</div> </div>
@ -83,6 +85,7 @@
</div> </div>
<Chart ref="chart1" class="chart1"></Chart> <Chart ref="chart1" class="chart1"></Chart>
<Chart ref="chart2" class="chart2"></Chart> <Chart ref="chart2" class="chart2"></Chart>
<Chart ref="chart3" class="chart3"></Chart>
</div> </div>
</template> </template>
<script> <script>
@ -134,14 +137,111 @@ export default {
methods: { methods: {
getData() { getData() {
dryRoomDataCarousel().then(e => { dryRoomDataCarousel().then(e => {
this.table1Data = e.data.dryingroomList || [] this.table1Data = e.data.dryingroomList.filter(v => parseFloat(v.expend / v.yield)) || []
}) })
EnergyExpend().then(e => { EnergyExpend().then(e => {
this.expend = e.map(v => v.expend).reduce((a, b) => a + b, 0).toFixed(2) this.expend = e.map(v => v.expend).reduce((a, b) => a + b, 0).toFixed(2)
let option2 = {
grid: {
top: '15%',
bottom: '10%',
// left: '5%',
right: '3%'
},
tooltip: {
trigger: 'axis',
axisPointer: {
type: 'shadow',
label: {
show: true
}
}
},
legend: {
right: 0,
textStyle: {
color: '#eee'
}
},
xAxis: {
data: e.map(v => parseFloat(v.monitorName.split(' - ')?.[1]?.split('(')?.[0]) + "#"),
axisLine: {
show: true, //X线
lineStyle: {
color: '#fff'
}
},
axisTick: {
show: true //X
},
axisLabel: {
interval: 0,
show: true,
textStyle: {
color: '#fff' //X
}
}
},
yAxis: [
{
type: 'value',
name: '单位KWh',
nameTextStyle: {
color: '#fff'
},
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
}
],
series: [
{
label: {
show: true,
position: 'top',
formatter: "{c}",
color: "#fff"
},
name: '耗电量',
type: 'bar',
smooth: true, //线
showAllSymbol: true, //
symbol: "emptyCircle", //
symbolSize: 5, //
// itemStyle: {
// //线
// color: "#058cff",
// },
// lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: e.map(v => parseFloat(v.expend)),
},
]
};
this.$refs.chart3.setData(option2)
}) })
agvdata().then(e => { agvdata().then(e => {
console.log(e) this.agvData = e.Data.filter(v => v.State === 2)
this.agvData = e.Data.filter(v=>v.State===2)
}) })
PlanAchievementRate().then(e => { PlanAchievementRate().then(e => {
this.proData = e.data this.proData = e.data
@ -178,56 +278,144 @@ export default {
createTimeStart: createTimeStart, createTimeStart: createTimeStart,
createTimeEnd: createTimeEnd, createTimeEnd: createTimeEnd,
chartType: 'cp' chartType: 'cp'
}).then(e => { }).then(vv => {
let e = vv.checkList
console.log(e)
let option = { let option = {
grid: {
top: '15%',
bottom: '10%',
left: '6%',
right: '6%'
},
tooltip: { tooltip: {
trigger: 'axis', trigger: 'axis',
axisPointer: { axisPointer: {
// Use axis to trigger tooltip type: 'shadow',
type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow' label: {
show: true
}
} }
}, },
legend: { legend: {
right: 0,
textStyle: { textStyle: {
color: '#eee' color: '#eee'
} }
}, },
grid: {
left: '3%',
right: '4%',
bottom: '3%',
containLabel: true
},
xAxis: { xAxis: {
type: 'value' data: e.map(v => v.machineName),
}, axisLine: {
yAxis: { show: true, //X线
type: 'category', lineStyle: {
axisLabel: { color: '#fff'
color: '#ccc' }
}, },
data: e.checkList.map(v => v.machineName), axisTick: {
show: true //X
},
axisLabel: {
interval:0,
show: true,
textStyle: {
color: '#fff' //X
}
}
}, },
yAxis: [
{
type: 'value',
name: '合格数',
nameTextStyle: {
color: '#fff'
},
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
},
{
type: 'value',
name: '合格率',
nameTextStyle: {
color: '#fff'
},
splitLine: {
show: false
},
axisTick: {
show: true
},
axisLine: {
show: true,
lineStyle: {
color: '#fff'
}
},
axisLabel: {
show: true,
textStyle: {
color: '#fff'
}
}
}
],
series: [ series: [
{ {
name: '合格数量',
type: 'bar',
stack: 'total',
label: { label: {
show: true, show: true,
position: 'insideRight', position: 'top',
formatter: "{c}车", formatter: "{c}%",
color: "#000" color: "#fff"
}, },
emphasis: { name: '合格率',
focus: 'series' type: 'line',
yAxisIndex: 1,
smooth: true, //线
showAllSymbol: true, //
symbol: "emptyCircle", //
symbolSize: 5, //
// itemStyle: {
// //线
// color: "#058cff",
// },
// lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: e.map(v => ((parseFloat(v.okQuality) / parseFloat(v.quality)) * 100).toFixed(2)),
},
{
label: {
show: true,
position: 'top',
formatter: "{c}",
color: "#fff"
}, },
itemStyle: { itemStyle: {
color: { color: {
type: 'linear', type: 'linear',
x: 0, x: 0,
y: 0, y: 1,
x2: 1, x2: 0,
y2: 0, y2: 0,
colorStops: [{ colorStops: [{
offset: 0, color: '#1e60f2' // 0% offset: 0, color: '#1e60f2' // 0%
@ -237,25 +425,105 @@ export default {
global: false // false global: false // false
} }
}, },
data: e.checkList.map(v => parseFloat(v.quality)) name: '合格数',
},
{
name: '不合格数量',
type: 'bar', type: 'bar',
stack: 'total', smooth: true, //线
label: { showAllSymbol: true, //
show: true, symbol: "emptyCircle", //
position: 'right' symbolSize: 5, //
}, // itemStyle: {
emphasis: { // //线
focus: 'series' // color: "#058cff",
}, // },
data: e.checkList.map(v => 0) // lineStyle: {
// color: "#058cff",
// },
// areaStyle: {
// color: "rgba(5,140,255, 0.2)",
// },
data: e.map(v => parseFloat(v.quality)),
}, },
] ]
}; };
// let option = {
// tooltip: {
// trigger: 'axis',
// axisPointer: {
// // Use axis to trigger tooltip
// type: 'shadow' // 'shadow' as default; can also be 'line' or 'shadow'
// }
// },
// legend: {
// textStyle: {
// color: '#eee'
// }
// },
// grid: {
// left: '3%',
// right: '4%',
// bottom: '3%',
// containLabel: true
// },
// xAxis: {
// type: 'value'
// },
// yAxis: {
// type: 'category',
// axisLabel: {
// color: '#ccc'
// },
// data: e.checkList.map(v => v.machineName),
// // data: e.checkList.map((v,k) => ''+k),
// },
// series: [
// {
// name: '',
// type: 'bar',
// stack: 'total',
// label: {
// show: true,
// position: 'insideRight',
// formatter: "{c}",
// color: "#000"
// },
// emphasis: {
// focus: 'series'
// },
// itemStyle: {
// color: {
// type: 'linear',
// x: 0,
// y: 0,
// x2: 1,
// y2: 0,
// colorStops: [{
// offset: 0, color: '#1e60f2' // 0%
// }, {
// offset: 1, color: '#00b9ff' // 100%
// }],
// global: false // false
// }
// },
// data: e.checkList.map(v => parseFloat(v.quality))
// },
// {
// name: '',
// type: 'bar',
// stack: 'total',
// label: {
// show: true,
// position: 'right'
// },
// emphasis: {
// focus: 'series'
// },
// data: e.checkList.map(v => 0)
// },
// ]
// };
this.$refs.chart1.setData(option) this.$refs.chart1.setData(option)
}) })
getHourProductionLists().then(e => { getHourProductionLists().then(e => {
let option1 = { let option1 = {
grid: { grid: {
@ -491,6 +759,14 @@ export default {
} }
.chart3 {
position: absolute;
width: 37.4%;
height: 42.5%;
top: 17.6%;
left: 31.3%;
}
.case-item { .case-item {
border: 2px solid #0c61ad; border: 2px solid #0c61ad;
border-radius: 2px; border-radius: 2px;

@ -499,6 +499,13 @@
<el-table-column align="center" width="150" prop="batchNumList" label="批次数量"></el-table-column> <el-table-column align="center" width="150" prop="batchNumList" label="批次数量"></el-table-column>
</el-table> </el-table>
<!-- 测试 --> <!-- 测试 -->
<el-row style="margin-top: 20px">
<el-steps :active="2">
<el-step title="成型" :description="totalQuantity_cx"></el-step>
<el-step title="烘房" :description="totalQuantity_hf"></el-step>
</el-steps>
</el-row>
<!-- 操作按钮 --> <!-- 操作按钮 -->
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm" v-if="showDetail"> </el-button> <el-button type="primary" @click="submitForm" v-if="showDetail"> </el-button>
@ -640,6 +647,7 @@ import {
import moment from 'moment'; import moment from 'moment';
import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order' import { getProEquipment, getProRoutes, getProShifts,selectMaterielList} from '@/api/plan/order'
import {prototype} from "clipboard"; import {prototype} from "clipboard";
import {getHourProductionList} from '@/api/plan/whiteOrder';
export default { export default {
name: "WorkorderBP", name: "WorkorderBP",
@ -728,6 +736,9 @@ export default {
showSearch: true, showSearch: true,
// //
total: 0, total: 0,
//
totalQuantity_cx: 0,
totalQuantity_hf: 0,
// //
workorderList: [], workorderList: [],
// //
@ -1447,6 +1458,34 @@ export default {
getWorkBatchList(this.selectWork).then(response => { getWorkBatchList(this.selectWork).then(response => {
this.formFields = response.data this.formFields = response.data
}) })
//
getHourProductionList({
workorderCode: this.selectWork.workorderCode,
}).then(response => {
let totalQuantity_cx = 0;
let totalQuantity_hf = 0;
// equName
response.forEach(item => {
// quantity
const quantity = Number(item.quantity) || 0;
if (item.equName.includes("成型")) {
totalQuantity_cx += quantity;
}
});
response.forEach(item => {
// quantity
const quantity = Number(item.quantity) || 0;
if (item.equName.includes("烘房")) {
totalQuantity_hf += quantity;
}
});
this.totalQuantity_cx = totalQuantity_cx;
this.totalQuantity_hf = totalQuantity_hf;
});
// //
// //

@ -200,7 +200,7 @@
<script> <script>
import { listBpprocure, getBpprocure, delBpprocure, addBpprocure, updateBpprocure } from "@/api/wms/bpprocure"; import { listBpprocure, getBpprocure, delBpprocure, addBpprocure, updateBpprocure } from "@/api/wms/bpprocure";
import JsBarcode from 'jsbarcode';
export default { export default {
name: "Bpprocure", name: "Bpprocure",
dicts: ['bp_raw'], dicts: ['bp_raw'],
@ -339,6 +339,7 @@ export default {
} }
}); });
}, },
handlePrint() { handlePrint() {
// //
const selectedData = this.bpprocureList.filter(item => this.ids.includes(item.id)); const selectedData = this.bpprocureList.filter(item => this.ids.includes(item.id));
@ -350,7 +351,6 @@ export default {
// //
this.printData = { this.printData = {
printDate: new Date().toLocaleString(), printDate: new Date().toLocaleString(),
workTable: selectedData.map(item => ({ workTable: selectedData.map(item => ({
procureCode: item.procureCode, procureCode: item.procureCode,
materialCode: item.materialCode, materialCode: item.materialCode,
@ -358,59 +358,89 @@ export default {
unit: item.unit, unit: item.unit,
supplyName: item.supplyName, supplyName: item.supplyName,
planNumber: item.planNumber, planNumber: item.planNumber,
realityNumber: item.realityNumber|| '', realityNumber: item.realityNumber || '',
})) }))
}; };
//
let printContent = `
<div style="text-align: center;">
<h3>采购单</h3>
//
const barcodeCanvas = document.createElement('canvas');
console.log(" this.printData.workTable[0].procureCode: " + this.printData.workTable[0].procureCode);
JsBarcode(barcodeCanvas, this.printData.workTable[0].procureCode, {
format: "CODE128",
height: 35,
width: 1.5,
displayValue: true,
// background: "#FFFFFF", //
// lineColor: "#000000" //
});
// Data URL
const barcodeDataUrl = barcodeCanvas.toDataURL();
console.log(barcodeDataUrl); // Data URL
//
let printContent = `
<html>
<head>
<style>
body { font-family: Arial, sans-serif; }
table { width: 100%; border-collapse: collapse; }
th, td { border: 1px solid #000; text-align: center; padding: 8px; }
</style>
</head>
<body>
<div style="text-align: center;">
<h3>采购单</h3>
<div style="float: right; margin-top: -50px; width: 200px; height: 100px;">
<img src="${barcodeDataUrl}" alt="条形码" />
</div> </div>
<div style="display: flex; justify-content: space-between; padding: 10px;"> </div>
<div>打印日期: ${this.printData.printDate}</div> <div style="display: flex; justify-content: space-between; padding: 10px;">
</div> <div>打印日期: ${this.printData.printDate}</div>
<table border="1" style="width: 100%; border-collapse: collapse;margin: 0 auto;"> </div>
<thead> <table>
<tr> <thead>
<th style="text-align: center;">采购单</th> <tr>
<th style="text-align: center;">物料编码</th> <th>采购单</th>
<th style="text-align: center;">物料描述</th> <th>物料编码</th>
<th style="text-align: center;">供应商</th> <th>物料描述</th>
<th style="text-align: center;">单位</th> <th>供应商</th>
<th style="text-align: center;">计划数量</th> <th>单位</th>
<th style="text-align: center;">已入库数量</th> <th>计划数量</th>
</tr> <th>已入库数量</th>
</thead> </tr>
<tbody>`; </thead>
<tbody>`;
this.printData.workTable.forEach(item => { this.printData.workTable.forEach(item => {
printContent += ` printContent += `
<tr> <tr>
<td style="text-align: center;">${item.procureCode}</td> <td>${item.procureCode}</td>
<td style="text-align: center;">${item.materialCode}</td> <td>${item.materialCode}</td>
<td style="text-align: center;">${item.materialDesc}</td> <td>${item.materialDesc}</td>
<td style="text-align: center;">${item.supplyName}</td> <td>${item.supplyName}</td>
<td style="text-align: center;">${item.unit}</td> <td>${item.unit}</td>
<td style="text-align: center;">${item.planNumber}</td> <td>${item.planNumber}</td>
<td style="text-align: center;">${item.realityNumber}</td> <td>${item.realityNumber}</td>
</tr>`; </tr>`;
}); });
printContent += ` printContent += `
</tbody> </tbody>
</table> </table>
</body>
`; </html>`;
const printWindow = window.open('', '_blank'); const printWindow = window.open('', '_blank');
printWindow.document.write('<html><head><title>打印</title></head><body>');
printWindow.document.write(printContent); printWindow.document.write(printContent);
printWindow.document.write('</body></html>');
printWindow.document.close(); printWindow.document.close();
printWindow.print(); printWindow.print();
printWindow.close(); printWindow.close();
}, },
// handleQuery, resetQuery, etc. // handleQuery, resetQuery, etc.

Loading…
Cancel
Save