datalist_company.html 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300
  1. {extend name="common/base"/}
  2. {block name="style"}
  3. <style>
  4. .footer{
  5. width: 100%;
  6. height: 25px;
  7. text-align: center;
  8. position: fixed;
  9. bottom: 0;
  10. }
  11. .name{
  12. font-weight: 600;
  13. color: rgb(95,95,95);
  14. }
  15. .number-red{
  16. color: red;
  17. }
  18. .number-green{
  19. color: rgb(11,178,89);
  20. }
  21. .yuan{
  22. padding-right: 2vw;
  23. }
  24. .static{
  25. display: flex;
  26. }
  27. </style>
  28. {/block}
  29. <!-- 主体 -->
  30. {block name="body"}
  31. <div class="p-3">
  32. <form class="layui-form gg-form-bar border-t border-x">
  33. <div class="layui-input-inline" style="width:300px;">
  34. <input type="text" name="keywords" placeholder="请输入委托单位关键字" class="layui-input" autocomplete="off"/>
  35. </div>
  36. <div class="layui-input-inline">
  37. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
  38. </div>
  39. </form>
  40. <table class="layui-hide" id="appropriation" lay-filter="appropriation"></table>
  41. </div>
  42. <script type="text/html" id="toolbarDemo">
  43. <div class="layui-btn-container static">
  44. <div>
  45. <span class="layui-btn layui-btn-sm " data-title="添加造价项目" lay-event="add">+ 添加请款函</span>
  46. </div>
  47. <div>
  48. <span class="name">评审服务费:</span><span class="number-red">{$sent_review_cost}</span><span class="yuan">元</span>
  49. <span class="name">已请款:</span><span class="number-green">{$appropriation_amount}</span><span class="yuan">元</span>
  50. <span class="name">未请款:</span><span class="number-red">{$not_appropriation_amount}</span><span class="yuan">元</span>
  51. <span class="name">已开票:</span><span class="number-green">{$invoicing_amount}</span><span class="yuan">元</span>
  52. <span class="name">未开票:</span><span class="number-red">{$not_invoicing_amount}</span><span class="yuan">元</span>
  53. </div>
  54. </div>
  55. </script>
  56. <script type="text/html" id="barDemo">
  57. <div class="layui-btn-container">
  58. <div class="layui-btn-group">
  59. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
  60. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">编辑</a>
  61. </div>
  62. </div>
  63. </script>
  64. {/block}
  65. <!-- /主体 -->
  66. <!-- 脚本 -->
  67. {block name="script"}
  68. <script>
  69. const moduleInit = ['tool'];
  70. function gouguInit() {
  71. var table = layui.table, tool = layui.tool, form = layui.form;
  72. var allcount;
  73. var num_aaa =0;
  74. layui.pageTable = table.render({
  75. elem: '#appropriation',
  76. title: '造价项目列表',
  77. toolbar: '#toolbarDemo',
  78. url: '/admin/project.appropriation/datalist_company',
  79. page: true,
  80. limit: 20,
  81. parseData: function(res) { // 数据解析回调函数
  82. // 在这里可以获取数据总数
  83. allcount = res.count;
  84. return {
  85. code: res.code, // 数据状态码
  86. msg: res.msg, // 状态信息
  87. count: res.count, // 数据总数
  88. data: res.data // 当前页数据
  89. };
  90. },
  91. cols: [
  92. [
  93. {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
  94. templet: function(d){
  95. return allcount - (d.LAY_NUM-1);
  96. }
  97. }, {
  98. field: 'status',
  99. title: '项目状态',
  100. align: 'center',
  101. width: 100,
  102. templet: function (item) {
  103. var html = '';
  104. if (item.status === 0) {
  105. html = '<span>立项中</span> ';
  106. } else if (item.status === 1) {
  107. html = '<span">审核中</span> ';
  108. } else if (item.status === 2) {
  109. html = '<span">已通过</span> ';
  110. } else if (item.status === 3) {
  111. html = '<span">已驳回</span> ';
  112. }else if (item.status === -1) {
  113. html = '<span">立项审核中</span> ';
  114. }else if (item.status === -2) {
  115. html = '<span">立项未通过</span> ';
  116. }
  117. return html;
  118. }
  119. }, {
  120. field: 'entrust_unit_name',
  121. title: '委托单位',
  122. align: 'center',
  123. width: 100
  124. }, {
  125. field: 'appropriation_amount',
  126. title: '请款金额',
  127. align: 'center',
  128. width: 100
  129. }, {
  130. field: 'appropriation_time',
  131. title: '请款时间',
  132. align: 'center',
  133. width: 150,
  134. templet: function (d) {
  135. if (d.appropriation_time) {
  136. return layui.util.toDateString(d.appropriation_time * 1000, "yyyy-MM-dd")
  137. } else {
  138. return "";
  139. }
  140. }
  141. }, {
  142. field: 'project_names',
  143. title: '相关项目',
  144. align: 'center',
  145. width: 150
  146. }, {
  147. field: 'refund_amount',
  148. title: '回款金额(元)',
  149. align: 'center',
  150. width: 150,
  151. templet: function (d) {
  152. if (d.refund_amount) {
  153. return `<u style="color: green">${d.refund_amount}</u>`
  154. } else {
  155. return ""
  156. }
  157. }
  158. }, {
  159. field: 'refund_time',
  160. title: '回款时间',
  161. align: 'center',
  162. width: 150,
  163. templet: function (d) {
  164. if (d.refund_time) {
  165. return layui.util.toDateString(d.refund_time * 1000, "yyyy-MM-dd")
  166. } else {
  167. return "";
  168. }
  169. }
  170. }, {
  171. field: 'invoicing_amount',
  172. title: '发票金额',
  173. align: 'center',
  174. width: 100,
  175. templet: function (d) {
  176. if (d.invoicing_amount) {
  177. return `<u style="color: green">${d.invoicing_amount}</u>`
  178. } else {
  179. return ""
  180. }
  181. }
  182. }, {
  183. field: 'invoicing_num',
  184. title: '发票编号',
  185. align: 'center',
  186. width: 150
  187. }, {
  188. field: 'invoice_status',
  189. title: '发票状态',
  190. align: 'center',
  191. width: 150,
  192. templet: function (d) {
  193. var h = "";
  194. if (d.invoice_status == 1) {
  195. h = "已开票";
  196. } else if (d.invoice_status == 0) {
  197. h = "未开票";
  198. }
  199. return h;
  200. }
  201. }, {
  202. field: 'invoice_type',
  203. title: '发票类型',
  204. align: 'center',
  205. width: 100,
  206. templet: function (d) {
  207. var h = "";
  208. if (d.invoice_status == 1) {
  209. h = "已开票";
  210. } else if (d.invoice_status == 0) {
  211. h = "未开票";
  212. }
  213. return h;
  214. }
  215. }, {
  216. field: 'invoice_detail',
  217. title: '请款函',
  218. align: 'center',
  219. }, {
  220. field: 'maker_name',
  221. title: '创建人名称',
  222. align: 'center',
  223. }, {
  224. fixed: 'right',
  225. field: 'right',
  226. title: '操作',
  227. toolbar: '#barDemo',
  228. width: 136,
  229. align: 'center'
  230. }
  231. ]
  232. ],
  233. done:function () {
  234. if(num_aaa === 0){
  235. parent.showhongdian()
  236. // console.log('2执行了')
  237. }
  238. }
  239. });
  240. //监听表头工具栏事件
  241. table.on('toolbar(appropriation)', function (obj) {
  242. if (obj.event === 'add') {
  243. tool.side("/admin/project.appropriation/add");
  244. return false;
  245. }
  246. });
  247. //监听表格行工具事件
  248. table.on('tool(appropriation)', function (obj) {
  249. if (obj.event === 'read') {
  250. tool.side("/admin/project.appropriation/c_read?id=" + obj.data.id);
  251. return false;
  252. }else if (obj.event === 'edit'){
  253. tool.side("/admin/project.appropriation/edit_company?id=" + obj.data.id);
  254. return false;
  255. }
  256. })
  257. //监听搜索提交
  258. form.on('submit(searchform)', function (data) {
  259. layui.pageTable.reload({
  260. where: {
  261. keywords: data.field.keywords
  262. },
  263. page: {
  264. curr: 1
  265. }
  266. });
  267. return false;
  268. });
  269. }
  270. </script>
  271. {/block}
  272. <!-- /脚本 -->