企业后台增加一键发送
This commit is contained in:
@@ -224,6 +224,133 @@ define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefin
|
|||||||
edit: function () {
|
edit: function () {
|
||||||
Controller.api.bindevent();
|
Controller.api.bindevent();
|
||||||
},
|
},
|
||||||
|
massagesindex: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'firmcustomer/index' + location.search,
|
||||||
|
add_url: 'firmcustomer/add',
|
||||||
|
edit_url: 'firmcustomer/edit',
|
||||||
|
del_url: 'firmcustomer/del',
|
||||||
|
import_url: 'firmcustomer/import',
|
||||||
|
massagesindex_url: 'firmcustomer/massagesindex'+ location.search,
|
||||||
|
table: 'firmcustomer',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.massagesindex_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
|
pageSize: 200,
|
||||||
|
pageList:[200,300],
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'name', title: __('Customer_name'), operate: 'LIKE'},
|
||||||
|
{field: 'gm_status', title: '发送状态', },
|
||||||
|
{field: 'send_time', title: '发送时间',},
|
||||||
|
{field: 'phone', title: __('Phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'rel_wx', title: __('Rel_wx'), operate: 'LIKE'},
|
||||||
|
{field: 'rel_group', title: __('Rel_group'), operate: 'LIKE'},
|
||||||
|
{field: 'firmstoreprojectstwo.name', title: __('Firmstoreprojectstwo.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'firmcustomerorigin.name', title: __('Firmcustomerorigin.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'firmtags_ids', title: __('Firmtags_ids'), operate: 'LIKE'},
|
||||||
|
{field: 'remark', title: __('Remark'), operate: 'LIKE'},
|
||||||
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
$('#submitButton').on('click', function () {
|
||||||
|
// 获取多选的数据
|
||||||
|
var rows = $('#table').bootstrapTable('getSelections');
|
||||||
|
var ids = [];
|
||||||
|
rows.forEach(function (row) {
|
||||||
|
ids.push(row.id);
|
||||||
|
});
|
||||||
|
var url = 'groupmessages/add?ids=' + ids.join(',');
|
||||||
|
Fast.api.open(url);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
massagesindexnot: function () {
|
||||||
|
// 初始化表格参数配置
|
||||||
|
Table.api.init({
|
||||||
|
extend: {
|
||||||
|
index_url: 'firmcustomer/index' + location.search,
|
||||||
|
add_url: 'firmcustomer/add',
|
||||||
|
edit_url: 'firmcustomer/edit',
|
||||||
|
del_url: 'firmcustomer/del',
|
||||||
|
import_url: 'firmcustomer/import',
|
||||||
|
massagesindexnot_url: 'firmcustomer/massagesindexnot'+ location.search,
|
||||||
|
table: 'firmcustomer',
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
var table = $("#table");
|
||||||
|
|
||||||
|
// 初始化表格
|
||||||
|
table.bootstrapTable({
|
||||||
|
url: $.fn.bootstrapTable.defaults.extend.massagesindexnot_url,
|
||||||
|
pk: 'id',
|
||||||
|
sortName: 'id',
|
||||||
|
fixedColumns: true,
|
||||||
|
fixedRightNumber: 1,
|
||||||
|
pageSize: 200,
|
||||||
|
pageList:[200,300],
|
||||||
|
columns: [
|
||||||
|
[
|
||||||
|
{checkbox: true},
|
||||||
|
{field: 'id', title: __('Id')},
|
||||||
|
{field: 'name', title: __('Customer_name'), operate: 'LIKE'},
|
||||||
|
{field: 'phone', title: __('Phone'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'rel_wx', title: __('Rel_wx'), operate: 'LIKE'},
|
||||||
|
{field: 'rel_group', title: __('Rel_group'), operate: 'LIKE'},
|
||||||
|
{field: 'firmstoreprojectstwo.name', title: __('Firmstoreprojectstwo.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'firmcustomerorigin.name', title: __('Firmcustomerorigin.name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||||
|
{field: 'firmtags_ids', title: __('Firmtags_ids'), operate: 'LIKE'},
|
||||||
|
{field: 'remark', title: __('Remark'), operate: 'LIKE'},
|
||||||
|
{field: 'responsible_pm', title: __('Responsible_pm'), operate: 'LIKE'},
|
||||||
|
{field: 'status', title: __('Status'), searchList: {"yes":__('Status yes'),"no":__('Status no')}, formatter: Table.api.formatter.status},
|
||||||
|
{field: 'admin_id', title: __('责任人'), operate: 'LIKE'},
|
||||||
|
{field: 'create_time', title: __('Create_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||||
|
|
||||||
|
]
|
||||||
|
]
|
||||||
|
});
|
||||||
|
|
||||||
|
// 为表格绑定事件
|
||||||
|
Table.api.bindevent(table);
|
||||||
|
|
||||||
|
$('#submitButton').on('click', function () {
|
||||||
|
// 获取多选的数据
|
||||||
|
var mess_id = $('#mess_id').val();
|
||||||
|
var rows = $('#table').bootstrapTable('getSelections');
|
||||||
|
var ids = [];
|
||||||
|
rows.forEach(function (row) {
|
||||||
|
ids.push(row.id);
|
||||||
|
});
|
||||||
|
$.post('groupmessages/addagain', {customer_ids: ids.join(','),mess_id:mess_id}, function (res) {
|
||||||
|
if (res.code == 1){
|
||||||
|
layer.msg('发送成功',function (){
|
||||||
|
location.reload();
|
||||||
|
},300);
|
||||||
|
|
||||||
|
}else {
|
||||||
|
layer.msg(res.msg);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
},
|
||||||
api: {
|
api: {
|
||||||
bindevent: function () {
|
bindevent: function () {
|
||||||
Form.api.bindevent($("form[role=form]"));
|
Form.api.bindevent($("form[role=form]"));
|
||||||
|
|||||||
Reference in New Issue
Block a user