detail_modal.ejs 63 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260
  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">
  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>
  506. </div>
  507. <div class="modal-footer">
  508. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  509. <button type="button" class="btn btn-sm btn-primary" onclick="post5()">确认修改</button>
  510. </div>
  511. </div>
  512. </div>
  513. </div>
  514. <!--标段设置-章节设置-->
  515. <div class="modal fade" id="bd-set-6" data-backdrop="static">
  516. <div class="modal-dialog" role="document">
  517. <div class="modal-content">
  518. <div class="modal-header">
  519. <h5 class="modal-title">章节设置</h5>
  520. </div>
  521. <div class="modal-body">
  522. <div class="form-group" id="chapter-spread" style="height: 330px; width: 465px;">
  523. </div>
  524. </div>
  525. <div class="modal-footer">
  526. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  527. <button type="button" class="btn btn-sm btn-primary" onclick="post6()">确认修改</button>
  528. </div>
  529. </div>
  530. </div>
  531. </div>
  532. <!--标段设置-付款账号-->
  533. <div class="modal fade" id="bd-set-7" data-backdrop="static">
  534. <div class="modal-dialog" role="document">
  535. <div class="modal-content">
  536. <div class="modal-header">
  537. <h5 class="modal-title">付款账号</h5>
  538. </div>
  539. <div class="modal-body">
  540. <div class="sjs-option-height">
  541. <table class="table table-bordered">
  542. <tr><th colspan="2" class="text-center">工程款账户</th></tr>
  543. <tr><td>开户名称</td><td><input type="text" id="project-name" class="form-control form-control-sm"></td></tr>
  544. <tr><td>开户银行</td><td><input type="text" id="project-bank" class="form-control form-control-sm"></td></tr>
  545. <tr><td>开户账号</td><td><input type="text" id="project-account" class="form-control form-control-sm"></td></tr>
  546. <tr><td>分账划拨比例(%)</td><td><input type="text" id="project-rate" class="form-control form-control-sm"></td></tr>
  547. <tr><td>联系人</td><td><input type="text" id="project-contact" class="form-control form-control-sm"></td></tr>
  548. <tr><td>联系电话</td><td><input type="text" id="project-phone" class="form-control form-control-sm"></td></tr>
  549. <tr><th colspan="2" class="text-center">农民工工资专用账户</th></tr>
  550. <tr><td>开户名称</td><td><input type="text" id="worker-name" class="form-control form-control-sm"></td></tr>
  551. <tr><td>开户银行</td><td><input type="text" id="worker-bank" class="form-control form-control-sm"></td></tr>
  552. <tr><td>开户账号</td><td><input type="text" id="worker-account" class="form-control form-control-sm"></td></tr>
  553. <tr><td>分账划拨比例(%)</td><td><input type="text" id="worker-rate" class="form-control form-control-sm"></td></tr>
  554. <tr><td>联系人</td><td><input type="text" id="worker-contact" class="form-control form-control-sm"></td></tr>
  555. <tr><td>联系电话</td><td><input type="text" id="worker-phone" class="form-control form-control-sm"></td></tr>
  556. </table>
  557. </div>
  558. </div>
  559. <div class="modal-footer">
  560. <button type="button" class="btn btn-sm btn-secondary" data-dismiss="modal">取消</button>
  561. <button type="button" class="btn btn-sm btn-primary" onclick="post7()" >确认修改</button>
  562. </div>
  563. </div>
  564. </div>
  565. </div>
  566. <script>
  567. let property = JSON.parse('<%- JSON.stringify(tenderInfo) %>');
  568. let ledgerChecked = <%- tender.ldeger_status === audit.ledger.status.checked %>;
  569. let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
  570. // 根据Min Max限制Input输入
  571. function limitInputMinMax (obj) {
  572. if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
  573. obj.value = obj.max;
  574. }
  575. if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
  576. obj.value = obj.min;
  577. }
  578. }
  579. // 根据Maxlength限制input输入
  580. function limitMaxLength (obj) {
  581. if (obj.value.length > obj.maxLength) {
  582. obj.value = obj.value.substr(0, obj.maxLength);
  583. }
  584. }
  585. // 根据正则限制输入
  586. function limitReg(obj, reg) {
  587. obj.value = obj.value.replace(reg, '');
  588. }
  589. // 小数位数 input 输入限制
  590. function limitDecimal(obj) {
  591. limitReg(obj, /[^\d]/g);
  592. limitMaxLength(obj);
  593. limitInputMinMax(obj);
  594. }
  595. function limitDealParamLength(obj) {
  596. limitReg(obj, /[^\d\.]/g); // 过滤数字和.
  597. limitReg(obj, /\.{2,}/g); // 过滤第二个.
  598. limitInputMinMax(obj);
  599. }
  600. function checkNumberValid(obj) {
  601. const value = _.toNumber(obj.value);
  602. obj.value = value ? value : '';
  603. }
  604. // 属性
  605. function loadCommonProperty () {
  606. // 合同信息
  607. $('#build-name').val(property.deal_info.buildName);
  608. $('#deal-code').val(property.deal_info.dealCode);
  609. $('#deal-name').val(property.deal_info.dealName);
  610. // 参建单位
  611. // 建设单位
  612. $('#build-company').val(property.construction_unit.build.company);
  613. $('#build-corporation').val(property.construction_unit.build.corporation);
  614. $('#build-date').val(property.construction_unit.build.date);
  615. // 承包单位1
  616. $('#contract1-company').val(property.construction_unit.contract1.company);
  617. $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
  618. $('#contract1-date').val(property.construction_unit.contract1.date);
  619. // 承包单位2
  620. $('#contract2-company').val(property.construction_unit.contract2.company);
  621. $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
  622. $('#contract2-date').val(property.construction_unit.contract2.date);
  623. // 监理单位1
  624. $('#supervision1-company').val(property.construction_unit.supervision1.company);
  625. $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
  626. $('#supervision1-date').val(property.construction_unit.supervision1.date);
  627. // 监理单位2
  628. $('#supervision2-company').val(property.construction_unit.supervision2.company);
  629. $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
  630. $('#supervision2-date').val(property.construction_unit.supervision2.date);
  631. // 技术参数
  632. $('#load-level').find("option:contains('" + property.tech_param.loadLevel + "')").attr("selected",true);;
  633. $('#length').val(property.tech_param.loadLength);
  634. $('#start-peg').val(property.tech_param.startPeg);
  635. $('#end-peg').val(property.tech_param.endPeg);
  636. $('#lane-count').val(property.tech_param.laneCount);
  637. $('#deal-period').val(property.tech_param.dealPeriod);
  638. $('#start-date').val(property.tech_param.startDate);
  639. $('#plan-end-date').val(property.tech_param.planEndDate);
  640. }
  641. $('#bd-set-1').on('show.bs.modal', function () {
  642. loadCommonProperty();
  643. })
  644. function post1 () {
  645. const prop = {
  646. deal_info: {
  647. buildName: $('#build-name').val(),
  648. dealCode: $('#deal-code').val(),
  649. dealName: $('#deal-name').val(),
  650. },
  651. construction_unit: {
  652. build: {
  653. company: $('#build-company').val(),
  654. corporation: $('#build-corporation').val(),
  655. date: $('#build-date').val(),
  656. },
  657. contract1: {
  658. company: $('#contract1-company').val(),
  659. corporation: $('#contract1-corporation').val(),
  660. date: $('#contract1-date').val(),
  661. },
  662. contract2: {
  663. company: $('#contract2-company').val(),
  664. corporation: $('#contract2-corporation').val(),
  665. date: $('#contract2-date').val(),
  666. },
  667. supervision1: {
  668. company: $('#supervision1-company').val(),
  669. corporation: $('#supervision1-corporation').val(),
  670. date: $('#supervision1-date').val(),
  671. },
  672. supervision2: {
  673. company: $('#supervision2-company').val(),
  674. corporation: $('#supervision2-corporation').val(),
  675. date: $('#supervision2-date').val(),
  676. },
  677. },
  678. tech_param: {
  679. loadLevel: $('#load-level').find("option:selected").text(),
  680. loadLength: _.toNumber($('#length').val()),
  681. startPeg: $('#start-peg').val(),
  682. endPeg: $('#end-peg').val(),
  683. laneCount: _.toNumber($('#lane-count').val()),
  684. dealPeriod: $('#deal-period').val(),
  685. startDate: $('#start-date').val(),
  686. planEndDate: $('#plan-end-date').val(),
  687. }
  688. };
  689. const tenderId = window.location.pathname.split('/')[2];
  690. postData('/tender/' + tenderId + '/save', prop, function (data) {
  691. property.deal_info = data.deal_info;
  692. property.construction_unit = data.construction_unit;
  693. property.tech_param = data.tech_param;
  694. $('#bd-set-1').modal('hide');
  695. });
  696. }
  697. // 小数位数
  698. function loadCalculateProperty () {
  699. $('#decimal-up').val(property.decimal.up);
  700. $('#decimal-tp').val(property.decimal.tp);
  701. $('#decimal-pay')[0].checked = property.decimal.pay;
  702. $('#decimal-pay-tp').val(property.decimal.payTp);
  703. }
  704. $('#bd-set-2').on('show.bs.modal', function () {
  705. loadCalculateProperty();
  706. });
  707. function post2() {
  708. const prop = {
  709. decimal: {
  710. up: _.toNumber($('#decimal-up').val()),
  711. tp: _.toNumber($('#decimal-tp').val()),
  712. pay: $('#decimal-pay')[0].checked,
  713. payTp: _.toNumber($('#decimal-pay-tp').val()),
  714. }
  715. };
  716. if (ledgerChecked) {
  717. if (prop.decimal.up < property.decimal.up) {
  718. toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
  719. return;
  720. }
  721. if (prop.decimal.tp < property.decimal.tp) {
  722. toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
  723. return;
  724. }
  725. }
  726. if (firstStageChecked) {
  727. if (property.decimal.pay) {
  728. if (!prop.decimal.pay) {
  729. toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
  730. return;
  731. }
  732. if (prop.decimal.payTp < property.decimal.payTp) {
  733. toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
  734. return;
  735. }
  736. } else {
  737. if (prop.decimal.pay) {
  738. toastr.warning('第一期已审批完成,合同支付不可单独设置');
  739. return;
  740. }
  741. }
  742. }
  743. const tenderId = window.location.pathname.split('/')[2];
  744. postData('/tender/' + tenderId + '/save', prop, function (data) {
  745. property.decimal = data.decimal;
  746. $('#bd-set-2').modal('hide');
  747. }, null, true);
  748. }
  749. // 清单精度
  750. const precisionObj = (function () {
  751. const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
  752. spread.options.showVerticalScrollbar = false;
  753. spread.options.showHorizontalScrollbar = false;
  754. const sheet = spread.getActiveSheet();
  755. SpreadJsObj.protectedSheet(sheet);
  756. sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
  757. sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
  758. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  759. const vStyle = new spreadNS.Style();
  760. vStyle.font = '12px 微软雅黑';
  761. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  762. const xStyle = new spreadNS.Style();
  763. xStyle.font = '12px 微软雅黑';
  764. xStyle.vAlign = 1;
  765. xStyle.hAlign = 1;
  766. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  767. const yStyle = new spreadNS.Style();
  768. yStyle.font = '12px 微软雅黑';
  769. yStyle.vAlign = 1;
  770. yStyle.hAlign = 1;
  771. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  772. SpreadJsObj.massOperationSheet(sheet, function () {
  773. sheet.defaults.rowHeight = 21;
  774. sheet.setColumnCount(2);
  775. sheet.setRowCount(13);
  776. sheet.setColumnWidth(0, 100);
  777. sheet.setColumnWidth(1, 60);
  778. sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  779. sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2).locked(false);
  780. sheet.setText(0, 0, 't');
  781. sheet.setText(1, 0, 'km');
  782. sheet.setText(2, 0, 'm');
  783. sheet.setText(3, 0, 'm2');
  784. sheet.setText(4, 0, 'm3');
  785. sheet.setText(5, 0, 'kg');
  786. sheet.setText(6, 0, '个');
  787. sheet.setText(7, 0, '台');
  788. sheet.setText(8, 0, '套');
  789. sheet.setText(9, 0, '棵');
  790. sheet.setText(10, 0, '组');
  791. sheet.setText(11, 0, '系统');
  792. sheet.setText(12, 0, '其他未列单位');
  793. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  794. sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
  795. sheet.getRange(0, 0, 13, 2).formatter('@');
  796. sheet.setSelection(0, 1, 1, 1);
  797. });
  798. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  799. const value = _.toNumber(info.editingText);
  800. if (!_.isInteger(value)) {
  801. toastr.warning('请输入0-6的整数');
  802. sheet.setText(info.row, info.col, '0');
  803. } else if (value > 6) {
  804. toastr.warning('请输入0-6的整数');
  805. sheet.setText(info.row, info.col, '6');
  806. } else if (value < 0) {
  807. toastr.warning('请输入0-6的整数');
  808. sheet.setText(info.row, info.col, '0');
  809. }
  810. });
  811. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  812. const sel = sheet.getSelections()[0];
  813. if (sel) {
  814. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  815. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  816. if (iCol !== 1) continue;
  817. sheet.setText(iRow, iCol, '0');
  818. }
  819. }
  820. }
  821. });
  822. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  823. let bHint = false;
  824. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  825. const curRow = info.cellRange.row + iRow;
  826. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  827. const curCol = info.cellRange.col + iCol;
  828. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  829. if (_.isNaN(value) || !_.isInteger(value)) {
  830. bHint = true;
  831. info.sheet.setText(curRow, curCol, '0');
  832. } else if (value > 6) {
  833. bHint = true;
  834. info.sheet.setText(curRow, curCol, '6');
  835. } else if (value < 0) {
  836. bHint = true;
  837. info.sheet.setText(curRow, curCol, '0');
  838. }
  839. }
  840. }
  841. if (bHint) {
  842. toastr.warning('请输入0-6的整数');
  843. }
  844. });
  845. function loadPrecisonProperty() {
  846. $('#hint-3').hide();
  847. sheet.setValue(0, 1, property.precision.t.value);
  848. sheet.setValue(1, 1, property.precision.km.value);
  849. sheet.setValue(2, 1, property.precision.m.value);
  850. sheet.setValue(3, 1, property.precision.m2.value);
  851. sheet.setValue(4, 1, property.precision.m3.value);
  852. sheet.setValue(5, 1, property.precision.kg.value);
  853. sheet.setValue(6, 1, property.precision.ge.value);
  854. sheet.setValue(7, 1, property.precision.tai.value);
  855. sheet.setValue(8, 1, property.precision.tao.value);
  856. sheet.setValue(9, 1, property.precision.ke.value);
  857. sheet.setValue(10, 1, property.precision.zu.value);
  858. sheet.setValue(11, 1, property.precision.xitong.value);
  859. sheet.setValue(12, 1, property.precision.other.value);
  860. }
  861. function setReadOnly(readOnly) {
  862. sheet.getRange(0, 1, 13, 1).locked(readOnly);
  863. }
  864. function getNewPrecisionData() {
  865. const precision = JSON.parse(JSON.stringify(property.precision));
  866. precision.t.value = _.toNumber(sheet.getText(0, 1));
  867. precision.km.value = _.toNumber(sheet.getText(1, 1));
  868. precision.m.value = _.toNumber(sheet.getText(2, 1));
  869. precision.m2.value = _.toNumber(sheet.getText(3, 1));
  870. precision.m3.value = _.toNumber(sheet.getText(4, 1));
  871. precision.kg.value = _.toNumber(sheet.getText(5, 1));
  872. precision.ge.value = _.toNumber(sheet.getText(6, 1));
  873. precision.tai.value = _.toNumber(sheet.getText(7, 1));
  874. precision.tao.value = _.toNumber(sheet.getText(8, 1));
  875. precision.ke.value = _.toNumber(sheet.getText(9, 1));
  876. precision.zu.value = _.toNumber(sheet.getText(10, 1));
  877. precision.xitong.value = _.toNumber(sheet.getText(11, 1));
  878. precision.other.value = _.toNumber(sheet.getText(12, 1));
  879. return precision;
  880. }
  881. function checkPrecisionMinLimit(precision, limit) {
  882. for (const unit of precision) {
  883. if (precision[unit].value < limit[unit].value) {
  884. if (precision[unit].unit) {
  885. toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
  886. } else {
  887. toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
  888. }
  889. return false;
  890. }
  891. }
  892. return true;
  893. };
  894. return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
  895. })();
  896. $('#bd-set-3').on('show.bs.modal', function () {
  897. <% if (((tender.ledger_status !== audit.ledger.status.uncheck && tender.ledger_status !== audit.ledger.status.checkNo) || tender.user_id !== ctx.session.sessionUser.accountId)
  898. && (!lastStage || lastStage.user_id !== ctx.session.sessionUser.accountId || (lastStage.status !== audit.stage.status.checkNo || lastStage.status !== audit.stage.status.uncheck))) { %>
  899. precisionObj.setReadOnly(true);
  900. <% } %>
  901. precisionObj.loadPrecisonProperty();
  902. });
  903. function post3 () {
  904. const prop = { precision: precisionObj.getNewPrecisionData() };
  905. if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
  906. const tenderId = window.location.pathname.split('/')[2];
  907. postData('/tender/' + tenderId + '/save', prop, function (data) {
  908. property.precision = data.precision;
  909. $('#bd-set-3').modal('hide');
  910. }, null, true);
  911. }
  912. // 合同参数
  913. const dealObj = (function () {
  914. const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
  915. spread.options.showVerticalScrollbar = false;
  916. spread.options.showHorizontalScrollbar = false;
  917. const sheet = spread.getActiveSheet();
  918. SpreadJsObj.protectedSheet(sheet);
  919. sheet.setText(0, 0, '参数名', spreadNS.SheetArea.colHeader);
  920. sheet.setText(0, 1, '参数值', spreadNS.SheetArea.colHeader);
  921. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  922. const vStyle = new spreadNS.Style();
  923. vStyle.font = '12px 微软雅黑';
  924. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  925. const xStyle = new spreadNS.Style();
  926. xStyle.font = '12px 微软雅黑';
  927. xStyle.vAlign = 1;
  928. xStyle.hAlign = 1;
  929. sheet.setDefaultStyle(xStyle, spreadNS.SheetArea.colHeader);
  930. const yStyle = new spreadNS.Style();
  931. yStyle.font = '12px 微软雅黑';
  932. yStyle.vAlign = 1;
  933. yStyle.hAlign = 1;
  934. sheet.setDefaultStyle(yStyle, spreadNS.SheetArea.rowHeader);
  935. SpreadJsObj.massOperationSheet(sheet, function () {
  936. sheet.defaults.rowHeight = 21;
  937. sheet.setColumnCount(2);
  938. sheet.setRowCount(5);
  939. sheet.setColumnWidth(0, 200);
  940. sheet.setColumnWidth(1, 200);
  941. sheet.getRange(0, 0, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  942. sheet.getRange(0, 1, 5, 1).vAlign(1).hAlign(2).locked(false);
  943. sheet.setText(0, 0, '签约合同价');
  944. sheet.setText(1, 0, '暂列金额');
  945. sheet.setText(2, 0, '签约合同价(不含暂列金)');
  946. sheet.setText(3, 0, '签约开工预付款');
  947. sheet.setText(4, 0, '签约材料预付款');
  948. sheet.getCell(2, 1).locked(true);
  949. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  950. sheet.getRange(0, 0, 5, 2).setBorder(lineBorder, {all: true});
  951. sheet.getRange(0, 0, 5, 2).formatter('@');
  952. sheet.setSelection(0, 1, 1, 1);
  953. });
  954. function calcHtjMinusZlj() {
  955. const htj = _.toNumber(sheet.getText(0, 1));
  956. const zlj = _.toNumber(sheet.getText(1, 1));
  957. sheet.setValue(2, 1, ZhCalc.sub(htj, zlj));
  958. }
  959. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  960. const value = _.toNumber(info.editingText);
  961. if (_.isNaN(value)) {
  962. toastr.warning('请输入不超过万亿的数字');
  963. info.sheet.setText(info.row, info.col, '0');
  964. } else if (value > Math.pow(10, 13)) {
  965. toastr.warning('请输入不超过万亿的数字');
  966. info.sheet.setText(info.row, info.col, '0');
  967. }
  968. if (info.row === 0 || info.row === 1) {
  969. calcHtjMinusZlj();
  970. }
  971. });
  972. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  973. const sel = sheet.getSelections()[0];
  974. let calc = false;
  975. if (sel) {
  976. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  977. if (iRow === 2) continue;
  978. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  979. if (iCol !== 1) continue;
  980. sheet.setText(iRow, iCol, '0');
  981. if (iRow === 0 || iRow === 1) calc = true;
  982. }
  983. }
  984. }
  985. if (calc) calcHtjMinusZlj();
  986. });
  987. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  988. let bHint = false;
  989. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  990. const curRow = info.cellRange.row + iRow;
  991. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  992. const curCol = info.cellRange.col + iCol;
  993. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  994. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  995. bHint = true;
  996. info.sheet.setText(curRow, curCol, '0');
  997. }
  998. }
  999. }
  1000. if (bHint) {
  1001. toastr.warning('请输入不超过万亿的数字');
  1002. }
  1003. calcHtjMinusZlj();
  1004. });
  1005. function loadDealProperty() {
  1006. sheet.setValue(0, 1, property.deal_param.contractPrice);
  1007. sheet.setValue(1, 1, property.deal_param.zanLiePrice);
  1008. sheet.setValue(2, 1, ZhCalc.sub(property.deal_param.contractPrice, property.deal_param.zanLiePrice));
  1009. sheet.setValue(3, 1, property.deal_param.startAdvance);
  1010. sheet.setValue(4, 1, property.deal_param.materialAdvance);
  1011. }
  1012. function setReadOnly (readOnly) {
  1013. sheet.getCell(0, 1).locked(readOnly);
  1014. sheet.getCell(1, 1).locked(readOnly);
  1015. sheet.getCell(3, 1).locked(readOnly);
  1016. sheet.getCell(4, 1).locked(readOnly);
  1017. }
  1018. function getNewDealData () {
  1019. const result = {};
  1020. result.contractPrice = _.toNumber(sheet.getText(0, 1));
  1021. result.zanLiePrice = _.toNumber(sheet.getText(1, 1));
  1022. result.startAdvance = _.toNumber(sheet.getText(3, 1));
  1023. result.materialAdvance = _.toNumber(sheet.getText(4, 1));
  1024. return result;
  1025. }
  1026. return { loadDealProperty, setReadOnly, getNewDealData, };
  1027. })();
  1028. $('#bd-set-4').on('show.bs.modal', function () {
  1029. dealObj.loadDealProperty();
  1030. <% 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)))) { %>
  1031. dealObj.setReadOnly(true);
  1032. <% } %>
  1033. });
  1034. function post4 () {
  1035. if (firstStageChecked) return;
  1036. const prop = { deal_param: dealObj.getNewDealData() };
  1037. const tenderId = window.location.pathname.split('/')[2];
  1038. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1039. property.deal_param = data.deal_param;
  1040. $('#bd-set-4').modal('hide');
  1041. window.location.reload();
  1042. });
  1043. }
  1044. // 显示设置
  1045. function loadDisplayProperty () {
  1046. $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
  1047. $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
  1048. }
  1049. $('#bd-set-5').on('show.bs.modal', function () {
  1050. loadDisplayProperty();
  1051. });
  1052. function post5 () {
  1053. const prop = {
  1054. display: {
  1055. ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
  1056. },
  1057. };
  1058. const tenderId = window.location.pathname.split('/')[2];
  1059. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1060. property.display = data.display;
  1061. $('#bd-set-5').modal('hide');
  1062. });
  1063. }
  1064. // 章节设置
  1065. const chapterObj = (function () {
  1066. const spreadSetting = {
  1067. cols: [
  1068. {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
  1069. {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
  1070. ],
  1071. emptyRows: 0,
  1072. headRows: 1,
  1073. headRowHeight: [32],
  1074. defaultRowHeight: 21,
  1075. headerFont: '12px 微软雅黑',
  1076. font: '12px 微软雅黑',
  1077. };
  1078. const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
  1079. spread.options.showVerticalScrollbar = false;
  1080. spread.options.showHorizontalScrollbar = false;
  1081. SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
  1082. function checkSheetData(sheet) {
  1083. let hint = '';
  1084. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1085. const cell = sheet.getCell(iRow, 1);
  1086. const defaultStype = sheet.getDefaultStyle();
  1087. if (cell.text().length > 50) {
  1088. cell.backColor('#f8d7da');
  1089. hint = '章节名称的长度超出范围,请重新输入';
  1090. } else {
  1091. cell.backColor(defaultStype.backColor);
  1092. }
  1093. }
  1094. if (hint === '') {
  1095. $('#hint-6').hide();
  1096. } else {
  1097. $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
  1098. }
  1099. }
  1100. spread.bind(spreadNS.Events.EditEnding, function (e, info) {
  1101. checkSheetData(info.sheet);
  1102. });
  1103. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1104. checkSheetData(info.sheet);
  1105. });
  1106. function loadChapterProperty() {
  1107. SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
  1108. $('#hint-6').hide();
  1109. const sheet = spread.getActiveSheet();
  1110. const defaultStype = sheet.getDefaultStyle();
  1111. sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
  1112. }
  1113. function setReadOnly(readOnly) {
  1114. SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
  1115. }
  1116. function getNewChapterData() {
  1117. const result = [];
  1118. const sheet = spread.getActiveSheet();
  1119. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1120. const data = {};
  1121. for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
  1122. const col = spreadSetting.cols[iCol];
  1123. data[col.field] = sheet.getText(iRow, iCol);
  1124. if (col.field === 'name') {
  1125. if (data.name.length > 50) {
  1126. return null;
  1127. }
  1128. }
  1129. }
  1130. result.push(data);
  1131. }
  1132. return result;
  1133. }
  1134. return { loadChapterProperty, setReadOnly, getNewChapterData, }
  1135. })();
  1136. $('#bd-set-6').on('show.bs.modal', function () {
  1137. chapterObj.loadChapterProperty();
  1138. chapterObj.setReadOnly(false);
  1139. });
  1140. function post6 () {
  1141. const chapter = chapterObj.getNewChapterData();
  1142. if (!chapter) { return; }
  1143. const tenderId = window.location.pathname.split('/')[2];
  1144. postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
  1145. property.chapter = data.chapter;
  1146. $('#bd-set-6').modal('hide');
  1147. });
  1148. }
  1149. // 属性
  1150. function loadPayProperty () {
  1151. // 付款账号
  1152. $('#project-name').val(property.pay_account.project.name);
  1153. $('#project-bank').val(property.pay_account.project.bank);
  1154. $('#project-account').val(property.pay_account.project.account);
  1155. $('#project-rate').val(property.pay_account.project.rate);
  1156. $('#project-contact').val(property.pay_account.project.contact);
  1157. $('#project-phone').val(property.pay_account.project.phone);
  1158. $('#worker-name').val(property.pay_account.worker.name);
  1159. $('#worker-bank').val(property.pay_account.worker.bank);
  1160. $('#worker-account').val(property.pay_account.worker.account);
  1161. $('#worker-rate').val(property.pay_account.worker.rate);
  1162. $('#worker-contact').val(property.pay_account.worker.contact);
  1163. $('#worker-phone').val(property.pay_account.worker.phone);
  1164. }
  1165. $('#bd-set-7').on('show.bs.modal', function () {
  1166. loadPayProperty();
  1167. })
  1168. function post7 () {
  1169. let flag = false;
  1170. const rate_reg = /^(([1-9][0-9]*)|(([0]\.\d{1,2}|[1-9][0-9]*\.\d{1,2}))|)$/;
  1171. const phone_reg = /^((0\d{2,3}-\d{7,8})|(1[3456789]\d{9}))$/;
  1172. const project_rate = $('#project-rate').val();
  1173. if (!rate_reg.test(project_rate) && project_rate !== '') {
  1174. toastr.error('工程款账户分账划拨比例数字格式有误且最多保留2位小数');
  1175. flag = true;
  1176. }
  1177. const project_phone = $('#project-phone').val();
  1178. if (!phone_reg.test(project_phone) && project_phone !== '') {
  1179. toastr.error('工程款账户联系电话格式有误');
  1180. flag = true;
  1181. }
  1182. const worker_rate = $('#worker-rate').val();
  1183. if (!rate_reg.test(worker_rate) && worker_rate !== '') {
  1184. toastr.error('农民工工资专用账户分账划拨比例数字格式有误且最多保留2位小数');
  1185. flag = true;
  1186. }
  1187. const worker_phone = $('#worker-phone').val();
  1188. if (!phone_reg.test(worker_phone) && worker_phone !== '') {
  1189. toastr.error('农民工工资专用账户联系电话格式有误');
  1190. flag = true;
  1191. }
  1192. if (flag) {
  1193. return false;
  1194. }
  1195. const prop = {
  1196. pay_account: {
  1197. project: {
  1198. name: $('#project-name').val(),
  1199. bank: $('#project-bank').val(),
  1200. account: $('#project-account').val(),
  1201. rate: $('#project-rate').val(),
  1202. contact: $('#project-contact').val(),
  1203. phone: $('#project-phone').val(),
  1204. },
  1205. worker: {
  1206. name: $('#worker-name').val(),
  1207. bank: $('#worker-bank').val(),
  1208. account: $('#worker-account').val(),
  1209. rate: $('#worker-rate').val(),
  1210. contact: $('#worker-contact').val(),
  1211. phone: $('#worker-phone').val(),
  1212. },
  1213. },
  1214. };
  1215. const tenderId = window.location.pathname.split('/')[2];
  1216. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1217. property.pay_account = data.pay_account;
  1218. $('#bd-set-7').modal('hide');
  1219. });
  1220. }
  1221. </script>