Browse Source

fix--项目满意率数据有问题

master
buaixuexideshitongxue 1 month ago
parent
commit
055bb2df7e
  1. 27
      src/views/datav/Jwpy.vue

27
src/views/datav/Jwpy.vue

@ -185,18 +185,15 @@
:highlight-hover-row='false'
:data="tableData"
height="350"
:summary-cell-style="summaryCellStyle"
:summary-method="getSummaries"
:style="{ width: '100%', marginTop: '20px', fontSize: fontSize + 'px' }"
:header-cell-style="headerCellStyle"
:row-style="tableRowStyle"
:show-summary='true'
>
<el-table-column prop="Name" label="单项业务" width="77px"/>
<el-table-column prop="sdcl" label="有效数" width="77px"/>
<el-table-column prop="State3" label="有效数" width="77px"/>
<el-table-column prop="BasicallySatisfiedNum" label="基本满意数" width="77px"/>
<el-table-column prop="sbmys" label="不满意数" width="77px"/>
<el-table-column prop="smyl" label="满意率" width="77px"/>
<el-table-column prop="myl" label="满意率" width="77px"/>
<el-table-column prop="smyltb" label="同比" width="77px">
<template v-slot="scope">
<span :style="getCellStyle(scope.row.smyltb)" style="font-size: 15px">{{ scope.row.smyltb }}</span>
@ -838,7 +835,27 @@ async function getData() {
//
GetZRSJXF(selectYear.value, selectMonth.value, selectOrg.value, task.value).then((res) => {
let temp = res.lstShen
temp = temp.map(item => {
const state3 = Number(item.State3) || 0;
const satisfiedNum = Number(item.SatisfiedNum) || 0;
const basicallySatisfiedNum = Number(item.BasicallySatisfiedNum) || 0;
const myl = state3 === 0
? '0.00'
: (((satisfiedNum + basicallySatisfiedNum * 0.75) / state3) * 100).toFixed(2);
return {
...item,
myl
};
});
const totalItem = temp.find(item => item.Name === null);
temp = temp.filter(item => item.Name !== null);
if (totalItem) {
temp.push({
...totalItem,
Name: '总计'
});
}
tableData.value = temp
});
console.log('selectOrg', selectOrg.value)

Loading…
Cancel
Save