|
@@ -746,11 +746,9 @@ function getItemClassData(nodes, prefix,
|
|
|
// 获取选套定额:把所有分类数据的必套定额确定好了先。选套定额就是清单下所有定额除了必套的
|
|
|
function getOptionalRationIDs(optionalRationData) {
|
|
|
const optionalRationIDs = [];
|
|
|
- if(optionalRationData){
|
|
|
- Object.values(optionalRationData).forEach(optionalRation => {
|
|
|
- if (optionalRation.length) optionalRationIDs.push(...optionalRation);
|
|
|
- })
|
|
|
- }
|
|
|
+ Object.values(optionalRationData).forEach(optionalRation => {
|
|
|
+ if (optionalRation.length) optionalRationIDs.push(...optionalRation);
|
|
|
+ })
|
|
|
return [...new Set(optionalRationIDs)];
|
|
|
}
|
|
|
|
|
@@ -920,17 +918,17 @@ async function generateClassData(libID) {
|
|
|
//console.log('getItemClassData start',billNode.data.name,billNode.data.code,billNode.data.ID);
|
|
|
const classCodeData = getItemClassData(guidanceTree.roots); // 必套定额在这个方法内就获取了,避免重复执行递归方法
|
|
|
const { requireRationData, optionalRationData, classGroups, IDData } = getItemData(guidanceTree.roots);
|
|
|
+
|
|
|
const { itemClassData, unMatchRation } = combineData(classCodeData, requireRationData, optionalRationData, classGroups, IDData);
|
|
|
|
|
|
const allRationIDs = guidanceTree.items.filter(node => !!node.data.rationID).map(node => node.data.rationID);
|
|
|
// 选套定额ID
|
|
|
- const optionalRationIDs = getOptionalRationIDs(itemClassData, allRationIDs);
|
|
|
+ const optionalRationIDs = getOptionalRationIDs(optionalRationData);
|
|
|
//if(itemClassData.length > 1000) console.log('getItemClassData end',billNode.data.name,billNode.data.code,billNode.data.ID,itemClassData.length)
|
|
|
itemClassData.forEach(item => {
|
|
|
// 错套定额
|
|
|
item.optionalRationIDs.push(...unMatchRation);
|
|
|
const errorRationIDs = getErrorRationIDs(item.requiredRationIDs, item.optionalRationIDs, allRationIDs);
|
|
|
- if (billNode.data.ID == '1d32fa34-0a9b-11ea-a33d-5388f9783b09') console.log(item.name)
|
|
|
billClassData.push({
|
|
|
itemCharacter: item.name,
|
|
|
class: classNum++,
|
|
@@ -950,7 +948,9 @@ async function generateClassData(libID) {
|
|
|
if (data.length) optionalRationIDs.push(...data);
|
|
|
})
|
|
|
})
|
|
|
+
|
|
|
const errorRationIDs = getErrorRationIDs([], optionalRationIDs, allRationIDs);
|
|
|
+
|
|
|
billClassData.push({
|
|
|
itemCharacter: '',
|
|
|
class: classNum++,
|
|
@@ -962,7 +962,6 @@ async function generateClassData(libID) {
|
|
|
optionalRationIDs: optionalRationIDs || [],
|
|
|
errorRationIDs,
|
|
|
});
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
console.log(`billClassData.length`);
|