detail_modal.ejs 57 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134
  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. <script>
  533. let property = JSON.parse('<%- JSON.stringify(tenderInfo) %>');
  534. let ledgerChecked = <%- tender.ldeger_status === audit.ledger.status.checked %>;
  535. let firstStageChecked = <%- lastStage !== undefined && lastStage !== null && (lastStage.order > 1 || (lastStage.order === 1 && lastStage.status === audit.stage.status.checked)) %>;
  536. // 根据Min Max限制Input输入
  537. function limitInputMinMax (obj) {
  538. if (_.toNumber(obj.value) > _.toNumber(obj.max)) {
  539. obj.value = obj.max;
  540. }
  541. if(_.toNumber(obj.value) < _.toNumber(obj.min)) {
  542. obj.value = obj.min;
  543. }
  544. }
  545. // 根据Maxlength限制input输入
  546. function limitMaxLength (obj) {
  547. if (obj.value.length > obj.maxLength) {
  548. obj.value = obj.value.substr(0, obj.maxLength);
  549. }
  550. }
  551. // 根据正则限制输入
  552. function limitReg(obj, reg) {
  553. obj.value = obj.value.replace(reg, '');
  554. }
  555. // 小数位数 input 输入限制
  556. function limitDecimal(obj) {
  557. limitReg(obj, /[^\d]/g);
  558. limitMaxLength(obj);
  559. limitInputMinMax(obj);
  560. }
  561. function limitDealParamLength(obj) {
  562. limitReg(obj, /[^\d\.]/g); // 过滤数字和.
  563. limitReg(obj, /\.{2,}/g); // 过滤第二个.
  564. limitInputMinMax(obj);
  565. }
  566. function checkNumberValid(obj) {
  567. const value = _.toNumber(obj.value);
  568. obj.value = value ? value : '';
  569. }
  570. // 属性
  571. function loadCommonProperty () {
  572. // 合同信息
  573. $('#build-name').val(property.deal_info.buildName);
  574. $('#deal-code').val(property.deal_info.dealCode);
  575. $('#deal-name').val(property.deal_info.dealName);
  576. // 参建单位
  577. // 建设单位
  578. $('#build-company').val(property.construction_unit.build.company);
  579. $('#build-corporation').val(property.construction_unit.build.corporation);
  580. $('#build-date').val(property.construction_unit.build.date);
  581. // 承包单位1
  582. $('#contract1-company').val(property.construction_unit.contract1.company);
  583. $('#contract1-corporation').val(property.construction_unit.contract1.corporation);
  584. $('#contract1-date').val(property.construction_unit.contract1.date);
  585. // 承包单位2
  586. $('#contract2-company').val(property.construction_unit.contract2.company);
  587. $('#contract2-corporation').val(property.construction_unit.contract2.corporation);
  588. $('#contract2-date').val(property.construction_unit.contract2.date);
  589. // 监理单位1
  590. $('#supervision1-company').val(property.construction_unit.supervision1.company);
  591. $('#supervision1-corporation').val(property.construction_unit.supervision1.corporation);
  592. $('#supervision1-date').val(property.construction_unit.supervision1.date);
  593. // 监理单位2
  594. $('#supervision2-company').val(property.construction_unit.supervision2.company);
  595. $('#supervision2-corporation').val(property.construction_unit.supervision2.corporation);
  596. $('#supervision2-date').val(property.construction_unit.supervision2.date);
  597. // 技术参数
  598. $('#loadLevel').val(property.tech_param.loadLevel);
  599. $('#length').val(property.tech_param.loadLength);
  600. $('#start-peg').val(property.tech_param.startPeg);
  601. $('#end-peg').val(property.tech_param.endPeg);
  602. $('#lane-count').val(property.tech_param.laneCount);
  603. $('#deal-period').val(property.tech_param.dealPeriod);
  604. $('#start-date').val(property.tech_param.startDate);
  605. $('#plan-end-date').val(property.tech_param.planEndDate);
  606. }
  607. $('#bd-set-1').on('show.bs.modal', function () {
  608. loadCommonProperty();
  609. })
  610. function post1 () {
  611. const prop = {
  612. deal_info: {
  613. buildName: $('#build-name').val(),
  614. dealCode: $('#deal-code').val(),
  615. dealName: $('#deal-name').val(),
  616. },
  617. construction_unit: {
  618. build: {
  619. company: $('#build-company').val(),
  620. corporation: $('#build-corporation').val(),
  621. date: $('#build-date').val(),
  622. },
  623. contract1: {
  624. company: $('#contract1-company').val(),
  625. corporation: $('#contract1-corporation').val(),
  626. date: $('#contract1-date').val(),
  627. },
  628. contract2: {
  629. company: $('#contract2-company').val(),
  630. corporation: $('#contract2-corporation').val(),
  631. date: $('#contract2-date').val(),
  632. },
  633. supervision1: {
  634. company: $('#supervision1-company').val(),
  635. corporation: $('#supervision1-corporation').val(),
  636. date: $('#supervision1-date').val(),
  637. },
  638. supervision2: {
  639. company: $('#supervision2-company').val(),
  640. corporation: $('#supervision2-corporation').val(),
  641. date: $('#supervision2-date').val(),
  642. },
  643. },
  644. tech_param: {
  645. loadLevel: _.toNumber($('#loadLevel').val()),
  646. loadLength: _.toNumber($('#length').val()),
  647. startPeg: $('#start-peg').val(),
  648. endPeg: $('#end-peg').val(),
  649. laneCount: _.toNumber($('#lane-count').val()),
  650. dealPeriod: $('#deal-period').val(),
  651. startDate: $('#start-date').val(),
  652. planEndDate: $('#plan-end-date').val(),
  653. }
  654. };
  655. const tenderId = window.location.pathname.split('/')[2];
  656. postData('/tender/' + tenderId + '/save', prop, function (data) {
  657. setReadOnly('#v-pills-1', true);
  658. property.deal_info = data.deal_info;
  659. property.construction_unit = data.construction_unit;
  660. property.tech_param = data.tech_param;
  661. $('#bd-set-1').modal('hide');
  662. });
  663. }
  664. // 小数位数
  665. function loadCalculateProperty () {
  666. $('#decimal-up').val(property.decimal.up);
  667. $('#decimal-tp').val(property.decimal.tp);
  668. $('#decimal-pay')[0].checked = property.decimal.pay;
  669. $('#decimal-pay-tp').val(property.decimal.payTp);
  670. }
  671. $('#bd-set-2').on('show.bs.modal', function () {
  672. loadCalculateProperty();
  673. });
  674. function post2() {
  675. const prop = {
  676. decimal: {
  677. up: _.toNumber($('#decimal-up').val()),
  678. tp: _.toNumber($('#decimal-tp').val()),
  679. pay: $('#decimal-pay')[0].checked,
  680. payTp: _.toNumber($('#decimal-pay-tp').val()),
  681. }
  682. };
  683. if (ledgerChecked) {
  684. if (prop.decimal.up < property.decimal.up) {
  685. toastr.warning('台账已审批完成,单价的小数位数,不可小于' + property.decimal.up);
  686. return;
  687. }
  688. if (prop.decimal.tp < property.decimal.tp) {
  689. toastr.warning('台账已审批完成,金额的小数位数,不可小于' + property.decimal.tp);
  690. return;
  691. }
  692. }
  693. if (firstStageChecked) {
  694. if (property.decimal.pay) {
  695. if (!prop.decimal.pay) {
  696. toastr.warning('第一期已审批完成,不可取消合同支付单独设置');
  697. return;
  698. }
  699. if (prop.decimal.payTp < property.decimal.payTp) {
  700. toastr.warning('第一期已审批完成,单独设置的合同支付小数位数,不可小于' + property.decimal.payTp);
  701. return;
  702. }
  703. } else {
  704. if (prop.decimal.pay) {
  705. toastr.warning('第一期已审批完成,合同支付不可单独设置');
  706. return;
  707. }
  708. }
  709. }
  710. const tenderId = window.location.pathname.split('/')[2];
  711. postData('/tender/' + tenderId + '/save', prop, function (data) {
  712. property.decimal = data.decimal;
  713. $('#bd-set-2').modal('hide');
  714. }, null, true);
  715. }
  716. // 清单精度
  717. const precisionObj = (function () {
  718. const spread = SpreadJsObj.createNewSpread($('#precision-spread')[0]);
  719. //spread.options.showVerticalScrollbar = false;
  720. //spread.options.showHorizontalScrollbar = false;
  721. const sheet = spread.getActiveSheet();
  722. SpreadJsObj.protectedSheet(sheet);
  723. //sheet.options.rowHeaderVisible = false;
  724. //sheet.options.colHeaderVisible = false;
  725. sheet.setText(0, 0, '单位', spreadNS.SheetArea.colHeader);
  726. sheet.setText(0, 1, '精度', spreadNS.SheetArea.colHeader);
  727. sheet.setRowHeight(0, 32, spreadNS.SheetArea.colHeader);
  728. const vStyle = new spreadNS.Style();
  729. vStyle.font = '12px 微软雅黑';
  730. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  731. SpreadJsObj.massOperationSheet(sheet, function () {
  732. sheet.defaults.rowHeight = 25;
  733. sheet.setColumnCount(2);
  734. sheet.setRowCount(13);
  735. sheet.setColumnWidth(0, 100);
  736. sheet.setColumnWidth(1, 60);
  737. sheet.getRange(0, 0, 13, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  738. sheet.getRange(0, 1, 13, 1).vAlign(1).hAlign(2);//.locked(true);
  739. sheet.setText(0, 0, 't');
  740. sheet.setText(1, 0, 'km');
  741. sheet.setText(2, 0, 'm');
  742. sheet.setText(3, 0, 'm2');
  743. sheet.setText(4, 0, 'm3');
  744. sheet.setText(5, 0, 'kg');
  745. sheet.setText(6, 0, '个');
  746. sheet.setText(7, 0, '台');
  747. sheet.setText(8, 0, '套');
  748. sheet.setText(9, 0, '棵');
  749. sheet.setText(10, 0, '组');
  750. sheet.setText(11, 0, '系统');
  751. sheet.setText(12, 0, '其他未列单位');
  752. const lineBorder = new spreadNS.LineBorder('#dee2e6', spreadNS.LineStyle.thin);
  753. sheet.getRange(0, 0, 13, 2).setBorder(lineBorder, {all: true});
  754. sheet.getRange(0, 0, 13, 2).formatter('@');
  755. sheet.setSelection(0, 1, 1, 1);
  756. });
  757. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  758. const value = _.toNumber(info.editingText);
  759. if (!_.isInteger(value)) {
  760. toastr.warning('请输入0-6的整数');
  761. sheet.setText(info.row, info.col, '0');
  762. } else if (value > 6) {
  763. toastr.warning('请输入0-6的整数');
  764. sheet.setText(info.row, info.col, '6');
  765. } else if (value < 0) {
  766. toastr.warning('请输入0-6的整数');
  767. sheet.setText(info.row, info.col, '0');
  768. }
  769. });
  770. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  771. const sel = sheet.getSelections()[0];
  772. let calc = false;
  773. if (sel) {
  774. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  775. if (iRow === 3) continue;
  776. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  777. if (iCol !== 2) continue;
  778. sheet.setText(iRow, iCol, '0');
  779. if (iRow === 1 || iRow === 2) calc = true;
  780. }
  781. }
  782. }
  783. if (calc) calcHtjMinusZlj();
  784. });
  785. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  786. let bHint = false;
  787. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  788. const curRow = info.cellRange.row + iRow;
  789. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  790. const curCol = info.cellRange.col + iCol;
  791. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  792. if (_.isNaN(value) || !_.isInteger(value)) {
  793. bHint = true;
  794. info.sheet.setText(curRow, curCol, '0');
  795. } else if (value > 6) {
  796. bHint = true;
  797. info.sheet.setText(curRow, curCol, '6');
  798. } else if (value < 0) {
  799. bHint = true;
  800. info.sheet.setText(curRow, curCol, '0');
  801. }
  802. }
  803. }
  804. if (bHint) {
  805. toastr.warning('请输入0-6的整数');
  806. }
  807. });
  808. function loadPrecisonProperty() {
  809. $('#hint-3').hide();
  810. sheet.setValue(0, 1, property.precision.t.value);
  811. sheet.setValue(1, 1, property.precision.km.value);
  812. sheet.setValue(2, 1, property.precision.m.value);
  813. sheet.setValue(3, 1, property.precision.m2.value);
  814. sheet.setValue(4, 1, property.precision.m3.value);
  815. sheet.setValue(5, 1, property.precision.kg.value);
  816. sheet.setValue(6, 1, property.precision.ge.value);
  817. sheet.setValue(7, 1, property.precision.tai.value);
  818. sheet.setValue(8, 1, property.precision.tao.value);
  819. sheet.setValue(9, 1, property.precision.ke.value);
  820. sheet.setValue(10, 1, property.precision.zu.value);
  821. sheet.setValue(11, 1, property.precision.xitong.value);
  822. sheet.setValue(12, 1, property.precision.other.value);
  823. }
  824. function setReadOnly(readOnly) {
  825. sheet.getRange(0, 1, 13, 1).locked(readOnly);
  826. }
  827. function getNewPrecisionData() {
  828. const precision = JSON.parse(JSON.stringify(property.precision));
  829. precision.t.value = _.toNumber(sheet.getText(0, 1));
  830. precision.km.value = _.toNumber(sheet.getText(1, 1));
  831. precision.m.value = _.toNumber(sheet.getText(2, 1));
  832. precision.m2.value = _.toNumber(sheet.getText(3, 1));
  833. precision.m3.value = _.toNumber(sheet.getText(4, 1));
  834. precision.kg.value = _.toNumber(sheet.getText(5, 1));
  835. precision.ge.value = _.toNumber(sheet.getText(6, 1));
  836. precision.tai.value = _.toNumber(sheet.getText(7, 1));
  837. precision.tao.value = _.toNumber(sheet.getText(8, 1));
  838. precision.ke.value = _.toNumber(sheet.getText(9, 1));
  839. precision.zu.value = _.toNumber(sheet.getText(10, 1));
  840. precision.xitong.value = _.toNumber(sheet.getText(11, 1));
  841. precision.other.value = _.toNumber(sheet.getText(12, 1));
  842. return precision;
  843. }
  844. function checkPrecisionMinLimit(precision, limit) {
  845. for (const unit of precision) {
  846. if (precision[unit].value < limit[unit].value) {
  847. if (precision[unit].unit) {
  848. toastr.warning('台账已审批通过,清单精度不可减少,单位为' + limit[unit].unit + '的清单的精度不可小于' + limit[unit].value);
  849. } else {
  850. toastr.warning('台账已审批通过,清单精度不可减少,其他清单的精度不可小于' + limit[unit].value);
  851. }
  852. return false;
  853. }
  854. }
  855. return true;
  856. };
  857. return {loadPrecisonProperty, setReadOnly, getNewPrecisionData, checkPrecisionMinLimit};
  858. })();
  859. $('#bd-set-3').on('show.bs.modal', function () {
  860. <% if (((tender.ledger_status !== audit.ledger.status.uncheck && tender.ledger_status !== audit.ledger.status.checkNo) || tender.user_id !== ctx.session.sessionUser.accountId)
  861. && (!lastStage || lastStage.user_id !== ctx.session.sessionUser.accountId || (lastStage.status !== audit.stage.status.checkNo || lastStage.status !== audit.stage.status.uncheck))) { %>
  862. precisionObj.setReadOnly(true);
  863. <% } %>
  864. precisionObj.loadPrecisonProperty();
  865. });
  866. function post3 () {
  867. const prop = { precision: precisionObj.getNewPrecisionData() };
  868. if (ledgerChecked && !precisionObj.checkPrecisionMinLimit(prop.precision, property.precision)) return;
  869. const tenderId = window.location.pathname.split('/')[2];
  870. postData('/tender/' + tenderId + '/save', prop, function (data) {
  871. property.precision = data.precision;
  872. $('#bd-set-3').modal('hide');
  873. }, null, true);
  874. }
  875. // 合同参数
  876. const dealObj = (function () {
  877. const spread = SpreadJsObj.createNewSpread($('#param-spread')[0]);
  878. spread.options.showVerticalScrollbar = false;
  879. spread.options.showHorizontalScrollbar = false;
  880. const sheet = spread.getActiveSheet();
  881. SpreadJsObj.protectedSheet(sheet);
  882. const vStyle = new spreadNS.Style();
  883. vStyle.font = '12px 微软雅黑';
  884. sheet.setDefaultStyle(vStyle, spreadNS.SheetArea.viewport);
  885. SpreadJsObj.massOperationSheet(sheet, function () {
  886. sheet.options.rowHeaderVisible = false;
  887. sheet.options.colHeaderVisible = false;
  888. sheet.defaults.rowHeight = 25;
  889. sheet.setColumnCount(3);
  890. sheet.setRowCount(6);
  891. sheet.setColumnWidth(0, 1);
  892. sheet.setColumnWidth(1, 200);
  893. sheet.setColumnWidth(2, 200);
  894. sheet.setRowHeight(0, 1);
  895. sheet.getRange(1, 1, 5, 1).vAlign(1).backColor('#e4e7ea').locked(true);
  896. sheet.getRange(1, 2, 5, 1).vAlign(1).hAlign(2).locked(true);
  897. sheet.setText(1, 1, '签约合同价');
  898. sheet.setText(2, 1, '暂列金额');
  899. sheet.setText(3, 1, '签约合同价(不含暂列金)');
  900. sheet.setText(4, 1, '签约开工预付款');
  901. sheet.setText(5, 1, '签约材料预付款');
  902. const lineBorder = new spreadNS.LineBorder('#6a696e', spreadNS.LineStyle.thin);
  903. sheet.getRange(0, 0, 6, 3).setBorder(lineBorder, {all: true});
  904. sheet.getRange(0, 0, 6, 3).formatter('@');
  905. sheet.setSelection(1, 2, 1, 1);
  906. });
  907. function calcHtjMinusZlj() {
  908. const htj = _.toNumber(sheet.getText(1, 2));
  909. const zlj = _.toNumber(sheet.getText(2, 2));
  910. sheet.setValue(3, 2, ZhCalc.sub(zlj, htj));
  911. }
  912. spread.bind(spreadNS.Events.EditEnded, function (e, info) {
  913. const value = _.toNumber(info.editingText);
  914. if (_.isNaN(value)) {
  915. toastr.warning('请输入不超过万亿的数字');
  916. info.sheet.setText(info.row, info.col, '0');
  917. } else if (value > Math.pow(10, 13)) {
  918. toastr.warning('请输入不超过万亿的数字');
  919. info.sheet.setText(info.row, info.col, '0');
  920. }
  921. if (info.row === 1 || info.row === 2) {
  922. calcHtjMinusZlj();
  923. }
  924. });
  925. SpreadJsObj.addDeleteBind(spread, function (sheet) {
  926. const sel = sheet.getSelections()[0];
  927. let calc = false;
  928. if (sel) {
  929. for (let iRow = sel.row, iRowLength = sel.row + sel.rowCount; iRow < iRowLength; iRow++) {
  930. if (iRow === 3) continue;
  931. for (let iCol = sel.col, iColLength = sel.col + sel.colCount; iCol < iColLength; iCol++) {
  932. if (iCol !== 2) continue;
  933. sheet.setText(iRow, iCol, '0');
  934. if (iRow === 1 || iRow === 2) calc = true;
  935. }
  936. }
  937. }
  938. if (calc) calcHtjMinusZlj();
  939. });
  940. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  941. let bHint = false;
  942. for (let iRow = 0; iRow < info.cellRange.rowCount; iRow++) {
  943. const curRow = info.cellRange.row + iRow;
  944. for (let iCol = 0; iCol < info.cellRange.colCount; iCol++) {
  945. const curCol = info.cellRange.col + iCol;
  946. const value = _.toNumber(info.sheet.getText(curRow, curCol));
  947. if (_.isNaN(value) || value > Math.pow(10, 13)) {
  948. bHint = true;
  949. info.sheet.setText(curRow, curCol, '0');
  950. }
  951. }
  952. }
  953. if (bHint) {
  954. toastr.warning('请输入不超过万亿的数字');
  955. }
  956. calcHtjMinusZlj();
  957. });
  958. function loadDealProperty() {
  959. $('#hint-4').hide();
  960. sheet.setValue(1, 2, property.deal_param.contractPrice);
  961. sheet.setValue(2, 2, property.deal_param.zanLiePrice);
  962. sheet.setValue(3, 2, ZhCalc.sub(property.deal_param.zanLiePrice, property.deal_param.contractPrice));
  963. sheet.setValue(4, 2, property.deal_param.startAdvance);
  964. sheet.setValue(5, 2, property.deal_param.materialAdvance);
  965. }
  966. function setReadOnly (readOnly) {
  967. sheet.getCell(1, 2).locked(readOnly);
  968. sheet.getCell(2, 2).locked(readOnly);
  969. sheet.getCell(4, 2).locked(readOnly);
  970. sheet.getCell(5, 2).locked(readOnly);
  971. }
  972. function getNewDealData () {
  973. const result = {};
  974. result.contractPrice = _.toNumber(sheet.getText(1, 2));
  975. result.zanLiePrice = _.toNumber(sheet.getText(2, 2));
  976. result.startAdvance = _.toNumber(sheet.getText(4, 2));
  977. result.materialAdvance = _.toNumber(sheet.getText(5, 2));
  978. return result;
  979. }
  980. return { loadDealProperty, setReadOnly, getNewDealData, };
  981. })();
  982. $('#bd-set-4').on('show.bs.modal', function () {
  983. dealObj.loadDealProperty();
  984. if (firstStageChecked) {
  985. dealObj.setReadOnly(true);
  986. }
  987. });
  988. function post4 () {
  989. if (firstStageChecked) return;
  990. const prop = { deal_param: dealObj.getNewDealData() };
  991. const tenderId = window.location.pathname.split('/')[2];
  992. postData('/tender/' + tenderId + '/save', prop, function (data) {
  993. property.deal_param = data.deal_param;
  994. $('bd-set-4').modal('hide');
  995. });
  996. }
  997. // 显示设置
  998. function loadDisplayProperty () {
  999. $('#ledger-dgn-qty')[0].checked = property.display.ledger.dgnQty;
  1000. $('#ledger-cl-qty')[0].checked = property.display.ledger.clQty;
  1001. }
  1002. $('#bd-set-5').on('show.bs.modal', function () {
  1003. loadDisplayProperty();
  1004. });
  1005. function post5 () {
  1006. const prop = {
  1007. display: {
  1008. ledger: { dgnQty: $('#ledger-dgn-qty')[0].checked, clQty: $('#ledger-cl-qty')[0].checked, },
  1009. },
  1010. };
  1011. const tenderId = window.location.pathname.split('/')[2];
  1012. postData('/tender/' + tenderId + '/save', prop, function (data) {
  1013. property.display = data.display;
  1014. $('#bd-set-5').modal('hide');
  1015. });
  1016. }
  1017. // 章节设置
  1018. const chapterObj = (function () {
  1019. const spreadSetting = {
  1020. cols: [
  1021. {title: '章节', colSpan: '1', rowSpan: '1', field: 'code', hAlign: 0, width: 100, formatter: '@', readOnly: true},
  1022. {title: '名称', colSpan: '1', rowSpan: '1', field: 'name', hAlign: 0, width: 230, formatter: '@', readOnly: true},
  1023. ],
  1024. emptyRows: 0,
  1025. headRows: 1,
  1026. headRowHeight: [32],
  1027. defaultRowHeight: 21,
  1028. headerFont: '12px 微软雅黑',
  1029. font: '12px 微软雅黑',
  1030. };
  1031. const spread = SpreadJsObj.createNewSpread($('#chapter-spread')[0]);
  1032. spread.options.showVerticalScrollbar = false;
  1033. spread.options.showHorizontalScrollbar = false;
  1034. SpreadJsObj.initSheet(spread.getActiveSheet(), spreadSetting);
  1035. function checkSheetData(sheet) {
  1036. let hint = '';
  1037. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1038. const cell = sheet.getCell(iRow, 1);
  1039. const defaultStype = sheet.getDefaultStyle();
  1040. if (cell.text().length > 50) {
  1041. cell.backColor('#f8d7da');
  1042. hint = '章节名称的长度超出范围,请重新输入';
  1043. } else {
  1044. cell.backColor(defaultStype.backColor);
  1045. }
  1046. }
  1047. if (hint === '') {
  1048. $('#hint-6').hide();
  1049. } else {
  1050. $('#hint-6').html('<i class="fa fa-smile-o mr-2"></i>' + hint).show();
  1051. }
  1052. }
  1053. spread.bind(spreadNS.Events.EditEnding, function (e, info) {
  1054. checkSheetData(info.sheet);
  1055. });
  1056. spread.bind(spreadNS.Events.ClipboardPasted, function (e, info) {
  1057. checkSheetData(info.sheet);
  1058. });
  1059. function loadChapterProperty() {
  1060. SpreadJsObj.loadSheetData(spread.getActiveSheet(), SpreadJsObj.DataType.Data, property.chapter);
  1061. $('#hint-6').hide();
  1062. const sheet = spread.getActiveSheet();
  1063. const defaultStype = sheet.getDefaultStyle();
  1064. sheet.getRange(0, 0, sheet.getRowCount(), sheet.getColumnCount()).backColor(defaultStype.backColor);
  1065. }
  1066. function setReadOnly(readOnly) {
  1067. SpreadJsObj.resetFieldReadOnly(spread.getActiveSheet(), 'name', readOnly);
  1068. }
  1069. function getNewChapterData() {
  1070. const result = [];
  1071. const sheet = spread.getActiveSheet();
  1072. for (let iRow = 0; iRow < sheet.getRowCount(); iRow++) {
  1073. const data = {};
  1074. for (let iCol = 0; iCol < sheet.getColumnCount(); iCol++) {
  1075. const col = spreadSetting.cols[iCol];
  1076. data[col.field] = sheet.getText(iRow, iCol);
  1077. if (col.field === 'name') {
  1078. if (data.name.length > 50) {
  1079. return null;
  1080. }
  1081. }
  1082. }
  1083. result.push(data);
  1084. }
  1085. return result;
  1086. }
  1087. return { loadChapterProperty, setReadOnly, getNewChapterData, }
  1088. })();
  1089. $('#bd-set-6').on('show.bs.modal', function () {
  1090. chapterObj.loadChapterProperty();
  1091. chapterObj.setReadOnly(false);
  1092. });
  1093. function post6 () {
  1094. const chapter = chapterObj.getNewChapterData();
  1095. if (!chapter) { return; }
  1096. const tenderId = window.location.pathname.split('/')[2];
  1097. postData('/tender/' + tenderId + '/save', { chapter: chapter }, function (data) {
  1098. property.chapter = data.chapter;
  1099. $('#bd-set-6').modal('hide');
  1100. });
  1101. }
  1102. </script>