| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318 | <% include ./sub_menu.ejs %><div class="panel-content">    <div class="panel-title">        <div class="title-main">            <h2>功能设置</h2>        </div>    </div>    <div class="content-wrap">        <div class="c-body">            <div class="sjs-height-0">                <div class="row m-0 mt-3">                    <div class="col-7">                        <div class="row">                            <div class="col-6">                                <div class="card mb-3">                                    <div class="card-body">                                        <h5 class="card-title">超计控制</h5>                                        <div class="form-group mb-4">                                            <div>                                                <div class="form-check">                                                    <input class="form-check-input" type="checkbox" id="ban_over" name="ban_over" <% if (funRela.banOver) { %>checked<% } %> onchange="updateSetting();">                                                    <label class="form-check-label" for="ban_over">超计时限制上报审批/审批通过</label>                                                </div>                                                <div class="form-check">                                                    <input class="form-check-input" type="checkbox" id="hint_over" name="hint_over" <% if (funRela.hintOver) { %>checked<% } %> onchange="updateSetting();">                                                    <label class="form-check-label" for="hint_over">超计时标红显示</label>                                                </div>                                            </div>                                        </div>                                    </div>                                </div>                            </div>                            <div class="col-6">                                <div class="card mb-3">                                    <div class="card-body">                                        <h5 class="card-title">变更令调用控制</h5>                                        <div class="form-group mb-4">                                            <div>                                                <div class="form-check form-check-inline">                                                    <input class="form-check-input" type="checkbox" id="ban_minus_cb" name="ban_minus_cb" <% if (funRela.banMinusChangeBills) { %>checked<% } %> onchange="updateSetting();">                                                    <label class="form-check-label" for="ban_minus_cb">强制调用负变更(限制上报审批/审批通过)</label>                                                </div>                                                <div class="alert-warning p-1"><i class="fa Example of exclamation-circle fa-exclamation-circle "></i> 变更令开始调用后,负变更清单必须在本期全部调用</div>                                            </div>                                        </div>                                    </div>                                </div>                            </div>                        </div>                        <div class="card mb-3">                            <div class="card-body">                                <h5 class="card-title">负变更</h5>                                <div class="form-group mb-4">                                    <div>                                        <div class="form-check form-check-inline">                                            <input class="form-check-input" type="checkbox" id="minusNoValue" name="minusNoValue" <% if (funRela.minusNoValue) { %>checked<% } %> onchange="updateSetting();">                                            <label class="form-check-label" for="minusNoValue">计量不计价</label>                                        </div>                                    </div>                                </div>                            </div>                        </div>                        <div class="card mb-3">                            <div class="card-body">                                <h5 class="card-title">合同支付</h5>                                <div class="form-group mb-4">                                    <div>                                        <div class="form-check form-check-inline">                                            <input class="form-check-input" type="checkbox" id="lockPayExpr" name="lockPayExpr" <% if (funRela.lockPayExpr) { %>checked<% } %> onchange="updateSetting();">                                            <label class="form-check-label" for="lockPayExpr">锁定往期带基数计算的合同支付项</label>                                        </div>                                    </div>                                </div>                            </div>                        </div>                        <div class="card mb-3 ">                            <div class="card-body pb-2">                                <div class="row m-0">                                    <h5 class="card-title">计量期上报</h5>                                    <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.session.sessionProject.page_show.openStageStart) { %>checked<% } %> onchange="updateSetting();">                                            <label class="custom-control-label" for="openStageStart"></label>                                        </div>                                    </div>                                </div>                                <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>                                            </div>                                            <select class="form-control form-control-sm" id="start_day" style="width: 90px!important;flex: none;" <% if (ctx.session.sessionProject.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.session.sessionProject.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.session.sessionProject.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>                                                <% } %>                                            </select>                                            <span class="text-danger mx-2"></span>                                        </div>                                    </div>                                </div>                                <div class="mt-3">                                    <label class="form-text alert alert-danger">开启选项后,超出范围内的日期,则不允许上报期计量。</label>                                </div>                            </div>                        </div>                        <div class="card mb-3">                            <div class="card-body">                                <h5 class="card-title">中间计量模式设置</h5>                                <div class="form-group mb-4">                                    <div>                                        <% for (const i in imType) { %>                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="radio" id="radio_<%- i %>" value="<%- imType[i].value %>" <% if (funRela.imType === imType[i].value) { %>checked<% } %> name="im_type" onchange="updateSetting();">                                                <label class="form-check-label" for="radio_<%- i %>" name="im_type"><%- imType[i].name %></label>                                            </div>                                        <% } %>                                    </div>                                    <div class="mt-3">                                        <label class="form-text alert alert-danger">切换模式,仅对未开始第一期计量的标段生效。</label>                                    </div>                                </div>                            </div>                        </div>                        <div class="row">                            <div class="col-5">                                <div class="card mb-3">                                    <div class="card-body">                                        <h5 class="card-title">工程变更</h5>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openChangeProject" <% if(ctx.session.sessionProject.page_show.openChangeProject) { %>checked<% } %> onchange="updateSetting(1);">                                                <label class="form-check-label" for="openChangeProject">显示「变更立项」页面</label>                                            </div>                                        </div>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openChangeApply" <% if(ctx.session.sessionProject.page_show.openChangeApply) { %>checked<% } %> onchange="updateSetting(2);">                                                <label class="form-check-label" for="openChangeApply">显示「变更申请」页面</label>                                            </div>                                        </div>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openChangePlan" <% if(ctx.session.sessionProject.page_show.openChangePlan) { %>checked<% } %> onchange="updateSetting(3);">                                                <label class="form-check-label" for="openChangePlan">显示「变更方案」页面</label>                                            </div>                                        </div>                                    </div>                                </div>                            </div>                            <div class="col-7">                                <div class="card mb-3">                                    <div class="card-body">                                        <h5 class="card-title">材料调差</h5>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openMaterialTax" <% if(ctx.session.sessionProject.page_show.openMaterialTax) { %>checked<% } %> onchange="updateSetting();">                                                <label class="form-check-label" for="openMaterialTax">使用材料税</label>                                            </div>                                        </div>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openMaterialChecklist" <% if(ctx.session.sessionProject.page_show.openMaterialChecklist) { %>checked<% } %> onchange="updateSetting();">                                                <label class="form-check-label" for="openMaterialChecklist">开启「批量设置调差清单」添加调差工料功能</label>                                            </div>                                        </div>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openMaterialSelf" <% if(ctx.session.sessionProject.page_show.openMaterialSelf) { %>checked<% } %> onchange="updateSetting();">                                                <label class="form-check-label" for="openMaterialSelf">开启调差清单-所属项目节「单独添加工料」功能                                                    <a href="javascript:void(0);"  data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,调差清单的所属项目节,允许单独添加工料"><i class="fa fa-question-circle "></i></a></label>                                            </div>                                        </div>                                        <div class="form-group mb-1">                                            <div class="form-check form-check-inline">                                                <input class="form-check-input" type="checkbox" id="openMaterialEditForAudit" <% if(ctx.session.sessionProject.page_show.openMaterialEditForAudit) { %>checked<% } %> onchange="updateSetting();">                                                <label class="form-check-label" for="openMaterialEditForAudit">开启「审核人修改数据」功能                                                    <a href="javascript:void(0);"  data-toggle="tooltip" data-placement="bottom" title="" data-original-title="开启该选项,审核人允许修改部分调差工料数据"><i class="fa fa-question-circle "></i></a></label>                                            </div>                                        </div>                                    </div>                                </div>                            </div>                        </div>                        <div class="card mb-3">                            <div class="card-body">                                <h5 class="card-title">动态决算</h5>                                <div class="form-group mb-4">                                    <div>                                        <div class="form-check form-check-inline">                                            <input class="form-check-input" type="checkbox" id="need_gcl" name="need_gcl" <% if (funRela.needGcl) { %>checked<% } %> onchange="updateSetting();">                                            <label class="form-check-label" for="need_gcl">显示清单信息</label>                                        </div>                                    </div>                                    <div class="mt-3">                                        <label class="form-text alert alert-danger">做施工图三级清单预算时,请进行勾选。</label>                                    </div>                                </div>                            </div>                        </div>                    </div>                </div>            </div>        </div>    </div></div><script src="/public/js/setting.js"></script><script>    $(() => {        autoFlashHeight();    });    const updateSetting = function (tab = false) {        if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 1) {            $('#openChangeApply').prop('checked', true);            $('#openChangePlan').prop('checked', true);        } else if (!$('#openChangeApply')[0].checked && $('#openChangeProject')[0].checked && tab === 2) {            $('#openChangeProject').prop('checked', false);        }        if (!$('#openChangePlan')[0].checked && $('#openChangeApply')[0].checked && tab === 2) {            $('#openChangePlan').prop('checked', true);        } else if (!$('#openChangePlan')[0].checked && $('#openChangeApply')[0].checked && tab === 3) {            $('#openChangeApply').prop('checked', false);            $('#openChangeProject').prop('checked', false);        }        const pushData = {};        if($('#openStageStart')[0].checked) {            // 判断是否已选开始日,截止月日            const startDay = parseInt($('#start_day').val());            const endMonth = parseInt($('#end_month').val());            const endDay = parseInt($('#end_day').val());            let flag = false;            if (startDay === 0) {                $('#start_day').siblings('span').text('请选择日');                flag = true;            } else {                $('#start_day').siblings('span').text('');            }            const endErrorMsg = [];            if (endMonth === 0) {                endErrorMsg.push('请选择月');                flag = true;            }            if (endDay === 0) {                endErrorMsg.push('请选择日');                flag = true;            }            if (endErrorMsg.length > 0) {                $('#end_day').siblings('span').text(endErrorMsg.join(' '));            } else {                // 本月截止日不允许小于开始日                if (endMonth === 1 && startDay > endDay) {                    $('#end_day').siblings('span').text('截止日期选择不正确,请重新选择');                    flag = true;                } else if (endMonth === 2 && startDay <= endDay){                    $('#end_day').siblings('span').text('次月截止日不允许大于开始日');                    flag = true;                } else {                    $('#end_day').siblings('span').text('');                }            }            if (flag) {                $('#openStageStart')[0].checked = 0;                $('#openStageStart').prop('checked', false);                return;            }            pushData.stage_start = {                start_day: startDay,                end_month: endMonth,                end_day: endDay,            }            $('#start_day').attr('disabled', true);            $('#end_month').attr('disabled', true);            $('#end_day').attr('disabled', true);        } else {            $('#start_day').removeAttr('disabled');            $('#end_month').removeAttr('disabled');            $('#end_day').removeAttr('disabled');        }        postData('/setting/fun/update', {            imType: parseInt($('[name=im_type]:checked').val()),            banOver: $('[name=ban_over]')[0].checked,            hintOver: $('#hint_over')[0].checked,            banMinusChangeBills: $('[name=ban_minus_cb]')[0].checked,            minusNoValue: $('[name=minusNoValue]')[0].checked,            lockPayExpr: $('#lockPayExpr')[0].checked,            needGcl: $('#need_gcl')[0].checked,            openChangeProject: $('#openChangeProject')[0].checked,            openChangeApply: $('#openChangeApply')[0].checked,            openChangePlan: $('#openChangePlan')[0].checked,            openMaterialTax: $('#openMaterialTax')[0].checked,            openMaterialChecklist: $('#openMaterialChecklist')[0].checked,            openMaterialSelf: $('#openMaterialSelf')[0].checked,            openMaterialEditForAudit: $('#openMaterialEditForAudit')[0].checked,            openStageStart: $('#openStageStart')[0].checked,            addFunSet: _.size(pushData) !== 0 ? pushData : null,        });    }</script>
 |