main.html 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  7. <meta name="keywords" content="">
  8. <meta name="description" content="">
  9. <title text="数据集合"></title>
  10. <link rel="stylesheet" href="../../../component/pear/css/pear.css" />
  11. <link rel="stylesheet" href="../../../admin/css/other/user.css" />
  12. </head>
  13. <body class="pear-container">
  14. <div class="layui-card">
  15. <div class="layui-card-body">
  16. <form class="layui-form">
  17. <div class="layui-form-item">
  18. <label class="layui-form-label">区县名称</label>
  19. <div class="layui-input-inline">
  20. <select name="district" id="district">
  21. </select>
  22. </div>
  23. <button class="pear-btn pear-btn-md-0 pear-btn-primary" lay-submit lay-filter="query">
  24. <i class="layui-icon layui-icon-search"></i> 查询
  25. </button>
  26. <button type="reset" class="pear-btn pear-btn-md-0">
  27. <i class="layui-icon layui-icon-refresh"></i> 重置
  28. </button>
  29. </div>
  30. </form>
  31. </div>
  32. </div>
  33. <div class="layui-card">
  34. <div class="layui-card-body">
  35. <table id="table" lay-filter="table"></table>
  36. </div>
  37. </div>
  38. </body>
  39. <script type="text/html" id="toolbar">
  40. </script>
  41. <script type="text/html" id="bar">
  42. <a class="cool-line-btn cool-bg-blue" lay-event="edit">办结</a>
  43. <div class="cool-line-divider"></div>
  44. <a class="cool-line-btn cool-bg-blue" lay-event="detail">详情</a>
  45. </script>
  46. <script type="text/html" id="createTimeTpl">
  47. {{layui.util.toDateString(d.createTime, 'yyyy-MM-dd HH:mm:ss')}}
  48. </script>
  49. <script src="../../../component/layui/layui.js"></script>
  50. <script src="../../../component/pear/pear.js"></script>
  51. <script>
  52. layui.use(['request', 'table', 'form', 'popup', 'common'], function () {
  53. var request = layui.request,
  54. table = layui.table,
  55. form = layui.form,
  56. popup = layui.popup,
  57. common = layui.common;
  58. var MODULE_PATH = "/business/data/v1/";
  59. layer.ready(function() {
  60. request.dictSelect('district', 'sys_district');
  61. });
  62. request.tableRender({
  63. url: MODULE_PATH,
  64. cols: [
  65. [
  66. {type: 'checkbox'},
  67. {title: '区县名称', field: 'districtName', align: 'center'},
  68. {title: '年月', field: 'yearMonth', align: 'center'},
  69. {title: '住宅销售套数(套)', field: 'saleNumber', align: 'center'},
  70. {title: '住宅销售面积(m²)', field: 'saleArea', align: 'center'},
  71. {title: '住宅销售总价(元)', field: 'saleTotalPrice', align: 'center'},
  72. {title: '非住宅销售套数(套)', field: 'otherSaleNumber', align: 'center'},
  73. {title: '非住宅销售面积(m²)', field: 'otherSaleArea', align: 'center'},
  74. {title: '非住宅销售总价(元)', field: 'otherSaleTotalPrice', align: 'center'},
  75. {title: '办结状态', field: 'isEnd', align: 'center', templet: function (d) {
  76. return d.isEnd == 1 ? '<span class="layui-badge-dot success"></span>已办结' : '<span class="layui-badge-dot warning"></span>未办结';
  77. }
  78. },
  79. {title: '操作', toolbar: '#bar', align: 'center', width: 130}
  80. ]
  81. ]
  82. });
  83. table.on('tool(table)', function (obj) {
  84. if (obj.event === 'edit') {
  85. isend(obj);
  86. }
  87. else if (obj.event === 'detail') {
  88. window.location.href = 'view.html?district=' + obj.data.district+'&yearMonth=' + obj.data.yearMonth;
  89. }
  90. });
  91. form.on('submit(query)', function (data) {
  92. refresh(data.field);
  93. return false;
  94. });
  95. window.isend= function(obj) {
  96. layer.confirm("是否确认办结?", function () {
  97. request.http({
  98. type: "get",
  99. url: MODULE_PATH+"end?district=" + obj.data.district+"&yearMonth="+obj.data.yearMonth,
  100. loading: true,
  101. success: function (result) {
  102. refresh();
  103. if (result.success) {
  104. popup.success(result.msg);
  105. } else {
  106. popup.failure(result.msg);
  107. }
  108. }
  109. })
  110. });
  111. };
  112. window.refresh = function (param) {
  113. table.reload('table', {where: param});
  114. };
  115. })
  116. </script>
  117. </html>