Explorar o código

Merge branch 'master' of http://192.168.1.41:3000/SmartCost/SCCommon

qinlaiqiao %!s(int64=4) %!d(string=hai) anos
pai
achega
464066f4e3

+ 1 - 1
types/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/types",
-  "version": "1.0.33",
+  "version": "1.0.34",
   "description": "共用类型文件",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 6 - 3
types/src/interface/bill.ts

@@ -146,8 +146,10 @@ export interface IBill extends IBRBase {
   checkPriceDiffResult?: string; // 材价差检测结果
   priceScope?: IPriceScope; // 价格区间
   classCode?: string; // 类别别名,清单经过机器检测后会加上
+  groupCode?: string; // 类别组,当机器检测结果不正确时,纠正措施
   checkRationResult?: string; // 机器检测结果(必套、选套、错套定额相关)
   checked?: boolean; // 是否已经进行清单检测过的清单,为true表式已经检测过了(用来计算通过率)
+  setParentQuantity?: boolean; // 是否打勾了填父量
   [key: string]: any; // 剩下的之后补充
 }
 
@@ -268,6 +270,7 @@ export interface IBillIndex {
   singleID: string;
   unitID: string;
   classCode: string; // 类别别名
+  groupCode?: string;
   code: string;
   name: string;
   unit: string;
@@ -281,8 +284,8 @@ export interface IBillIndex {
 
 export enum LibType {
   BILL = '1',
-  NORM = '2'
+  NORM = '2',
 }
 export interface IBillOption extends INumFileRef {
-  libType?: LibType
-}
+  libType?: LibType;
+}

+ 1 - 0
types/src/interface/project.ts

@@ -207,6 +207,7 @@ export interface IProperty {
   isItemIncrease?: boolean; // 是否是子目增加
   itemIncreaseSetting?: IIncreaseSetting;
   isAreaIncrease?: boolean; // 是否是面积增加
+  isShowRation?: boolean; // 是否显示定额
   areaIncreaseSetting?: IAreaIncreaseSetting; // 面积增加费设置
   indexName?: string; // 指标名称
   lockBills?: boolean; // 锁定清单

+ 1 - 1
wise-cost-util/package.json

@@ -1,6 +1,6 @@
 {
   "name": "@sc/wise-cost-util",
-  "version": "1.1.4",
+  "version": "1.1.5",
   "description": "wise-cost项目前后端业务通用工具包",
   "main": "./dist/index.cjs.js",
   "module": "./dist/index.esm.js",

+ 37 - 0
wise-cost-util/src/bill.ts

@@ -88,3 +88,40 @@ export const getItemCharacters = (stdBill: IStdBill, itemCharacterMap: IItemChar
 
   return characters;
 };
+
+// 对于含有中文的清单编号,分离出中文和数字
+export const separateBillCode = (code: string) => {
+  const result = code.match(/^([\u4e00-\u9fa5]+)(\d+)/);
+  if (result && result.length === 3) {
+    const pre = result[1];
+    const subCode = result[2];
+    return { pre, code: subCode };
+  }
+  return { pre: '', code };
+};
+
+/**
+ *
+ * @param sourceCode 清单ID
+ *
+ * 返回: isStd是否来自标准清单  code:标准清单编号
+ */
+export const matchAndGetStdBillCode = (sourceCode: string) => {
+  const { pre, code } = separateBillCode(sourceCode);
+  if (code.length === 12) {
+    return { isStd: true, code: pre + code.substring(0, 9) };
+  }
+  if (code.length === 9) {
+    return { isStd: true, code: pre + code };
+  }
+  return { isStd: false, code: sourceCode };
+};
+
+// 取标准清单编号
+export const getStdBillCode = (sourceCode: string) => {
+  const { isStd, code } = matchAndGetStdBillCode(sourceCode);
+  if (isStd) {
+    return code;
+  }
+  return '';
+};