datalist.html 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315
  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 type="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. <div id="selectBox2" style="display: none;">
  16. <div id="financialSelect2"></div>
  17. <div id="companySelect2"></div>
  18. <button id="cc">1111</button>
  19. </div>
  20. <script type="text/html" id="toolbarDemo">
  21. <div class="layui-btn-container">
  22. </div>
  23. </script>
  24. <script type="text/html" id="barDemo">
  25. <div class="layui-btn-group">
  26. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="read">查看</a>
  27. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="receive">接收</a>
  28. </div>
  29. </script>
  30. {/block}
  31. <!-- /主体 -->
  32. <!-- 脚本 -->
  33. {block name="script"}
  34. <script>
  35. const moduleInit = ['tool'];
  36. var listount;
  37. var select_Data
  38. var financial = [
  39. {nickname: "hhh1", id: 1},
  40. {nickname: "hhh2", id: 2},
  41. {nickname: "hhh3", id: 3},
  42. ]
  43. function gouguInit() {
  44. var table = layui.table, tool = layui.tool, form = layui.form;
  45. var allcount;
  46. layui.pageTable = table.render({
  47. elem: '#cost_project',
  48. title: '造价项目列表',
  49. toolbar: '#toolbarDemo',
  50. url: '/admin/project.audit_company/datalist',
  51. page: true,
  52. limit: 20,
  53. parseData: function(res) { // 数据解析回调函数
  54. // 在这里可以获取数据总数
  55. allcount = res.count;
  56. return {
  57. code: res.code, // 数据状态码
  58. msg: res.msg, // 状态信息
  59. count: res.count, // 数据总数
  60. data: res.data // 当前页数据
  61. };
  62. },
  63. cols: [
  64. [
  65. {fixed: 'left', field: 'id', title: '编号', align: 'center', width: 80,
  66. templet: function(d){
  67. return allcount - (d.LAY_NUM-1);
  68. }
  69. },
  70. {
  71. field: 'project_status',
  72. title: '项目状态',
  73. align: 'center',
  74. width: 100,
  75. templet: function (item) {
  76. var html;
  77. if (item.project_status === 3) {
  78. html = '<span class="layui-badge layui-bg-orange">待接收</span> ';
  79. }
  80. return html;
  81. }
  82. },
  83. {
  84. field: 'project_name',
  85. title: '项目名称',
  86. align: 'center',
  87. width: 200
  88. }, {
  89. field: 'project_num',
  90. title: '项目编号',
  91. align: 'center',
  92. width: 150
  93. }, {
  94. field: 'project_time',
  95. title: '项目周期',
  96. align: 'center',
  97. width: 250,
  98. templet: function (item) {
  99. var html;
  100. html =
  101. "<div>" +
  102. layui.util.toDateString(item.project_start_time * 1000, 'yyyy-MM-dd') +
  103. "~" +
  104. layui.util.toDateString(item.project_end_time * 1000, 'yyyy-MM-dd') +
  105. "</div>";
  106. return html;
  107. }
  108. }, {
  109. field: 'entrust_unit_name',
  110. title: '委托单位',
  111. align: 'center',
  112. width: 150
  113. }, {
  114. field: 'entrust_head',
  115. title: '委托单位负责人',
  116. align: 'center',
  117. width: 150
  118. }, {
  119. field: 'entrust_head_phone',
  120. title: '委托单位负责人电话',
  121. align: 'center',
  122. width: 150
  123. }, {
  124. field: 'sent_review_unit',
  125. title: '送审单位',
  126. align: 'center',
  127. width: 100
  128. }, {
  129. field: 'sent_review_head',
  130. title: '送审单位负责人',
  131. align: 'center',
  132. width: 150
  133. }, {
  134. field: 'sent_review_phone',
  135. title: '送审单位负责人电话',
  136. align: 'center',
  137. width: 150
  138. }, {
  139. field: 'project_scale',
  140. title: '项目规模',
  141. align: 'center',
  142. width: 150
  143. }, {
  144. field: 'engineering_category',
  145. title: '工程类别',
  146. align: 'center',
  147. width: 150
  148. }, {
  149. field: 'engineering_type',
  150. title: '项目类型',
  151. align: 'center',
  152. width: 150
  153. }, {
  154. field: 'project_region',
  155. title: '项目区域',
  156. align: 'center',
  157. width: 150
  158. }, {
  159. field: 'fiscal_nature',
  160. title: '财政性质',
  161. align: 'center',
  162. width: 150
  163. }, {
  164. field: 'sent_review_cost',
  165. title: '送审服务费',
  166. align: 'center',
  167. width: 150
  168. }, {
  169. field: 'preparation_amount',
  170. title: '编制金额',
  171. align: 'center',
  172. width: 150
  173. }, {
  174. field: 'sent_review_amount',
  175. title: '送审金额',
  176. align: 'center',
  177. width: 150
  178. }, {
  179. field: 'authorize_amount',
  180. title: '审定金额',
  181. align: 'center',
  182. width: 150
  183. }, {
  184. field: 'review_add_amount',
  185. title: '审增金额',
  186. align: 'center',
  187. width: 150
  188. }, {
  189. field: 'review_reduce_amount',
  190. title: '审减金额',
  191. align: 'center',
  192. width: 150
  193. }, {
  194. field: 'report_time',
  195. title: '报告时间',
  196. align: 'center',
  197. width: 150,
  198. templet: function (d) {
  199. if (d.report_time) {
  200. return layui.util.toDateString(d.report_time * 1000, "yyyy-MM-dd")
  201. } else {
  202. return "";
  203. }
  204. }
  205. }, {
  206. field: 'charge_standard',
  207. title: '收费标准',
  208. align: 'center',
  209. width: 150
  210. }, {
  211. field: 'invoicing__amount',
  212. title: '开票金额',
  213. align: 'center',
  214. width: 150
  215. }, {
  216. field: 'invoicing__num',
  217. title: '开票编号',
  218. align: 'center',
  219. width: 150
  220. }, {
  221. field: 'operate_head_name',
  222. title: '作业负责人',
  223. align: 'center',
  224. width: 150
  225. }, {
  226. field: 'operate_team_names',
  227. title: '作业成员',
  228. align: 'center',
  229. width: 300
  230. }, {
  231. field: 'create_time',
  232. title: '项目创建日期',
  233. align: 'center',
  234. width: 120,
  235. templet: "<div>{{layui.util.toDateString(d.updated, 'yyyy-MM-dd')}}</div>"
  236. }, {
  237. field: 'project_dead_time',
  238. title: '项目归档日期',
  239. align: 'center',
  240. width: 120
  241. },
  242. {
  243. fixed: 'right',
  244. field: 'right',
  245. title: '操作',
  246. toolbar: '#barDemo',
  247. width: 136,
  248. align: 'center'
  249. }
  250. ]
  251. ],
  252. done: function (res, curr, count) {
  253. listount = count;
  254. }
  255. });
  256. //监听表格行工具事件
  257. table.on('tool(cost_project)', function (obj) {
  258. var data = obj.data;
  259. if (obj.event === 'read') {
  260. // console.log(obj.data.getTrusteeName.institution)
  261. tool.side('/admin/project.audit_company/read?id=' + obj.data.id);
  262. } else if (obj.event === 'edit') {
  263. tool.side('/admin/project.audit_company/edit?id=' + obj.data.id);
  264. } else if (obj.event === 'receive') {
  265. var index = layer.confirm("确认是否接收此项目?", function () {
  266. layer.close(index);
  267. let callback = function (e) {
  268. layer.msg(e.msg);
  269. listount--;
  270. if (listount == 0) {
  271. parent.showhongdian()
  272. }
  273. if (e.code == 0) {
  274. obj.del();
  275. }
  276. }
  277. tool.delete("/admin/project.audit_company/receive", {
  278. id: data.id,
  279. }, callback);
  280. })
  281. return false;
  282. }
  283. })
  284. //监听搜索提交
  285. form.on('submit(searchform)', function (data) {
  286. layui.pageTable.reload({
  287. where: {
  288. keywords: data.field.keywords
  289. },
  290. page: {
  291. curr: 1
  292. }
  293. });
  294. return false;
  295. });
  296. }
  297. </script>
  298. {/block}
  299. <!-- /脚本 -->