detail_modal.ejs 113 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130
  1. <!--标段设置-标段属性-->
  2. <div class="modal fade" id="bd-set-1" data-backdrop="static">
  3. <div class="modal-dialog" role="document">
  4. <div class="modal-content">
  5. <div class="modal-header">
  6. <h5 class="modal-title">标段属性</h5>
  7. </div>
  8. <div class="modal-height-500" style="overflow-y: auto">
  9. <div class="modal-body">
  10. <ul class="nav nav-tabs nav-justified mb-2">
  11. <li class="nav-item">
  12. <a class="nav-link active" data-toggle="tab" href="#htxx" role="tab" aria-selected="true">合同信息</a>
  13. </li>
  14. <li class="nav-item">
  15. <a class="nav-link" data-toggle="tab" href="#cjdw" role="tab" aria-selected="false">参建单位</a>
  16. </li>
  17. <li class="nav-item">
  18. <a class="nav-link" data-toggle="tab" href="#jscs" role="tab">技术参数</a>
  19. </li>
  20. <li class="nav-item">
  21. <a class="nav-link" data-toggle="tab" href="#zbxx" role="tab">中标信息</a>
  22. </li>
  23. </ul>
  24. <div class="tab-content">
  25. <div class="tab-pane active" id="htxx">
  26. <div class="form-group">
  27. <div class="row">
  28. <div class="col-12 mb-2">
  29. <div class="input-group input-group-sm">
  30. <div class="input-group-prepend">
  31. <span class="input-group-text">建设项目名称</span>
  32. </div>
  33. <input type="text" class="form-control" value="项目A" id="build-name" maxlength="100" oninput="limitReturn(this)">
  34. </div>
  35. </div>
  36. <div class="col-12 mb-2">
  37. <div class="input-group input-group-sm">
  38. <div class="input-group-prepend">
  39. <span class="input-group-text" style="width:90px">合同编号</span>
  40. </div>
  41. <input type="text" class="form-control" value="" id="deal-code" maxlength="100" oninput="limitReturn(this)">
  42. </div>
  43. </div>
  44. <div class="col-12 mb-2">
  45. <div class="input-group input-group-sm">
  46. <div class="input-group-prepend">
  47. <span class="input-group-text" style="width:90px">合同名称</span>
  48. </div>
  49. <input type="text" class="form-control" value="" id="deal-name" maxlength="100" oninput="limitReturn(this)">
  50. </div>
  51. </div>
  52. <div class="col-12 mb-2">
  53. <div class="input-group input-group-sm">
  54. <div class="input-group-prepend">
  55. <span class="input-group-text" style="width:90px">工程类别</span>
  56. </div>
  57. <select class="form-control" id="project-type">
  58. <option value="">请选择</option>
  59. <option value="设计">设计</option>
  60. <option value="监理">监理</option>
  61. <option value="施工">施工</option>
  62. <option value="其他">其他</option>
  63. </select>
  64. </div>
  65. </div>
  66. <div class="col-12 mb-2">
  67. <div class="input-group input-group-sm">
  68. <div class="input-group-prepend">
  69. <span class="input-group-text" style="width:90px">合同类别</span>
  70. </div>
  71. <input type="text" class="form-control" value="" id="deal-type">
  72. </div>
  73. </div>
  74. <div class="col-12">
  75. <div class="input-group input-group-sm">
  76. <div class="input-group-prepend">
  77. <span class="input-group-text" style="width:90px">结算书编号</span>
  78. </div>
  79. <input type="text" class="form-control" value="" id="final-code">
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <div class="tab-pane" id="cjdw">
  86. <div class="form-group mb-4">
  87. <label>建设单位:</label>
  88. <div class="row">
  89. <div class="col-12 mb-2">
  90. <div class="input-group input-group-sm">
  91. <div class="input-group-prepend">
  92. <span class="input-group-text">单位名称</span>
  93. </div>
  94. <input type="text" class="form-control" value="" id="build-company" maxlength="100" oninput="limitReturn(this)">
  95. </div>
  96. </div>
  97. <div class="col-6 pr-0">
  98. <div class="input-group input-group-sm">
  99. <div class="input-group-prepend">
  100. <span class="input-group-text">法人代表</span>
  101. </div>
  102. <input type="text" class="form-control" value="" id="build-corporation" maxlength="100" oninput="limitReturn(this)">
  103. </div>
  104. </div>
  105. <div class="col-6">
  106. <div class="input-group input-group-sm">
  107. <div class="input-group-prepend">
  108. <span class="input-group-text">签订日期</span>
  109. </div>
  110. <input type="date" class="form-control" value="" id="build-date">
  111. </div>
  112. </div>
  113. </div>
  114. </div>
  115. <div class="form-group mb-4">
  116. <label>承包单位1:</label>
  117. <div class="row">
  118. <div class="col-12 mb-2">
  119. <div class="input-group input-group-sm">
  120. <div class="input-group-prepend">
  121. <span class="input-group-text">单位名称</span>
  122. </div>
  123. <input type="text" class="form-control" value="" id="contract1-company" maxlength="100" oninput="limitReturn(this)">
  124. </div>
  125. </div>
  126. <div class="col-6 pr-0">
  127. <div class="input-group input-group-sm">
  128. <div class="input-group-prepend">
  129. <span class="input-group-text">法人代表</span>
  130. </div>
  131. <input type="text" class="form-control" value="" id="contract1-corporation" maxlength="100" oninput="limitReturn(this)">
  132. </div>
  133. </div>
  134. <div class="col-6">
  135. <div class="input-group input-group-sm">
  136. <div class="input-group-prepend">
  137. <span class="input-group-text">签订日期</span>
  138. </div>
  139. <input type="date" class="form-control" value="" id="contract1-date">
  140. </div>
  141. </div>
  142. </div>
  143. </div>
  144. <div class="form-group mb-4">
  145. <label>承包单位2:</label>
  146. <div class="row">
  147. <div class="col-12 mb-2">
  148. <div class="input-group input-group-sm">
  149. <div class="input-group-prepend">
  150. <span class="input-group-text">单位名称</span>
  151. </div>
  152. <input type="text" class="form-control" value="" id="contract2-company" maxlength="100" oninput="limitReturn(this)">
  153. </div>
  154. </div>
  155. <div class="col-6 pr-0">
  156. <div class="input-group input-group-sm">
  157. <div class="input-group-prepend">
  158. <span class="input-group-text">法人代表</span>
  159. </div>
  160. <input type="text" class="form-control" value="" id="contract2-corporation" maxlength="100" oninput="limitReturn(this)">
  161. </div>
  162. </div>
  163. <div class="col-6">
  164. <div class="input-group input-group-sm">
  165. <div class="input-group-prepend">
  166. <span class="input-group-text">签订日期</span>
  167. </div>
  168. <input type="date" class="form-control" value="" id="contract2-date">
  169. </div>
  170. </div>
  171. </div>
  172. </div>
  173. <div class="form-group mb-4">
  174. <label>监理单位1:</label>
  175. <div class="row">
  176. <div class="col-12 mb-2">
  177. <div class="input-group input-group-sm">
  178. <div class="input-group-prepend">
  179. <span class="input-group-text">单位名称</span>
  180. </div>
  181. <input type="text" class="form-control" value="" id="supervision1-company" maxlength="100" oninput="limitReturn(this)">
  182. </div>
  183. </div>
  184. <div class="col-6 pr-0">
  185. <div class="input-group input-group-sm">
  186. <div class="input-group-prepend">
  187. <span class="input-group-text">法人代表</span>
  188. </div>
  189. <input type="text" class="form-control" value="" id="supervision1-corporation" maxlength="100" oninput="limitReturn(this)">
  190. </div>
  191. </div>
  192. <div class="col-6">
  193. <div class="input-group input-group-sm">
  194. <div class="input-group-prepend">
  195. <span class="input-group-text">签订日期</span>
  196. </div>
  197. <input type="date" class="form-control" value="" id="supervision1-date">
  198. </div>
  199. </div>
  200. </div>
  201. </div>
  202. <div class="form-group">
  203. <label>监理单位2:</label>
  204. <div class="row">
  205. <div class="col-12 mb-2">
  206. <div class="input-group input-group-sm">
  207. <div class="input-group-prepend">
  208. <span class="input-group-text">单位名称</span>
  209. </div>
  210. <input type="text" class="form-control" value="" id="supervision2-company" maxlength="100" oninput="limitReturn(this)">
  211. </div>
  212. </div>
  213. <div class="col-6 pr-0">
  214. <div class="input-group input-group-sm">
  215. <div class="input-group-prepend">
  216. <span class="input-group-text">法人代表</span>
  217. </div>
  218. <input type="text" class="form-control" value="" id="supervision2-corporation" maxlength="100" oninput="limitReturn(this)">
  219. </div>
  220. </div>
  221. <div class="col-6">
  222. <div class="input-group input-group-sm">
  223. <div class="input-group-prepend">
  224. <span class="input-group-text">签订日期</span>
  225. </div>
  226. <input type="date" class="form-control" value="" id="supervision2-date">
  227. </div>
  228. </div>
  229. </div>
  230. </div>
  231. </div>
  232. <div class="tab-pane" id="jscs">
  233. <div class="form-group">
  234. <div class="row">
  235. <div class="col-6 pr-0 mb-2">
  236. <div class="input-group input-group-sm">
  237. <div class="input-group-prepend">
  238. <span class="input-group-text">公路等级</span>
  239. </div>
  240. <select class="form-control" id="load-level">
  241. <option>高速公路</option>
  242. <option>一级公路</option>
  243. <option>二级公路</option>
  244. <option>三级公路</option>
  245. <option>四级公路</option>
  246. </select>
  247. </div>
  248. </div>
  249. <div class="col-6">
  250. <div class="input-group input-group-sm">
  251. <div class="input-group-prepend">
  252. <span class="input-group-text" style="width:90px">长度(KM)</span>
  253. </div>
  254. <input type="text" class="form-control" value="" id="length" min="0" max="10000"
  255. oninput="limitDealParamLength(this);limitReturn(this);" onchange="checkNumberValid(this)">
  256. </div>
  257. </div>
  258. <div class="col-6 pr-0 mb-2">
  259. <div class="input-group input-group-sm">
  260. <div class="input-group-prepend">
  261. <span class="input-group-text">起始桩号</span>
  262. </div>
  263. <input type="text" class="form-control" value="" id="start-peg" maxlength="100" oninput="limitReturn(this)">
  264. </div>
  265. </div>
  266. <div class="col-6">
  267. <div class="input-group input-group-sm">
  268. <div class="input-group-prepend">
  269. <span class="input-group-text" style="width:90px">终止桩号</span>
  270. </div>
  271. <input type="text" class="form-control" value="" id="end-peg" maxlength="100" oninput="limitReturn(this)">
  272. </div>
  273. </div>
  274. <div class="col-6 pr-0 mb-2">
  275. <div class="input-group input-group-sm">
  276. <div class="input-group-prepend">
  277. <span class="input-group-text" style="width:66px">车道数</span>
  278. </div>
  279. <input type="text" class="form-control" value="" id="lane-count" maxlength="100" oninput="limitReturn(this)">
  280. </div>
  281. </div>
  282. <div class="col-6">
  283. <div class="input-group input-group-sm">
  284. <div class="input-group-prepend">
  285. <span class="input-group-text" style="width:90px">合同工期</span>
  286. </div>
  287. <input type="text" class="form-control" value="" id="deal-period" maxlength="100" oninput="limitReturn(this)">
  288. </div>
  289. </div>
  290. <div class="col-6 pr-0 mb-2">
  291. <div class="input-group input-group-sm">
  292. <div class="input-group-prepend">
  293. <span class="input-group-text">开工日期</span>
  294. </div>
  295. <input type="date" class="form-control" value="" id="start-date">
  296. </div>
  297. </div>
  298. <div class="col-6">
  299. <div class="input-group input-group-sm">
  300. <div class="input-group-prepend">
  301. <span class="input-group-text">计划完工日期</span>
  302. </div>
  303. <input type="date" class="form-control" value="" id="plan-end-date">
  304. </div>
  305. </div>
  306. <div class="col-6 pr-0 mb-2">
  307. <div class="input-group input-group-sm">
  308. <div class="input-group-prepend">
  309. <span class="input-group-text">实际开工日期</span>
  310. </div>
  311. <input type="date" class="form-control" value="" id="real-start-date">
  312. </div>
  313. </div>
  314. <div class="col-6">
  315. <div class="input-group input-group-sm">
  316. <div class="input-group-prepend">
  317. <span class="input-group-text">实际完工日期</span>
  318. </div>
  319. <input type="date" class="form-control" value="" id="real-end-date">
  320. </div>
  321. </div>
  322. <div class="col-12">
  323. <div class="input-group input-group-sm">
  324. <div class="input-group-prepend">
  325. <span class="input-group-text">构造物规模</span>
  326. </div>
  327. <textarea class="form-control" id="structure-scale"></textarea>
  328. </div>
  329. </div>
  330. </div>
  331. </div>
  332. </div>
  333. <div class="tab-pane" id="zbxx">
  334. <div class="form-group">
  335. <div class="row">
  336. <div class="col-12 mb-2">
  337. <div class="input-group input-group-sm">
  338. <div class="input-group-prepend">
  339. <span class="input-group-text">业主控制价</span>
  340. </div>
  341. <input type="number" class="form-control nospin" value="" id="control-price" onchange="checkNumberValid(this)">
  342. </div>
  343. </div>
  344. <div class="col-12 mb-2">
  345. <div class="input-group input-group-sm">
  346. <div class="input-group-prepend">
  347. <span class="input-group-text">中标价</span>
  348. </div>
  349. <input type="number" class="form-control nospin" value="" id="bid-price" onchange="checkNumberValid(this)">
  350. </div>
  351. </div>
  352. <div class="col-12 mb-2">
  353. <div class="input-group input-group-sm">
  354. <div class="input-group-prepend">
  355. <span class="input-group-text">开标日期</span>
  356. </div>
  357. <input type="date" class="form-control" value="" id="bid-start-date">
  358. </div>
  359. </div>
  360. <div class="col-12 mb-2">
  361. <div class="input-group input-group-sm">
  362. <div class="input-group-prepend">
  363. <span class="input-group-text" >招标方式</span>
  364. </div>
  365. <select class="form-control" id="bid-type">
  366. <option>公开招标</option>
  367. <option>邀请招标</option>
  368. </select>
  369. </div>
  370. </div>
  371. <div class="col-12 mb-2">
  372. <div class="input-group input-group-sm">
  373. <div class="input-group-prepend">
  374. <span class="input-group-text" style="width:90px">合同计价方式</span>
  375. </div>
  376. <select class="form-control" id="deal-calc-type">
  377. <option>总价合同</option>
  378. <option>单价合同</option>
  379. </select>
  380. </div>
  381. </div>
  382. </div>
  383. </div>
  384. </div>
  385. </div>
  386. </div>
  387. </div>
  388. <div class="modal-footer">
  389. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  390. <button type="button" class="btn btn-sm btn-primary" onclick="post1();">确认修改</button>
  391. </div>
  392. </div>
  393. </div>
  394. </div>
  395. <% if (
  396. ((tender.ledger_status === audit.ledger.status.uncheck || tender.ledger_status === audit.ledger.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId) ||
  397. (lastStage && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck)) ||
  398. (!lastStage && revise && revise.valid && (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
  399. ) { %>
  400. <!--标段设置-小数位数-->
  401. <div class="modal fade" id="bd-set-2" data-backdrop="static">
  402. <div class="modal-dialog" role="document">
  403. <div class="modal-content">
  404. <div class="modal-header">
  405. <h5 class="modal-title">小数位数</h5>
  406. </div>
  407. <div class="modal-body">
  408. <div class="form-group">
  409. <label>全局设置</label>
  410. <div class="row">
  411. <div class="col-4">
  412. <div class="input-group input-group-sm">
  413. <div class="input-group-prepend">
  414. <span class="input-group-text">单价</span>
  415. </div>
  416. <input type="number" class="form-control" value="3" id="decimal-up"
  417. min="0" max="4" maxlength="1" oninput="limitDecimal(this)">
  418. </div>
  419. </div>
  420. <div class="col-4">
  421. <div class="input-group input-group-sm">
  422. <div class="input-group-prepend">
  423. <span class="input-group-text">金额</span>
  424. </div>
  425. <input type="number" class="form-control" value="2" id="decimal-tp"
  426. oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
  427. </div>
  428. </div>
  429. </div>
  430. </div>
  431. <div class="form-group">
  432. <label>单独设置</label>
  433. <div class="row">
  434. <div class="col-auto pr-0">
  435. <div class="form-group form-check pl-0">
  436. <div class="custom-control custom-switch">
  437. <input type="checkbox" class="custom-control-input" id="decimal-pay">
  438. <label class="custom-control-label" for="decimal-pay">合同支付</label>
  439. </div>
  440. </div>
  441. </div>
  442. <div class="col-4">
  443. <div class="input-group input-group-sm">
  444. <div class="input-group-prepend">
  445. <span class="input-group-text">金额</span>
  446. </div>
  447. <input type="number" class="form-control" value="2" id="decimal-pay-tp"
  448. oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
  449. </div>
  450. </div>
  451. </div>
  452. <div class="row mt-1">
  453. <div class="col-auto pr-0">
  454. <div class="form-group form-check pl-0">
  455. <div class="custom-control custom-switch">
  456. <input type="checkbox" class="custom-control-input" id="decimal-extra">
  457. <label class="custom-control-label" for="decimal-extra">其他台账</label>
  458. </div>
  459. </div>
  460. </div>
  461. <div class="col-4">
  462. <div class="input-group input-group-sm">
  463. <div class="input-group-prepend">
  464. <span class="input-group-text">金额</span>
  465. </div>
  466. <input type="number" class="form-control" value="2" id="decimal-extra-tp"
  467. oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
  468. </div>
  469. </div>
  470. </div>
  471. </div>
  472. </div>
  473. <div class="modal-footer">
  474. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  475. <button type="button" class="btn btn-sm btn-primary" onclick="post2();">确认修改</button>
  476. </div>
  477. </div>
  478. </div>
  479. </div>
  480. <!--标段设置-清单精度-->
  481. <div class="modal fade" id="bd-set-3" data-backdrop="static">
  482. <div class="modal-dialog" role="document">
  483. <div class="modal-content">
  484. <div class="modal-header">
  485. <h5 class="modal-title">数量精度</h5>
  486. </div>
  487. <div class="modal-body">
  488. <div class="form-group" id="precision-spread" style="height: 397px; width: 465px;">
  489. </div>
  490. </div>
  491. <div class="modal-footer">
  492. <div id="hint-3" class="text-danger fa fa-exclamation-circle" style="display: none;"></div>
  493. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  494. <button type="button" class="btn btn-sm btn-primary" onclick="post3();">确认修改</button>
  495. </div>
  496. </div>
  497. </div>
  498. </div>
  499. <% } else { %>
  500. <!--标段设置-小数位数-->
  501. <div class="modal fade" id="bd-set-2" data-backdrop="static">
  502. <div class="modal-dialog" role="document">
  503. <div class="modal-content">
  504. <div class="modal-header">
  505. <h5 class="modal-title">小数位数</h5>
  506. </div>
  507. <div class="modal-body">
  508. <div class="form-group">
  509. <label>全局设置</label>
  510. <div class="row">
  511. <div class="col-4">
  512. <div class="input-group input-group-sm">
  513. <div class="input-group-prepend">
  514. <span class="input-group-text">单价</span>
  515. </div>
  516. <input type="number" class="form-control" value="3" id="decimal-up" readonly="">
  517. </div>
  518. </div>
  519. <div class="col-4">
  520. <div class="input-group input-group-sm">
  521. <div class="input-group-prepend">
  522. <span class="input-group-text">金额</span>
  523. </div>
  524. <input type="number" class="form-control" value="2" id="decimal-tp" readonly="">
  525. </div>
  526. </div>
  527. </div>
  528. </div>
  529. <div class="form-group">
  530. <label>单独设置</label>
  531. <div class="row">
  532. <div class="col-auto pr-0">
  533. <div class="form-group form-check pl-0">
  534. <div class="custom-control custom-switch">
  535. <input type="checkbox" class="custom-control-input" id="decimal-pay" disabled>
  536. <label class="custom-control-label" for="decimal-pay">合同支付</label>
  537. </div>
  538. </div>
  539. </div>
  540. <div class="col-4">
  541. <div class="input-group input-group-sm">
  542. <div class="input-group-prepend">
  543. <span class="input-group-text">金额</span>
  544. </div>
  545. <input type="number" class="form-control" value="2" id="decimal-pay-tp" readonly="">
  546. </div>
  547. </div>
  548. </div>
  549. <div class="row mt-1">
  550. <div class="col-auto pr-0">
  551. <div class="form-group form-check pl-0">
  552. <div class="custom-control custom-switch">
  553. <input type="checkbox" class="custom-control-input" id="decimal-extra" disabled>
  554. <label class="custom-control-label" for="decimal-extra">其他台账</label>
  555. </div>
  556. </div>
  557. </div>
  558. <div class="col-4">
  559. <div class="input-group input-group-sm">
  560. <div class="input-group-prepend">
  561. <span class="input-group-text">金额</span>
  562. </div>
  563. <input type="number" class="form-control" value="2" id="decimal-extra-tp" readonly="">
  564. </div>
  565. </div>
  566. </div>
  567. </div>
  568. </div>
  569. <div class="modal-footer">
  570. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  571. </div>
  572. </div>
  573. </div>
  574. </div>
  575. <!--标段设置-清单精度-->
  576. <div class="modal fade" id="bd-set-3" data-backdrop="static">
  577. <div class="modal-dialog" role="document">
  578. <div class="modal-content">
  579. <div class="modal-header">
  580. <h5 class="modal-title">数量精度</h5>
  581. </div>
  582. <div class="modal-body">
  583. <div class="sjs-option-height" id="precision-spread" style="height: 397px; width: 465px;">
  584. </div>
  585. </div>
  586. <div class="modal-footer">
  587. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  588. </div>
  589. </div>
  590. </div>
  591. </div>
  592. <% } %>
  593. <% if (!lastStage || (lastStage.order === 1 && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck))) { %>
  594. <!--标段设置-合同参数-->
  595. <div class="modal fade" id="bd-set-4" data-backdrop="static">
  596. <div class="modal-dialog" role="document">
  597. <div class="modal-content">
  598. <div class="modal-header">
  599. <h5 class="modal-title">合同参数</h5>
  600. </div>
  601. <div class="modal-body">
  602. <ul class="nav nav-tabs nav-justified mb-2">
  603. <li class="nav-item">
  604. <a class="nav-link active" data-toggle="tab" href="#htcs" role="tab" aria-selected="true">合同参数</a>
  605. </li>
  606. <li class="nav-item">
  607. <a class="nav-link" data-toggle="tab" href="#bzqd" role="tab" aria-selected="false">100章清单</a>
  608. </li>
  609. </ul>
  610. <div class="tab-content">
  611. <div class="tab-pane active" id="htcs">
  612. <div class="modal-height-300" style="overflow-y: auto">
  613. <div class="form-group">
  614. <!--默认显示-->
  615. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  616. </div>
  617. </div>
  618. </div>
  619. </div>
  620. <div class="tab-pane" id="bzqd">
  621. <div class="modal-height-300" style="overflow-y: auto">
  622. <div class="form-group">
  623. <div class="form-group" id="cap100-spread" style="height: 230px; width: 465px;">
  624. </div>
  625. </div>
  626. </div>
  627. </div>
  628. </div>
  629. </div>
  630. <div class="modal-footer">
  631. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  632. <button type="button" class="btn btn-sm btn-primary" onclick="post4()">确认修改</button>
  633. </div>
  634. </div>
  635. </div>
  636. </div>
  637. <% } else { %>
  638. <!--标段设置-合同参数-->
  639. <div class="modal fade" id="bd-set-4" data-backdrop="static">
  640. <div class="modal-dialog" role="document">
  641. <div class="modal-content">
  642. <div class="modal-header">
  643. <h5 class="modal-title">合同参数</h5>
  644. </div>
  645. <div class="modal-body">
  646. <ul class="nav nav-tabs nav-justified mb-2">
  647. <li class="nav-item">
  648. <a class="nav-link active" data-toggle="tab" href="#htcs" role="tab" aria-selected="true">合同参数</a>
  649. </li>
  650. <li class="nav-item">
  651. <a class="nav-link" data-toggle="tab" href="#bzqd" role="tab" aria-selected="false">100章清单</a>
  652. </li>
  653. </ul>
  654. <div class="tab-content">
  655. <div class="tab-pane active" id="htcs">
  656. <div class="modal-height-300" style="overflow-y: auto">
  657. <div class="form-group">
  658. <!--默认显示-->
  659. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  660. </div>
  661. </div>
  662. </div>
  663. </div>
  664. <div class="tab-pane" id="bzqd">
  665. <div class="modal-height-300" style="overflow-y: auto">
  666. <div class="form-group">
  667. <div class="form-group" id="cap100-spread" style="height: 230px; width: 465px;">
  668. </div>
  669. </div>
  670. </div>
  671. </div>
  672. </div>
  673. </div>
  674. <div class="modal-footer">
  675. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  676. </div>
  677. </div>
  678. </div>
  679. </div>
  680. <% } %>
  681. <!--标段设置-显示设置-->
  682. <div class="modal fade" id="bd-set-5" data-backdrop="static">
  683. <div class="modal-dialog" role="document">
  684. <div class="modal-content">
  685. <div class="modal-header">
  686. <h5 class="modal-title">显示设置</h5>
  687. </div>
  688. <div class="modal-body">
  689. <div class="form-group">
  690. <div class="custom-control custom-checkbox mb-2">
  691. <input type="checkbox" class="custom-control-input" id="ledger-dgn-qty" checked="">
  692. <label class="custom-control-label" for="ledger-dgn-qty">项目节数量</label>
  693. </div>
  694. <div class="custom-control custom-checkbox mb-2">
  695. <input type="checkbox" class="custom-control-input" id="ledger-cl-qty" checked="">
  696. <label class="custom-control-label" for="ledger-cl-qty">错漏增减</label>
  697. </div>
  698. <div class="custom-control custom-checkbox mb-2">
  699. <input type="checkbox" class="custom-control-input" id="thousandth" checked="">
  700. <label class="custom-control-label" for="thousandth">千分位</label>
  701. </div>
  702. <div class="custom-control custom-checkbox mb-2">
  703. <input type="checkbox" class="custom-control-input" id="stage-rc" checked="">
  704. <label class="custom-control-label" for="stage-rc">实际完成量</label>
  705. </div>
  706. <div class="custom-control custom-checkbox mb-2">
  707. <input type="checkbox" class="custom-control-input" checked="" id="stage-correct">
  708. <label class="custom-control-label" for="stage-correct">使用数量纠正完成率</label>
  709. </div>
  710. </div>
  711. </div>
  712. <div class="modal-footer">
  713. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  714. <button type="button" class="btn btn-sm btn-primary" onclick="post5()">确认修改</button>
  715. </div>
  716. </div>
  717. </div>
  718. </div>
  719. <!--标段设置-章节设置-->
  720. <div class="modal fade" id="bd-set-6" data-backdrop="static">
  721. <div class="modal-dialog" role="document">
  722. <div class="modal-content">
  723. <div class="modal-header">
  724. <h5 class="modal-title">章节设置</h5>
  725. </div>
  726. <div class="modal-body">
  727. <div class="form-group" id="chapter-spread" style="height: 330px; width: 465px;">
  728. </div>
  729. </div>
  730. <div class="modal-footer">
  731. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  732. <button type="button" class="btn btn-sm btn-primary" onclick="post6()">确认修改</button>
  733. </div>
  734. </div>
  735. </div>
  736. </div>
  737. <!--标段设置-付款账号-->
  738. <div class="modal fade" id="bd-set-7" data-backdrop="static">
  739. <div class="modal-dialog" role="document">
  740. <div class="modal-content">
  741. <div class="modal-header">
  742. <h5 class="modal-title">付款账号</h5>
  743. </div>
  744. <div class="modal-body">
  745. <div class="sjs-option-height">
  746. <table class="table table-bordered">
  747. <tr><th colspan="2" class="text-center">工程款账户</th></tr>
  748. <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  749. <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  750. <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  751. <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  752. <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  753. <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  754. <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
  755. <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  756. <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  757. <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  758. <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  759. <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  760. <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  761. </table>
  762. </div>
  763. </div>
  764. <div class="modal-footer">
  765. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  766. <button type="button" class="btn btn-sm btn-primary" onclick="post7()" >确认修改</button>
  767. </div>
  768. </div>
  769. </div>
  770. </div>
  771. <!--批量设置-->
  772. <div class="modal fade" id="bd-set-8" data-backdrop="static">
  773. <div class="modal-dialog" role="document">
  774. <div class="modal-content">
  775. <div class="modal-header">
  776. <h5 class="modal-title">从其他标段拷贝设置</h5>
  777. </div>
  778. <div class="modal-body">
  779. <div class="alert alert-warning mb-1">从以下标段拷贝设置</div>
  780. <div class="mb-1" id="setting-custom">
  781. <a class="btn btn-sm btn-light">
  782. <div class="custom-control custom-checkbox">
  783. <input type="checkbox" class="custom-control-input" checked data-type="tender">
  784. <label class="custom-control-label text-primary" for="customCheckDisabld">标段属性</label>
  785. </div>
  786. </a>
  787. <a class="btn btn-sm btn-light">
  788. <div class="custom-control custom-checkbox">
  789. <input type="checkbox" class="custom-control-input" checked data-type="chapter">
  790. <label class="custom-control-label text-primary" for="customCheckDisabld2">章节设置</label>
  791. </div>
  792. </a>
  793. <a class="btn btn-sm btn-light">
  794. <div class="custom-control custom-checkbox">
  795. <input type="checkbox" class="custom-control-input" checked data-type="pay_account">
  796. <label class="custom-control-label text-primary" for="customCheckDisabld3">付款账号</label>
  797. </div>
  798. </a>
  799. </div>
  800. <div class="modal-height-300" id="copyModalContent">
  801. </div>
  802. </div>
  803. <div class="modal-footer">
  804. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  805. <button type="button" class="btn btn-sm btn-primary" id="copy_comfirm_btn">确认</button>
  806. </div>
  807. </div>
  808. </div>
  809. </div>
  810. <div class="modal fade" id="sp-list" data-backdrop="static">
  811. <div class="modal-dialog" role="document">
  812. <div class="modal-content">
  813. <div class="modal-header bg-dark text-white border-secondary">
  814. <h5 class="modal-title">审批进度详情</h5>
  815. </div>
  816. <div class="modal-body bg-dark text-white">
  817. <div class="modal-height-500" style="overflow: auto" id="audit-list">
  818. </div>
  819. </div>
  820. <div class="modal-footer bg-dark text-white border-secondary">
  821. <button type="button" class="btn btn-secondary btn-sm" data-dismiss="modal">关闭</button>
  822. </div>
  823. </div>
  824. </div>
  825. </div>
  826. <script>
  827. let property = JSON.parse(unescape('<%- escape(JSON.stringify(tenderInfo)) %>'));
  828. let ledgerChecked = <%- (tender.ledger_status === audit.ledger.status.checked) && ((lastStage !== undefined && lastStage !== null) || !revise || !revise.valid || revise.status === audit.revise.status.checked) %>;
  829. let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
  830. // 根据Min Max限制Input输入
  831. function limitInputMinMax (obj) {
  832. if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
  833. obj.value = obj.max;
  834. }
  835. if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
  836. obj.value = obj.min;
  837. }
  838. }
  839. // 根据Maxlength限制input输入
  840. function limitMaxLength (obj) {
  841. if (obj.value.length > obj.maxLength) {
  842. obj.value = obj.value.substr(0, obj.maxLength);
  843. }
  844. }
  845. // 根据正则限制输入
  846. function limitReg(obj, reg) {
  847. obj.value = obj.value.replace(reg, '');
  848. }
  849. // 小数位数 input 输入限制
  850. function limitDecimal(obj) {
  851. limitReg(obj, /[^\d]/g);
  852. limitMaxLength(obj);
  853. limitInputMinMax(obj);
  854. }
  855. function limitDealParamLength(obj) {
  856. limitReg(obj, /[^\d\.]/g); // 过滤数字和.
  857. limitReg(obj, /\.{2,}/g); // 过滤第二个.
  858. limitInputMinMax(obj);
  859. }
  860. function limitReturn(obj) {
  861. limitReg(obj, /\s/g);
  862. }
  863. function checkNumberValid(obj) {
  864. const value = _.toNumber(obj.value);
  865. obj.value = value ? value : '';
  866. }
  867. // 属性
  868. function loadCommonProperty () {
  869. // 合同信息
  870. $('#build-name').val(property.deal_info.buildName);
  871. $('#deal-code').val(property.deal_info.dealCode);
  872. $('#deal-name').val(property.deal_info.dealName);
  873. $('#project-type').val(property.deal_info.projectType);
  874. $('#deal-type').val(property.deal_info.dealType);
  875. $('#final-code').val(property.deal_info.finalCode);
  876. // 参建单位
  877. // 建设单位
  878. $('#build-company').val(property.construction_unit.build.company);
  879. $('#build-corporation').val(property.construction_unit.build.corporation);
  880. $('#build-date').val(property.construction_unit.build.date);
  881. // 承包单位1
  882. $('#contract1-company').val(property.construction_unit.contract1.company);
  883. $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
  884. $('#contract1-date').val(property.construction_unit.contract1.date);
  885. // 承包单位2
  886. $('#contract2-company').val(property.construction_unit.contract2.company);
  887. $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
  888. $('#contract2-date').val(property.construction_unit.contract2.date);
  889. // 监理单位1
  890. $('#supervision1-company').val(property.construction_unit.supervision1.company);
  891. $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
  892. $('#supervision1-date').val(property.construction_unit.supervision1.date);
  893. // 监理单位2
  894. $('#supervision2-company').val(property.construction_unit.supervision2.company);
  895. $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
  896. $('#supervision2-date').val(property.construction_unit.supervision2.date);
  897. // 技术参数
  898. $('#load-level').find("option:contains('" + property.tech_param.loadLevel + "')").attr("selected",true);
  899. $('#length').val(property.tech_param.loadLength);
  900. $('#start-peg').val(property.tech_param.startPeg);
  901. $('#end-peg').val(property.tech_param.endPeg);
  902. $('#lane-count').val(property.tech_param.laneCount);
  903. $('#deal-period').val(property.tech_param.dealPeriod);
  904. $('#start-date').val(property.tech_param.startDate);
  905. $('#plan-end-date').val(property.tech_param.planEndDate);
  906. $('#real-start-date').val(property.tech_param.realStartDate);
  907. $('#real-end-date').val(property.tech_param.realEndDate);
  908. $('#structure-scale').val(property.tech_param.structureScale);
  909. // 中标信息
  910. $('#control-price').val(property.bid_info.controlPrice);
  911. $('#bid-price').val(property.bid_info.bidPrice);
  912. $('#bid-start-date').val(property.bid_info.bidStartDate);
  913. $('#bid-type').find("option:contains('" + property.bid_info.bidType + "')").attr("selected",true);
  914. $('#deal-calc-type').find("option:contains('" + property.bid_info.dealCalcType + "')").attr("selected",true);
  915. }
  916. $('#bd-set-1').on('show.bs.modal', function () {
  917. loadCommonProperty();
  918. })
  919. function post1 () {
  920. const prop = {
  921. deal_info: {
  922. buildName: $('#build-name').val(),
  923. dealCode: $('#deal-code').val(),
  924. dealName: $('#deal-name').val(),
  925. projectType: $('#project-type').val(),
  926. dealType: $('#deal-type').val(),
  927. finalCode: $('#final-code').val(),
  928. },
  929. construction_unit: {
  930. build: {
  931. company: $('#build-company').val(),
  932. corporation: $('#build-corporation').val(),
  933. date: $('#build-date').val(),
  934. },
  935. contract1: {
  936. company: $('#contract1-company').val(),
  937. corporation: $('#contract1-corporation').val(),
  938. date: $('#contract1-date').val(),
  939. },
  940. contract2: {
  941. company: $('#contract2-company').val(),
  942. corporation: $('#contract2-corporation').val(),
  943. date: $('#contract2-date').val(),
  944. },
  945. supervision1: {
  946. company: $('#supervision1-company').val(),
  947. corporation: $('#supervision1-corporation').val(),
  948. date: $('#supervision1-date').val(),
  949. },
  950. supervision2: {
  951. company: $('#supervision2-company').val(),
  952. corporation: $('#supervision2-corporation').val(),
  953. date: $('#supervision2-date').val(),
  954. },
  955. },
  956. tech_param: {
  957. loadLevel: $('#load-level').find("option:selected").text(),
  958. loadLength: _.toNumber($('#length').val()),
  959. startPeg: $('#start-peg').val(),
  960. endPeg: $('#end-peg').val(),
  961. laneCount: _.toNumber($('#lane-count').val()),
  962. dealPeriod: $('#deal-period').val(),
  963. startDate: $('#start-date').val(),
  964. planEndDate: $('#plan-end-date').val(),
  965. realStartDate: $('#real-start-date').val(),
  966. realEndDate: $('#real-end-date').val(),
  967. structureScale: $('#structure-scale').val(),
  968. },
  969. bid_info: {
  970. controlPrice: _.toNumber($('#control-price').val()),
  971. bidPrice: _.toNumber($('#bid-price').val()),
  972. bidStartDate: $('#bid-start-date').val(),
  973. bidType: $('#bid-type').find("option:selected").text(),
  974. dealCalcType: $('#deal-calc-type').find("option:selected").text(),
  975. }
  976. };
  977. const tenderId = window.location.pathname.split('/')[2];
  978. postData('/tender/' + tenderId + '/save', prop, function (data) {
  979. property.deal_info = data.deal_info;
  980. property.construction_unit = data.construction_unit;
  981. property.tech_param = data.tech_param;
  982. property.bid_info = data.bid_info;
  983. $('#bd-set-1').modal('hide');
  984. });
  985. }
  986. // 小数位数
  987. function loadCalculateProperty () {
  988. $('#decimal-up').val(property.decimal.up);
  989. $('#decimal-tp').val(property.decimal.tp);
  990. $('#decimal-pay')[0].checked = property.decimal.pay;
  991. $('#decimal-pay-tp').val(property.decimal.payTp);
  992. $('#decimal-pay-tp')[0].disabled = !property.decimal.pay;
  993. $('#decimal-extra')[0].checked = property.decimal.extra;
  994. $('#decimal-extra-tp').val(property.decimal.extraTp);
  995. $('#decimal-extra-tp')[0].disabled = !property.decimal.extra;
  996. }
  997. $('#decimal-pay').change(() => {
  998. $('#decimal-pay-tp')[0].disabled = !$('#decimal-pay')[0].checked;
  999. });
  1000. $('#decimal-extra').change(() => {
  1001. $('#decimal-extra-tp')[0].disabled = !$('#decimal-extra')[0].checked;
  1002. });
  1003. $('#bd-set-2').on('show.bs.modal', function () {
  1004. loadCalculateProperty();
  1005. });
  1006. function post2() {
  1007. const prop = {
  1008. decimal: {
  1009. up: _.toNumber($('#decimal-up').val()),
  1010. tp: _.toNumber($('#decimal-tp').val()),
  1011. pay: $('#decimal-pay')[0].checked,
  1012. payTp: _.toNumber($('#decimal-pay-tp').val()),
  1013. extra: $('#decimal-extra')[0].checked,
  1014. extraTp: _.toNumber($('#decimal-extra-tp').val()),
  1015. }
  1016. };
  1017. if (ledgerChecked) {
  1018. if (prop.decimal.up < property.decimal.up) {
  1019. toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
  1020. return;
  1021. }
  1022. if (prop.decimal.tp < property.decimal.tp) {
  1023. toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
  1024. return;
  1025. }
  1026. }
  1027. if (firstStageChecked) {
  1028. if (property.decimal.pay) {
  1029. if (!prop.decimal.pay) {
  1030. toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
  1031. return;
  1032. }
  1033. if (prop.decimal.payTp < property.decimal.payTp) {
  1034. toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
  1035. return;
  1036. }
  1037. } else {
  1038. if (prop.decimal.pay) {
  1039. toastr.warning('第一期已审批完成,合同支付不可单独设置');
  1040. return;
  1041. }
  1042. }
  1043. if (property.decimal.extra) {
  1044. if (!prop.decimal.extra) {
  1045. toastr.warning('第一期已审批完成,不可取消其他台账单独设置');
  1046. return;
  1047. }
  1048. if (prop.decimal.extraTp < property.decimal.extraTp) {
  1049. toastr.warning('第一期已审批完成,单独设置的其他台账小数位数,不可小于' + property.decimal.extraTp);
  1050. return;
  1051. }
  1052. } else {
  1053. if (prop.decimal.extra) {
  1054. toastr.warning('第一期已审批完成,其他台账不可单独设置');
  1055. return;
  1056. }
  1057. }
  1058. }
  1059. const tenderId = window.location.pathname.split('/')[2];
  1060. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1061. property.decimal = data.decimal;
  1062. $('#bd-set-2').modal('hide');
  1063. }, null, true);
  1064. }
  1065. // 清单精度
  1066. const precisionObj = (function () {
  1067. const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
  1068. spread.options.showVerticalScrollbar = false;
  1069. spread.options.showHorizontalScrollbar = false;
  1070. const sheet = spread.getActiveSheet();
  1071. SpreadJsObj.protectedSheet(sheet);
  1072. sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
  1073. sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
  1074. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  1075. const vStyle = new spreadNS.Style();
  1076. vStyle.font = '12px 微软雅黑';
  1077. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  1078. const xStyle = new spreadNS.Style();
  1079. xStyle.font = '12px 微软雅黑';
  1080. xStyle.vAlign = 1;
  1081. xStyle.hAlign = 1;
  1082. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  1083. const yStyle = new spreadNS.Style();
  1084. yStyle.font = '12px 微软雅黑';
  1085. yStyle.vAlign = 1;
  1086. yStyle.hAlign = 1;
  1087. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  1088. SpreadJsObj.massOperationSheet(sheet, function () {
  1089. sheet.defaults.rowHeight = 21;
  1090. sheet.setColumnCount(2);
  1091. sheet.setRowCount(13);
  1092. sheet.setColumnWidth(0, 100);
  1093. sheet.setColumnWidth(1, 60);
  1094. sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  1095. sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2).locked(false);
  1096. sheet.setText(0, 0, 't');
  1097. sheet.setText(1, 0, 'km');
  1098. sheet.setText(2, 0, 'm');
  1099. sheet.setText(3, 0, 'm2');
  1100. sheet.setText(4, 0, 'm3');
  1101. sheet.setText(5, 0, 'kg');
  1102. sheet.setText(6, 0, '个');
  1103. sheet.setText(7, 0, '台');
  1104. sheet.setText(8, 0, '套');
  1105. sheet.setText(9, 0, '棵');
  1106. sheet.setText(10, 0, '组');
  1107. sheet.setText(11, 0, '系统');
  1108. sheet.setText(12, 0, '其他未列单位');
  1109. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  1110. sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
  1111. sheet.getRange(0, 0, 13, 2).formatter('@');
  1112. sheet.setSelection(0, 1, 1, 1);
  1113. });
  1114. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1115. const value = _.toNumber(info.editingText);
  1116. if (!_.isInteger(value)) {
  1117. toastr.warning('请输入0-6的整数');
  1118. sheet.setText(info.row, info.col, '0');
  1119. } else if (value > 6) {
  1120. toastr.warning('请输入0-6的整数');
  1121. sheet.setText(info.row, info.col, '6');
  1122. } else if (value < 0) {
  1123. toastr.warning('请输入0-6的整数');
  1124. sheet.setText(info.row, info.col, '0');
  1125. }
  1126. });
  1127. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  1128. const sel = sheet.getSelections()[0];
  1129. if (sel) {
  1130. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  1131. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  1132. if (iCol !== 1) continue;
  1133. sheet.setText(iRow, iCol, '0');
  1134. }
  1135. }
  1136. }
  1137. });
  1138. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1139. let bHint = false;
  1140. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  1141. const curRow = info.cellRange.row + iRow;
  1142. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1143. const curCol = info.cellRange.col + iCol;
  1144. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1145. if (_.isNaN(value) || !_.isInteger(value)) {
  1146. bHint = true;
  1147. info.sheet.setText(curRow, curCol, '0');
  1148. } else if (value > 6) {
  1149. bHint = true;
  1150. info.sheet.setText(curRow, curCol, '6');
  1151. } else if (value < 0) {
  1152. bHint = true;
  1153. info.sheet.setText(curRow, curCol, '0');
  1154. }
  1155. }
  1156. }
  1157. if (bHint) {
  1158. toastr.warning('请输入0-6的整数');
  1159. }
  1160. });
  1161. function loadPrecisonProperty() {
  1162. $('#hint-3').hide();
  1163. sheet.setValue(0, 1, property.precision.t.value);
  1164. sheet.setValue(1, 1, property.precision.km.value);
  1165. sheet.setValue(2, 1, property.precision.m.value);
  1166. sheet.setValue(3, 1, property.precision.m2.value);
  1167. sheet.setValue(4, 1, property.precision.m3.value);
  1168. sheet.setValue(5, 1, property.precision.kg.value);
  1169. sheet.setValue(6, 1, property.precision.ge.value);
  1170. sheet.setValue(7, 1, property.precision.tai.value);
  1171. sheet.setValue(8, 1, property.precision.tao.value);
  1172. sheet.setValue(9, 1, property.precision.ke.value);
  1173. sheet.setValue(10, 1, property.precision.zu.value);
  1174. sheet.setValue(11, 1, property.precision.xitong.value);
  1175. sheet.setValue(12, 1, property.precision.other.value);
  1176. }
  1177. function setReadOnly(readOnly) {
  1178. sheet.getRange(0, 1, 13, 1).locked(readOnly);
  1179. }
  1180. function getNewPrecisionData() {
  1181. const precision = JSON.parse(JSON.stringify(property.precision));
  1182. precision.t.value = _.toNumber(sheet.getText(0, 1));
  1183. precision.km.value = _.toNumber(sheet.getText(1, 1));
  1184. precision.m.value = _.toNumber(sheet.getText(2, 1));
  1185. precision.m2.value = _.toNumber(sheet.getText(3, 1));
  1186. precision.m3.value = _.toNumber(sheet.getText(4, 1));
  1187. precision.kg.value = _.toNumber(sheet.getText(5, 1));
  1188. precision.ge.value = _.toNumber(sheet.getText(6, 1));
  1189. precision.tai.value = _.toNumber(sheet.getText(7, 1));
  1190. precision.tao.value = _.toNumber(sheet.getText(8, 1));
  1191. precision.ke.value = _.toNumber(sheet.getText(9, 1));
  1192. precision.zu.value = _.toNumber(sheet.getText(10, 1));
  1193. precision.xitong.value = _.toNumber(sheet.getText(11, 1));
  1194. precision.other.value = _.toNumber(sheet.getText(12, 1));
  1195. return precision;
  1196. }
  1197. function checkPrecisionMinLimit(precision, limit) {
  1198. for (const unit in precision) {
  1199. if (precision[unit].value < limit[unit].value) {
  1200. if (precision[unit].unit) {
  1201. toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
  1202. } else {
  1203. toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
  1204. }
  1205. return false;
  1206. }
  1207. }
  1208. return true;
  1209. };
  1210. return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
  1211. })();
  1212. $('#bd-set-3').on('show.bs.modal', function () {
  1213. <% if (!(
  1214. ((tender.ledger_status === audit.ledger.status.uncheck || tender.ledger_status === audit.ledger.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId) ||
  1215. (lastStage && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck)) ||
  1216. (!lastStage && revise && revise.valid && (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
  1217. )) { %>
  1218. precisionObj.setReadOnly(true);
  1219. <% } %>
  1220. precisionObj.loadPrecisonProperty();
  1221. });
  1222. function post3 () {
  1223. const prop = { precision: precisionObj.getNewPrecisionData() };
  1224. if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
  1225. const tenderId = window.location.pathname.split('/')[2];
  1226. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1227. property.precision = data.precision;
  1228. $('#bd-set-3').modal('hide');
  1229. }, null, true);
  1230. }
  1231. // 合同参数
  1232. const dealObj = (function () {
  1233. const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
  1234. spread.options.showVerticalScrollbar = false;
  1235. spread.options.showHorizontalScrollbar = false;
  1236. const sheet = spread.getActiveSheet();
  1237. SpreadJsObj.protectedSheet(sheet);
  1238. sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
  1239. sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
  1240. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  1241. const vStyle = new spreadNS.Style();
  1242. vStyle.font = '12px 微软雅黑';
  1243. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  1244. const xStyle = new spreadNS.Style();
  1245. xStyle.font = '12px 微软雅黑';
  1246. xStyle.vAlign = 1;
  1247. xStyle.hAlign = 1;
  1248. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  1249. const yStyle = new spreadNS.Style();
  1250. yStyle.font = '12px 微软雅黑';
  1251. yStyle.vAlign = 1;
  1252. yStyle.hAlign = 1;
  1253. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  1254. SpreadJsObj.massOperationSheet(sheet, function () {
  1255. sheet.defaults.rowHeight = 21;
  1256. sheet.setColumnCount(2);
  1257. sheet.setRowCount(5);
  1258. sheet.setColumnWidth(0, 200);
  1259. sheet.setColumnWidth(1, 200);
  1260. sheet.getRange(0, 0, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  1261. sheet.getRange(0, 1, 5, 1).vAlign(1).hAlign(2).locked(false);
  1262. sheet.setText(0, 0, '签约合同价');
  1263. sheet.setText(1, 0, '暂列金额');
  1264. sheet.setText(2, 0, '签约合同价(不含暂列金)');
  1265. sheet.setText(3, 0, '签约开工预付款');
  1266. sheet.setText(4, 0, '签约材料预付款');
  1267. sheet.setText(5, 0, '安全生产费');
  1268. sheet.getCell(2, 1).locked(true);
  1269. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  1270. sheet.getRange(0, 0, 5, 2).setBorder(lineBorder, {all: true});
  1271. sheet.getRange(0, 0, 5, 2).formatter('@');
  1272. sheet.setSelection(0, 1, 1, 1);
  1273. });
  1274. const cap100spread = SpreadJsObj.createNewSpread($('#cap100-spread')[0]);
  1275. cap100spread.options.showVerticalScrollbar = false;
  1276. cap100spread.options.showHorizontalScrollbar = false;
  1277. const cap100sheet = cap100spread.getActiveSheet();
  1278. SpreadJsObj.protectedSheet(cap100sheet);
  1279. cap100sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
  1280. cap100sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
  1281. cap100sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  1282. cap100sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  1283. cap100sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  1284. cap100sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  1285. SpreadJsObj.massOperationSheet(cap100sheet, function () {
  1286. cap100sheet.defaults.rowHeight = 21;
  1287. cap100sheet.setColumnCount(2);
  1288. cap100sheet.setRowCount(2);
  1289. cap100sheet.setColumnWidth(0, 200);
  1290. cap100sheet.setColumnWidth(1, 200);
  1291. cap100sheet.getRange(0, 0, 2, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  1292. cap100sheet.getRange(0, 1, 2, 1).vAlign(1).hAlign(2).locked(false);
  1293. cap100sheet.setText(0, 0, '安全生产费');
  1294. cap100sheet.setText(1, 0, '扬尘污染费');
  1295. const cap100lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  1296. cap100sheet.getRange(0, 0, 2, 2).setBorder(cap100lineBorder, {all: true});
  1297. cap100sheet.getRange(0, 0, 2, 2).formatter('@');
  1298. cap100sheet.setSelection(0, 1, 1, 1);
  1299. });
  1300. function calcHtjMinusZlj() {
  1301. const htj = _.toNumber(sheet.getText(0, 1));
  1302. const zlj = _.toNumber(sheet.getText(1, 1));
  1303. sheet.setValue(2, 1, ZhCalc.sub(htj, zlj));
  1304. }
  1305. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1306. const value = _.toNumber(info.editingText);
  1307. if (_.isNaN(value)) {
  1308. toastr.warning('请输入不超过万亿的数字');
  1309. info.sheet.setText(info.row, info.col, '0');
  1310. } else if (value > Math.pow(10, 13)) {
  1311. toastr.warning('请输入不超过万亿的数字');
  1312. info.sheet.setText(info.row, info.col, '0');
  1313. }
  1314. if (info.row === 0 || info.row === 1) {
  1315. calcHtjMinusZlj();
  1316. }
  1317. });
  1318. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  1319. const sel = sheet.getSelections()[0];
  1320. let calc = false;
  1321. if (sel) {
  1322. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  1323. if (iRow === 2) continue;
  1324. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  1325. if (iCol !== 1) continue;
  1326. sheet.setText(iRow, iCol, '0');
  1327. if (iRow === 0 || iRow === 1) calc = true;
  1328. }
  1329. }
  1330. }
  1331. if (calc) calcHtjMinusZlj();
  1332. });
  1333. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1334. let bHint = false;
  1335. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  1336. const curRow = info.cellRange.row + iRow;
  1337. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1338. const curCol = info.cellRange.col + iCol;
  1339. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1340. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  1341. bHint = true;
  1342. info.sheet.setText(curRow, curCol, '0');
  1343. }
  1344. }
  1345. }
  1346. if (bHint) {
  1347. toastr.warning('请输入不超过万亿的数字');
  1348. }
  1349. calcHtjMinusZlj();
  1350. });
  1351. cap100spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1352. const value = _.toNumber(info.editingText);
  1353. if (_.isNaN(value)) {
  1354. toastr.warning('请输入不超过万亿的数字');
  1355. info.sheet.setText(info.row, info.col, '0');
  1356. } else if (value > Math.pow(10, 13)) {
  1357. toastr.warning('请输入不超过万亿的数字');
  1358. info.sheet.setText(info.row, info.col, '0');
  1359. }
  1360. // if (info.row === 0 || info.row === 1) {
  1361. // calcHtjMinusZlj();
  1362. // }
  1363. });
  1364. SpreadJsObj.addDeleteBind(cap100spread, function (sheet) {
  1365. const sel = sheet.getSelections()[0];
  1366. // let calc = false;
  1367. if (sel) {
  1368. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  1369. if (iRow === 2) continue;
  1370. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  1371. if (iCol !== 1) continue;
  1372. sheet.setText(iRow, iCol, '0');
  1373. // if (iRow === 0 || iRow === 1) calc = true;
  1374. }
  1375. }
  1376. }
  1377. // if (calc) calcHtjMinusZlj();
  1378. });
  1379. cap100spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1380. let bHint = false;
  1381. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  1382. const curRow = info.cellRange.row + iRow;
  1383. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1384. const curCol = info.cellRange.col + iCol;
  1385. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1386. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  1387. bHint = true;
  1388. info.sheet.setText(curRow, curCol, '0');
  1389. }
  1390. }
  1391. }
  1392. if (bHint) {
  1393. toastr.warning('请输入不超过万亿的数字');
  1394. }
  1395. });
  1396. function loadDealProperty() {
  1397. sheet.setValue(0, 1, property.deal_param.contractPrice);
  1398. sheet.setValue(1, 1, property.deal_param.zanLiePrice);
  1399. sheet.setValue(2, 1, ZhCalc.sub(property.deal_param.contractPrice, property.deal_param.zanLiePrice));
  1400. sheet.setValue(3, 1, property.deal_param.startAdvance);
  1401. sheet.setValue(4, 1, property.deal_param.materialAdvance);
  1402. // sheet.setValue(5, 1, property.deal_param.safeAdvance);
  1403. cap100sheet.setValue(0, 1, property.deal_param.safeAdvance);
  1404. cap100sheet.setValue(1, 1, property.deal_param.dustAdvance);
  1405. }
  1406. function setReadOnly (readOnly) {
  1407. sheet.getCell(0, 1).locked(readOnly);
  1408. sheet.getCell(1, 1).locked(readOnly);
  1409. sheet.getCell(3, 1).locked(readOnly);
  1410. sheet.getCell(4, 1).locked(readOnly);
  1411. // sheet.getCell(5, 1).locked(readOnly);
  1412. cap100sheet.getCell(0, 1).locked(readOnly);
  1413. cap100sheet.getCell(1, 1).locked(readOnly);
  1414. }
  1415. function getNewDealData () {
  1416. const result = {};
  1417. result.contractPrice = _.toNumber(sheet.getText(0, 1));
  1418. result.zanLiePrice = _.toNumber(sheet.getText(1, 1));
  1419. result.startAdvance = _.toNumber(sheet.getText(3, 1));
  1420. result.materialAdvance = _.toNumber(sheet.getText(4, 1));
  1421. // result.safeAdvance = _.toNumber(sheet.getText(5, 1));
  1422. result.safeAdvance = _.toNumber(cap100sheet.getText(0, 1));
  1423. result.dustAdvance = _.toNumber(cap100sheet.getText(1, 1));
  1424. return result;
  1425. }
  1426. return { loadDealProperty, setReadOnly, getNewDealData, };
  1427. })();
  1428. $('#bd-set-4').on('show.bs.modal', function () {
  1429. dealObj.loadDealProperty();
  1430. <% 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)))) { %>
  1431. dealObj.setReadOnly(true);
  1432. <% } %>
  1433. });
  1434. function post4 () {
  1435. if (firstStageChecked) return;
  1436. const prop = { deal_param: dealObj.getNewDealData() };
  1437. const tenderId = window.location.pathname.split('/')[2];
  1438. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1439. property.deal_param = data.deal_param;
  1440. $('#bd-set-4').modal('hide');
  1441. window.location.reload();
  1442. });
  1443. }
  1444. // 显示设置
  1445. function loadDisplayProperty () {
  1446. $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
  1447. $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
  1448. $('#thousandth')[0].checked = property.display.thousandth;
  1449. $('#stage-rc')[0].checked = property.display.stage.realComplete;
  1450. $('#stage-correct')[0].checked = property.display.stage.correct;
  1451. }
  1452. $('#bd-set-5').on('show.bs.modal', function () {
  1453. loadDisplayProperty();
  1454. });
  1455. function post5 () {
  1456. const prop = {
  1457. display: {
  1458. ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
  1459. thousandth: $('#thousandth')[0].checked,
  1460. stage: { realComplete: $('#stage-rc')[0].checked, correct: $('#stage-correct')[0].checked },
  1461. },
  1462. };
  1463. const tenderId = window.location.pathname.split('/')[2];
  1464. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1465. property.display = data.display;
  1466. $('#bd-set-5').modal('hide');
  1467. });
  1468. }
  1469. // 章节设置
  1470. const chapterObj = (function () {
  1471. const spreadSetting = {
  1472. cols: [
  1473. {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
  1474. {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
  1475. ],
  1476. emptyRows: 0,
  1477. headRows: 1,
  1478. headRowHeight: [32],
  1479. defaultRowHeight: 21,
  1480. headerFont: '12px 微软雅黑',
  1481. font: '12px 微软雅黑',
  1482. };
  1483. const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
  1484. spread.options.showVerticalScrollbar = false;
  1485. spread.options.showHorizontalScrollbar = false;
  1486. SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
  1487. function checkSheetData(sheet) {
  1488. let hint = '';
  1489. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1490. const cell = sheet.getCell(iRow, 1);
  1491. const defaultStype = sheet.getDefaultStyle();
  1492. cell.text(cell.text().replace(/\s/g, ''))
  1493. if (cell.text().length > 50) {
  1494. cell.backColor('#f8d7da');
  1495. hint = '章节名称的长度超出范围,请重新输入';
  1496. } else {
  1497. cell.backColor(defaultStype.backColor);
  1498. }
  1499. }
  1500. if (hint === '') {
  1501. $('#hint-6').hide();
  1502. } else {
  1503. $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
  1504. }
  1505. }
  1506. spread.bind(spreadNS.Events.EditEnding, function (e, info) {
  1507. checkSheetData(info.sheet);
  1508. });
  1509. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1510. checkSheetData(info.sheet);
  1511. });
  1512. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1513. checkSheetData(info.sheet);
  1514. });
  1515. function loadChapterProperty() {
  1516. SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
  1517. $('#hint-6').hide();
  1518. const sheet = spread.getActiveSheet();
  1519. const defaultStype = sheet.getDefaultStyle();
  1520. sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
  1521. }
  1522. function setReadOnly(readOnly) {
  1523. SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
  1524. }
  1525. function getNewChapterData() {
  1526. const result = [];
  1527. const sheet = spread.getActiveSheet();
  1528. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1529. const data = {};
  1530. for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
  1531. const col = spreadSetting.cols[iCol];
  1532. data[col.field] = sheet.getText(iRow, iCol).replace(/\s/g, '');
  1533. if (col.field === 'name') {
  1534. if (data.name.length > 50) {
  1535. return null;
  1536. }
  1537. }
  1538. }
  1539. result.push(data);
  1540. }
  1541. return result;
  1542. }
  1543. return { loadChapterProperty, setReadOnly, getNewChapterData, }
  1544. })();
  1545. $('#bd-set-6').on('show.bs.modal', function () {
  1546. chapterObj.loadChapterProperty();
  1547. chapterObj.setReadOnly(false);
  1548. });
  1549. function post6 () {
  1550. const chapter = chapterObj.getNewChapterData();
  1551. if (!chapter) { return; }
  1552. const tenderId = window.location.pathname.split('/')[2];
  1553. postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
  1554. property.chapter = data.chapter;
  1555. $('#bd-set-6').modal('hide');
  1556. });
  1557. }
  1558. // 属性
  1559. function loadPayProperty () {
  1560. // 付款账号
  1561. $('#project-name').val(property.pay_account.project.name);
  1562. $('#project-bank').val(property.pay_account.project.bank);
  1563. $('#project-account').val(property.pay_account.project.account);
  1564. $('#project-rate').val(property.pay_account.project.rate);
  1565. $('#project-contact').val(property.pay_account.project.contact);
  1566. $('#project-phone').val(property.pay_account.project.phone);
  1567. $('#worker-name').val(property.pay_account.worker.name);
  1568. $('#worker-bank').val(property.pay_account.worker.bank);
  1569. $('#worker-account').val(property.pay_account.worker.account);
  1570. $('#worker-rate').val(property.pay_account.worker.rate);
  1571. $('#worker-contact').val(property.pay_account.worker.contact);
  1572. $('#worker-phone').val(property.pay_account.worker.phone);
  1573. }
  1574. $('#bd-set-7').on('show.bs.modal', function () {
  1575. loadPayProperty();
  1576. })
  1577. function post7 () {
  1578. let flag = false;
  1579. const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
  1580. const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
  1581. const project_rate = $('#project-rate').val();
  1582. if (!rate_reg.test(project_rate) && project_rate !== '') {
  1583. toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
  1584. flag = true;
  1585. }
  1586. const project_phone = $('#project-phone').val();
  1587. if (!phone_reg.test(project_phone) && project_phone !== '') {
  1588. toastr.error('工程款账户联系电话格式有误');
  1589. flag = true;
  1590. }
  1591. const worker_rate = $('#worker-rate').val();
  1592. if (!rate_reg.test(worker_rate) && worker_rate !== '') {
  1593. toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
  1594. flag = true;
  1595. }
  1596. const worker_phone = $('#worker-phone').val();
  1597. if (!phone_reg.test(worker_phone) && worker_phone !== '') {
  1598. toastr.error('农民工工资专用账户联系电话格式有误');
  1599. flag = true;
  1600. }
  1601. if (flag) {
  1602. return false;
  1603. }
  1604. const prop = {
  1605. pay_account: {
  1606. project: {
  1607. name: $('#project-name').val(),
  1608. bank: $('#project-bank').val(),
  1609. account: $('#project-account').val(),
  1610. rate: $('#project-rate').val(),
  1611. contact: $('#project-contact').val(),
  1612. phone: $('#project-phone').val(),
  1613. },
  1614. worker: {
  1615. name: $('#worker-name').val(),
  1616. bank: $('#worker-bank').val(),
  1617. account: $('#worker-account').val(),
  1618. rate: $('#worker-rate').val(),
  1619. contact: $('#worker-contact').val(),
  1620. phone: $('#worker-phone').val(),
  1621. },
  1622. },
  1623. };
  1624. const tenderId = window.location.pathname.split('/')[2];
  1625. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1626. property.pay_account = data.pay_account;
  1627. $('#bd-set-7').modal('hide');
  1628. });
  1629. }
  1630. </script>
  1631. <% if (ctx.session.sessionUser.is_admin) { %>
  1632. <!--游客账号-->
  1633. <div class="modal fade" id="bd-set-9" data-backdrop="static">
  1634. <div class="modal-dialog" role="document">
  1635. <div class="modal-content">
  1636. <div class="modal-header">
  1637. <h5 class="modal-title">游客账号</h5>
  1638. </div>
  1639. <div class="modal-body">
  1640. <div class="dropdown text-right">
  1641. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="tourist_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  1642. 添加游客
  1643. </button>
  1644. <div class="dropdown-menu dropdown-menu-right" id="tourist_dropdownMenu" aria-labelledby="tourist_dropdownMenuButton" style="width:220px">
  1645. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1646. placeholder="姓名/手机 检索" autocomplete="off"></div>
  1647. <dl class="list-unstyled book-list">
  1648. <% accountGroup.forEach((group, idx) => { %>
  1649. <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>
  1650. <div class="dd-content" data-toggleid="<%- idx %>">
  1651. <% group.groupList.forEach(item => { %>
  1652. <% if (item.id !== ctx.tender.data.user_id) { %>
  1653. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  1654. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1655. class="ml-auto"><%- item.mobile %></span></p>
  1656. <span class="text-muted"><%- item.role %></span>
  1657. </dd>
  1658. <% } %>
  1659. <% });%>
  1660. </div>
  1661. <% }) %>
  1662. </dl>
  1663. </div>
  1664. </div>
  1665. <div class="card mt-3">
  1666. <div class="card-header">
  1667. 游客列表
  1668. </div>
  1669. <div class="modal-height-300">
  1670. <ul class="list-group list-group-flush" id="tourist-users">
  1671. <% for (const t of tourists) { %>
  1672. <li class="list-group-item" data-id="<%- t.user_id %>">
  1673. <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>
  1674. <% } %>
  1675. </ul>
  1676. </div>
  1677. </div>
  1678. </div>
  1679. <div class="modal-footer">
  1680. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  1681. </div>
  1682. </div>
  1683. </div>
  1684. </div>
  1685. <!--上报控制-->
  1686. <div class="modal fade" id="bd-set-10" data-backdrop="static">
  1687. <div class="modal-dialog" role="document">
  1688. <div class="modal-content">
  1689. <div class="modal-header">
  1690. <h5 class="modal-title">上报控制</h5>
  1691. </div>
  1692. <div class="modal-body">
  1693. <div class="form-group">
  1694. <div class="custom-control custom-checkbox mb-2">
  1695. <input type="checkbox" class="custom-control-input" id="lc_same_code" checked="">
  1696. <label class="custom-control-label" for="lc_same_code">重复项目节</label>
  1697. </div>
  1698. <div class="custom-control custom-checkbox mb-2">
  1699. <input type="checkbox" class="custom-control-input" id="lc_sibling" checked="">
  1700. <label class="custom-control-label" for="lc_sibling">项目节清单同层次</label>
  1701. </div>
  1702. <div class="custom-control custom-checkbox mb-2">
  1703. <input type="checkbox" class="custom-control-input" id="lc_over" checked="">
  1704. <label class="custom-control-label" for="lc_over">超计判断</label>
  1705. </div>
  1706. </div>
  1707. </div>
  1708. <div class="modal-footer">
  1709. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  1710. <button type="button" class="btn btn-sm btn-primary" onclick="post10()">确认修改</button>
  1711. </div>
  1712. </div>
  1713. </div>
  1714. </div>
  1715. <script>
  1716. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  1717. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  1718. const cur_tender_uid = parseInt('<%- ctx.tender.data.user_id %>');
  1719. const cur_tenderid = parseInt('<%- ctx.tender.id %>');
  1720. const loadLedgerCheckProperty = function () {
  1721. $('#lc_same_code')[0].checked = property.ledger_check.same_code;
  1722. $('#lc_sibling')[0].checked = property.ledger_check.sibling;
  1723. $('#lc_over')[0].checked = property.ledger_check.over;
  1724. }
  1725. $('#bd-set-10').on('show.bs.modal', function () {
  1726. loadLedgerCheckProperty();
  1727. });
  1728. function post10 () {
  1729. const prop = {
  1730. ledger_check: {
  1731. same_code: $('#lc_same_code')[0].checked,
  1732. sibling: $('#lc_sibling')[0].checked,
  1733. over: $('#lc_over')[0].checked,
  1734. },
  1735. };
  1736. const tenderId = window.location.pathname.split('/')[2];
  1737. postData('/tender/' + tenderId + '/save2', prop, function (data) {
  1738. property.ledger_check = data.ledger_check;
  1739. $('#bd-set-10').modal('hide');
  1740. });
  1741. }
  1742. $(function () {
  1743. // 投资进度
  1744. let timer2 = null;
  1745. let oldSearchVal2 = null;
  1746. $('body').on('input propertychange', '#tourist_dropdownMenu .gr-search', function (e) {
  1747. oldSearchVal2 = e.target.value;
  1748. timer2 && clearTimeout(timer2);
  1749. timer2 = setTimeout(() => {
  1750. const newVal = $(this).val();
  1751. let html = '';
  1752. if (newVal && newVal === oldSearchVal2) {
  1753. accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1754. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1755. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1756. class="ml-auto">${item.mobile || ''}</span></p>
  1757. <span class="text-muted">${item.role || ''}</span>
  1758. </dd>`
  1759. });
  1760. $('#tourist_dropdownMenu .book-list').empty();
  1761. $('#tourist_dropdownMenu .book-list').append(html);
  1762. } else {
  1763. if (!$('#tourist_dropdownMenu .acc-btn').length) {
  1764. accountGroup.forEach((group, idx) => {
  1765. if (!group) return;
  1766. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1767. </a> ${group.groupName}</dt>
  1768. <div class="dd-content" data-toggleid="${idx}">`;
  1769. group.groupList.forEach(item => {
  1770. if (item.id !== cur_tender_uid) {
  1771. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1772. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1773. class="ml-auto">${item.mobile || ''}</span></p>
  1774. <span class="text-muted">${item.role || ''}</span>
  1775. </dd>`;
  1776. }
  1777. });
  1778. html += '</div>';
  1779. });
  1780. $('#tourist_dropdownMenu .book-list').empty();
  1781. $('#tourist_dropdownMenu .book-list').append(html);
  1782. }
  1783. }
  1784. }, 400);
  1785. });
  1786. // 添加审批流程按钮逻辑
  1787. $('body').on('click', '#tourist_dropdownMenu .book-list dt', function () {
  1788. const idx = $(this).find('.acc-btn').attr('data-groupid');
  1789. const type = $(this).find('.acc-btn').attr('data-type');
  1790. if (type === 'hide') {
  1791. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1792. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
  1793. $(this).find('.acc-btn').attr('data-type', 'show');
  1794. })
  1795. } else {
  1796. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1797. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
  1798. $(this).find('.acc-btn').attr('data-type', 'hide');
  1799. })
  1800. }
  1801. return false;
  1802. });
  1803. // 选中用户
  1804. $('body').on('click', '#tourist_dropdownMenu dl dd', function () {
  1805. const id = parseInt($(this).data('id'));
  1806. if (id) {
  1807. const user = _.find(accountList, function (item) {
  1808. return item.id === id;
  1809. });
  1810. const saIdList = [];
  1811. for (let i = 0; i < $('#tourist-users li').length; i++) {
  1812. saIdList.push(parseInt($('#tourist-users li').eq(i).data('id')));
  1813. }
  1814. if (_.includes(saIdList, id)) {
  1815. toastr.error('该用户已存在列表中,无需重复添加');
  1816. return;
  1817. }
  1818. const prop = {
  1819. user_id: id,
  1820. type: 'add',
  1821. };
  1822. postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
  1823. const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
  1824. '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
  1825. '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
  1826. $('#tourist-users').append(html);
  1827. // 外面显示游客数量
  1828. const num = $('#tourist-users li').length;
  1829. if (!$('#tourist-num').hasClass('badge')) {
  1830. $('#tourist-num').addClass('badge badge-secondary').text(num);
  1831. } else {
  1832. $('#tourist-num').text(num);
  1833. }
  1834. });
  1835. }
  1836. });
  1837. // 移除用户
  1838. $('body').on('click', '#tourist-users .remove-tourist-user', function () {
  1839. const id = parseInt($(this).data('id'));
  1840. if (id) {
  1841. const prop = {
  1842. id,
  1843. type: 'del',
  1844. };
  1845. const _self = $(this);
  1846. postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
  1847. _self.parents('li').remove();
  1848. // 外面显示游客数量
  1849. const num = $('#tourist-users li').length;
  1850. if (num == 0) {
  1851. $('#tourist-num').removeClass('badge badge-secondary').text('');
  1852. } else {
  1853. $('#tourist-num').text(num);
  1854. }
  1855. });
  1856. }
  1857. });
  1858. });
  1859. </script>
  1860. <% } %>
  1861. <% if (ctx.session.sessionProject.page_show.xxjd && ctx.session.sessionUser.is_admin) { %>
  1862. <!--标段设置-投资进度-->
  1863. <div class="modal fade" id="xxjd-set" data-backdrop="static">
  1864. <div class="modal-dialog" role="document">
  1865. <div class="modal-content">
  1866. <div class="modal-header">
  1867. <h5 class="modal-title">投资进度</h5>
  1868. </div>
  1869. <div class="modal-body">
  1870. <div class="alert alert-warning">设置可使用「投资进度」用户</div>
  1871. <div class="dropdown">
  1872. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="xxjd_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  1873. 添加用户
  1874. </button>
  1875. <div class="dropdown-menu" id="xxjd_dropdownMenu" aria-labelledby="xxjd_dropdownMenuButton" style="width:220px">
  1876. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1877. placeholder="姓名/手机 检索" autocomplete="off"></div>
  1878. <dl class="list-unstyled book-list">
  1879. <% accountGroup.forEach((group, idx) => { %>
  1880. <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>
  1881. <div class="dd-content" data-toggleid="<%- idx %>">
  1882. <% group.groupList.forEach(item => { %>
  1883. <% if (item.id !== ctx.tender.data.user_id) { %>
  1884. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  1885. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1886. class="ml-auto"><%- item.mobile %></span></p>
  1887. <span class="text-muted"><%- item.role %></span>
  1888. </dd>
  1889. <% } %>
  1890. <% });%>
  1891. </div>
  1892. <% }) %>
  1893. </dl>
  1894. </div>
  1895. </div>
  1896. <div class="mt-1" style="max-height: 300px;overflow: auto">
  1897. <table class="table table-bordered">
  1898. <tr><th>用户</th><th>查看</th><th>修改</th><th>移除</th></tr>
  1899. <tbody id="schedule-users">
  1900. <% for (const sa of scheduleAuditList) { %>
  1901. <% const audit = ctx.helper._.find(accountList, { id : sa.audit_id }); %>
  1902. <% if (audit) { %>
  1903. <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>
  1904. <div class="custom-control custom-checkbox mb-2">
  1905. <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<% } %>>
  1906. <label class="custom-control-label" for="<%- sa.id %>_customRadio41"></label>
  1907. </div>
  1908. </td><td>
  1909. <div class="custom-control custom-checkbox mb-2">
  1910. <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<% } %>>
  1911. <label class="custom-control-label" for="<%- sa.id %>_customRadio42"></label>
  1912. </div>
  1913. </td>
  1914. <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="<%- sa.id %>">移除</a></td>
  1915. </tr>
  1916. <% } %>
  1917. <% } %>
  1918. </tbody>
  1919. </table>
  1920. </div>
  1921. </div>
  1922. <div class="modal-footer">
  1923. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  1924. </div>
  1925. </div>
  1926. </div>
  1927. </div>
  1928. <script>
  1929. $(function () {
  1930. const scPermission = JSON.parse(unescape('<%- escape(JSON.stringify(scPermission)) %>'));
  1931. // 投资进度
  1932. let timer = null;
  1933. let oldSearchVal = null;
  1934. $('body').on('input propertychange', '#xxjd_dropdownMenu .gr-search', function(e) {
  1935. oldSearchVal = e.target.value;
  1936. timer && clearTimeout(timer);
  1937. timer = setTimeout(() => {
  1938. const newVal = $(this).val();
  1939. let html = '';
  1940. if (newVal && newVal === oldSearchVal) {
  1941. accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1942. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1943. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1944. class="ml-auto">${item.mobile || ''}</span></p>
  1945. <span class="text-muted">${item.role || ''}</span>
  1946. </dd>`
  1947. });
  1948. $('#xxjd_dropdownMenu .book-list').empty();
  1949. $('#xxjd_dropdownMenu .book-list').append(html);
  1950. } else {
  1951. if (!$('#xxjd_dropdownMenu .acc-btn').length) {
  1952. accountGroup.forEach((group, idx) => {
  1953. if (!group) return;
  1954. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1955. </a> ${group.groupName}</dt>
  1956. <div class="dd-content" data-toggleid="${idx}">`;
  1957. group.groupList.forEach(item => {
  1958. if (item.id !== cur_tender_uid) {
  1959. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1960. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1961. class="ml-auto">${item.mobile || ''}</span></p>
  1962. <span class="text-muted">${item.role || ''}</span>
  1963. </dd>`;
  1964. }
  1965. });
  1966. html += '</div>';
  1967. });
  1968. $('#xxjd_dropdownMenu .book-list').empty();
  1969. $('#xxjd_dropdownMenu .book-list').append(html);
  1970. }
  1971. }
  1972. }, 400);
  1973. });
  1974. // 添加审批流程按钮逻辑
  1975. $('body').on('click', '#xxjd_dropdownMenu .book-list dt', function () {
  1976. const idx = $(this).find('.acc-btn').attr('data-groupid');
  1977. const type = $(this).find('.acc-btn').attr('data-type');
  1978. if (type === 'hide') {
  1979. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1980. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
  1981. $(this).find('.acc-btn').attr('data-type', 'show');
  1982. })
  1983. } else {
  1984. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1985. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
  1986. $(this).find('.acc-btn').attr('data-type', 'hide');
  1987. })
  1988. }
  1989. return false;
  1990. });
  1991. // 选中用户
  1992. $('body').on('click', '#xxjd_dropdownMenu dl dd', function () {
  1993. const id = parseInt($(this).data('id'));
  1994. if (id) {
  1995. const user = _.find(accountList, function (item) {
  1996. return item.id === id;
  1997. });
  1998. const saIdList = [];
  1999. for (let i = 0; i < $('#schedule-users tr').length; i++) {
  2000. saIdList.push(parseInt($('#schedule-users tr').eq(i).data('id')));
  2001. }
  2002. if (_.includes(saIdList, id)) {
  2003. toastr.error('该用户已存在列表中,无需重复添加');
  2004. return;
  2005. }
  2006. const prop = {
  2007. audit_id: id,
  2008. type: 'add',
  2009. };
  2010. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  2011. 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' +
  2012. ' <div class="custom-control custom-checkbox mb-2">\n' +
  2013. ' <input type="checkbox" data-zhi="'+ scPermission.show +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio41" name="customCheckbox" class="custom-control-input" checked>\n' +
  2014. ' <label class="custom-control-label" for="'+ data.id + '_customRadio41"></label>\n' +
  2015. ' </div>\n' +
  2016. ' </td><td>\n' +
  2017. ' <div class="custom-control custom-checkbox mb-2">\n' +
  2018. ' <input type="checkbox" data-zhi="'+ scPermission.edit +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio42" name="customCheckbox" class="custom-control-input">\n' +
  2019. ' <label class="custom-control-label" for="'+ data.id + '_customRadio42"></label>\n' +
  2020. ' </div>\n' +
  2021. ' </td>\n' +
  2022. ' <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="'+ data.id + '">移除</a></td>\n' +
  2023. ' </tr>';
  2024. $('#schedule-users').append(html);
  2025. });
  2026. }
  2027. });
  2028. // 移除用户
  2029. $('body').on('click', '#schedule-users .remove-schedule-user', function () {
  2030. const id = parseInt($(this).data('id'));
  2031. if (id) {
  2032. const prop = {
  2033. id,
  2034. type: 'del',
  2035. };
  2036. const _self = $(this);
  2037. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  2038. _self.parents('tr').remove();
  2039. });
  2040. }
  2041. });
  2042. // 权限更改
  2043. $('body').on('click', '#schedule-users input[type="checkbox"]', function () {
  2044. let permission = scPermission.no;
  2045. const value = parseInt($(this).data('zhi'));
  2046. if ($(this).is(':checked')) {
  2047. if (value === scPermission.edit) {
  2048. permission = scPermission.edit;
  2049. $(this).parents('td').siblings().find('input').prop('checked', true);
  2050. } else if (value === scPermission.show) {
  2051. permission = scPermission.show;
  2052. }
  2053. } else {
  2054. if (value === scPermission.edit) {
  2055. permission = scPermission.show;
  2056. } else if (value === scPermission.show) {
  2057. permission = scPermission.no;
  2058. $(this).parents('td').siblings().find('input').prop('checked', false);
  2059. }
  2060. }
  2061. const id = parseInt($(this).data('id'));
  2062. const prop = {
  2063. id,
  2064. permission,
  2065. type: 'edit',
  2066. };
  2067. const _self = $(this);
  2068. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  2069. });
  2070. });
  2071. })
  2072. </script>
  2073. <% } %>