Merge remote-tracking branch 'origin/dev-scheduling' into dev-scheduling

dev-scheduling
liuqingkun 5 hours ago
commit 2a95edf82a
  1. 86
      src/views/productionSchedulingPlan/statisticalAnalysis/index.vue

@ -15,6 +15,7 @@
@size-change="sizeChange"
@refresh-change="refreshChange"
@on-load="onLoad"
:summary-method="summaryMethod"
>
<template #menu-left> </template>
<template #menu-right> </template>
@ -24,8 +25,6 @@
</template>
<script>
export default {
components: {},
data() {
@ -84,60 +83,84 @@ export default {
{
label: '班组',
prop: '班组',
search: true,
sortable: true,
span: 12,
hide:true,
},
{
label: '设备',
prop: '设备',
search: true,
search: false,
sortable: true,
span: 12,
hide:true,
},
{
label: '生成订单项数',
label: '总订单',
prop: 'partCode',
search: false,
sortable: true,
span: 12,
},
{
label: 'MES排产项数',
prop: '自动排产率',
label: '排产订单',
prop: '排产订单',
search: false,
sortable: true,
span: 12,
},
{
label: '自动排产率',
prop: '自动排产率',
{
label: '排产率',
prop: '排产率',
search: false,
sortable: true,
span: 12,
},
{
label: '排产时间',
label: '时间',
prop: 'cycledate',
search: true,
sortable: true,
span: 12,
hide:true,
type: "date",
hide: true,
type: 'date',
searchRange: true,
startPlaceholder: "开始时间",
endPlaceholder: "结束时间",
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
},
],
showSummary: true,
},
data: [],
};
},
methods: {
summaryMethod({ columns, data }) {
const sums = [];
if (columns.length > 0) {
columns.forEach((column, index) => {
let prop = column.property;
console.log('column, index',column, index)
if (['partCode', '排产订单', '排产率'].includes(prop)) {
let values = this.data.map(item => Number(item[prop] || 0));
let all =
values.length !== 0
? (sums[index] = values.reduce((a, b) => {
return a + b;
}))
: 0;
if (prop == 'partCode') {
sums[index] = all;
} else if (prop == '排产订单') {
sums[index] = all;
} else if (prop == '排产率') {
sums[index] = (all / values.length)+'%' || 0;
}
} else {
if(index==0){
sums[index] = '总计';
}else{
sums[index] = '无';
}
}
});
}
return sums;
},
searchReset() {
this.query = {};
this.onLoad(this.page);
@ -160,7 +183,20 @@ export default {
onLoad(page, params = {}) {
this.loading = true;
this.data = [];
this.data = [
{
班组: '班组1',
排产率: '80',
排产订单: '80',
partCode: '100',
},
{
班组: '班组2',
排产率: '80',
排产订单: '80',
partCode: '100',
},
];
this.page.total = this.data.length;
// getList(page.currentPage, page.pageSize, Object.assign(params, this.query)).then(res => {
// this.data = res.data.data.records;

Loading…
Cancel
Save