contract_modal_edit.html 51 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993
  1. <!DOCTYPE HTML>
  2. <html xmlns:th="http://www.thymeleaf.org"
  3. xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
  4. layout:decorate="~{admin/common/common}">
  5. <head>
  6. <title>编辑内容</title>
  7. </head>
  8. <body layout:fragment="content">
  9. <style>
  10. .col-sm-2 {
  11. width: 13.666667%
  12. }
  13. .error {
  14. text-align: left !important;
  15. display: block;
  16. }
  17. .width-180 {
  18. width: 180px
  19. }
  20. .width-80 {
  21. width: 80px
  22. }
  23. .width-25 {
  24. width: 25px
  25. }
  26. .btn-primary {
  27. margin-top: 10px
  28. }
  29. .line {
  30. display: block;
  31. text-align: left;
  32. background-color: #fff;
  33. color: #333;
  34. border-bottom: 1px solid #0a6999;
  35. border-color: #fff;
  36. border-bottom: 1px solid #0a6999;
  37. margin-top: 10px;
  38. vertical-align: middle;
  39. padding: 4px 12px;
  40. height: 31px;
  41. line-height: 31px;
  42. font-size: 14px;
  43. font-weight: bold;
  44. }
  45. .margin-top-10 {
  46. margin-top: 10px;
  47. }
  48. </style>
  49. <article class="page-container">
  50. <form class="form form-horizontal" id="form-contract-edit">
  51. <input type="hidden" name="is_tenancy" id="is_tenancy" th:value="${contract.is_tenancy}"/>
  52. <input type="hidden" name="is_property" id="is_property" th:value="${contract.is_property}"/>
  53. <input type="hidden" name="is_parking" id="is_parking" th:value="${contract.is_parking}"/>
  54. <input type="hidden" name="is_water" id="is_water" th:value="${contract.is_water}"/>
  55. <input type="hidden" name="is_electric" id="is_electric" th:value="${contract.is_electric}"/>
  56. <div class="line">基本信息</div>
  57. <input type="hidden" th:id="contract_id" th:name="contract_id" th:value="${contract.id}"/>
  58. <div class="row cl">
  59. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>合同编号:</label>
  60. <div class="formControls col-xs-8 col-sm-4">
  61. <input type="text" required
  62. maxlength="45" class="input-text readonly " th:name="contract_no"
  63. th:value="${contract.contract_no}" disabled/>
  64. </div>
  65. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>企业名称:</label>
  66. <div class="formControls col-xs-8 col-sm-4">
  67. <input type="text" style="width:74%" required placeholder="点击查找按钮查找公司"
  68. maxlength="45" class="input-text readonly " id="company_name" th:name="company_name"
  69. th:value="${contract.company_name}" disabled/>
  70. <input type="hidden" th:name="company_id" th:value="${contract.company_id}"/>
  71. </div>
  72. </div>
  73. <div class="row cl" th:each="companyContact,iterStat:${contract.companyContacts}" th:object="${companyContact}">
  74. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>联系人:</label>
  75. <div class="formControls col-xs-8 col-sm-4">
  76. <input type="text" class="input-text readonly" required maxlength="45" disabled
  77. th:value="*{contact}"/>
  78. </div>
  79. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>联系电话:</label>
  80. <div class="formControls col-xs-8 col-sm-4">
  81. <input type="text" class="input-text readonly" required maxlength="45" disabled
  82. th:value="*{phone}"/>
  83. </div>
  84. </div>
  85. <div class="row cl">
  86. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>合同生效日:</label>
  87. <div class="formControls col-xs-8 col-sm-4">
  88. <input type="text" th:name="contract_start_date" disabled
  89. th:value="${contract.contract_start_date}"
  90. id="datemin" class="input-text readonly">
  91. </div>
  92. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>合同到期日:</label>
  93. <div class="formControls col-xs-8 col-sm-4">
  94. <input type="text" th:name="contract_end_date" disabled th:value="${contract.contract_end_date}"
  95. id="datemax" class="input-text readonly">
  96. </div>
  97. </div>
  98. <div class="row cl">
  99. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>单位地址:</label>
  100. <div class="formControls col-xs-8 col-sm-4">
  101. <input type="text" class="input-text readonly" disabled maxlength="45" th:name="location"
  102. th:value="${contract.location}"/>
  103. </div>
  104. <!-- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>经营范围:</label>
  105. <div class="formControls col-xs-8 col-sm-4">
  106. <input type="text" class="input-text" required maxlength="45" th:name="business" th:value="${contract.business}"/>
  107. </div> -->
  108. </div>
  109. <div class="row cl">
  110. <label class="form-label col-xs-4 col-sm-2"><span>合同上传:</span></label>
  111. <div class="formControls col-xs-8 col-sm-9">
  112. <div class="uploader-thum-container">
  113. <div id="fileListPre" class="uploader-list">
  114. <th:block th:unless="${contract.fileDown.file_url} == null">
  115. <a th:href="${fileUrl} + ${contract.fileDown.file_url}" target="_blank">[[${contract.fileDown.file_name}]]</a>
  116. </th:block>
  117. </div>
  118. <input type="hidden" name="file_url" id="img" th:value="${contract.fileDown.file_url}"/>
  119. </div>
  120. </div>
  121. </div>
  122. <div class="row cl">
  123. <label class="form-label col-xs-4 col-sm-2">备注:</label>
  124. <div class="formControls col-xs-8 col-sm-9">
  125. <textarea name="" cols="" rows="" th:name="remark" disabled class="textarea readonly"
  126. placeholder="说点什么..."
  127. dragonfly="true" onKeyUp="$.Huitextarealength(this,200)">[[${contract.remark}]]</textarea>
  128. </div>
  129. </div>
  130. <div class="row cl">
  131. <label class="form-label col-xs-4 col-sm-2">选择需要填写的模块:</label>
  132. <input type="checkbox" class="type is_tenancy" value="1" th:checked="${contract.is_tenancy}" th:text="房屋租赁"
  133. onclick="selectModal(this)">
  134. <input type="checkbox" class="type is_water" value="2" th:checked="${contract.is_water}" th:text="水费"
  135. onclick="selectModal(this)">
  136. <input type="checkbox" class="type is_electric" value="3" th:checked="${contract.is_electric}" th:text="电费"
  137. onclick="selectModal(this)">
  138. <input type="checkbox" class="type is_property" value="4" th:checked="${contract.is_property}" th:text="物业费"
  139. onclick="selectModal(this)">
  140. <input type="checkbox" class="type is_parking" value="5" th:checked="${contract.is_parking}" th:text="停车费"
  141. onclick="selectModal(this)">
  142. </div>
  143. <div id="tenancy_fee">
  144. <div class="line">房屋租赁</div>
  145. <div class="row cl">
  146. <div class="formControls col-xs-8 col-sm-12">
  147. <div id="tenancy_fee_add"><i class="Hui-iconfont" onclick="addFloorLine()">&#xe600;</i></div>
  148. <table class="table table-border table-bordered table-bg table-hover">
  149. <thead>
  150. <tr class="text-c">
  151. <th>楼栋</th>
  152. <th>层</th>
  153. <th>可用面积(平方米)</th>
  154. <th>面积(平方米)</th>
  155. <th>单价(元/月/平方米)</th>
  156. <th>备注</th>
  157. <!-- <th width="100">操作</th> -->
  158. </tr>
  159. </thead>
  160. <tbody class="add_floor_line">
  161. <tr class="text-c ">
  162. <td>
  163. <div class="formControls col-sm-12 text-left">
  164. <span class="select-box">
  165. <input type="hidden" class="floor_id" th:name="buildLives[0].floor_id"/>
  166. <select class="select build_number" th:name="buildLives[0].build_number"
  167. onchange="setAttr(this);">
  168. <option value="">--请选择--</option>
  169. <option th:attr="floor_id=${item.id}"
  170. th:each="item : ${buildings}" th:value="${item.build_number}"
  171. th:text="${item.build_number}">
  172. </option>
  173. </select>
  174. </span>
  175. </div>
  176. </td>
  177. <td>
  178. <div class="formControls col-sm-12 text-left">
  179. <span class="select-box">
  180. <select class="select floor" th:name="buildLives[0].floor"
  181. onchange="setAreaPrice(this);">
  182. <option value="">--请选择--</option>
  183. </select>
  184. </span>
  185. </div>
  186. </td>
  187. <td>
  188. <div class="formControls col-sm-12 text-left">
  189. <span class=" remain_area"></span>
  190. </div>
  191. </td>
  192. <td>
  193. <div class="formControls col-sm-12 text-left">
  194. <input type="text" class="input-text use_area" number="true"
  195. min="0" max="99999.9999" th:name="buildLives[0].use_area"
  196. onchange="getPaidFee();getTotalArea();"/>
  197. </div>
  198. </td>
  199. <td>
  200. <div class="formControls col-sm-12 text-left">
  201. <input type="text" class="input-text pay" max="999.99" number="true"
  202. min="0"
  203. th:name="buildLives[0].pay" onchange="getPaidFee()"/>
  204. </div>
  205. </td>
  206. <td>
  207. <div class="formControls col-sm-12 text-left">
  208. <input type="text" class="input-text remarks" maxlength="255"
  209. th:name="buildLives[0].remarks"/>
  210. </div>
  211. </td>
  212. <!-- <td class="icon_font"></td> -->
  213. </tr>
  214. </tbody>
  215. </table>
  216. </div>
  217. </div>
  218. <div class="row cl">
  219. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>已收房租:</label>
  220. <div class="formControls col-xs-8 col-sm-4">
  221. <div class="col-sm-6 nopadding">
  222. <input type="text" class="input-text width-180" style="width:50%" th:id="paid_tenancy_month"
  223. digits="true"
  224. th:name="paid_tenancy_month" maxlength="2" th:value="${contract.paid_tenancy_month}"
  225. onchange="getPaidFee()"/><span> 个月,</span>
  226. </div>
  227. <div class="col-sm-6 nopadding">
  228. <span>共</span>
  229. <input type="text" class="input-text width-180 disabled" disabled="disabled" style="width:74%"
  230. th:id="paid_tenancy" maxlength="20" number="true" min="0"
  231. th:name="paid_tenancy" th:value="${contract.paid_tenancy}"/><span
  232. style="margin-left:3px"> 元</span>
  233. </div>
  234. </div>
  235. <label class="form-label col-xs-4 col-sm-2">总面积(m²):</label>
  236. <div class="formControls col-xs-8 col-sm-4">
  237. <input type="hidden" th:name="area" id="area"/>
  238. <span id="total_area">[[${contract.area}]]</span>
  239. </div>
  240. </div>
  241. <div class="row cl">
  242. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>押金(元):</label>
  243. <div class="formControls col-xs-8 col-sm-4">
  244. <input type="text" class="input-text" maxlength="10" number="true" min="0" max="99999.9999"
  245. th:name="deposit_fee" th:value="${contract.deposit_fee}" onchange="isfloat2Fn(value)"/>
  246. </div>
  247. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>收款周期:</label>
  248. <div class="formControls col-xs-8 col-sm-4">
  249. <input type="text" class="input-text width-180" th:id="tenancy_payment_cycle"
  250. th:value="${contract.tenancy_payment_cycle}"
  251. th:name="tenancy_payment_cycle"/><span>月一次</span>
  252. </div>
  253. </div>
  254. </div>
  255. <div id="water_fee">
  256. <div class="line">水费</div>
  257. <div class="row cl">
  258. <div class="formControls col-xs-8 col-sm-12">
  259. <div id="water_fee_add"><i class="Hui-iconfont hand" onclick="addWaterLine()">&#xe600;</i></div>
  260. <table class="table table-border table-bordered table-bg table-hover">
  261. <thead>
  262. <tr class="text-c">
  263. <th>水表</th>
  264. <th>初始读数</th>
  265. <th class="width-25">操作</th>
  266. </tr>
  267. </thead>
  268. <tbody class="add_water_line">
  269. <tr class="text-c " th:if="${#lists.isEmpty(contractWaters)}">
  270. <td>
  271. <div class="formControls col-sm-12 text-left">
  272. <select id="water_select_0" class="water_select"
  273. th:name="contractWaterList[0].water_id" onchange="checkWaterName(this)">
  274. <option value="">--请选择--</option>
  275. <option th:each="item : ${waters}" th:attr="is_common=${item.is_common}"
  276. th:value="${item.id}">
  277. [[*{item.name}]] <span class="ml_5" th:if="${item.is_common}">共用</span>
  278. </option>
  279. </select>
  280. </div>
  281. </td>
  282. <td>
  283. <div class="formControls col-sm-12 text-left">
  284. <input type="text" class="input-text start_water_meter_count"
  285. maxlength="10" number="true" min="0"
  286. th:name="contractWaterList[0].start_water_meter_count"/>
  287. </div>
  288. </td>
  289. <!-- <td><input type="text" class="input-text water_price"
  290. maxlength="20" number="true" min="0" th:name="contractWaterList[0].water_price"/></td> -->
  291. <td class="icon_font"></td>
  292. </tr>
  293. <tr class="text-c " th:unless="${#lists.isEmpty(contractWaters)}"
  294. th:each="water,iterStat : ${contractWaters}" th:object="${water}">
  295. <td>
  296. <div class="formControls col-sm-12 text-left">
  297. <select th:id="'water_select_'+${iterStat.index}" class="water_select"
  298. th:name="'contractWaterList['+${iterStat.index}+'].water_id'"
  299. onchange="checkWaterName(this)">
  300. <option value="">--请选择--</option>
  301. <option th:each="item : ${waters}" th:attr="is_common=${item.is_common}"
  302. th:value="${item.id}" th:selected="${item.id}==*{water_id}">
  303. [[${item.name}]] <span class="ml_5" th:if="${item.is_common}">共用</span>
  304. </option>
  305. </select>
  306. </div>
  307. </td>
  308. <td>
  309. <div class="formControls col-sm-12 text-left">
  310. <input type="text" class="input-text start_water_meter_count"
  311. maxlength="10" number="true" min="0" th:value="*{start_water_meter_count}"
  312. th:name="'contractWaterList['+${iterStat.index}+'].start_water_meter_count'"/>
  313. </div>
  314. </td>
  315. <td class="icon_font"></td>
  316. </tr>
  317. </tbody>
  318. </table>
  319. </div>
  320. </div>
  321. </div>
  322. <div id="electric_fee">
  323. <div class="line">电费</div>
  324. <div class="row cl">
  325. <div class="formControls col-xs-8 col-sm-12">
  326. <div id="electric_fee_add"><i class="Hui-iconfont hand" onclick="addElectricLine()">&#xe600;</i>
  327. </div>
  328. <table class="table table-border table-bordered table-bg table-hover">
  329. <thead>
  330. <tr class="text-c">
  331. <th>电表</th>
  332. <th>初始读数</th>
  333. <th>初始峰值读数</th>
  334. <th>初始平峰读数</th>
  335. <th>初始谷值读数</th>
  336. <th class="width-25">操作</th>
  337. </tr>
  338. </thead>
  339. <tbody class="add_electric_line">
  340. <tr th:if="${#lists.isEmpty(contractElectrics)}" class="text-c ">
  341. <td>
  342. <div class="formControls col-sm-12 text-left">
  343. <select id="electric_select_0" class="electric_select"
  344. th:name="contractElectrics[0].electric_id"
  345. onchange="checkElectricName(this)">
  346. <option value="">--请选择--</option>
  347. <option th:each="item : ${electrics}"
  348. th:attr="is_common=${item.is_common},is_peak=${item.is_peak}"
  349. th:value="${item.id}">
  350. [[${item.name}]] <span class="ml_5" th:if="${item.is_peak}">峰平谷值电表</span>
  351. <span class="ml_5" th:unless="${item.is_peak}">通用电表</span><span class="ml_5" th:if="${item.is_common}">共用</span>
  352. </option>
  353. </select>
  354. </div>
  355. </td>
  356. <td class="commonElectric">
  357. <div class="formControls col-sm-12 text-left">
  358. <input type="text" class="input-text start_electric_meter_count"
  359. maxlength="10" number="true" min="0"
  360. th:name="contractElectrics[0].start_electric_meter_count"/>
  361. </div>
  362. </td>
  363. <td class="peakValleyElectric">
  364. <div class="formControls col-sm-12 text-left">
  365. <input type="text" class="input-text start_electric_peak_count"
  366. disabled number="true" min="0" max="99999.9999"
  367. th:name="contractElectrics[0].start_electric_peak_count"
  368. onchange="isfloat4Fn(value)"/>
  369. </div>
  370. </td>
  371. <td class="peakValleyElectric">
  372. <div class="formControls col-sm-12 text-left">
  373. <input type="text" class="input-text start_electric_flat_count"
  374. disabled number="true" min="0" max="99999.9999"
  375. th:name="contractElectrics[0].start_electric_flat_count"
  376. onchange="isfloat4Fn(value)"/>
  377. </div>
  378. </td>
  379. <td class="peakValleyElectric">
  380. <div class="formControls col-sm-12 text-left">
  381. <input type="text" class="input-text start_electric_valley_count"
  382. disabled number="true" min="0" max="99999.9999"
  383. th:name="contractElectrics[0].start_electric_valley_count"
  384. onchange="isfloat4Fn(value)"/>
  385. </div>
  386. </td>
  387. <!-- <td><input type="text" class="input-text electric_price"
  388. maxlength="20" number="true" min="0" th:name="contractElectrics[0].electric_price"/></td>
  389. -->
  390. <td class="icon_font"></td>
  391. </tr>
  392. <tr class="text-c " th:unless="${#lists.isEmpty(contractElectrics)}"
  393. th:each="electric,iterStat : ${contractElectrics}" th:object="${electric}">
  394. <td>
  395. <div class="formControls col-sm-12 text-left">
  396. <select th:id="'electric_select_'+${iterStat.index}" class="electric_select"
  397. th:name="'contractElectrics['+${iterStat.index}+'].electric_id'"
  398. onchange="checkElectricName(this)">
  399. <option value="">--请选择--</option>
  400. <option th:each="item : ${electrics}" th:selected="${item.id}==*{electric_id}"
  401. th:attr="is_common=${item.is_common},is_peak=${item.is_peak}"
  402. th:value="${item.id}">
  403. [[${item.name}]] <span class="ml_5" th:if="${item.is_peak}">峰平谷值电表</span>
  404. <span class="ml_5" th:unless="${item.is_peak}">通用电表</span><span class="ml_5" th:if="${item.is_common}">共用</span>
  405. </option>
  406. </select>
  407. </div>
  408. </td>
  409. <td class="commonElectric">
  410. <div class="formControls col-sm-12 text-left">
  411. <input type="text" class="input-text start_electric_meter_count"
  412. maxlength="10" number="true" min="0" th:value="*{start_electric_meter_count}"
  413. th:name="'contractElectrics['+${iterStat.index}+'].start_electric_meter_count'"/>
  414. </div>
  415. </td>
  416. <td class="peakValleyElectric">
  417. <div class="formControls col-sm-12 text-left">
  418. <input type="text" class="input-text start_electric_peak_count"
  419. disabled number="true" min="0" max="99999.9999"
  420. th:value="*{start_electric_peak_count}"
  421. th:name="'contractElectrics['+${iterStat.index}+'].start_electric_peak_count'"
  422. onchange="isfloat4Fn(value)"/>
  423. </div>
  424. </td>
  425. <td class="peakValleyElectric">
  426. <div class="formControls col-sm-12 text-left">
  427. <input type="text" class="input-text start_electric_flat_count"
  428. disabled number="true" min="0" max="99999.9999"
  429. th:value="*{start_electric_flat_count}"
  430. th:name="'contractElectrics['+${iterStat.index}+'].start_electric_flat_count'"
  431. onchange="isfloat4Fn(value)"/>
  432. </div>
  433. </td>
  434. <td class="peakValleyElectric">
  435. <div class="formControls col-sm-12 text-left">
  436. <input type="text" class="input-text start_electric_valley_count"
  437. disabled number="true" min="0" max="99999.9999"
  438. th:value="*{start_electric_valley_count}"
  439. th:name="'contractElectrics['+${iterStat.index}+'].start_electric_valley_count'"
  440. onchange="isfloat4Fn(value)"/>
  441. </div>
  442. </td>
  443. <td class="icon_font"></td>
  444. </tr>
  445. </tbody>
  446. </table>
  447. </div>
  448. </div>
  449. </div>
  450. <div id="property_fee">
  451. <div class="line">物业费用</div>
  452. <div class="row cl">
  453. <div class="formControls col-xs-8 col-sm-12">
  454. <table class="table table-border table-bordered table-bg table-hover">
  455. <thead>
  456. <tr class="text-c">
  457. <th>费用项</th>
  458. <th>价格</th>
  459. <th>面积</th>
  460. <th>收款周期</th>
  461. <th width="300">说明</th>
  462. </tr>
  463. </thead>
  464. <tbody>
  465. <tr class="text-c">
  466. <td>
  467. 物业费
  468. </td>
  469. <td>
  470. <div class="formControls col-sm-12 text-left">
  471. <input type="text" class="input-text width-80" number="true" min="0"
  472. max="99999.9999" th:value="${property.price}"
  473. th:name="contractProperty.price"
  474. onchange="isfloat4Fn(value)"/>元/月/平方米
  475. </div>
  476. </td>
  477. <td>
  478. <div class="formControls col-sm-12 text-left">
  479. <input type="text" class="input-text width-80" maxlength="10" number="true"
  480. min="0" th:value="${property.number}" th:name="contractProperty.number"/>/平方米
  481. </div>
  482. </td>
  483. <td>
  484. <div class="formControls col-sm-12 text-left">
  485. <input type="text" class="input-text width-80" digits="true" range="[1,12]"
  486. th:name="contractProperty.payment_cycle"
  487. th:value="${property.payment_cycle}"/><span>月一次</span>
  488. </div>
  489. </td>
  490. <td>
  491. <div class="formControls col-sm-12 text-left">
  492. <input type="text" class="input-text" maxlength="45"
  493. th:name="contractProperty.remarks" th:value="${property.remarks}"/>
  494. </div>
  495. </td>
  496. </tr>
  497. </tbody>
  498. </table>
  499. </div>
  500. </div>
  501. </div>
  502. <div id="parking_fee">
  503. <div class="line">停车费用</div>
  504. <div class="row cl">
  505. <div class="formControls col-xs-8 col-sm-12">
  506. <!-- <div><i class="Hui-iconfont" onclick="addParkingLine()">&#xe600;</i></div> -->
  507. <table class="table table-border table-bordered table-bg table-hover">
  508. <thead>
  509. <tr class="text-c">
  510. <th>费用项</th>
  511. <th>价格</th>
  512. <th>数量</th>
  513. <th>收款周期</th>
  514. <th width="300">说明</th>
  515. <!--<th>操作</th>-->
  516. </tr>
  517. </thead>
  518. <tbody class="add_parking_line">
  519. <tr class="text-c ">
  520. <td>
  521. 停车费
  522. </td>
  523. <td>
  524. <div class="formControls col-sm-12 text-left">
  525. <input type="text" class="input-text width-80 price" number="true" min="0"
  526. max="99999.9999" th:name="contractParking.price" th:value="${parking.price}"
  527. onchange="isfloat4Fn(value)"/>元/月/个
  528. </div>
  529. </td>
  530. <td>
  531. <div class="formControls col-sm-12 text-left">
  532. <input type="text" class="input-text width-80 number" maxlength="10"
  533. number="true" min="0" th:name="contractParking.number"
  534. th:value="${parking.number}"/>/个
  535. </div>
  536. </td>
  537. <td>
  538. <div class="formControls col-sm-12 text-left">
  539. <input type="text" class="input-text width-80 payment_cycle" digits="true"
  540. range="[1,12]"
  541. th:name="contractParking.payment_cycle"
  542. th:value="${parking.payment_cycle}"/><span>月一次</span>
  543. </div>
  544. </td>
  545. <td>
  546. <div class="formControls col-sm-12 text-left">
  547. <input type="text" class="input-text remarks" maxlength="45"
  548. th:name="contractParking.remarks" th:value="${parking.remarks}"/>
  549. </div>
  550. </td>
  551. <!--<td class="icon_font"><i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i></td>-->
  552. </tr>
  553. </tbody>
  554. </table>
  555. </div>
  556. </div>
  557. </div>
  558. <div class="row cl">
  559. <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>缴费日期前</label>
  560. <div class="formControls col-xs-8 col-sm-4">
  561. <input type="text" class="input-text width-180 readonly" required disabled th:id="remind_day" th:value="${contract.remind_day}"
  562. th:name="remind_day"/><span>天提醒</span>
  563. </div>
  564. </div>
  565. <div class="row cl">
  566. <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
  567. <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont">&#xe632;</i> 保存
  568. </button>
  569. <button onClick="removeIframe();" class="btn margin-top-10 btn-default radius" type="button">&nbsp;&nbsp;取消&nbsp;&nbsp;</button>
  570. </div>
  571. </div>
  572. </form>
  573. </article>
  574. <script type="text/javascript" th:src="@{/js/build/contract/contract_edit_modal.js}"></script>
  575. <script th:inline="javascript">
  576. $("#electric_fee").hide();
  577. $("#water_fee").hide();
  578. $("#property_fee").hide();
  579. $("#parking_fee").hide();
  580. $("#tenancy_fee").hide();
  581. var options = {
  582. uploadBtnId: '#filePicker',
  583. picturePreId: 'fileListPre',
  584. hiddenPictureUrl: 'img',
  585. hiddenPictureName: 'imgName',
  586. // accept : {
  587. // title : 'Images',
  588. // extensions : 'gif,jpg,jpeg,bmp,png',
  589. // mimeTypes : 'image/gif,image/jpg,image/jpeg,image/bmp,image/png'
  590. // },
  591. width: 81,
  592. height: 81,
  593. fileSizeLimit: 100 * 1024 * 1024,
  594. fileSingleSizeLimit: 100 * 1024 * 1024
  595. // fileNumLimit: 1
  596. };
  597. var webUploadPicture = new $WebUploadDoc(options);
  598. webUploadPicture.init();
  599. $(document).ready(function () {
  600. initDisabled();
  601. $(".water_select").each(function (index, obj) {
  602. initWaterSelect(index);
  603. });
  604. $(".electric_select").each(function (index, obj) {
  605. initElectricSelect(index);
  606. });
  607. });
  608. function initDisabled() {
  609. if ($("input[name='is_tenancy']").val() == 'true') {
  610. $(".is_tenancy").attr("disabled", "disabled");
  611. $(".is_tenancy").addClass("disabled", "disabled");
  612. $("#tenancy_fee").show();
  613. $("#tenancy_fee").find("input").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  614. .find("select").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  615. .find("#tenancy_fee_add").hide();
  616. }
  617. if ($("input[name='is_water']").val() == 'true') {
  618. $(".is_water").attr("disabled", "disabled");
  619. $(".is_water").addClass("disabled", "disabled");
  620. $("#water_fee").show();
  621. $("#water_fee").find("input").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  622. .find("select").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  623. .find("#water_fee_add").hide();
  624. }
  625. if ($("input[name='is_electric']").val() == 'true') {
  626. $(".is_electric").attr("disabled", "disabled");
  627. $(".is_electric").addClass("disabled", "disabled");
  628. $("#electric_fee").show();
  629. $("#electric_fee").find("input").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  630. .find("select").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  631. .find("#electric_fee_add").hide();
  632. }
  633. if ($("input[name='is_property']").val() == 'true') {
  634. $(".is_property").attr("disabled", "disabled");
  635. $(".is_property").addClass("disabled", "disabled");
  636. $("#property_fee").show();
  637. $("#property_fee").find("input").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  638. .find("select").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  639. }
  640. if ($("input[name='is_parking']").val() == 'true') {
  641. $(".is_parking").attr("disabled", "disabled");
  642. $(".is_parking").addClass("disabled", "disabled");
  643. $("#parking_fee").show();
  644. $("#parking_fee").find("input").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  645. .find("select").attr("disabled", "disabled").addClass("disabled", "disabled").end()
  646. }
  647. }
  648. function initWaterSelect(index) {
  649. $("#water_select_" + index).select2({
  650. width: '150px',
  651. language: {
  652. noResults: function (params) {
  653. return "暂无数据";
  654. }
  655. }
  656. });
  657. }
  658. function initElectricSelect(index) {
  659. $("#electric_select_" + index).select2({
  660. width: '150px',
  661. language: {
  662. noResults: function (params) {
  663. return "暂无数据";
  664. }
  665. }
  666. });
  667. }
  668. /**
  669. * 取消
  670. */
  671. function removeIframe() {
  672. var index = parent.layer.getFrameIndex(window.name);
  673. parent.layer.close(index);
  674. }
  675. $(function () {
  676. // 日期表单初始化
  677. laydate.render({
  678. elem: '#datemax'
  679. });
  680. laydate.render({
  681. elem: '#datemin'
  682. });
  683. addFloorLine([[${buildLives}]]);
  684. });
  685. function addFloorLine(buildLives) {
  686. if (buildLives.length!=0) {
  687. for (var i = 0; i < buildLives.length; i++) {
  688. var length = i;
  689. var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
  690. $(".add_floor_line tr:eq(0)").clone().insertAfter($('.add_floor_line>tr').eq(-1))
  691. .find(".floor_id").removeAttr("name").attr("name", "buildLives[" + i + "].floor_id").val(buildLives[i].floor_id).end()
  692. .find(".build_number").removeAttr("name").attr("name", "buildLives[" + i + "].build_number").val(buildLives[i].build_number).end()
  693. .find(".floor").removeAttr("name").attr("name", "buildLives[" + i + "].floor").val(buildLives[i].floor).end()
  694. .find(".use_area").removeAttr("name").attr("name", "buildLives[" + i + "].use_area").val(buildLives[i].use_area).end()
  695. .find(".pay").removeAttr("name").attr("name", "buildLives[" + i + "].pay").val(buildLives[i].pay).end()
  696. .find(".remarks").removeAttr("name").attr("name", "buildLives[" + i + "].remarks").val(buildLives[i].remarks).end();
  697. //.find(".icon_font").html(html).end();
  698. $('#layui-layer2').height(48);
  699. //给楼栋楼层赋值
  700. setAttr($(".add_floor_line tr:eq(" + (1 + length) + ")").find(".build_number"), buildLives[i].floor);
  701. }
  702. $(".add_floor_line tr:eq(0)").remove();
  703. }
  704. }
  705. function addElectricLine() {
  706. var length = $(".add_electric_line tr").length;
  707. var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
  708. $(".add_electric_line tr:eq(0)").clone().insertAfter($('.add_electric_line>tr').eq(-1))
  709. .find(".start_electric_meter_count").removeAttr("name").attr("name", "contractElectrics[" + length + "].start_electric_meter_count").val("").end()
  710. .find(".start_electric_peak_count").removeAttr("name").attr("name", "contractElectrics[" + length + "].start_electric_peak_count").val("").end()
  711. .find(".start_electric_flat_count").removeAttr("name").attr("name", "contractElectrics[" + length + "].start_electric_flat_count").val("").end()
  712. .find(".start_electric_valley_count").removeAttr("name").attr("name", "contractElectrics[" + length + "].start_electric_valley_count").val("").end()
  713. .find(".electric_select").removeAttr("name").removeAttr("id").attr("name", "contractElectrics[" + length + "].electric_id")
  714. .attr("id", "electric_select_" + length).end()
  715. .find("span").remove().end()
  716. .find(".icon_font").html(html).end();
  717. var waterLength = $(".add_water_line tr").length;
  718. if (length >= waterLength) {
  719. $('#layui-layer2').height(48);
  720. }
  721. initElectricSelect(length);
  722. }
  723. function addWaterLine() {
  724. var length = $(".add_water_line tr").length;
  725. var html = "<i class='Hui-iconfont' onclick='removeLine(this)'>&#xe6a1;</i>";
  726. $(".add_water_line tr:eq(0)").clone().insertAfter($('.add_water_line>tr').eq(-1))
  727. .find(".start_water_meter_count").removeAttr("name").attr("name", "contractWaterList[" + length + "].start_water_meter_count").val("").end()
  728. .find(".water_select").removeAttr("name").removeAttr("id").attr("name", "contractWaterList[" + length + "].water_id")
  729. .attr("id", "water_select_" + length).end()
  730. .find("span").remove().end()
  731. .find(".icon_font").html(html).end();
  732. var electricLength = $(".add_electric_line tr").length;
  733. if (length >= electricLength) {
  734. $('#layui-layer2').height(48);
  735. }
  736. initWaterSelect(length);
  737. }
  738. function removeLine(obj) {
  739. if ($(obj).parents("tbody").find("tr").length == 1) {
  740. sadMessage("仅剩最后一行,不能删除!");
  741. } else {
  742. $(obj).parent().parent().remove();
  743. }
  744. }
  745. //obj:楼栋下拉框 , floorValue:楼层值
  746. function setAttr(obj, floorValue) {
  747. if ($(obj).find("option:selected").attr("floor_id")) {
  748. $(".floor_id").val($(obj).find("option:selected").attr("floor_id"));
  749. $(obj).parent().parent().parent().next().find(".floor").html("<option>请选择</option>");
  750. $.ajax({
  751. type: "get",
  752. dataType: "json",
  753. url: pagePath + "/build/contract/findFloor/" + $(obj).find("option:selected").attr("floor_id"),
  754. success: function (result) {
  755. if (result.success) {
  756. var html = "";
  757. var remain_area = "";
  758. $.each(result.obj, function (index, item) {
  759. html += "<option pay='" + item.pay + "' remain_area='" + item.remain_area + "' value='" + item.floor + "'>" + item.floor + "</option>";
  760. if (floorValue && floorValue == item.floor) {
  761. remain_area = item.remain_area;
  762. }
  763. });
  764. $(obj).parents("tr").find(".floor").append(html);
  765. if (floorValue) {
  766. $(obj).parents("tr").find(".floor").val(floorValue);
  767. $(obj).parents("tr").find(".remain_area").text(remain_area);
  768. }
  769. } else {
  770. errorMessage(result.message);
  771. }
  772. },
  773. error: function () {
  774. errorMessage('系统错误!');
  775. }
  776. });
  777. } else {
  778. $(obj).parent().parent().parent().next().find(".floor").html("<option>请选择</option>");
  779. $(obj).parent().parent().parent().next().next().find(".use_area").val("");
  780. $(obj).parent().parent().parent().next().next().find(".remain_area").text("");
  781. $(obj).parent().parent().parent().next().next().next().find(".pay").val("");
  782. }
  783. }
  784. function setAreaPrice(obj) {
  785. $(obj).parent().parent().parent().next().find(".use_area").val($(obj).find("option:selected").attr("remain_area"));
  786. $(obj).parent().parent().parent().next().find(".remain_area").text($(obj).find("option:selected").attr("remain_area"));
  787. getTotalArea();
  788. }
  789. function getTotalArea() {
  790. var totalArea = 0;
  791. $(".add_floor_line").find(".use_area").each(function () {
  792. totalArea += parseFloat($(this).val() == "" ? 0 : $(this).val());
  793. });
  794. $("#total_area").text(totalArea);
  795. $("#area").val(totalArea);
  796. }
  797. function getPaidFee() {
  798. var totalMonthFee = 0.0;
  799. $(".add_floor_line").find("tr").each(function () {
  800. var floorArea = parseFloat($(this).find(".use_area").val() == "" ? 0 : $(this).find(".use_area").val());
  801. var floorPay = parseFloat($(this).find(".pay").val() == "" ? 0 : $(this).find(".pay").val());
  802. totalMonthFee += (floorArea * floorPay);
  803. });
  804. var paid_tenancy = parseFloat($("#paid_tenancy_month").val() == "" ? 0 : $("#paid_tenancy_month").val()) * totalMonthFee;
  805. $("#paid_tenancy").val(paid_tenancy.toFixed(2));
  806. }
  807. function checkWaterName(obj) {
  808. var index = $(".add_water_line tr").index($(obj).parents("tr"));
  809. $(".add_water_line tr:not(:eq(" + index + "))").find(".water_select").each(function (i, item) {
  810. if ($(this).val() != "" && $(obj).val() == $(this).val()) {
  811. errorMessage("水表名称不能重复!");
  812. $("#" + $(obj).attr("id")).val("").trigger("change");
  813. }
  814. });
  815. var flag = $(obj).find("option:selected").attr("is_common");
  816. if (flag == 'true') {
  817. $(obj).parents("tr").find(".start_water_meter_count").removeAttr("required").attr("disabled", "disabled").val("");
  818. } else {
  819. $(obj).parents("tr").find(".start_water_meter_count").removeAttr("disabled").attr("required");
  820. }
  821. }
  822. function checkElectricName(obj) {
  823. var index = $(".add_electric_line tr").index($(obj).parents("tr"));
  824. $(".add_electric_line tr:not(:eq(" + index + "))").find(".electric_select").each(function (i, item) {
  825. if ($(this).val() != "" && $(obj).val() == $(this).val()) {
  826. errorMessage("电表名称不能重复!");
  827. $("#" + $(obj).attr("id")).val("").trigger("change");
  828. }
  829. });
  830. var is_common = $(obj).find("option:selected").attr("is_common");
  831. var is_peak = $(obj).find("option:selected").attr("is_peak");
  832. if (is_peak == "true") {
  833. $(obj).parents("tr").find(".commonElectric").find("input").each(function () {
  834. $(this).val("");
  835. $(this).attr("disabled", "disabled");
  836. });
  837. $(obj).parents("tr").find(".peakValleyElectric").find("input").each(function () {
  838. $(this).attr("required", "true");
  839. if (is_common == 'false') {
  840. $(this).removeAttr("disabled");
  841. }
  842. });
  843. } else {
  844. $(obj).parents("tr").find(".peakValleyElectric").find("input").each(function () {
  845. $(this).val("");
  846. $(this).attr("disabled", "disabled");
  847. });
  848. $(obj).parents("tr").find(".commonElectric").find("input").each(function () {
  849. if (is_common == 'false') {
  850. $(this).removeAttr("disabled");
  851. }
  852. });
  853. }
  854. }
  855. function isfloat4Fn(val) {
  856. if (/^\d+(\.\d{1,4})?$/.test(String(val)) == false) {
  857. errorMessage("小数点后最多4位小数");
  858. }
  859. }
  860. function isfloat2Fn(val) {
  861. if (/^\d+(\.\d{1,2})?$/.test(String(val)) == false) {
  862. errorMessage("小数点后最多2位小数");
  863. }
  864. }
  865. //查看已用面积,更改面积不能小于已用面积
  866. function checkUseArea(obj) {
  867. var use_area = $(obj).attr("use_area");
  868. if ($(obj).val() - use_area < 0) {
  869. sadMessage("楼层已用面积" + use_area + "平方米,不能小于已用面积!");
  870. $(obj).val("");
  871. }
  872. }
  873. function selectModal(obj) {
  874. var flag = $(obj).prop("checked");
  875. var val = $(obj).val();
  876. if (flag) {
  877. if (val == "1") {
  878. $("#tenancy_fee").show();
  879. $("#is_tenancy").val(true);
  880. $("#tenancy_fee").find("input").attr("required", true).end()
  881. .find("select").attr("required", true).end()
  882. .find("input[type='hidden']").removeAttr("required").end()
  883. .find(".remarks").removeAttr("required").end();
  884. } else if (val == "2") {
  885. $("#water_fee").show();
  886. $("#is_water").val(true);
  887. $("#water_fee").find("input").attr("required", true).end()
  888. .find("input[type='hidden']").removeAttr("required").end()
  889. .find("select").attr("required", true).end();
  890. } else if (val == "3") {
  891. $("#electric_fee").show();
  892. $("#is_electric").val(true);
  893. $("#electric_fee").find("select").attr("required", true).end();
  894. } else if (val == "4") {
  895. $("#property_fee").show();
  896. $("#is_property").val(true);
  897. $("#property_fee").find("input").attr("required", true).end()
  898. .find("input[type='hidden']").removeAttr("required").end()
  899. .find("input[name='contractProperty.remarks']").removeAttr("required").end();
  900. } else if (val == "5") {
  901. $("#parking_fee").show();
  902. $("#is_parking").val(true);
  903. $("#parking_fee").find("input").attr("required", true).end()
  904. .find("input[type='hidden']").removeAttr("required").end()
  905. .find("input[name='contractParking.remarks']").removeAttr("required").end();
  906. }
  907. $('#layui-layer2').height(200);
  908. } else {
  909. if (val == "1") {
  910. $("#tenancy_fee").hide();
  911. $("#is_tenancy").val(false);
  912. $("#tenancy_fee").find("select").removeAttr("required").end()
  913. .find("input").removeAttr("required").end();
  914. } else if (val == "2") {
  915. $("#water_fee").hide();
  916. $("#is_water").val(false);
  917. $("#water_fee").find("select").removeAttr("required").end()
  918. .find("input").removeAttr("required").end();
  919. } else if (val == "3") {
  920. $("#electric_fee").hide();
  921. $("#is_electric").val(false);
  922. $("#electric_fee").find("select").removeAttr("required").end()
  923. .find("input").removeAttr("required").end();
  924. } else if (val == "4") {
  925. $("#property_fee").hide();
  926. $("#is_property").val(false);
  927. $("#property_fee").find("select").removeAttr("required").end()
  928. .find("input").removeAttr("required").end();
  929. } else if (val == "5") {
  930. $("#parking_fee").hide();
  931. $("#is_parking").val(false);
  932. $("#parking_fee").find("select").removeAttr("required").end()
  933. .find("input").removeAttr("required").end();
  934. }
  935. }
  936. }
  937. </script>
  938. </body>
  939. </html>