生产管理
This commit is contained in:
@@ -3,16 +3,17 @@
|
||||
<div class='count-box'>
|
||||
<div class='count-tip-box'>
|
||||
<div class='item'>
|
||||
<p class='num'>2,344</p>
|
||||
<p class='num'> {{ totalDownLoadNumClass ? totalDownLoadNumClass : 0}}</p>
|
||||
<p class='title'>本班合计</p>
|
||||
</div>
|
||||
<div class='split'></div>
|
||||
<div class='item'>
|
||||
<p class='num'>2,344</p>
|
||||
<p class='num'>{{ totalDownLoadNumDay ? totalDownLoadNumDay : 0 }} </p>
|
||||
<p class='title'>本日合计</p>
|
||||
</div>
|
||||
</div>
|
||||
<dv-scroll-board :config="config" style="width:580px;height:180px;margin-top: 10px;" class='count-table'/>
|
||||
<dv-scroll-board ref="locationScrollBoardTable" :config="config" style="width:580px;height:180px;margin-top: 10px;"
|
||||
class='count-table' />
|
||||
<span class='split-line' style='left: 70px;'></span>
|
||||
<span class='split-line' style='left: 195px;'></span>
|
||||
<span class='split-line' style='left: 320px;'></span>
|
||||
@@ -26,9 +27,64 @@ export default {
|
||||
name: 'Count',
|
||||
components: {
|
||||
ModelBox
|
||||
},
|
||||
props: {
|
||||
dataObj: {
|
||||
type: Array,
|
||||
default: () => []
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
dataObj: {
|
||||
handler(newVal, oldVal) {
|
||||
console.log(newVal, 'newVal');
|
||||
if (newVal) {
|
||||
this.totalGlassNum = 0;
|
||||
this.tableData = [];
|
||||
// 累加所有项目的downLoadNumDay
|
||||
this.totalDownLoadNumDay = 0;
|
||||
this.totalDownLoadNumClass = 0
|
||||
// 遍历每条产线数据
|
||||
newVal.forEach(item => {
|
||||
// 计算当前项目的glassNum总和
|
||||
const glassArray = JSON.parse(item.glassNum);
|
||||
const itemGlassSum = glassArray.reduce((sum, num) => sum + num, 0);
|
||||
this.tableData.push({
|
||||
lineName: item.lineName,
|
||||
glassSum: itemGlassSum,
|
||||
downLoadNumDay:item.downLoadNumDay,
|
||||
downLoadNumClass: item.downLoadNumClass
|
||||
});
|
||||
|
||||
// 累加downLoadNumDay
|
||||
this.totalDownLoadNumDay += item.downLoadNumDay;
|
||||
this.totalDownLoadNumClass += item.downLoadNumClass;
|
||||
|
||||
});
|
||||
let eqArr = this.tableData.map((item, index) => [
|
||||
`<span style="color:#000;" >${index+1 || ''}
|
||||
</span>`,
|
||||
`<span style="color:#000;" >${item.lineName || ''}
|
||||
</span>`,
|
||||
// formatDate(item.planStartTime) || '',
|
||||
`
|
||||
<span style="color:#000;" >${item.downLoadNumClass || ''}
|
||||
</span>`,
|
||||
`<span style="color:#000;">${item.downLoadNumDay || ''}</span>`,
|
||||
`<span style="color:#000;">${item.glassSum || ''}</span>`,
|
||||
])
|
||||
this.config.data = eqArr
|
||||
this.$refs['locationScrollBoardTable'].updateRows(eqArr)
|
||||
}
|
||||
// this.getChart(this.todayClass)
|
||||
},
|
||||
deep: true // 深度监听
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
totalDownLoadNumDay: 0,
|
||||
totalDownLoadNumClass:0,
|
||||
config:{
|
||||
header: ['<span style="color:#000;">序号</span>', '<span style="color:#000;">产线</span>', '<span style="color:#000;">本班</span>', '<span style="color:#000;">本日</span>', '<span style="color:#000;">一托玻璃数量</span>'],
|
||||
headerHeight: 30,
|
||||
@@ -39,11 +95,6 @@ export default {
|
||||
columnWidth: [70, 125, 125, 125, 130],
|
||||
align : ['center', 'center', 'center', 'center', 'center'],
|
||||
data: [
|
||||
['<span style="color:#000;">1</span>', '<span style="color:#000;">A1</span>', '<span style="color:#000;">23</span>', '<span style="color:#000;">234</span>', '<span style="color:#000;">234</span>'],
|
||||
['<span style="color:#000;">2</span>', '<span style="color:#000;">A2</span>', '<span style="color:#000;">13</span>', '<span style="color:#000;">234</span>','<span style="color:#000;">234</span>'],
|
||||
['<span style="color:#000;">3</span>', '<span style="color:#000;">A3</span>', '<span style="color:#000;">24</span>', '<span style="color:#000;">234</span>', '<span style="color:#000;">234</span>'],
|
||||
['<span style="color:#000;">4</span>', '<span style="color:#000;">A4</span>', '<span style="color:#000;">45</span>', '<span style="color:#000;">234</span>', '<span style="color:#000;">234</span>'],
|
||||
['<span style="color:#000;">5</span>', '<span style="color:#000;">A5</span>', '<span style="color:#000;">55</span>', '<span style="color:#000;">234</span>', '<span style="color:#000;">234</span>']
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -98,4 +149,4 @@ export default {
|
||||
}
|
||||
}
|
||||
|
||||
</style>
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user