123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282 |
- @extends('admin/site/side_layout')
- @section('header_extend')
- <style>
- h1 {
- color: #0d8ddb
- }
- </style>
- @endsection
- @section('right')
- <form class="row" id="searchForm">
- <div class="col-md-6">
- <div class="input-group" style="display: flex">
- <span class="input-group-btn" style="width: auto">
- <button type="button" class="btn btn-md btn-primary"
- onclick="units.add(0)" style="margin-left: 10px">
- <span class="glyphicon glyphicon-plus"></span> 添加
- </button>
- <button type="button" class="btn btn-md btn-danger"
- onclick="units.delete()" style="margin-left: 10px">
- <span class="glyphicon glyphicon-remove"></span> 删除
- </button>
- </span>
- <button type="button" class="btn btn-md btn-success"
- onclick="units.batchBeApplicable()" style="margin-left: 10px"> 批量适用
- </button>
- <button type="button" class="btn btn-md btn-success"
- onclick="units.batchNotApplicable()" style="margin-left: 10px"> 批量不适用
- </button>
- <div class="input-group" style="margin-left: 10px">
- <input type="text" placeholder="请输入推送的手机号" class="input-md form-control"
- name="mobile" id="mobile" style="width: 150px;float: right" value="{{$mobile}}">
- <span class="input-group-btn">
- <button type="button" class="btn btn-md btn-success" onclick="units.pushMessage()"> 推送</button>
- </span>
- </div>
- <select name="beApplicable" id="beApplicable" title="" class="form-control"
- style="width: 150px;float: inherit;margin-left: 10px;position: relative;"
- onchange="tips.selectPage();">
- <option value="">请选择</option>
- <option value="0">待定</option>
- <option value="1">适用</option>
- <option value="2">不适用</option>
- </select>
- <div class="input-group" style="width: 150px;">
- <input type="text" placeholder="请输入软文标题" class="input-md form-control"
- name="title"
- id="title" style="width: 150px;float: right">
- <span class="input-group-btn">
- <button type="button" class="btn btn-md btn-success" onclick="units.search()"> 搜索</button>
- <button type="button" class="btn btn-md btn-primary" style="margin-left: 10px" name="btnReset"> 重置</button>
- </span>
- </div>
- </div>
- </div>
- </form>
- <hr>
- <div class="table-responsive">
- <table id="table" class="table table-condensed"
- data-mobile-responsive="true"></table>
- </div>
- @endsection
- @section('footer_extend')
- <script>
- $('#bzx').click(function () {
- $('.toggle-x-box').toggle();
- });
- var units = {
- search: function () {
- tips.selectPage();
- },
- getIdsBySelections: function () {
- var selections = $("#table").bootstrapTable('getSelections');
- var ids = [];
- $.each(selections, function (inx, val) {
- ids.push(val.id);
- });
- return ids;
- },
- add: function (id) {
- var url = '/admin/articles/' + id + '?siteId={{$siteId}}';
- layer.open({
- type: 2,
- content: [url],
- area: ['100%', '100%'],
- title: '',
- closeBtn: 0
- });
- },
- save: function (id) {
- var url = '/admin/articles/' + id + '?siteId={{$siteId}}';
- layer.open({
- type: 2,
- content: [url],
- area: ['100%', '100%'],
- title: '',
- closeBtn: 0
- });
- },
- delete: function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('确定要删除吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles',
- type: 'delete',
- data: {ids: ids},
- tableRefresh: '#table'
- });
- });
- },
- batchBeApplicable: function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('确定适用吗?', {icon: 3, title: '批量适用'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/batch-be-applicable/{{$siteId}}',
- type: 'get',
- data: {ids: ids, type: 1},
- tableRefresh: '#table'
- });
- });
- },
- batchNotApplicable: function () {
- var ids = units.getIdsBySelections();
- if (ids.length === 0) {
- layer.alert('请先选择您所要操作的对象', {icon: 0});
- return;
- }
- layer.confirm('确定不适用吗?', {icon: 3, title: '批量不适用'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/batch-be-applicable/{{$siteId}}',
- type: 'get',
- data: {ids: ids, type: 2},
- tableRefresh: '#table'
- });
- });
- },
- toBeDetermined: function (id) {
- layer.confirm('确定待定吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/to-be-determined/{{$siteId}}',
- type: 'get',
- data: {id: id, type: 0},
- tableRefresh: '#table'
- });
- });
- },
- beApplicable: function (id) {
- layer.confirm('确定适用吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/to-be-determined/{{$siteId}}',
- type: 'get',
- data: {id: id, type: 1},
- tableRefresh: '#table'
- });
- });
- },
- notApplicable: function (id) {
- layer.confirm('确定不适用吗?', {icon: 3, title: '删除信息'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/to-be-determined/{{$siteId}}',
- type: 'get',
- data: {id: id, type: 2},
- tableRefresh: '#table'
- });
- });
- },
- notApplicableWherefore: function (id) {
- var notBeApplicableInfo = $('#not_be_applicable_info' + id).val();
- if (notBeApplicableInfo.length > 250) {
- layer.msg('字符长度过长,请控制在250字符以内');
- return;
- }
- tips.ajax({
- url: '/admin/articles/not-applicable-wherefore/{{$siteId}}',
- type: 'get',
- data: {id: id, notBeApplicableInfo: notBeApplicableInfo},
- tableRefresh: '#table'
- });
- },
- pushMessage: function () {
- var mobile = $('#mobile').val();
- layer.confirm('确定推送吗?', {icon: 3, title: '推送短信'}, function (index, layero) {
- layer.close(index);
- tips.ajax({
- url: '/admin/articles/push-mobile-message',
- type: 'put',
- data: {mobile: mobile, type: 1,siteId:'{{$siteId}}'},
- tableRefresh: '#table'
- });
- });
- },
- };
- var config = {};
- config.url = '/admin/sites/' + "{{$siteId}}" + '/articles-find';
- config.columns = [ //字段
- {checkbox: true},
- {title: '编号', field: 'id', align: 'center'},
- {
- title: '标题', field: 'title', align: 'center',
- formatter: function (value, row) {
- return '<a href="javascript:;" onclick="units.save(' + row.id + ')">' + value + '</a>'
- }
- },
- {title: '查找人员', field: 'translator_name', align: 'center'},
- {title: '审核状态', field: 'check', align: 'center'},
- {
- title: '操作', field: '', align: 'center',
- formatter: function (value, row) {
- var str = '';
- if (row.be_applicable === 0) {
- //熄灭
- str += '<button onclick="units.toBeDetermined(' + row.id + ')" class="btn btn-md btn-info" style="display: none">待定</button> ';
- //高亮
- str += '<button onclick="units.beApplicable(' + row.id + ')" class="btn btn-md btn-success">适用</button> ';
- //高亮
- str += '<button onclick="units.notApplicable(' + row.id + ')" class="btn btn-md btn-danger">不适用</button> ';
- } else if (row.be_applicable === 1) {
- //高亮
- str += '<button onclick="units.toBeDetermined(' + row.id + ')" class="btn btn-md btn-info">待定</button> ';
- //熄灭
- str += '<button onclick="units.beApplicable(' + row.id + ')" class="btn btn-md btn-success" style="display: none">适用</button> ';
- //高亮
- str += '<button onclick="units.notApplicable(' + row.id + ')" class="btn btn-md btn-danger">不适用</button> ';
- } else {
- //高亮
- str += '<button onclick="units.toBeDetermined(' + row.id + ')" class="btn btn-md btn-info">待定</button> ';
- //高亮
- str += '<button onclick="units.beApplicable(' + row.id + ')" class="btn btn-md btn-success">适用</button> ';
- //熄灭
- str += '<button onclick="units.notApplicable(' + row.id + ')" class="btn btn-md btn-danger" style="display: none">不适用</button> ';
- }
- return str;
- }
- },
- {title: '审核人', field: 'reviewer', align: 'center'},
- {title: '更新时间', field: 'updated_at', align: 'center'},
- {
- title: '不适用原因', field: 'not_be_applicable_info', align: 'center',
- formatter: function (value, row) {
- var str = '';
- if (row.be_applicable === 2) {
- str += '<input type="text" class="form-control" id="not_be_applicable_info' + row.id + '" name="not_be_applicable_info" value="' + row.not_be_applicable_info + '">';
- str += '<button onclick="units.notApplicableWherefore(' + row.id + ')" class="btn btn-md btn-success">确定</button>';
- }
- return str;
- },
- cellStyle: function () {
- return {css: {'display': 'flex'}};
- }
- }
- ];
- tips.bootstrapTable(config);
- </script>
- @endsection
|