|  | @@ -11,6 +11,7 @@
 | 
	
		
			
				|  |  |  const EmptyTenderHtml = [
 | 
	
		
			
				|  |  |      '',
 | 
	
		
			
				|  |  |  ];
 | 
	
		
			
				|  |  | +let selfLevelSort;
 | 
	
		
			
				|  |  |  const tenderTree = [];
 | 
	
		
			
				|  |  |  let parentId = 0;
 | 
	
		
			
				|  |  |  
 | 
	
	
		
			
				|  | @@ -35,9 +36,23 @@ function getPId(level) {
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  // 分类数据排序
 | 
	
		
			
				|  |  | +function loadSelfCategoryLevel(selfLevel){
 | 
	
		
			
				|  |  | +    selfLevelSort = selfLevel ? selfLevel.split(',') : [];
 | 
	
		
			
				|  |  | +    selfLevelSort = selfLevelSort.filter(x => {
 | 
	
		
			
				|  |  | +        return category.find(c => { return c.id + '' === x; });
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +    category.forEach(cate => {
 | 
	
		
			
				|  |  | +        cate.is_self = selfLevelSort.length > 0;
 | 
	
		
			
				|  |  | +        cate.self_level = selfLevelSort.indexOf(cate.id + '') + 1;
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  | +}
 | 
	
		
			
				|  |  | +// 分类数据排序
 | 
	
		
			
				|  |  |  function sortCategory() {
 | 
	
		
			
				|  |  | +    category.forEach(cate => {
 | 
	
		
			
				|  |  | +        cate.show_level = cate.is_self ? cate.self_level : cate.level;
 | 
	
		
			
				|  |  | +    });
 | 
	
		
			
				|  |  |      category.sort(function (a, b) {
 | 
	
		
			
				|  |  | -        return a.level ? (b.level ? a.level - b.level : -1) : a.id - b.id;
 | 
	
		
			
				|  |  | +        return a.show_level ? (b.show_level ? a.show_level - b.show_level : -1) : a.id - b.id;
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |  }
 | 
	
		
			
				|  |  |  function calculateParent(node) {
 | 
	
	
		
			
				|  | @@ -62,7 +77,7 @@ function calculateParent(node) {
 | 
	
		
			
				|  |  |  // 初始化TenderTree数据
 | 
	
		
			
				|  |  |  function initTenderTree () {
 | 
	
		
			
				|  |  |      const levelCategory = category.filter(function (c) {
 | 
	
		
			
				|  |  | -        return c.level && c.level > 0;
 | 
	
		
			
				|  |  | +        return c.show_level && c.show_level > 0;
 | 
	
		
			
				|  |  |      });
 | 
	
		
			
				|  |  |      function findCategoryNode(cid, value, array) {
 | 
	
		
			
				|  |  |          for (const a of array) {
 | 
	
	
		
			
				|  | @@ -82,7 +97,7 @@ function initTenderTree () {
 | 
	
		
			
				|  |  |                  vid: value,
 | 
	
		
			
				|  |  |                  name: cateValue.value,
 | 
	
		
			
				|  |  |                  children: [],
 | 
	
		
			
				|  |  | -                level: i ? i : category.level,
 | 
	
		
			
				|  |  | +                level: i ? i : category.show_level,
 | 
	
		
			
				|  |  |                  sort_id: ++parentId,
 | 
	
		
			
				|  |  |                  sort: cateValue.sort,
 | 
	
		
			
				|  |  |              };
 | 
	
	
		
			
				|  | @@ -100,7 +115,9 @@ function initTenderTree () {
 | 
	
		
			
				|  |  |                  if (index === 0 && tender.category) {
 | 
	
		
			
				|  |  |                      for (const [i,c] of tender.category.entries()) {
 | 
	
		
			
				|  |  |                          const cate = findNode('id', c.cid, category);
 | 
	
		
			
				|  |  | -                        tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
 | 
	
		
			
				|  |  | +                        if (cate) {
 | 
	
		
			
				|  |  | +                            tenderCategory = getCategoryNode(cate, c.value, tenderCategory, i+1);
 | 
	
		
			
				|  |  | +                        }
 | 
	
		
			
				|  |  |                      }
 | 
	
		
			
				|  |  |                  }
 | 
	
		
			
				|  |  |                  return tenderCategory;
 | 
	
	
		
			
				|  | @@ -163,7 +180,8 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
 | 
	
		
			
				|  |  |      if (node.cid) {
 | 
	
		
			
				|  |  |          html.push('<td class="in-' + node.level + '">');
 | 
	
		
			
				|  |  |          html.push('<span onselectstart="return false" style="{-moz-user-select:none}" class="fold-switch mr-1" title="收起" cid="'+ node.sort_id +'"><i class="fa fa-minus-square-o"></i></span> <i class="fa fa-folder-o"></i> ', node.name);
 | 
	
		
			
				|  |  | -        html.push('</td><td></td><td></td>');
 | 
	
		
			
				|  |  | +        // html.push('</td><td></td><td></td>');
 | 
	
		
			
				|  |  | +        html.push('</td>');
 | 
	
		
			
				|  |  |      } else {
 | 
	
		
			
				|  |  |          html.push('<td colspan="3" class="in-' + node.level + '">');
 | 
	
		
			
				|  |  |          html.push('<div class="row">');
 | 
	
	
		
			
				|  | @@ -174,22 +192,22 @@ function recursiveGetTenderNodeHtml (node, arr, pid) {
 | 
	
		
			
				|  |  |          html.push('<a href="javascript: void(0)" id="' + node.id + '">', node.name, '</a></span>');
 | 
	
		
			
				|  |  |          html.push('<span class="col-auto ml-auto"></span>');
 | 
	
		
			
				|  |  |          html.push('</div>');
 | 
	
		
			
				|  |  | -        html.push('<div class="d-flex justify-content-between"><span>');
 | 
	
		
			
				|  |  | -        // 计量期数
 | 
	
		
			
				|  |  | -        if (!node.cid) {
 | 
	
		
			
				|  |  | -            html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | -        html.push('</span><span>');
 | 
	
		
			
				|  |  | -        // 累计合同计量
 | 
	
		
			
				|  |  | -        const sum = node.lastStage ? ZhCalc.add(node.total_price, node.lastStage.end_qc_tp) : node.total_price;
 | 
	
		
			
				|  |  | -        html.push(node.sum_tp ? node.sum_tp : '');
 | 
	
		
			
				|  |  | -        html.push('</span></div>');
 | 
	
		
			
				|  |  | -        // 截止本期累计完成/本期完成/未完成
 | 
	
		
			
				|  |  | -        if (node.lastStage) {
 | 
	
		
			
				|  |  | -            html.push(getProgressHtml(node.sum_tp, node.pre_gather_tp, node.gather_tp));
 | 
	
		
			
				|  |  | -        } else {
 | 
	
		
			
				|  |  | -            html.push('');
 | 
	
		
			
				|  |  | -        }
 | 
	
		
			
				|  |  | +        // html.push('<div class="d-flex justify-content-between"><span>');
 | 
	
		
			
				|  |  | +        // // 计量期数
 | 
	
		
			
				|  |  | +        // if (!node.cid) {
 | 
	
		
			
				|  |  | +        //     html.push(node.lastStage ? '第' + node.lastStage.order + '期' : '台账');
 | 
	
		
			
				|  |  | +        // }
 | 
	
		
			
				|  |  | +        // html.push('</span><span>');
 | 
	
		
			
				|  |  | +        // // 累计合同计量
 | 
	
		
			
				|  |  | +        // const sum = node.lastStage ? ZhCalc.add(node.total_price, node.lastStage.end_qc_tp) : node.total_price;
 | 
	
		
			
				|  |  | +        // html.push(node.sum_tp ? node.sum_tp : '');
 | 
	
		
			
				|  |  | +        // html.push('</span></div>');
 | 
	
		
			
				|  |  | +        // // 截止本期累计完成/本期完成/未完成
 | 
	
		
			
				|  |  | +        // if (node.lastStage) {
 | 
	
		
			
				|  |  | +        //     html.push(getProgressHtml(node.sum_tp, node.pre_gather_tp, node.gather_tp));
 | 
	
		
			
				|  |  | +        // } else {
 | 
	
		
			
				|  |  | +        //     html.push('');
 | 
	
		
			
				|  |  | +        // }
 | 
	
		
			
				|  |  |          html.push('</td>');
 | 
	
		
			
				|  |  |      }
 | 
	
		
			
				|  |  |      html.push('</tr>');
 | 
	
	
		
			
				|  | @@ -205,9 +223,9 @@ function getTenderTreeHtml () {
 | 
	
		
			
				|  |  |      const html = [];
 | 
	
		
			
				|  |  |      html.push('<table class="table">');
 | 
	
		
			
				|  |  |      html.push('<thead>', '<tr>');
 | 
	
		
			
				|  |  | -    html.push('<th>名称</th>');
 | 
	
		
			
				|  |  | -    html.push('<th width="120">计量期数</th>');
 | 
	
		
			
				|  |  | -    html.push('<th>总价</th>');
 | 
	
		
			
				|  |  | +    html.push('<th class="text-center">', subProject.name, '</th>');
 | 
	
		
			
				|  |  | +    // html.push('<th width="120">计量期数</th>');
 | 
	
		
			
				|  |  | +    // html.push('<th>总价</th>');
 | 
	
		
			
				|  |  |      html.push('</tr>', '</thead>');
 | 
	
		
			
				|  |  |      if (tenderTree.length > 0) {
 | 
	
		
			
				|  |  |          parentId = 0;
 |