瀏覽代碼

施工图预算,根据设置隐藏工程量清单

MaiXinRong 3 年之前
父節點
當前提交
d37562a404
共有 1 個文件被更改,包括 5 次插入4 次删除
  1. 5 4
      app/controller/budget_controller.js

+ 5 - 4
app/controller/budget_controller.js

@@ -196,7 +196,7 @@ module.exports = app => {
             }
         }
 
-        _getSpreadSetting(type) {
+        _getSpreadSetting(needGcl) {
             const spreadSetting = {
                 cols: [
                     {title: '项目节编号', colSpan: '1', rowSpan: '2', field: 'code', hAlign: 0, width: 180, formatter: '@', cellType: 'tree'},
@@ -220,7 +220,7 @@ module.exports = app => {
                 font: '12px 微软雅黑',
             };
             // todo 根据设置判断预算是否需要清单
-            if (type !== 'yu') {
+            if (!needGcl) {
                 spreadSetting.cols = spreadSetting.cols.filter(x => {
                     return ['b_code', 'quantity', 'unit_price'].indexOf(x.field) < 0;
                 });
@@ -243,10 +243,11 @@ module.exports = app => {
 
         async detail(ctx) {
             try {
+                const needGcl = await this._getNeedGcl();
                 const renderData = {
-                    spreadSetting: this._getSpreadSetting(ctx.params.btype),
+                    spreadSetting: this._getSpreadSetting(needGcl),
                     jsFiles: this.app.jsFiles.common.concat(this.app.jsFiles.budget.detail),
-                    needGcl: await this._getNeedGcl(),
+                    needGcl,
                 };
                 [renderData.stdBills, renderData.stdChapters] = await ctx.service.budgetStd.getStdList(ctx.budget.std_id, ctx.params.btype);
                 await this.layout('budget/detail.ejs', renderData, 'budget/detail_modal.ejs');