Compare commits

..

2 Commits

@ -44,7 +44,7 @@ export default {
{ type: 'seq', width: 60, title: '序号' }, { type: 'seq', width: 60, title: '序号' },
{ field: 'label', title: '跨',}, { field: 'label', title: '跨',},
{ field: 'quantity', title: '数量',}, { field: 'quantity', title: '数量',},
{ field: 'weight', title: '重量',}, { field: 'weight', title: '重量',formatter:this.weightFormat},
] ]
const path=this.$route.path const path=this.$route.path
switch (path){ switch (path){
@ -126,8 +126,8 @@ export default {
const wc = [], point = [] const wc = [], point = []
const 一跨完成数据=data.filter(item=> item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '二区'&&['7','8'].includes(item.kw)) const 一跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '二区' && ['7', '8','9'].includes(item.kw))
const 一跨计划数量=data.filter(item=> item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '二区'&&['7','8'].includes(item.kw)).length const 一跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '二区' && ['7', '8','9'].includes(item.kw)).length
let 一跨完成率 = '0' let 一跨完成率 = '0'
if (一跨计划数量) { if (一跨计划数量) {
@ -136,9 +136,11 @@ export default {
point.push({kua: '1跨', c: 一跨完成率, n: 一跨完成率 > 100 ? '0' : (100 - 一跨完成率).toFixed(2)}) point.push({kua: '1跨', c: 一跨完成率, n: 一跨完成率 > 100 ? '0' : (100 - 一跨完成率).toFixed(2)})
wc.push({ label: '1跨', quantity: 一跨完成数据.length, weight: 一跨完成数据.reduce((accumulator, currentValue) => { wc.push({
label: '1跨', quantity: 一跨完成数据.length, weight: 一跨完成数据.reduce((accumulator, currentValue) => {
return accumulator + (currentValue?.bcshzl || 0) / 1000; return accumulator + (currentValue?.bcshzl || 0) / 1000;
}, 0) },) }, 0)
},)
const 二跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '三区') const 二跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '三区')
const 二跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '三区').length const 二跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '三区').length
@ -150,9 +152,11 @@ export default {
point.push({kua: '2跨', c: 二跨完成率, n: 二跨完成率 > 100 ? '0' : (100 - 二跨完成率).toFixed(2)}) point.push({kua: '2跨', c: 二跨完成率, n: 二跨完成率 > 100 ? '0' : (100 - 二跨完成率).toFixed(2)})
wc.push({ label: '2跨', quantity: 二跨完成数据.length, weight: 二跨完成数据.reduce((accumulator, currentValue) => { wc.push({
label: '2跨', quantity: 二跨完成数据.length, weight: 二跨完成数据.reduce((accumulator, currentValue) => {
return accumulator + (currentValue.bcshzl || 0) / 1000; return accumulator + (currentValue.bcshzl || 0) / 1000;
}, 0) },) }, 0)
},)
const 三跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '二区' && ['6', '13', '14'].includes(item.kw)) const 三跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '二区' && ['6', '13', '14'].includes(item.kw))
const 三跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '二区' && ['6', '13', '14'].includes(item.kw)).length const 三跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '二区' && ['6', '13', '14'].includes(item.kw)).length
@ -164,13 +168,18 @@ export default {
point.push({kua: '3跨', c: 三跨完成率, n: 三跨完成率 > 100 ? '0' : (100 - 三跨完成率).toFixed(2)}) point.push({kua: '3跨', c: 三跨完成率, n: 三跨完成率 > 100 ? '0' : (100 - 三跨完成率).toFixed(2)})
wc.push({ label: '3跨', quantity: 三跨完成数据.length, weight: 三跨完成数据.reduce((accumulator, currentValue) => { wc.push({
label: '3跨', quantity: 三跨完成数据.length, weight: 三跨完成数据.reduce((accumulator, currentValue) => {
return accumulator + (currentValue.bcshzl || 0) / 1000; return accumulator + (currentValue.bcshzl || 0) / 1000;
}, 0) },) }, 0)
},)
const 四跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '四区') const 四跨完成数据 = data.filter(item => item.qgfkrq >= date && item.qgfkrq < nextDate && item.zyq1 === '四区')
const 四跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '四区').length const 四跨计划数量 = data.filter(item => item.qgjhrq >= date && item.qgjhrq < endOfMonth && item.zyq1 === '四区').length
const _四跨完成数据 = data.filter(item => item.qgfkrq>='2025/05/26 00:00:00' && item.zyq1 === '四区')
console.log(_四跨完成数据,date)
let 四跨完成率 = '0.00' let 四跨完成率 = '0.00'
if (四跨计划数量) { if (四跨计划数量) {
四跨完成率 = (四跨完成数据.length / 四跨计划数量 * 100).toFixed(2) 四跨完成率 = (四跨完成数据.length / 四跨计划数量 * 100).toFixed(2)
@ -178,11 +187,16 @@ export default {
point.push({kua: '4,5,6跨', c: 四跨完成率, n: 四跨完成率 > 100 ? '0' : (100 - 四跨完成率).toFixed(2)}) point.push({kua: '4,5,6跨', c: 四跨完成率, n: 四跨完成率 > 100 ? '0' : (100 - 四跨完成率).toFixed(2)})
wc.push({ label: '4、5、6跨', quantity: 四跨完成数据.length, weight: 四跨完成数据.reduce((accumulator, currentValue) => { wc.push({
label: '4、5、6跨', quantity: 四跨完成数据.length, weight: 四跨完成数据.reduce((accumulator, currentValue) => {
return accumulator + (currentValue.bcshzl || 0) / 1000; return accumulator + (currentValue.bcshzl || 0) / 1000;
}, 0) },) }, 0)
},)
return {point, wc} return {point, wc}
},
weightFormat({cellValue}) {
return XEUtils.toNumber(cellValue).toFixed(2)
} }
} }
} }

@ -28,6 +28,7 @@ const 作业计划完成量统计=()=>{
formData:{ formData:{
from:XEUtils.toDateString(new Date(),'yyyy/MM/dd'), from:XEUtils.toDateString(new Date(),'yyyy/MM/dd'),
to:XEUtils.toDateString(new Date(),'yyyy/MM/dd'), to:XEUtils.toDateString(new Date(),'yyyy/MM/dd'),
ylbs:'n',
}, },
formItems:[ formItems:[
{ field: 'from', title: '开始日期', span: 4, { field: 'from', title: '开始日期', span: 4,

@ -65,8 +65,6 @@
ref="xGrid" ref="xGrid"
border border
resizable resizable
:scroll-y="{enabled: true}"
:align="'center'" :align="'center'"
:height="height" :height="height"
:columns="tableColumn" :columns="tableColumn"
@ -720,7 +718,7 @@ export default {
filename: '月度计划追踪记录',// filename: '月度计划追踪记录',//
sheetName: 'Sheet1', sheetName: 'Sheet1',
type: 'xlsx',// xlsx csv type: 'xlsx',// xlsx csv
data: this.data, // data: this.list, //
// sheetMethod: this.sheetMethod, // sheetMethod: this.sheetMethod,
useStyle: true, useStyle: true,
// //

Loading…
Cancel
Save