123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253 |
- [#ftl]
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
- <title>编辑发票信息</title>
- <!--框架必需start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/jquery.js"></script>
- <script type="text/javascript" src="${ctx}/qui/libs/js/framework.js"></script>
- <link href="${ctx}/qui/libs/css/import_basic.css" rel="stylesheet" type="text/css"/>
- <link rel="stylesheet" type="text/css" id="skin" prePath="${ctx}/qui/"/>
- <link rel="stylesheet" type="text/css" id="customSkin"/>
- <!--框架必需end-->
- <!-- 表单验证start -->
- <link rel="stylesheet" href="${ctx}/qui/libs/js/form/validform/css/style.css" type="text/css" media="all" />
- <script src="${ctx}/qui/libs/js/form/validform/validform.js" type="text/javascript"></script>
- <!-- 表单验证end -->
- <!--表单异步提交start-->
- <script src="${ctx}/qui/libs/js/form/form.js" type="text/javascript"></script>
- <!--表单异步提交end-->
- <!--箭头分页start-->
- <script type="text/javascript" src="${ctx}/qui/libs/js/nav/pageArrow.js"></script>
- <!--箭头分页end-->
- <!-- 日期选择框start -->
- <script type="text/javascript"
- src="${ctx}/qui/libs/js/form/datePicker/WdatePicker.js"></script>
- <!-- 日期选择框end -->
- </head>
- <body>
- <div class="box1" id="formContent" whiteBg="true">
- <form id="myFormId" action="${ctx}/invoice/editData.do" method="post" >
- <input type="hidden" name="invoiceId" value='${bwp.invoiceId!""}'/>
- <input type="hidden" name="invoiceInfo" value='${bwp.invoiceInfo!""}'/>
- <table class="tableStyle" formMode="view">
- <tr>
- <td><span class="star">*</span>发票代码:</td>
- <td><input type="text" name="invoiceCode" value='${bwp.invoiceCode!""}' datatype="*" autocomplete="off"/></td>
- <td><span class="star">*</span>发票号:</td>
- <td><input type="text" name="invoiceNumb" value='${bwp.invoiceNumb!""}' datatype="*" autocomplete="off"/></td>
- </tr>
- <tr >
- <td><span class="star">*</span>发票抬头:</td>
- <td colspan="3"><input style="width: 75%" type="text" name="orgName" value='${bwp.orgName!""}' autocomplete="off" datatype="*"/></td>
- </tr>
- <tr>
- <td><span class="star">*</span>纳税人识别号:</td>
- <td colspan="3"><input style="width: 75%" type="text" name="taxpayerNumber" value='${bwp.taxpayerNumber!""}' autocomplete="off" datatype="*"/></td>
- </tr>
- <tr>
- <td>总金额:</td>
- <td><input type="text" name="totalAmount" value='${bwp.totalAmount!""}' autocomplete="off" /></td>
- <td>税额:</td>
- <td><input type="text" name="taxAmount" value='${bwp.taxAmount!""}' autocomplete="off" /></td>
- </tr>
- <tr>
- <td>开票时间:</td>
- <td><input type="text" class="date" dateFmt="yyyy-MM-dd" id="billingTimeStr" autocomplete="off" name="billingTimeStr" value='${bwp.billingTime!""?string("yyyy-MM-dd")}' /></td>
- <td>开票人:</td>
- <td><input type="text" name="billingUser" value='${bwp.billingUser!""}' autocomplete="off"/></td>
- </tr>
- <tr>
- <td>发票状态:</td>
- <td><select name="state"
- data='{"list":[{"value":"1","key":"正常"},{"value":"2","key":"作废"}]}'
- selectedValue='${bwp.state!""}'></select>
- </td>
- <td>备注:</td>
- <td ><textarea rows="2" name="remark">${bwp.remark!""}</textarea></td>
- </tr>
- </table>
- <div class="right">
- <div class="padding_top5 padding_left10">
- <a href="#" onclick="addRow()"><span class="icon_add">添加</span></a>
- <div class="box_tool_line"></div>
- <a href="#" onclick="delRow()"><span class="icon_delete">删除</span></a>
- <div class="box_tool_line"></div>
- <a href="#" onclick="save()"><span class="icon_save">保存</span></a>
- <div class="box_tool_line"></div>
- <a href="#" onclick="top.Dialog.close()"><span class="icon_back">退出</span></a>
- <div class="clear"></div>
- </div>
- </div>
- </form>
- <table id="invoiceInfoTab" class="tableStyle" useCheckBox="false">
- <thead>
- <th width="5%"></th>
- <th width="25%">名称</th>
- <th width="10%">规格</th>
- <th width="10%">单位</th>
- <th width="10%">数量</th>
- <th width="10%">单价</th>
- <th width="10%">金额</th>
- <th width="10%">税率(%)</th>
- <th width="10%">税费</th>
- </thead>
- <tbody>
- [#if bwp.infoList??]
- [#assign size=1]
- [#list bwp.infoList as bs]
- [#if bs??]
- <tr>
- <td width="5%"><input type='checkbox' name='infoCk'/></td>
- <td width="25%"><input type='text' name='name' value='${bs.name!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='text' name='specs' value='${bs.specs!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='text' name='unit' value='${bs.unit!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='number' name='number' value='${bs.number!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='number' name='price' value='${bs.price!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='number' name='amount' value='${bs.amount!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='number' name='taxRate' value='${bs.taxRate!"" }' style='width:95%;'/></td>
- <td width="10%"><input type='number' name='taxAmount' value='${bs.taxAmount!"0" }' style='width:95%;'/></td>
- </tr>
- [/#if]
- [#assign size=size+1]
- [/#list]
- [/#if]
- </tbody>
- </table>
- </div>
- <!-- 异步提交start -->
- <script type="text/javascript">
- function initComplete(){
- //表单提交
- $("#myFormId").Validform({
- tiptype:3,//表示在右边显示
- ajaxPost:true,
- datatype:{
- //小数
- "decimal" : /^\d+\.\d+$/
- },
- showAllError:true,
- callback:function(responseText){
- $.Hidemsg();
- if(responseText.status=="y"){
- top.Dialog.alert(responseText.info,function(){
- closeWin();
- });
- }else{
- top.Dialog.alert(responseText.info,function(){
- return false;
- });
- }
- }
- });
- }
- //重置
- function closeWin() {
- //刷新数据
- top.frmright.resetSearch();
- //关闭窗口
- top.Dialog.close();
- }
- var j=1;
- //添加行
- function addRow(){
- //名称
- var val0="<td width='5%'><input type='checkbox' name='infoCk' value='"+j+"'/></td>";
- var val1="<td width='25%'><input type='text' name='name' value='' style='width:95%;' autocomplete='off' /></td>";
- //规格<t</td>"; width="10%"
- var val2="<td width='10%'><input type='text' name='specs' value='元/m³' style='width:95%;' autocomplete='off'/></td>";
- //单位<t</td>"; width="10%"
- var val3="<td width='10%'><input type='text' name='unit' value='m³' style='width:95%;' autocomplete='off'/></td>";
- //数量<t</td>"; width="10%"
- var val4="<td width='10%'><input type='number' name='number' value='' style='width:95%;' autocomplete='off'/></td>";
- //单价<t</td>"; width="10%"
- var val5="<td width='10%'><input type='number' name='price' value='' style='width:95%;' autocomplete='off'/></td>";
- //金额<t</td>"; width="10%"
- var val6="<td width='10%'><input type='number' name='amount' value='' style='width:95%;' autocomplete='off'/></td>";
- var val7="<td width='10%'><input type='number' name='taxRate' value='' style='width:95%;' autocomplete='off'/></td>";
- var val8="<td width='10%'><input type='number' name='taxAmount' value='' style='width:95%;' autocomplete='off'/></td>";
- var $tr=$("<tr>"+val0+val1+val2+val3+val4+val5+val6+val7+val8+"</tr>");
- $("#invoiceInfoTab tbody").append($tr);
- j++;
- //重新渲染表格
- $("#invoiceInfoTab").render();
- }
- //删除行
- function delRow(){
- var cks=$("input[name='infoCk']:checked");
- if(cks.length==0){
- top.Dialog.alert('请选择要删除的行!');
- return ;
- }
- for(var i=cks.length-1;i>=0;i--){
- //删除表单上的行
- $(cks[i]).parent().parent().remove();
- }
- }
- function save() {
- //将明细拼接成String
- var trDate = $("#invoiceInfoTab tbody ").find("tr");
- trDate = Array.from(trDate);
- var infoList=[];
- trDate.forEach(function (item,index) {
- var inputData = $(item).find("input");
- inputData = Array.from(inputData);
- var data = {};
- inputData.forEach(function (value) {
- var inputItem = $(value);
- if(inputItem.attr("name")!="infoCk"){
- if (inputItem.attr("type") =="number") {
- data[inputItem.attr("name")] =Number(inputItem.val());
- }else{
- data[inputItem.attr("name")] = inputItem.val();
- }
- }
- });
- infoList.push(data);
- })
- $("input[name='invoiceInfo']").val(JSON.stringify(infoList));
- $("#myFormId").submit();
- }
- </script>
- <!-- 异步提交end -->
- </body>
- </html>
|