detail_modal.ejs 104 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765176617671768176917701771177217731774177517761777177817791780178117821783178417851786178717881789179017911792179317941795179617971798179918001801180218031804180518061807180818091810181118121813181418151816181718181819182018211822182318241825182618271828182918301831183218331834183518361837183818391840184118421843184418451846184718481849185018511852185318541855185618571858185918601861186218631864186518661867186818691870187118721873187418751876187718781879188018811882188318841885188618871888188918901891189218931894189518961897189818991900190119021903190419051906190719081909191019111912191319141915191619171918191919201921192219231924192519261927192819291930193119321933193419351936193719381939
  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. <div class="form-group">
  603. <!--默认显示-->
  604. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  605. </div>
  606. </div>
  607. </div>
  608. <div class="modal-footer">
  609. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  610. <button type="button" class="btn btn-sm btn-primary" onclick="post4()">确认修改</button>
  611. </div>
  612. </div>
  613. </div>
  614. </div>
  615. <% } else { %>
  616. <!--标段设置-合同参数-->
  617. <div class="modal fade" id="bd-set-4" data-backdrop="static">
  618. <div class="modal-dialog" role="document">
  619. <div class="modal-content">
  620. <div class="modal-header">
  621. <h5 class="modal-title">合同参数</h5>
  622. </div>
  623. <div class="modal-body">
  624. <div class="form-group">
  625. <!--默认显示-->
  626. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  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. </div>
  633. </div>
  634. </div>
  635. </div>
  636. <% } %>
  637. <!--标段设置-显示设置-->
  638. <div class="modal fade" id="bd-set-5" data-backdrop="static">
  639. <div class="modal-dialog" role="document">
  640. <div class="modal-content">
  641. <div class="modal-header">
  642. <h5 class="modal-title">显示设置</h5>
  643. </div>
  644. <div class="modal-body">
  645. <div class="form-group">
  646. <div class="custom-control custom-checkbox mb-2">
  647. <input type="checkbox" class="custom-control-input" id="ledger-dgn-qty" checked="">
  648. <label class="custom-control-label" for="ledger-dgn-qty">项目节数量</label>
  649. </div>
  650. <div class="custom-control custom-checkbox mb-2">
  651. <input type="checkbox" class="custom-control-input" id="ledger-cl-qty" checked="">
  652. <label class="custom-control-label" for="ledger-cl-qty">错漏增减</label>
  653. </div>
  654. <div class="custom-control custom-checkbox mb-2">
  655. <input type="checkbox" class="custom-control-input" id="thousandth" checked="">
  656. <label class="custom-control-label" for="thousandth">千分位</label>
  657. </div>
  658. <div class="custom-control custom-checkbox mb-2">
  659. <input type="checkbox" class="custom-control-input" id="stage-rc" checked="">
  660. <label class="custom-control-label" for="stage-rc">实际完成量</label>
  661. </div>
  662. <div class="custom-control custom-checkbox mb-2">
  663. <input type="checkbox" class="custom-control-input" checked="" id="stage-correct">
  664. <label class="custom-control-label" for="stage-correct">使用数量纠正完成率</label>
  665. </div>
  666. </div>
  667. </div>
  668. <div class="modal-footer">
  669. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  670. <button type="button" class="btn btn-sm btn-primary" onclick="post5()">确认修改</button>
  671. </div>
  672. </div>
  673. </div>
  674. </div>
  675. <!--标段设置-章节设置-->
  676. <div class="modal fade" id="bd-set-6" data-backdrop="static">
  677. <div class="modal-dialog" role="document">
  678. <div class="modal-content">
  679. <div class="modal-header">
  680. <h5 class="modal-title">章节设置</h5>
  681. </div>
  682. <div class="modal-body">
  683. <div class="form-group" id="chapter-spread" style="height: 330px; width: 465px;">
  684. </div>
  685. </div>
  686. <div class="modal-footer">
  687. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  688. <button type="button" class="btn btn-sm btn-primary" onclick="post6()">确认修改</button>
  689. </div>
  690. </div>
  691. </div>
  692. </div>
  693. <!--标段设置-付款账号-->
  694. <div class="modal fade" id="bd-set-7" data-backdrop="static">
  695. <div class="modal-dialog" role="document">
  696. <div class="modal-content">
  697. <div class="modal-header">
  698. <h5 class="modal-title">付款账号</h5>
  699. </div>
  700. <div class="modal-body">
  701. <div class="sjs-option-height">
  702. <table class="table table-bordered">
  703. <tr><th colspan="2" class="text-center">工程款账户</th></tr>
  704. <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  705. <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  706. <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  707. <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  708. <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  709. <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  710. <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
  711. <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  712. <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  713. <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  714. <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  715. <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  716. <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm" oninput="limitReturn(this)"></td></tr>
  717. </table>
  718. </div>
  719. </div>
  720. <div class="modal-footer">
  721. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  722. <button type="button" class="btn btn-sm btn-primary" onclick="post7()" >确认修改</button>
  723. </div>
  724. </div>
  725. </div>
  726. </div>
  727. <!--批量设置-->
  728. <div class="modal fade" id="bd-set-8" data-backdrop="static">
  729. <div class="modal-dialog" role="document">
  730. <div class="modal-content">
  731. <div class="modal-header">
  732. <h5 class="modal-title">从其他标段拷贝设置</h5>
  733. </div>
  734. <div class="modal-body">
  735. <div class="alert alert-warning mb-1">从以下标段拷贝设置</div>
  736. <div class="mb-1" id="setting-custom">
  737. <a class="btn btn-sm btn-light">
  738. <div class="custom-control custom-checkbox">
  739. <input type="checkbox" class="custom-control-input" checked data-type="tender">
  740. <label class="custom-control-label text-primary" for="customCheckDisabld">标段属性</label>
  741. </div>
  742. </a>
  743. <a class="btn btn-sm btn-light">
  744. <div class="custom-control custom-checkbox">
  745. <input type="checkbox" class="custom-control-input" checked data-type="chapter">
  746. <label class="custom-control-label text-primary" for="customCheckDisabld2">章节设置</label>
  747. </div>
  748. </a>
  749. <a class="btn btn-sm btn-light">
  750. <div class="custom-control custom-checkbox">
  751. <input type="checkbox" class="custom-control-input" checked data-type="pay_account">
  752. <label class="custom-control-label text-primary" for="customCheckDisabld3">付款账号</label>
  753. </div>
  754. </a>
  755. </div>
  756. <div class="modal-height-300" id="copyModalContent">
  757. </div>
  758. </div>
  759. <div class="modal-footer">
  760. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  761. <button type="button" class="btn btn-sm btn-primary" id="copy_comfirm_btn">确认</button>
  762. </div>
  763. </div>
  764. </div>
  765. </div>
  766. <script>
  767. let property = JSON.parse(unescape('<%- escape(JSON.stringify(tenderInfo)) %>'));
  768. let ledgerChecked = <%- (tender.ledger_status === audit.ledger.status.checked) && ((lastStage !== undefined && lastStage !== null) || !revise || !revise.valid || revise.status === audit.revise.status.checked) %>;
  769. let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
  770. // 根据Min Max限制Input输入
  771. function limitInputMinMax (obj) {
  772. if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
  773. obj.value = obj.max;
  774. }
  775. if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
  776. obj.value = obj.min;
  777. }
  778. }
  779. // 根据Maxlength限制input输入
  780. function limitMaxLength (obj) {
  781. if (obj.value.length > obj.maxLength) {
  782. obj.value = obj.value.substr(0, obj.maxLength);
  783. }
  784. }
  785. // 根据正则限制输入
  786. function limitReg(obj, reg) {
  787. obj.value = obj.value.replace(reg, '');
  788. }
  789. // 小数位数 input 输入限制
  790. function limitDecimal(obj) {
  791. limitReg(obj, /[^\d]/g);
  792. limitMaxLength(obj);
  793. limitInputMinMax(obj);
  794. }
  795. function limitDealParamLength(obj) {
  796. limitReg(obj, /[^\d\.]/g); // 过滤数字和.
  797. limitReg(obj, /\.{2,}/g); // 过滤第二个.
  798. limitInputMinMax(obj);
  799. }
  800. function limitReturn(obj) {
  801. limitReg(obj, /\s/g);
  802. }
  803. function checkNumberValid(obj) {
  804. const value = _.toNumber(obj.value);
  805. obj.value = value ? value : '';
  806. }
  807. // 属性
  808. function loadCommonProperty () {
  809. // 合同信息
  810. $('#build-name').val(property.deal_info.buildName);
  811. $('#deal-code').val(property.deal_info.dealCode);
  812. $('#deal-name').val(property.deal_info.dealName);
  813. $('#project-type').val(property.deal_info.projectType);
  814. $('#deal-type').val(property.deal_info.dealType);
  815. $('#final-code').val(property.deal_info.finalCode);
  816. // 参建单位
  817. // 建设单位
  818. $('#build-company').val(property.construction_unit.build.company);
  819. $('#build-corporation').val(property.construction_unit.build.corporation);
  820. $('#build-date').val(property.construction_unit.build.date);
  821. // 承包单位1
  822. $('#contract1-company').val(property.construction_unit.contract1.company);
  823. $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
  824. $('#contract1-date').val(property.construction_unit.contract1.date);
  825. // 承包单位2
  826. $('#contract2-company').val(property.construction_unit.contract2.company);
  827. $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
  828. $('#contract2-date').val(property.construction_unit.contract2.date);
  829. // 监理单位1
  830. $('#supervision1-company').val(property.construction_unit.supervision1.company);
  831. $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
  832. $('#supervision1-date').val(property.construction_unit.supervision1.date);
  833. // 监理单位2
  834. $('#supervision2-company').val(property.construction_unit.supervision2.company);
  835. $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
  836. $('#supervision2-date').val(property.construction_unit.supervision2.date);
  837. // 技术参数
  838. $('#load-level').find("option:contains('" + property.tech_param.loadLevel + "')").attr("selected",true);
  839. $('#length').val(property.tech_param.loadLength);
  840. $('#start-peg').val(property.tech_param.startPeg);
  841. $('#end-peg').val(property.tech_param.endPeg);
  842. $('#lane-count').val(property.tech_param.laneCount);
  843. $('#deal-period').val(property.tech_param.dealPeriod);
  844. $('#start-date').val(property.tech_param.startDate);
  845. $('#plan-end-date').val(property.tech_param.planEndDate);
  846. $('#real-start-date').val(property.tech_param.realStartDate);
  847. $('#real-end-date').val(property.tech_param.realEndDate);
  848. $('#structure-scale').val(property.tech_param.structureScale);
  849. // 中标信息
  850. $('#control-price').val(property.bid_info.controlPrice);
  851. $('#bid-price').val(property.bid_info.bidPrice);
  852. $('#bid-start-date').val(property.bid_info.bidStartDate);
  853. $('#bid-type').find("option:contains('" + property.bid_info.bidType + "')").attr("selected",true);
  854. $('#deal-calc-type').find("option:contains('" + property.bid_info.dealCalcType + "')").attr("selected",true);
  855. }
  856. $('#bd-set-1').on('show.bs.modal', function () {
  857. loadCommonProperty();
  858. })
  859. function post1 () {
  860. const prop = {
  861. deal_info: {
  862. buildName: $('#build-name').val(),
  863. dealCode: $('#deal-code').val(),
  864. dealName: $('#deal-name').val(),
  865. projectType: $('#project-type').val(),
  866. dealType: $('#deal-type').val(),
  867. finalCode: $('#final-code').val(),
  868. },
  869. construction_unit: {
  870. build: {
  871. company: $('#build-company').val(),
  872. corporation: $('#build-corporation').val(),
  873. date: $('#build-date').val(),
  874. },
  875. contract1: {
  876. company: $('#contract1-company').val(),
  877. corporation: $('#contract1-corporation').val(),
  878. date: $('#contract1-date').val(),
  879. },
  880. contract2: {
  881. company: $('#contract2-company').val(),
  882. corporation: $('#contract2-corporation').val(),
  883. date: $('#contract2-date').val(),
  884. },
  885. supervision1: {
  886. company: $('#supervision1-company').val(),
  887. corporation: $('#supervision1-corporation').val(),
  888. date: $('#supervision1-date').val(),
  889. },
  890. supervision2: {
  891. company: $('#supervision2-company').val(),
  892. corporation: $('#supervision2-corporation').val(),
  893. date: $('#supervision2-date').val(),
  894. },
  895. },
  896. tech_param: {
  897. loadLevel: $('#load-level').find("option:selected").text(),
  898. loadLength: _.toNumber($('#length').val()),
  899. startPeg: $('#start-peg').val(),
  900. endPeg: $('#end-peg').val(),
  901. laneCount: _.toNumber($('#lane-count').val()),
  902. dealPeriod: $('#deal-period').val(),
  903. startDate: $('#start-date').val(),
  904. planEndDate: $('#plan-end-date').val(),
  905. realStartDate: $('#real-start-date').val(),
  906. realEndDate: $('#real-end-date').val(),
  907. structureScale: $('#structure-scale').val(),
  908. },
  909. bid_info: {
  910. controlPrice: _.toNumber($('#control-price').val()),
  911. bidPrice: _.toNumber($('#bid-price').val()),
  912. bidStartDate: $('#bid-start-date').val(),
  913. bidType: $('#bid-type').find("option:selected").text(),
  914. dealCalcType: $('#deal-calc-type').find("option:selected").text(),
  915. }
  916. };
  917. const tenderId = window.location.pathname.split('/')[2];
  918. postData('/tender/' + tenderId + '/save', prop, function (data) {
  919. property.deal_info = data.deal_info;
  920. property.construction_unit = data.construction_unit;
  921. property.tech_param = data.tech_param;
  922. property.bid_info = data.bid_info;
  923. $('#bd-set-1').modal('hide');
  924. });
  925. }
  926. // 小数位数
  927. function loadCalculateProperty () {
  928. $('#decimal-up').val(property.decimal.up);
  929. $('#decimal-tp').val(property.decimal.tp);
  930. $('#decimal-pay')[0].checked = property.decimal.pay;
  931. $('#decimal-pay-tp').val(property.decimal.payTp);
  932. $('#decimal-pay-tp')[0].disabled = !property.decimal.pay;
  933. $('#decimal-extra')[0].checked = property.decimal.extra;
  934. $('#decimal-extra-tp').val(property.decimal.extraTp);
  935. $('#decimal-extra-tp')[0].disabled = !property.decimal.extra;
  936. }
  937. $('#decimal-pay').change(() => {
  938. $('#decimal-pay-tp')[0].disabled = !$('#decimal-pay')[0].checked;
  939. });
  940. $('#decimal-extra').change(() => {
  941. $('#decimal-extra-tp')[0].disabled = !$('#decimal-extra')[0].checked;
  942. });
  943. $('#bd-set-2').on('show.bs.modal', function () {
  944. loadCalculateProperty();
  945. });
  946. function post2() {
  947. const prop = {
  948. decimal: {
  949. up: _.toNumber($('#decimal-up').val()),
  950. tp: _.toNumber($('#decimal-tp').val()),
  951. pay: $('#decimal-pay')[0].checked,
  952. payTp: _.toNumber($('#decimal-pay-tp').val()),
  953. extra: $('#decimal-extra')[0].checked,
  954. extraTp: _.toNumber($('#decimal-extra-tp').val()),
  955. }
  956. };
  957. if (ledgerChecked) {
  958. if (prop.decimal.up < property.decimal.up) {
  959. toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
  960. return;
  961. }
  962. if (prop.decimal.tp < property.decimal.tp) {
  963. toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
  964. return;
  965. }
  966. }
  967. if (firstStageChecked) {
  968. if (property.decimal.pay) {
  969. if (!prop.decimal.pay) {
  970. toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
  971. return;
  972. }
  973. if (prop.decimal.payTp < property.decimal.payTp) {
  974. toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
  975. return;
  976. }
  977. } else {
  978. if (prop.decimal.pay) {
  979. toastr.warning('第一期已审批完成,合同支付不可单独设置');
  980. return;
  981. }
  982. }
  983. if (property.decimal.extra) {
  984. if (!prop.decimal.extra) {
  985. toastr.warning('第一期已审批完成,不可取消其他台账单独设置');
  986. return;
  987. }
  988. if (prop.decimal.extraTp < property.decimal.extraTp) {
  989. toastr.warning('第一期已审批完成,单独设置的其他台账小数位数,不可小于' + property.decimal.extraTp);
  990. return;
  991. }
  992. } else {
  993. if (prop.decimal.extra) {
  994. toastr.warning('第一期已审批完成,其他台账不可单独设置');
  995. return;
  996. }
  997. }
  998. }
  999. const tenderId = window.location.pathname.split('/')[2];
  1000. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1001. property.decimal = data.decimal;
  1002. $('#bd-set-2').modal('hide');
  1003. }, null, true);
  1004. }
  1005. // 清单精度
  1006. const precisionObj = (function () {
  1007. const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
  1008. spread.options.showVerticalScrollbar = false;
  1009. spread.options.showHorizontalScrollbar = false;
  1010. const sheet = spread.getActiveSheet();
  1011. SpreadJsObj.protectedSheet(sheet);
  1012. sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
  1013. sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
  1014. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  1015. const vStyle = new spreadNS.Style();
  1016. vStyle.font = '12px 微软雅黑';
  1017. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  1018. const xStyle = new spreadNS.Style();
  1019. xStyle.font = '12px 微软雅黑';
  1020. xStyle.vAlign = 1;
  1021. xStyle.hAlign = 1;
  1022. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  1023. const yStyle = new spreadNS.Style();
  1024. yStyle.font = '12px 微软雅黑';
  1025. yStyle.vAlign = 1;
  1026. yStyle.hAlign = 1;
  1027. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  1028. SpreadJsObj.massOperationSheet(sheet, function () {
  1029. sheet.defaults.rowHeight = 21;
  1030. sheet.setColumnCount(2);
  1031. sheet.setRowCount(13);
  1032. sheet.setColumnWidth(0, 100);
  1033. sheet.setColumnWidth(1, 60);
  1034. sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  1035. sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2).locked(false);
  1036. sheet.setText(0, 0, 't');
  1037. sheet.setText(1, 0, 'km');
  1038. sheet.setText(2, 0, 'm');
  1039. sheet.setText(3, 0, 'm2');
  1040. sheet.setText(4, 0, 'm3');
  1041. sheet.setText(5, 0, 'kg');
  1042. sheet.setText(6, 0, '个');
  1043. sheet.setText(7, 0, '台');
  1044. sheet.setText(8, 0, '套');
  1045. sheet.setText(9, 0, '棵');
  1046. sheet.setText(10, 0, '组');
  1047. sheet.setText(11, 0, '系统');
  1048. sheet.setText(12, 0, '其他未列单位');
  1049. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  1050. sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
  1051. sheet.getRange(0, 0, 13, 2).formatter('@');
  1052. sheet.setSelection(0, 1, 1, 1);
  1053. });
  1054. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1055. const value = _.toNumber(info.editingText);
  1056. if (!_.isInteger(value)) {
  1057. toastr.warning('请输入0-6的整数');
  1058. sheet.setText(info.row, info.col, '0');
  1059. } else if (value > 6) {
  1060. toastr.warning('请输入0-6的整数');
  1061. sheet.setText(info.row, info.col, '6');
  1062. } else if (value < 0) {
  1063. toastr.warning('请输入0-6的整数');
  1064. sheet.setText(info.row, info.col, '0');
  1065. }
  1066. });
  1067. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  1068. const sel = sheet.getSelections()[0];
  1069. if (sel) {
  1070. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  1071. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  1072. if (iCol !== 1) continue;
  1073. sheet.setText(iRow, iCol, '0');
  1074. }
  1075. }
  1076. }
  1077. });
  1078. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1079. let bHint = false;
  1080. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  1081. const curRow = info.cellRange.row + iRow;
  1082. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1083. const curCol = info.cellRange.col + iCol;
  1084. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1085. if (_.isNaN(value) || !_.isInteger(value)) {
  1086. bHint = true;
  1087. info.sheet.setText(curRow, curCol, '0');
  1088. } else if (value > 6) {
  1089. bHint = true;
  1090. info.sheet.setText(curRow, curCol, '6');
  1091. } else if (value < 0) {
  1092. bHint = true;
  1093. info.sheet.setText(curRow, curCol, '0');
  1094. }
  1095. }
  1096. }
  1097. if (bHint) {
  1098. toastr.warning('请输入0-6的整数');
  1099. }
  1100. });
  1101. function loadPrecisonProperty() {
  1102. $('#hint-3').hide();
  1103. sheet.setValue(0, 1, property.precision.t.value);
  1104. sheet.setValue(1, 1, property.precision.km.value);
  1105. sheet.setValue(2, 1, property.precision.m.value);
  1106. sheet.setValue(3, 1, property.precision.m2.value);
  1107. sheet.setValue(4, 1, property.precision.m3.value);
  1108. sheet.setValue(5, 1, property.precision.kg.value);
  1109. sheet.setValue(6, 1, property.precision.ge.value);
  1110. sheet.setValue(7, 1, property.precision.tai.value);
  1111. sheet.setValue(8, 1, property.precision.tao.value);
  1112. sheet.setValue(9, 1, property.precision.ke.value);
  1113. sheet.setValue(10, 1, property.precision.zu.value);
  1114. sheet.setValue(11, 1, property.precision.xitong.value);
  1115. sheet.setValue(12, 1, property.precision.other.value);
  1116. }
  1117. function setReadOnly(readOnly) {
  1118. sheet.getRange(0, 1, 13, 1).locked(readOnly);
  1119. }
  1120. function getNewPrecisionData() {
  1121. const precision = JSON.parse(JSON.stringify(property.precision));
  1122. precision.t.value = _.toNumber(sheet.getText(0, 1));
  1123. precision.km.value = _.toNumber(sheet.getText(1, 1));
  1124. precision.m.value = _.toNumber(sheet.getText(2, 1));
  1125. precision.m2.value = _.toNumber(sheet.getText(3, 1));
  1126. precision.m3.value = _.toNumber(sheet.getText(4, 1));
  1127. precision.kg.value = _.toNumber(sheet.getText(5, 1));
  1128. precision.ge.value = _.toNumber(sheet.getText(6, 1));
  1129. precision.tai.value = _.toNumber(sheet.getText(7, 1));
  1130. precision.tao.value = _.toNumber(sheet.getText(8, 1));
  1131. precision.ke.value = _.toNumber(sheet.getText(9, 1));
  1132. precision.zu.value = _.toNumber(sheet.getText(10, 1));
  1133. precision.xitong.value = _.toNumber(sheet.getText(11, 1));
  1134. precision.other.value = _.toNumber(sheet.getText(12, 1));
  1135. return precision;
  1136. }
  1137. function checkPrecisionMinLimit(precision, limit) {
  1138. for (const unit in precision) {
  1139. if (precision[unit].value < limit[unit].value) {
  1140. if (precision[unit].unit) {
  1141. toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
  1142. } else {
  1143. toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
  1144. }
  1145. return false;
  1146. }
  1147. }
  1148. return true;
  1149. };
  1150. return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
  1151. })();
  1152. $('#bd-set-3').on('show.bs.modal', function () {
  1153. <% if (!(
  1154. ((tender.ledger_status === audit.ledger.status.uncheck || tender.ledger_status === audit.ledger.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId) ||
  1155. (lastStage && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck)) ||
  1156. (!lastStage && revise && revise.valid && (revise.status === audit.revise.status.uncheck || revise.status === audit.revise.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
  1157. )) { %>
  1158. precisionObj.setReadOnly(true);
  1159. <% } %>
  1160. precisionObj.loadPrecisonProperty();
  1161. });
  1162. function post3 () {
  1163. const prop = { precision: precisionObj.getNewPrecisionData() };
  1164. if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
  1165. const tenderId = window.location.pathname.split('/')[2];
  1166. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1167. property.precision = data.precision;
  1168. $('#bd-set-3').modal('hide');
  1169. }, null, true);
  1170. }
  1171. // 合同参数
  1172. const dealObj = (function () {
  1173. const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
  1174. spread.options.showVerticalScrollbar = false;
  1175. spread.options.showHorizontalScrollbar = false;
  1176. const sheet = spread.getActiveSheet();
  1177. SpreadJsObj.protectedSheet(sheet);
  1178. sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
  1179. sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
  1180. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  1181. const vStyle = new spreadNS.Style();
  1182. vStyle.font = '12px 微软雅黑';
  1183. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  1184. const xStyle = new spreadNS.Style();
  1185. xStyle.font = '12px 微软雅黑';
  1186. xStyle.vAlign = 1;
  1187. xStyle.hAlign = 1;
  1188. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  1189. const yStyle = new spreadNS.Style();
  1190. yStyle.font = '12px 微软雅黑';
  1191. yStyle.vAlign = 1;
  1192. yStyle.hAlign = 1;
  1193. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  1194. SpreadJsObj.massOperationSheet(sheet, function () {
  1195. sheet.defaults.rowHeight = 21;
  1196. sheet.setColumnCount(2);
  1197. sheet.setRowCount(6);
  1198. sheet.setColumnWidth(0, 200);
  1199. sheet.setColumnWidth(1, 200);
  1200. sheet.getRange(0, 0, 6, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  1201. sheet.getRange(0, 1, 6, 1).vAlign(1).hAlign(2).locked(false);
  1202. sheet.setText(0, 0, '签约合同价');
  1203. sheet.setText(1, 0, '暂列金额');
  1204. sheet.setText(2, 0, '签约合同价(不含暂列金)');
  1205. sheet.setText(3, 0, '签约开工预付款');
  1206. sheet.setText(4, 0, '签约材料预付款');
  1207. sheet.setText(5, 0, '安全生产费');
  1208. sheet.getCell(2, 1).locked(true);
  1209. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  1210. sheet.getRange(0, 0, 6, 2).setBorder(lineBorder, {all: true});
  1211. sheet.getRange(0, 0, 6, 2).formatter('@');
  1212. sheet.setSelection(0, 1, 1, 1);
  1213. });
  1214. function calcHtjMinusZlj() {
  1215. const htj = _.toNumber(sheet.getText(0, 1));
  1216. const zlj = _.toNumber(sheet.getText(1, 1));
  1217. sheet.setValue(2, 1, ZhCalc.sub(htj, zlj));
  1218. }
  1219. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1220. const value = _.toNumber(info.editingText);
  1221. if (_.isNaN(value)) {
  1222. toastr.warning('请输入不超过万亿的数字');
  1223. info.sheet.setText(info.row, info.col, '0');
  1224. } else if (value > Math.pow(10, 13)) {
  1225. toastr.warning('请输入不超过万亿的数字');
  1226. info.sheet.setText(info.row, info.col, '0');
  1227. }
  1228. if (info.row === 0 || info.row === 1) {
  1229. calcHtjMinusZlj();
  1230. }
  1231. });
  1232. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  1233. const sel = sheet.getSelections()[0];
  1234. let calc = false;
  1235. if (sel) {
  1236. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  1237. if (iRow === 2) continue;
  1238. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  1239. if (iCol !== 1) continue;
  1240. sheet.setText(iRow, iCol, '0');
  1241. if (iRow === 0 || iRow === 1) calc = true;
  1242. }
  1243. }
  1244. }
  1245. if (calc) calcHtjMinusZlj();
  1246. });
  1247. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1248. let bHint = false;
  1249. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  1250. const curRow = info.cellRange.row + iRow;
  1251. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1252. const curCol = info.cellRange.col + iCol;
  1253. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1254. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  1255. bHint = true;
  1256. info.sheet.setText(curRow, curCol, '0');
  1257. }
  1258. }
  1259. }
  1260. if (bHint) {
  1261. toastr.warning('请输入不超过万亿的数字');
  1262. }
  1263. calcHtjMinusZlj();
  1264. });
  1265. function loadDealProperty() {
  1266. sheet.setValue(0, 1, property.deal_param.contractPrice);
  1267. sheet.setValue(1, 1, property.deal_param.zanLiePrice);
  1268. sheet.setValue(2, 1, ZhCalc.sub(property.deal_param.contractPrice, property.deal_param.zanLiePrice));
  1269. sheet.setValue(3, 1, property.deal_param.startAdvance);
  1270. sheet.setValue(4, 1, property.deal_param.materialAdvance);
  1271. sheet.setValue(5, 1, property.deal_param.safeAdvance);
  1272. }
  1273. function setReadOnly (readOnly) {
  1274. sheet.getCell(0, 1).locked(readOnly);
  1275. sheet.getCell(1, 1).locked(readOnly);
  1276. sheet.getCell(3, 1).locked(readOnly);
  1277. sheet.getCell(4, 1).locked(readOnly);
  1278. sheet.getCell(5, 1).locked(readOnly);
  1279. }
  1280. function getNewDealData () {
  1281. const result = {};
  1282. result.contractPrice = _.toNumber(sheet.getText(0, 1));
  1283. result.zanLiePrice = _.toNumber(sheet.getText(1, 1));
  1284. result.startAdvance = _.toNumber(sheet.getText(3, 1));
  1285. result.materialAdvance = _.toNumber(sheet.getText(4, 1));
  1286. result.safeAdvance = _.toNumber(sheet.getText(5, 1));
  1287. return result;
  1288. }
  1289. return { loadDealProperty, setReadOnly, getNewDealData, };
  1290. })();
  1291. $('#bd-set-4').on('show.bs.modal', function () {
  1292. dealObj.loadDealProperty();
  1293. <% 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)))) { %>
  1294. dealObj.setReadOnly(true);
  1295. <% } %>
  1296. });
  1297. function post4 () {
  1298. if (firstStageChecked) return;
  1299. const prop = { deal_param: dealObj.getNewDealData() };
  1300. const tenderId = window.location.pathname.split('/')[2];
  1301. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1302. property.deal_param = data.deal_param;
  1303. $('#bd-set-4').modal('hide');
  1304. window.location.reload();
  1305. });
  1306. }
  1307. // 显示设置
  1308. function loadDisplayProperty () {
  1309. $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
  1310. $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
  1311. $('#thousandth')[0].checked = property.display.thousandth;
  1312. $('#stage-rc')[0].checked = property.display.stage.realComplete;
  1313. $('#stage-correct')[0].checked = property.display.stage.correct;
  1314. }
  1315. $('#bd-set-5').on('show.bs.modal', function () {
  1316. loadDisplayProperty();
  1317. });
  1318. function post5 () {
  1319. const prop = {
  1320. display: {
  1321. ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
  1322. thousandth: $('#thousandth')[0].checked,
  1323. stage: { realComplete: $('#stage-rc')[0].checked, correct: $('#stage-correct')[0].checked },
  1324. },
  1325. };
  1326. const tenderId = window.location.pathname.split('/')[2];
  1327. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1328. property.display = data.display;
  1329. $('#bd-set-5').modal('hide');
  1330. });
  1331. }
  1332. // 章节设置
  1333. const chapterObj = (function () {
  1334. const spreadSetting = {
  1335. cols: [
  1336. {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
  1337. {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
  1338. ],
  1339. emptyRows: 0,
  1340. headRows: 1,
  1341. headRowHeight: [32],
  1342. defaultRowHeight: 21,
  1343. headerFont: '12px 微软雅黑',
  1344. font: '12px 微软雅黑',
  1345. };
  1346. const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
  1347. spread.options.showVerticalScrollbar = false;
  1348. spread.options.showHorizontalScrollbar = false;
  1349. SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
  1350. function checkSheetData(sheet) {
  1351. let hint = '';
  1352. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1353. const cell = sheet.getCell(iRow, 1);
  1354. const defaultStype = sheet.getDefaultStyle();
  1355. cell.text(cell.text().replace(/\s/g, ''))
  1356. if (cell.text().length > 50) {
  1357. cell.backColor('#f8d7da');
  1358. hint = '章节名称的长度超出范围,请重新输入';
  1359. } else {
  1360. cell.backColor(defaultStype.backColor);
  1361. }
  1362. }
  1363. if (hint === '') {
  1364. $('#hint-6').hide();
  1365. } else {
  1366. $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
  1367. }
  1368. }
  1369. spread.bind(spreadNS.Events.EditEnding, function (e, info) {
  1370. checkSheetData(info.sheet);
  1371. });
  1372. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  1373. checkSheetData(info.sheet);
  1374. });
  1375. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1376. checkSheetData(info.sheet);
  1377. });
  1378. function loadChapterProperty() {
  1379. SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
  1380. $('#hint-6').hide();
  1381. const sheet = spread.getActiveSheet();
  1382. const defaultStype = sheet.getDefaultStyle();
  1383. sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
  1384. }
  1385. function setReadOnly(readOnly) {
  1386. SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
  1387. }
  1388. function getNewChapterData() {
  1389. const result = [];
  1390. const sheet = spread.getActiveSheet();
  1391. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1392. const data = {};
  1393. for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
  1394. const col = spreadSetting.cols[iCol];
  1395. data[col.field] = sheet.getText(iRow, iCol).replace(/\s/g, '');
  1396. if (col.field === 'name') {
  1397. if (data.name.length > 50) {
  1398. return null;
  1399. }
  1400. }
  1401. }
  1402. result.push(data);
  1403. }
  1404. return result;
  1405. }
  1406. return { loadChapterProperty, setReadOnly, getNewChapterData, }
  1407. })();
  1408. $('#bd-set-6').on('show.bs.modal', function () {
  1409. chapterObj.loadChapterProperty();
  1410. chapterObj.setReadOnly(false);
  1411. });
  1412. function post6 () {
  1413. const chapter = chapterObj.getNewChapterData();
  1414. if (!chapter) { return; }
  1415. const tenderId = window.location.pathname.split('/')[2];
  1416. postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
  1417. property.chapter = data.chapter;
  1418. $('#bd-set-6').modal('hide');
  1419. });
  1420. }
  1421. // 属性
  1422. function loadPayProperty () {
  1423. // 付款账号
  1424. $('#project-name').val(property.pay_account.project.name);
  1425. $('#project-bank').val(property.pay_account.project.bank);
  1426. $('#project-account').val(property.pay_account.project.account);
  1427. $('#project-rate').val(property.pay_account.project.rate);
  1428. $('#project-contact').val(property.pay_account.project.contact);
  1429. $('#project-phone').val(property.pay_account.project.phone);
  1430. $('#worker-name').val(property.pay_account.worker.name);
  1431. $('#worker-bank').val(property.pay_account.worker.bank);
  1432. $('#worker-account').val(property.pay_account.worker.account);
  1433. $('#worker-rate').val(property.pay_account.worker.rate);
  1434. $('#worker-contact').val(property.pay_account.worker.contact);
  1435. $('#worker-phone').val(property.pay_account.worker.phone);
  1436. }
  1437. $('#bd-set-7').on('show.bs.modal', function () {
  1438. loadPayProperty();
  1439. })
  1440. function post7 () {
  1441. let flag = false;
  1442. const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
  1443. const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
  1444. const project_rate = $('#project-rate').val();
  1445. if (!rate_reg.test(project_rate) && project_rate !== '') {
  1446. toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
  1447. flag = true;
  1448. }
  1449. const project_phone = $('#project-phone').val();
  1450. if (!phone_reg.test(project_phone) && project_phone !== '') {
  1451. toastr.error('工程款账户联系电话格式有误');
  1452. flag = true;
  1453. }
  1454. const worker_rate = $('#worker-rate').val();
  1455. if (!rate_reg.test(worker_rate) && worker_rate !== '') {
  1456. toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
  1457. flag = true;
  1458. }
  1459. const worker_phone = $('#worker-phone').val();
  1460. if (!phone_reg.test(worker_phone) && worker_phone !== '') {
  1461. toastr.error('农民工工资专用账户联系电话格式有误');
  1462. flag = true;
  1463. }
  1464. if (flag) {
  1465. return false;
  1466. }
  1467. const prop = {
  1468. pay_account: {
  1469. project: {
  1470. name: $('#project-name').val(),
  1471. bank: $('#project-bank').val(),
  1472. account: $('#project-account').val(),
  1473. rate: $('#project-rate').val(),
  1474. contact: $('#project-contact').val(),
  1475. phone: $('#project-phone').val(),
  1476. },
  1477. worker: {
  1478. name: $('#worker-name').val(),
  1479. bank: $('#worker-bank').val(),
  1480. account: $('#worker-account').val(),
  1481. rate: $('#worker-rate').val(),
  1482. contact: $('#worker-contact').val(),
  1483. phone: $('#worker-phone').val(),
  1484. },
  1485. },
  1486. };
  1487. const tenderId = window.location.pathname.split('/')[2];
  1488. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1489. property.pay_account = data.pay_account;
  1490. $('#bd-set-7').modal('hide');
  1491. });
  1492. }
  1493. </script>
  1494. <% if (ctx.session.sessionUser.is_admin) { %>
  1495. <!--游客账号-->
  1496. <div class="modal fade" id="bd-set-9" data-backdrop="static">
  1497. <div class="modal-dialog" role="document">
  1498. <div class="modal-content">
  1499. <div class="modal-header">
  1500. <h5 class="modal-title">游客账号</h5>
  1501. </div>
  1502. <div class="modal-body">
  1503. <div class="dropdown text-right">
  1504. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="tourist_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  1505. 添加游客
  1506. </button>
  1507. <div class="dropdown-menu dropdown-menu-right" id="tourist_dropdownMenu" aria-labelledby="tourist_dropdownMenuButton" style="width:220px">
  1508. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1509. placeholder="姓名/手机 检索" autocomplete="off"></div>
  1510. <dl class="list-unstyled book-list">
  1511. <% accountGroup.forEach((group, idx) => { %>
  1512. <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>
  1513. <div class="dd-content" data-toggleid="<%- idx %>">
  1514. <% group.groupList.forEach(item => { %>
  1515. <% if (item.id !== ctx.tender.data.user_id) { %>
  1516. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  1517. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1518. class="ml-auto"><%- item.mobile %></span></p>
  1519. <span class="text-muted"><%- item.role %></span>
  1520. </dd>
  1521. <% } %>
  1522. <% });%>
  1523. </div>
  1524. <% }) %>
  1525. </dl>
  1526. </div>
  1527. </div>
  1528. <div class="card mt-3">
  1529. <div class="card-header">
  1530. 游客列表
  1531. </div>
  1532. <div class="modal-height-300">
  1533. <ul class="list-group list-group-flush" id="tourist-users">
  1534. <% for (const t of tourists) { %>
  1535. <li class="list-group-item" data-id="<%- t.user_id %>">
  1536. <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>
  1537. <% } %>
  1538. </ul>
  1539. </div>
  1540. </div>
  1541. </div>
  1542. <div class="modal-footer">
  1543. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  1544. </div>
  1545. </div>
  1546. </div>
  1547. </div>
  1548. <script>
  1549. const accountGroup = JSON.parse(unescape('<%- escape(JSON.stringify(accountGroup)) %>'));
  1550. const accountList = JSON.parse(unescape('<%- escape(JSON.stringify(accountList)) %>'));
  1551. const cur_tender_uid = parseInt('<%- ctx.tender.data.user_id %>');
  1552. const cur_tenderid = parseInt('<%- ctx.tender.id %>');
  1553. $(function () {
  1554. // 形象进度
  1555. let timer2 = null;
  1556. let oldSearchVal2 = null;
  1557. $('body').on('input propertychange', '#tourist_dropdownMenu .gr-search', function (e) {
  1558. oldSearchVal2 = e.target.value;
  1559. timer2 && clearTimeout(timer2);
  1560. timer2 = setTimeout(() => {
  1561. const newVal = $(this).val();
  1562. let html = '';
  1563. if (newVal && newVal === oldSearchVal2) {
  1564. accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1565. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1566. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1567. class="ml-auto">${item.mobile || ''}</span></p>
  1568. <span class="text-muted">${item.role || ''}</span>
  1569. </dd>`
  1570. });
  1571. $('#tourist_dropdownMenu .book-list').empty();
  1572. $('#tourist_dropdownMenu .book-list').append(html);
  1573. } else {
  1574. if (!$('#tourist_dropdownMenu .acc-btn').length) {
  1575. accountGroup.forEach((group, idx) => {
  1576. if (!group) return;
  1577. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1578. </a> ${group.groupName}</dt>
  1579. <div class="dd-content" data-toggleid="${idx}">`;
  1580. group.groupList.forEach(item => {
  1581. if (item.id !== cur_tender_uid) {
  1582. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1583. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1584. class="ml-auto">${item.mobile || ''}</span></p>
  1585. <span class="text-muted">${item.role || ''}</span>
  1586. </dd>`;
  1587. }
  1588. });
  1589. html += '</div>';
  1590. });
  1591. $('#tourist_dropdownMenu .book-list').empty();
  1592. $('#tourist_dropdownMenu .book-list').append(html);
  1593. }
  1594. }
  1595. }, 400);
  1596. });
  1597. // 添加审批流程按钮逻辑
  1598. $('body').on('click', '#tourist_dropdownMenu .book-list dt', function () {
  1599. const idx = $(this).find('.acc-btn').attr('data-groupid');
  1600. const type = $(this).find('.acc-btn').attr('data-type');
  1601. if (type === 'hide') {
  1602. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1603. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
  1604. $(this).find('.acc-btn').attr('data-type', 'show');
  1605. })
  1606. } else {
  1607. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1608. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
  1609. $(this).find('.acc-btn').attr('data-type', 'hide');
  1610. })
  1611. }
  1612. return false;
  1613. });
  1614. // 选中用户
  1615. $('body').on('click', '#tourist_dropdownMenu dl dd', function () {
  1616. const id = parseInt($(this).data('id'));
  1617. if (id) {
  1618. const user = _.find(accountList, function (item) {
  1619. return item.id === id;
  1620. });
  1621. const saIdList = [];
  1622. for (let i = 0; i < $('#tourist-users li').length; i++) {
  1623. saIdList.push(parseInt($('#tourist-users li').eq(i).data('id')));
  1624. }
  1625. if (_.includes(saIdList, id)) {
  1626. toastr.error('该用户已存在列表中,无需重复添加');
  1627. return;
  1628. }
  1629. const prop = {
  1630. user_id: id,
  1631. type: 'add',
  1632. };
  1633. postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
  1634. const html = '<li class="list-group-item" data-id="' + user.id + '">\n' +
  1635. '<a href="javascript:void(0);" class="text-danger pull-right remove-tourist-user" data-id="' + data.id + '">移除</a>' + user.name + ' ' +
  1636. '<small class="text-muted">' + user.role + '</small><p class="m-0 ml-2"><small class="text-muted">' + user.company + '</small></p></li>';
  1637. $('#tourist-users').append(html);
  1638. // 外面显示游客数量
  1639. const num = $('#tourist-users li').length;
  1640. if (!$('#tourist-num').hasClass('badge')) {
  1641. $('#tourist-num').addClass('badge badge-secondary').text(num);
  1642. } else {
  1643. $('#tourist-num').text(num);
  1644. }
  1645. });
  1646. }
  1647. });
  1648. // 移除用户
  1649. $('body').on('click', '#tourist-users .remove-tourist-user', function () {
  1650. const id = parseInt($(this).data('id'));
  1651. if (id) {
  1652. const prop = {
  1653. id,
  1654. type: 'del',
  1655. };
  1656. const _self = $(this);
  1657. postData('/tender/' + cur_tenderid + '/tourist/audit/save', prop, function (data) {
  1658. _self.parents('li').remove();
  1659. // 外面显示游客数量
  1660. const num = $('#tourist-users li').length;
  1661. if (num == 0) {
  1662. $('#tourist-num').removeClass('badge badge-secondary').text('');
  1663. } else {
  1664. $('#tourist-num').text(num);
  1665. }
  1666. });
  1667. }
  1668. });
  1669. });
  1670. </script>
  1671. <% } %>
  1672. <% if (ctx.session.sessionProject.page_show !== null && parseInt(ctx.session.sessionProject.page_show.xxjd) === 1 && ctx.session.sessionUser.is_admin) { %>
  1673. <!--标段设置-形象进度-->
  1674. <div class="modal fade" id="xxjd-set" data-backdrop="static">
  1675. <div class="modal-dialog" role="document">
  1676. <div class="modal-content">
  1677. <div class="modal-header">
  1678. <h5 class="modal-title">形象进度</h5>
  1679. </div>
  1680. <div class="modal-body">
  1681. <div class="alert alert-warning">设置可使用「形象进度」用户</div>
  1682. <div class="dropdown">
  1683. <button class="btn btn-outline-primary btn-sm dropdown-toggle" type="button" id="xxjd_dropdownMenuButton" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
  1684. 添加用户
  1685. </button>
  1686. <div class="dropdown-menu" id="xxjd_dropdownMenu" aria-labelledby="xxjd_dropdownMenuButton" style="width:220px">
  1687. <div class="mb-2 p-2"><input class="form-control form-control-sm gr-search"
  1688. placeholder="姓名/手机 检索" autocomplete="off"></div>
  1689. <dl class="list-unstyled book-list">
  1690. <% accountGroup.forEach((group, idx) => { %>
  1691. <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>
  1692. <div class="dd-content" data-toggleid="<%- idx %>">
  1693. <% group.groupList.forEach(item => { %>
  1694. <% if (item.id !== ctx.tender.data.user_id) { %>
  1695. <dd class="border-bottom p-2 mb-0 " data-id="<%- item.id %>" >
  1696. <p class="mb-0 d-flex"><span class="text-primary"><%- item.name %></span><span
  1697. class="ml-auto"><%- item.mobile %></span></p>
  1698. <span class="text-muted"><%- item.role %></span>
  1699. </dd>
  1700. <% } %>
  1701. <% });%>
  1702. </div>
  1703. <% }) %>
  1704. </dl>
  1705. </div>
  1706. </div>
  1707. <div class="mt-1" style="max-height: 300px;overflow: auto">
  1708. <table class="table table-bordered">
  1709. <tr><th>用户</th><th>查看</th><th>修改</th><th>移除</th></tr>
  1710. <tbody id="schedule-users">
  1711. <% for (const sa of scheduleAuditList) { %>
  1712. <% const audit = ctx.helper._.find(accountList, { id : sa.audit_id }); %>
  1713. <% if (audit) { %>
  1714. <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>
  1715. <div class="custom-control custom-checkbox mb-2">
  1716. <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<% } %>>
  1717. <label class="custom-control-label" for="<%- sa.id %>_customRadio41"></label>
  1718. </div>
  1719. </td><td>
  1720. <div class="custom-control custom-checkbox mb-2">
  1721. <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<% } %>>
  1722. <label class="custom-control-label" for="<%- sa.id %>_customRadio42"></label>
  1723. </div>
  1724. </td>
  1725. <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="<%- sa.id %>">移除</a></td>
  1726. </tr>
  1727. <% } %>
  1728. <% } %>
  1729. </tbody>
  1730. </table>
  1731. </div>
  1732. </div>
  1733. <div class="modal-footer">
  1734. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">关闭</button>
  1735. </div>
  1736. </div>
  1737. </div>
  1738. </div>
  1739. <script>
  1740. $(function () {
  1741. const scPermission = JSON.parse(unescape('<%- escape(JSON.stringify(scPermission)) %>'));
  1742. // 形象进度
  1743. let timer = null;
  1744. let oldSearchVal = null;
  1745. $('body').on('input propertychange', '#xxjd_dropdownMenu .gr-search', function(e) {
  1746. oldSearchVal = e.target.value;
  1747. timer && clearTimeout(timer);
  1748. timer = setTimeout(() => {
  1749. const newVal = $(this).val();
  1750. let html = '';
  1751. if (newVal && newVal === oldSearchVal) {
  1752. accountList.filter(item => item && item.id !== cur_tender_uid && (item.name.indexOf(newVal) !== -1 || (item.mobile && item.mobile.indexOf(newVal) !== -1))).forEach(item => {
  1753. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1754. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1755. class="ml-auto">${item.mobile || ''}</span></p>
  1756. <span class="text-muted">${item.role || ''}</span>
  1757. </dd>`
  1758. });
  1759. $('#xxjd_dropdownMenu .book-list').empty();
  1760. $('#xxjd_dropdownMenu .book-list').append(html);
  1761. } else {
  1762. if (!$('#xxjd_dropdownMenu .acc-btn').length) {
  1763. accountGroup.forEach((group, idx) => {
  1764. if (!group) return;
  1765. html += `<dt><a href="javascript: void(0);" class="acc-btn" data-groupid="${idx}" data-type="hide"><i class="fa fa-plus-square"></i>
  1766. </a> ${group.groupName}</dt>
  1767. <div class="dd-content" data-toggleid="${idx}">`;
  1768. group.groupList.forEach(item => {
  1769. if (item.id !== cur_tender_uid) {
  1770. html += `<dd class="border-bottom p-2 mb-0 " data-id="${item.id}" >
  1771. <p class="mb-0 d-flex"><span class="text-primary">${item.name}</span><span
  1772. class="ml-auto">${item.mobile || ''}</span></p>
  1773. <span class="text-muted">${item.role || ''}</span>
  1774. </dd>`;
  1775. }
  1776. });
  1777. html += '</div>';
  1778. });
  1779. $('#xxjd_dropdownMenu .book-list').empty();
  1780. $('#xxjd_dropdownMenu .book-list').append(html);
  1781. }
  1782. }
  1783. }, 400);
  1784. });
  1785. // 添加审批流程按钮逻辑
  1786. $('body').on('click', '#xxjd_dropdownMenu .book-list dt', function () {
  1787. const idx = $(this).find('.acc-btn').attr('data-groupid');
  1788. const type = $(this).find('.acc-btn').attr('data-type');
  1789. if (type === 'hide') {
  1790. $(this).parent().find(`div[data-toggleid="${idx}"]`).show(() => {
  1791. $(this).children().find('i').removeClass('fa-plus-square').addClass('fa-minus-square-o');
  1792. $(this).find('.acc-btn').attr('data-type', 'show');
  1793. })
  1794. } else {
  1795. $(this).parent().find(`div[data-toggleid="${idx}"]`).hide(() => {
  1796. $(this).children().find('i').removeClass('fa-minus-square-o').addClass('fa-plus-square');
  1797. $(this).find('.acc-btn').attr('data-type', 'hide');
  1798. })
  1799. }
  1800. return false;
  1801. });
  1802. // 选中用户
  1803. $('body').on('click', '#xxjd_dropdownMenu dl dd', function () {
  1804. const id = parseInt($(this).data('id'));
  1805. if (id) {
  1806. const user = _.find(accountList, function (item) {
  1807. return item.id === id;
  1808. });
  1809. const saIdList = [];
  1810. for (let i = 0; i < $('#schedule-users tr').length; i++) {
  1811. saIdList.push(parseInt($('#schedule-users tr').eq(i).data('id')));
  1812. }
  1813. if (_.includes(saIdList, id)) {
  1814. toastr.error('该用户已存在列表中,无需重复添加');
  1815. return;
  1816. }
  1817. const prop = {
  1818. audit_id: id,
  1819. type: 'add',
  1820. };
  1821. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  1822. 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' +
  1823. ' <div class="custom-control custom-checkbox mb-2">\n' +
  1824. ' <input type="checkbox" data-zhi="'+ scPermission.show +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio41" name="customCheckbox" class="custom-control-input" checked>\n' +
  1825. ' <label class="custom-control-label" for="'+ data.id + '_customRadio41"></label>\n' +
  1826. ' </div>\n' +
  1827. ' </td><td>\n' +
  1828. ' <div class="custom-control custom-checkbox mb-2">\n' +
  1829. ' <input type="checkbox" data-zhi="'+ scPermission.edit +'" data-id="'+ data.id + '" id="'+ data.id + '_customRadio42" name="customCheckbox" class="custom-control-input">\n' +
  1830. ' <label class="custom-control-label" for="'+ data.id + '_customRadio42"></label>\n' +
  1831. ' </div>\n' +
  1832. ' </td>\n' +
  1833. ' <td><a href="javascript:void(0);" class="text-danger remove-schedule-user" data-id="'+ data.id + '">移除</a></td>\n' +
  1834. ' </tr>';
  1835. $('#schedule-users').append(html);
  1836. });
  1837. }
  1838. });
  1839. // 移除用户
  1840. $('body').on('click', '#schedule-users .remove-schedule-user', function () {
  1841. const id = parseInt($(this).data('id'));
  1842. if (id) {
  1843. const prop = {
  1844. id,
  1845. type: 'del',
  1846. };
  1847. const _self = $(this);
  1848. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  1849. _self.parents('tr').remove();
  1850. });
  1851. }
  1852. });
  1853. // 权限更改
  1854. $('body').on('click', '#schedule-users input[type="checkbox"]', function () {
  1855. let permission = scPermission.no;
  1856. const value = parseInt($(this).data('zhi'));
  1857. if ($(this).is(':checked')) {
  1858. if (value === scPermission.edit) {
  1859. permission = scPermission.edit;
  1860. $(this).parents('td').siblings().find('input').prop('checked', true);
  1861. } else if (value === scPermission.show) {
  1862. permission = scPermission.show;
  1863. }
  1864. } else {
  1865. if (value === scPermission.edit) {
  1866. permission = scPermission.show;
  1867. } else if (value === scPermission.show) {
  1868. permission = scPermission.no;
  1869. $(this).parents('td').siblings().find('input').prop('checked', false);
  1870. }
  1871. }
  1872. const id = parseInt($(this).data('id'));
  1873. const prop = {
  1874. id,
  1875. permission,
  1876. type: 'edit',
  1877. };
  1878. const _self = $(this);
  1879. postData('/tender/' + cur_tenderid + '/schedule/audit/save', prop, function (data) {
  1880. });
  1881. });
  1882. })
  1883. </script>
  1884. <% } %>