ソースを参照

关联台账,不计价相关

MaiXinRong 2 年 前
コミット
20ffb34cba

+ 2 - 2
app/controller/stage_controller.js

@@ -181,7 +181,8 @@ module.exports = app => {
                 await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
                 const projectFunInfo = await this.ctx.service.project.getFunRela(ctx.session.sessionProject.id);
-                [renderData.ledgerSpread, renderData.posSpread] = this._getSpreadSetting(projectFunInfo);
+                renderData.minusNoValue = projectFunInfo.minusNoValue && ctx.tender.info.fun_rela.stage_change.minusNoValue;
+                [renderData.ledgerSpread, renderData.posSpread] = this._getSpreadSetting({minusNoValue: renderData.minusNoValue});
                 const sjsRela = await this.ctx.service.project.getSjsRela(ctx.session.sessionProject.id);
                 this.ctx.helper.refreshSpreadShow(sjsRela.ledgerCol, [renderData.ledgerSpread, renderData.posSpread]);
                 renderData.changeConst = changeConst;
@@ -206,7 +207,6 @@ module.exports = app => {
                 renderData.sfData = sfData;
                 // 收方单附件删除权限
                 renderData.sfAttDelPower = ctx.session.sessionUser.accountId === ctx.stage.user_id || ctx.helper._.findIndex(ctx.stage.auditors2, { aid: ctx.session.sessionUser.accountId }) !== -1;
-                renderData.minusNoValue = projectFunInfo.minusNoValue && ctx.tender.info.fun_rela.stage_change.minusNoValue;
                 renderData.hintOver = projectFunInfo.hintOver && ctx.tender.info.fun_rela.hintOver;
                 renderData.categoryData = await this.ctx.service.category.getAllCategory(this.ctx.session.sessionProject.id);
                 await this.layout('stage/index.ejs', renderData, 'stage/modal.ejs');

+ 4 - 1
app/controller/stage_rela_controller.js

@@ -96,7 +96,10 @@ module.exports = app => {
                 if (!relaStage) throw '不存在该关联标段';
                 const renderData = await this._getDefaultRenderData(ctx);
                 renderData.jsFiles = this.app.jsFiles.common.concat(this.app.jsFiles.stageRela.detail);
-                [renderData.ledgerSpread, renderData.posSpread] = await spreadSetting.getStageSpreadSetting(ctx, null, true);
+                const relaTenderInfo = await this.ctx.service.tenderInfo.getTenderInfo(relaStage.rela_tid);
+                const projectFunInfo = await this.ctx.service.project.getFunRela(ctx.session.sessionProject.id);
+                renderData.minusNoValue = projectFunInfo.minusNoValue && relaTenderInfo.fun_rela.stage_change.minusNoValue;
+                [renderData.ledgerSpread, renderData.posSpread] = await spreadSetting.getStageSpreadSetting(ctx, null, true, {minusNoValue: renderData.minusNoValue});
                 renderData.measureType = measureType;
                 renderData.whiteList = this.ctx.app.config.multipart.whitelist;
                 renderData.curAuditor = ctx.stage.curAuditor;

+ 14 - 1
app/lib/spread_setting.js

@@ -25,6 +25,15 @@ function removeFieldCols(setting, cols) {
     });
 };
 
+function hiddenFieldCols(setting, cols) {
+    setting.cols.forEach(x => {
+        if (cols.indexOf(x.field) >= 0) {
+            x.defaultVisible = false;
+            x.visible = false;
+        }
+    });
+};
+
 function refreshSpreadShow(sjsRela, sjsSetting) {
     const sjsSettings = sjsSetting instanceof Array ? sjsSetting : [sjsSetting];
     for (const field of sjsRela) {
@@ -63,7 +72,7 @@ const getLedgerSpreadSetting = async function(ctx, tid, readOnly) {
     return [ledger, pos];
 };
 
-const getStageSpreadSetting = async function (ctx, tid, readOnly) {
+const getStageSpreadSetting = async function (ctx, tid, readOnly, funInfo) {
     const tender = tid ? await getCtxTender(ctx, tid) : ctx.tender;
 
     const stageSetting = tender.data.measure_type === measureType.tz.value
@@ -85,6 +94,10 @@ const getStageSpreadSetting = async function (ctx, tid, readOnly) {
         removeFieldCols(ledger, spreadConst.filterCols.thirdPartyCols.dagl);
         removeFieldCols(pos, spreadConst.filterCols.thirdPartyCols.dagl);
     }
+    if (!funInfo.minusNoValue || !tender.info.fun_rela.stage_change.minusNoValue) {
+        hiddenFieldCols(ledger, spreadConst.filterCols.minusNoValueCols);
+        hiddenFieldCols(pos, spreadConst.filterCols.minusNoValueCols);
+    }
     ledger.readOnly = readOnly;
     pos.readOnly = readOnly;
 

+ 8 - 2
app/public/js/sr_detail.js

@@ -910,14 +910,20 @@ $(document).ready(() => {
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量金额');
                 $('[name=type-title-qc]').text('本期变更计量金额');
-                $('#show-qc-minus-jl').parent().hidden();
-                $('#qc-minus-jl').parent().hidden();
+                if ($('#show-qc-minus-jl').length > 0) {
+                    $('#show-qc-minus-jl').parent().hide();
+                    $('#qc-minus-jl').parent().hide();
+                }
             } else {
                 const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                 jlCol.title = '本期计量数量';
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量数量');
                 $('[name=type-title-qc]').text('本期变更计量数量');
+                if ($('#show-qc-minus-jl').length > 0) {
+                    $('#show-qc-minus-jl').parent().show();
+                    $('#qc-minus-jl').parent().show();
+                }
             }
             if (relaStage.im_type === imType.bb.value || relaStage.im_type === imType.bw.value) {
                 $('#show-jldy').parent().show();

+ 16 - 8
app/public/js/stage.js

@@ -2921,16 +2921,20 @@ $(document).ready(() => {
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量金额');
                 $('[name=type-title-qc]').text('本期变更计量金额');
-                $('#show-qc-minus-jl').parent().hide();
-                $('#qc-minus-jl').parent().hide();
+                if ($('#show-qc-minus-jl').length > 0) {
+                    $('#show-qc-minus-jl').parent().hide();
+                    $('#qc-minus-jl').parent().hide();
+                }
             } else {
                 const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                 jlCol.title = '本期计量数量';
                 SpreadJsObj.reLoadSheetHeader(self.sheet);
                 $('[name=type-title-contract]').text('本期合同计量数量');
                 $('[name=type-title-qc]').text('本期变更计量数量');
-                $('#show-qc-minus-jl').parent().show();
-                $('#qc-minus-jl').parent().show();
+                if ($('#show-qc-minus-jl').length > 0) {
+                    $('#show-qc-minus-jl').parent().show();
+                    $('#qc-minus-jl').parent().show();
+                }
             }
             if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                 $('#show-jldy').parent().show();
@@ -3020,16 +3024,20 @@ $(document).ready(() => {
                         SpreadJsObj.reLoadSheetHeader(self.sheet);
                         $('[name=type-title-contract]').text('本期合同计量金额');
                         $('[name=type-title-qc]').text('本期变更计量金额');
-                        $('#show-qc-minus-jl').parent().hide();
-                        $('#qc-minus-jl').parent().hide();
+                        if ($('#show-qc-minus-jl').length > 0) {
+                            $('#show-qc-minus-jl').parent().hide();
+                            $('#qc-minus-jl').parent().hide();
+                        }
                     } else {
                         const jlCol = self.spreadSetting.cols.find(function (x) {return x.field === 'jl'});
                         jlCol.title = '本期计量数量';
                         SpreadJsObj.reLoadSheetHeader(self.sheet);
                         $('[name=type-title-contract]').text('本期合同计量数量');
                         $('[name=type-title-qc]').text('本期变更计量数量');
-                        $('#show-qc-minus-jl').parent().show();
-                        $('#qc-minus-jl').parent().show();
+                        if ($('#show-qc-minus-jl').length > 0) {
+                            $('#show-qc-minus-jl').parent().show();
+                            $('#qc-minus-jl').parent().show();
+                        }
                     }
                     if (stage.im_type === imType.bb.value || stage.im_type === imType.bw.value) {
                         $('#show-jldy').parent().show();

+ 11 - 0
app/view/stage_rela/detail.ejs

@@ -125,6 +125,9 @@
                                     <tbody>
                                     <tr><th width="120" name="type-title-contract">本期合同计量数量</th><td id="show-contract-jl"></td></tr>
                                     <tr><th name="type-title-qc">本期变更计量数量</th><td id="show-qc-jl"></td></tr>
+                                    <% if (minusNoValue) { %>
+                                    <tr><th name="type-title-qc-minus">本期不计价变更数量</th><td id="show-qc-minus-jl"></td></tr>
+                                    <% } %>
                                     <tr><th>变更令号</th><td id="show-bgl-code"></td></tr>
                                     <tr><th>变更图号</th><td id="show-bgl-drawing-code"></td></tr>
                                     <tr><th>部位</th><td id="show-bw-name"></td></tr>
@@ -153,6 +156,14 @@
                                         </div>
                                         <input type="text" class="form-control" value="" id="qc-jl" readonly="">
                                     </div>
+                                    <% if (minusNoValue) { %>
+                                    <div class="input-group input-group-sm mb-2">
+                                        <div class="input-group-prepend">
+                                            <span class="input-group-text" name="type-title-qc-minus">本期不计价变更数量</span>
+                                        </div>
+                                        <input type="text" class="form-control" value="" id="qc-minus-jl" readonly="">
+                                    </div>
+                                    <% } %>
                                     <div class="input-group input-group-sm mb-2">
                                         <div class="input-group-prepend">
                                             <span class="input-group-text">变更令号</span>