fix:coding#443生产报告小数点问题

This commit is contained in:
shijing 2024-08-05 14:46:06 +08:00
parent 32d659912e
commit 0a34b50fef
6 changed files with 22 additions and 22 deletions

View File

@ -75,9 +75,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8].toFixed(2) }}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -441,8 +441,8 @@ export default {
mounted() { mounted() {
function precen(a, b) { function precen(a, b) {
if (b !== 0 && b !== null && a !== null) { if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2); let precen = (a / b)* 100;
return precen * 100 + "%"; return precen.toFixed(2) + "%";
} else { } else {
return "/"; return "/";
} }

View File

@ -85,9 +85,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8].toFixed(2) }}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>

View File

@ -77,9 +77,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8].toFixed(2) }}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -577,8 +577,8 @@ export default {
mounted() { mounted() {
function precen(a, b) { function precen(a, b) {
if (b !== 0 && b !== null && a !== null) { if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2); let precen = (a / b) * 100;
return precen * 100 + "%"; return precen.toFixed(2) + "%";
} else { } else {
return "/"; return "/";
} }

View File

@ -59,9 +59,9 @@
> >
{{ item[4] }} {{ item[4] }}
</td> </td>
<td class="numCell">{{ item[5] }}</td> <td class="numCell">{{ item[5].toFixed(2) }}</td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7].toFixed(2) }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -403,8 +403,8 @@ export default {
mounted() { mounted() {
function precen(a, b) { function precen(a, b) {
if (b !== 0 && b !== null && a !== null) { if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2); let precen = (a / b)* 100;
return precen * 100 + "%"; return precen.toFixed(2) + "%";
} else { } else {
return "/"; return "/";
} }

View File

@ -78,9 +78,9 @@
> >
{{ item[5] }} {{ item[5] }}
</td> </td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td> <td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8].toFixed(2) }}</td>
<td class="numCell">{{ item[9] }}</td> <td class="numCell">{{ item[9] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -775,8 +775,8 @@ export default {
mounted() { mounted() {
function precen(a, b) { function precen(a, b) {
if (b !== 0 && b !== null && a !== null) { if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2); let precen = (a / b)* 100;
return precen * 100 + "%"; return precen.toFixed(2) + "%";
} else { } else {
return "/"; return "/";
} }

View File

@ -59,9 +59,9 @@
> >
{{ item[4] }} {{ item[4] }}
</td> </td>
<td class="numCell">{{ item[5].toFixed(2) }}</td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[6] }}</td>
<td class="numCell">{{ item[6] }}</td> <td class="numCell">{{ item[7].toFixed(2) }}</td>
<td class="numCell">{{ item[7] }}</td>
<td class="numCell">{{ item[8] }}</td> <td class="numCell">{{ item[8] }}</td>
</tr> </tr>
</tbody> </tbody>
@ -427,8 +427,8 @@ export default {
mounted() { mounted() {
function precen(a, b) { function precen(a, b) {
if (b !== 0 && b !== null && a !== null) { if (b !== 0 && b !== null && a !== null) {
let precen = (a / b).toFixed(2); let precen = (a / b)* 100;
return precen * 100 + "%"; return precen.toFixed(2) + "%";
} else { } else {
return "/"; return "/";
} }