house_data.html 15 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383
  1. {extend name="public/layout" /}
  2. {block name="title"}房屋信息统计{/block}
  3. {block name="head"}
  4. {include file="public/head"}
  5. <style>
  6. .layui-table th:last-child {
  7. border-right: none;
  8. }
  9. .layui-table-view .layui-table {
  10. /* width:100% */
  11. }
  12. .layui-table thead tr,
  13. .layui-table-header {
  14. background-color: #D8E6F1 !important;
  15. }
  16. .line-middle {
  17. width: 10px;
  18. height: 100%;
  19. margin: 0px 10px;
  20. }
  21. .line {
  22. width: 10px;
  23. height: 2px;
  24. background-color: #999999;
  25. }
  26. .mb0 {
  27. margin-bottom: 0px;
  28. }
  29. .layui-btn {
  30. background-color: #fff;
  31. color: #555;
  32. border: 1px solid #c9c9c9
  33. }
  34. .layui-btn:hover {
  35. background-color: #fff;
  36. color: #555;
  37. border: 1px solid #249efb;
  38. }
  39. .layui-btn-primary,.sBtn {
  40. background-color: #249efb;
  41. color: #fff;
  42. border: 1px solid #249efb;
  43. }
  44. .layui-btn-primary:hover {
  45. background-color: #249efb;
  46. color: #fff;
  47. border: 1px solid #249efb;
  48. }
  49. .sBtn:hover {
  50. background-color: #249efb;
  51. color: #fff;
  52. border: 1px solid #249efb;
  53. }
  54. .flex-row,.row {
  55. display: flex;
  56. }
  57. .align-center {
  58. align-items: center;
  59. }
  60. .layui-input-block {
  61. margin-left: 0px;
  62. }
  63. .ml10 {
  64. margin-left: 10px;
  65. }
  66. .mt10 {
  67. margin-top: 10px;
  68. }
  69. .padding-tlr {
  70. padding: 15px 15px 0px;
  71. }
  72. .houseType {
  73. display: inline-block;
  74. padding: 3px 8px;
  75. margin: 0px 5px;
  76. cursor: pointer;
  77. flex: none;
  78. }
  79. .communityStyle {
  80. display: inline-block;
  81. padding: 3px 8px;
  82. margin: 0px 5px 5px;
  83. cursor: pointer;
  84. flex: none;
  85. }
  86. .Hactive {
  87. background-color: #249efb;
  88. color: #fff;
  89. border-radius: 15px;
  90. }
  91. .activeIndex {
  92. background-color: #249efb;
  93. color: #fff;
  94. border-radius: 15px;
  95. }
  96. .flex-sub {
  97. flex:1;
  98. }
  99. .flex-wrap {
  100. flex-wrap: wrap;
  101. }
  102. .justify-start {
  103. justify-content: flex-start;
  104. }
  105. </style>
  106. {/block}
  107. {block name="body"}
  108. <div class="layui-fluid">
  109. <div class="layui-card">
  110. <div class="search-form layui-form padding-tlr">
  111. <div class="flex-row align-center">
  112. <div class="layui-form-item mb0">
  113. <div class="layui-input-block">
  114. <select name="houseType">
  115. <option value="">请选择房屋类型</option>
  116. <option value="0">现房</option>
  117. <option value="1">期房</option>
  118. </select>
  119. </div>
  120. </div>
  121. <div class="layui-form-item mb0 ml10">
  122. <div class="layui-input-block">
  123. <select name="houseStatus">
  124. <option value="">请选择房屋状态</option>
  125. <option value="0">老房</option>
  126. <option value="1">毛坯</option>
  127. <option value="2">精装</option>
  128. </select>
  129. </div>
  130. </div>
  131. <div class="layui-inline row ml10" id="timeBtn">
  132. <input type="button" class="layui-btn" value="今日"/>
  133. <input type="button" class="layui-btn" value="3天"/>
  134. <input type="button" class="layui-btn" value="7天"/>
  135. <input type="button" class="layui-btn" value="1个月"/>
  136. </div>
  137. <div class="layui-inline ml10"> <!-- 注意:这一层元素并不是必须的 -->
  138. <input type="text" class="layui-input" id="sDate" name="start_date" placeholder="选择开始日期">
  139. </div>
  140. <div class="line-middle">
  141. <div class="line"></div>
  142. </div>
  143. <div class="layui-inline"> <!-- 注意:这一层元素并不是必须的 -->
  144. <input type="text" class="layui-input" id="eDate" name="end_date" placeholder="选择结束日期">
  145. </div>
  146. <button class="layui-btn sBtn ml10" lay-submit lay-filter="table-search">筛选</button>
  147. </div>
  148. <div class="flex-row mt10">
  149. <div class="layui-form-item mb0">
  150. <div class="layui-input-block">
  151. <select name="depart">
  152. <option value="">请选择部门</option>
  153. <option value="0">销售部</option>
  154. <option value="1">技术部</option>
  155. </select>
  156. </div>
  157. </div>
  158. <div class="layui-form-item mb0 ml10">
  159. <div class="layui-input-block">
  160. <select name="staff">
  161. <option value="">请选择员工</option>
  162. <option value="0">张三</option>
  163. <option value="1">李四</option>
  164. </select>
  165. </div>
  166. </div>
  167. </div>
  168. <div class="flex-row mt10 align-center">
  169. <span>房屋户型:</span>
  170. <div class="flex-sub flex-row align-center" id="houseTypeEle">
  171. <span class="houseType">一居室</span>
  172. <span class="houseType">两居室</span>
  173. <span class="houseType">三居室</span>
  174. <span class="houseType">四居室</span>
  175. <span class="houseType">五居室</span>
  176. <span class="houseType">五居室以上</span>
  177. <span class="houseType">公寓</span>
  178. <span class="houseType">别墅大宅</span>
  179. <span class="houseType">其他</span>
  180. </div>
  181. </div>
  182. <div class="flex-row mt10 justify-start">
  183. <span>小区名称:</span>
  184. <div class="flex-sub flex-row justify-start flex-wrap" id="community" style="height: 29.5px;">
  185. <span class="communityStyle">万科小区一</span>
  186. <span class="communityStyle">万科小区二</span>
  187. <span class="communityStyle">万科小区三</span>
  188. <span class="communityStyle">万科小区四</span>
  189. <span class="communityStyle">万科小区五</span>
  190. <span class="communityStyle">万科小区六</span>
  191. <span class="communityStyle">万科小区七</span>
  192. <span class="communityStyle">万科小区八</span>
  193. <span class="communityStyle">万科小区九</span>
  194. <span class="communityStyle">万科小区十</span>
  195. <i class="layui-icon layui-icon-down" style="margin-top: 5px;"></i>
  196. </div>
  197. </div>
  198. </div>
  199. <div class="layui-card-body">
  200. <table lay-filter="datalist" id="list"></table>
  201. </div>
  202. </div>
  203. </div>
  204. {/block}
  205. {block name="js"}
  206. <script>
  207. layui.use(['table', 'form', 'laydate'], function () {
  208. let table = layui.table,
  209. form = layui.form,
  210. laydate = layui.laydate,
  211. $ = layui.$;
  212. $('body').attr('layadmin-themealias', 'default');
  213. //执行一个laydate实例
  214. laydate.render({
  215. elem: '#sDate' //指定元素
  216. });
  217. laydate.render({
  218. elem: '#eDate' //指定元素
  219. });
  220. let cols1 = [[
  221. { field: 'id', title: '部门名称',width: 100, align: 'center', 'fixed': true },
  222. { field: 'id', title: '人效',width: 90, align: 'center' },
  223. { field: 'id', title: '待确认',width: 90, align: 'center' },
  224. { field: 'id', title: '量房数',width: 90, align: 'center' },
  225. { field: 'id', title: '到店数',width: 90, align: 'center' },
  226. { field: 'id', title: '见面数',width: 90, align: 'center' },
  227. { field: 'id', title: '见面率',width: 90, align: 'center' },
  228. { field: 'id', title: '订金数',width: 90, align: 'center' },
  229. { field: 'id', title: '收定率',width: 90, align: 'center' },
  230. { field: 'id', title: '收定金额',width: 100, align: 'center' },
  231. { field: 'id', title: '合同数',width: 90, align: 'center' },
  232. { field: 'id', title: '合同率',width: 90, align: 'center' },
  233. { field: 'id', title: '合同金额',width: 100, align: 'center' },
  234. { field: 'id', title: '均单值',width: 90, align: 'center' },
  235. { field: 'id', title: '线索量',width: 90, align: 'center' },
  236. { field: 'id', title: '有效线索量',width: 90, align: 'center' },
  237. { field: 'id', title: '有效率',width: 90, align: 'center' }
  238. ]];
  239. let cols2 = [[
  240. { field: 'id', title: '员工名称',width: 100, align: 'center', 'fixed': true },
  241. { field: 'id', title: '部门名称',width: 100, align: 'center' },
  242. { field: 'id', title: '待确认',width: 90, align: 'center' },
  243. { field: 'id', title: '量房数',width: 90, align: 'center' },
  244. { field: 'id', title: '到店数',width: 90, align: 'center' },
  245. { field: 'id', title: '见面数',width: 90, align: 'center' },
  246. { field: 'id', title: '见面率',width: 90, align: 'center' },
  247. { field: 'id', title: '订金数',width: 90, align: 'center' },
  248. { field: 'id', title: '收定率',width: 90, align: 'center' },
  249. { field: 'id', title: '收定金额',width: 100, align: 'center' },
  250. { field: 'id', title: '合同数',width: 90, align: 'center' },
  251. { field: 'id', title: '合同率',width: 90, align: 'center' },
  252. { field: 'id', title: '合同金额',width: 100, align: 'center' },
  253. { field: 'id', title: '均单值',width: 90, align: 'center' },
  254. { field: 'id', title: '线索量',width: 90, align: 'center' },
  255. { field: 'id', title: '有效线索量',width: 90, align: 'center' },
  256. { field: 'id', title: '有效率',width: 90, align: 'center' }
  257. ]];
  258. table.render({
  259. elem: '#list'
  260. , url: '{:url("statistics/customer")}'
  261. , page: true
  262. , cols: cols1
  263. , id: 'tablelist'
  264. });
  265. function setYMD(time) {
  266. let dateTime = new Date(time);
  267. let year = dateTime.getFullYear();
  268. let Month = dateTime.getMonth() + 1;
  269. let days = dateTime.getDate();
  270. return `${year}-${Month > 9 ? Month : '0' + Month}-${days > 9 ? days : '0' + days}`;
  271. }
  272. var dateArr = {};
  273. var today = new Date().getTime();
  274. var oneTime = 24 * 60 * 60 * 1000;
  275. var threeDay1 = today - 3 * oneTime;
  276. var sevenDay1 = today - 6 * oneTime;
  277. var oneMonth = today - 30 * oneTime;
  278. dateArr = {
  279. nowS: setYMD(today),
  280. nowE: setYMD(today),
  281. threeDayS: setYMD(threeDay1),
  282. threeDayE: setYMD(today),
  283. sevenDayS: setYMD(sevenDay1),
  284. sevenDayE: setYMD(today),
  285. oneMonthS: setYMD(oneMonth),
  286. oneMonthE: setYMD(today),
  287. }
  288. $('#timeBtn').on('click',function(e){
  289. if (!!(e.target.localName != 'input')) return;
  290. let o = document.querySelector('#timeBtn').children;
  291. if (e.target.classList.contains('layui-btn-primary') == true) {
  292. for (var i = 0; i < o.length; i++) {
  293. o[i].className = 'layui-btn';
  294. }
  295. $('#sDate').val('');
  296. $('#eDate').val('');
  297. return;
  298. } else {
  299. for (var i = 0; i < o.length; i++) {
  300. o[i].className = 'layui-btn';
  301. }
  302. e.target.className = 'layui-btn layui-btn-primary';
  303. if (!!(e.target.className.indexOf('layui-btn-primary') > 0)) {
  304. if (e.target.value == '今日') {
  305. $('#sDate').val(dateArr.nowS);
  306. $('#eDate').val(dateArr.nowE);
  307. } else if (e.target.value == '3天') {
  308. $('#sDate').val(dateArr.threeDayS);
  309. $('#eDate').val(dateArr.threeDayE);
  310. } else if (e.target.value == '7天') {
  311. $('#sDate').val(dateArr.sevenDayS);
  312. $('#eDate').val(dateArr.sevenDayE);
  313. } else {
  314. $('#sDate').val(dateArr.oneMonthS);
  315. $('#eDate').val(dateArr.oneMonthE);
  316. }
  317. }
  318. }
  319. })
  320. $('#houseTypeEle').on('click',function(e){
  321. let o = document.querySelector('#houseTypeEle').children;
  322. if (e.target.localName === 'span') {
  323. for(var i = 0; i<o.length;i++) {
  324. if (o[i].innerText === e.target.innerText) {
  325. o[i].className = 'houseType Hactive';
  326. } else {
  327. o[i].className = 'houseType';
  328. }
  329. }
  330. }
  331. })
  332. $('#community').on('click',function(e){
  333. let o = document.querySelector('#community').children;
  334. if (e.target.localName === 'span') {
  335. for(var i = 0; i<o.length;i++) {
  336. if (o[i].innerText === e.target.innerText) {
  337. o[i].className = 'communityStyle activeIndex';
  338. } else {
  339. if (o[i].localName === 'span') o[i].className = 'communityStyle';
  340. }
  341. }
  342. }
  343. })
  344. form.on('submit(table-search)', function (data) {
  345. let field = data.field;
  346. let houseType = $('.Hactive');
  347. let community = $('.activeIndex');
  348. let timeEl = $('.layui-btn-primary');
  349. let option = {
  350. where: field
  351. , page: {
  352. curr: 1
  353. }
  354. };
  355. if (field.type == 1) {
  356. option.cols = [[
  357. { type: 'numbers', field: 'id', title: '序号', align: 'center' }
  358. ]]
  359. } else {
  360. option.cols = [[
  361. { type: 'numbers', field: 'id', title: '序号', align: 'center' }
  362. ]]
  363. }
  364. //执行重载
  365. table.reload('tablelist', option);
  366. });
  367. })
  368. </script>
  369. {/block}