contract_edit.html 51 KB

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