index.html 7.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <meta charset="utf-8">
  5. <title>发票管理</title>
  6. <meta name="renderer" content="webkit">
  7. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  8. <meta name="viewport"
  9. content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
  10. <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all">
  11. <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all">
  12. <style type="text/css">
  13. .LAY-btns .layui-nav {
  14. padding-left: 0;
  15. padding-right: 10px;
  16. top: -4px;
  17. margin: 0 10px;
  18. border: 0;
  19. background-color: #009688;
  20. }
  21. .LAY-btns .layui-nav .layui-nav-item {
  22. line-height: 30px;
  23. }
  24. .LAY-btns .layui-nav .layui-nav-child {
  25. top: 34px;
  26. }
  27. .LAY-btns .layui-nav .layui-nav-bar {
  28. display: none;
  29. }
  30. .LAY-btns .layui-nav .layui-nav-child dd.layui-this a {
  31. color: #333;
  32. background-color: #fff;
  33. }
  34. .LAY-btns .layui-nav .layui-nav-child dd.layui-this a:hover {
  35. background-color: #f2f2f2;
  36. color: #000;
  37. }
  38. .seach_items {
  39. display: inline-block;
  40. margin-right: 5px;
  41. margin-top: 5px;
  42. }
  43. </style>
  44. </head>
  45. <body>
  46. <div class="layui-fluid">
  47. <div class="layui-card">
  48. <div class="layui-card-body" pad15>
  49. <div class="layui-row layui-col-space15">
  50. <div class="layui-col-md12">
  51. <div class="LAY-btns" style="margin-bottom: 10px;">
  52. <div style="float:left; margin-right: 5px; margin-top: 5px;">
  53. <button class="layui-btn" id="btn_add">
  54. <i class="layui-icon layui-icon-add-circle"></i>申请发票
  55. </button>
  56. </div>
  57. <div style="float:right;">
  58. <form class="layui-form" lay-filter="query-form-element">
  59. <div class="seach_items">
  60. <input type="text" name="title" autocomplete="off" class="layui-input"
  61. placeholder="标题"/>
  62. </div>
  63. <div class="seach_items">
  64. <input type="text" name="create_user" autocomplete="off" class="layui-input"
  65. placeholder="添加人"/>
  66. </div>
  67. </form>
  68. </div>
  69. <div style="clear: both;"></div>
  70. </div>
  71. <table class="layui-hide" id="datagrid" lay-filter="datagrid-operate"></table>
  72. <script type="text/html" id="datagrid-operate-bar">
  73. <div class="layui-btn-group">
  74. <a class="layui-btn layui-btn-xs" lay-event="detail">查看</a>
  75. </div>
  76. <div class="layui-btn-group">
  77. <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a>
  78. </div>
  79. </script>
  80. </div>
  81. </div>
  82. </div>
  83. </div>
  84. </div>
  85. <script src="../../layuiadmin/layui/layui.js?t=1"></script>
  86. <script>
  87. layui.config({
  88. base: '../../../layuiadmin/' //静态资源所在路径
  89. }).extend({
  90. index: 'lib/index' //主入口模块
  91. }).use(['index', 'table', 'form', 'upload', 'http'], function () {
  92. var $ = layui.$
  93. , table = layui.table
  94. , admin = layui.admin
  95. , form = layui.form;
  96. table.render({
  97. elem: '#datagrid'
  98. , url: '/tenant/invoice/'
  99. , cols: [[
  100. {field: 'invoice_name', title: '名称', width: 150}
  101. ,{field: 'tax_no', title: '税号', width: 150}
  102. ,{field: 'company_address', title: '单位地址', width: 150}
  103. ,{field: 'phone_no', title: '电话号码', width: 100}
  104. ,{field: 'deposit_bank', title: '开户银行', width: 200}
  105. ,{field: 'bank_account', title: '银行账户', width: 200}
  106. ,{field: 'invoice_sum', title: '发票金额', width: 100}
  107. ,{field: 'status_text', title: '状态', width: 100}
  108. ,{field: 'use_time', title: '操作时间', width: 200}
  109. ,{field: 'reject_reason', title: '说明', width: 100}
  110. ,{field: 'consignee', title: '收件人', width: 100}
  111. ,{field: 'consignee_tel', title: '收件人电话', width: 100}
  112. ,{field: 'consignee_address', title: '收件地址', width: 100}
  113. ,{field: 'express_company', title: '快递公司', width: 100}
  114. ,{field: 'express_number', title: '快递单号', width: 100}
  115. , {title: "操作", width: 150, align: 'left', fixed: 'right', toolbar: '#datagrid-operate-bar'}
  116. ]]
  117. , page: true
  118. , height: 'full-108'
  119. });
  120. var _params;
  121. form.on('submit(query-form-element)', function (data) {
  122. //layer.msg(JSON.stringify(data.field));
  123. _params = data.field;
  124. table.reload('datagrid', {
  125. where: data.field
  126. , page: {curr: 1}
  127. });
  128. layer.closeAll();
  129. return false;
  130. });
  131. //监听工具条
  132. table.on('tool(datagrid-operate)', function (obj) {
  133. var data = obj.data;
  134. if (obj.event === 'detail') {
  135. table.editdata = data;
  136. layer.open({
  137. type: 2,
  138. title: "详情",
  139. shadeClose: false,
  140. area: ['700px', '500px'],
  141. content: 'detail.html'
  142. })
  143. }else if (obj.event === 'edit') {
  144. let status = data.status;
  145. if(status !== 0){
  146. layer.msg('当前发票暂不允许修改');
  147. return
  148. }
  149. table.editdata = data;
  150. layer.open({
  151. type: 2,
  152. title: '修改',
  153. shadeClose: false,
  154. area: ['50%', '80%'],
  155. btn: ['保存', '取消'],
  156. yes: function (index, dom) {
  157. layui.submitChild();
  158. },
  159. btn2: function (index, layero) {
  160. layer.close(index);//关闭当前按钮
  161. },
  162. content: 'edit.html?id=' + data.id
  163. });
  164. }
  165. });
  166. $('#btn_add').on('click', function () {
  167. layer.open({
  168. type: 2,
  169. title: '申请发票',
  170. shadeClose: false,
  171. btn: ['保存', '取消'],
  172. area: ['50%', '80%'],
  173. yes: function (index, dom) {
  174. layui.submitChild();
  175. },
  176. btn2: function (index, layero) {
  177. layer.close(index);//关闭当前按钮
  178. },
  179. content: 'edit.html'
  180. });
  181. });
  182. });
  183. </script>
  184. </body>
  185. </html>