| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026 |
- <!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>
- </head>
- <body layout:fragment="content">
- <style>
- .col-sm-2 {
- width: 14.666667%
- }
- .width-180 {
- width: 180px
- }
- /*.width-80 {*/
- /*width: 80px*/
- /*}*/
- .width-25 {
- width: 25px
- }
- label.error {
- position: initial !important;
- display: block;
- !important;
- }
- .line {
- display: block;
- text-align: left;
- 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;
- }
- </style>
- <article class="page-container">
- <form class="form form-horizontal" id="form-contract-stop">
- <input type="hidden" th:id="id" th:name="id" th:value="${contract.id}"/>
- <input type="hidden" id="contract_no" th:name="contract_no" th:value="${contract.contract_no}"/>
- <input type="hidden" id="company_name" th:name="company_name" th:value="${contract.company_name}"/>
- <input type="hidden" id="company_id" th:name="company_id" th:value="${contract.company_id}"/>
- <input type="hidden" id="is_tenancy" th:name="is_tenancy" th:value="${contract.is_tenancy}"/>
- <input type="hidden" id="is_property" th:name="is_property" th:value="${contract.is_property}"/>
- <input type="hidden" id="is_parking" th:name="is_parking" th:value="${contract.is_parking}"/>
- <input type="hidden" id="is_water" th:name="is_water" th:value="${contract.is_water}"/>
- <input type="hidden" id="is_electric" th:name="is_electric" th:value="${contract.is_electric}"/>
- <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-4">
- [[${contract.contract_no}]]
- </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-4">
- [[${contract.company_name}]]
- </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-4">
- <input type="text" id="contract_terminate_date" th:name="contract_terminate_date" required
- class="input-text">
- <input type="hidden" id="contract_end_date" th:value="${contract.contract_end_date}"/>
- </div>
- </div>
- <div class="row cl" th:if="${is_tenancy}">
- <label class="form-label col-xs-4 col-sm-2">已收押金(元):</label>
- <div class="formControls col-xs-8 col-sm-4">
- [[${contract.deposit_fee}]]
- </div>
- </div>
- <div class="row cl" th:if="${is_tenancy}">
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>退还押金(元):</label>
- <div class="formControls col-xs-8 col-sm-4">
- <input type="text" class="input-text" required maxlength="20" number="true" min="0"
- th:name="returned_deposit_fee"/>
- </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-4">
- <input type="text" class="input-text" maxlength="20" number="true" th:name="final_fee"/>
- </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">
- <textarea name="" cols="" rows="" th:name="final_remark" class="textarea" placeholder="说点什么..."
- dragonfly="true" onKeyUp="$.Huitextarealength(this,200)"></textarea>
- </div>
- </div>
- <div id="fee">
- <div th:if="${contract.is_tenancy}">
- <div class="line">房租费用</div>
- <div>
- <!-- <div ><i class="Hui-iconfont" onclick="addTenancyLine()"></i></div> -->
- <table id="tenancyTb" style="margin-top: 15px"
- class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr class="text-c">
- <th width="70">缴费期数</th>
- <th>开始日期</th>
- <th>结束日期</th>
- <th>应缴房租(元)</th>
- <th>已缴房租(元)</th>
- <th>应缴费日期</th>
- <th>缴费状态</th>
- <th>备注</th>
- </tr>
- </thead>
- <tbody class="pre_tenancy_line" id="pre_tenancy_line">
- <tr th:object="${tenancy}" class="text-c">
- <td>
- <span>上 期</span>
- <input type="hidden" id="preTenancyId" th:value="*{id}"/>
- </td>
- <td class="period_start_date"
- th:text="*{#dates.format(period_start_date, 'yyyy-MM-dd')}"></td>
- <td class="period_end_date" th:text="*{#dates.format(period_end_date, 'yyyy-MM-dd')}"></td>
- <td class="house_fee" th:text="*{house_fee}"></td>
- <td class="paid_house_fee" th:text="*{paid_house_fee}"></td>
- <td class="pay_time" th:text="*{#dates.format(pay_time, 'yyyy-MM-dd')}"></td>
- <td class="td-status status">
- <span class="label radius" th:if="*{status}==0">未缴款</span>
- <span class="label radius label-success" th:if="*{status}==2">已缴款</span>
- <span class="label radius" th:if="*{status}==1">部分缴款</span>
- </td>
- <td class="remark" th:text="*{remark}"></td>
- </tr>
- <tr id="lastTenancyfee" style="display:none;" class="text-c">
- <td>
- <span>末 期</span>
- <input type="hidden" class="id" name="lastTenancy.id"/>
- </td>
- <td>
- <input type="text" th:name="lastTenancy.period_start_date"
- id="lastTenancy_datemin" class="input-text period_start_date">
- </td>
- <td>
- <input type="text" th:name="lastTenancy.period_end_date"
- id="lastTenancy_datemax"
- class="input-text period_end_date">
- </td>
- <td><input type="text" class="input-text width-80 house_fee" required maxlength="20"
- number="true" min="0" th:name="lastTenancy.house_fee"/></td>
- <td><input type="text" class="input-text width-80 paid_house_fee" required maxlength="20"
- number="true" min="0" th:name="lastTenancy.paid_house_fee"/></td>
- <td>
- <input type="text" th:name="lastTenancy.pay_time"
- id="lastTenancy_pay_time"
- class="input-text pay_time" required>
- </td>
- <td>
- <span class="select-box">
- <select class="select status" required th:name="lastTenancy.status">
- <option value="0" selected="selected">未缴费</option>
- <option value="1">已缴费</option>
- <option value="2">部分缴费</option>
- </select>
- </span>
- </td>
- <td><input type="text" class="input-text width-80 remark" th:name="lastTenancy.remark"/>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div th:if="${contract.is_property}">
- <div class="line">物业费</div>
- <table id="propertyTb" style="margin-top: 15px"
- 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>
- <th>备注</th>
- </tr>
- </thead>
- <tbody>
- <tr id="pre_property_line" class="text-c" th:object="${property}">
- <td>
- <span>上期</span>
- <input type="hidden" id="prePropertyId" th:value="*{id}"/>
- </td>
- <td class="period_start_date" th:text="*{#dates.format(period_start_date, 'yyyy-MM-dd')}"></td>
- <td class="period_end_date" th:text="*{#dates.format(period_end_date, 'yyyy-MM-dd')}"></td>
- <td class="total_fee" th:text="(*{price})*(*{number})*(*{payment_cycle})"></td>
- <td th:text="*{#dates.format(pay_time, 'yyyy-MM-dd')}"></td>
- <td class="td-status">
- <span class="label radius" th:unless="*{actural_paid_date}">未缴费</span>
- <span class="label radius label-success" th:if="*{actural_paid_date}">已缴费</span>
- </td>
- <td th:text="*{remarks}"></td>
- </tr>
- <tr id="lastPropertyfee" class="text-c" style="display:none;">
- <td>末期<input type="hidden" class="id" id="lastPropertyId" name="lastProperty.id"/></td>
- <td>
- <input type="text" th:name="lastProperty.period_start_date"
- id="lastProperty_datemin" class="input-text period_start_date">
- </td>
- <td>
- <input type="text" th:name="lastProperty.period_end_date"
- id="lastProperty_period_end_date" class="input-text period_end_date">
- </td>
- <td><input type="text" class="input-text width-80 total_fee" required maxlength="20"
- number="true"
- min="0" th:name="lastProperty.total_fee"/></td>
- <td>
- <input type="text" th:name="lastProperty.pay_time" id="lastProperty_pay_time"
- class="input-text pay_time" required>
- </td>
- <td>
- <span class="select-box">
- <select class="select is_paid" required th:name="lastProperty.is_paid">
- <option value="0" selected="selected">未缴费</option>
- <option value="1">已缴费</option>
- </select>
- </span>
- </td>
- <td><input type="text" class="input-text width-80 remark" th:name="lastProperty.remark"/></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div th:if="${contract.is_parking}">
- <div class="line">停车费</div>
- <table id="propertyTb" style="margin-top: 15px"
- 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>
- <th>备注</th>
- </tr>
- </thead>
- <tbody>
- <tr id="pre_parking_line" class="text-c" th:object="${parking}">
- <td>
- <span>上期</span>
- <input type="hidden" id="preParkingId" th:value="*{id}"/>
- </td>
- <td class="period_start_date" th:text="*{#dates.format(period_start_date, 'yyyy-MM-dd')}"></td>
- <td class="period_end_date" th:text="*{#dates.format(period_end_date, 'yyyy-MM-dd')}"></td>
- <td th:text="(*{price})*(*{number})*(*{payment_cycle})"></td>
- <td th:text="*{#dates.format(pay_time, 'yyyy-MM-dd')}"></td>
- <td class="td-status">
- <span class="label radius" th:unless="*{actural_paid_date}">未缴费</span>
- <span class="label radius label-success" th:if="*{actural_paid_date}">已缴费</span>
- </td>
- <td th:text="*{remarks}"></td>
- </tr>
- <tr id="lastParkingfee" class="text-c" style="display:none;">
- <td>末期<input type="hidden" class="id" id="lastParkingId" name="lastParking.id"/></td>
- <td>
- <input type="text" th:name="lastParking.period_start_date"
- id="lastParking_period_start_date" class="input-text period_start_date">
- </td>
- <td>
- <input type="text" th:name="lastParking.period_end_date"
- id="lastParking_period_end_date"
- class="input-text period_end_date">
- </td>
- <td><input type="text" class="input-text width-80 total_fee" required maxlength="20"
- number="true"
- min="0" th:name="lastParking.total_fee"/></td>
- <td>
- <input type="text" th:name="lastParking.pay_time"
- id="lastParking_pay_time"
- class="input-text pay_time" required>
- </td>
- <td>
- <span class="select-box">
- <select class="select status is_paid" required th:name="lastParking.is_paid">
- <option value="0" th:selected="selected">未缴费</option>
- <option value="1">已缴费</option>
- </select>
- </span>
- </td>
- <td><input type="text" class="input-text width-80 remark" th:name="lastParking.remark"/></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div th:if="${contract.is_water}">
- <div class="line">水费</div>
- <div class="row cl">
- <input type="hidden" value="true" name="waterRecord.is_water"/>
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>抄表日期:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" th:name="waterRecord.record_date" required id="water_record_date"
- class="input-text">
- </div>
- </div>
- <table style="margin-top: 15px" 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>
- <th>总吨数</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c water_length" th:attr="water_length=${#lists.size(contractWaters)}"
- th:each="contractWater,iterStat:${contractWaters}" th:object="${contractWater}">
- <td>[[*{water_name}]]
- <input type="hidden" class="input-text" th:value="*{water_name}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].water_name'"/>
- <input type="hidden" class="input-text" th:value="*{water_id}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].water_id'"/>
- </td>
- <td>
- <span th:if="*{waterRead.is_common}">是</span>
- <span th:unless="*{waterRead.is_common}">否</span>
- </td>
- <td>
- <input type="hidden" class="input-text" th:value="*{waterRead.meter_write}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].meter_write_before'"/>
- <span class="water_meter_write_before">[[*{waterRead.meter_write}]]</span>
- </td>
- <td><input type="hidden" class="input-text" th:value="*{waterRead.water_current_read}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].water_before_read'"/>
- <span class="water_before_read">[[*{waterRead.water_current_read}]]</span>
- </td>
- <td><input type="text" class="input-text meter_write_water readonly" required
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].meter_write'" readonly/>
- </td>
- <td><input type="text" class="input-text" onchange="compareWaterRead(this)" required
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].water_current_read'"
- number="true" min="0" max="99999.9999"/></td>
- <td><input type="text" th:name="'waterRecord.waterReads['+${iterStat.index}+'].use_water'"
- readonly class="input-text use_water readonly"/>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="line"></div>
- <table class="table table-border table-bordered table-bg table-hover">
- <thead>
- <tr class="text-c">
- <th>水表名称</th>
- <th>用水量</th>
- <th>单价</th>
- <th>小计金额(元)</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c water_read_company" th:each="contractWater,iterStat:${contractWaters}"
- th:object="${contractWater}">
- <input type="hidden" required class="input-text" th:value="${contract.company_name}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].waterReadCompanies[0].company_name'"/>
- <input type="hidden" required class="input-text" th:value="${contract.company_id}"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].waterReadCompanies[0].company_id'"/>
- <td th:text="*{water_name}"></td>
- <td><input type="text" class="input-text use_water" required number="true"
- min="0"
- max="999.9999"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].waterReadCompanies[0].use_water'"
- th:onchange="'initTotalFee('+${iterStat.index}+');'"/></td>
- <td>
- <input type="text" required number="true" min="0" max="999.9999"
- class="input-text water_price"
- th:onchange="'initTotalFee('+${iterStat.index}+');'"
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].waterReadCompanies[0].water_price'"/>
- </td>
- <td><input type="text" class="input-text total_fee readonly" readonly
- th:name="'waterRecord.waterReads['+${iterStat.index}+'].waterReadCompanies[0].total_fee'"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="3">其他费用</td>
- <td>
- <input type="text" class="input-text water_other_fee" number="true" min="0"
- max="999.9999" th:name="waterRecord.water_other_fee"
- onchange="initTotalFee();"/></td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="2">合计</td>
- <td><input type="hidden" name="waterRecord.use_water"
- class="total_use_water"><span>用水量:</span><span
- id="total_use_water"></span><span>(吨)</span></td>
- <td><input type="text" class="input-text readonly water_fee" readonly
- th:name="waterRecord.water_fee"/></td>
- </tr>
- </tbody>
- </table>
- </div>
- <div th:if="${contract.is_electric}">
- <div class="line">电费</div>
- <div class="row cl">
- <input type="hidden" value="false" name="electricRecord.is_water"/>
- <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>抄表日期:</label>
- <div class="formControls col-xs-8 col-sm-9">
- <input type="text" th:name="electricRecord.record_date" required id="electric_record_date"
- class="input-text">
- </div>
- </div>
- <table style="margin-top: 15px" class="table table-border table-bordered table-bg table-hover w2000">
- <thead>
- <tr class="text-c">
- <th class="w80">电表名</th>
- <th class="w80">是否共用</th>
- <th class="w60">倍率</th>
- <th class="w100">上期抄表日</th>
- <th class="w80">上期通用</th>
- <th class="w80">上期峰值</th>
- <th class="w80">上期平值</th>
- <th class="w80">上期谷值</th>
- <th class="w120">本期抄表日</th>
- <th class="w80">本期通用</th>
- <th class="w80">本期峰值</th>
- <th class="w80">本期平值</th>
- <th class="w80">本期谷值</th>
- <th class="w80">通用度数</th>
- <th class="w80">峰值度数</th>
- <th class="w80">平值度数</th>
- <th class="w80">谷值度数</th>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c electric_length" th:attr="electric_length=${#lists.size(contractElectrics)}"
- th:each="contractElectric,iterStat:${contractElectrics}" th:object="${contractElectric}">
- <input type="hidden" class="input-text" th:value="*{id}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].id'"/>
- <input type="hidden" class="input-text" th:value="*{electric_name}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_name'"/>
- <td>[[*{electric_name}]]
- <input type="hidden" class="input-text" th:value="*{electric_id}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_id'"/>
- </td>
- <td>
- <span th:if="*{electricRead.is_common}">是</span>
- <span th:unless="*{electricRead.is_common}">否</span>
- </td>
- <td class="ratio">
- [[*{electricRead.ratio}]]
- </td>
- <td>
- <input type="hidden" class="input-text" th:value="*{electricRead.meter_write}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].meter_write_before'"/>
- <span class="electric_meter_write_before">[[*{electricRead.meter_write}]]</span>
- </td>
- <td>
- <input type="hidden" class="input-text" th:value="*{electricRead.meter_write}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].meter_write'"/>
- <span class="electric_before_read">[[*{electricRead.electric_current_read}]]</span>
- </td>
- <td>
- <input type="hidden" class="input-text"
- th:value="*{electricRead.electric_peak_current_read}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_peak_before_read'"/>
- <span class="electric_peak_before_read">[[*{electricRead.electric_peak_current_read}]]</span>
- </td>
- <td>
- <input type="hidden" class="input-text"
- th:value="*{electricRead.electric_flat_current_read}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_flat_before_read'"/>
- <span class="electric_flat_before_read">[[*{electricRead.electric_flat_current_read}]]</span>
- </td>
- <td>
- <input type="hidden" class="input-text"
- th:value="*{electricRead.electric_valley_current_read}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_valley_before_read'"/>
- <span class="electric_valley_before_read">[[*{electricRead.electric_valley_current_read}]]</span>
- </td>
- <td><input type="text" class="input-text meter_write_electric readonly"
- readonly th:name="'electricReads['+${iterStat.index}+'].meter_write'"/>
- </td>
- <td><input type="text" onchange="compareElectricRead(this)"
- th:class="*{electricRead.is_peak}? 'readonly input-text':'input-text'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_current_read'"
- number="true"
- min="0" max="99999.9999"/>
- </td>
- <td><input type="text" onchange="comparePeakRead(this)"
- th:class="*{!electricRead.is_peak}? 'readonly input-text':'input-text'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_peak_current_read'"
- number="true"
- min="0"
- max="99999.9999"/>
- </td>
- <td><input type="text" onchange="compareFlatRead(this)"
- th:class="*{!electricRead.is_peak}? 'readonly input-text':'input-text'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_flat_current_read'"
- number="true"
- min="0"
- max="99999.9999"/>
- </td>
- <td><input type="text" class="input-text" onchange="compareValleyRead(this)"
- th:class="*{!electricRead.is_peak}? 'readonly input-text':'input-text'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electric_valley_current_read'"
- number="true"
- min="0"
- max="99999.9999"/>
- </td>
- <td><input type="text"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].use_electric'"
- class="input-text readonly use_electric"/>
- </td>
- <td><input type="text"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].use_peak_electric'"
- class="input-text readonly use_peak_electric"/>
- </td>
- <td><input type="text"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].use_flat_electric'"
- class="input-text readonly use_flat_electric"/>
- </td>
- <td><input type="text"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].use_valley_electric'"
- class="input-text readonly use_valley_electric"/>
- </td>
- </tr>
- </tbody>
- </table>
- <div class="line"></div>
- <table 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>
- </tr>
- </thead>
- <tbody>
- <tr class="text-c electric_read_company" th:each="contractElectric,iterStat:${contractElectrics}"
- th:object="${contractElectric}">
- <input type="hidden" required class="input-text" th:value="*{electricRead.is_peak}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].is_peak'"/>
- <input type="hidden" required class="input-text" th:value="${contract.company_id}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].company_id'"/>
- <input type="hidden" required class="input-text" th:value="${contract.company_name}"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].company_name'"/>
- <td th:text="*{electric_name}" class="electric_peak"
- th:attr="is_peak=*{electricRead.is_peak}"></td>
- <td>
- <input th:unless="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999" class="input-text electric_count"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_count'"/>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999" class="input-text electric_peak_count"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_peak_count'"/>
- </td>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999" class="input-text electric_flat_count"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_flat_count'"/>
- </td>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999" class="input-text electric_valley_count"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_valley_count'"/>
- </td>
- <td>
- <input th:unless="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999" class="input-text electric_price"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_price'"/>
- </td>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999"
- class="input-text electric_peak_price"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_peak_price'"/>
- </td>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999"
- class="input-text electric_flat_price"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_flat_price'"/>
- </td>
- <td>
- <input th:if="*{electricRead.is_peak}" type="text" required number="true" min="0"
- max="999.9999"
- class="input-text electric_valley_price"
- th:onchange="'initElectricTotalFee('+${iterStat.index}+');'"
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].electric_valley_price'"/>
- </td>
- <td>
- <input type="text" class="input-text total_fee readonly"
- readonly
- th:name="'electricRecord.electricReads['+${iterStat.index}+'].electricReadCompanies[0].total_fee'"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="7">线损费用(元)</td>
- <td colspan="2">
- 线损率: <input onchange="initElectricTotalFee()" type="text"
- class="input-text wire_loss"
- th:name="electricRecord.wire_loss"/>%
- </td>
- <td>
- <input onchange="initElectricTotalFee()" type="text"
- class="input-text readonly total_wire_loss"
- readonly th:name="electricRecord.total_wire_loss"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="9">基本电费(元)</td>
- <td>
- <input onchange="initElectricTotalFee()" type="text"
- class="input-text base_electric"
- th:name="electricRecord.base_electric "/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="9">电力设备租金(元)</td>
- <td>
- <input onchange="initElectricTotalFee()" type="text"
- class="input-text electric_rent"
- th:name="electricRecord.electric_rent"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="9">其他费用(元)</td>
- <td>
- <input onchange="initElectricTotalFee()" type="text"
- class="input-text other_fee" number="true" min="0" max="999.9999"
- th:name="electricRecord.other_fee"/>
- </td>
- </tr>
- <tr class="text-c">
- <td scope="col" colspan="7">合计</td>
- <td colspan="2">用电量 <input type="hidden"
- class="input-text readonly total_use_electric" readonly
- th:name="electricRecord.use_electric"/> <span
- id="total_use_electric"></span></td>
- <td>
- <input onchange="initElectricTotalFee()" type="text"
- class="input-text readonly electric_fee" readonly
- th:name="electricRecord.electric_fee"/>
- </td>
- </tr>
- </tbody>
- </table>
- </div>
- </div>
- <div class="row cl">
- <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>
- <div id="map" style="display: none"></div>
- </article>
- <script type="text/javascript" th:src="@{/js/build/contract/contract_stop.js}"></script>
- <script th:inline="javascript">
- var validate_date=true;
- $(".readonly").attr("readonly", "readonly");
- $(function () {
- laydate.render({
- elem: '#contract_terminate_date',
- done: function (value, date) {
- getFee();
- $("#contract_terminate_date").blur();
- }
- });
- // 日期表单初始化
- laydate.render({
- elem: '#water_record_date',
- done: function (value) {//控件选择完毕后的回调---点击日期、清空、现在、确定均会触发。
- initWaterMeterWrite(value);
- }
- });
- // 日期表单初始化
- laydate.render({
- elem: '#electric_record_date',
- done: function (value) {//控件选择完毕后的回调---点击日期、清空、现在、确定均会触发。
- initElectricMeterWrite(value);
- }
- });
- function initElectricMeterWrite(value) {
- var index = 0;
- $(".electric_length").each(function (i) {
- $(this).find(".meter_write_electric").val(value);
- var meter_write_before = $(this).find(".electric_meter_write_before").html();
- if (compareDate(meter_write_before, value)) {
- validate_date = false;
- index = i;
- return false;
- }
- validate_date = true;
- });
- if (!validate_date) {
- sadMessage("第" + (index + 1) + "行本期抄表日不能小于上期抄表日");
- return false;
- }
- validate_date = true;
- }
- function initWaterMeterWrite(value) {
- var index = 0;
- $(".water_length").each(function (i) {
- $(this).find(".meter_write_water").val(value);
- var meter_write_before = $(this).find(".water_meter_write_before").html();
- if (compareDate(meter_write_before, value)) {
- validate_date = false;
- index = i;
- return false;
- }
- validate_date = true;
- });
- if (!validate_date) {
- sadMessage("第" + (index + 1) + "行本期抄表日不能小于上期抄表日");
- return false;
- }
- validate_date = true;
- }
- laydate.render({
- elem: '#lastTenancy_datemin'
- });
- laydate.render({
- elem: '#lastTenancy_datemax'
- });
- laydate.render({
- elem: '#lastTenancy_pay_time'
- });
- laydate.render({
- elem: '#lastProperty_datemin'
- });
- laydate.render({
- elem: '#lastProperty_period_end_date'
- });
- laydate.render({
- elem: '#lastProperty_pay_time'
- });
- laydate.render({
- elem: '#lastParking_period_start_date'
- });
- laydate.render({
- elem: '#lastParking_period_end_date'
- });
- laydate.render({
- elem: '#lastParking_pay_time'
- });
- });
- /**
- * 取消
- */
- function removeIframe() {
- var index = parent.layer.getFrameIndex(window.name);
- parent.layer.close(index);
- }
- function compareWaterRead(obj) {
- var meter_write_current = $(obj).val();
- var water_before_read = $(obj).parents("tr").find(".water_before_read").html();
- if (parseFloat(meter_write_current) < parseFloat(water_before_read)) {
- validate_read = false;
- sadMessage("本期读数不能小于上期读数");
- return false;
- }
- validate_read = true;
- var use_water = meter_write_current - water_before_read;
- $(obj).parents("tr").find(".use_water").val(use_water);
- }
- function compareElectricRead(obj) {
- var meter_write_current = $(obj).val();
- var water_before_read = $(obj).parents("tr").find(".electric_before_read").html();
- if (parseFloat(meter_write_current) < parseFloat(water_before_read)) {
- validate_read = false;
- sadMessage("本期通用读数不能小于上期通用读数");
- return false;
- }
- validate_read = true;
- var use_electric = meter_write_current - water_before_read;
- var ratio = $(obj).parents("tr").find(".ratio").html();
- if (ratio != null && $.trim(ratio) != '') {
- use_electric = use_electric * ratio;
- }
- $(obj).parents("tr").find(".use_electric").val(use_electric);
- }
- function comparePeakRead(obj) {
- var meter_write_current = $(obj).val();
- var water_before_read = $(obj).parents("tr").find(".electric_peak_before_read").html();
- if (parseFloat(meter_write_current) < parseFloat(water_before_read)) {
- validate_peak_read = false;
- sadMessage("本期峰值读数不能小于上期峰值读数");
- return false;
- }
- validate_peak_read = true;
- var use_electric = meter_write_current - water_before_read;
- var ratio = $(obj).parents("tr").find(".ratio").html();
- if (ratio != null && $.trim(ratio) != '') {
- use_electric = use_electric * ratio;
- }
- $(obj).parents("tr").find(".use_peak_electric").val(use_electric);
- }
- function compareFlatRead(obj) {
- var meter_write_current = $(obj).val();
- var water_before_read = $(obj).parents("tr").find(".electric_flat_before_read").html();
- if (parseFloat(meter_write_current) < parseFloat(water_before_read)) {
- validate_flat_read = false;
- sadMessage("本期平峰读数不能小于上期平峰读数");
- return false;
- }
- validate_flat_read = true;
- var use_electric = meter_write_current - water_before_read;
- var ratio = $(obj).parents("tr").find(".ratio").html();
- if (ratio != null && $.trim(ratio) != '') {
- use_electric = use_electric * ratio;
- }
- $(obj).parents("tr").find(".use_flat_electric").val(use_electric);
- }
- function compareValleyRead(obj) {
- var meter_write_current = $(obj).val();
- var water_before_read = $(obj).parents("tr").find(".electric_valley_before_read").html();
- if (parseFloat(meter_write_current) < parseFloat(water_before_read)) {
- validate_valley_read = false;
- sadMessage("本期谷值读数不能小于上期谷值读数");
- return false;
- }
- validate_valley_read = true;
- var use_electric = meter_write_current - water_before_read;
- var ratio = $(obj).parents("tr").find(".ratio").html();
- if (ratio != null && $.trim(ratio) != '') {
- use_electric = use_electric * ratio;
- }
- $(obj).parents("tr").find(".use_valley_electric").val(use_electric);
- }
- function initTotalFee(obj) {
- var total_use_water = 0;
- var all_fee = 0;
- var other_fee = $(".water_other_fee").val();
- $(".water_read_company").each(function (index, item) {
- if (index == obj && obj != null && $.trim(obj) != '') {
- if ($(item).find(".water_price").val() && $(item).find(".use_water").val()) {
- $(item).find(".total_fee").val(parseFloat($(item).find(".water_price").val()) * parseFloat($(item).find(".use_water").val()));
- }
- if ($(item).find(".use_water").val()) {
- total_use_water += parseFloat($(item).find(".use_water").val());
- }
- }
- if ($(item).find(".total_fee").val()) {
- all_fee += parseFloat($(item).find(".total_fee").val());
- } else {
- all_fee += 0;
- }
- });
- if (other_fee) {
- all_fee += parseFloat(other_fee);
- }
- $(".water_fee").val(all_fee);
- if (obj != null && $.trim(obj) != '') {
- $(".total_use_water").val(total_use_water);
- $("#total_use_water").text(total_use_water);
- }
- }
- function initElectricTotalFee(obj) {
- var use_electric = 0;
- 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(".electric_peak").attr("is_peak") == 'true') {
- var flatFee;
- var peakFee;
- var valleyFee;
- if ($(item).find(".electric_flat_price").val() && $(item).find(".electric_flat_count").val()) {
- flatFee = parseFloat($(item).find(".electric_flat_price").val()) * parseFloat($(item).find(".electric_flat_count").val());
- }
- if ($(item).find(".electric_peak_price").val() && $(item).find(".electric_peak_count").val()) {
- peakFee = parseFloat($(item).find(".electric_peak_price").val()) * parseFloat($(item).find(".electric_peak_count").val());
- }
- if ($(item).find(".electric_valley_price").val() && $(item).find(".electric_valley_count").val()) {
- valleyFee = parseFloat($(item).find(".electric_valley_price").val()) * parseFloat($(item).find(".electric_valley_count").val());
- }
- if (flatFee) {
- fee += flatFee;
- }
- if (peakFee) {
- fee += peakFee;
- }
- if (valleyFee) {
- fee += valleyFee;
- }
- if ($(item).find(".electric_flat_count").val()) {
- use_electric += parseFloat($(item).find(".electric_flat_count").val());
- }
- if ($(item).find(".electric_peak_count").val()) {
- use_electric += parseFloat($(item).find(".electric_peak_count").val());
- }
- if ($(item).find(".electric_valley_count").val()) {
- use_electric += parseFloat($(item).find(".electric_valley_count").val());
- }
- } else {
- if ($(item).find(".electric_price").val() && $(item).find(".electric_count").val()) {
- var electricFee = parseFloat($(item).find(".electric_price").val()) * parseFloat($(item).find(".electric_count").val());
- fee = electricFee;
- }
- if ($(item).find(".electric_count").val()) {
- use_electric += parseFloat($(item).find(".electric_count").val());
- }
- }
- $(item).find(".total_fee").val(fee);
- }else{
- if ($(item).find(".electric_peak").attr("is_peak") == 'true') {
- if($(item).find(".electric_flat_count").val()){
- use_electric+=parseFloat($(item).find(".electric_flat_count").val());
- }
- if($(item).find(".electric_peak_count").val()){
- use_electric+=parseFloat($(item).find(".electric_peak_count").val());
- }
- if($(item).find(".electric_valley_count").val()){
- use_electric+=parseFloat($(item).find(".electric_valley_count").val());
- }
- } else {
- if($(item).find(".electric_count").val()){
- use_electric+=parseFloat($(item).find(".electric_count").val());
- }
- }
- }
- if ($(item).find(".total_fee").val()) {
- all_fee += parseFloat($(item).find(".total_fee").val());
- }
- 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 += parseFloat(other_fee);
- }
- if (total_wire_loss) {
- all_fee += parseFloat(total_wire_loss);
- if (base_electric)
- all_fee += parseFloat(base_electric);
- }
- if (electric_rent) {
- all_fee += parseFloat(electric_rent);
- }
- if (base_electric) {
- all_fee += parseFloat(base_electric);
- }
- $(".electric_fee").val(all_fee);
- $(".total_use_electric").val(use_electric);
- $("#total_use_electric").text(use_electric);
- }
- </script>
- </body>
- </html>
|