Kaynağa Gözat

汇总对比,截止月相关

MaiXinRong 4 ay önce
ebeveyn
işleme
b31aac01e0

+ 18 - 0
app/controller/spss_controller.js

@@ -229,6 +229,22 @@ module.exports = app => {
             if (stage) await this.ctx.service.stage.doCheckStage(stage);
             return { type: 'stage', stage, filter: month };
         }
+        async _filterUnderMonth(tender, month, checked) {
+            const stages = await this._getValidStages(tender.id, 'desc', checked);
+            let stage = this.ctx.helper._.find(stages, { s_time: month });
+            if (!stage) {
+                const checkTime = moment(month);
+                for (const s of stages) {
+                    const rela_time = moment(s.s_time);
+                    if (rela_time.isBefore(checkTime)) {
+                        stage = s;
+                        break;
+                    }
+                }
+            }
+            if (stage) await this.ctx.service.stage.doCheckStage(stage);
+            return { type: 'stage', stage, filter: stage ? stage.s_time : month };
+        }
         async _filterFinal(tender, checked) {
             const stages = await this._getValidStages(tender.id, 'desc', checked);
             const stage = stages[0];
@@ -293,6 +309,8 @@ module.exports = app => {
                     return await this._filterTimeZone(tender, stageInfo.zone, stageInfo.checked);
                 case 'stage-zone':
                     return await this._filterOrderZone(tender, stageInfo.stage_zone, stageInfo.checked);
+                case 'under-month':
+                    return await this._filterUnderMonth(tender, stageInfo.month, stageInfo.checked);
                 default:
                     return;
             }

+ 6 - 0
app/public/js/shares/tender_select_multi.js

@@ -179,6 +179,12 @@ const TenderSelectMulti = function (setting) {
                         toastr.warning('请选择 汇总年月');
                         return;
                     }
+                } else if (stage.type === 'under-month') {
+                    stage.month = $('#gather-under-month').val();
+                    if (stage.month === '') {
+                        toastr.warning('请选择 汇总年月');
+                        return;
+                    }
                 } else if (stage.type === 'zone') {
                     stage.zone = $('#gather-zone').val();
                     if (stage.zone === '') {

+ 1 - 1
app/view/dashboard/index.ejs

@@ -607,7 +607,7 @@
                                                     <td><%- notice.opinion ? notice.opinion : '' %></td>
                                                 </tr>
                                             <% } else if(notice.type === pushType.safeStage && ctx.subProject.page_show.safePayment) { %>
-                                                <tr data-type="13">
+                                                <tr data-type="14">
                                                     <td><span class="bg-new-inspection text-new-payment badge text-width">安全计量</span></td>
                                                     <td><a href="/sp/<%- notice.spid %>/safe/tender/<%- notice.tid %>/stage"><%- notice.name %></a> <a href="/sp/<%- notice.spid %>/safe/tender/<%- notice.tid %>/stage/<%- notice.order %>/bills">第<%- notice.order %>期</a></td>
                                                     <td><%- notice.su_name %><%- (notice.su_role ? '-' + notice.su_role : '') %></td>

+ 9 - 0
app/view/spss/spss_select_modal.ejs

@@ -33,6 +33,10 @@
                                 <input class="form-check-input" type="radio" id="tsm-source-zone" value="zone" name="tsm-source">
                                 <label class="form-check-label" for="tsm-source-zone">月区间</label>
                             </div>
+                            <div class="form-check form-check-inline" stage-type="under-month">
+                                <input class="form-check-input" type="radio" id="tsm-source-under-month" value="under-month" name="tsm-source">
+                                <label class="form-check-label" for="tsm-source-under-month">截止月</label>
+                            </div>
                         </div>
                     </div>
                     <div class="form-row align-items-center mb-2" id="tsm-stage-info-detail">
@@ -44,6 +48,11 @@
                                     <input id="gather-month" class="datepicker-here form-control mt-0" auto-close="true" autocomplete="off" placeholder="点击选择年月" data-view="months" data-min-view="months" data-date-format="yyyy-MM" data-language="zh" type="text" autocomplete="off">
                                 </div>
                             </div>
+                            <div id="gather-by-under-month" name="gather-type" style="display: none">
+                                <div class="input-group input-group-sm">
+                                    <input id="gather-under-month" class="datepicker-here form-control mt-0" auto-close="true" autocomplete="off" placeholder="点击选择年月" data-view="months" data-min-view="months" data-date-format="yyyy-MM" data-language="zh" type="text" autocomplete="off">
+                                </div>
+                            </div>
                             <div id="gather-by-zone" name="gather-type" style="display: none">
                                 <div class="input-group input-group-sm">
                                     <input id="gather-zone" class="datepicker-here form-control mt-0" placeholder="点击选择周期" data-range="true" data-multiple-dates-separator=" - "  data-min-view="months" data-view="months" data-date-format="yyyy-MM" data-language="zh" type="text" autocomplete="off">