| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166 |
- <!DOCTYPE HTML>
- <html xmlns:th="http://www.thymeleaf.org"
- xmlns:layout="http://www.ultraq.net.nz/thymeleaf/layout"
- layout:decorate="~{admin/common/common}">
- <head>
- <title>水费编辑</title>
- <style>
- .line {
- display: block;
- text-align: left;
- background-color: #fff;
- color: #333;
- border-bottom: 1px solid #0a6999;
- border-color: #fff;
- border-bottom: 1px solid #0a6999;
- margin-top: 10px;
- vertical-align: middle;
- padding: 4px 12px;
- height: 31px;
- line-height: 31px;
- font-size: 14px;
- font-weight: bold;
- }
- .input-text {
- width: 110PX;
- }
- </style>
- </head>
- <body layout:fragment="content">
- <article class="page-container">
- <form class="form form-horizontal" id="form-electricWater-edit">
- <div class="line">基本信息</div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">客户名称:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span th:text="${companyName}"></span>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2">合同编号:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <span th:each="contractNo,iterStat:${contractNoes}">
- [[*{contractNo}]] <span th:if="${iterStat.last}"></span><span th:unless="${iterStat.last}">,</span>
- </span>
- </div>
- </div>
- <div id="waterFee">
- <input type="hidden" th:value="${waterFee.id}" th:name="id">
- <div class="line">水费信息</div>
- <div>
- <div class="btn" style="margin-top: 15px">抄表信息</div>
- <table id="waterReadTb" class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr class="text-c">
- <th>水表名称</th>
- <th>上期抄表日</th>
- <th>本期抄表日</th>
- <th>用水量</th>
- <th>单价</th>
- <th>小计金额(元)</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c water_read_company" th:each="water,iterStat:${waterReadCompanies}"
- th:object="${water}">
- <td th:text="*{water_name}"></td>
- <td th:text="*{meter_write_before}"></td>
- <td th:text="*{meter_write}"></td>
- <td class="use_water" th:text="*{use_water}"></td>
- <td>
- <input type="hidden" th:value="*{id}"
- th:name="'waterReadCompanies['+${iterStat.index}+'].id'"/>
- <input type="text" required number="true" min="0" max="999.9999" th:value="*{water_price}"
- class="input-text water_price"
- th:onchange="'isfloat4Fn(this);initTotalFee('+${iterStat.index}+');'"
- th:name="'waterReadCompanies['+${iterStat.index}+'].water_price'"/></td>
- <td><input type="text" th:value="*{total_fee}" class="input-text total_fee readonly" readonly
- th:name="'waterReadCompanies['+${iterStat.index}+'].total_fee'"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="5">其他费用</td>
- <td>
- <input type="text" class="input-text other_fee" required number="true" min="0"
- max="999.9999" th:value="${waterFee.other_fee}" th:name="other_fee"
- onchange="isfloat4Fn(this);initTotalFee();"/></td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="4">合计</td>
- <td><span>用水量:</span><span th:text="${waterFee.use_water}"></span><span>(吨)</span></td>
- <td><input type="text" class="input-text readonly water_fee" readonly
- th:value="${waterFee.water_fee}" th:name="water_fee"/></td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="row cl">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>是否已缴费:</label>
- <div class="formControls col-xs-8 col-sm-3">
- <span class="select-box">
- <select class="select" th:name="status" id="status" >
- <option value="0" th:selected="${waterFee.status}=='0'">未缴费</option>
- <option value="2" th:selected="${waterFee.status}=='2'">已缴费</option>
- </select>
- </span>
- </div>
- </div>
- <div class="row cl" id="manageRow">
- <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
- <button class="btn btn-primary radius" type="submit"><i class="Hui-iconfont"></i>保存</button>
- <button onClick="removeIframe();" class="btn btn-default radius" type="button"> 取消 </button>
- </div>
- </div>
- </form>
- </article>
- <script type="text/javascript" th:src="@{/js/build/water/water_fee_edit.js}"></script>
- <script th:inline="javascript">
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- function initTotalFee(obj) {
- var all_fee = 0;
- var other_fee = $(".other_fee").val();
- $(".water_read_company").each(function (index, item) {
- if (index == obj && obj != null && $.trim(obj) != '') {
- $(item).find(".total_fee").val(parseFloat($(item).find(".water_price").val()) * parseFloat($(item).find(".use_water").text()));
- }
- if ($(item).find(".total_fee").val()) {
- all_fee += parseFloat($(item).find(".total_fee").val());
- } else {
- all_fee += 0;
- }
- });
- if (other_fee) {
- all_fee = accAdd(parseFloat(other_fee),all_fee);
- }
- $(".water_fee").val(all_fee);
- }
- function isfloat4Fn(obj) {
- var val = $(obj).val();
- if (/^\d+(\.\d{1,4})?$/.test(String(val)) == false) {
- errorMessage("小数点后最多4位小数");
- $(obj).val(0);
- }
- }
- </script>
- </body>
- </html>
|