123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130 |
- <!--标段设置-标段属性-->
- <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>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#zbxx" 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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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-name" maxlength="100" oninput="limitReturn(this)">
- </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>
- <select class="form-control" id="project-type">
- <option value="">请选择</option>
- <option value="设计">设计</option>
- <option value="监理">监理</option>
- <option value="施工">施工</option>
- <option value="其他">其他</option>
- </select>
- </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-type">
- </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="final-code">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(this)">
- </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);limitReturn(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" oninput="limitReturn(this)">
- </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" oninput="limitReturn(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" style="width:66px">车道数</span>
- </div>
- <input type="text" class="form-control" value="" id="lane-count" maxlength="100" oninput="limitReturn(this)">
- </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" oninput="limitReturn(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="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 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="real-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="real-end-date">
- </div>
- </div>
- <div class="col-12">
- <div class="input-group input-group-sm">
- <div class="input-group-prepend">
- <span class="input-group-text">构造物规模</span>
- </div>
- <textarea class="form-control" id="structure-scale"></textarea>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="zbxx">
- <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="number" class="form-control nospin" value="" id="control-price" onchange="checkNumberValid(this)">
- </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">中标价</span>
- </div>
- <input type="number" class="form-control nospin" value="" id="bid-price" onchange="checkNumberValid(this)">
- </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">开标日期</span>
- </div>
- <input type="date" class="form-control" value="" id="bid-start-date">
- </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" >招标方式</span>
- </div>
- <select class="form-control" id="bid-type">
- <option>公开招标</option>
- <option>邀请招标</option>
- </select>
- </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>
- <select class="form-control" id="deal-calc-type">
- <option>总价合同</option>
- <option>单价合同</option>
- </select>
- </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)) ||
- (!lastStage && revise && revise.valid && (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
- ) { %>
- <!--标段设置-小数位数-->
- <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 pr-0">
- <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 class="row mt-1">
- <div class="col-auto pr-0">
- <div class="form-group form-check pl-0">
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" id="decimal-extra">
- <label class="custom-control-label" for="decimal-extra">其他台账</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-extra-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 pr-0">
- <div class="form-group form-check pl-0">
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" id="decimal-pay" disabled>
- <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 class="row mt-1">
- <div class="col-auto pr-0">
- <div class="form-group form-check pl-0">
- <div class="custom-control custom-switch">
- <input type="checkbox" class="custom-control-input" id="decimal-extra" disabled>
- <label class="custom-control-label" for="decimal-extra">其他台账</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-extra-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">
- <ul class="nav nav-tabs nav-justified mb-2">
- <li class="nav-item">
- <a class="nav-link active" data-toggle="tab" href="#htcs" role="tab" aria-selected="true">合同参数</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#bzqd" role="tab" aria-selected="false">100章清单</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane active" id="htcs">
- <div class="modal-height-300" style="overflow-y: auto">
- <div class="form-group">
- <!--默认显示-->
- <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="bzqd">
- <div class="modal-height-300" style="overflow-y: auto">
- <div class="form-group">
- <div class="form-group" id="cap100-spread" style="height: 230px; width: 465px;">
- </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="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">
- <ul class="nav nav-tabs nav-justified mb-2">
- <li class="nav-item">
- <a class="nav-link active" data-toggle="tab" href="#htcs" role="tab" aria-selected="true">合同参数</a>
- </li>
- <li class="nav-item">
- <a class="nav-link" data-toggle="tab" href="#bzqd" role="tab" aria-selected="false">100章清单</a>
- </li>
- </ul>
- <div class="tab-content">
- <div class="tab-pane active" id="htcs">
- <div class="modal-height-300" style="overflow-y: auto">
- <div class="form-group">
- <!--默认显示-->
- <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
- </div>
- </div>
- </div>
- </div>
- <div class="tab-pane" id="bzqd">
- <div class="modal-height-300" style="overflow-y: auto">
- <div class="form-group">
- <div class="form-group" id="cap100-spread" style="height: 230px; width: 465px;">
- </div>
- </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-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="custom-control-input" id="ledger-dgn-qty" checked="">
- <label class="custom-control-label" for="ledger-dgn-qty">项目节数量</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" id="ledger-cl-qty" checked="">
- <label class="custom-control-label" for="ledger-cl-qty">错漏增减</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" id="thousandth" checked="">
- <label class="custom-control-label" for="thousandth">千分位</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" id="stage-rc" checked="">
- <label class="custom-control-label" for="stage-rc">实际完成量</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" checked="" id="stage-correct">
- <label class="custom-control-label" for="stage-correct">使用数量纠正完成率</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>
- <!--标段设置-付款账号-->
- <div class="modal fade" id="bd-set-7" 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">
- <table class="table table-bordered">
- <tr><th colspan="2" class="text-center">工程款账户</th></tr>
- <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
- <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
- </table>
- </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="post7()" >确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <!--批量设置-->
- <div class="modal fade" id="bd-set-8" 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="alert alert-warning mb-1">从以下标段拷贝设置</div>
- <div class="mb-1" id="setting-custom">
- <a class="btn btn-sm btn-light">
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="custom-control-input" checked data-type="tender">
- <label class="custom-control-label text-primary" for="customCheckDisabld">标段属性</label>
- </div>
- </a>
- <a class="btn btn-sm btn-light">
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="custom-control-input" checked data-type="chapter">
- <label class="custom-control-label text-primary" for="customCheckDisabld2">章节设置</label>
- </div>
- </a>
- <a class="btn btn-sm btn-light">
- <div class="custom-control custom-checkbox">
- <input type="checkbox" class="custom-control-input" checked data-type="pay_account">
- <label class="custom-control-label text-primary" for="customCheckDisabld3">付款账号</label>
- </div>
- </a>
- </div>
- <div class="modal-height-300" id="copyModalContent">
- </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" id="copy_comfirm_btn">确认</button>
- </div>
- </div>
- </div>
- </div>
- <div class="modal fade" id="sp-list" data-backdrop="static">
- <div class="modal-dialog" role="document">
- <div class="modal-content">
- <div class="modal-header bg-dark text-white border-secondary">
- <h5 class="modal-title">审批进度详情</h5>
- </div>
- <div class="modal-body bg-dark text-white">
- <div class="modal-height-500" style="overflow: auto" id="audit-list">
- </div>
- </div>
- <div class="modal-footer bg-dark text-white border-secondary">
- <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- let property = JSON.parse(unescape('<%- escape(JSON.stringify(tenderInfo)) %>'));
- let ledgerChecked = <%- (tender.ledger_status === audit.ledger.status.checked) && ((lastStage !== undefined && lastStage !== null) || !revise || !revise.valid || revise.status === audit.revise.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 limitReturn(obj) {
- limitReg(obj, /\s/g);
- }
- 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);
- $('#project-type').val(property.deal_info.projectType);
- $('#deal-type').val(property.deal_info.dealType);
- $('#final-code').val(property.deal_info.finalCode);
- // 参建单位
- // 建设单位
- $('#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);
- // 技术参数
- $('#load-level').find("option:contains('" + property.tech_param.loadLevel + "')").attr("selected",true);
- $('#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);
- $('#real-start-date').val(property.tech_param.realStartDate);
- $('#real-end-date').val(property.tech_param.realEndDate);
- $('#structure-scale').val(property.tech_param.structureScale);
- // 中标信息
- $('#control-price').val(property.bid_info.controlPrice);
- $('#bid-price').val(property.bid_info.bidPrice);
- $('#bid-start-date').val(property.bid_info.bidStartDate);
- $('#bid-type').find("option:contains('" + property.bid_info.bidType + "')").attr("selected",true);
- $('#deal-calc-type').find("option:contains('" + property.bid_info.dealCalcType + "')").attr("selected",true);
- }
- $('#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(),
- projectType: $('#project-type').val(),
- dealType: $('#deal-type').val(),
- finalCode: $('#final-code').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: $('#load-level').find("option:selected").text(),
- 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(),
- realStartDate: $('#real-start-date').val(),
- realEndDate: $('#real-end-date').val(),
- structureScale: $('#structure-scale').val(),
- },
- bid_info: {
- controlPrice: _.toNumber($('#control-price').val()),
- bidPrice: _.toNumber($('#bid-price').val()),
- bidStartDate: $('#bid-start-date').val(),
- bidType: $('#bid-type').find("option:selected").text(),
- dealCalcType: $('#deal-calc-type').find("option:selected").text(),
- }
- };
- 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;
- property.bid_info = data.bid_info;
- $('#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);
- $('#decimal-pay-tp')[0].disabled = !property.decimal.pay;
- $('#decimal-extra')[0].checked = property.decimal.extra;
- $('#decimal-extra-tp').val(property.decimal.extraTp);
- $('#decimal-extra-tp')[0].disabled = !property.decimal.extra;
- }
- $('#decimal-pay').change(() => {
- $('#decimal-pay-tp')[0].disabled = !$('#decimal-pay')[0].checked;
- });
- $('#decimal-extra').change(() => {
- $('#decimal-extra-tp')[0].disabled = !$('#decimal-extra')[0].checked;
- });
- $('#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()),
- extra: $('#decimal-extra')[0].checked,
- extraTp: _.toNumber($('#decimal-extra-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;
- }
- }
- if (property.decimal.extra) {
- if (!prop.decimal.extra) {
- toastr.warning('第一期已审批完成,不可取消其他台账单独设置');
- return;
- }
- if (prop.decimal.extraTp < property.decimal.extraTp) {
- toastr.warning('第一期已审批完成,单独设置的其他台账小数位数,不可小于' + property.decimal.extraTp);
- return;
- }
- } else {
- if (prop.decimal.extra) {
- 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 in 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)) ||
- (!lastStage && revise && revise.valid && (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
- )) { %>
- 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, '签约材料预付款');
- sheet.setText(5, 0, '安全生产费');
- sheet.getCell(2, 1).locked(true);
- 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);
- });
- const cap100spread = SpreadJsObj.createNewSpread($('#cap100-spread')[0]);
- cap100spread.options.showVerticalScrollbar = false;
- cap100spread.options.showHorizontalScrollbar = false;
- const cap100sheet = cap100spread.getActiveSheet();
- SpreadJsObj.protectedSheet(cap100sheet);
- cap100sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
- cap100sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
- cap100sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
- cap100sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
- cap100sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
- cap100sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
- SpreadJsObj.massOperationSheet(cap100sheet, function () {
- cap100sheet.defaults.rowHeight = 21;
- cap100sheet.setColumnCount(2);
- cap100sheet.setRowCount(2);
- cap100sheet.setColumnWidth(0, 200);
- cap100sheet.setColumnWidth(1, 200);
- cap100sheet.getRange(0, 0, 2, 1).vAlign(1).backColor('#e4e7ea').locked(true);
- cap100sheet.getRange(0, 1, 2, 1).vAlign(1).hAlign(2).locked(false);
- cap100sheet.setText(0, 0, '安全生产费');
- cap100sheet.setText(1, 0, '扬尘污染费');
- const cap100lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
- cap100sheet.getRange(0, 0, 2, 2).setBorder(cap100lineBorder, {all: true});
- cap100sheet.getRange(0, 0, 2, 2).formatter('@');
- cap100sheet.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 === 0 || info.row === 1) {
- 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();
- });
- cap100spread.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 === 0 || info.row === 1) {
- // calcHtjMinusZlj();
- // }
- });
- SpreadJsObj.addDeleteBind(cap100spread, 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();
- });
- cap100spread.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('请输入不超过万亿的数字');
- }
- });
- 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);
- // sheet.setValue(5, 1, property.deal_param.safeAdvance);
- cap100sheet.setValue(0, 1, property.deal_param.safeAdvance);
- cap100sheet.setValue(1, 1, property.deal_param.dustAdvance);
- }
- 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);
- // sheet.getCell(5, 1).locked(readOnly);
- cap100sheet.getCell(0, 1).locked(readOnly);
- cap100sheet.getCell(1, 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));
- // result.safeAdvance = _.toNumber(sheet.getText(5, 1));
- result.safeAdvance = _.toNumber(cap100sheet.getText(0, 1));
- result.dustAdvance = _.toNumber(cap100sheet.getText(1, 1));
- return result;
- }
- return { loadDealProperty, setReadOnly, getNewDealData, };
- })();
- $('#bd-set-4').on('show.bs.modal', function () {
- dealObj.loadDealProperty();
- <% if (lastStage !== undefined && lastStage !== null && (lastStage.user_id !== ctx.session.sessionUser.accountId || lastStage.order > 1 || (lastStage.order === 1 && (lastStage.status !== audit.stage.status.uncheck && lastStage.status !== audit.stage.status.checkNo)))) { %>
- 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');
- window.location.reload();
- });
- }
- // 显示设置
- function loadDisplayProperty () {
- $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
- $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
- $('#thousandth')[0].checked = property.display.thousandth;
- $('#stage-rc')[0].checked = property.display.stage.realComplete;
- $('#stage-correct')[0].checked = property.display.stage.correct;
- }
- $('#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, },
- thousandth: $('#thousandth')[0].checked,
- stage: { realComplete: $('#stage-rc')[0].checked, correct: $('#stage-correct')[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();
- cell.text(cell.text().replace(/\s/g, ''))
- 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.EditEnded, 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).replace(/\s/g, '');
- 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');
- });
- }
- // 属性
- function loadPayProperty () {
- // 付款账号
- $('#project-name').val(property.pay_account.project.name);
- $('#project-bank').val(property.pay_account.project.bank);
- $('#project-account').val(property.pay_account.project.account);
- $('#project-rate').val(property.pay_account.project.rate);
- $('#project-contact').val(property.pay_account.project.contact);
- $('#project-phone').val(property.pay_account.project.phone);
- $('#worker-name').val(property.pay_account.worker.name);
- $('#worker-bank').val(property.pay_account.worker.bank);
- $('#worker-account').val(property.pay_account.worker.account);
- $('#worker-rate').val(property.pay_account.worker.rate);
- $('#worker-contact').val(property.pay_account.worker.contact);
- $('#worker-phone').val(property.pay_account.worker.phone);
- }
- $('#bd-set-7').on('show.bs.modal', function () {
- loadPayProperty();
- })
- function post7 () {
- let flag = false;
- const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
- const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
- const project_rate = $('#project-rate').val();
- if (!rate_reg.test(project_rate) && project_rate !== '') {
- toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
- flag = true;
- }
- const project_phone = $('#project-phone').val();
- if (!phone_reg.test(project_phone) && project_phone !== '') {
- toastr.error('工程款账户联系电话格式有误');
- flag = true;
- }
- const worker_rate = $('#worker-rate').val();
- if (!rate_reg.test(worker_rate) && worker_rate !== '') {
- toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
- flag = true;
- }
- const worker_phone = $('#worker-phone').val();
- if (!phone_reg.test(worker_phone) && worker_phone !== '') {
- toastr.error('农民工工资专用账户联系电话格式有误');
- flag = true;
- }
- if (flag) {
- return false;
- }
- const prop = {
- pay_account: {
- project: {
- name: $('#project-name').val(),
- bank: $('#project-bank').val(),
- account: $('#project-account').val(),
- rate: $('#project-rate').val(),
- contact: $('#project-contact').val(),
- phone: $('#project-phone').val(),
- },
- worker: {
- name: $('#worker-name').val(),
- bank: $('#worker-bank').val(),
- account: $('#worker-account').val(),
- rate: $('#worker-rate').val(),
- contact: $('#worker-contact').val(),
- phone: $('#worker-phone').val(),
- },
- },
- };
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save', prop, function (data) {
- property.pay_account = data.pay_account;
- $('#bd-set-7').modal('hide');
- });
- }
- </script>
- <% if (ctx.session.sessionUser.is_admin) { %>
- <!--游客账号-->
- <div class="modal fade" id="bd-set-9" 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="dropdown text-right">
- <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="tourist_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- 添加游客
- </button>
- <div class="dropdown-menu dropdown-menu-right" id="tourist_dropdownMenu" aria-labelledby="tourist_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off"></div>
- <dl class="list-unstyled book-list">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.tender.data.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </div>
- <div class="card mt-3">
- <div class="card-header">
- 游客列表
- </div>
- <div class="modal-height-300">
- <ul class="list-group list-group-flush" id="tourist-users">
- <% for (const t of tourists) { %>
- <li class="list-group-item" data-id="<%- t.user_id %>">
- <a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="<%- t.id %>">移除</a><%- t.user_name %> <small class="text-muted"><%- t.user_role %></small><p class="m-0 ml-2"><small class="text-muted"><%- t.user_company %></small></p></li>
- <% } %>
- </ul>
- </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-10" 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="custom-control-input" id="lc_same_code" checked="">
- <label class="custom-control-label" for="lc_same_code">重复项目节</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" id="lc_sibling" checked="">
- <label class="custom-control-label" for="lc_sibling">项目节清单同层次</label>
- </div>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" class="custom-control-input" id="lc_over" checked="">
- <label class="custom-control-label" for="lc_over">超计判断</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="post10()">确认修改</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
- const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
- const cur_tender_uid = parseInt('<%- ctx.tender.data.user_id %>');
- const cur_tenderid = parseInt('<%- ctx.tender.id %>');
- const loadLedgerCheckProperty = function () {
- $('#lc_same_code')[0].checked = property.ledger_check.same_code;
- $('#lc_sibling')[0].checked = property.ledger_check.sibling;
- $('#lc_over')[0].checked = property.ledger_check.over;
- }
- $('#bd-set-10').on('show.bs.modal', function () {
- loadLedgerCheckProperty();
- });
- function post10 () {
- const prop = {
- ledger_check: {
- same_code: $('#lc_same_code')[0].checked,
- sibling: $('#lc_sibling')[0].checked,
- over: $('#lc_over')[0].checked,
- },
- };
- const tenderId = window.location.pathname.split('/')[2];
- postData('/tender/' + tenderId + '/save2', prop, function (data) {
- property.ledger_check = data.ledger_check;
- $('#bd-set-10').modal('hide');
- });
- }
- $(function () {
- // 投资进度
- let timer2 = null;
- let oldSearchVal2 = null;
- $('body').on('input propertychange', '#tourist_dropdownMenu .gr-search', function (e) {
- oldSearchVal2 = e.target.value;
- timer2 && clearTimeout(timer2);
- timer2 = setTimeout(() => {
- const newVal = $(this).val();
- let html = '';
- if (newVal && newVal === oldSearchVal2) {
- accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
- html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
- <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
- class="ml-auto">${item.mobile || ''}</span></p>
- <span class="text-muted">${item.role || ''}</span>
- </dd>`
- });
- $('#tourist_dropdownMenu .book-list').empty();
- $('#tourist_dropdownMenu .book-list').append(html);
- } else {
- if (!$('#tourist_dropdownMenu .acc-btn').length) {
- accountGroup.forEach((group, idx) => {
- if (!group) return;
- html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
- </a> ${group.groupName}</dt>
- <div class="dd-content" data-toggleid="${idx}">`;
- group.groupList.forEach(item => {
- if (item.id !== cur_tender_uid) {
- html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
- <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
- class="ml-auto">${item.mobile || ''}</span></p>
- <span class="text-muted">${item.role || ''}</span>
- </dd>`;
- }
- });
- html += '</div>';
- });
- $('#tourist_dropdownMenu .book-list').empty();
- $('#tourist_dropdownMenu .book-list').append(html);
- }
- }
- }, 400);
- });
- // 添加审批流程按钮逻辑
- $('body').on('click', '#tourist_dropdownMenu .book-list dt', function () {
- const idx = $(this).find('.acc-btn').attr('data-groupid');
- const type = $(this).find('.acc-btn').attr('data-type');
- if (type === 'hide') {
- $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
- $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
- $(this).find('.acc-btn').attr('data-type', 'show');
- })
- } else {
- $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
- $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
- $(this).find('.acc-btn').attr('data-type', 'hide');
- })
- }
- return false;
- });
- // 选中用户
- $('body').on('click', '#tourist_dropdownMenu dl dd', function () {
- const id = parseInt($(this).data('id'));
- if (id) {
- const user = _.find(accountList, function (item) {
- return item.id === id;
- });
- const saIdList = [];
- for (let i = 0; i < $('#tourist-users li').length; i++) {
- saIdList.push(parseInt($('#tourist-users li').eq(i).data('id')));
- }
- if (_.includes(saIdList, id)) {
- toastr.error('该用户已存在列表中,无需重复添加');
- return;
- }
- const prop = {
- user_id: id,
- type: 'add',
- };
- postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
- const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
- '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
- '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
- $('#tourist-users').append(html);
- // 外面显示游客数量
- const num = $('#tourist-users li').length;
- if (!$('#tourist-num').hasClass('badge')) {
- $('#tourist-num').addClass('badge badge-secondary').text(num);
- } else {
- $('#tourist-num').text(num);
- }
- });
- }
- });
- // 移除用户
- $('body').on('click', '#tourist-users .remove-tourist-user', function () {
- const id = parseInt($(this).data('id'));
- if (id) {
- const prop = {
- id,
- type: 'del',
- };
- const _self = $(this);
- postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
- _self.parents('li').remove();
- // 外面显示游客数量
- const num = $('#tourist-users li').length;
- if (num == 0) {
- $('#tourist-num').removeClass('badge badge-secondary').text('');
- } else {
- $('#tourist-num').text(num);
- }
- });
- }
- });
- });
- </script>
- <% } %>
- <% if (ctx.session.sessionProject.page_show.xxjd && ctx.session.sessionUser.is_admin) { %>
- <!--标段设置-投资进度-->
- <div class="modal fade" id="xxjd-set" 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="alert alert-warning">设置可使用「投资进度」用户</div>
- <div class="dropdown">
- <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="xxjd_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
- 添加用户
- </button>
- <div class="dropdown-menu" id="xxjd_dropdownMenu" aria-labelledby="xxjd_dropdownMenuButton" style="width:220px">
- <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
- placeholder="姓名/手机 检索" autocomplete="off"></div>
- <dl class="list-unstyled book-list">
- <% accountGroup.forEach((group, idx) => { %>
- <dt><a href="javascript: void(0);" class="acc-btn" data-groupid="<%- idx %>" data-type="hide"><i class="fa fa-plus-square"></i></a> <%- group.groupName %></dt>
- <div class="dd-content" data-toggleid="<%- idx %>">
- <% group.groupList.forEach(item => { %>
- <% if (item.id !== ctx.tender.data.user_id) { %>
- <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
- <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
- class="ml-auto"><%- item.mobile %></span></p>
- <span class="text-muted"><%- item.role %></span>
- </dd>
- <% } %>
- <% });%>
- </div>
- <% }) %>
- </dl>
- </div>
- </div>
- <div class="mt-1" style="max-height: 300px;overflow: auto">
- <table class="table table-bordered">
- <tr><th>用户</th><th>查看</th><th>修改</th><th>移除</th></tr>
- <tbody id="schedule-users">
- <% for (const sa of scheduleAuditList) { %>
- <% const audit = ctx.helper._.find(accountList, { id : sa.audit_id }); %>
- <% if (audit) { %>
- <tr data-id="<%- audit.id %>"><td><p class="mb-0 d-flex"><b class="col-5 pl-0"><%- audit.name %></b> <span class="text-muted"><%- audit.mobile %></span><p class="text-muted mb-0"><%- audit.role %></p></td><td>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" data-zhi="<%- scPermission.show %>" data-id="<%- sa.id %>" id="<%- sa.id %>_customRadio41" name="customCheckbox" class="custom-control-input" <% if (sa.permission !== scPermission.no) { %>checked<% } %>>
- <label class="custom-control-label" for="<%- sa.id %>_customRadio41"></label>
- </div>
- </td><td>
- <div class="custom-control custom-checkbox mb-2">
- <input type="checkbox" data-zhi="<%- scPermission.edit %>" data-id="<%- sa.id %>" id="<%- sa.id %>_customRadio42" name="customCheckbox" class="custom-control-input" <% if (sa.permission === scPermission.edit) { %>checked<% } %>>
- <label class="custom-control-label" for="<%- sa.id %>_customRadio42"></label>
- </div>
- </td>
- <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="<%- sa.id %>">移除</a></td>
- </tr>
- <% } %>
- <% } %>
- </tbody>
- </table>
- </div>
- </div>
- <div class="modal-footer">
- <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
- </div>
- </div>
- </div>
- </div>
- <script>
- $(function () {
- const scPermission = JSON.parse(unescape('<%- escape(JSON.stringify(scPermission)) %>'));
- // 投资进度
- let timer = null;
- let oldSearchVal = null;
- $('body').on('input propertychange', '#xxjd_dropdownMenu .gr-search', function(e) {
- oldSearchVal = e.target.value;
- timer && clearTimeout(timer);
- timer = setTimeout(() => {
- const newVal = $(this).val();
- let html = '';
- if (newVal && newVal === oldSearchVal) {
- accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
- html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
- <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
- class="ml-auto">${item.mobile || ''}</span></p>
- <span class="text-muted">${item.role || ''}</span>
- </dd>`
- });
- $('#xxjd_dropdownMenu .book-list').empty();
- $('#xxjd_dropdownMenu .book-list').append(html);
- } else {
- if (!$('#xxjd_dropdownMenu .acc-btn').length) {
- accountGroup.forEach((group, idx) => {
- if (!group) return;
- html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
- </a> ${group.groupName}</dt>
- <div class="dd-content" data-toggleid="${idx}">`;
- group.groupList.forEach(item => {
- if (item.id !== cur_tender_uid) {
- html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
- <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
- class="ml-auto">${item.mobile || ''}</span></p>
- <span class="text-muted">${item.role || ''}</span>
- </dd>`;
- }
- });
- html += '</div>';
- });
- $('#xxjd_dropdownMenu .book-list').empty();
- $('#xxjd_dropdownMenu .book-list').append(html);
- }
- }
- }, 400);
- });
- // 添加审批流程按钮逻辑
- $('body').on('click', '#xxjd_dropdownMenu .book-list dt', function () {
- const idx = $(this).find('.acc-btn').attr('data-groupid');
- const type = $(this).find('.acc-btn').attr('data-type');
- if (type === 'hide') {
- $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
- $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
- $(this).find('.acc-btn').attr('data-type', 'show');
- })
- } else {
- $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
- $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
- $(this).find('.acc-btn').attr('data-type', 'hide');
- })
- }
- return false;
- });
- // 选中用户
- $('body').on('click', '#xxjd_dropdownMenu dl dd', function () {
- const id = parseInt($(this).data('id'));
- if (id) {
- const user = _.find(accountList, function (item) {
- return item.id === id;
- });
- const saIdList = [];
- for (let i = 0; i < $('#schedule-users tr').length; i++) {
- saIdList.push(parseInt($('#schedule-users tr').eq(i).data('id')));
- }
- if (_.includes(saIdList, id)) {
- toastr.error('该用户已存在列表中,无需重复添加');
- return;
- }
- const prop = {
- audit_id: id,
- type: 'add',
- };
- postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
- const html = '<tr data-id="'+ user.id + '"><td><p class="mb-0 d-flex"><b class="col-5 pl-0">'+ user.name + '</b> <span class="text-muted">'+ user.mobile + '</span><p class="text-muted mb-0">'+ user.role + '</p></td><td>\n' +
- ' <div class="custom-control custom-checkbox mb-2">\n' +
- ' <input type="checkbox" data-zhi="'+ scPermission.show +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio41" name="customCheckbox" class="custom-control-input" checked>\n' +
- ' <label class="custom-control-label" for="'+ data.id + '_customRadio41"></label>\n' +
- ' </div>\n' +
- ' </td><td>\n' +
- ' <div class="custom-control custom-checkbox mb-2">\n' +
- ' <input type="checkbox" data-zhi="'+ scPermission.edit +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio42" name="customCheckbox" class="custom-control-input">\n' +
- ' <label class="custom-control-label" for="'+ data.id + '_customRadio42"></label>\n' +
- ' </div>\n' +
- ' </td>\n' +
- ' <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="'+ data.id + '">移除</a></td>\n' +
- ' </tr>';
- $('#schedule-users').append(html);
- });
- }
- });
- // 移除用户
- $('body').on('click', '#schedule-users .remove-schedule-user', function () {
- const id = parseInt($(this).data('id'));
- if (id) {
- const prop = {
- id,
- type: 'del',
- };
- const _self = $(this);
- postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
- _self.parents('tr').remove();
- });
- }
- });
- // 权限更改
- $('body').on('click', '#schedule-users input[type="checkbox"]', function () {
- let permission = scPermission.no;
- const value = parseInt($(this).data('zhi'));
- if ($(this).is(':checked')) {
- if (value === scPermission.edit) {
- permission = scPermission.edit;
- $(this).parents('td').siblings().find('input').prop('checked', true);
- } else if (value === scPermission.show) {
- permission = scPermission.show;
- }
- } else {
- if (value === scPermission.edit) {
- permission = scPermission.show;
- } else if (value === scPermission.show) {
- permission = scPermission.no;
- $(this).parents('td').siblings().find('input').prop('checked', false);
- }
- }
- const id = parseInt($(this).data('id'));
- const prop = {
- id,
- permission,
- type: 'edit',
- };
- const _self = $(this);
- postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
- });
- });
- })
- </script>
- <% } %>
|