123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134 |
- <!--标段设置-标段属性-->
- <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);
- SpreadJsObj.massOperationSheet(sheet, function () {
- sheet.defaults.rowHeight = 25;
- 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);//.locked(true);
- 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>
|