123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371 |
- {extend name="public/layout" /} {block name="title"}装修案例列表{/block} {block name="body"}
- <style type="text/css">
- html,
- body {
- display: block;
- min-width: 1000px;
- }
- .layui-fluid {
- display: block;
- box-shadow: 0 0 4px 0 #B6CADE;
- border-radius: 5px;
- margin: 15px;
- background-color: #ffffff;
- box-sizing: border-box;
- }
- .layui-table thead tr,
- .layui-table-header {
- background-color: #D8E6F1 !important;
- }
- .layui-tab {
- padding: 15px;
- height: 100%;
- box-sizing: border-box;
- }
- .layui-form-item {
- width: 100%;
- }
- .layui-form-item .layui-inline {
- display: block;
- float: left;
- width: 145px;
- height: 38px;
- line-height: 38px;
- background: #FFFFFF;
- margin-right: 16px;
- }
- .layui-form-item .layui-input-inline {
- width: 145px;
- height: 38px;
- line-height: 38px;
- margin-bottom: 0;
- }
- .layui-form-item .layui-input-inline .layui-input {
- border: 1px solid #9DB6CF;
- border-radius: 5px;
- }
- .layui-form-select dl dd.layui-this {
- background-color: #249EFB;
- }
- .layui-form-item div.searchBox {
- width: 320px;
- background: #FFFFFF;
- border: 1px solid #B6CADE;
- border-radius: 24px;
- height: 38px;
- overflow: hidden;
- padding-left: 18px;
- position: relative;
- margin-bottom: 0px;
- float: right;
- }
- .searchBox .inputBox {
- width: 240px;
- float: left;
- height: 36px;
- line-height: 36px;
- border-width: 0;
- }
- .searchBtn {
- position: absolute;
- top: 0;
- right: 0;
- width: 51px;
- height: 38px;
- background-color: #fff;
- }
- .searchBtn img {
- position: absolute;
- width: 26px;
- top: 6px;
- left: 0;
- }
- .layui-form-label {
- width: auto;
- }
- .layui-btn-primary {
- color: #249EFB;
- border: 1px solid #249EFB;
- }
- .layui-btn-primary:hover {
- background-color: #E3F7FF;
- color: #249EFB;
- }
- .layui-table-page>div {
- display: flex;
- justify-content: flex-start;
- }
- .layui-btn-xs,.layui-btn-xs:hover {
- border: 1px solid #249EFB;
- background-color: #fff;
- color: #249EFB;
- padding: 0px 10px;
- }
- .layui-btn-danger,.layui-btn-danger:hover{
- color: #FF5722;
- background-color: #fff;
- border: 1px solid #FF5722;
- padding: 0px 10px;
- }
- .ml10 {
- margin-left: 10px;
- }
- .wxAddSend {
- position: relative;
- }
- .absolute-bottom {
- position: absolute;
- width: 122px;
- z-index: 99;
- display: flex;
- flex-direction: column;
- justify-content: center;
- align-items: center;
- background-color: #fff;
- box-sizing: border-box;
- padding: 5px;
- }
- .none {
- display: none;
- }
- </style>
- <body>
- <div class="layui-fluid">
- <div class="layui-card">
- <div class="layui-card-header layuiadmin-card-header-auto" style="padding: 15px 15px 20px;">
- <a type="button" class="layui-btn layui-btn-primary wxAddSend">添加群发内容</a>
- <div style="float:right;" class="layui-form">
- <div class="layui-inline">
- <label class="layui-form-label">群发时间</label>
- <div class="layui-input-inline select-date">
- <input type="text" name="date" id="select_date" placeholder="选择时间" autocomplete="off" class="layui-input">
- </div>
- </div>
- <div class="layui-inline ml10">
- <button class="layui-btn layuiadmin-btn-list" lay-submit lay-filter="LAY-app-contlist-search">
- <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
- </button>
- </div>
- </div>
- </div>
- <div class="layui-card-body" style="text-align: center;">
- <table id="qunfa-table" lay-filter="qunfa-table"></table>
- </div>
- </div>
- </div>
- </body>
- {/block} {block name="js"}
- <script type="text/html" id="table-wxshow-action">
- <a class="layui-btn layui-btn-xs" lay-event="send-edit" data->编辑</a>
- {auth:check name="wework/delete_external_message" }
- <a class="layui-btn layui-btn-xs layui-btn-danger" lay-event="del">删除</a>
- {/auth:check}
- </script>
- <script type="text/html" id="sendtime">
- <span>{{d.sendtime}} -- {{d.endtime}}</span>
- </script>
- <script type="text/html" id="statistics">
- <a class="layui-btn layui-btn-xs" lay-event="statistics-view">查看</a>
- </script>
- <script>
- layui.config({
- base: '__LAYUI__/',
- urlbase: '/sys'
- }).extend({
- index: 'lib/index' //主入口模块
- }).use(['index', 'table', 'element', 'laydate'], function () {
- var $ = layui.$,
- form = layui.form,
- element = layui.element,
- laydate = layui.laydate,
- table = layui.table;
- //日期范围
- laydate.render({
- elem: '#select_date',
- range:true
- });
- // 添加群发内容
- $('.wxAddSend').click(function () {
- layer.open({
- type: 2,
- title: ['添加群发内容', 'color:#333333;background-color:#D8E6F1;'],
- content: '{:url("wework/add_external_message")}',
- resize: false,
- area: ['80%', '80%'],
- });
- })
- //监听搜索
- form.on('submit(LAY-app-contlist-search)', function (data) {
- var field = data.field;
- console.log(data)
- //执行重载
- table.reload('qunfa-table', {
- where: field
- , page: { curr: 1 }
- });
- });
- ///default entery
- var firstTabTableLoad = function () {
- //装修案例列表
- table.render({
- elem: '#qunfa-table',
- autoSort: false,
- url: "{:url('wework/external_message')}",
- cols: [
- [{
- align: 'center',
- type: 'numbers',
- field: 'id',
- width: 80,
- title: '序号',
- sort: true
- }, {
- align: 'center',
- field: 'content',
- width: 100,
- title: '群发内容',
- }, {
- align: 'center',
- title: '群发类型',
- field: 'send_type_name',
- }, {
- align: 'center',
- title: '群发对象',
- field: 'customer_group_name'
- }, {
- align: 'center',
- title: '执行人员',
- field: 'employee_name'
- },
- {
- align: 'center',
- field: 'square',
- title: '群发时间',
- minWidth: 300,
- templet: '#sendtime'
- }, {
- align: 'center',
- title: '执行统计',
- width: 100,
- templet: '#statistics'
- },
- {
- align: 'center',
- title: '操作',
- width: 240,
- align: 'center',
- fixed: 'right',
- templet: "#table-wxshow-action"
- }]
- ],
- page: true,
- limit: 30,
- height: 'full-160',
- text: '对不起,加载出现异常!'
- });
- //监听列表
- table.on('tool(qunfa-table)', function (obj) {
- var data = obj.data;
- if (obj.event === 'send-edit') {
- console.log(data.edit_per)
- if (!data.edit_per) {
- layer.msg('已执行群发无法编辑')
- return false
- }
- layer.open({
- type: 2,
- title: ['编辑群发内容', 'color:#333333;background-color:#D8E6F1;'],
- content: "{:url('wework/edit_external_message')}?id=" + data.id,
- resize: false,
- area: ['80%', '80%']
- });
- }
- if (obj.event === 'del') {
- layer.confirm('确定删除此群发?', { title: ['信息', 'color:#333333;background-color:#D8E6F1;'], }, function (index) {
- $.ajax({
- url: "{:url('wework/delete_external_message')}",
- data: {
- id: data.id
- },
- type: 'post',
- success:function (res) {
- console.log(res)
- if (res.code == 0) {
- layer.msg('删除成功')
- obj.del();
- layer.close(index);
- } else {
- layer.msg(res.msg)
- }
- }
- });
- });
- }
- if(obj.event === 'statistics-view') {
- layer.open({
- type: 2,
- title: ['执行情况', 'color:#333333;background-color:#D8E6F1;'],
- content: "{:url('wework/statistics_external_message')}?id=" + data.id,
- resize: false,
- area: ['80%', '80%']
- });
- }
- });
- };
- firstTabTableLoad();
- var field = {};
- form.on('select(state)', function (data) {
- field['state'] = data.value;
- table.reload('qunfa-table', {
- where: field
- , page: { curr: 1 }
- });
- });
- form.on('select(user_id)', function (data) {
- field['user_id'] = data.value;
- table.reload('qunfa-table', {
- where: field
- , page: { curr: 1 }
- });
- });
- form.on('select(means)', function (data) {
- field['means'] = data.value;
- table.reload('qunfa-table', {
- where: field
- , page: { curr: 1 }
- });
- });
- form.on('select(date)', function (data) {
- field['date'] = data.value;
- table.reload('qunfa-table', {
- where: field
- , page: { curr: 1 }
- });
- });
- });
- </script>
- {/block}
|