Browse Source

改版后,变更令、清单汇总、审核比较页面无法显示问题

MaiXinRong 6 years ago
parent
commit
ad14545700

+ 4 - 1
app/controller/stage_controller.js

@@ -678,6 +678,7 @@ module.exports = app => {
          */
         async change(ctx) {
             try {
+                await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
                 renderData.ledger = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
                 renderData.changes = await ctx.service.change.getChangeAndUsedInfo(ctx.tender.id);
@@ -808,7 +809,7 @@ module.exports = app => {
                     throw '提交数据错误';
                 }
                 if (data.checkType === auditConst.status.checked && ctx.stage.check_detail) {
-                    throw '审批通过前,需要完成中间计量。';
+                    throw '审批通过前,需要中间计量。';
                 }
                 if (data.checkType === auditConst.status.checkNo) {
                     if (!data.checkType || isNaN(data.checkType)) {
@@ -865,6 +866,7 @@ module.exports = app => {
          */
         async gather(ctx) {
             try {
+                await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
                 [renderData.gclSpread, renderData.leafXmjSpread] = this._getGatherSpreadSetting();
                 renderData.ledger = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);
@@ -911,6 +913,7 @@ module.exports = app => {
                 return [ledger, pos];
             }
             try {
+                await this._getStageAuditViewData(ctx);
                 const renderData = await this._getDefaultRenderData(ctx);
                 [renderData.ledgerSpread, renderData.posSpread] = getCompareSpreadSetting();
                 renderData.ledger = await ctx.service.ledger.getDataByTenderId(ctx.tender.id, -1);

+ 0 - 49
app/public/js/tender.js

@@ -68,31 +68,6 @@ function loadCalculateProperty () {
     $('#decimal-pay')[0].checked = property.decimal.pay;
     $('#decimal-pay-tp').val(property.decimal.payTp);
 }
-// 清单精度
-function loadPrecisionProperty () {
-    $('#unit-t').val(property.precision.t.value);
-    $('#unit-km').val(property.precision.km.value);
-    $('#unit-m').val(property.precision.m.value);
-    $('#unit-m2').val(property.precision.m2.value);
-    $('#unit-m3').val(property.precision.m3.value);
-    $('#unit-kg').val(property.precision.kg.value);
-    $('#unit-ge').val(property.precision.ge.value);
-    $('#unit-tai').val(property.precision.tai.value);
-    $('#unit-tao').val(property.precision.tao.value);
-    $('#unit-ke').val(property.precision.ke.value);
-    $('#unit-zu').val(property.precision.zu.value);
-    $('#unit-xitong').val(property.precision.xitong.value);
-    $('#unit-other').val(property.precision.other.value);
-}
-// 合同参数
-function loadDealProperty () {
-    $('#contract-price').val(property.deal_param.contractPrice);
-    $('#zan-lie-price').val(property.deal_param.zanLiePrice);
-    const iDecimal = property.decimal.pay ? property.decimal.payTp : property.decimal.tp;
-    $('#c-zl').val(ZhCalc.round(ZhCalc.minus(property.deal_param.contractPrice, property.deal_param.zanLiePrice), iDecimal));
-    $('#start-advance').val(property.deal_param.startAdvance);
-    $('#material-advance').val(property.deal_param.materialAdvance);
-}
 // 显示设置
 function loadDisplayProperty () {
     $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
@@ -110,30 +85,6 @@ function setReadOnly(obj, readOnly) {
         $('input[type=checkbox]', obj).removeAttr('disabled');
     }
 }
-// 获取当前合同支付应该使用的小数位数
-function getDealTpDecimal() {
-    const spec = $('#decimal-pay')[0].checked;
-    return spec ? _.toNumber($('#decimal-pay-tp').val()) : _.toNumber($('#decimal-tp').val());
-}
-// 四舍五入
-function roundPrice(obj) {
-    //const iDecimal = getDealTpDecimal();
-    //obj.val(ZhCalc.round(_.toNumber(obj.val()), iDecimal));
-}
-// 计算签约合同价(不含暂列金额)
-function calculateC2() {
-    const constract = _.toNumber($('#contract-price').val());
-    const zanLie = _.toNumber($('#zan-lie-price').val());
-    $('#c-zl').val(ZhCalc.minus(constract, zanLie));
-}
-// 根据小数位数,计算全部的合同参数
-function CalculateAllDealParam() {
-    roundPrice($('#contract-price'));
-    roundPrice($('#zan-lie-price'));
-    roundPrice($('#start-advance'));
-    roundPrice($('#material-advance'));
-    calculateC2();
-}
 // 根据Min Max限制Input输入
 function limitInputMinMax (obj) {
     if (_.toNumber(obj.value) > _.toNumber(obj.max)) {

+ 1 - 1
app/service/change.js

@@ -728,7 +728,7 @@ module.exports = app => {
                     [lastStage.order, lastStage.order, this.ctx.stage.curTimes, this.ctx.stage.curTimes, this.ctx.stage.curOrder]);
             } else {
                 if (lastStage.status === audit.stage.status.uncheck) {
-                    filter = 'And s.order < ' + lastStage.order;
+                    filter = ' And s.order < ' + lastStage.order;
                 } else if (lastStage.status === audit.stage.status.checked) {
                     filter = '';
                 } else if (lastStage.status === audit.stage.status.checkNo) {

+ 1 - 1
app/view/stage/stage_sub_menu.ejs

@@ -37,7 +37,7 @@
         <div class="nav-box">
                 <ul class="nav-list list-unstyled">
                     <li class="<% if (ctx.url === '/tender' + ctx.tender.id + '/measure/stage' + ctx.stage.order) { %>active<% } %>">
-                        <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- stage.order %>/bgl"><span class="ml-3">变更概况</span></a>
+                        <a href="/tender/<%- ctx.tender.id %>/measure/stage/<%- stage.order %>/change"><span class="ml-3">变更概况</span></a>
                     </li>
                 </ul>
             </div>