|
@@ -49,6 +49,7 @@
|
|
|
return false;
|
|
|
}
|
|
|
$(document).ready(function() {
|
|
|
+
|
|
|
$("#name").focus();
|
|
|
validateForm = $("#inputForm").validate({
|
|
|
submitHandler: function(form){
|
|
@@ -85,7 +86,7 @@
|
|
|
}
|
|
|
});
|
|
|
|
|
|
- function addRow(list, idx, tpl, row){
|
|
|
+ function addRow(list, idx, tpl, row,flag){
|
|
|
var idx1 = $("#workAccountList tr").length;
|
|
|
if(list == '#workAccountList' && idx1 < 100){
|
|
|
bornTemplete(list, idx, tpl, row, idx1);
|
|
@@ -96,17 +97,20 @@
|
|
|
$("#workAccountList"+idx+"_code").attr("minlength","12");
|
|
|
$("#workAccountList"+idx+"_code").attr("maxlength","12");
|
|
|
}
|
|
|
- //$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
|
|
|
- if(idx>0){
|
|
|
- var i = idx-1;
|
|
|
- var code = $("#workAccountList"+i+"_code").val();
|
|
|
- if(code == null || code == undefined || code == ""){
|
|
|
- i = idx-2;
|
|
|
- code = $("#workAccountList"+i+"_code").val();
|
|
|
- }
|
|
|
- $("#workAccountList"+idx+"_code").val(code);
|
|
|
-
|
|
|
+ if (idx==0 && flag){
|
|
|
+ $("#workAccountList"+idx+"_totalMoney").val(row);
|
|
|
}
|
|
|
+ //$("#workAccountList"+idx+"_number").val(("0000000" + 100000000 * Math.random()).match(/(\d{8})(\.|$)/)[1]);
|
|
|
+ // if(idx>0){
|
|
|
+ // var i = idx-1;
|
|
|
+ // var code = $("#workAccountList"+i+"_code").val();
|
|
|
+ // if(code == null || code == undefined || code == ""){
|
|
|
+ // i = idx-2;
|
|
|
+ // code = $("#workAccountList"+i+"_code").val();
|
|
|
+ // }
|
|
|
+ // $("#workAccountList"+idx+"_code").val(code);
|
|
|
+ //
|
|
|
+ // }
|
|
|
}
|
|
|
}
|
|
|
function bornTemplete(list, idx, tpl, row, idx1){
|
|
@@ -534,7 +538,7 @@
|
|
|
<div class="layui-item layui-col-sm6">
|
|
|
<label class="layui-form-label"><span class="require-item">*</span>开票金额(元):</label>
|
|
|
<div class="layui-input-block">
|
|
|
- <input htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="#,#00.00"/>"/>
|
|
|
+ <input id="kaipiao" htmlEscape="false" readonly="true" class="form-control layui-input" value="<fmt:formatNumber value="${workInvoice.money}" pattern="#,#00.00"/>"/>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="layui-item layui-col-sm6">
|
|
@@ -612,13 +616,13 @@
|
|
|
<table id="contentTable" class="table table-bordered table-condensed can-edit">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th><span class="require-item">*</span>发票代码</th>
|
|
|
+ <th>发票代码</th>
|
|
|
<th><span class="require-item">*</span>发票号</th>
|
|
|
<th><span class="require-item">*</span>开票金额</th>
|
|
|
- <th width="80px"><span class="require-item">*</span>税率</th>
|
|
|
- <th width="100px"><span class="require-item">*</span>金额</th>
|
|
|
- <th width="100px"><span class="require-item">*</span>税额</th>
|
|
|
- <th width="100px"><span class="require-item">*</span>累计登记金额</th>
|
|
|
+ <th width="80px">税率</th>
|
|
|
+ <th width="100px">金额</th>
|
|
|
+ <th width="100px">税额</th>
|
|
|
+ <th width="100px">累计登记金额</th>
|
|
|
<th width="80px">操作</th>
|
|
|
<%--<th><span class="require-item">*</span>发票状态</th><%–正常–%>--%>
|
|
|
<%--<th><span class="require-item">*</span>被退标记</th>--%>
|
|
@@ -627,6 +631,7 @@
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody id="workAccountList">
|
|
|
+
|
|
|
</tbody>
|
|
|
</table>
|
|
|
<script type="text/template" id="workAccountListTpl">//<!--
|
|
@@ -636,7 +641,7 @@
|
|
|
<input id="workAccountList{{idx}}_delFlag" name="workAccountList[{{idx}}].delFlag" type="hidden" value="0"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}" class="form-control number required"/>
|
|
|
+ <input id="workAccountList{{idx}}_code" name="workAccountList[{{idx}}].code" type="text" value="{{row.code}}" class="form-control number"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
<input id="workAccountList{{idx}}_number" name="workAccountList[{{idx}}].number" onchange="checkSame(this)" type="text" value="{{row.number}}" minlength="8" maxlength="8" class="form-control number required"/>
|
|
@@ -647,24 +652,24 @@
|
|
|
</td>
|
|
|
<td>
|
|
|
<div class="input-group">
|
|
|
- <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}" class="form-control number required"/><span class="input-group-addon input-height">%</span>
|
|
|
+ <input id="workAccountList{{idx}}_tax" onblur="setTaxMoney(this)" name="workAccountList[{{idx}}].tax" type="text" value="{{row.tax}}" class="form-control number"/><span class="input-group-addon input-height">%</span>
|
|
|
</div>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}" class="form-control number required"/>
|
|
|
+ <input id="workAccountList{{idx}}_taxMoney" name="workAccountList[{{idx}}].taxMoney" type="text" value="{{row.taxMoney}}" class="form-control number"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}" class="form-control number required"/>
|
|
|
+ <input id="workAccountList{{idx}}_taxRate" name="workAccountList[{{idx}}].taxRate" type="text" value="{{row.taxRate}}" class="form-control number"/>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0" readonly="true" class="form-control required"/>
|
|
|
+ <input id="workAccountList{{idx}}_incomeMoney" name="workAccountList[{{idx}}].incomeMoney" type="text" value="0" readonly="true" class="form-control"/>
|
|
|
</td>
|
|
|
|
|
|
<input id="workAccountList{{idx}}_state" name="workAccountList[{{idx}}].state" type="hidden" value="正常" class="form-control"/>
|
|
|
|
|
|
- <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign" type="hidden" value="正常" readonly="true" class="form-control required"/>
|
|
|
+ <input id="workAccountList{{idx}}_backSign" name="workAccountList[{{idx}}].backSign" type="hidden" value="正常" readonly="true" class="form-control"/>
|
|
|
|
|
|
- <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber" type="hidden" value="" readonly="true" class="form-control required"/>
|
|
|
+ <input id="workAccountList{{idx}}_backNumber" name="workAccountList[{{idx}}].backNumber" type="hidden" value="" readonly="true" class="form-control "/>
|
|
|
|
|
|
|
|
|
<td class="text-center op-td">
|
|
@@ -705,6 +710,11 @@
|
|
|
var workAccountListRowIdx = 0, workAccountListTpl = $("#workAccountListTpl").html().replace(/(\/\/\<!\-\-)|(\/\/\-\->)/g,"");
|
|
|
$(document).ready(function() {
|
|
|
var data = ${fns:toJson(workInvoice.workAccountList)};
|
|
|
+ var kaipiao=$("#kaipiao").val();
|
|
|
+ if (data.length==0){
|
|
|
+ addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, kaipiao,"true");
|
|
|
+ workAccountListRowIdx = workAccountListRowIdx + 1;
|
|
|
+ }
|
|
|
for (var i=0; i<data.length; i++){
|
|
|
addRow('#workAccountList', workAccountListRowIdx, workAccountListTpl, data[i]);
|
|
|
workAccountListRowIdx = workAccountListRowIdx + 1;
|