|
@@ -2896,6 +2896,7 @@ $(function () {
|
|
|
|
|
|
function createBlocks(aNode, categoryID){
|
|
|
function createBlock(node) {
|
|
|
+ if (node.data.name == undefined || node.data.name == '') return; // 清单名称为空,不生成块模板文件
|
|
|
let name = node.data.code + ' ' + node.data.name + ' ' + node.data.unit;
|
|
|
name = name.replace(/^\s+|\s+$/g, ""); // 只去两头空格
|
|
|
blockLibObj.newNode(2, name, categoryID);
|
|
@@ -2904,10 +2905,7 @@ $(function () {
|
|
|
function createRecursion(node){
|
|
|
if (!node) return;
|
|
|
|
|
|
- if (calcTools.isLeafBill(node)){
|
|
|
- if (node.data.name == undefined || node.data.name == '') return // 清单名称为空,不生成块模板文件
|
|
|
- else createBlock(node);
|
|
|
- }
|
|
|
+ if (calcTools.isLeafBill(node)) createBlock(node);
|
|
|
|
|
|
if (node.firstChild()) createRecursion(node.firstChild());
|
|
|
if (node.nextSibling) createRecursion(node.nextSibling);
|