1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069 |
- {extend name="public/layout" /} {block name="title"}在施工地{/block} {block name="body"}
- <link rel="stylesheet" href="__LAYUI__/common.css" media="all">
- <style type="text/css">
- html,
- body {
- display: block;
- min-width: 1100px;
- }
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
- .layui-fluid {
- display: block;
- box-shadow: 0 0 4px 0 #B6CADE;
- border-radius: 5px;
- margin: 15px;
- background-color: #ffffff;
- }
- .layui-form-label {
- width: auto;
- }
- .layui-laydate-range {
- width: 581px;
- }
- .layui-table-page>div {
- display: flex;
- justify-content: flex-start;
- }
- .layui-btn-primary,
- .layui-btn-primary:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- }
- .layui-form-item .layui-inline {
- margin-right: 0px;
- }
- .layui-btn-normal,
- .layui-btn-normal:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- }
- .layui-btn-danger,
- .layui-btn-danger:hover {
- color: #FF5722;
- border: 1px solid #FF5722;
- background-color: #fff;
- }
- .font10 {
- font-size: 10px;
- }
- .font13 {
- font-size: 13px;
- }
- .textc {
- text-align: center;
- }
- .zsgd_status_box {
- position: relative;
- padding-bottom: 5px;
- }
- .zsgd_status_x {
- position: absolute;
- background-color: #d7d7d7;
- z-index: 0;
- height: 8px;
- width: 92%;
- left: 4%;
- top: 8px;
- }
- .zsgd_status_ul {
- position: relative;
- z-index: 1;
- margin-top: 5px;
- }
- .zsgd_status_ul li {
- float: left;
- width: 11.11%;
- overflow: hidden;
- }
- .status_title {
- width: 22px;
- height: 22px;
- box-sizing: border-box;
- text-align: center;
- color: #333;
- border: 1px solid #333;
- border-radius: 50%;
- overflow: hidden;
- line-height: 22px;
- background-color: #fff;
- }
- .status_time {
- margin: 10px 0 0;
- }
- .layui-table-cell {
- height: auto !important;
- }
- .lh20 {
- line-height: 16px;
- }
- .add_status_title {
- background: #169bd5 !important;
- color: #fff !important;
- border: 1px solid #169bd5 !important;
- }
- .layui-table-fixed {
- z-index: 1111;
- }
- .relative {
- position: relative;
- }
- .noneClass {
- display: none !important;
- }
- .c_wordlist {
- width: 20px;
- position: absolute;
- top: 43px;
- right: 1px;
- display: flex;
- flex-direction: column;
- z-index: 99999;
- height: auto;
- justify-content: flex-start;
- align-items: center;
- box-sizing: border-box;
- padding: 4px 0px;
- overflow: hidden;
- max-height: 297px;
- -ms-overflow-style: none;
- /* IE 10+ */
- scrollbar-width: none;
- /* Firefox */
- overflow-y: scroll;
- background-color: #f5f5f5;
- }
- .c_wordlist::-webkit-scrollbar {
- display: none;
- /* Chrome Safari */
- }
- .li_active {
- font-weight: 700;
- background-color: #249EFB;
- color: #fff;
- }
- .c_wordlist>li {
- width: 20px;
- height: 37px;
- cursor: pointer;
- display: flex;
- justify-content: center;
- align-items: center;
- margin-bottom: 0px;
- line-height: 37px;
- }
- .layui-form-selected dl {
- z-index: 9999 !important;
- }
- .layui-form-select dl {
- width: 100% !important;
- }
- .flex-row {
- display: flex;
- align-items: center;
- justify-content: space-between;
- }
- .flex-sub {
- flex: 1;
- }
- .layui-form-item .layui-input-inline {
- width: auto !important;
- }
- .justify-end {
- justify-content: flex-end;
- }
- .lay-tab {
- width: 100%;
- height: 50px;
- display: flex;
- align-items: center;
- }
- .lay-tab>div {
- line-height: 50px;
- height: 100%;
- padding: 0px 15px;
- cursor: pointer;
- }
- .layactive {
- color: #249EFB;
- position: relative;
- }
- .layactive::after {
- content: " ";
- width: 50px;
- height: 4px;
- background-color: #249EFB;
- position: absolute;
- bottom: 0px;
- left: 50%;
- transform: translateX(-50%);
- border-radius: 2px;
- }
- .colorgray {
- color: #999999;
- }
- .colorpass {
- color: #249EFB;
- }
- .colorreject {
- color: rgb(244, 57, 57);
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="lay-tab">
- <div data-type="0" class="layactive">公司上传</div>
- <div data-type="1">员工上传</div>
- </div>
- <div class="layui-card">
- <div class="layui-form layui-card-header layuiadmin-card-header-auto laybtns">
- <div class="layui-form-item flex-row">
- <div class="layui-inline flex-row">
- {auth:check name="construction/add"}
- <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
- data-type="add">新建在施工地</button>
- {/auth:check}
- {auth:check name="construction/step_setting"}
- <button class="layui-btn layui-btn-primary layuiadmin-btn-course"
- data-type="step_setting">施工阶段设置</button>
- {/auth:check}
- </div>
- <div class="flex-sub flex-row justify-end">
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub relative" id="box212">
- <select name="community" lay-filter="community" id="community" lay-search>
- <option value="">请选择小区</option>
- {notempty name="communityList"}
- {volist name="communityList.arr" id="t"}
- <option data-py="{$t.s}" value="{$t.id}">{$t.name}</option>
- {/volist}
- {/notempty}
- </select>
- <ul class="c_wordlist noneClass">
- {notempty name="communityList"}
- {volist name="communityList.sort" id="vo"}
- <li data-py="{$vo}">{$vo}</li>
- {/volist}
- {/notempty}
- </ul>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="housetype" lay-filter="type" id="type">
- <option value="">请选择户型</option>
- {volist name="housetype" id="t"}
- <option value="{$t.id}">{$t.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="decostyle" lay-filter="type" id="type">
- <option value="">请选择分类</option>
- {volist name="decostyle" id="t"}
- <option value="{$t.id}">{$t.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="employee_id" id="employee" lay-search>
- <option value="">请选择上传人</option>
- {volist name="employee" id="e"}
- <option value="{$e.id}">{$e.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <input type="text" name="addtime" class="layui-input" id="lay-date" placeholder="请选择上传时间">
- </div>
- </div>
- <div class="layui-inline">
- <button class="layui-btn layuiadmin-btn-list submitbtn" lay-submit
- lay-filter="LAY-app-contlist-search">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-form layui-card-header layuiadmin-card-header-auto laybtns1 layui-hide">
- <div class="layui-form-item flex-row">
- <div class="flex-sub flex-row justify-end">
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <label class="layui-form-label">小区</label>
- <div class="layui-input-inline flex-sub relative" id="box212">
- <select name="community" lay-filter="community" id="community" lay-search>
- <option value="">请选择小区</option>
- {notempty name="communityList"}
- {volist name="communityList.arr" id="t"}
- <option data-py="{$t.s}" value="{$t.id}">{$t.name}</option>
- {/volist}
- {/notempty}
- </select>
- <ul class="c_wordlist noneClass">
- {notempty name="communityList"}
- {volist name="communityList.sort" id="vo"}
- <li data-py="{$vo}">{$vo}</li>
- {/volist}
- {/notempty}
- </ul>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="housetype" lay-filter="type" id="type">
- <option value="">请选择户型</option>
- {volist name="housetype" id="t"}
- <option value="{$t.id}">{$t.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="decostyle" lay-filter="type" id="type">
- <option value="">请选择分类</option>
- {volist name="decostyle" id="t"}
- <option value="{$t.id}">{$t.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <select name="employee_id" id="employee" lay-search>
- <option value="">请选择上传人</option>
- {volist name="employee_mb" id="e"}
- <option value="{$e.id}">{$e.name}</option>
- {/volist}
- </select>
- </div>
- </div>
- <div class="layui-inline flex-row" style="margin-right: 0px;">
- <div class="layui-input-inline flex-sub">
- <input type="text" name="addtime" class="layui-input" id="lay-date1" placeholder="请选择上传时间">
- </div>
- </div>
- <div class="layui-inline">
- <button class="layui-btn layuiadmin-btn-list submitbtn" lay-submit
- lay-filter="LAY-app-contlist-search1">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
- </button>
- </div>
- </div>
- </div>
- </div>
- <div class="layui-card-body" style="text-align: center;">
- <table id="company-activity" lay-filter="company-activity"></table>
- <script type="text/html" id="show">
- <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.del !== 1 ? 'checked' : '' }} id="clickshow">
- </script>
- <script type="text/html" id="statusele">
- {{# if(d.status==0){ }}
- <span class="colorgray">待审核</span>
- {{# } }}
- {{# if(d.status==1){ }}
- <span class="colorpass">已通过</span>
- {{# } }}
- {{# if(d.status==2){ }}
- <span class="colorreject">已驳回</span>
- {{# } }}
- </script>
- <script type="text/html" id="table-user-bind">
- {auth:check name="construction/edit"}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
- 编辑
- </a>
- {/auth:check}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="phaSe" data-types="1">
- 上传进度
- </a>
- <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="clues">
- 线索记录
- </a> -->
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">
- 删除
- </a>
- </script>
- <script type="text/html" id="showTwo">
- {{# if(d.status==0){ }}
- <span>未审核通过</span>
- {{# } }}
- {{# if(d.status==1){ }}
- <input type="checkbox" name="show" value="{{d.id}}" lay-skin="switch" lay-text="上架|下架" lay-filter="show" {{ d.del !== 1 ? 'checked' : '' }} id="clickshow">
- {{# } }}
- {{# if(d.status==2){ }}
- <span>未审核通过</span>
- {{# } }}
- </script>
- <script type="text/html" id="table-user-bind1">
- {{# if(d.status==0){ }}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="pass">
- 通过
- </a>
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="reject">
- 驳回
- </a>
- {{# } }}
- {{# if(d.status==1){ }}
- {auth:check name="construction/edit"}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
- 编辑
- </a>
- {/auth:check}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="phaSe" data-types="1">
- 上传进度
- </a>
- <!-- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="clues">
- 线索记录
- </a> -->
- {{# } }}
- {{# if(d.status==2){ }}
- {auth:check name="construction/edit"}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="edit">
- 编辑
- </a>
- {/auth:check}
- {{# } }}
- <a class="layui-btn layui-btn-normal layui-btn-xs" lay-event="del">
- 删除
- </a>
- </script>
- </div>
- </div>
- </div>
- </body>
- {/block} {block name="js"}
- <script type="text/html" id="employee_name">
- {{# if(d.employee){ }}
- <span>{{d.employee.opt_name}}</span>
- {{# }else{ }}
- <span style="color: #cccccc;">无</span>
- {{# } }}
- </script>
- <script type="text/html" id="recommend">
- {{# if(d.recommend){ }}
- <span>是</span>
- {{# }else{ }}
- <span style="color: #cccccc;">否</span>
- {{# } }}
- </script>
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'form', 'table', 'laydate'], function () {
- var $ = layui.$,
- form = layui.form,
- laydate = layui.laydate,
- table = layui.table,
- scrollTopNum = 0;
- //日期范围
- laydate.render({
- elem: '#lay-date',
- range: true
- });
- laydate.render({
- elem: '#lay-date1',
- range: true
- });
- $('.lay-tab div').click(function () {
- $(this).addClass('layactive').siblings().removeClass("layactive");
- let type = $(this).prop('dataset').type;
- if (type == '0') {
- $('.laybtns1').addClass('layui-hide');
- $('.laybtns').removeClass('layui-hide');
- } else {
- $('.laybtns').addClass('layui-hide');
- $('.laybtns1').removeClass('layui-hide');
- }
- getShowList(type);
- })
- //监听搜索
- form.on('submit(LAY-app-contlist-search)', function (data) {
- var field = data.field;
- //执行重载
- table.reload('company-activity', {
- where: field
- });
- });
- //监听搜索
- form.on('submit(LAY-app-contlist-search1)', function (data) {
- var field = data.field;
- //执行重载
- table.reload('company-activity', {
- where: field
- });
- });
- //事件
- var active = {
- add: function () {
- layer.open({
- type: 2,
- title: ['新建在施工地', 'color:#333333;background-color:#D8E6F1;'],
- content: '{:url("construction/add")}',
- resize: false,
- area: ['80%', '80%'],
- yes: function (index, layero) {
- }
- });
- },
- step_setting: function () {
- layer.open({
- type: 2,
- title: ['施工阶段设置', 'color:#333333;background-color:#D8E6F1;'],
- content: '{:url("construction/step_setting")}',
- resize: false,
- area: ['50%', '80%'],
- yes: function (index, layero) {
- }
- });
- }
- };
- document.onkeydown = function (event) {
- var e = event || window.event || arguments.callee.caller.arguments[0];
- if (e && e.keyCode == 13) {
- $(".submitbtn").trigger("click");
- }
- };
- getShowList(0);
- function getShowList(type = 0) {
- if (type == 0) {
- //列表
- table.render({
- elem: '#company-activity',
- url: "{:url('construction/index')}",
- height: 'full-160',
- where: { type: type },
- cols: [
- [
- { align: 'center', field: 'name', title: '标题', width: '9%', fixed: 'left', style: 'padding:20px 0' },
- {
- align: 'center', title: '小区名称', width: '7%', templet: function (e) {
- var str;
- if (e.community !== null) {
- str = e.community.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '户型', width: '7%', templet: function (e) {
- var str;
- if (e.housetype !== null) {
- str = e.housetype.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '风格', width: '7%', templet: function (e) {
- var str;
- if (e.style !== null) {
- str = e.style.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '设计师', width: '6%', templet: function (e) {
- var str;
- if (e.designer !== null) {
- str = e.designer.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- { align: 'center', field: "start_time", title: '开工时间', sort: true, width: '8%' },
- { align: 'center', field: "view_times", title: '浏览次数', sort: true, minWidth: 100 },
- {
- align: 'center', field: 'step_list', title: '施工阶段', minWidth: 460, templet: function (e) {
- var statushtml = '';
- statushtml += '<div class="zsgd_status_box">';
- statushtml += '<div class="zsgd_status_x"></div>';
- statushtml += '<ul class="zsgd_status_ul">';
- for (var i = 0; i < e.step_list.length; i++) {
- if (i == 0) {
- statushtml += '<li>';
- } else {
- statushtml += '<li style="margin-left:' + ((420 - (46.65 * e.step_list.length)) / (e.step_list.length - 1)) + 'px">';
- }
- if (e.step_list[i].record_id == 0) {
- statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="1" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.id + '">';
- statushtml += '<p class="font13 status_title">0' + e.step_list[i].order + '</p>';
- } else {
- 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 + '">';
- statushtml += '<p class="font13 status_title add_status_title">0' + e.step_list[i].order + '</p>';
- }
- statushtml += '<p class="font10 textc lh20 status_time">' + e.step_list[i].name + '</p>';
- statushtml += '</a></li>';
- }
- statushtml += '</ul><div style="clear: both;"></div></div>';
- return statushtml;
- }
- },
- { align: 'center', title: '开关', minWidth: '100', templet: '#show' },
- { align: 'center', title: '推荐', minWidth: '100', templet: '#recommend' }
- , {
- align: 'center',
- title: '上传人',
- minWidth: 100,
- templet: '#employee_name'
- }
- , {
- align: 'center',
- field: "addtime",
- title: '上传时间',
- minWidth: 160,
- }
- , { align: 'center', title: '操作', minWidth: 270, align: 'center', fixed: 'right', toolbar: '#table-user-bind', style: 'padding:20px 0' }
- ]
- ],
- page: true,
- // limit: 30,
- // height: 'full-220',
- text: '对不起,加载出现异常!'
- });
- } else {
- let url = '{:url("construction/index",array("type"=>1))}';
- //列表
- table.render({
- elem: '#company-activity',
- url: url,
- height: 'full-160',
- where: { type: type },
- cols: [
- [
- { align: 'center', field: 'name', title: '标题', width: '9%', fixed: 'left', style: 'padding:20px 0' },
- {
- align: 'center', title: '小区名称', width: '7%', templet: function (e) {
- var str;
- if (e.community !== null) {
- str = e.community.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '户型', width: '7%', templet: function (e) {
- var str;
- if (e.housetype !== null) {
- str = e.housetype.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '风格', width: '7%', templet: function (e) {
- var str;
- if (e.style !== null) {
- str = e.style.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- {
- align: 'center', title: '设计师', width: '6%', templet: function (e) {
- var str;
- if (e.designer !== null) {
- str = e.designer.name
- } else {
- str = '暂无填写'
- }
- return str;
- }
- },
- { align: 'center', field: "start_time", title: '开工时间', sort: true, width: '8%' },
- { align: 'center', field: "view_times", title: '浏览次数', sort: true, minWidth: 100 },
- {
- align: 'center', field: 'step_list', title: '施工阶段', minWidth: 460, templet: function (e) {
- var statushtml = '';
- statushtml += '<div class="zsgd_status_box">';
- statushtml += '<div class="zsgd_status_x"></div>';
- statushtml += '<ul class="zsgd_status_ul">';
- for (var i = 0; i < e.step_list.length; i++) {
- if (i == 0) {
- statushtml += '<li>';
- } else {
- statushtml += '<li style="margin-left:' + ((420 - (46.65 * e.step_list.length)) / (e.step_list.length - 1)) + 'px">';
- }
- if (e.step_list[i].record_id == 0) {
- statushtml += '<a href="javascript:void(0)" lay-event="phaSe" data-types="1" data-steps_id="' + e.step_list[i].id + '" data-id="' + e.id + '">';
- statushtml += '<p class="font13 status_title">0' + e.step_list[i].order + '</p>';
- } else {
- 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 + '">';
- statushtml += '<p class="font13 status_title add_status_title">0' + e.step_list[i].order + '</p>';
- }
- statushtml += '<p class="font10 textc lh20 status_time">' + e.step_list[i].name + '</p>';
- statushtml += '</a></li>';
- }
- statushtml += '</ul><div style="clear: both;"></div></div>';
- return statushtml;
- }
- },
- { align: 'center', title: '开关', minWidth: '100', templet: '#showTwo' },
- { align: 'center', title: '推荐', minWidth: '100', templet: '#recommend' }
- , {
- align: 'center',
- title: '上传人',
- minWidth: 100,
- field: 'opt_name'
- }
- , {
- align: 'center',
- field: "addtime",
- title: '上传时间',
- minWidth: 180,
- }
- , {
- align: 'center',
- title: '审核状态',
- minWidth: 100,
- templet: '#statusele'
- }
- , { align: 'center', title: '操作', minWidth: 270, align: 'center', fixed: 'right', toolbar: '#table-user-bind1', style: 'padding:20px 0' }
- ]
- ],
- page: true,
- // limit: 30,
- // height: 'full-220',
- text: '对不起,加载出现异常!'
- });
- }
- }
- table.on('sort(company-activity)', function (obj) {
- table.reload('company-activity', {
- initSort: obj
- , where: {
- order: obj.field + ' ' + obj.type
- }
- });
- });
- setTimeout(() => {
- $('.layui-table-main').scroll(function (e) {
- scrollTopNum = $(this).scrollTop();
- })
- }, 800)
- function scrollPostion(num) {
- $('.layui-table-main').scrollTop(num)
- }
- /*---------------------------------------------------------*/
- $(document).click((e) => {
- let c_element = $('#community').next();
- if (c_element[0].className.indexOf('layui-form-selected') < 0) {
- $('.c_wordlist').addClass('noneClass');
- }
- })
- $('dd').click(() => {
- $('.c_wordlist').addClass('noneClass');
- })
- $('#box212').click(() => {
- $('.c_wordlist').toggleClass('noneClass');
- })
- let xqElement = $('.layui-anim-upbit')[0];
- xqElement.classList.add('xqElement');
- let options = [];
- let xqDatalist = $('#community').children();
- for (let i = 0; i < xqDatalist.length; i++) {
- if (xqDatalist[i].dataset.py) {
- options.push(xqDatalist[i].dataset.py)
- }
- }
- $('.c_wordlist').click((e) => {
- if (e.target.localName != 'li') {
- e.stopPropagation();
- return;
- }
- let index = 0;
- let curWord = e.target.dataset.py;
- let lilist = $('.c_wordlist').children();
- for (let i = 0; i < lilist.length; i++) {
- lilist[i].className = '';
- }
- if (parseInt(curWord) != NaN) {
- let word1 = curWord.toLowerCase();
- index = options.indexOf(word1)
- } else {
- index = options.indexOf(curWord)
- }
- setTimeout(() => {
- e.target.className = 'li_active';
- let num = index * 36 + 36;
- $('.xqElement').scrollTop(num);
- }, 50)
- e.stopPropagation();
- })
- $('.layui-select-title input').on('input', function (e) {
- let val = $(this).val();
- if (!val) {
- $('.c_wordlist').removeClass('noneClass');
- return;
- }
- $('.c_wordlist').addClass('noneClass');
- })
- /*--------------------------------------------*/
- //监听
- table.on('tool(company-activity)', function (obj) {
- var data = obj.data;
- var this_data = $(this).data();
- var urls = '';
- if (obj.event === 'phaSe') {
- if (this_data.types == 1) {
- var steps_id = 0
- if (this_data.steps_id) {
- steps_id = this_data.steps_id
- }
- urls = "{:url('construction/update_step')}?construction_id=" + data.id + "&steps_id=" + steps_id;
- } else {
- urls = "{:url('construction/update_step')}?id=" + this_data.id + "&steps_id=" + this_data.steps_id;
- }
- layer.open({
- type: 2,
- title: ['上传进度', 'color:#333333;background-color:#D8E6F1;'],
- content: urls,
- resize: false,
- area: ['80%', '80%'],
- yes: function (index, layero) {
- }
- });
- } else if (obj.event === 'edit') {
- layer.open({
- type: 2,
- title: ['编辑在施工地', 'color:#333333;background-color:#D8E6F1;'],
- content: "{:url('construction/edit')}?id=" + data.id,
- resize: false,
- area: ['80%', '80%'],
- yes: function (index, layero) {
- },
- end: function () {
- scrollPostion(scrollTopNum);
- setTimeout(() => {
- $('.layui-table-main').scroll(function (e) {
- scrollTopNum = $(this).scrollTop();
- console.log(scrollTopNum, '<<<记录位置');
- })
- }, 800)
- }
- });
- } else if (obj.event === 'clues') {
- layer.open({
- type: 2,
- title: ['线索记录', 'color:#333333;background-color:#D8E6F1;'],
- content: "{:url('data/cluedata')}?id=" + data.id + '&type=construction',
- resize: false,
- area: ['80%', '80%'],
- yes: function (index, layero) {
- }
- });
- } else if (obj.event === 'del') {
- layer.confirm('确定删除?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
- $.ajax({
- type: 'post',
- url: "{:url('construction/delete')}",
- data: {
- id: data.id
- },
- success: function (res) {
- if (res.code == 0) {
- layer.msg(res.msg, {
- anim: 0
- }, function () {
- //执行重载
- table.reload('company-activity');
- layer.close(index);
- });
- } else {
- layer.msg(res.msg, {
- anim: 2
- });
- }
- }
- });
- });
- } else if (obj.event === 'pass') {
- layer.confirm('确定通过审核?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
- $.ajax({
- type: 'post',
- url: "{:url('dashboard/construction/approve')}",
- data: {
- id: data.id,
- status: '1'
- },
- success: function (res) {
- if (res.code == 0) {
- layer.msg(res.msg, {
- anim: 0
- }, function () {
- //执行重载
- table.reload('company-activity', {
- where: { type: '1' }
- , page: { curr: 1 }
- });
- layer.close(index);
- });
- } else {
- layer.msg(res.msg, {
- anim: 2
- });
- }
- }
- });
- });
- } else if (obj.event === 'reject') {
- //例子2
- layer.prompt({
- value: '',
- title: '驳回原因',
- }, function (value, index, elem) {
- $.ajax({
- type: 'post',
- url: "{:url('dashboard/construction/approve')}",
- data: {
- id: data.id,
- status: '2',
- remark: value
- },
- success: function (res) {
- if (res.code == 0) {
- layer.msg(res.msg, {
- anim: 0
- }, function () {
- //执行重载
- table.reload('company-activity', {
- where: { type: '1' }
- , page: { curr: 1 }
- });
- layer.close(index);
- });
- } else {
- layer.msg(res.msg, {
- anim: 2
- });
- }
- }
- });
- });
- }
- });
- $('.layui-btn.layuiadmin-btn-course').on('click', function () {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- //发布
- form.on('switch(show)', function (obj) {
- var id = obj.value;
- $.ajax({
- type: "post",
- url: '{:url("construction/change_status")}',
- data: {
- id: id
- },
- success: function (res) {
- layer.msg(res.msg, { time: 2000 });
- }
- });
- });
- });
- </script>
- {/block}
|