1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144 |
- <!--标段设置-标段属性-->
- <div class="modal fade" id="bd-set-1" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">标段属性</h5>
- </div>
- <div class="modal-height-500" style="overflow-y: auto">
- <div class="modal-body">
- <ul class="nav nav-tabs nav-justified mb-2">
- <li class="nav-item">
- <a class="nav-link active" data-toggle="tab" href="#htxx" role="tab" aria-selected="true">合同信息</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#cjdw" role="tab" aria-selected="false">参建单位</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#jscs" role="tab">技术参数</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane active" id="htxx">
- <div class="form-group">
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">建设项目名称</span>
- </div>
- <input type="text" class="form-control" value="项目A" id="build-name" maxlength="100">
- </div>
- </div>
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:90px">合同编号</span>
- </div>
- <input type="text" class="form-control" value="" id="deal-code" maxlength="100">
- </div>
- </div>
- <div class="col-12">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:90px">合同名称</span>
- </div>
- <input type="text" class="form-control" value="" id="deal-name" maxlength="100">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="cjdw">
- <div class="form-group mb-4">
- <label>建设单位:</label>
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单位名称</span>
- </div>
- <input type="text" class="form-control" value="" id="build-company" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">法人代表</span>
- </div>
- <input type="text" class="form-control" value="" id="build-corporation" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">签订日期</span>
- </div>
- <input type="date" class="form-control" value="" id="build-date">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group mb-4">
- <label>承包单位1:</label>
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单位名称</span>
- </div>
- <input type="text" class="form-control" value="" id="contract1-company" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">法人代表</span>
- </div>
- <input type="text" class="form-control" value="" id="contract1-corporation" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">签订日期</span>
- </div>
- <input type="date" class="form-control" value="" id="contract1-date">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group mb-4">
- <label>承包单位2:</label>
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单位名称</span>
- </div>
- <input type="text" class="form-control" value="" id="contract2-company" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">法人代表</span>
- </div>
- <input type="text" class="form-control" value="" id="contract2-corporation" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">签订日期</span>
- </div>
- <input type="date" class="form-control" value="" id="contract2-date">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group mb-4">
- <label>监理单位1:</label>
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单位名称</span>
- </div>
- <input type="text" class="form-control" value="" id="supervision1-company" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">法人代表</span>
- </div>
- <input type="text" class="form-control" value="" id="supervision1-corporation" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">签订日期</span>
- </div>
- <input type="date" class="form-control" value="" id="supervision1-date">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label>监理单位2:</label>
- <div class="row">
- <div class="col-12 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单位名称</span>
- </div>
- <input type="text" class="form-control" value="" id="supervision2-company" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">法人代表</span>
- </div>
- <input type="text" class="form-control" value="" id="supervision2-corporation" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">签订日期</span>
- </div>
- <input type="date" class="form-control" value="" id="supervision2-date">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="jscs">
- <div class="form-group">
- <div class="row">
- <div class="col-6 pr-0 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">公路等级</span>
- </div>
- <select class="form-control" id="load-level">
- <option>高速公路</option>
- <option>一级公路</option>
- <option>二级公路</option>
- <option>三级公路</option>
- <option>四级公路</option>
- </select>
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:90px">长度(KM)</span>
- </div>
- <input type="text" class="form-control" value="" id="length" min="0" max="10000"
- oninput="limitDealParamLength(this)" onchange="checkNumberValid(this)">
- </div>
- </div>
- <div class="col-6 pr-0 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">起始桩号</span>
- </div>
- <input type="text" class="form-control" value="" id="start-peg" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:90px">终止桩号</span>
- </div>
- <input type="text" class="form-control" value="" id="end-peg" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:66px">车道数</span>
- </div>
- <input type="text" class="form-control" value="" id="lane-count" maxlength="100">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text" style="width:90px">合同工期</span>
- </div>
- <input type="text" class="form-control" value="" id="deal-period" maxlength="100">
- </div>
- </div>
- <div class="col-6 pr-0 mb-2">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">开工日期</span>
- </div>
- <input type="date" class="form-control" value="" id="start-date">
- </div>
- </div>
- <div class="col-6">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">计划完工日期</span>
- </div>
- <input type="date" class="form-control" value="" id="plan-end-date">
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post1();">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <% if (((tender.ledger_status === audit.ledger.status.uncheck || tender.ledger_status === audit.ledger.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
- || (lastStage && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck))) { %>
- <!--标段设置-小数位数-->
- <div class="modal fade" id="bd-set-2" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">小数位数</h5>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label>全局设置</label>
- <div class="row">
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单价</span>
- </div>
- <input type="number" class="form-control" value="3" id="decimal-up"
- min="0" max="4" maxlength="1" oninput="limitDecimal(this)">
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">金额</span>
- </div>
- <input type="number" class="form-control" value="2" id="decimal-tp"
- oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label>单独设置</label>
- <div class="row">
- <div class="col-auto mt-1">
- <div class="form-group form-check pl-0">
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" id="decimal-pay">
- <label class="custom-control-label" for="decimal-pay">合同支付</label>
- </div>
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">金额</span>
- </div>
- <input type="number" class="form-control" value="2" id="decimal-pay-tp"
- oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post2();">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <!--标段设置-清单精度-->
- <div class="modal fade" id="bd-set-3" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">数量精度</h5>
- </div>
- <div class="modal-body">
- <div class="form-group" id="precision-spread" style="height: 397px; width: 465px;">
- </div>
- </div>
- <div class="modal-footer">
- <div id="hint-3" class="text-danger fa fa-exclamation-circle" style="display: none;"></div>
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post3();">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <% } else { %>
- <!--标段设置-小数位数-->
- <div class="modal fade" id="bd-set-2" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">小数位数</h5>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <label>全局设置</label>
- <div class="row">
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">单价</span>
- </div>
- <input type="number" class="form-control" value="3" id="decimal-up" readonly="">
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">金额</span>
- </div>
- <input type="number" class="form-control" value="2" id="decimal-tp" readonly="">
- </div>
- </div>
- </div>
- </div>
- <div class="form-group">
- <label>单独设置</label>
- <div class="row">
- <div class="col-auto mt-1">
- <div class="form-group form-check pl-0">
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" id="decimal-pay" readonly="">
- <label class="custom-control-label" for="decimal-pay">合同支付</label>
- </div>
- </div>
- </div>
- <div class="col-4">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">金额</span>
- </div>
- <input type="number" class="form-control" value="2" id="decimal-pay-tp" readonly="">
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
- </div>
- </div>
- </div>
- </div>
- <!--标段设置-清单精度-->
- <div class="modal fade" id="bd-set-3" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">数量精度</h5>
- </div>
- <div class="modal-body">
- <div class="sjs-option-height" id="precision-spread" style="height: 397px; width: 465px;">
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
- </div>
- </div>
- </div>
- </div>
- <% } %>
- <% if (!lastStage || (lastStage.order === 1 && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck))) { %>
- <!--标段设置-合同参数-->
- <div class="modal fade" id="bd-set-4" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">合同参数</h5>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <!--默认显示-->
- <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post4()">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <% } else { %>
- <!--标段设置-合同参数-->
- <div class="modal fade" id="bd-set-4" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">合同参数</h5>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <!--默认显示-->
- <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
- </div>
- </div>
- </div>
- </div>
- <% } %>
- <!--标段设置-显示设置-->
- <div class="modal fade" id="bd-set-5" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">显示设置</h5>
- </div>
- <div class="modal-body">
- <div class="form-group">
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="form-check-input" id="ledger-dgn-qty" checked="">
- <label class="form-check-label" for="ledger-dgn-qty">项目节数量</label>
- </div>
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="form-check-input" id="ledger-cl-qty" checked="">
- <label class="form-check-label" for="ledger-cl-qty">错漏增减</label>
- </div>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post5()">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <!--标段设置-章节设置-->
- <div class="modal fade" id="bd-set-6" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header">
- <h5 class="modal-title">章节设置</h5>
- </div>
- <div class="modal-body">
- <div class="form-group" id="chapter-spread" style="height: 330px; width: 465px;">
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
- <button type="button" class="btn btn-sm btn-primary" onclick="post6()">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- let property = JSON.parse('<%- JSON.stringify(tenderInfo) %>');
- let ledgerChecked = <%- tender.ldeger_status === audit.ledger.status.checked %>;
- let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
- // 根据Min Max限制Input输入
- function limitInputMinMax (obj) {
- if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
- obj.value = obj.max;
- }
- if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
- obj.value = obj.min;
- }
- }
- // 根据Maxlength限制input输入
- function limitMaxLength (obj) {
- if (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);
- }
- function limitDealParamLength(obj) {
- limitReg(obj, /[^\d\.]/g); // 过滤数字和.
- limitReg(obj, /\.{2,}/g); // 过滤第二个.
- limitInputMinMax(obj);
- }
- function checkNumberValid(obj) {
- const value = _.toNumber(obj.value);
- obj.value = value ? value : '';
- }
- // 属性
- function loadCommonProperty () {
- // 合同信息
- $('#build-name').val(property.deal_info.buildName);
- $('#deal-code').val(property.deal_info.dealCode);
- $('#deal-name').val(property.deal_info.dealName);
- // 参建单位
- // 建设单位
- $('#build-company').val(property.construction_unit.build.company);
- $('#build-corporation').val(property.construction_unit.build.corporation);
- $('#build-date').val(property.construction_unit.build.date);
- // 承包单位1
- $('#contract1-company').val(property.construction_unit.contract1.company);
- $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
- $('#contract1-date').val(property.construction_unit.contract1.date);
- // 承包单位2
- $('#contract2-company').val(property.construction_unit.contract2.company);
- $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
- $('#contract2-date').val(property.construction_unit.contract2.date);
- // 监理单位1
- $('#supervision1-company').val(property.construction_unit.supervision1.company);
- $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
- $('#supervision1-date').val(property.construction_unit.supervision1.date);
- // 监理单位2
- $('#supervision2-company').val(property.construction_unit.supervision2.company);
- $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
- $('#supervision2-date').val(property.construction_unit.supervision2.date);
- // 技术参数
- $('#loadLevel').val(property.tech_param.loadLevel);
- $('#length').val(property.tech_param.loadLength);
- $('#start-peg').val(property.tech_param.startPeg);
- $('#end-peg').val(property.tech_param.endPeg);
- $('#lane-count').val(property.tech_param.laneCount);
- $('#deal-period').val(property.tech_param.dealPeriod);
- $('#start-date').val(property.tech_param.startDate);
- $('#plan-end-date').val(property.tech_param.planEndDate);
- }
- $('#bd-set-1').on('show.bs.modal', function () {
- loadCommonProperty();
- })
- function post1 () {
- const prop = {
- deal_info: {
- buildName: $('#build-name').val(),
- dealCode: $('#deal-code').val(),
- dealName: $('#deal-name').val(),
- },
- construction_unit: {
- build: {
- company: $('#build-company').val(),
- corporation: $('#build-corporation').val(),
- date: $('#build-date').val(),
- },
- contract1: {
- company: $('#contract1-company').val(),
- corporation: $('#contract1-corporation').val(),
- date: $('#contract1-date').val(),
- },
- contract2: {
- company: $('#contract2-company').val(),
- corporation: $('#contract2-corporation').val(),
- date: $('#contract2-date').val(),
- },
- supervision1: {
- company: $('#supervision1-company').val(),
- corporation: $('#supervision1-corporation').val(),
- date: $('#supervision1-date').val(),
- },
- supervision2: {
- company: $('#supervision2-company').val(),
- corporation: $('#supervision2-corporation').val(),
- date: $('#supervision2-date').val(),
- },
- },
- tech_param: {
- loadLevel: _.toNumber($('#loadLevel').val()),
- loadLength: _.toNumber($('#length').val()),
- startPeg: $('#start-peg').val(),
- endPeg: $('#end-peg').val(),
- laneCount: _.toNumber($('#lane-count').val()),
- dealPeriod: $('#deal-period').val(),
- startDate: $('#start-date').val(),
- planEndDate: $('#plan-end-date').val(),
- }
- };
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- setReadOnly('#v-pills-1', true);
- property.deal_info = data.deal_info;
- property.construction_unit = data.construction_unit;
- property.tech_param = data.tech_param;
- $('#bd-set-1').modal('hide');
- });
- }
- // 小数位数
- function loadCalculateProperty () {
- $('#decimal-up').val(property.decimal.up);
- $('#decimal-tp').val(property.decimal.tp);
- $('#decimal-pay')[0].checked = property.decimal.pay;
- $('#decimal-pay-tp').val(property.decimal.payTp);
- }
- $('#bd-set-2').on('show.bs.modal', function () {
- loadCalculateProperty();
- });
- function post2() {
- const prop = {
- decimal: {
- up: _.toNumber($('#decimal-up').val()),
- tp: _.toNumber($('#decimal-tp').val()),
- pay: $('#decimal-pay')[0].checked,
- payTp: _.toNumber($('#decimal-pay-tp').val()),
- }
- };
- if (ledgerChecked) {
- if (prop.decimal.up < property.decimal.up) {
- toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
- return;
- }
- if (prop.decimal.tp < property.decimal.tp) {
- toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
- return;
- }
- }
- if (firstStageChecked) {
- if (property.decimal.pay) {
- if (!prop.decimal.pay) {
- toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
- return;
- }
- if (prop.decimal.payTp < property.decimal.payTp) {
- toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
- return;
- }
- } else {
- if (prop.decimal.pay) {
- toastr.warning('第一期已审批完成,合同支付不可单独设置');
- return;
- }
- }
- }
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- property.decimal = data.decimal;
- $('#bd-set-2').modal('hide');
- }, null, true);
- }
- // 清单精度
- const precisionObj = (function () {
- const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
- spread.options.showVerticalScrollbar = false;
- spread.options.showHorizontalScrollbar = false;
- const sheet = spread.getActiveSheet();
- SpreadJsObj.protectedSheet(sheet);
- //sheet.options.rowHeaderVisible = false;
- //sheet.options.colHeaderVisible = false;
- sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
- sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
- sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
- const vStyle = new spreadNS.Style();
- vStyle.font = '12px 微软雅黑';
- sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
- const xStyle = new spreadNS.Style();
- xStyle.font = '12px 微软雅黑';
- xStyle.vAlign = 1;
- xStyle.hAlign = 1;
- sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
- const yStyle = new spreadNS.Style();
- yStyle.font = '12px 微软雅黑';
- yStyle.vAlign = 1;
- yStyle.hAlign = 1;
- sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
- SpreadJsObj.massOperationSheet(sheet, function () {
- sheet.defaults.rowHeight = 21;
- sheet.setColumnCount(2);
- sheet.setRowCount(13);
- sheet.setColumnWidth(0, 100);
- sheet.setColumnWidth(1, 60);
- sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
- sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2);
- sheet.setText(0, 0, 't');
- sheet.setText(1, 0, 'km');
- sheet.setText(2, 0, 'm');
- sheet.setText(3, 0, 'm2');
- sheet.setText(4, 0, 'm3');
- sheet.setText(5, 0, 'kg');
- sheet.setText(6, 0, '个');
- sheet.setText(7, 0, '台');
- sheet.setText(8, 0, '套');
- sheet.setText(9, 0, '棵');
- sheet.setText(10, 0, '组');
- sheet.setText(11, 0, '系统');
- sheet.setText(12, 0, '其他未列单位');
- const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
- sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
- sheet.getRange(0, 0, 13, 2).formatter('@');
- sheet.setSelection(0, 1, 1, 1);
- });
- spread.bind(spreadNS.Events.EditEnded, function (e, info) {
- const value = _.toNumber(info.editingText);
- if (!_.isInteger(value)) {
- toastr.warning('请输入0-6的整数');
- sheet.setText(info.row, info.col, '0');
- } else if (value > 6) {
- toastr.warning('请输入0-6的整数');
- sheet.setText(info.row, info.col, '6');
- } else if (value < 0) {
- toastr.warning('请输入0-6的整数');
- sheet.setText(info.row, info.col, '0');
- }
- });
- SpreadJsObj.addDeleteBind(spread, function (sheet) {
- const sel = sheet.getSelections()[0];
- let calc = false;
- if (sel) {
- for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
- if (iRow === 3) continue;
- for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
- if (iCol !== 2) continue;
- sheet.setText(iRow, iCol, '0');
- if (iRow === 1 || iRow === 2) calc = true;
- }
- }
- }
- if (calc) calcHtjMinusZlj();
- });
- spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
- let bHint = false;
- for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
- const curRow = info.cellRange.row + iRow;
- for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
- const curCol = info.cellRange.col + iCol;
- const value = _.toNumber(info.sheet.getText(curRow, curCol));
- if (_.isNaN(value) || !_.isInteger(value)) {
- bHint = true;
- info.sheet.setText(curRow, curCol, '0');
- } else if (value > 6) {
- bHint = true;
- info.sheet.setText(curRow, curCol, '6');
- } else if (value < 0) {
- bHint = true;
- info.sheet.setText(curRow, curCol, '0');
- }
- }
- }
- if (bHint) {
- toastr.warning('请输入0-6的整数');
- }
- });
- function loadPrecisonProperty() {
- $('#hint-3').hide();
- sheet.setValue(0, 1, property.precision.t.value);
- sheet.setValue(1, 1, property.precision.km.value);
- sheet.setValue(2, 1, property.precision.m.value);
- sheet.setValue(3, 1, property.precision.m2.value);
- sheet.setValue(4, 1, property.precision.m3.value);
- sheet.setValue(5, 1, property.precision.kg.value);
- sheet.setValue(6, 1, property.precision.ge.value);
- sheet.setValue(7, 1, property.precision.tai.value);
- sheet.setValue(8, 1, property.precision.tao.value);
- sheet.setValue(9, 1, property.precision.ke.value);
- sheet.setValue(10, 1, property.precision.zu.value);
- sheet.setValue(11, 1, property.precision.xitong.value);
- sheet.setValue(12, 1, property.precision.other.value);
- }
- function setReadOnly(readOnly) {
- sheet.getRange(0, 1, 13, 1).locked(readOnly);
- }
- function getNewPrecisionData() {
- const precision = JSON.parse(JSON.stringify(property.precision));
- precision.t.value = _.toNumber(sheet.getText(0, 1));
- precision.km.value = _.toNumber(sheet.getText(1, 1));
- precision.m.value = _.toNumber(sheet.getText(2, 1));
- precision.m2.value = _.toNumber(sheet.getText(3, 1));
- precision.m3.value = _.toNumber(sheet.getText(4, 1));
- precision.kg.value = _.toNumber(sheet.getText(5, 1));
- precision.ge.value = _.toNumber(sheet.getText(6, 1));
- precision.tai.value = _.toNumber(sheet.getText(7, 1));
- precision.tao.value = _.toNumber(sheet.getText(8, 1));
- precision.ke.value = _.toNumber(sheet.getText(9, 1));
- precision.zu.value = _.toNumber(sheet.getText(10, 1));
- precision.xitong.value = _.toNumber(sheet.getText(11, 1));
- precision.other.value = _.toNumber(sheet.getText(12, 1));
- return precision;
- }
- function checkPrecisionMinLimit(precision, limit) {
- for (const unit of precision) {
- if (precision[unit].value < limit[unit].value) {
- if (precision[unit].unit) {
- toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
- } else {
- toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
- }
- return false;
- }
- }
- return true;
- };
- return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
- })();
- $('#bd-set-3').on('show.bs.modal', function () {
- <% if (((tender.ledger_status !== audit.ledger.status.uncheck && tender.ledger_status !== audit.ledger.status.checkNo) || tender.user_id !== ctx.session.sessionUser.accountId)
- && (!lastStage || lastStage.user_id !== ctx.session.sessionUser.accountId || (lastStage.status !== audit.stage.status.checkNo || lastStage.status !== audit.stage.status.uncheck))) { %>
- precisionObj.setReadOnly(true);
- <% } %>
- precisionObj.loadPrecisonProperty();
- });
- function post3 () {
- const prop = { precision: precisionObj.getNewPrecisionData() };
- if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- property.precision = data.precision;
- $('#bd-set-3').modal('hide');
- }, null, true);
- }
- // 合同参数
- const dealObj = (function () {
- const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
- spread.options.showVerticalScrollbar = false;
- spread.options.showHorizontalScrollbar = false;
- const sheet = spread.getActiveSheet();
- SpreadJsObj.protectedSheet(sheet);
- const vStyle = new spreadNS.Style();
- vStyle.font = '12px 微软雅黑';
- sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
- SpreadJsObj.massOperationSheet(sheet, function () {
- sheet.options.rowHeaderVisible = false;
- sheet.options.colHeaderVisible = false;
- sheet.defaults.rowHeight = 25;
- sheet.setColumnCount(3);
- sheet.setRowCount(6);
- sheet.setColumnWidth(0, 1);
- sheet.setColumnWidth(1, 200);
- sheet.setColumnWidth(2, 200);
- sheet.setRowHeight(0, 1);
- sheet.getRange(1, 1, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
- sheet.getRange(1, 2, 5, 1).vAlign(1).hAlign(2).locked(true);
- sheet.setText(1, 1, '签约合同价');
- sheet.setText(2, 1, '暂列金额');
- sheet.setText(3, 1, '签约合同价(不含暂列金)');
- sheet.setText(4, 1, '签约开工预付款');
- sheet.setText(5, 1, '签约材料预付款');
- const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
- sheet.getRange(0, 0, 6, 3).setBorder(lineBorder, {all: true});
- sheet.getRange(0, 0, 6, 3).formatter('@');
- sheet.setSelection(1, 2, 1, 1);
- });
- function calcHtjMinusZlj() {
- const htj = _.toNumber(sheet.getText(1, 2));
- const zlj = _.toNumber(sheet.getText(2, 2));
- sheet.setValue(3, 2, ZhCalc.sub(zlj, htj));
- }
- spread.bind(spreadNS.Events.EditEnded, function (e, info) {
- const value = _.toNumber(info.editingText);
- if (_.isNaN(value)) {
- toastr.warning('请输入不超过万亿的数字');
- info.sheet.setText(info.row, info.col, '0');
- } else if (value > Math.pow(10, 13)) {
- toastr.warning('请输入不超过万亿的数字');
- info.sheet.setText(info.row, info.col, '0');
- }
- if (info.row === 1 || info.row === 2) {
- calcHtjMinusZlj();
- }
- });
- SpreadJsObj.addDeleteBind(spread, function (sheet) {
- const sel = sheet.getSelections()[0];
- let calc = false;
- if (sel) {
- for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
- if (iRow === 3) continue;
- for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
- if (iCol !== 2) continue;
- sheet.setText(iRow, iCol, '0');
- if (iRow === 1 || iRow === 2) calc = true;
- }
- }
- }
- if (calc) calcHtjMinusZlj();
- });
- spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
- let bHint = false;
- for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
- const curRow = info.cellRange.row + iRow;
- for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
- const curCol = info.cellRange.col + iCol;
- const value = _.toNumber(info.sheet.getText(curRow, curCol));
- if (_.isNaN(value) || value > Math.pow(10, 13)) {
- bHint = true;
- info.sheet.setText(curRow, curCol, '0');
- }
- }
- }
- if (bHint) {
- toastr.warning('请输入不超过万亿的数字');
- }
- calcHtjMinusZlj();
- });
- function loadDealProperty() {
- $('#hint-4').hide();
- sheet.setValue(1, 2, property.deal_param.contractPrice);
- sheet.setValue(2, 2, property.deal_param.zanLiePrice);
- sheet.setValue(3, 2, ZhCalc.sub(property.deal_param.zanLiePrice, property.deal_param.contractPrice));
- sheet.setValue(4, 2, property.deal_param.startAdvance);
- sheet.setValue(5, 2, property.deal_param.materialAdvance);
- }
- function setReadOnly (readOnly) {
- sheet.getCell(1, 2).locked(readOnly);
- sheet.getCell(2, 2).locked(readOnly);
- sheet.getCell(4, 2).locked(readOnly);
- sheet.getCell(5, 2).locked(readOnly);
- }
- function getNewDealData () {
- const result = {};
- result.contractPrice = _.toNumber(sheet.getText(1, 2));
- result.zanLiePrice = _.toNumber(sheet.getText(2, 2));
- result.startAdvance = _.toNumber(sheet.getText(4, 2));
- result.materialAdvance = _.toNumber(sheet.getText(5, 2));
- return result;
- }
- return { loadDealProperty, setReadOnly, getNewDealData, };
- })();
- $('#bd-set-4').on('show.bs.modal', function () {
- dealObj.loadDealProperty();
- if (firstStageChecked) {
- dealObj.setReadOnly(true);
- }
- });
- function post4 () {
- if (firstStageChecked) return;
- const prop = { deal_param: dealObj.getNewDealData() };
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- property.deal_param = data.deal_param;
- $('bd-set-4').modal('hide');
- });
- }
- // 显示设置
- function loadDisplayProperty () {
- $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
- $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
- }
- $('#bd-set-5').on('show.bs.modal', function () {
- loadDisplayProperty();
- });
- function post5 () {
- const prop = {
- display: {
- ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
- },
- };
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- property.display = data.display;
- $('#bd-set-5').modal('hide');
- });
- }
- // 章节设置
- const chapterObj = (function () {
- const spreadSetting = {
- cols: [
- {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
- {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
- ],
- emptyRows: 0,
- headRows: 1,
- headRowHeight: [32],
- defaultRowHeight: 21,
- headerFont: '12px 微软雅黑',
- font: '12px 微软雅黑',
- };
- const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
- spread.options.showVerticalScrollbar = false;
- spread.options.showHorizontalScrollbar = false;
- SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
- function checkSheetData(sheet) {
- let hint = '';
- for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
- const cell = sheet.getCell(iRow, 1);
- const defaultStype = sheet.getDefaultStyle();
- if (cell.text().length > 50) {
- cell.backColor('#f8d7da');
- hint = '章节名称的长度超出范围,请重新输入';
- } else {
- cell.backColor(defaultStype.backColor);
- }
- }
- if (hint === '') {
- $('#hint-6').hide();
- } else {
- $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
- }
- }
- spread.bind(spreadNS.Events.EditEnding, function (e, info) {
- checkSheetData(info.sheet);
- });
- spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
- checkSheetData(info.sheet);
- });
- function loadChapterProperty() {
- SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
- $('#hint-6').hide();
- const sheet = spread.getActiveSheet();
- const defaultStype = sheet.getDefaultStyle();
- sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
- }
- function setReadOnly(readOnly) {
- SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
- }
- function getNewChapterData() {
- const result = [];
- const sheet = spread.getActiveSheet();
- for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
- const data = {};
- for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
- const col = spreadSetting.cols[iCol];
- data[col.field] = sheet.getText(iRow, iCol);
- if (col.field === 'name') {
- if (data.name.length > 50) {
- return null;
- }
- }
- }
- result.push(data);
- }
- return result;
- }
- return { loadChapterProperty, setReadOnly, getNewChapterData, }
- })();
- $('#bd-set-6').on('show.bs.modal', function () {
- chapterObj.loadChapterProperty();
- chapterObj.setReadOnly(false);
- });
- function post6 () {
- const chapter = chapterObj.getNewChapterData();
- if (!chapter) { return; }
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
- property.chapter = data.chapter;
- $('#bd-set-6').modal('hide');
- });
- }
- </script>
|