| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257 |
- <!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="electricFee">
- <div class="line">电费信息</div>
- <input type="hidden" th:value="${electricFee.id}" th:name="id">
- <div class="row cl">
- <div class="formControls col-xs-8 col-sm-12">
- <div class="btn ">抄表信息</div>
- <table id="electricReadTb" class="table table-border table-bordered table-bg table-hover">
- <thead class="text-c">
- <tr class="text-c">
- <th>电表名称</th>
- <th>上期抄表日</th>
- <th>本期抄表日</th>
- <th>倍率</th>
- <th>本期通用(度)</th>
- <th>本期峰值(度)</th>
- <th>本期平值(度)</th>
- <th>本期谷值(度)</th>
- <th>本期通用(元/度)</th>
- <th>本期峰值(元/度)</th>
- <th>本期平值(元/度)</th>
- <th>本期谷值(元/度)</th>
- <th>小计金额(元)</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c electric_read_company" th:each="electric,iterStat:${electricReadCompanies}"
- th:object="${electric}">
- <td th:text="*{electric_name}"></td>
- <td th:text="*{meter_write_before}"></td>
- <td th:text="*{meter_write}"></td>
- <td class="ratio" th:attr="is_peak=*{is_peak}" th:text="*{ratio}"></td>
- <td><span class="electric_count" th:unless="*{is_peak}" th:text="*{electric_count}"></span></td>
- <td><span class="electric_peak_count" th:if="*{is_peak}" th:text="*{electric_peak_count}"></span></td>
- <td><span class="electric_flat_count" th:if="*{is_peak}" th:text="*{electric_flat_count}"></span></td>
- <td><span class="electric_valley_count" th:if="*{is_peak}" th:text="*{electric_valley_count}"></span></td>
- <td>
- <input type="hidden" th:value="*{id}"
- th:name="'electricReadCompanies['+${iterStat.index}+'].id'"/>
- <input th:unless="*{is_peak}" type="text" required number="true" min="0"
- max="999.9999" th:value="*{electric_price}" class="input-text electric_price"
- th:onchange="'isfloat4Fn(this);initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricReadCompanies['+${iterStat.index}+'].electric_price'"/></td>
- <td>
- <input th:if="*{is_peak}" type="text" required number="true" min="0" max="999.9999"
- th:value="*{electric_peak_price}" class="input-text electric_peak_price"
- th:onchange="'isfloat4Fn(this);initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricReadCompanies['+${iterStat.index}+'].electric_peak_price'"/>
- </td>
- <td>
- <input th:if="*{is_peak}" type="text" required number="true" min="0" max="999.9999"
- th:value="*{electric_flat_price}" class="input-text electric_flat_price"
- th:onchange="'isfloat4Fn(this);initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricReadCompanies['+${iterStat.index}+'].electric_flat_price'"/>
- </td>
- <td>
- <input th:if="*{is_peak}" type="text" required number="true" min="0" max="999.9999"
- th:value="*{electric_valley_price}" class="input-text electric_valley_price"
- th:onchange="'isfloat4Fn(this);initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricReadCompanies['+${iterStat.index}+'].electric_valley_price'"/>
- </td>
- <td>
- <input type="text" th:value="*{total_fee}" class="input-text total_fee readonly"
- readonly
- th:name="'electricReadCompanies['+${iterStat.index}+'].total_fee'"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="9">线损费用(元)</td>
- <td colspan="3">
- 线损率: <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- th:value="*{electricFee.wire_loss}" class="input-text wire_loss"
- th:name="wire_loss"/>%
- </td>
- <td>
- <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- th:value="*{electricFee.total_wire_loss}"
- class="input-text readonly total_wire_loss"
- readonly th:name="total_wire_loss"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="12">基本电费(元)</td>
- <td>
- <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- th:value="*{electricFee.base_electric}" class="input-text base_electric"
- th:name="base_electric "/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="12">电力设备租金(元)</td>
- <td>
- <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- th:value="*{electricFee.electric_rent}" class="input-text electric_rent"
- th:name="electric_rent"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="12">其他费用(元)</td>
- <td>
- <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- class="input-text other_fee" required number="true" min="0" max="999.9999"
- th:value="${electricFee.other_fee}" th:name="other_fee"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="9">合计</td>
- <td colspan="3">用电量 <span th:text="${electricFee.use_electric}"></span></td>
- <td>
- <input onchange="isfloat4Fn(this);initElectricTotalFee()" type="text"
- class="input-text readonly electric_fee" readonly
- th:value="${electricFee.electric_fee}" th:name="electric_fee"/>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </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="${electricFee.status}=='0'">未缴费</option>
- <option value="2" th:selected="${electricFee.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/electric/electric_fee_edit.js}"></script>
- <script th:inline="javascript">
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- function isfloat4Fn(obj) {
- var val = $(obj).val();
- if (/^\d+(\.\d{1,4})?$/.test(String(val)) == false) {
- errorMessage("小数点后最多4位小数");
- $(obj).val(0);
- }
- }
- function initElectricTotalFee(obj) {
- var all_fee = 0;
- var other_fee = $(".other_fee").val();
- var total_wire_loss = $(".total_wire_loss").val();
- var base_electric = $(".base_electric").val();
- var electric_rent = $(".electric_rent").val();
- $(".electric_read_company").each(function (index, item) {
- if (index == obj && obj != null && $.trim(obj) != '') {
- var fee = 0;
- if ($(item).find(".ratio").attr("is_peak") == 'true') {
- var flatFee = parseFloat($(item).find(".electric_flat_price").val()) * parseFloat($(item).find(".electric_flat_count").text());
- var peakFee = parseFloat($(item).find(".electric_peak_price").val()) * parseFloat($(item).find(".electric_peak_count").text());
- var valleyFee = parseFloat($(item).find(".electric_valley_price").val()) * parseFloat($(item).find(".electric_valley_count").text());
- fee = accAdd(accAdd(flatFee , peakFee) , valleyFee) ;
- } else {
- var electricFee = parseFloat($(item).find(".electric_price").val()) * parseFloat($(item).find(".electric_count").text());
- fee = electricFee ;
- }
- $(item).find(".total_fee").val(fee);
- }
- if ($(item).find(".total_fee").val()) {
- all_fee = accAdd(parseFloat($(item).find(".total_fee").val()),all_fee);
- }
- else {
- all_fee += 0;
- }
- });
- var wire_loss = $(".wire_loss").val();
- if (wire_loss != null && $.trim(wire_loss) != '') {
- total_wire_loss=parseFloat(wire_loss) * all_fee/100;
- $(".total_wire_loss").val(total_wire_loss);
- }
- if (other_fee) {
- all_fee = accAdd(parseFloat(other_fee),all_fee);
- }
- if (total_wire_loss) {
- all_fee = accAdd(parseFloat(total_wire_loss),all_fee);
- }
- if (electric_rent) {
- all_fee = accAdd(parseFloat(electric_rent),all_fee);
- }
- if (base_electric) {
- all_fee = accAdd(parseFloat(base_electric),all_fee);
- }
- $(".electric_fee").val(all_fee);
- }
- </script>
- </body>
- </html>
|