|
@@ -110,6 +110,23 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
+ //方法一使用id选择器进行计算。
|
|
|
+ //获取输入的数字
|
|
|
+ //自动计算出结果并填充在相应的输入框中
|
|
|
+ var proceedsMoney = '${workInvoice.proceedsMoney}'
|
|
|
+ if(null == proceedsMoney || undefined == proceedsMoney || '' == proceedsMoney){
|
|
|
+ proceedsMoney = "0.00"
|
|
|
+ }
|
|
|
+ $("#proceedsMoneys").val(parseFloat(proceedsMoney).toFixed(2));
|
|
|
+
|
|
|
+ // 计算剩余应收款金额
|
|
|
+ // 获取开票金额
|
|
|
+ var money = '${workInvoice.money}'
|
|
|
+ var noProceedsMoneys = (parseFloat(money) - parseFloat(proceedsMoney)).toFixed(2);
|
|
|
+
|
|
|
+ $("#noProceedsMoneys").val(noProceedsMoneys);
|
|
|
+
|
|
|
+
|
|
|
laydate.render({
|
|
|
elem: '#receiptDate', //目标元素。由于laydate.js封装了一个轻量级的选择器引擎,因此elem还允许你传入class、tag但必须按照这种方式 '#id .class'
|
|
|
event: 'focus', //响应事件。如果没有传入event,则按照默认的click
|
|
@@ -189,6 +206,51 @@
|
|
|
}
|
|
|
|
|
|
}
|
|
|
+
|
|
|
+ function isNumber(val){
|
|
|
+ if(val === "" || val ==null){
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ var regPos = /^\d+(\.\d+)?$/; //非负浮点数
|
|
|
+ var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
|
|
|
+ if(regPos.test(val) || regNeg.test(val)){
|
|
|
+ return true;
|
|
|
+ }else{
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ function getProceedsMoneys(value){
|
|
|
+
|
|
|
+ var proceedsMoneys = "0.00";
|
|
|
+ //方法一使用id选择器进行计算。
|
|
|
+ //获取输入的数字
|
|
|
+ //自动计算出结果并填充在相应的输入框中
|
|
|
+ var size = $("#workReceiptList tr").length;
|
|
|
+ for (var i = 0;i<size;i++){
|
|
|
+ var workReceiptMoney = $("#workReceiptList"+i+"_money").val();
|
|
|
+ var delFlag = $("#workReceiptList"+i+"_delFlag").val();
|
|
|
+ if (workReceiptMoney!=undefined && isNumber(workReceiptMoney) && delFlag==0){
|
|
|
+ if(proceedsMoneys==""){
|
|
|
+ proceedsMoneys = parseFloat(workReceiptMoney).toFixed(2);
|
|
|
+ }else {
|
|
|
+ proceedsMoneys = (parseFloat(proceedsMoneys) + parseFloat(workReceiptMoney)).toFixed(2);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ $("#proceedsMoneys").val(proceedsMoneys);
|
|
|
+
|
|
|
+ // 计算剩余应收款金额
|
|
|
+ // 获取开票金额
|
|
|
+ var money = '${workInvoice.money}'
|
|
|
+ console.log(parseFloat(money))
|
|
|
+ console.log(parseFloat(proceedsMoneys))
|
|
|
+ console.log(parseFloat(money) - parseFloat(proceedsMoneys))
|
|
|
+ var noProceedsMoneys = (parseFloat(money) - parseFloat(proceedsMoneys)).toFixed(2);
|
|
|
+
|
|
|
+ $("#noProceedsMoneys").val(noProceedsMoneys);
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
</head>
|
|
|
<body >
|
|
@@ -540,10 +602,11 @@
|
|
|
onclick="addRow('#workReceiptList', workClientBankRowIdx, workClientBankTpl);workClientBankRowIdx = workClientBankRowIdx + 1;"
|
|
|
title="新增"><i class="fa fa-plus"></i> 新增</a>
|
|
|
</div>
|
|
|
- <table id="receiptTable" class="table table-bordered table-condensed details">
|
|
|
+ <table id="receiptTable" class="table table-bordered table-condensed details" style="margin-bottom: 0px">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
<th><span class="require-item">*</span>汇款单位</th>
|
|
|
+
|
|
|
<th><span class="require-item">*</span>汇款金额</th>
|
|
|
<th width="160px"><span class="require-item">*</span>汇款时间</th>
|
|
|
<th width="100px">操作</th>
|
|
@@ -552,6 +615,30 @@
|
|
|
<tbody id="workReceiptList">
|
|
|
</tbody>
|
|
|
</table>
|
|
|
+ <table id="proceedsMoneysTable" class="table table-bordered table-condensed can-edit no-bottom-margin details">
|
|
|
+ <thead>
|
|
|
+ <tr style="border: 0px">
|
|
|
+ <td style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>总收款费用(元):</label></td>
|
|
|
+ <td style="border: 0px">
|
|
|
+ <input htmlEscape="false" style="border: 0px; vertical-align:middle;text-align: center; font-weight: bold;" id="proceedsMoneys" name="proceedsMoneys" readonly="true" class="form-control layui-input" value="${workInvoice.proceedsMoney}"/>
|
|
|
+ </td>
|
|
|
+ <td width="160px"></td>
|
|
|
+ <td width="100px"></td>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
+ <table id="noProceedsMoneysTable" class="table table-bordered table-condensed can-edit no-bottom-margin details">
|
|
|
+ <thead>
|
|
|
+ <tr style="border: 0px">
|
|
|
+ <td style="vertical-align:middle;text-align: center;"><label><font color="red">*</font>剩余应收款费用(元):</label></td>
|
|
|
+ <td style="border: 0px">
|
|
|
+ <input htmlEscape="false" style="border: 0px; vertical-align:middle;text-align: center; font-weight: bold;" id="noProceedsMoneys" name="noProceedsMoneys" readonly="true" class="form-control layui-input" value=""/>
|
|
|
+ </td>
|
|
|
+ <td width="160px"></td>
|
|
|
+ <td width="100px"></td>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ </table>
|
|
|
<script type="text/template" id="workClientBankTpl">//<!--
|
|
|
<tr id="workReceiptList{{idx}}">
|
|
|
<td class="hide">
|
|
@@ -562,7 +649,7 @@
|
|
|
<input id="workReceiptList{{idx}}_companyName" placeholder="请输入汇款单位" name="workReceiptList[{{idx}}].companyName" value="{{row.companyName}}" style="text-align: center" class="form-control judgment "/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="workReceiptList{{idx}}_money" name="workReceiptList[{{idx}}].money" placeholder="请输入汇款金额" value="{{row.money}}" style="text-align: center" class="form-control number judgment"/>
|
|
|
+ <input id="workReceiptList{{idx}}_money" name="workReceiptList[{{idx}}].money" placeholder="请输入汇款金额" value="{{row.money}}" onchange="getProceedsMoneys(this.value)" style="text-align: center" class="form-control number judgment"/>
|
|
|
</td>
|
|
|
|
|
|
<td>
|