12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145 |
- <!--标段设置-标段属性-->
- <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) {
- 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.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).locked(false);
- 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];
- if (sel) {
- for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
- for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
- if (iCol !== 1) continue;
- sheet.setText(iRow, iCol, '0');
- }
- }
- }
- });
- 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);
- 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(5);
- sheet.setColumnWidth(0, 200);
- sheet.setColumnWidth(1, 200);
- sheet.getRange(0, 0, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
- sheet.getRange(0, 1, 5, 1).vAlign(1).hAlign(2).locked(false);
- sheet.setText(0, 0, '签约合同价');
- sheet.setText(1, 0, '暂列金额');
- sheet.setText(2, 0, '签约合同价(不含暂列金)');
- sheet.setText(3, 0, '签约开工预付款');
- sheet.setText(4, 0, '签约材料预付款');
- const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
- sheet.getRange(0, 0, 5, 2).setBorder(lineBorder, {all: true});
- sheet.getRange(0, 0, 5, 2).formatter('@');
- sheet.setSelection(0, 1, 1, 1);
- });
- function calcHtjMinusZlj() {
- const htj = _.toNumber(sheet.getText(0, 1));
- const zlj = _.toNumber(sheet.getText(1, 1));
- sheet.setValue(2, 1, ZhCalc.sub(htj, zlj));
- }
- 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 === 2) continue;
- for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
- if (iCol !== 1) continue;
- sheet.setText(iRow, iCol, '0');
- if (iRow === 0 || iRow === 1) 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() {
- sheet.setValue(0, 1, property.deal_param.contractPrice);
- sheet.setValue(1, 1, property.deal_param.zanLiePrice);
- sheet.setValue(2, 1, ZhCalc.sub(property.deal_param.contractPrice, property.deal_param.zanLiePrice));
- sheet.setValue(3, 1, property.deal_param.startAdvance);
- sheet.setValue(4, 1, property.deal_param.materialAdvance);
- }
- function setReadOnly (readOnly) {
- sheet.getCell(0, 1).locked(readOnly);
- sheet.getCell(1, 1).locked(readOnly);
- sheet.getCell(3, 1).locked(readOnly);
- sheet.getCell(4, 1).locked(readOnly);
- }
- function getNewDealData () {
- const result = {};
- result.contractPrice = _.toNumber(sheet.getText(0, 1));
- result.zanLiePrice = _.toNumber(sheet.getText(1, 1));
- result.startAdvance = _.toNumber(sheet.getText(3, 1));
- result.materialAdvance = _.toNumber(sheet.getText(4, 1));
- 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>
|