ei_billing_upload.ftl 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="renderer" content="webkit|ie-comp|ie-stand">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  7. <meta name="viewport"
  8. content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no"/>
  9. <meta http-equiv="Cache-Control" content="no-siteapp"/>
  10. <#include "/base/add_base.ftl">
  11. <style>
  12. .tit{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  13. .tit:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  14. .tit-2{position: relative;text-align: left;font-size: 16px;padding-left: 10px;}
  15. .tit-2:after{content: '';position: absolute;left: 0;top: 20%;height: 60%;width: 3px;background-color: #32a3d8;}
  16. #province select{margin-right:10px; width:100px;height: 31px;-webkit-appearance:none !important;appearance:none;background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;padding-left:3px;padding-right: 25px;}
  17. .ac_results li a {white-space: nowrap;text-decoration:none;display:block;color:#05a;padding:1px 3px}
  18. .ac_results li {border:1px solid #fff}
  19. .ac_results li a span {float:right}
  20. .select-box{background: url(${path}/common/images/cm/select-1.png) right center no-repeat;background-size: auto 100%;}
  21. .select-box select{-webkit-appearance:none !important;background-color: transparent; appearance:none;padding-right: 15px;}
  22. .dalog-ask{position: absolute;left:60%;top:0;-webkit-transform: translateY(-30%);transform: translateY(-30%);display: none;background-color: #fff;z-index: 10;}
  23. .tag{ width:300px; min-height:300px; border:1px solid #32a3d8; position:relative;background-color: #fff;line-height: 1.5;padding: 10px 12px;}
  24. .tag em{display:block; border-width:15px; position:absolute; top:30%; left:-30px;border-style:solid dashed dashed; border-color:transparent #32a3d8 transparent transparent;font-size:0; line-height:0;}
  25. .time-line-list{list-style: none;width: 100%;margin-left: -20px;}
  26. .time-line-list>li{position: relative;float: left; text-align: center;width: 100px;overflow: hidden;white-space: nowrap;word-break: break-all;padding: 2px 0;}
  27. .time-line-list .number{display: inline-block; padding: 2px; background: #32a3d8;border: 2px solid #fff;box-shadow:0 0 0 1px #32a3d8;width: 20px;height: 20px;color: #fff;line-height: 20px;border-radius: 50%;}
  28. .time-line-list>li:before{content:'';position: absolute;height: 1px;width: 30%;right:0;top: 15px; background-color: #32a3d8;}
  29. .time-line-list>li:after{content: '';position: absolute;height: 1px;width: 30%;left: 0;top: 15px;background:#32a3d8;}
  30. .time-line-list>li:first-child:after,.time-line-list>li:last-child:before{display: none;}
  31. .time-line-list .arrow{border-width:7px; position:absolute; left:25%; top:9px;border-style:solid dashed dashed; border-color:transparent transparent transparent #32a3d8;font-size:0; line-height:0;}
  32. .time-line-list>li:first-child .arrow{display: none;}
  33. .table-bg th{background-color: #e2f6ff;}
  34. .update-parts>span{margin-right: 10px;padding: 3px 4px;background-color: #effaff;border: 1px solid #32a3d8;}
  35. .msg-phone{height: 35px;line-height: 35px;}
  36. .col-sm-1{width: 150px;}
  37. .all_down{text-decoration: underline;color: #00c;}
  38. </style>
  39. <title>发票上传 - 发票管理 - RST</title>
  40. </head>
  41. <body>
  42. <article class="page-container" style="padding: 10px;">
  43. <div class="pd-20 cl">
  44. <form action="${path}/admin/ei_billing/update_file" method="post" class="form form-horizontal" id="form-order-add" onkeydown="if(event.keyCode==13)return false;">
  45. <input type="hidden" id="billId" name="billId" value="${billId}">
  46. <input type="hidden" id="billInvoiceFileUrl" name="billInvoiceFileUrl" value="">
  47. <div class="row cl">
  48. <label class="form-label col-1 col-sm-1" style="float: left;text-align: right;"><span class="c-red">*</span>PDF文件:</label>
  49. <div class="formControls col-8 col-sm-8" style="margin-top: 3px;float: left;">
  50. <div class="select_invo" style="display: none;float: left;"><a href="javascript:void(0)" class=" all_down" onclick="toReadPdf()">查看发票</a></div>
  51. <input type="file" class="up_file" name="file" upload_type="file" id="upload_file_pdf" style="display: none">
  52. <div class="upload_file" style="margin-left: 10px;float: left;"><a href="javascript:void(0)" class=" all_down" onclick="fileOnclick(this)">点击上传发票</a></div>
  53. </div>
  54. </div>
  55. <div class="row cl" id="" style="">
  56. <label class="form-label col-1 col-sm-1" style="float: left;text-align: right;">发票代码 :</label>
  57. <div class="formControls col-5 col-sm-5" style="float: left;">
  58. <input type="text" class="input-text trim_input" value="" placeholder="发票代码" id="billInvoiceCode" datatype="/^.{0,50}$/" name="billInvoiceCode" >
  59. </div>
  60. </div>
  61. <div class="row cl" id="" style="">
  62. <label class="form-label col-1 col-sm-1" style="float: left;text-align: right;">发票号码 :</label>
  63. <div class="formControls col-5 col-sm-5" style="float: left;">
  64. <input type="text" class="input-text trim_input" value="" placeholder="发票号码" id="billInvoiceNum" datatype="/^.{0,50}$/" name="billInvoiceNum" >
  65. </div>
  66. </div>
  67. <div class="row cl" id="" style="">
  68. <label class="form-label col-1 col-sm-1" style="float: left;text-align: right;">开票日期 :</label>
  69. <div class="formControls col-5 col-sm-5" style="float: left;">
  70. <input type="text" placeholder="开票日期" id="billInvoiceDate" name="billInvoiceDate" datatype="*" class="input-text Wdate" onclick="WdatePicker({skin:'whyGreen',dateFmt:'yyyy-MM-dd HH:mm:ss',maxDate: '%y-%M-%d'})" readonly="readonly">
  71. </div>
  72. </div>
  73. <div class="row cl" id="" style="margin-top: 50px;">
  74. <div class="formControls col-11 col-sm-11" style="text-align: center;">
  75. <input type="submit" class="btn btn-primary add-order-button" value="确定上传" >
  76. </div>
  77. </div>
  78. </form>
  79. </div>
  80. </article>
  81. <script type="text/javascript">
  82. var url_path = "${path}";
  83. </script>
  84. <script type="text/javascript" src="${path}/common/lib/jquery/1.9.1/ajaxfileupload.js"></script>
  85. <script type="text/javascript" src="${path}/common/lib/My97DatePicker/4.8/WdatePicker.js"></script>
  86. <script type="text/javascript">
  87. var billId = "${billId}";
  88. var FILE_URL = "";
  89. $(function(){
  90. $("#upload_file_pdf").change(function() {
  91. fileUpload("upload_file_pdf");
  92. });
  93. });
  94. function fileOnclick(node){
  95. $(node).parent().siblings('.up_file').click();
  96. }
  97. /***
  98. * 发票上传
  99. */
  100. function fileUpload(idValue) {
  101. $.ajaxFileUpload({
  102. url:"/admin/ei_billing/upload_invoice?billId="+billId,
  103. secureuri:false,
  104. fileElementId : idValue,//文件选择框的id属性/名称
  105. dataType: 'json', //json
  106. success: function (data) {
  107. if(data.returnCode == 200){
  108. $("#billInvoiceFileUrl").val(data.returnMsg.path);
  109. FILE_URL = data.returnMsg.path;
  110. $(".select_invo").show();
  111. $(".upload_file").find("a").eq(0).html("重新上传发票");
  112. }else{
  113. layer.msg('上传文件失败,请重试!',{icon: 5,time:2000});
  114. }
  115. $("#upload_file_pdf").change(function() {
  116. fileUpload("upload_file_pdf");
  117. });
  118. }
  119. });
  120. }
  121. $(function(){
  122. var loadIndex = 0;
  123. $("#form-order-add").Validform({
  124. tiptype: function (msg, o, cssctl) {
  125. if (o.type == 3) {//失败
  126. layer.msg(msg, {icon: 5, time: 3000});
  127. $(window).scrollTop(o.obj.offset().top - 40);
  128. }
  129. },
  130. datatype: {//自定义验证类型
  131. },
  132. ignoreHidden: true,
  133. tipSweep: true, //若为true,则只在表单提交时验证
  134. ajaxPost: true, //异步提交
  135. beforeCheck: function (curform) { //验证通过之前执行的函数
  136. var flag = false;
  137. },
  138. beforeSubmit: function (curform) { //验证通过之后执行的函数
  139. var billInvoiceFileUrl = $("#billInvoiceFileUrl").val();
  140. if(!isEmpty(billInvoiceFileUrl)){
  141. layer.msg("请上传发票文件!", {icon: 5, time: 3000});
  142. return false;
  143. }
  144. loadIndex = layer.load(1, {
  145. shade: [0.5,'#fff'] //0.1透明度的白色背景
  146. });
  147. },
  148. callback: function (data) {//异步回调函数
  149. if (data) {
  150. if (data.resultCode == 200) {
  151. layer.msg(data.resultMsg,{icon: 5,time:3000});
  152. parent.layer.close(parent.layer.getFrameIndex(window.name));
  153. }else {
  154. layer.msg("上传发票失败!", {icon: 5, time: 3000});
  155. }
  156. if(loadIndex != 0 ){
  157. layer.close(loadIndex);
  158. }
  159. }
  160. return false;
  161. }
  162. });
  163. });
  164. /**
  165. * 查看pdf
  166. * @param url
  167. */
  168. function toReadPdf() {
  169. window.open("/"+FILE_URL);
  170. }
  171. </script>
  172. </body>
  173. </html>