排产看板代码提交

dev-scheduling
zhangdi 4 hours ago
parent 9339b84484
commit 9322be557e
  1. 9
      src/api/productionSchedulingPlan/scheduling.js
  2. 6
      src/axios.js
  3. 72
      src/views/productionSchedulingPlan/statisticalAnalysis/index.vue

@ -20,4 +20,13 @@ export const getYieldOrderList = (current, size, params) => {
size,
},
});
};
// 排产看板数据
export const schedulingCount = row => {
return request({
url: '/blade-scheduling/workOrder/schedulingCount',
method: 'post',
data: row,
});
};

@ -87,9 +87,9 @@ axios.interceptors.request.use(
config.headers['Content-Type'] = 'text/plain';
}
//headers中配置serialize为true开启序列化
if (config.method === 'post' && meta.isSerialize === true) {
config.data = serialize(config.data);
}
// if (config.method === 'post' && meta.isSerialize === true) {
// config.data = serialize(config.data);
// }
return config;
},
error => {

@ -19,12 +19,15 @@
>
<template #menu-left> </template>
<template #menu-right> </template>
<template #menu="{ row }"> </template>
<template #schedulingRate="{ row }">
{{row.schedulingRate}}%
</template>
</avue-crud>
</basic-container>
</template>
<script>
import { schedulingCount } from '@/api/productionSchedulingPlan/scheduling';
export default {
components: {},
data() {
@ -50,6 +53,7 @@ export default {
tree: false,
border: true,
index: true,
indexWidth: 80,
selection: false,
addBtn: false,
editBtn: false,
@ -81,29 +85,29 @@ export default {
menu: false,
column: [
{
label: '班组',
prop: '班组',
label: '作业中心',
prop: 'workCenterName',
search: false,
sortable: true,
span: 12,
},
{
label: '总订单',
prop: 'partCode',
prop: 'totalCount',
search: false,
sortable: true,
span: 12,
},
{
label: '排产订单',
prop: '排产订单',
prop: 'schedulingCount',
search: false,
sortable: true,
span: 12,
},
{
label: '排产率',
prop: '排产率',
prop: 'schedulingRate',
search: false,
sortable: true,
span: 12,
@ -119,6 +123,8 @@ export default {
searchRange: true,
startPlaceholder: '开始时间',
endPlaceholder: '结束时间',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
},
],
showSummary: true,
@ -133,8 +139,7 @@ export default {
if (columns.length > 0) {
columns.forEach((column, index) => {
let prop = column.property;
console.log('column, index',column, index)
if (['partCode', '排产订单', '排产率'].includes(prop)) {
if (['totalCount', 'schedulingCount', 'schedulingRate'].includes(prop)) {
let values = this.data.map(item => Number(item[prop] || 0));
let all =
values.length !== 0
@ -142,20 +147,20 @@ export default {
return a + b;
}))
: 0;
if (prop == 'partCode') {
if (prop == 'totalCount') {
sums[index] = all;
} else if (prop == '排产订单') {
} else if (prop == 'schedulingCount') {
sums[index] = all;
} else if (prop == '排产率') {
sums[index] = (all / values.length)+'%' || 0;
} else if (prop == 'schedulingRate') {
// sums[index] = all / values.length + '%' || 0;
sums[index] = ((sums[3]/sums[2])*100).toFixed(2)+ '%' || 0
}
} else {
if(index==0){
if (index == 0) {
sums[index] = '总计';
}else{
sums[index] = '';
} else {
sums[index] = '-';
}
}
});
}
@ -167,6 +172,7 @@ export default {
},
searchChange(params, done) {
this.query = params;
this.page.currentPage = 1;
this.onLoad(this.page, params);
done();
@ -182,28 +188,20 @@ export default {
},
onLoad(page, params = {}) {
console.log(9999999,!!params.cycledate,(!!params.cycledate)&&params.cycledate.lenght>0)
this.loading = true;
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;
this.loading = false;
// this.page.total = res.data.data.total
// this.selectionClear();
// });
this.data = [];
if(!!params.cycledate){
this.query.startTime=params.cycledate[0]
this.query.endTime=params.cycledate[1]
}
schedulingCount(this.query).then(
res => {
this.data = res.data.data;
this.loading = false;
this.page.total = res.data.data.total;
}
);
},
},
mounted() {},

Loading…
Cancel
Save