Compare commits

..

No commits in common. '610458855f9cf2ec85568e0a1a25cf5699cd6eb8' and 'fa662a5ec0e463822e8bb5e1b0e7ce8a7d41eb5f' have entirely different histories.

  1. 9
      src/api/productionSchedulingPlan/scheduling.js
  2. 6
      src/axios.js
  3. 72
      src/views/productionSchedulingPlan/statisticalAnalysis/index.vue

@ -20,13 +20,4 @@ export const getYieldOrderList = (current, size, params) => {
size, 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'; 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,15 +19,12 @@
> >
<template #menu-left> </template> <template #menu-left> </template>
<template #menu-right> </template> <template #menu-right> </template>
<template #schedulingRate="{ row }"> <template #menu="{ row }"> </template>
{{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() {
@ -53,7 +50,6 @@ 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,
@ -85,29 +81,29 @@ export default {
menu: false, menu: false,
column: [ column: [
{ {
label: '作业中心', label: '班组',
prop: 'workCenterName', prop: '班组',
search: false, search: false,
sortable: true, sortable: true,
span: 12, span: 12,
}, },
{ {
label: '总订单', label: '总订单',
prop: 'totalCount', prop: 'partCode',
search: false, search: false,
sortable: true, sortable: true,
span: 12, span: 12,
}, },
{ {
label: '排产订单', label: '排产订单',
prop: 'schedulingCount', prop: '排产订单',
search: false, search: false,
sortable: true, sortable: true,
span: 12, span: 12,
}, },
{ {
label: '排产率', label: '排产率',
prop: 'schedulingRate', prop: '排产率',
search: false, search: false,
sortable: true, sortable: true,
span: 12, span: 12,
@ -123,8 +119,6 @@ export default {
searchRange: true, searchRange: true,
startPlaceholder: '开始时间', startPlaceholder: '开始时间',
endPlaceholder: '结束时间', endPlaceholder: '结束时间',
format: 'YYYY-MM-DD',
valueFormat: 'YYYY-MM-DD',
}, },
], ],
showSummary: true, showSummary: true,
@ -139,7 +133,8 @@ 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;
if (['totalCount', 'schedulingCount', 'schedulingRate'].includes(prop)) { console.log('column, index',column, index)
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
@ -147,20 +142,20 @@ export default {
return a + b; return a + b;
})) }))
: 0; : 0;
if (prop == 'totalCount') { if (prop == 'partCode') {
sums[index] = all; sums[index] = all;
} else if (prop == 'schedulingCount') { } else if (prop == '排产订单') {
sums[index] = all; sums[index] = all;
} else if (prop == 'schedulingRate') { } else if (prop == '排产率') {
// 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] = '';
} }
} }
}); });
} }
@ -172,7 +167,6 @@ 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();
@ -188,20 +182,28 @@ 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){ {
this.query.startTime=params.cycledate[0] 班组: '班组1',
this.query.endTime=params.cycledate[1] 排产率: '80',
} 排产订单: '80',
schedulingCount(this.query).then( partCode: '100',
res => { },
this.data = res.data.data; {
this.loading = false; 班组: '班组2',
this.page.total = res.data.data.total; 排产率: '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();
// });
}, },
}, },
mounted() {}, mounted() {},

Loading…
Cancel
Save