排产看板代码提交

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

@ -21,3 +21,12 @@ export const getYieldOrderList = (current, size, params) => {
}, },
}); });
}; };
// 排产看板数据
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'; config.headers['Content-Type'] = 'text/plain';
} }
//headers中配置serialize为true开启序列化 //headers中配置serialize为true开启序列化
if (config.method === 'post' && meta.isSerialize === true) { // if (config.method === 'post' && meta.isSerialize === true) {
config.data = serialize(config.data); // config.data = serialize(config.data);
} // }
return config; return config;
}, },
error => { error => {

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

Loading…
Cancel
Save