detail_modal.ejs 64 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272
  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. </ul>
  21. <div class="tab-content">
  22. <div class="tab-pane active" id="htxx">
  23. <div class="form-group">
  24. <div class="row">
  25. <div class="col-12 mb-2">
  26. <div class="input-group input-group-sm">
  27. <div class="input-group-prepend">
  28. <span class="input-group-text">建设项目名称</span>
  29. </div>
  30. <input type="text" class="form-control" value="项目A" id="build-name" maxlength="100">
  31. </div>
  32. </div>
  33. <div class="col-12 mb-2">
  34. <div class="input-group input-group-sm">
  35. <div class="input-group-prepend">
  36. <span class="input-group-text" style="width:90px">合同编号</span>
  37. </div>
  38. <input type="text" class="form-control" value="" id="deal-code" maxlength="100">
  39. </div>
  40. </div>
  41. <div class="col-12">
  42. <div class="input-group input-group-sm">
  43. <div class="input-group-prepend">
  44. <span class="input-group-text" style="width:90px">合同名称</span>
  45. </div>
  46. <input type="text" class="form-control" value="" id="deal-name" maxlength="100">
  47. </div>
  48. </div>
  49. </div>
  50. </div>
  51. </div>
  52. <div class="tab-pane" id="cjdw">
  53. <div class="form-group mb-4">
  54. <label>建设单位:</label>
  55. <div class="row">
  56. <div class="col-12 mb-2">
  57. <div class="input-group input-group-sm">
  58. <div class="input-group-prepend">
  59. <span class="input-group-text">单位名称</span>
  60. </div>
  61. <input type="text" class="form-control" value="" id="build-company" maxlength="100">
  62. </div>
  63. </div>
  64. <div class="col-6 pr-0">
  65. <div class="input-group input-group-sm">
  66. <div class="input-group-prepend">
  67. <span class="input-group-text">法人代表</span>
  68. </div>
  69. <input type="text" class="form-control" value="" id="build-corporation" maxlength="100">
  70. </div>
  71. </div>
  72. <div class="col-6">
  73. <div class="input-group input-group-sm">
  74. <div class="input-group-prepend">
  75. <span class="input-group-text">签订日期</span>
  76. </div>
  77. <input type="date" class="form-control" value="" id="build-date">
  78. </div>
  79. </div>
  80. </div>
  81. </div>
  82. <div class="form-group mb-4">
  83. <label>承包单位1:</label>
  84. <div class="row">
  85. <div class="col-12 mb-2">
  86. <div class="input-group input-group-sm">
  87. <div class="input-group-prepend">
  88. <span class="input-group-text">单位名称</span>
  89. </div>
  90. <input type="text" class="form-control" value="" id="contract1-company" maxlength="100">
  91. </div>
  92. </div>
  93. <div class="col-6 pr-0">
  94. <div class="input-group input-group-sm">
  95. <div class="input-group-prepend">
  96. <span class="input-group-text">法人代表</span>
  97. </div>
  98. <input type="text" class="form-control" value="" id="contract1-corporation" maxlength="100">
  99. </div>
  100. </div>
  101. <div class="col-6">
  102. <div class="input-group input-group-sm">
  103. <div class="input-group-prepend">
  104. <span class="input-group-text">签订日期</span>
  105. </div>
  106. <input type="date" class="form-control" value="" id="contract1-date">
  107. </div>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="form-group mb-4">
  112. <label>承包单位2:</label>
  113. <div class="row">
  114. <div class="col-12 mb-2">
  115. <div class="input-group input-group-sm">
  116. <div class="input-group-prepend">
  117. <span class="input-group-text">单位名称</span>
  118. </div>
  119. <input type="text" class="form-control" value="" id="contract2-company" maxlength="100">
  120. </div>
  121. </div>
  122. <div class="col-6 pr-0">
  123. <div class="input-group input-group-sm">
  124. <div class="input-group-prepend">
  125. <span class="input-group-text">法人代表</span>
  126. </div>
  127. <input type="text" class="form-control" value="" id="contract2-corporation" maxlength="100">
  128. </div>
  129. </div>
  130. <div class="col-6">
  131. <div class="input-group input-group-sm">
  132. <div class="input-group-prepend">
  133. <span class="input-group-text">签订日期</span>
  134. </div>
  135. <input type="date" class="form-control" value="" id="contract2-date">
  136. </div>
  137. </div>
  138. </div>
  139. </div>
  140. <div class="form-group mb-4">
  141. <label>监理单位1:</label>
  142. <div class="row">
  143. <div class="col-12 mb-2">
  144. <div class="input-group input-group-sm">
  145. <div class="input-group-prepend">
  146. <span class="input-group-text">单位名称</span>
  147. </div>
  148. <input type="text" class="form-control" value="" id="supervision1-company" maxlength="100">
  149. </div>
  150. </div>
  151. <div class="col-6 pr-0">
  152. <div class="input-group input-group-sm">
  153. <div class="input-group-prepend">
  154. <span class="input-group-text">法人代表</span>
  155. </div>
  156. <input type="text" class="form-control" value="" id="supervision1-corporation" maxlength="100">
  157. </div>
  158. </div>
  159. <div class="col-6">
  160. <div class="input-group input-group-sm">
  161. <div class="input-group-prepend">
  162. <span class="input-group-text">签订日期</span>
  163. </div>
  164. <input type="date" class="form-control" value="" id="supervision1-date">
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. <div class="form-group">
  170. <label>监理单位2:</label>
  171. <div class="row">
  172. <div class="col-12 mb-2">
  173. <div class="input-group input-group-sm">
  174. <div class="input-group-prepend">
  175. <span class="input-group-text">单位名称</span>
  176. </div>
  177. <input type="text" class="form-control" value="" id="supervision2-company" maxlength="100">
  178. </div>
  179. </div>
  180. <div class="col-6 pr-0">
  181. <div class="input-group input-group-sm">
  182. <div class="input-group-prepend">
  183. <span class="input-group-text">法人代表</span>
  184. </div>
  185. <input type="text" class="form-control" value="" id="supervision2-corporation" maxlength="100">
  186. </div>
  187. </div>
  188. <div class="col-6">
  189. <div class="input-group input-group-sm">
  190. <div class="input-group-prepend">
  191. <span class="input-group-text">签订日期</span>
  192. </div>
  193. <input type="date" class="form-control" value="" id="supervision2-date">
  194. </div>
  195. </div>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="tab-pane" id="jscs">
  200. <div class="form-group">
  201. <div class="row">
  202. <div class="col-6 pr-0 mb-2">
  203. <div class="input-group input-group-sm">
  204. <div class="input-group-prepend">
  205. <span class="input-group-text">公路等级</span>
  206. </div>
  207. <select class="form-control" id="load-level">
  208. <option>高速公路</option>
  209. <option>一级公路</option>
  210. <option>二级公路</option>
  211. <option>三级公路</option>
  212. <option>四级公路</option>
  213. </select>
  214. </div>
  215. </div>
  216. <div class="col-6">
  217. <div class="input-group input-group-sm">
  218. <div class="input-group-prepend">
  219. <span class="input-group-text" style="width:90px">长度(KM)</span>
  220. </div>
  221. <input type="text" class="form-control" value="" id="length" min="0" max="10000"
  222. oninput="limitDealParamLength(this)" onchange="checkNumberValid(this)">
  223. </div>
  224. </div>
  225. <div class="col-6 pr-0 mb-2">
  226. <div class="input-group input-group-sm">
  227. <div class="input-group-prepend">
  228. <span class="input-group-text">起始桩号</span>
  229. </div>
  230. <input type="text" class="form-control" value="" id="start-peg" maxlength="100">
  231. </div>
  232. </div>
  233. <div class="col-6">
  234. <div class="input-group input-group-sm">
  235. <div class="input-group-prepend">
  236. <span class="input-group-text" style="width:90px">终止桩号</span>
  237. </div>
  238. <input type="text" class="form-control" value="" id="end-peg" maxlength="100">
  239. </div>
  240. </div>
  241. <div class="col-6 pr-0 mb-2">
  242. <div class="input-group input-group-sm">
  243. <div class="input-group-prepend">
  244. <span class="input-group-text" style="width:66px">车道数</span>
  245. </div>
  246. <input type="text" class="form-control" value="" id="lane-count" maxlength="100">
  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">合同工期</span>
  253. </div>
  254. <input type="text" class="form-control" value="" id="deal-period" maxlength="100">
  255. </div>
  256. </div>
  257. <div class="col-6 pr-0 mb-2">
  258. <div class="input-group input-group-sm">
  259. <div class="input-group-prepend">
  260. <span class="input-group-text">开工日期</span>
  261. </div>
  262. <input type="date" class="form-control" value="" id="start-date">
  263. </div>
  264. </div>
  265. <div class="col-6">
  266. <div class="input-group input-group-sm">
  267. <div class="input-group-prepend">
  268. <span class="input-group-text">计划完工日期</span>
  269. </div>
  270. <input type="date" class="form-control" value="" id="plan-end-date">
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. </div>
  277. </div>
  278. </div>
  279. <div class="modal-footer">
  280. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  281. <button type="button" class="btn btn-sm btn-primary" onclick="post1();">确认修改</button>
  282. </div>
  283. </div>
  284. </div>
  285. </div>
  286. <% if (((tender.ledger_status === audit.ledger.status.uncheck || tender.ledger_status === audit.ledger.status.checkNo) && tender.user_id === ctx.session.sessionUser.accountId)
  287. || (lastStage && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck))) { %>
  288. <!--标段设置-小数位数-->
  289. <div class="modal fade" id="bd-set-2" data-backdrop="static">
  290. <div class="modal-dialog" role="document">
  291. <div class="modal-content">
  292. <div class="modal-header">
  293. <h5 class="modal-title">小数位数</h5>
  294. </div>
  295. <div class="modal-body">
  296. <div class="form-group">
  297. <label>全局设置</label>
  298. <div class="row">
  299. <div class="col-4">
  300. <div class="input-group input-group-sm">
  301. <div class="input-group-prepend">
  302. <span class="input-group-text">单价</span>
  303. </div>
  304. <input type="number" class="form-control" value="3" id="decimal-up"
  305. min="0" max="4" maxlength="1" oninput="limitDecimal(this)">
  306. </div>
  307. </div>
  308. <div class="col-4">
  309. <div class="input-group input-group-sm">
  310. <div class="input-group-prepend">
  311. <span class="input-group-text">金额</span>
  312. </div>
  313. <input type="number" class="form-control" value="2" id="decimal-tp"
  314. oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
  315. </div>
  316. </div>
  317. </div>
  318. </div>
  319. <div class="form-group">
  320. <label>单独设置</label>
  321. <div class="row">
  322. <div class="col-auto mt-1">
  323. <div class="form-group form-check pl-0">
  324. <div class="custom-control custom-switch">
  325. <input type="checkbox" class="custom-control-input" id="decimal-pay">
  326. <label class="custom-control-label" for="decimal-pay">合同支付</label>
  327. </div>
  328. </div>
  329. </div>
  330. <div class="col-4">
  331. <div class="input-group input-group-sm">
  332. <div class="input-group-prepend">
  333. <span class="input-group-text">金额</span>
  334. </div>
  335. <input type="number" class="form-control" value="2" id="decimal-pay-tp"
  336. oninput="limitDecimal(this)" min="0" max="4" maxlength="1">
  337. </div>
  338. </div>
  339. </div>
  340. </div>
  341. </div>
  342. <div class="modal-footer">
  343. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  344. <button type="button" class="btn btn-sm btn-primary" onclick="post2();">确认修改</button>
  345. </div>
  346. </div>
  347. </div>
  348. </div>
  349. <!--标段设置-清单精度-->
  350. <div class="modal fade" id="bd-set-3" data-backdrop="static">
  351. <div class="modal-dialog" role="document">
  352. <div class="modal-content">
  353. <div class="modal-header">
  354. <h5 class="modal-title">数量精度</h5>
  355. </div>
  356. <div class="modal-body">
  357. <div class="form-group" id="precision-spread" style="height: 397px; width: 465px;">
  358. </div>
  359. </div>
  360. <div class="modal-footer">
  361. <div id="hint-3" class="text-danger fa fa-exclamation-circle" style="display: none;"></div>
  362. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  363. <button type="button" class="btn btn-sm btn-primary" onclick="post3();">确认修改</button>
  364. </div>
  365. </div>
  366. </div>
  367. </div>
  368. <% } else { %>
  369. <!--标段设置-小数位数-->
  370. <div class="modal fade" id="bd-set-2" data-backdrop="static">
  371. <div class="modal-dialog" role="document">
  372. <div class="modal-content">
  373. <div class="modal-header">
  374. <h5 class="modal-title">小数位数</h5>
  375. </div>
  376. <div class="modal-body">
  377. <div class="form-group">
  378. <label>全局设置</label>
  379. <div class="row">
  380. <div class="col-4">
  381. <div class="input-group input-group-sm">
  382. <div class="input-group-prepend">
  383. <span class="input-group-text">单价</span>
  384. </div>
  385. <input type="number" class="form-control" value="3" id="decimal-up" readonly="">
  386. </div>
  387. </div>
  388. <div class="col-4">
  389. <div class="input-group input-group-sm">
  390. <div class="input-group-prepend">
  391. <span class="input-group-text">金额</span>
  392. </div>
  393. <input type="number" class="form-control" value="2" id="decimal-tp" readonly="">
  394. </div>
  395. </div>
  396. </div>
  397. </div>
  398. <div class="form-group">
  399. <label>单独设置</label>
  400. <div class="row">
  401. <div class="col-auto mt-1">
  402. <div class="form-group form-check pl-0">
  403. <div class="custom-control custom-switch">
  404. <input type="checkbox" class="custom-control-input" id="decimal-pay" readonly="">
  405. <label class="custom-control-label" for="decimal-pay">合同支付</label>
  406. </div>
  407. </div>
  408. </div>
  409. <div class="col-4">
  410. <div class="input-group input-group-sm">
  411. <div class="input-group-prepend">
  412. <span class="input-group-text">金额</span>
  413. </div>
  414. <input type="number" class="form-control" value="2" id="decimal-pay-tp" readonly="">
  415. </div>
  416. </div>
  417. </div>
  418. </div>
  419. </div>
  420. <div class="modal-footer">
  421. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  422. </div>
  423. </div>
  424. </div>
  425. </div>
  426. <!--标段设置-清单精度-->
  427. <div class="modal fade" id="bd-set-3" data-backdrop="static">
  428. <div class="modal-dialog" role="document">
  429. <div class="modal-content">
  430. <div class="modal-header">
  431. <h5 class="modal-title">数量精度</h5>
  432. </div>
  433. <div class="modal-body">
  434. <div class="sjs-option-height" id="precision-spread" style="height: 397px; width: 465px;">
  435. </div>
  436. </div>
  437. <div class="modal-footer">
  438. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  439. </div>
  440. </div>
  441. </div>
  442. </div>
  443. <% } %>
  444. <% if (!lastStage || (lastStage.order === 1 && lastStage.user_id === ctx.session.sessionUser.accountId && (lastStage.status === audit.stage.status.checkNo || lastStage.status === audit.stage.status.uncheck))) { %>
  445. <!--标段设置-合同参数-->
  446. <div class="modal fade" id="bd-set-4" data-backdrop="static">
  447. <div class="modal-dialog" role="document">
  448. <div class="modal-content">
  449. <div class="modal-header">
  450. <h5 class="modal-title">合同参数</h5>
  451. </div>
  452. <div class="modal-body">
  453. <div class="form-group">
  454. <!--默认显示-->
  455. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  456. </div>
  457. </div>
  458. </div>
  459. <div class="modal-footer">
  460. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  461. <button type="button" class="btn btn-sm btn-primary" onclick="post4()">确认修改</button>
  462. </div>
  463. </div>
  464. </div>
  465. </div>
  466. <% } else { %>
  467. <!--标段设置-合同参数-->
  468. <div class="modal fade" id="bd-set-4" data-backdrop="static">
  469. <div class="modal-dialog" role="document">
  470. <div class="modal-content">
  471. <div class="modal-header">
  472. <h5 class="modal-title">合同参数</h5>
  473. </div>
  474. <div class="modal-body">
  475. <div class="form-group">
  476. <!--默认显示-->
  477. <div class="form-group" id="param-spread" style="height: 230px; width: 465px;">
  478. </div>
  479. </div>
  480. </div>
  481. <div class="modal-footer">
  482. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">确定</button>
  483. </div>
  484. </div>
  485. </div>
  486. </div>
  487. <% } %>
  488. <!--标段设置-显示设置-->
  489. <div class="modal fade" id="bd-set-5" data-backdrop="static">
  490. <div class="modal-dialog" role="document">
  491. <div class="modal-content">
  492. <div class="modal-header">
  493. <h5 class="modal-title">显示设置</h5>
  494. </div>
  495. <div class="modal-body">
  496. <div class="form-group">
  497. <div class="custom-control custom-checkbox mb-2">
  498. <input type="checkbox" class="form-check-input" id="ledger-dgn-qty" checked="">
  499. <label class="form-check-label" for="ledger-dgn-qty">项目节数量</label>
  500. </div>
  501. <div class="custom-control custom-checkbox mb-2">
  502. <input type="checkbox" class="form-check-input" id="ledger-cl-qty" checked="">
  503. <label class="form-check-label" for="ledger-cl-qty">错漏增减</label>
  504. </div>
  505. <div class="custom-control custom-checkbox mb-2">
  506. <input type="checkbox" class="form-check-input" id="thousandth" checked="">
  507. <label class="form-check-label" for="thousandth">千分位</label>
  508. </div>
  509. <div class="custom-control custom-checkbox mb-2">
  510. <input type="checkbox" class="form-check-input" id="stage-rc" checked="">
  511. <label class="form-check-label" for="stage-rc">实际完成量</label>
  512. </div>
  513. </div>
  514. </div>
  515. <div class="modal-footer">
  516. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  517. <button type="button" class="btn btn-sm btn-primary" onclick="post5()">确认修改</button>
  518. </div>
  519. </div>
  520. </div>
  521. </div>
  522. <!--标段设置-章节设置-->
  523. <div class="modal fade" id="bd-set-6" data-backdrop="static">
  524. <div class="modal-dialog" role="document">
  525. <div class="modal-content">
  526. <div class="modal-header">
  527. <h5 class="modal-title">章节设置</h5>
  528. </div>
  529. <div class="modal-body">
  530. <div class="form-group" id="chapter-spread" style="height: 330px; width: 465px;">
  531. </div>
  532. </div>
  533. <div class="modal-footer">
  534. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  535. <button type="button" class="btn btn-sm btn-primary" onclick="post6()">确认修改</button>
  536. </div>
  537. </div>
  538. </div>
  539. </div>
  540. <!--标段设置-付款账号-->
  541. <div class="modal fade" id="bd-set-7" data-backdrop="static">
  542. <div class="modal-dialog" role="document">
  543. <div class="modal-content">
  544. <div class="modal-header">
  545. <h5 class="modal-title">付款账号</h5>
  546. </div>
  547. <div class="modal-body">
  548. <div class="sjs-option-height">
  549. <table class="table table-bordered">
  550. <tr><th colspan="2" class="text-center">工程款账户</th></tr>
  551. <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm"></td></tr>
  552. <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm"></td></tr>
  553. <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm"></td></tr>
  554. <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm"></td></tr>
  555. <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm"></td></tr>
  556. <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm"></td></tr>
  557. <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
  558. <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm"></td></tr>
  559. <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm"></td></tr>
  560. <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm"></td></tr>
  561. <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm"></td></tr>
  562. <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm"></td></tr>
  563. <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm"></td></tr>
  564. </table>
  565. </div>
  566. </div>
  567. <div class="modal-footer">
  568. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  569. <button type="button" class="btn btn-sm btn-primary" onclick="post7()" >确认修改</button>
  570. </div>
  571. </div>
  572. </div>
  573. </div>
  574. <script>
  575. let property = JSON.parse('<%- JSON.stringify(tenderInfo) %>');
  576. let ledgerChecked = <%- tender.ldeger_status === audit.ledger.status.checked %>;
  577. let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
  578. // 根据Min Max限制Input输入
  579. function limitInputMinMax (obj) {
  580. if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
  581. obj.value = obj.max;
  582. }
  583. if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
  584. obj.value = obj.min;
  585. }
  586. }
  587. // 根据Maxlength限制input输入
  588. function limitMaxLength (obj) {
  589. if (obj.value.length > obj.maxLength) {
  590. obj.value = obj.value.substr(0, obj.maxLength);
  591. }
  592. }
  593. // 根据正则限制输入
  594. function limitReg(obj, reg) {
  595. obj.value = obj.value.replace(reg, '');
  596. }
  597. // 小数位数 input 输入限制
  598. function limitDecimal(obj) {
  599. limitReg(obj, /[^\d]/g);
  600. limitMaxLength(obj);
  601. limitInputMinMax(obj);
  602. }
  603. function limitDealParamLength(obj) {
  604. limitReg(obj, /[^\d\.]/g); // 过滤数字和.
  605. limitReg(obj, /\.{2,}/g); // 过滤第二个.
  606. limitInputMinMax(obj);
  607. }
  608. function checkNumberValid(obj) {
  609. const value = _.toNumber(obj.value);
  610. obj.value = value ? value : '';
  611. }
  612. // 属性
  613. function loadCommonProperty () {
  614. // 合同信息
  615. $('#build-name').val(property.deal_info.buildName);
  616. $('#deal-code').val(property.deal_info.dealCode);
  617. $('#deal-name').val(property.deal_info.dealName);
  618. // 参建单位
  619. // 建设单位
  620. $('#build-company').val(property.construction_unit.build.company);
  621. $('#build-corporation').val(property.construction_unit.build.corporation);
  622. $('#build-date').val(property.construction_unit.build.date);
  623. // 承包单位1
  624. $('#contract1-company').val(property.construction_unit.contract1.company);
  625. $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
  626. $('#contract1-date').val(property.construction_unit.contract1.date);
  627. // 承包单位2
  628. $('#contract2-company').val(property.construction_unit.contract2.company);
  629. $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
  630. $('#contract2-date').val(property.construction_unit.contract2.date);
  631. // 监理单位1
  632. $('#supervision1-company').val(property.construction_unit.supervision1.company);
  633. $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
  634. $('#supervision1-date').val(property.construction_unit.supervision1.date);
  635. // 监理单位2
  636. $('#supervision2-company').val(property.construction_unit.supervision2.company);
  637. $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
  638. $('#supervision2-date').val(property.construction_unit.supervision2.date);
  639. // 技术参数
  640. $('#load-level').find("option:contains('" + property.tech_param.loadLevel + "')").attr("selected",true);;
  641. $('#length').val(property.tech_param.loadLength);
  642. $('#start-peg').val(property.tech_param.startPeg);
  643. $('#end-peg').val(property.tech_param.endPeg);
  644. $('#lane-count').val(property.tech_param.laneCount);
  645. $('#deal-period').val(property.tech_param.dealPeriod);
  646. $('#start-date').val(property.tech_param.startDate);
  647. $('#plan-end-date').val(property.tech_param.planEndDate);
  648. }
  649. $('#bd-set-1').on('show.bs.modal', function () {
  650. loadCommonProperty();
  651. })
  652. function post1 () {
  653. const prop = {
  654. deal_info: {
  655. buildName: $('#build-name').val(),
  656. dealCode: $('#deal-code').val(),
  657. dealName: $('#deal-name').val(),
  658. },
  659. construction_unit: {
  660. build: {
  661. company: $('#build-company').val(),
  662. corporation: $('#build-corporation').val(),
  663. date: $('#build-date').val(),
  664. },
  665. contract1: {
  666. company: $('#contract1-company').val(),
  667. corporation: $('#contract1-corporation').val(),
  668. date: $('#contract1-date').val(),
  669. },
  670. contract2: {
  671. company: $('#contract2-company').val(),
  672. corporation: $('#contract2-corporation').val(),
  673. date: $('#contract2-date').val(),
  674. },
  675. supervision1: {
  676. company: $('#supervision1-company').val(),
  677. corporation: $('#supervision1-corporation').val(),
  678. date: $('#supervision1-date').val(),
  679. },
  680. supervision2: {
  681. company: $('#supervision2-company').val(),
  682. corporation: $('#supervision2-corporation').val(),
  683. date: $('#supervision2-date').val(),
  684. },
  685. },
  686. tech_param: {
  687. loadLevel: $('#load-level').find("option:selected").text(),
  688. loadLength: _.toNumber($('#length').val()),
  689. startPeg: $('#start-peg').val(),
  690. endPeg: $('#end-peg').val(),
  691. laneCount: _.toNumber($('#lane-count').val()),
  692. dealPeriod: $('#deal-period').val(),
  693. startDate: $('#start-date').val(),
  694. planEndDate: $('#plan-end-date').val(),
  695. }
  696. };
  697. const tenderId = window.location.pathname.split('/')[2];
  698. postData('/tender/' + tenderId + '/save', prop, function (data) {
  699. property.deal_info = data.deal_info;
  700. property.construction_unit = data.construction_unit;
  701. property.tech_param = data.tech_param;
  702. $('#bd-set-1').modal('hide');
  703. });
  704. }
  705. // 小数位数
  706. function loadCalculateProperty () {
  707. $('#decimal-up').val(property.decimal.up);
  708. $('#decimal-tp').val(property.decimal.tp);
  709. $('#decimal-pay')[0].checked = property.decimal.pay;
  710. $('#decimal-pay-tp').val(property.decimal.payTp);
  711. }
  712. $('#bd-set-2').on('show.bs.modal', function () {
  713. loadCalculateProperty();
  714. });
  715. function post2() {
  716. const prop = {
  717. decimal: {
  718. up: _.toNumber($('#decimal-up').val()),
  719. tp: _.toNumber($('#decimal-tp').val()),
  720. pay: $('#decimal-pay')[0].checked,
  721. payTp: _.toNumber($('#decimal-pay-tp').val()),
  722. }
  723. };
  724. if (ledgerChecked) {
  725. if (prop.decimal.up < property.decimal.up) {
  726. toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
  727. return;
  728. }
  729. if (prop.decimal.tp < property.decimal.tp) {
  730. toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
  731. return;
  732. }
  733. }
  734. if (firstStageChecked) {
  735. if (property.decimal.pay) {
  736. if (!prop.decimal.pay) {
  737. toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
  738. return;
  739. }
  740. if (prop.decimal.payTp < property.decimal.payTp) {
  741. toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
  742. return;
  743. }
  744. } else {
  745. if (prop.decimal.pay) {
  746. toastr.warning('第一期已审批完成,合同支付不可单独设置');
  747. return;
  748. }
  749. }
  750. }
  751. const tenderId = window.location.pathname.split('/')[2];
  752. postData('/tender/' + tenderId + '/save', prop, function (data) {
  753. property.decimal = data.decimal;
  754. $('#bd-set-2').modal('hide');
  755. }, null, true);
  756. }
  757. // 清单精度
  758. const precisionObj = (function () {
  759. const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
  760. spread.options.showVerticalScrollbar = false;
  761. spread.options.showHorizontalScrollbar = false;
  762. const sheet = spread.getActiveSheet();
  763. SpreadJsObj.protectedSheet(sheet);
  764. sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
  765. sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
  766. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  767. const vStyle = new spreadNS.Style();
  768. vStyle.font = '12px 微软雅黑';
  769. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  770. const xStyle = new spreadNS.Style();
  771. xStyle.font = '12px 微软雅黑';
  772. xStyle.vAlign = 1;
  773. xStyle.hAlign = 1;
  774. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  775. const yStyle = new spreadNS.Style();
  776. yStyle.font = '12px 微软雅黑';
  777. yStyle.vAlign = 1;
  778. yStyle.hAlign = 1;
  779. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  780. SpreadJsObj.massOperationSheet(sheet, function () {
  781. sheet.defaults.rowHeight = 21;
  782. sheet.setColumnCount(2);
  783. sheet.setRowCount(13);
  784. sheet.setColumnWidth(0, 100);
  785. sheet.setColumnWidth(1, 60);
  786. sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  787. sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2).locked(false);
  788. sheet.setText(0, 0, 't');
  789. sheet.setText(1, 0, 'km');
  790. sheet.setText(2, 0, 'm');
  791. sheet.setText(3, 0, 'm2');
  792. sheet.setText(4, 0, 'm3');
  793. sheet.setText(5, 0, 'kg');
  794. sheet.setText(6, 0, '个');
  795. sheet.setText(7, 0, '台');
  796. sheet.setText(8, 0, '套');
  797. sheet.setText(9, 0, '棵');
  798. sheet.setText(10, 0, '组');
  799. sheet.setText(11, 0, '系统');
  800. sheet.setText(12, 0, '其他未列单位');
  801. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  802. sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
  803. sheet.getRange(0, 0, 13, 2).formatter('@');
  804. sheet.setSelection(0, 1, 1, 1);
  805. });
  806. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  807. const value = _.toNumber(info.editingText);
  808. if (!_.isInteger(value)) {
  809. toastr.warning('请输入0-6的整数');
  810. sheet.setText(info.row, info.col, '0');
  811. } else if (value > 6) {
  812. toastr.warning('请输入0-6的整数');
  813. sheet.setText(info.row, info.col, '6');
  814. } else if (value < 0) {
  815. toastr.warning('请输入0-6的整数');
  816. sheet.setText(info.row, info.col, '0');
  817. }
  818. });
  819. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  820. const sel = sheet.getSelections()[0];
  821. if (sel) {
  822. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  823. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  824. if (iCol !== 1) continue;
  825. sheet.setText(iRow, iCol, '0');
  826. }
  827. }
  828. }
  829. });
  830. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  831. let bHint = false;
  832. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  833. const curRow = info.cellRange.row + iRow;
  834. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  835. const curCol = info.cellRange.col + iCol;
  836. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  837. if (_.isNaN(value) || !_.isInteger(value)) {
  838. bHint = true;
  839. info.sheet.setText(curRow, curCol, '0');
  840. } else if (value > 6) {
  841. bHint = true;
  842. info.sheet.setText(curRow, curCol, '6');
  843. } else if (value < 0) {
  844. bHint = true;
  845. info.sheet.setText(curRow, curCol, '0');
  846. }
  847. }
  848. }
  849. if (bHint) {
  850. toastr.warning('请输入0-6的整数');
  851. }
  852. });
  853. function loadPrecisonProperty() {
  854. $('#hint-3').hide();
  855. sheet.setValue(0, 1, property.precision.t.value);
  856. sheet.setValue(1, 1, property.precision.km.value);
  857. sheet.setValue(2, 1, property.precision.m.value);
  858. sheet.setValue(3, 1, property.precision.m2.value);
  859. sheet.setValue(4, 1, property.precision.m3.value);
  860. sheet.setValue(5, 1, property.precision.kg.value);
  861. sheet.setValue(6, 1, property.precision.ge.value);
  862. sheet.setValue(7, 1, property.precision.tai.value);
  863. sheet.setValue(8, 1, property.precision.tao.value);
  864. sheet.setValue(9, 1, property.precision.ke.value);
  865. sheet.setValue(10, 1, property.precision.zu.value);
  866. sheet.setValue(11, 1, property.precision.xitong.value);
  867. sheet.setValue(12, 1, property.precision.other.value);
  868. }
  869. function setReadOnly(readOnly) {
  870. sheet.getRange(0, 1, 13, 1).locked(readOnly);
  871. }
  872. function getNewPrecisionData() {
  873. const precision = JSON.parse(JSON.stringify(property.precision));
  874. precision.t.value = _.toNumber(sheet.getText(0, 1));
  875. precision.km.value = _.toNumber(sheet.getText(1, 1));
  876. precision.m.value = _.toNumber(sheet.getText(2, 1));
  877. precision.m2.value = _.toNumber(sheet.getText(3, 1));
  878. precision.m3.value = _.toNumber(sheet.getText(4, 1));
  879. precision.kg.value = _.toNumber(sheet.getText(5, 1));
  880. precision.ge.value = _.toNumber(sheet.getText(6, 1));
  881. precision.tai.value = _.toNumber(sheet.getText(7, 1));
  882. precision.tao.value = _.toNumber(sheet.getText(8, 1));
  883. precision.ke.value = _.toNumber(sheet.getText(9, 1));
  884. precision.zu.value = _.toNumber(sheet.getText(10, 1));
  885. precision.xitong.value = _.toNumber(sheet.getText(11, 1));
  886. precision.other.value = _.toNumber(sheet.getText(12, 1));
  887. return precision;
  888. }
  889. function checkPrecisionMinLimit(precision, limit) {
  890. for (const unit of precision) {
  891. if (precision[unit].value < limit[unit].value) {
  892. if (precision[unit].unit) {
  893. toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
  894. } else {
  895. toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
  896. }
  897. return false;
  898. }
  899. }
  900. return true;
  901. };
  902. return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
  903. })();
  904. $('#bd-set-3').on('show.bs.modal', function () {
  905. <% if (((tender.ledger_status !== audit.ledger.status.uncheck && tender.ledger_status !== audit.ledger.status.checkNo) || tender.user_id !== ctx.session.sessionUser.accountId)
  906. && (!lastStage || lastStage.user_id !== ctx.session.sessionUser.accountId || (lastStage.status !== audit.stage.status.checkNo || lastStage.status !== audit.stage.status.uncheck))) { %>
  907. precisionObj.setReadOnly(true);
  908. <% } %>
  909. precisionObj.loadPrecisonProperty();
  910. });
  911. function post3 () {
  912. const prop = { precision: precisionObj.getNewPrecisionData() };
  913. if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
  914. const tenderId = window.location.pathname.split('/')[2];
  915. postData('/tender/' + tenderId + '/save', prop, function (data) {
  916. property.precision = data.precision;
  917. $('#bd-set-3').modal('hide');
  918. }, null, true);
  919. }
  920. // 合同参数
  921. const dealObj = (function () {
  922. const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
  923. spread.options.showVerticalScrollbar = false;
  924. spread.options.showHorizontalScrollbar = false;
  925. const sheet = spread.getActiveSheet();
  926. SpreadJsObj.protectedSheet(sheet);
  927. sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
  928. sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
  929. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  930. const vStyle = new spreadNS.Style();
  931. vStyle.font = '12px 微软雅黑';
  932. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  933. const xStyle = new spreadNS.Style();
  934. xStyle.font = '12px 微软雅黑';
  935. xStyle.vAlign = 1;
  936. xStyle.hAlign = 1;
  937. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  938. const yStyle = new spreadNS.Style();
  939. yStyle.font = '12px 微软雅黑';
  940. yStyle.vAlign = 1;
  941. yStyle.hAlign = 1;
  942. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  943. SpreadJsObj.massOperationSheet(sheet, function () {
  944. sheet.defaults.rowHeight = 21;
  945. sheet.setColumnCount(2);
  946. sheet.setRowCount(5);
  947. sheet.setColumnWidth(0, 200);
  948. sheet.setColumnWidth(1, 200);
  949. sheet.getRange(0, 0, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  950. sheet.getRange(0, 1, 5, 1).vAlign(1).hAlign(2).locked(false);
  951. sheet.setText(0, 0, '签约合同价');
  952. sheet.setText(1, 0, '暂列金额');
  953. sheet.setText(2, 0, '签约合同价(不含暂列金)');
  954. sheet.setText(3, 0, '签约开工预付款');
  955. sheet.setText(4, 0, '签约材料预付款');
  956. sheet.getCell(2, 1).locked(true);
  957. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  958. sheet.getRange(0, 0, 5, 2).setBorder(lineBorder, {all: true});
  959. sheet.getRange(0, 0, 5, 2).formatter('@');
  960. sheet.setSelection(0, 1, 1, 1);
  961. });
  962. function calcHtjMinusZlj() {
  963. const htj = _.toNumber(sheet.getText(0, 1));
  964. const zlj = _.toNumber(sheet.getText(1, 1));
  965. sheet.setValue(2, 1, ZhCalc.sub(htj, zlj));
  966. }
  967. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  968. const value = _.toNumber(info.editingText);
  969. if (_.isNaN(value)) {
  970. toastr.warning('请输入不超过万亿的数字');
  971. info.sheet.setText(info.row, info.col, '0');
  972. } else if (value > Math.pow(10, 13)) {
  973. toastr.warning('请输入不超过万亿的数字');
  974. info.sheet.setText(info.row, info.col, '0');
  975. }
  976. if (info.row === 0 || info.row === 1) {
  977. calcHtjMinusZlj();
  978. }
  979. });
  980. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  981. const sel = sheet.getSelections()[0];
  982. let calc = false;
  983. if (sel) {
  984. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  985. if (iRow === 2) continue;
  986. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  987. if (iCol !== 1) continue;
  988. sheet.setText(iRow, iCol, '0');
  989. if (iRow === 0 || iRow === 1) calc = true;
  990. }
  991. }
  992. }
  993. if (calc) calcHtjMinusZlj();
  994. });
  995. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  996. let bHint = false;
  997. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  998. const curRow = info.cellRange.row + iRow;
  999. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  1000. const curCol = info.cellRange.col + iCol;
  1001. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  1002. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  1003. bHint = true;
  1004. info.sheet.setText(curRow, curCol, '0');
  1005. }
  1006. }
  1007. }
  1008. if (bHint) {
  1009. toastr.warning('请输入不超过万亿的数字');
  1010. }
  1011. calcHtjMinusZlj();
  1012. });
  1013. function loadDealProperty() {
  1014. sheet.setValue(0, 1, property.deal_param.contractPrice);
  1015. sheet.setValue(1, 1, property.deal_param.zanLiePrice);
  1016. sheet.setValue(2, 1, ZhCalc.sub(property.deal_param.contractPrice, property.deal_param.zanLiePrice));
  1017. sheet.setValue(3, 1, property.deal_param.startAdvance);
  1018. sheet.setValue(4, 1, property.deal_param.materialAdvance);
  1019. }
  1020. function setReadOnly (readOnly) {
  1021. sheet.getCell(0, 1).locked(readOnly);
  1022. sheet.getCell(1, 1).locked(readOnly);
  1023. sheet.getCell(3, 1).locked(readOnly);
  1024. sheet.getCell(4, 1).locked(readOnly);
  1025. }
  1026. function getNewDealData () {
  1027. const result = {};
  1028. result.contractPrice = _.toNumber(sheet.getText(0, 1));
  1029. result.zanLiePrice = _.toNumber(sheet.getText(1, 1));
  1030. result.startAdvance = _.toNumber(sheet.getText(3, 1));
  1031. result.materialAdvance = _.toNumber(sheet.getText(4, 1));
  1032. return result;
  1033. }
  1034. return { loadDealProperty, setReadOnly, getNewDealData, };
  1035. })();
  1036. $('#bd-set-4').on('show.bs.modal', function () {
  1037. dealObj.loadDealProperty();
  1038. <% 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)))) { %>
  1039. dealObj.setReadOnly(true);
  1040. <% } %>
  1041. });
  1042. function post4 () {
  1043. if (firstStageChecked) return;
  1044. const prop = { deal_param: dealObj.getNewDealData() };
  1045. const tenderId = window.location.pathname.split('/')[2];
  1046. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1047. property.deal_param = data.deal_param;
  1048. $('#bd-set-4').modal('hide');
  1049. window.location.reload();
  1050. });
  1051. }
  1052. // 显示设置
  1053. function loadDisplayProperty () {
  1054. $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
  1055. $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
  1056. $('#thousandth')[0].checked = property.display.thousandth;
  1057. $('#stage-rc')[0].checked = property.display.stage.realComplete;
  1058. }
  1059. $('#bd-set-5').on('show.bs.modal', function () {
  1060. loadDisplayProperty();
  1061. });
  1062. function post5 () {
  1063. const prop = {
  1064. display: {
  1065. ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
  1066. thousandth: $('#thousandth')[0].checked,
  1067. stage: { realComplete: $('#stage-rc')[0].checked, },
  1068. },
  1069. };
  1070. const tenderId = window.location.pathname.split('/')[2];
  1071. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1072. property.display = data.display;
  1073. $('#bd-set-5').modal('hide');
  1074. });
  1075. }
  1076. // 章节设置
  1077. const chapterObj = (function () {
  1078. const spreadSetting = {
  1079. cols: [
  1080. {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
  1081. {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
  1082. ],
  1083. emptyRows: 0,
  1084. headRows: 1,
  1085. headRowHeight: [32],
  1086. defaultRowHeight: 21,
  1087. headerFont: '12px 微软雅黑',
  1088. font: '12px 微软雅黑',
  1089. };
  1090. const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
  1091. spread.options.showVerticalScrollbar = false;
  1092. spread.options.showHorizontalScrollbar = false;
  1093. SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
  1094. function checkSheetData(sheet) {
  1095. let hint = '';
  1096. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1097. const cell = sheet.getCell(iRow, 1);
  1098. const defaultStype = sheet.getDefaultStyle();
  1099. if (cell.text().length > 50) {
  1100. cell.backColor('#f8d7da');
  1101. hint = '章节名称的长度超出范围,请重新输入';
  1102. } else {
  1103. cell.backColor(defaultStype.backColor);
  1104. }
  1105. }
  1106. if (hint === '') {
  1107. $('#hint-6').hide();
  1108. } else {
  1109. $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
  1110. }
  1111. }
  1112. spread.bind(spreadNS.Events.EditEnding, function (e, info) {
  1113. checkSheetData(info.sheet);
  1114. });
  1115. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1116. checkSheetData(info.sheet);
  1117. });
  1118. function loadChapterProperty() {
  1119. SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
  1120. $('#hint-6').hide();
  1121. const sheet = spread.getActiveSheet();
  1122. const defaultStype = sheet.getDefaultStyle();
  1123. sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
  1124. }
  1125. function setReadOnly(readOnly) {
  1126. SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
  1127. }
  1128. function getNewChapterData() {
  1129. const result = [];
  1130. const sheet = spread.getActiveSheet();
  1131. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1132. const data = {};
  1133. for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
  1134. const col = spreadSetting.cols[iCol];
  1135. data[col.field] = sheet.getText(iRow, iCol);
  1136. if (col.field === 'name') {
  1137. if (data.name.length > 50) {
  1138. return null;
  1139. }
  1140. }
  1141. }
  1142. result.push(data);
  1143. }
  1144. return result;
  1145. }
  1146. return { loadChapterProperty, setReadOnly, getNewChapterData, }
  1147. })();
  1148. $('#bd-set-6').on('show.bs.modal', function () {
  1149. chapterObj.loadChapterProperty();
  1150. chapterObj.setReadOnly(false);
  1151. });
  1152. function post6 () {
  1153. const chapter = chapterObj.getNewChapterData();
  1154. if (!chapter) { return; }
  1155. const tenderId = window.location.pathname.split('/')[2];
  1156. postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
  1157. property.chapter = data.chapter;
  1158. $('#bd-set-6').modal('hide');
  1159. });
  1160. }
  1161. // 属性
  1162. function loadPayProperty () {
  1163. // 付款账号
  1164. $('#project-name').val(property.pay_account.project.name);
  1165. $('#project-bank').val(property.pay_account.project.bank);
  1166. $('#project-account').val(property.pay_account.project.account);
  1167. $('#project-rate').val(property.pay_account.project.rate);
  1168. $('#project-contact').val(property.pay_account.project.contact);
  1169. $('#project-phone').val(property.pay_account.project.phone);
  1170. $('#worker-name').val(property.pay_account.worker.name);
  1171. $('#worker-bank').val(property.pay_account.worker.bank);
  1172. $('#worker-account').val(property.pay_account.worker.account);
  1173. $('#worker-rate').val(property.pay_account.worker.rate);
  1174. $('#worker-contact').val(property.pay_account.worker.contact);
  1175. $('#worker-phone').val(property.pay_account.worker.phone);
  1176. }
  1177. $('#bd-set-7').on('show.bs.modal', function () {
  1178. loadPayProperty();
  1179. })
  1180. function post7 () {
  1181. let flag = false;
  1182. const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
  1183. const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
  1184. const project_rate = $('#project-rate').val();
  1185. if (!rate_reg.test(project_rate) && project_rate !== '') {
  1186. toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
  1187. flag = true;
  1188. }
  1189. const project_phone = $('#project-phone').val();
  1190. if (!phone_reg.test(project_phone) && project_phone !== '') {
  1191. toastr.error('工程款账户联系电话格式有误');
  1192. flag = true;
  1193. }
  1194. const worker_rate = $('#worker-rate').val();
  1195. if (!rate_reg.test(worker_rate) && worker_rate !== '') {
  1196. toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
  1197. flag = true;
  1198. }
  1199. const worker_phone = $('#worker-phone').val();
  1200. if (!phone_reg.test(worker_phone) && worker_phone !== '') {
  1201. toastr.error('农民工工资专用账户联系电话格式有误');
  1202. flag = true;
  1203. }
  1204. if (flag) {
  1205. return false;
  1206. }
  1207. const prop = {
  1208. pay_account: {
  1209. project: {
  1210. name: $('#project-name').val(),
  1211. bank: $('#project-bank').val(),
  1212. account: $('#project-account').val(),
  1213. rate: $('#project-rate').val(),
  1214. contact: $('#project-contact').val(),
  1215. phone: $('#project-phone').val(),
  1216. },
  1217. worker: {
  1218. name: $('#worker-name').val(),
  1219. bank: $('#worker-bank').val(),
  1220. account: $('#worker-account').val(),
  1221. rate: $('#worker-rate').val(),
  1222. contact: $('#worker-contact').val(),
  1223. phone: $('#worker-phone').val(),
  1224. },
  1225. },
  1226. };
  1227. const tenderId = window.location.pathname.split('/')[2];
  1228. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1229. property.pay_account = data.pay_account;
  1230. $('#bd-set-7').modal('hide');
  1231. });
  1232. }
  1233. </script>