浏览代码

feat: 信息价显示空数据,相似材料筛选改为默认筛选名称; ai填值需要判断单位是否一致

vian 8 月之前
父节点
当前提交
82f7ffa5b9
共有 1 个文件被更改,包括 8 次插入5 次删除
  1. 8 5
      web/maintain/price_info_lib/js/priceEmpty.js

+ 8 - 5
web/maintain/price_info_lib/js/priceEmpty.js

@@ -69,7 +69,8 @@ const EMPTY_BOOK = (() => {
 
   // 获取材料关键字: 名称 规格
   const getKeyword = (item) => {
-    return item ? `${item.name} ${item.specs}` : '';
+    // return item ? `${item.name} ${item.specs}` : '';
+    return item ? `${item.name}` : '';
   }
 
   // 改变关键字
@@ -388,13 +389,15 @@ const EMPTY_BOOK = (() => {
         matchRes.forEach((item, index) => {
           const firstMatch = item[0];
           const chunkItem = chunk[index];
-          // 相似度过低的不命中
-          if (firstMatch.similarity < 70) {
+          const summaryIndex = item[0].index;
+          const summaryItem = summaryData[index][summaryIndex];
+          const curUnit = cache[chunkItem.row]?.unit || '';
+          const summaryItemUnit = summaryItem?.unit || '';
+          // 相似度过低的、单位不一致的,不命中
+          if (firstMatch.similarity < 70 || curUnit !== summaryItemUnit) {
             noMatchRows.push(chunkItem.row);
             return;
           };
-          const summaryIndex = item[0].index;
-          const summaryItem = summaryData[index][summaryIndex];
           if (chunkItem && summaryItem) {
             workBookObj.sheet.setValue(chunkItem.row, classCodeCol, summaryItem.classCode);
             // 如果实际行存在珠海地区的,才填计算式