|
@@ -1,4 +1,4 @@
|
|
|
-import { IBaseGlj, IInfoPriceItem, TaxType } from '@sc/types';
|
|
|
|
|
|
|
+import { GljType, IBaseGlj, IInfoPriceItem, TaxType } from '@sc/types';
|
|
|
|
|
|
|
|
export const getInfoMarketPrice = (info: IInfoPriceItem, taxType: TaxType) => {
|
|
export const getInfoMarketPrice = (info: IInfoPriceItem, taxType: TaxType) => {
|
|
|
// 1: 一般计税 2: 简易计税
|
|
// 1: 一般计税 2: 简易计税
|
|
@@ -25,3 +25,20 @@ export const getIndex = (obj: IBaseGlj, pops = ['code', 'name', 'specs', 'unit',
|
|
|
index = arr.join('|-|');
|
|
index = arr.join('|-|');
|
|
|
return index;
|
|
return index;
|
|
|
};
|
|
};
|
|
|
|
|
+
|
|
|
|
|
+// 是否是人工
|
|
|
|
|
+export const isLabour = (type: GljType) => {
|
|
|
|
|
+ return type === GljType.LABOUR;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 是否是材料
|
|
|
|
|
+export const isMaterial = (type: GljType) => {
|
|
|
|
|
+ const rootType = +String(type).charAt(0);
|
|
|
|
|
+ return rootType === 2;
|
|
|
|
|
+};
|
|
|
|
|
+
|
|
|
|
|
+// 是否是机械
|
|
|
|
|
+export const isMachine = (type: GljType) => {
|
|
|
|
|
+ const rootType = +String(type).charAt(0);
|
|
|
|
|
+ return rootType === 3;
|
|
|
|
|
+};
|