|  | @@ -111,55 +111,85 @@
 | 
												
													
														
															|  |                              <div class="col-6">
 |  |                              <div class="col-6">
 | 
												
													
														
															|  |                                  <div class="card mb-3 ">
 |  |                                  <div class="card mb-3 ">
 | 
												
													
														
															|  |                                      <div class="card-header d-flex justify-content-between">
 |  |                                      <div class="card-header d-flex justify-content-between">
 | 
												
													
														
															|  | -                                        <div>计量期上报</div>
 |  | 
 | 
												
													
														
															|  | -                                        <div class="row m-0">
 |  | 
 | 
												
													
														
															|  | -                                            <div class="pull-right d-inline-block form-group form-check ml-auto">
 |  | 
 | 
												
													
														
															|  | -                                                <div class="custom-control custom-switch">
 |  | 
 | 
												
													
														
															|  | -                                                    <input type="checkbox" class="custom-control-input" id="openStageStart" <% if(ctx.subProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">
 |  | 
 | 
												
													
														
															|  | -                                                    <label class="custom-control-label" for="openStageStart"></label>
 |  | 
 | 
												
													
														
															|  | -                                                </div>
 |  | 
 | 
												
													
														
															|  | -                                            </div>
 |  | 
 | 
												
													
														
															|  | -                                        </div>
 |  | 
 | 
												
													
														
															|  | 
 |  | +                                        <div>计量期上报/审批</div>
 | 
												
													
														
															|  |                                      </div>
 |  |                                      </div>
 | 
												
													
														
															|  |                                      <div class="card-body pb-2">
 |  |                                      <div class="card-body pb-2">
 | 
												
													
														
															|  |                                          <div class="form-group mb-1">
 |  |                                          <div class="form-group mb-1">
 | 
												
													
														
															|  | -                                            <div>
 |  | 
 | 
												
													
														
															|  | -                                                <div class="input-group input-group-sm mb-2">
 |  | 
 | 
												
													
														
															|  | -                                                    <div class="input-group-prepend">
 |  | 
 | 
												
													
														
															|  | -                                                        <span class="input-group-text">开始日期:</span>
 |  | 
 | 
												
													
														
															|  | -                                                        <span class="input-group-text" style="width: 90px;padding-left: 12px;">每月</span>
 |  | 
 | 
												
													
														
															|  | 
 |  | +                                            <nav class="nav nav-tabs">
 | 
												
													
														
															|  | 
 |  | +                                                <a class="nav-link nav-item active" data-toggle="tab" name="stage-setting" type="audit" onclick="changeSettingTab(this);">审批</a>
 | 
												
													
														
															|  | 
 |  | +                                                <a class="nav-link nav-item" data-toggle="tab" name="stage-setting" type="start" onclick="changeSettingTab(this);">上报</a>
 | 
												
													
														
															|  | 
 |  | +                                                <div class="ml-auto">
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="custom-control custom-switch" id="switch-stage-start" style="display: none;">
 | 
												
													
														
															|  | 
 |  | +                                                        <input type="checkbox" class="custom-control-input" id="openStageStart" <% if(ctx.subProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">
 | 
												
													
														
															|  | 
 |  | +                                                        <label class="custom-control-label" for="openStageStart"></label>
 | 
												
													
														
															|  | 
 |  | +                                                    </div>
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="custom-control custom-switch" id="switch-stage-audit">
 | 
												
													
														
															|  | 
 |  | +                                                        <input type="checkbox" class="custom-control-input" id="openStageAudit" <% if(ctx.subProject.page_show.openStageAudit) { %>checked<% } %> onchange="updateSetting();">
 | 
												
													
														
															|  | 
 |  | +                                                        <label class="custom-control-label" for="openStageAudit"></label>
 | 
												
													
														
															|  |                                                      </div>
 |  |                                                      </div>
 | 
												
													
														
															|  | -                                                    <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 |  | 
 | 
												
													
														
															|  | -                                                        <option value="0">请选择日</option>
 |  | 
 | 
												
													
														
															|  | -                                                        <% for (let i = 1; i <= 31;i++) { %>
 |  | 
 | 
												
													
														
															|  | -                                                            <option value="<%- i %>" <% if (funSet.stage_start.start_day === i) {%>selected<% } %>><%- i %></option>
 |  | 
 | 
												
													
														
															|  | -                                                        <% } %>
 |  | 
 | 
												
													
														
															|  | -                                                    </select>
 |  | 
 | 
												
													
														
															|  | -                                                    <span class="text-danger mx-2"></span>
 |  | 
 | 
												
													
														
															|  |                                                  </div>
 |  |                                                  </div>
 | 
												
													
														
															|  | -                                                <div class="input-group input-group-sm mb-2">
 |  | 
 | 
												
													
														
															|  | -                                                    <div class="input-group-prepend">
 |  | 
 | 
												
													
														
															|  | -                                                        <span class="input-group-text">截止日期:</span>
 |  | 
 | 
												
													
														
															|  | 
 |  | +                                            </nav>
 | 
												
													
														
															|  | 
 |  | +                                            <div class="tab-content my-2">
 | 
												
													
														
															|  | 
 |  | +                                                <div class="tab-pane fade active show" id="stage-audit-tab" role="tabpanel" aria-labelledby="home-tab">
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="input-group input-group-sm mt-2 col-6">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-prepend">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">预警:</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  | 
 |  | +                                                        <input type="number" class="form-control" value="<%- ctx.subProject.page_show.stageAuditEarly %>" <% if(!ctx.subProject.page_show.openStageAudit) { %>disabled<% } %> id="stage-audit-early" oninput="limitDecimal(this);" min="0" max="30" onchange="updateSetting();">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-append">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">天</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  | 
 |  | +                                                    </div>
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="text-muted ml-4 mt-2"><small>审批停留时长符合设置天数(包含节假日),审批流程提醒为预警</small></div>
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="input-group input-group-sm mt-2 col-6">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-prepend">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">紧急:</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  | 
 |  | +                                                        <input type="number" class="form-control" value="<%- ctx.subProject.page_show.stageAuditWorry %>" <% if(!ctx.subProject.page_show.openStageAudit) { %>disabled<% } %> id="stage-audit-worry" oninput="limitDecimal(this);" min="0" max="30" onchange="updateSetting();">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-append">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">天</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  |                                                      </div>
 |  |                                                      </div>
 | 
												
													
														
															|  | -                                                    <select class="form-control form-control-sm" id="end_month" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 |  | 
 | 
												
													
														
															|  | -                                                        <option value="0">请选择月</option>
 |  | 
 | 
												
													
														
															|  | -                                                        <% for (const i of endMonth) { %>
 |  | 
 | 
												
													
														
															|  | -                                                        <option value="<%- i.val %>" <% if (funSet.stage_start.end_month === i.val) {%>selected<% } %> ><%- i.name %></option>
 |  | 
 | 
												
													
														
															|  | -                                                        <% } %>
 |  | 
 | 
												
													
														
															|  | -                                                    </select>
 |  | 
 | 
												
													
														
															|  | -                                                    <select class="form-control form-control-sm" id="end_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 |  | 
 | 
												
													
														
															|  | -                                                        <option value="0">请选择日</option>
 |  | 
 | 
												
													
														
															|  | -                                                        <% for (let i = 1; i <= 31;i++) { %>
 |  | 
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="text-muted ml-4 mt-2"><small>审批停留时长符合设置天数(包含节假日),审批流程提醒为紧急</small></div>
 | 
												
													
														
															|  | 
 |  | +                                                </div>
 | 
												
													
														
															|  | 
 |  | +                                                <div class="tab-pane fade" id="stage-start-tab" role="tabpanel" aria-labelledby="profile-tab">
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="input-group input-group-sm mb-2">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-prepend">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">开始日期:</span>
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text" style="width: 90px;padding-left: 12px;">每月</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  | 
 |  | +                                                        <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 | 
												
													
														
															|  | 
 |  | +                                                            <option value="0">请选择日</option>
 | 
												
													
														
															|  | 
 |  | +                                                            <% for (let i = 1; i <= 31;i++) { %>
 | 
												
													
														
															|  | 
 |  | +                                                            <option value="<%- i %>" <% if (funSet.stage_start.start_day === i) {%>selected<% } %>><%- i %></option>
 | 
												
													
														
															|  | 
 |  | +                                                            <% } %>
 | 
												
													
														
															|  | 
 |  | +                                                        </select>
 | 
												
													
														
															|  | 
 |  | +                                                        <span class="text-danger mx-2"></span>
 | 
												
													
														
															|  | 
 |  | +                                                    </div>
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="input-group input-group-sm mb-2">
 | 
												
													
														
															|  | 
 |  | +                                                        <div class="input-group-prepend">
 | 
												
													
														
															|  | 
 |  | +                                                            <span class="input-group-text">截止日期:</span>
 | 
												
													
														
															|  | 
 |  | +                                                        </div>
 | 
												
													
														
															|  | 
 |  | +                                                        <select class="form-control form-control-sm" id="end_month" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 | 
												
													
														
															|  | 
 |  | +                                                            <option value="0">请选择月</option>
 | 
												
													
														
															|  | 
 |  | +                                                            <% for (const i of endMonth) { %>
 | 
												
													
														
															|  | 
 |  | +                                                            <option value="<%- i.val %>" <% if (funSet.stage_start.end_month === i.val) {%>selected<% } %> ><%- i.name %></option>
 | 
												
													
														
															|  | 
 |  | +                                                            <% } %>
 | 
												
													
														
															|  | 
 |  | +                                                        </select>
 | 
												
													
														
															|  | 
 |  | +                                                        <select class="form-control form-control-sm" id="end_day" style="width: 90px!important;flex: none;" <% if (ctx.subProject.page_show.openStageStart) { %>disabled<% } %>>
 | 
												
													
														
															|  | 
 |  | +                                                            <option value="0">请选择日</option>
 | 
												
													
														
															|  | 
 |  | +                                                            <% for (let i = 1; i <= 31;i++) { %>
 | 
												
													
														
															|  |                                                              <option value="<%- i %>" <% if (funSet.stage_start.end_day === i) {%>selected<% } %>><%- i %></option>
 |  |                                                              <option value="<%- i %>" <% if (funSet.stage_start.end_day === i) {%>selected<% } %>><%- i %></option>
 | 
												
													
														
															|  | -                                                        <% } %>
 |  | 
 | 
												
													
														
															|  | -                                                    </select>
 |  | 
 | 
												
													
														
															|  | -                                                    <span class="text-danger mx-2"></span>
 |  | 
 | 
												
													
														
															|  | 
 |  | +                                                            <% } %>
 | 
												
													
														
															|  | 
 |  | +                                                        </select>
 | 
												
													
														
															|  | 
 |  | +                                                        <span class="text-danger mx-2"></span>
 | 
												
													
														
															|  | 
 |  | +                                                    </div>
 | 
												
													
														
															|  | 
 |  | +                                                    <div class="mt-3">
 | 
												
													
														
															|  | 
 |  | +                                                        <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>
 | 
												
													
														
															|  | 
 |  | +                                                    </div>
 | 
												
													
														
															|  |                                                  </div>
 |  |                                                  </div>
 | 
												
													
														
															|  |                                              </div>
 |  |                                              </div>
 | 
												
													
														
															|  |                                          </div>
 |  |                                          </div>
 | 
												
													
														
															|  | -                                        <div class="mt-3">
 |  | 
 | 
												
													
														
															|  | -                                            <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>
 |  | 
 | 
												
													
														
															|  | -                                        </div>
 |  | 
 | 
												
													
														
															|  |                                      </div>
 |  |                                      </div>
 | 
												
													
														
															|  |                                  </div>
 |  |                                  </div>
 | 
												
													
														
															|  |                              </div>
 |  |                              </div>
 | 
												
											
												
													
														
															|  | @@ -316,6 +346,20 @@
 | 
												
													
														
															|  |  <script>
 |  |  <script>
 | 
												
													
														
															|  |      let changeClass = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_class)) %>'));
 |  |      let changeClass = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_class)) %>'));
 | 
												
													
														
															|  |      let changeState = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_state)) %>'));
 |  |      let changeState = JSON.parse(unescape('<%- escape(JSON.stringify(funSet.change_state)) %>'));
 | 
												
													
														
															|  | 
 |  | +    const changeSettingTab = function(tab) {
 | 
												
													
														
															|  | 
 |  | +        const type = tab.getAttribute('type');
 | 
												
													
														
															|  | 
 |  | +        if (type === 'start') {
 | 
												
													
														
															|  | 
 |  | +            $('#switch-stage-start').show();
 | 
												
													
														
															|  | 
 |  | +            $('#switch-stage-audit').hide();
 | 
												
													
														
															|  | 
 |  | +            $('#stage-start-tab').addClass('active').addClass('show');
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-tab').removeClass('active').removeClass('show');
 | 
												
													
														
															|  | 
 |  | +        } else if (type === 'audit') {
 | 
												
													
														
															|  | 
 |  | +            $('#switch-stage-start').hide();
 | 
												
													
														
															|  | 
 |  | +            $('#switch-stage-audit').show();
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-tab').addClass('active').addClass('show');
 | 
												
													
														
															|  | 
 |  | +            $('#stage-start-tab').removeClass('active').removeClass('show');
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  |      $(() => {
 |  |      $(() => {
 | 
												
													
														
															|  |          autoFlashHeight();
 |  |          autoFlashHeight();
 | 
												
													
														
															|  |          // 自定义变更类别
 |  |          // 自定义变更类别
 | 
												
											
												
													
														
															|  | @@ -384,6 +428,32 @@
 | 
												
													
														
															|  |              }
 |  |              }
 | 
												
													
														
															|  |          });
 |  |          });
 | 
												
													
														
															|  |      });
 |  |      });
 | 
												
													
														
															|  | 
 |  | +
 | 
												
													
														
															|  | 
 |  | +    // 根据Min Max限制Input输入
 | 
												
													
														
															|  | 
 |  | +    function limitInputMinMax (obj) {
 | 
												
													
														
															|  | 
 |  | +        if (obj.max && _.toNumber(obj.value) > _.toNumber(obj.max)) {
 | 
												
													
														
															|  | 
 |  | +            obj.value = obj.max;
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +        if(obj.min && _.toNumber(obj.value) < _.toNumber(obj.min)) {
 | 
												
													
														
															|  | 
 |  | +            obj.value = obj.min;
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  | 
 |  | +    // 根据Maxlength限制input输入
 | 
												
													
														
															|  | 
 |  | +    function limitMaxLength (obj) {
 | 
												
													
														
															|  | 
 |  | +        if (obj.maxLength >= 0 && obj.value.length > obj.maxLength) {
 | 
												
													
														
															|  | 
 |  | +            obj.value = obj.value.substr(0, obj.maxLength);
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  | 
 |  | +    // 根据正则限制输入
 | 
												
													
														
															|  | 
 |  | +    function limitReg(obj, reg) {
 | 
												
													
														
															|  | 
 |  | +        obj.value = obj.value.replace(reg, '');
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  | 
 |  | +    // 小数位数 input 输入限制
 | 
												
													
														
															|  | 
 |  | +    function limitDecimal(obj) {
 | 
												
													
														
															|  | 
 |  | +        limitReg(obj, /[^\d]/g);
 | 
												
													
														
															|  | 
 |  | +        limitMaxLength(obj);
 | 
												
													
														
															|  | 
 |  | +        limitInputMinMax(obj);
 | 
												
													
														
															|  | 
 |  | +    }
 | 
												
													
														
															|  |      const updateSetting = function (tab = false, set_type = 0) {
 |  |      const updateSetting = function (tab = false, set_type = 0) {
 | 
												
													
														
															|  |          if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 1) {
 |  |          if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 1) {
 | 
												
													
														
															|  |              $('#openChangeApply').prop('checked', true);
 |  |              $('#openChangeApply').prop('checked', true);
 | 
												
											
												
													
														
															|  | @@ -451,6 +521,13 @@
 | 
												
													
														
															|  |              $('#end_month').removeAttr('disabled');
 |  |              $('#end_month').removeAttr('disabled');
 | 
												
													
														
															|  |              $('#end_day').removeAttr('disabled');
 |  |              $('#end_day').removeAttr('disabled');
 | 
												
													
														
															|  |          }
 |  |          }
 | 
												
													
														
															|  | 
 |  | +        if ($('#openStageAudit')[0].checked) {
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-early').removeAttr('disabled');
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-worry').removeAttr('disabled');
 | 
												
													
														
															|  | 
 |  | +        } else {
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-early').attr('disabled', 'disabled');
 | 
												
													
														
															|  | 
 |  | +            $('#stage-audit-worry').attr('disabled', 'disabled');
 | 
												
													
														
															|  | 
 |  | +        }
 | 
												
													
														
															|  |          if (set_type === 1) {
 |  |          if (set_type === 1) {
 | 
												
													
														
															|  |              // 自定义变更类别
 |  |              // 自定义变更类别
 | 
												
													
														
															|  |              const change_class = [];
 |  |              const change_class = [];
 | 
												
											
												
													
														
															|  | @@ -544,6 +621,9 @@
 | 
												
													
														
															|  |              openMultiStageCalc: $('#openMultiStageCalc')[0].checked,
 |  |              openMultiStageCalc: $('#openMultiStageCalc')[0].checked,
 | 
												
													
														
															|  |              closeWapYfSf: $('#closeWapYfSf')[0].checked,
 |  |              closeWapYfSf: $('#closeWapYfSf')[0].checked,
 | 
												
													
														
															|  |              addFunSet: _.size(pushData) !== 0 ? pushData : null,
 |  |              addFunSet: _.size(pushData) !== 0 ? pushData : null,
 | 
												
													
														
															|  | 
 |  | +            openStageAudit: $('#openStageAudit')[0].checked,
 | 
												
													
														
															|  | 
 |  | +            stageAuditEarly: parseInt($('#stage-audit-early').val()),
 | 
												
													
														
															|  | 
 |  | +            stageAuditWorry: parseInt($('#stage-audit-worry').val()),
 | 
												
													
														
															|  |          }, function (result) {
 |  |          }, function (result) {
 | 
												
													
														
															|  |              if ($('#openChangeState').is(':checked')) {
 |  |              if ($('#openChangeState').is(':checked')) {
 | 
												
													
														
															|  |                  $('#openBgStatus').removeClass('text-secondary');
 |  |                  $('#openBgStatus').removeClass('text-secondary');
 |