|
|
@@ -1,4 +1,5 @@
|
|
|
import { GljType, IBaseGlj, IInfoPriceItem, TaxType } from '@sc/types';
|
|
|
+import { roundForObj } from '@sc/util';
|
|
|
|
|
|
export const getInfoMarketPrice = (info: IInfoPriceItem, taxType: TaxType) => {
|
|
|
// 1: 一般计税 2: 简易计税
|
|
|
@@ -14,6 +15,13 @@ export const getInfoMarketPrice = (info: IInfoPriceItem, taxType: TaxType) => {
|
|
|
return parseFloat(infoPrice);
|
|
|
};
|
|
|
|
|
|
+// 计算采保费率后的市场价
|
|
|
+export const calcMarketPriceByInfoPrice = (infoPrice: number, purchaseFeeRate: number, decimal: number) => {
|
|
|
+ if (!purchaseFeeRate) return infoPrice;
|
|
|
+ return roundForObj(infoPrice * (1 + purchaseFeeRate / 100), decimal);
|
|
|
+};
|
|
|
+
|
|
|
+// roundForObj()
|
|
|
// 返回五大项组成的索引
|
|
|
export const getIndex = (obj: IBaseGlj, pops = ['code', 'name', 'specs', 'unit', 'type']): string => {
|
|
|
let index = '';
|