This commit is contained in:
xd 2024-05-09 17:28:24 +08:00
parent be70da84cb
commit bc43f03800
2 changed files with 11 additions and 10 deletions

View File

@ -1,5 +1,14 @@
import request from '@/utils/request'
// 金额计算
export function toDecimal(x){
let f = parseFloat(x);
if (isNaN(f)) {
return;
}
f = Math.round(x*100)/100;
return f;
}
// 获取目录
export function productList(query) {
return request({

View File

@ -95,7 +95,7 @@
</style>
<script>
import { productList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData} from "@/api/redBook/redBook";
import {toDecimal, productList,productRemarkList,productXinghList,judgeparent,productZlList,productYsxhListCheck,productYsxhList,productJmListCheck,productJmList,searchData} from "@/api/redBook/redBook";
export default {
name: "productSelect",
@ -372,18 +372,10 @@
row.percent2 = percent2;
row.setPrice = price;
row.count = count;
const allPrice = this.toDecimal(count*price);
const allPrice = toDecimal(count*price);
row.allPrice = allPrice;
this.selectedResultData.push(row)
},
toDecimal(x){
var f = parseFloat(x);
if (isNaN(f)) {
return;
}
f = Math.round(x*100)/100;
return f;
},
//
handleDeleteClick(index){