index.html 29 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069
  1. {extend name="public/layout" /} {block name="title"}在施工地{/block} {block name="body"}
  2. <link rel="stylesheet" href="__LAYUI__/common.css" media="all">
  3. <style type="text/css">
  4. html,
  5. body {
  6. display: block;
  7. min-width: 1100px;
  8. }
  9. .layui-table thead tr,
  10. .layui-table-header {
  11. background-color: #D8E6F1 !important;
  12. }
  13. .layui-fluid {
  14. display: block;
  15. box-shadow: 0 0 4px 0 #B6CADE;
  16. border-radius: 5px;
  17. margin: 15px;
  18. background-color: #ffffff;
  19. }
  20. .layui-form-label {
  21. width: auto;
  22. }
  23. .layui-laydate-range {
  24. width: 581px;
  25. }
  26. .layui-table-page>div {
  27. display: flex;
  28. justify-content: flex-start;
  29. }
  30. .layui-btn-primary,
  31. .layui-btn-primary:hover {
  32. border: 1px solid #249EFB;
  33. background-color: #fff;
  34. color: #249EFB;
  35. }
  36. .layui-form-item .layui-inline {
  37. margin-right: 0px;
  38. }
  39. .layui-btn-normal,
  40. .layui-btn-normal:hover {
  41. border: 1px solid #249EFB;
  42. background-color: #fff;
  43. color: #249EFB;
  44. }
  45. .layui-btn-danger,
  46. .layui-btn-danger:hover {
  47. color: #FF5722;
  48. border: 1px solid #FF5722;
  49. background-color: #fff;
  50. }
  51. .font10 {
  52. font-size: 10px;
  53. }
  54. .font13 {
  55. font-size: 13px;
  56. }
  57. .textc {
  58. text-align: center;
  59. }
  60. .zsgd_status_box {
  61. position: relative;
  62. padding-bottom: 5px;
  63. }
  64. .zsgd_status_x {
  65. position: absolute;
  66. background-color: #d7d7d7;
  67. z-index: 0;
  68. height: 8px;
  69. width: 92%;
  70. left: 4%;
  71. top: 8px;
  72. }
  73. .zsgd_status_ul {
  74. position: relative;
  75. z-index: 1;
  76. margin-top: 5px;
  77. }
  78. .zsgd_status_ul li {
  79. float: left;
  80. width: 11.11%;
  81. overflow: hidden;
  82. }
  83. .status_title {
  84. width: 22px;
  85. height: 22px;
  86. box-sizing: border-box;
  87. text-align: center;
  88. color: #333;
  89. border: 1px solid #333;
  90. border-radius: 50%;
  91. overflow: hidden;
  92. line-height: 22px;
  93. background-color: #fff;
  94. }
  95. .status_time {
  96. margin: 10px 0 0;
  97. }
  98. .layui-table-cell {
  99. height: auto !important;
  100. }
  101. .lh20 {
  102. line-height: 16px;
  103. }
  104. .add_status_title {
  105. background: #169bd5 !important;
  106. color: #fff !important;
  107. border: 1px solid #169bd5 !important;
  108. }
  109. .layui-table-fixed {
  110. z-index: 1111;
  111. }
  112. .relative {
  113. position: relative;
  114. }
  115. .noneClass {
  116. display: none !important;
  117. }
  118. .c_wordlist {
  119. width: 20px;
  120. position: absolute;
  121. top: 43px;
  122. right: 1px;
  123. display: flex;
  124. flex-direction: column;
  125. z-index: 99999;
  126. height: auto;
  127. justify-content: flex-start;
  128. align-items: center;
  129. box-sizing: border-box;
  130. padding: 4px 0px;
  131. overflow: hidden;
  132. max-height: 297px;
  133. -ms-overflow-style: none;
  134. /* IE 10+ */
  135. scrollbar-width: none;
  136. /* Firefox */
  137. overflow-y: scroll;
  138. background-color: #f5f5f5;
  139. }
  140. .c_wordlist::-webkit-scrollbar {
  141. display: none;
  142. /* Chrome Safari */
  143. }
  144. .li_active {
  145. font-weight: 700;
  146. background-color: #249EFB;
  147. color: #fff;
  148. }
  149. .c_wordlist>li {
  150. width: 20px;
  151. height: 37px;
  152. cursor: pointer;
  153. display: flex;
  154. justify-content: center;
  155. align-items: center;
  156. margin-bottom: 0px;
  157. line-height: 37px;
  158. }
  159. .layui-form-selected dl {
  160. z-index: 9999 !important;
  161. }
  162. .layui-form-select dl {
  163. width: 100% !important;
  164. }
  165. .flex-row {
  166. display: flex;
  167. align-items: center;
  168. justify-content: space-between;
  169. }
  170. .flex-sub {
  171. flex: 1;
  172. }
  173. .layui-form-item .layui-input-inline {
  174. width: auto !important;
  175. }
  176. .justify-end {
  177. justify-content: flex-end;
  178. }
  179. .lay-tab {
  180. width: 100%;
  181. height: 50px;
  182. display: flex;
  183. align-items: center;
  184. }
  185. .lay-tab>div {
  186. line-height: 50px;
  187. height: 100%;
  188. padding: 0px 15px;
  189. cursor: pointer;
  190. }
  191. .layactive {
  192. color: #249EFB;
  193. position: relative;
  194. }
  195. .layactive::after {
  196. content: " ";
  197. width: 50px;
  198. height: 4px;
  199. background-color: #249EFB;
  200. position: absolute;
  201. bottom: 0px;
  202. left: 50%;
  203. transform: translateX(-50%);
  204. border-radius: 2px;
  205. }
  206. .colorgray {
  207. color: #999999;
  208. }
  209. .colorpass {
  210. color: #249EFB;
  211. }
  212. .colorreject {
  213. color: rgb(244, 57, 57);
  214. }
  215. </style>
  216. <body>
  217. <div class="layui-fluid">
  218. <div class="lay-tab">
  219. <div data-type="0" class="layactive">公司上传</div>
  220. <div data-type="1">员工上传</div>
  221. </div>
  222. <div class="layui-card">
  223. <div class="layui-form layui-card-header layuiadmin-card-header-auto laybtns">
  224. <div class="layui-form-item flex-row">
  225. <div class="layui-inline flex-row">
  226. {auth:check name="construction/add"}
  227. <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
  228. data-type="add">新建在施工地</button>
  229. {/auth:check}
  230. {auth:check name="construction/step_setting"}
  231. <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
  232. data-type="step_setting">施工阶段设置</button>
  233. {/auth:check}
  234. </div>
  235. <div class="flex-sub flex-row justify-end">
  236. <div class="layui-inline flex-row" style="margin-right: 0px;">
  237. <div class="layui-input-inline flex-sub relative" id="box212">
  238. <select name="community" lay-filter="community" id="community" lay-search>
  239. <option value="">请选择小区</option>
  240. {notempty name="communityList"}
  241. {volist name="communityList.arr" id="t"}
  242. <option data-py="{$t.s}" value="{$t.id}">{$t.name}</option>
  243. {/volist}
  244. {/notempty}
  245. </select>
  246. <ul class="c_wordlist noneClass">
  247. {notempty name="communityList"}
  248. {volist name="communityList.sort" id="vo"}
  249. <li data-py="{$vo}">{$vo}</li>
  250. {/volist}
  251. {/notempty}
  252. </ul>
  253. </div>
  254. </div>
  255. <div class="layui-inline flex-row" style="margin-right: 0px;">
  256. <div class="layui-input-inline flex-sub">
  257. <select name="housetype" lay-filter="type" id="type">
  258. <option value="">请选择户型</option>
  259. {volist name="housetype" id="t"}
  260. <option value="{$t.id}">{$t.name}</option>
  261. {/volist}
  262. </select>
  263. </div>
  264. </div>
  265. <div class="layui-inline flex-row" style="margin-right: 0px;">
  266. <div class="layui-input-inline flex-sub">
  267. <select name="decostyle" lay-filter="type" id="type">
  268. <option value="">请选择分类</option>
  269. {volist name="decostyle" id="t"}
  270. <option value="{$t.id}">{$t.name}</option>
  271. {/volist}
  272. </select>
  273. </div>
  274. </div>
  275. <div class="layui-inline flex-row" style="margin-right: 0px;">
  276. <div class="layui-input-inline flex-sub">
  277. <select name="employee_id" id="employee" lay-search>
  278. <option value="">请选择上传人</option>
  279. {volist name="employee" id="e"}
  280. <option value="{$e.id}">{$e.name}</option>
  281. {/volist}
  282. </select>
  283. </div>
  284. </div>
  285. <div class="layui-inline flex-row" style="margin-right: 0px;">
  286. <div class="layui-input-inline flex-sub">
  287. <input type="text" name="addtime" class="layui-input" id="lay-date" placeholder="请选择上传时间">
  288. </div>
  289. </div>
  290. <div class="layui-inline">
  291. <button class="layui-btn layuiadmin-btn-list submitbtn" lay-submit
  292. lay-filter="LAY-app-contlist-search">
  293. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  294. </button>
  295. </div>
  296. </div>
  297. </div>
  298. </div>
  299. <div class="layui-form layui-card-header layuiadmin-card-header-auto laybtns1 layui-hide">
  300. <div class="layui-form-item flex-row">
  301. <div class="flex-sub flex-row justify-end">
  302. <div class="layui-inline flex-row" style="margin-right: 0px;">
  303. <label class="layui-form-label">小区</label>
  304. <div class="layui-input-inline flex-sub relative" id="box212">
  305. <select name="community" lay-filter="community" id="community" lay-search>
  306. <option value="">请选择小区</option>
  307. {notempty name="communityList"}
  308. {volist name="communityList.arr" id="t"}
  309. <option data-py="{$t.s}" value="{$t.id}">{$t.name}</option>
  310. {/volist}
  311. {/notempty}
  312. </select>
  313. <ul class="c_wordlist noneClass">
  314. {notempty name="communityList"}
  315. {volist name="communityList.sort" id="vo"}
  316. <li data-py="{$vo}">{$vo}</li>
  317. {/volist}
  318. {/notempty}
  319. </ul>
  320. </div>
  321. </div>
  322. <div class="layui-inline flex-row" style="margin-right: 0px;">
  323. <div class="layui-input-inline flex-sub">
  324. <select name="housetype" lay-filter="type" id="type">
  325. <option value="">请选择户型</option>
  326. {volist name="housetype" id="t"}
  327. <option value="{$t.id}">{$t.name}</option>
  328. {/volist}
  329. </select>
  330. </div>
  331. </div>
  332. <div class="layui-inline flex-row" style="margin-right: 0px;">
  333. <div class="layui-input-inline flex-sub">
  334. <select name="decostyle" lay-filter="type" id="type">
  335. <option value="">请选择分类</option>
  336. {volist name="decostyle" id="t"}
  337. <option value="{$t.id}">{$t.name}</option>
  338. {/volist}
  339. </select>
  340. </div>
  341. </div>
  342. <div class="layui-inline flex-row" style="margin-right: 0px;">
  343. <div class="layui-input-inline flex-sub">
  344. <select name="employee_id" id="employee" lay-search>
  345. <option value="">请选择上传人</option>
  346. {volist name="employee_mb" id="e"}
  347. <option value="{$e.id}">{$e.name}</option>
  348. {/volist}
  349. </select>
  350. </div>
  351. </div>
  352. <div class="layui-inline flex-row" style="margin-right: 0px;">
  353. <div class="layui-input-inline flex-sub">
  354. <input type="text" name="addtime" class="layui-input" id="lay-date1" placeholder="请选择上传时间">
  355. </div>
  356. </div>
  357. <div class="layui-inline">
  358. <button class="layui-btn layuiadmin-btn-list submitbtn" lay-submit
  359. lay-filter="LAY-app-contlist-search1">
  360. <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
  361. </button>
  362. </div>
  363. </div>
  364. </div>
  365. </div>
  366. <div class="layui-card-body" style="text-align: center;">
  367. <table id="company-activity" lay-filter="company-activity"></table>
  368. <script type="text/html" id="show">
  369. <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.del !== 1 ? 'checked' : '' }} id="clickshow">
  370. </script>
  371. <script type="text/html" id="statusele">
  372. {{# if(d.status==0){ }}
  373. <span class="colorgray">待审核</span>
  374. {{# } }}
  375. {{# if(d.status==1){ }}
  376. <span class="colorpass">已通过</span>
  377. {{# } }}
  378. {{# if(d.status==2){ }}
  379. <span class="colorreject">已驳回</span>
  380. {{# } }}
  381. </script>
  382. <script type="text/html" id="table-user-bind">
  383. {auth:check name="construction/edit"}
  384. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
  385. 编辑
  386. </a>
  387. {/auth:check}
  388. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="phaSe" data-types="1">
  389. 上传进度
  390. </a>
  391. <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="clues">
  392. 线索记录
  393. </a> -->
  394. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">
  395. 删除
  396. </a>
  397. </script>
  398. <script type="text/html" id="showTwo">
  399. {{# if(d.status==0){ }}
  400. <span>未审核通过</span>
  401. {{# } }}
  402. {{# if(d.status==1){ }}
  403. <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.del !== 1 ? 'checked' : '' }} id="clickshow">
  404. {{# } }}
  405. {{# if(d.status==2){ }}
  406. <span>未审核通过</span>
  407. {{# } }}
  408. </script>
  409. <script type="text/html" id="table-user-bind1">
  410. {{# if(d.status==0){ }}
  411. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="pass">
  412. 通过
  413. </a>
  414. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reject">
  415. 驳回
  416. </a>
  417. {{# } }}
  418. {{# if(d.status==1){ }}
  419. {auth:check name="construction/edit"}
  420. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
  421. 编辑
  422. </a>
  423. {/auth:check}
  424. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="phaSe" data-types="1">
  425. 上传进度
  426. </a>
  427. <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="clues">
  428. 线索记录
  429. </a> -->
  430. {{# } }}
  431. {{# if(d.status==2){ }}
  432. {auth:check name="construction/edit"}
  433. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
  434. 编辑
  435. </a>
  436. {/auth:check}
  437. {{# } }}
  438. <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">
  439. 删除
  440. </a>
  441. </script>
  442. </div>
  443. </div>
  444. </div>
  445. </body>
  446. {/block} {block name="js"}
  447. <script type="text/html" id="employee_name">
  448. {{# if(d.employee){ }}
  449. <span>{{d.employee.opt_name}}</span>
  450. {{# }else{ }}
  451. <span style="color: #cccccc;">无</span>
  452. {{# } }}
  453. </script>
  454. <script type="text/html" id="recommend">
  455. {{# if(d.recommend){ }}
  456. <span>是</span>
  457. {{# }else{ }}
  458. <span style="color: #cccccc;">否</span>
  459. {{# } }}
  460. </script>
  461. <script>
  462. layui.config({
  463. base: '__LAYUI__/',
  464. urlbase: '/sys'
  465. }).extend({
  466. index: 'lib/index' //主入口模块
  467. }).use(['index', 'form', 'table', 'laydate'], function () {
  468. var $ = layui.$,
  469. form = layui.form,
  470. laydate = layui.laydate,
  471. table = layui.table,
  472. scrollTopNum = 0;
  473. //日期范围
  474. laydate.render({
  475. elem: '#lay-date',
  476. range: true
  477. });
  478. laydate.render({
  479. elem: '#lay-date1',
  480. range: true
  481. });
  482. $('.lay-tab div').click(function () {
  483. $(this).addClass('layactive').siblings().removeClass("layactive");
  484. let type = $(this).prop('dataset').type;
  485. if (type == '0') {
  486. $('.laybtns1').addClass('layui-hide');
  487. $('.laybtns').removeClass('layui-hide');
  488. } else {
  489. $('.laybtns').addClass('layui-hide');
  490. $('.laybtns1').removeClass('layui-hide');
  491. }
  492. getShowList(type);
  493. })
  494. //监听搜索
  495. form.on('submit(LAY-app-contlist-search)', function (data) {
  496. var field = data.field;
  497. //执行重载
  498. table.reload('company-activity', {
  499. where: field
  500. });
  501. });
  502. //监听搜索
  503. form.on('submit(LAY-app-contlist-search1)', function (data) {
  504. var field = data.field;
  505. //执行重载
  506. table.reload('company-activity', {
  507. where: field
  508. });
  509. });
  510. //事件
  511. var active = {
  512. add: function () {
  513. layer.open({
  514. type: 2,
  515. title: ['新建在施工地', 'color:#333333;background-color:#D8E6F1;'],
  516. content: '{:url("construction/add")}',
  517. resize: false,
  518. area: ['80%', '80%'],
  519. yes: function (index, layero) {
  520. }
  521. });
  522. },
  523. step_setting: function () {
  524. layer.open({
  525. type: 2,
  526. title: ['施工阶段设置', 'color:#333333;background-color:#D8E6F1;'],
  527. content: '{:url("construction/step_setting")}',
  528. resize: false,
  529. area: ['50%', '80%'],
  530. yes: function (index, layero) {
  531. }
  532. });
  533. }
  534. };
  535. document.onkeydown = function (event) {
  536. var e = event || window.event || arguments.callee.caller.arguments[0];
  537. if (e && e.keyCode == 13) {
  538. $(".submitbtn").trigger("click");
  539. }
  540. };
  541. getShowList(0);
  542. function getShowList(type = 0) {
  543. if (type == 0) {
  544. //列表
  545. table.render({
  546. elem: '#company-activity',
  547. url: "{:url('construction/index')}",
  548. height: 'full-160',
  549. where: { type: type },
  550. cols: [
  551. [
  552. { align: 'center', field: 'name', title: '标题', width: '9%', fixed: 'left', style: 'padding:20px 0' },
  553. {
  554. align: 'center', title: '小区名称', width: '7%', templet: function (e) {
  555. var str;
  556. if (e.community !== null) {
  557. str = e.community.name
  558. } else {
  559. str = '暂无填写'
  560. }
  561. return str;
  562. }
  563. },
  564. {
  565. align: 'center', title: '户型', width: '7%', templet: function (e) {
  566. var str;
  567. if (e.housetype !== null) {
  568. str = e.housetype.name
  569. } else {
  570. str = '暂无填写'
  571. }
  572. return str;
  573. }
  574. },
  575. {
  576. align: 'center', title: '风格', width: '7%', templet: function (e) {
  577. var str;
  578. if (e.style !== null) {
  579. str = e.style.name
  580. } else {
  581. str = '暂无填写'
  582. }
  583. return str;
  584. }
  585. },
  586. {
  587. align: 'center', title: '设计师', width: '6%', templet: function (e) {
  588. var str;
  589. if (e.designer !== null) {
  590. str = e.designer.name
  591. } else {
  592. str = '暂无填写'
  593. }
  594. return str;
  595. }
  596. },
  597. { align: 'center', field: "start_time", title: '开工时间', sort: true, width: '8%' },
  598. { align: 'center', field: "view_times", title: '浏览次数', sort: true, minWidth: 100 },
  599. {
  600. align: 'center', field: 'step_list', title: '施工阶段', minWidth: 460, templet: function (e) {
  601. var statushtml = '';
  602. statushtml += '<div class="zsgd_status_box">';
  603. statushtml += '<div class="zsgd_status_x"></div>';
  604. statushtml += '<ul class="zsgd_status_ul">';
  605. for (var i = 0; i < e.step_list.length; i++) {
  606. if (i == 0) {
  607. statushtml += '<li>';
  608. } else {
  609. statushtml += '<li style="margin-left:' + ((420 - (46.65 * e.step_list.length)) / (e.step_list.length - 1)) + 'px">';
  610. }
  611. if (e.step_list[i].record_id == 0) {
  612. statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="1" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.id + '">';
  613. statushtml += '<p class="font13 status_title">0' + e.step_list[i].order + '</p>';
  614. } else {
  615. statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="2" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.step_list[i].record_id + '">';
  616. statushtml += '<p class="font13 status_title add_status_title">0' + e.step_list[i].order + '</p>';
  617. }
  618. statushtml += '<p class="font10 textc lh20 status_time">' + e.step_list[i].name + '</p>';
  619. statushtml += '</a></li>';
  620. }
  621. statushtml += '</ul><div style="clear: both;"></div></div>';
  622. return statushtml;
  623. }
  624. },
  625. { align: 'center', title: '开关', minWidth: '100', templet: '#show' },
  626. { align: 'center', title: '推荐', minWidth: '100', templet: '#recommend' }
  627. , {
  628. align: 'center',
  629. title: '上传人',
  630. minWidth: 100,
  631. templet: '#employee_name'
  632. }
  633. , {
  634. align: 'center',
  635. field: "addtime",
  636. title: '上传时间',
  637. minWidth: 160,
  638. }
  639. , { align: 'center', title: '操作', minWidth: 270, align: 'center', fixed: 'right', toolbar: '#table-user-bind', style: 'padding:20px 0' }
  640. ]
  641. ],
  642. page: true,
  643. // limit: 30,
  644. // height: 'full-220',
  645. text: '对不起,加载出现异常!'
  646. });
  647. } else {
  648. let url = '{:url("construction/index",array("type"=>1))}';
  649. //列表
  650. table.render({
  651. elem: '#company-activity',
  652. url: url,
  653. height: 'full-160',
  654. where: { type: type },
  655. cols: [
  656. [
  657. { align: 'center', field: 'name', title: '标题', width: '9%', fixed: 'left', style: 'padding:20px 0' },
  658. {
  659. align: 'center', title: '小区名称', width: '7%', templet: function (e) {
  660. var str;
  661. if (e.community !== null) {
  662. str = e.community.name
  663. } else {
  664. str = '暂无填写'
  665. }
  666. return str;
  667. }
  668. },
  669. {
  670. align: 'center', title: '户型', width: '7%', templet: function (e) {
  671. var str;
  672. if (e.housetype !== null) {
  673. str = e.housetype.name
  674. } else {
  675. str = '暂无填写'
  676. }
  677. return str;
  678. }
  679. },
  680. {
  681. align: 'center', title: '风格', width: '7%', templet: function (e) {
  682. var str;
  683. if (e.style !== null) {
  684. str = e.style.name
  685. } else {
  686. str = '暂无填写'
  687. }
  688. return str;
  689. }
  690. },
  691. {
  692. align: 'center', title: '设计师', width: '6%', templet: function (e) {
  693. var str;
  694. if (e.designer !== null) {
  695. str = e.designer.name
  696. } else {
  697. str = '暂无填写'
  698. }
  699. return str;
  700. }
  701. },
  702. { align: 'center', field: "start_time", title: '开工时间', sort: true, width: '8%' },
  703. { align: 'center', field: "view_times", title: '浏览次数', sort: true, minWidth: 100 },
  704. {
  705. align: 'center', field: 'step_list', title: '施工阶段', minWidth: 460, templet: function (e) {
  706. var statushtml = '';
  707. statushtml += '<div class="zsgd_status_box">';
  708. statushtml += '<div class="zsgd_status_x"></div>';
  709. statushtml += '<ul class="zsgd_status_ul">';
  710. for (var i = 0; i < e.step_list.length; i++) {
  711. if (i == 0) {
  712. statushtml += '<li>';
  713. } else {
  714. statushtml += '<li style="margin-left:' + ((420 - (46.65 * e.step_list.length)) / (e.step_list.length - 1)) + 'px">';
  715. }
  716. if (e.step_list[i].record_id == 0) {
  717. statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="1" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.id + '">';
  718. statushtml += '<p class="font13 status_title">0' + e.step_list[i].order + '</p>';
  719. } else {
  720. statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="2" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.step_list[i].record_id + '">';
  721. statushtml += '<p class="font13 status_title add_status_title">0' + e.step_list[i].order + '</p>';
  722. }
  723. statushtml += '<p class="font10 textc lh20 status_time">' + e.step_list[i].name + '</p>';
  724. statushtml += '</a></li>';
  725. }
  726. statushtml += '</ul><div style="clear: both;"></div></div>';
  727. return statushtml;
  728. }
  729. },
  730. { align: 'center', title: '开关', minWidth: '100', templet: '#showTwo' },
  731. { align: 'center', title: '推荐', minWidth: '100', templet: '#recommend' }
  732. , {
  733. align: 'center',
  734. title: '上传人',
  735. minWidth: 100,
  736. field: 'opt_name'
  737. }
  738. , {
  739. align: 'center',
  740. field: "addtime",
  741. title: '上传时间',
  742. minWidth: 180,
  743. }
  744. , {
  745. align: 'center',
  746. title: '审核状态',
  747. minWidth: 100,
  748. templet: '#statusele'
  749. }
  750. , { align: 'center', title: '操作', minWidth: 270, align: 'center', fixed: 'right', toolbar: '#table-user-bind1', style: 'padding:20px 0' }
  751. ]
  752. ],
  753. page: true,
  754. // limit: 30,
  755. // height: 'full-220',
  756. text: '对不起,加载出现异常!'
  757. });
  758. }
  759. }
  760. table.on('sort(company-activity)', function (obj) {
  761. table.reload('company-activity', {
  762. initSort: obj
  763. , where: {
  764. order: obj.field + ' ' + obj.type
  765. }
  766. });
  767. });
  768. setTimeout(() => {
  769. $('.layui-table-main').scroll(function (e) {
  770. scrollTopNum = $(this).scrollTop();
  771. })
  772. }, 800)
  773. function scrollPostion(num) {
  774. $('.layui-table-main').scrollTop(num)
  775. }
  776. /*---------------------------------------------------------*/
  777. $(document).click((e) => {
  778. let c_element = $('#community').next();
  779. if (c_element[0].className.indexOf('layui-form-selected') < 0) {
  780. $('.c_wordlist').addClass('noneClass');
  781. }
  782. })
  783. $('dd').click(() => {
  784. $('.c_wordlist').addClass('noneClass');
  785. })
  786. $('#box212').click(() => {
  787. $('.c_wordlist').toggleClass('noneClass');
  788. })
  789. let xqElement = $('.layui-anim-upbit')[0];
  790. xqElement.classList.add('xqElement');
  791. let options = [];
  792. let xqDatalist = $('#community').children();
  793. for (let i = 0; i < xqDatalist.length; i++) {
  794. if (xqDatalist[i].dataset.py) {
  795. options.push(xqDatalist[i].dataset.py)
  796. }
  797. }
  798. $('.c_wordlist').click((e) => {
  799. if (e.target.localName != 'li') {
  800. e.stopPropagation();
  801. return;
  802. }
  803. let index = 0;
  804. let curWord = e.target.dataset.py;
  805. let lilist = $('.c_wordlist').children();
  806. for (let i = 0; i < lilist.length; i++) {
  807. lilist[i].className = '';
  808. }
  809. if (parseInt(curWord) != NaN) {
  810. let word1 = curWord.toLowerCase();
  811. index = options.indexOf(word1)
  812. } else {
  813. index = options.indexOf(curWord)
  814. }
  815. setTimeout(() => {
  816. e.target.className = 'li_active';
  817. let num = index * 36 + 36;
  818. $('.xqElement').scrollTop(num);
  819. }, 50)
  820. e.stopPropagation();
  821. })
  822. $('.layui-select-title input').on('input', function (e) {
  823. let val = $(this).val();
  824. if (!val) {
  825. $('.c_wordlist').removeClass('noneClass');
  826. return;
  827. }
  828. $('.c_wordlist').addClass('noneClass');
  829. })
  830. /*--------------------------------------------*/
  831. //监听
  832. table.on('tool(company-activity)', function (obj) {
  833. var data = obj.data;
  834. var this_data = $(this).data();
  835. var urls = '';
  836. if (obj.event === 'phaSe') {
  837. if (this_data.types == 1) {
  838. var steps_id = 0
  839. if (this_data.steps_id) {
  840. steps_id = this_data.steps_id
  841. }
  842. urls = "{:url('construction/update_step')}?construction_id=" + data.id + "&steps_id=" + steps_id;
  843. } else {
  844. urls = "{:url('construction/update_step')}?id=" + this_data.id + "&steps_id=" + this_data.steps_id;
  845. }
  846. layer.open({
  847. type: 2,
  848. title: ['上传进度', 'color:#333333;background-color:#D8E6F1;'],
  849. content: urls,
  850. resize: false,
  851. area: ['80%', '80%'],
  852. yes: function (index, layero) {
  853. }
  854. });
  855. } else if (obj.event === 'edit') {
  856. layer.open({
  857. type: 2,
  858. title: ['编辑在施工地', 'color:#333333;background-color:#D8E6F1;'],
  859. content: "{:url('construction/edit')}?id=" + data.id,
  860. resize: false,
  861. area: ['80%', '80%'],
  862. yes: function (index, layero) {
  863. },
  864. end: function () {
  865. scrollPostion(scrollTopNum);
  866. setTimeout(() => {
  867. $('.layui-table-main').scroll(function (e) {
  868. scrollTopNum = $(this).scrollTop();
  869. console.log(scrollTopNum, '<<<记录位置');
  870. })
  871. }, 800)
  872. }
  873. });
  874. } else if (obj.event === 'clues') {
  875. layer.open({
  876. type: 2,
  877. title: ['线索记录', 'color:#333333;background-color:#D8E6F1;'],
  878. content: "{:url('data/cluedata')}?id=" + data.id + '&type=construction',
  879. resize: false,
  880. area: ['80%', '80%'],
  881. yes: function (index, layero) {
  882. }
  883. });
  884. } else if (obj.event === 'del') {
  885. layer.confirm('确定删除?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
  886. $.ajax({
  887. type: 'post',
  888. url: "{:url('construction/delete')}",
  889. data: {
  890. id: data.id
  891. },
  892. success: function (res) {
  893. if (res.code == 0) {
  894. layer.msg(res.msg, {
  895. anim: 0
  896. }, function () {
  897. //执行重载
  898. table.reload('company-activity');
  899. layer.close(index);
  900. });
  901. } else {
  902. layer.msg(res.msg, {
  903. anim: 2
  904. });
  905. }
  906. }
  907. });
  908. });
  909. } else if (obj.event === 'pass') {
  910. layer.confirm('确定通过审核?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
  911. $.ajax({
  912. type: 'post',
  913. url: "{:url('dashboard/construction/approve')}",
  914. data: {
  915. id: data.id,
  916. status: '1'
  917. },
  918. success: function (res) {
  919. if (res.code == 0) {
  920. layer.msg(res.msg, {
  921. anim: 0
  922. }, function () {
  923. //执行重载
  924. table.reload('company-activity', {
  925. where: { type: '1' }
  926. , page: { curr: 1 }
  927. });
  928. layer.close(index);
  929. });
  930. } else {
  931. layer.msg(res.msg, {
  932. anim: 2
  933. });
  934. }
  935. }
  936. });
  937. });
  938. } else if (obj.event === 'reject') {
  939. //例子2
  940. layer.prompt({
  941. value: '',
  942. title: '驳回原因',
  943. }, function (value, index, elem) {
  944. $.ajax({
  945. type: 'post',
  946. url: "{:url('dashboard/construction/approve')}",
  947. data: {
  948. id: data.id,
  949. status: '2',
  950. remark: value
  951. },
  952. success: function (res) {
  953. if (res.code == 0) {
  954. layer.msg(res.msg, {
  955. anim: 0
  956. }, function () {
  957. //执行重载
  958. table.reload('company-activity', {
  959. where: { type: '1' }
  960. , page: { curr: 1 }
  961. });
  962. layer.close(index);
  963. });
  964. } else {
  965. layer.msg(res.msg, {
  966. anim: 2
  967. });
  968. }
  969. }
  970. });
  971. });
  972. }
  973. });
  974. $('.layui-btn.layuiadmin-btn-course').on('click', function () {
  975. var type = $(this).data('type');
  976. active[type] ? active[type].call(this) : '';
  977. });
  978. //发布
  979. form.on('switch(show)', function (obj) {
  980. var id = obj.value;
  981. $.ajax({
  982. type: "post",
  983. url: '{:url("construction/change_status")}',
  984. data: {
  985. id: id
  986. },
  987. success: function (res) {
  988. layer.msg(res.msg, { time: 2000 });
  989. }
  990. });
  991. });
  992. });
  993. </script>
  994. {/block}