|
@@ -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);
|
|
|
// 如果实际行存在珠海地区的,才填计算式
|