datalist.html 9.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277
  1. {extend name="common/base"/}
  2. <!-- 主体 -->
  3. {block name="body"}
  4. <div class="p-3">
  5. <form class="layui-form gg-form-bar border-t border-x">
  6. <div class="layui-input-inline" style="width:300px;">
  7. <input type="text" name="keywords" placeholder="请输入关键字" class="layui-input" autocomplete="off"/>
  8. </div>
  9. <div class="layui-input-inline">
  10. <button class="layui-btn layui-btn-normal" lay-submit="" lay-filter="searchform">提交搜索</button>
  11. </div>
  12. </form>
  13. <table class="layui-hide" id="cost_project" lay-filter="cost_project"></table>
  14. </div>
  15. <script type="text/html" id="toolbarDemo">
  16. <div class="layui-btn-container">
  17. </div>
  18. </script>
  19. <script type="text/html" id="barDemo">
  20. <div class="layui-btn-group">
  21. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
  22. <a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a>
  23. </div>
  24. </script>
  25. {/block}
  26. <!-- /主体 -->
  27. <!-- 脚本 -->
  28. {block name="script"}
  29. <script>
  30. const moduleInit = ['tool'];
  31. function gouguInit() {
  32. var table = layui.table, tool = layui.tool, form = layui.form;
  33. layui.pageTable = table.render({
  34. elem: '#cost_project',
  35. title: '接收项目',
  36. toolbar: '#toolbarDemo',
  37. url: '/admin/project.received/datalist',
  38. page: true,
  39. limit: 20,
  40. cols: [
  41. [
  42. {
  43. fixed: 'left',
  44. field: 'id',
  45. title: '编号',
  46. align: 'center',
  47. width: 80
  48. }, {
  49. field: 'project_status',
  50. title: '项目状态',
  51. align: 'center',
  52. width: 100,
  53. templet: function (item) {
  54. var html;
  55. if (item.project_status === 4) {
  56. html = '<span class="layui-badge layui-bg-orange">分配中</span> ';
  57. }
  58. return html;
  59. }
  60. }, {
  61. field: 'project_name',
  62. title: '项目名称',
  63. align: 'center',
  64. width: 200
  65. }, {
  66. field: 'project_num',
  67. title: '项目编号',
  68. align: 'center',
  69. width: 150
  70. }, {
  71. field: 'project_time',
  72. title: '项目周期',
  73. align: 'center',
  74. width: 250,
  75. templet: function (item) {
  76. var html;
  77. html =
  78. "<div>" +
  79. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  80. "~" +
  81. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  82. "</div>";
  83. return html;
  84. }
  85. }, {
  86. field: 'entrust_unit_name',
  87. title: '委托单位',
  88. align: 'center',
  89. width: 150
  90. }, {
  91. field: 'entrust_head',
  92. title: '委托单位负责人',
  93. align: 'center',
  94. width: 150
  95. }, {
  96. field: 'entrust_head_phone',
  97. title: '委托单位负责人电话',
  98. align: 'center',
  99. width: 150
  100. }, {
  101. field: 'sent_review_unit',
  102. title: '送审单位',
  103. align: 'center',
  104. width: 100
  105. }, {
  106. field: 'sent_review_head',
  107. title: '送审单位负责人',
  108. align: 'center',
  109. width: 150
  110. }, {
  111. field: 'sent_review_phone',
  112. title: '送审单位负责人电话',
  113. align: 'center',
  114. width: 150
  115. }, {
  116. field: 'project_scale',
  117. title: '项目规模',
  118. align: 'center',
  119. width: 150
  120. }, {
  121. field: 'engineering_category',
  122. title: '工程类别',
  123. align: 'center',
  124. width: 150
  125. }, {
  126. field: 'engineering_type',
  127. title: '工程类型',
  128. align: 'center',
  129. width: 150
  130. }, {
  131. field: 'project_region',
  132. title: '项目区域',
  133. align: 'center',
  134. width: 150
  135. }, {
  136. field: 'fiscal_nature',
  137. title: '财政性质',
  138. align: 'center',
  139. width: 150
  140. }, {
  141. field: 'sent_review_cost',
  142. title: '送审服务费',
  143. align: 'center',
  144. width: 150
  145. }, {
  146. field: 'preparation_amount',
  147. title: '编制金额',
  148. align: 'center',
  149. width: 150
  150. }, {
  151. field: 'sent_review_amount',
  152. title: '送审金额',
  153. align: 'center',
  154. width: 150
  155. }, {
  156. field: 'authorize_amount',
  157. title: '审定金额',
  158. align: 'center',
  159. width: 150
  160. }, {
  161. field: 'review_add_amount',
  162. title: '审增金额',
  163. align: 'center',
  164. width: 150
  165. }, {
  166. field: 'review_reduce_amount',
  167. title: '审减金额',
  168. align: 'center',
  169. width: 150
  170. }, {
  171. field: 'report_time',
  172. title: '报告时间',
  173. align: 'center',
  174. width: 150,
  175. templet: function (d) { if(d.report_time){ return layui.util.toDateString(d.report_time * 1000, "yyyy-MM-dd") }else{return "";}}
  176. }, {
  177. field: 'charge_standard',
  178. title: '收费标准',
  179. align: 'center',
  180. width: 150
  181. }, {
  182. field: 'invoicing__amount',
  183. title: '开票金额',
  184. align: 'center',
  185. width: 150
  186. }, {
  187. field: 'invoicing__num',
  188. title: '开票编号',
  189. align: 'center',
  190. width: 150
  191. }, {
  192. field: 'operate_head_name',
  193. title: '作业负责人',
  194. align: 'center',
  195. width: 150
  196. }, {
  197. field: 'operate_team_names',
  198. title: '作业成员',
  199. align: 'center',
  200. width: 300
  201. }, {
  202. field: 'create_time',
  203. title: '项目创建日期',
  204. align: 'center',
  205. width: 120,
  206. templet: "<div>{{layui.util.toDateString(d.updated, 'yyyy-MM-dd')}}</div>"
  207. }, {
  208. field: 'project_dead_time',
  209. title: '项目归档日期',
  210. align: 'center',
  211. width: 120
  212. },
  213. {
  214. fixed: 'right',
  215. field: 'right',
  216. title: '操作',
  217. toolbar: '#barDemo',
  218. width: 136,
  219. align: 'center'
  220. }
  221. ]
  222. ]
  223. });
  224. //监听表格行工具事件
  225. table.on('tool(cost_project)', function (obj) {
  226. var data = obj.data;
  227. if (obj.event === 'read') {
  228. // console.log(obj.data.getTrusteeName.institution)
  229. tool.side('/admin/project.received/read?id=' + obj.data.id);
  230. } else if (obj.event === 'edit') {
  231. tool.side('/admin/project.received/edit?id=' + obj.data.id);
  232. } else if (obj.event === 'del') {
  233. layer.confirm('确定要删除该记录吗?', {
  234. icon: 3,
  235. title: '提示'
  236. }, function (index) {
  237. let callback = function (e) {
  238. layer.msg(e.msg);
  239. if (e.code == 0) {
  240. obj.del();
  241. }
  242. }
  243. tool.delete("/admin/project.received/del", {id: data.id}, callback);
  244. layer.close(index);
  245. });
  246. }
  247. return false;
  248. });
  249. //监听搜索提交
  250. form.on('submit(searchform)', function (data) {
  251. layui.pageTable.reload({
  252. where: {
  253. keywords: data.field.keywords
  254. },
  255. page: {
  256. curr: 1
  257. }
  258. });
  259. return false;
  260. });
  261. }
  262. </script>
  263. {/block}
  264. <!-- /脚本 -->