init commit
This commit is contained in:
29
public/assets/js/backend/wdsxh/member/apply/apply.js
Normal file
29
public/assets/js/backend/wdsxh/member/apply/apply.js
Normal file
@@ -0,0 +1,29 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
examine: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
offline_examine: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
$(document).on('change','input[name="row[state]"]',function (){
|
||||
var type=$(this).val();
|
||||
switch (type){
|
||||
case "2":
|
||||
$('.reject').addClass('hide');
|
||||
break;
|
||||
case "3":
|
||||
$('.reject').removeClass('hide');
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
142
public/assets/js/backend/wdsxh/member/apply/company.js
Normal file
142
public/assets/js/backend/wdsxh/member/apply/company.js
Normal file
@@ -0,0 +1,142 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/apply/company/index' + location.search,
|
||||
del_url: 'wdsxh/member/apply/apply/del',
|
||||
examine_url: 'wdsxh/member/apply/apply/examine',
|
||||
table: 'wdsxh_member_apply',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'company_name', title: __('Company_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'company_logo', title: __('Company_logo'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.image},
|
||||
{field: 'company_position', title: __('Company_position'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'state', title: __('State'), visible: false, searchList: {"1":__('State 1'),"2":__('State 2'),"3":__('State 3'),"4":__('State 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'child_state', title: __('State'), searchList: {"1":'待审核',"2":'已驳回',"3":'待付款',"4":'线下待审核',"5":'线下已驳回',"6":'已通过'}, formatter: Table.api.formatter.normal},
|
||||
{field: 'examine_name', title: '审核人', operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'examine',
|
||||
text: __('入会审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 1){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'offline_examine',
|
||||
text: __('线下审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/offline_examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 4){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'details',
|
||||
text: __('详情'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state != '1' && row.child_state != '4'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
text: __('删除'),
|
||||
title: __('删除'),
|
||||
classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
|
||||
url: 'wdsxh/member/apply/apply/del',
|
||||
confirm: '确认删除吗?',
|
||||
visible:function(row){
|
||||
if(row['child_state'] !='6'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$("#table").bootstrapTable('refresh',{});
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Toastr.error(ret.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
142
public/assets/js/backend/wdsxh/member/apply/organize.js
Normal file
142
public/assets/js/backend/wdsxh/member/apply/organize.js
Normal file
@@ -0,0 +1,142 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/apply/organize/index' + location.search,
|
||||
del_url: 'wdsxh/member/apply/apply/del',
|
||||
examine_url: 'wdsxh/member/apply/apply/examine',
|
||||
table: 'wdsxh_member_apply',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'organize_name', title: __('Organize_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'organize_logo', title: __('Organize_logo'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.image},
|
||||
{field: 'organize_position', title: __('Organize_position'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'state', title: __('State'), visible: false, searchList: {"1":__('State 1'),"2":__('State 2'),"3":__('State 3'),"4":__('State 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'child_state', title: __('State'), searchList: {"1":'待审核',"2":'已驳回',"3":'待付款',"4":'线下待审核',"5":'线下已驳回',"6":'已通过'}, formatter: Table.api.formatter.normal},
|
||||
{field: 'examine_name', title: '审核人', operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'examine',
|
||||
text: __('入会审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 1){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'offline_examine',
|
||||
text: __('线下审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/offline_examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 4){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'details',
|
||||
text: __('详情'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state != '1' && row.child_state != '4'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
text: __('删除'),
|
||||
title: __('删除'),
|
||||
classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
|
||||
url: 'wdsxh/member/apply/apply/del',
|
||||
confirm: '确认删除吗?',
|
||||
visible:function(row){
|
||||
if(row['child_state'] !='6'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$("#table").bootstrapTable('refresh',{});
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Toastr.error(ret.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
140
public/assets/js/backend/wdsxh/member/apply/person.js
Normal file
140
public/assets/js/backend/wdsxh/member/apply/person.js
Normal file
@@ -0,0 +1,140 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/apply/person/index' + location.search,
|
||||
del_url: 'wdsxh/member/apply/apply/del',
|
||||
examine_url: 'wdsxh/member/apply/apply/examine',
|
||||
table: 'wdsxh_member_apply',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'native_place', title: __('Native_place'), operate: 'LIKE'},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'state', title: __('State'), visible: false, searchList: {"1":__('State 1'),"2":__('State 2'),"3":__('State 3'),"4":__('State 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'child_state', title: __('State'), searchList: {"1":'待审核',"2":'已驳回',"3":'待付款',"4":'线下待审核',"5":'线下已驳回',"6":'已通过'}, formatter: Table.api.formatter.normal},
|
||||
{field: 'examine_name', title: '审核人', operate: false},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'examine',
|
||||
text: __('入会审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 1){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'offline_examine',
|
||||
text: __('线下审核'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/offline_examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state == 4){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$(".btn-refresh").trigger("click");
|
||||
return true;
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Layer.alert(ret.msg);
|
||||
return false;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'details',
|
||||
text: __('详情'),
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/apply/apply/examine',
|
||||
visible: function (row) {
|
||||
if(row.child_state != '1' && row.child_state != '4'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
},
|
||||
{
|
||||
name: 'del',
|
||||
text: __('删除'),
|
||||
title: __('删除'),
|
||||
classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
|
||||
url: 'wdsxh/member/apply/apply/del',
|
||||
confirm: '确认删除吗?',
|
||||
visible:function(row){
|
||||
if(row['child_state'] !='6'){
|
||||
return true;
|
||||
}else{
|
||||
return false;
|
||||
}
|
||||
},
|
||||
success: function (data, ret) {
|
||||
$("#table").bootstrapTable('refresh',{});
|
||||
},
|
||||
error: function (data, ret) {
|
||||
Toastr.error(ret.msg);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
57
public/assets/js/backend/wdsxh/member/cert.js
Normal file
57
public/assets/js/backend/wdsxh/member/cert.js
Normal file
@@ -0,0 +1,57 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/cert/index' + location.search,
|
||||
add_url: 'wdsxh/member/cert/add',
|
||||
edit_url: 'wdsxh/member/cert/edit',
|
||||
del_url: 'wdsxh/member/cert/del',
|
||||
multi_url: 'wdsxh/member/cert/multi',
|
||||
import_url: 'wdsxh/member/cert/import',
|
||||
table: 'wdsxh_cert',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'member_name', title: __('Member_id'), operate: false},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'number', title: __('Number'), operate: 'LIKE'},
|
||||
{field: 'image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'channel', title: __('Channel'), searchList: {"1":__('Channel 1'),"2":__('Channel 2')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:false, addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
237
public/assets/js/backend/wdsxh/member/company.js
Normal file
237
public/assets/js/backend/wdsxh/member/company.js
Normal file
@@ -0,0 +1,237 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/company/index' + location.search,
|
||||
add_url: 'wdsxh/member/company/add',
|
||||
edit_url: 'wdsxh/member/company/edit',
|
||||
del_url: 'wdsxh/member/company/del',
|
||||
multi_url: 'wdsxh/member/company/multi',
|
||||
import_url: 'wdsxh/member/company/import',
|
||||
table: 'wdsxh_member',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
$(document).on("click", ".btn-export", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
var page = table.bootstrapTable('getData');
|
||||
var all = table.bootstrapTable('getOptions').totalRows;
|
||||
console.log(ids, page, all);
|
||||
Layer.confirm("请选择导出的选项", {
|
||||
title: '导出数据',
|
||||
btn: ["选中项(" + ids.length + "条)", "本页(" + page.length + "条)", "全部(" + all + "条)"],
|
||||
success: function (layero, index) {
|
||||
$(".layui-layer-btn a", layero).addClass("layui-layer-btn0");
|
||||
}
|
||||
, yes: function (index, layero) {
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn2: function (index, layero) {
|
||||
var ids = [];
|
||||
$.each(page, function (i, j) {
|
||||
ids.push(j.id);
|
||||
});
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn3: function (index, layero) {
|
||||
submitForm("all");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
});
|
||||
var submitForm = function (ids) {
|
||||
// 确保隐藏表单存在
|
||||
var $form = $("#exportHiddenForm");
|
||||
if ($form.length === 0) {
|
||||
$form = $("<form id='exportHiddenForm' method='post' target='_blank' style='display:none;'></form>");
|
||||
$form.attr('action', Fast.api.fixurl("wdsxh/member/company/export"));
|
||||
$form.append("<input type='hidden' name='ids' />");
|
||||
$form.append("<input type='hidden' name='filter' />");
|
||||
$form.append("<input type='hidden' name='op' />");
|
||||
$form.append("<input type='hidden' name='search' />");
|
||||
$form.append("<input type='hidden' name='columns' />");
|
||||
$("body").append($form);
|
||||
}
|
||||
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
console.log(options);
|
||||
var columns = [];
|
||||
$.each(options.columns[0], function (i, j) {
|
||||
if (j.field && !j.checkbox && j.visible && j.field != 'operate') {
|
||||
columns.push(j.field);
|
||||
}
|
||||
});
|
||||
var search = options.queryParams({});
|
||||
$("input[name=search]", $form).val(options.searchText);
|
||||
$("input[name=ids]", $form).val(ids);
|
||||
var _filter = search.filter || {};
|
||||
var _op = search.op || {};
|
||||
if (typeof _filter !== 'string') {
|
||||
_filter = JSON.stringify(_filter);
|
||||
}
|
||||
if (typeof _op !== 'string') {
|
||||
_op = JSON.stringify(_op);
|
||||
}
|
||||
$("input[name=filter]", $form).val(_filter);
|
||||
$("input[name=op]", $form).val(_op);
|
||||
$("input[name=columns]", $form).val(columns.join(','));
|
||||
$form[0].submit();
|
||||
};
|
||||
|
||||
$(document).on("click", ".import_template", function () {
|
||||
Fast.api.ajax({
|
||||
url:'wdsxh/member/company/import_template',
|
||||
}, function(data, ret){
|
||||
//成功的回调
|
||||
var $a = $("<a>");
|
||||
$a.attr("href", data.file);
|
||||
$a.attr("download", data.filename);
|
||||
$("body").append($a);
|
||||
$a[0].click();
|
||||
$a.remove();
|
||||
return false;
|
||||
}, function(data, ret){
|
||||
alert(ret.msg);
|
||||
//失败的回调
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'native_place', title: __('Native_place'), operate: 'LIKE'},
|
||||
{field: 'industry.name', title: __('Industry.name'), operate: 'LIKE'},
|
||||
{field: 'company_name', title: __('Company_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'company_logo', title: __('Company_logo'), operate: false, table: table, class: 'autocontent', formatter: Table.api.formatter.image},
|
||||
{field: 'company_position', title: __('Company_position'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'join_time', title: __('Join_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'expire_time', title: __('Expire_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
name: 'list',
|
||||
text: __('产品维护'),
|
||||
title: __('产品维护'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/company_goods?member_id={id}',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 会员消息通知按钮点击事件
|
||||
$(document).on("click", ".btn-member-notification", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
if (ids.length === 0) {
|
||||
Layer.msg("请至少选择一个会员");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开通知表单弹窗
|
||||
Fast.api.open('wdsxh/member/person/send_notification?ids=' + ids.join(','), '发送会员消息通知', {
|
||||
area: ['800px', '600px'],
|
||||
callback: function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
edit: function () {
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 监听用户输入框变化,当清空时同时清空隐藏字段
|
||||
$(document).on('input', '#c-user', function() {
|
||||
if ($(this).val() === '') {
|
||||
$('#c-uid').val('');
|
||||
}
|
||||
});
|
||||
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
send_notification: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
54
public/assets/js/backend/wdsxh/member/industry_category.js
Normal file
54
public/assets/js/backend/wdsxh/member/industry_category.js
Normal file
@@ -0,0 +1,54 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/industry_category/index' + location.search,
|
||||
add_url: 'wdsxh/member/industry_category/add',
|
||||
edit_url: 'wdsxh/member/industry_category/edit',
|
||||
del_url: 'wdsxh/member/industry_category/del',
|
||||
multi_url: 'wdsxh/member/industry_category/multi',
|
||||
import_url: 'wdsxh/member/industry_category/import',
|
||||
table: 'wdsxh_member_industry_category',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'weigh',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'icon', title: __('Icon'), operate: 'LIKE', formatter: Table.api.formatter.image},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'status', title: __('Status'), searchList: {"0":__('Status 0'),"1":__('Status 1')}, formatter: Table.api.formatter.status},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
67
public/assets/js/backend/wdsxh/member/join_config.js
Normal file
67
public/assets/js/backend/wdsxh/member/join_config.js
Normal file
@@ -0,0 +1,67 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/join_config/index' + location.search,
|
||||
edit_url: 'wdsxh/member/join_config/edit',
|
||||
table: 'wdsxh_member_join_config',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'weigh',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{
|
||||
field: 'operate',
|
||||
width: "150px",
|
||||
title: __('Operate'),
|
||||
table: table,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'fieldset',
|
||||
text: __('自定义登记字段'),
|
||||
title: __('自定义登记字段'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/member/join_config/fieldset',
|
||||
}
|
||||
],
|
||||
formatter: Table.api.formatter.operate
|
||||
},
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
fieldset: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
56
public/assets/js/backend/wdsxh/member/level.js
Normal file
56
public/assets/js/backend/wdsxh/member/level.js
Normal file
@@ -0,0 +1,56 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/level/index' + location.search,
|
||||
add_url: 'wdsxh/member/level/add',
|
||||
edit_url: 'wdsxh/member/level/edit',
|
||||
del_url: 'wdsxh/member/level/del',
|
||||
multi_url: 'wdsxh/member/level/multi',
|
||||
import_url: 'wdsxh/member/level/import',
|
||||
table: 'wdsxh_member_level',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'weigh',
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'fees', title: __('Fees'), operate:'BETWEEN'},
|
||||
{field: 'weigh', title: __('Weigh'), operate: false},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'updatetime', title: __('Updatetime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
edit: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
146
public/assets/js/backend/wdsxh/member/member.js
Normal file
146
public/assets/js/backend/wdsxh/member/member.js
Normal file
@@ -0,0 +1,146 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
member: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/member/member' + location.search,
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: '昵称', operate: 'LIKE'},
|
||||
{field: 'avatar', title: '头像', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'createtime', title: '注册时间', operate:false},
|
||||
{field: 'level_name', title: '级别', operate: false},
|
||||
{field: 'join_time', title: '加入时间', operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
seluser:function(){
|
||||
Table.api.init({
|
||||
extend: {
|
||||
}
|
||||
});
|
||||
var table = $("#table");
|
||||
table.bootstrapTable({
|
||||
url: 'wdsxh/member/member/seluser' + location.search,
|
||||
pk: 'id',
|
||||
sortName: 'createtime',
|
||||
search:false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
visible: false,
|
||||
showExport: false,
|
||||
searchFormVisible: true,
|
||||
sortOrder:'desc',
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('ID'), sortable: true,operate: false},
|
||||
{field: 'avatar', title: __('头像'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
|
||||
{field: 'nickname', title: __('昵称'), operate: 'LIKE'},
|
||||
{field: 'mobile', title: __('手机号'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('创建时间'),operate: false, formatter: Table.api.formatter.datetime, addclass: 'datetimerange', sortable: true},
|
||||
{
|
||||
field: 'buttons',
|
||||
width: "80px",
|
||||
title: __('操作'),
|
||||
text: __('操作'),
|
||||
table: table,
|
||||
operate: false,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'ajax',
|
||||
text: __('选择'),
|
||||
title: __('选择'),
|
||||
classname: 'btn btn-xs btn-primary btn-magic btn-click',
|
||||
icon: 'fa fa-check',
|
||||
click:function (obj,row) {
|
||||
console.log(row);
|
||||
Fast.api.close(row);
|
||||
}
|
||||
}
|
||||
],
|
||||
formatter: Table.api.formatter.buttons
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
activity_seluser:function(){
|
||||
Table.api.init({
|
||||
extend: {
|
||||
}
|
||||
});
|
||||
var table = $("#table");
|
||||
table.bootstrapTable({
|
||||
url: 'wdsxh/member/member/activity_seluser' + location.search,
|
||||
pk: 'id',
|
||||
sortName: 'createtime',
|
||||
search:false,
|
||||
showToggle: false,
|
||||
showColumns: false,
|
||||
visible: false,
|
||||
showExport: false,
|
||||
searchFormVisible: true,
|
||||
sortOrder:'desc',
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('ID'), sortable: true,operate: false},
|
||||
{field: 'avatar', title: __('头像'), events: Table.api.events.image, formatter: Table.api.formatter.image, operate: false},
|
||||
{field: 'nickname', title: __('昵称'), operate: 'LIKE'},
|
||||
{field: 'mobile', title: __('手机号'), operate: 'LIKE'},
|
||||
{field: 'createtime', title: __('创建时间'),operate: false, formatter: Table.api.formatter.datetime, addclass: 'datetimerange', sortable: true},
|
||||
{
|
||||
field: 'buttons',
|
||||
width: "80px",
|
||||
title: __('操作'),
|
||||
text: __('操作'),
|
||||
table: table,
|
||||
operate: false,
|
||||
events: Table.api.events.operate,
|
||||
buttons: [
|
||||
{
|
||||
name: 'ajax',
|
||||
text: __('选择'),
|
||||
title: __('选择'),
|
||||
classname: 'btn btn-xs btn-primary btn-magic btn-click',
|
||||
icon: 'fa fa-check',
|
||||
click:function (obj,row) {
|
||||
console.log(row);
|
||||
Fast.api.close(row);
|
||||
}
|
||||
}
|
||||
],
|
||||
formatter: Table.api.formatter.buttons
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
237
public/assets/js/backend/wdsxh/member/organize.js
Normal file
237
public/assets/js/backend/wdsxh/member/organize.js
Normal file
@@ -0,0 +1,237 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/organize/index' + location.search,
|
||||
add_url: 'wdsxh/member/organize/add',
|
||||
edit_url: 'wdsxh/member/organize/edit',
|
||||
del_url: 'wdsxh/member/organize/del',
|
||||
multi_url: 'wdsxh/member/organize/multi',
|
||||
import_url: 'wdsxh/member/organize/import',
|
||||
table: 'wdsxh_member',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
$(document).on("click", ".btn-export", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
var page = table.bootstrapTable('getData');
|
||||
var all = table.bootstrapTable('getOptions').totalRows;
|
||||
console.log(ids, page, all);
|
||||
Layer.confirm("请选择导出的选项", {
|
||||
title: '导出数据',
|
||||
btn: ["选中项(" + ids.length + "条)", "本页(" + page.length + "条)", "全部(" + all + "条)"],
|
||||
success: function (layero, index) {
|
||||
$(".layui-layer-btn a", layero).addClass("layui-layer-btn0");
|
||||
}
|
||||
, yes: function (index, layero) {
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn2: function (index, layero) {
|
||||
var ids = [];
|
||||
$.each(page, function (i, j) {
|
||||
ids.push(j.id);
|
||||
});
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn3: function (index, layero) {
|
||||
submitForm("all");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
});
|
||||
var submitForm = function (ids) {
|
||||
// 确保隐藏表单存在
|
||||
var $form = $("#exportHiddenForm");
|
||||
if ($form.length === 0) {
|
||||
$form = $("<form id='exportHiddenForm' method='post' target='_blank' style='display:none;'></form>");
|
||||
$form.attr('action', Fast.api.fixurl("wdsxh/member/organize/export"));
|
||||
$form.append("<input type='hidden' name='ids' />");
|
||||
$form.append("<input type='hidden' name='filter' />");
|
||||
$form.append("<input type='hidden' name='op' />");
|
||||
$form.append("<input type='hidden' name='search' />");
|
||||
$form.append("<input type='hidden' name='columns' />");
|
||||
$("body").append($form);
|
||||
}
|
||||
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
console.log(options);
|
||||
var columns = [];
|
||||
$.each(options.columns[0], function (i, j) {
|
||||
if (j.field && !j.checkbox && j.visible && j.field != 'operate') {
|
||||
columns.push(j.field);
|
||||
}
|
||||
});
|
||||
var search = options.queryParams({});
|
||||
$("input[name=search]", $form).val(options.searchText);
|
||||
$("input[name=ids]", $form).val(ids);
|
||||
var _filter = search.filter || {};
|
||||
var _op = search.op || {};
|
||||
if (typeof _filter !== 'string') {
|
||||
_filter = JSON.stringify(_filter);
|
||||
}
|
||||
if (typeof _op !== 'string') {
|
||||
_op = JSON.stringify(_op);
|
||||
}
|
||||
$("input[name=filter]", $form).val(_filter);
|
||||
$("input[name=op]", $form).val(_op);
|
||||
$("input[name=columns]", $form).val(columns.join(','));
|
||||
$form[0].submit();
|
||||
};
|
||||
|
||||
$(document).on("click", ".import_template", function () {
|
||||
Fast.api.ajax({
|
||||
url:'wdsxh/member/organize/import_template',
|
||||
}, function(data, ret){
|
||||
//成功的回调
|
||||
var $a = $("<a>");
|
||||
$a.attr("href", data.file);
|
||||
$a.attr("download", data.filename);
|
||||
$("body").append($a);
|
||||
$a[0].click();
|
||||
$a.remove();
|
||||
return false;
|
||||
}, function(data, ret){
|
||||
alert(ret.msg);
|
||||
//失败的回调
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'native_place', title: __('Native_place'), operate: 'LIKE'},
|
||||
{field: 'industry.name', title: __('Industry.name'), operate: 'LIKE'},
|
||||
{field: 'organize_name', title: __('Organize_name'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'organize_logo', title: __('Organize_logo'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.image},
|
||||
{field: 'organize_position', title: __('Organize_position'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
||||
{field: 'join_time', title: __('Join_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'expire_time', title: __('Expire_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
name: 'list',
|
||||
text: __('产品维护'),
|
||||
title: __('产品维护'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
extend: 'data-area=["100%","100%"]',
|
||||
url: 'wdsxh/company_goods?member_id={id}',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
},
|
||||
]
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 会员消息通知按钮点击事件
|
||||
$(document).on("click", ".btn-member-notification", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
if (ids.length === 0) {
|
||||
Layer.msg("请至少选择一个会员");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开通知表单弹窗
|
||||
Fast.api.open('wdsxh/member/person/send_notification?ids=' + ids.join(','), '发送会员消息通知', {
|
||||
area: ['800px', '600px'],
|
||||
callback: function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
edit: function () {
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 监听用户输入框变化,当清空时同时清空隐藏字段
|
||||
$(document).on('input', '#c-user', function() {
|
||||
if ($(this).val() === '') {
|
||||
$('#c-uid').val('');
|
||||
}
|
||||
});
|
||||
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
send_notification: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
49
public/assets/js/backend/wdsxh/member/pay.js
Normal file
49
public/assets/js/backend/wdsxh/member/pay.js
Normal file
@@ -0,0 +1,49 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/pay/index' + location.search,
|
||||
table: 'wdsxh_member_pay',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'order_no', title: '订单号', operate: 'LIKE'},
|
||||
{field: 'wechat.nickname', title: '昵称', operate: false},
|
||||
{field: 'wechat.avatar', title: '头像', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'member.name', title: '姓名', operate: 'LIKE'},
|
||||
{field: 'level.name', title: '入会级别', operate: 'LIKE'},
|
||||
{field: 'fees', title: __('Fees'), operate:'BETWEEN'},
|
||||
{field: 'paid', title: __('Paid'), operate: false, searchList: {"1":__('Paid 1'),"2":__('Paid 2'),"4":__('Paid 4')}, formatter: Table.api.formatter.normal},
|
||||
{field: 'pay_time', title: __('Pay_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'pay_method', title: '缴费方式', searchList: {"2":'微信支付',"3":'线下缴费',"4":'后台添加'}, formatter: Table.api.formatter.normal},
|
||||
{field: 'pay_voucher', title: '缴费凭证', operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
]
|
||||
]
|
||||
});
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
216
public/assets/js/backend/wdsxh/member/person.js
Normal file
216
public/assets/js/backend/wdsxh/member/person.js
Normal file
@@ -0,0 +1,216 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/person/index' + location.search,
|
||||
add_url: 'wdsxh/member/person/add',
|
||||
edit_url: 'wdsxh/member/person/edit',
|
||||
del_url: 'wdsxh/member/person/del',
|
||||
multi_url: 'wdsxh/member/person/multi',
|
||||
import_url: 'wdsxh/member/person/import',
|
||||
table: 'wdsxh_member',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
$(document).on("click", ".btn-export", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
var page = table.bootstrapTable('getData');
|
||||
var all = table.bootstrapTable('getOptions').totalRows;
|
||||
console.log(ids, page, all);
|
||||
Layer.confirm("请选择导出的选项", {
|
||||
title: '导出数据',
|
||||
btn: ["选中项(" + ids.length + "条)", "本页(" + page.length + "条)", "全部(" + all + "条)"],
|
||||
success: function (layero, index) {
|
||||
$(".layui-layer-btn a", layero).addClass("layui-layer-btn0");
|
||||
}
|
||||
, yes: function (index, layero) {
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn2: function (index, layero) {
|
||||
var ids = [];
|
||||
$.each(page, function (i, j) {
|
||||
ids.push(j.id);
|
||||
});
|
||||
submitForm(ids.join(","));
|
||||
return false;
|
||||
}
|
||||
,
|
||||
btn3: function (index, layero) {
|
||||
submitForm("all");
|
||||
return false;
|
||||
}
|
||||
})
|
||||
});
|
||||
var submitForm = function (ids) {
|
||||
// 确保隐藏表单存在
|
||||
var $form = $("#exportHiddenForm");
|
||||
if ($form.length === 0) {
|
||||
$form = $("<form id='exportHiddenForm' method='post' target='_blank' style='display:none;'></form>");
|
||||
$form.attr('action', Fast.api.fixurl("wdsxh/member/person/export"));
|
||||
$form.append("<input type='hidden' name='ids' />");
|
||||
$form.append("<input type='hidden' name='filter' />");
|
||||
$form.append("<input type='hidden' name='op' />");
|
||||
$form.append("<input type='hidden' name='search' />");
|
||||
$form.append("<input type='hidden' name='columns' />");
|
||||
$("body").append($form);
|
||||
}
|
||||
|
||||
var options = table.bootstrapTable('getOptions');
|
||||
console.log(options);
|
||||
var columns = [];
|
||||
$.each(options.columns[0], function (i, j) {
|
||||
if (j.field && !j.checkbox && j.visible && j.field != 'operate') {
|
||||
columns.push(j.field);
|
||||
}
|
||||
});
|
||||
var search = options.queryParams({});
|
||||
$("input[name=search]", $form).val(options.searchText);
|
||||
$("input[name=ids]", $form).val(ids);
|
||||
var _filter = search.filter || {};
|
||||
var _op = search.op || {};
|
||||
if (typeof _filter !== 'string') {
|
||||
_filter = JSON.stringify(_filter);
|
||||
}
|
||||
if (typeof _op !== 'string') {
|
||||
_op = JSON.stringify(_op);
|
||||
}
|
||||
$("input[name=filter]", $form).val(_filter);
|
||||
$("input[name=op]", $form).val(_op);
|
||||
$("input[name=columns]", $form).val(columns.join(','));
|
||||
$form[0].submit();
|
||||
};
|
||||
|
||||
$(document).on("click", ".import_template", function () {
|
||||
Fast.api.ajax({
|
||||
url:'wdsxh/member/person/import_template',
|
||||
}, function(data, ret){
|
||||
//成功的回调
|
||||
var $a = $("<a>");
|
||||
$a.attr("href", data.file);
|
||||
$a.attr("download", data.filename);
|
||||
$("body").append($a);
|
||||
$a[0].click();
|
||||
$a.remove();
|
||||
return false;
|
||||
}, function(data, ret){
|
||||
alert(ret.msg);
|
||||
//失败的回调
|
||||
return false;
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
fixedColumns: true,
|
||||
fixedRightNumber: 1,
|
||||
columns: [
|
||||
[
|
||||
{checkbox: true},
|
||||
{field: 'id', title: __('Id')},
|
||||
{field: 'name', title: __('Name'), operate: 'LIKE'},
|
||||
{field: 'avatar', title: __('Avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'mobile', title: __('Mobile'), operate: 'LIKE'},
|
||||
{field: 'level.name', title: __('Level.name'), operate: 'LIKE'},
|
||||
{field: 'native_place', title: __('Native_place'), operate: 'LIKE'},
|
||||
{field: 'industry.name', title: __('Industry.name'), operate: 'LIKE'},
|
||||
{field: 'join_time', title: __('Join_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'expire_time', title: __('Expire_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'status', title: __('Status'), searchList: {"normal":__('Status normal'),"hidden":__('Status hidden')}, formatter: Table.api.formatter.status},
|
||||
{field: 'createtime', title: __('Createtime'), operate:'RANGE', addclass:'datetimerange', autocomplete:false, formatter: Table.api.formatter.datetime},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
|
||||
table.on('post-body.bs.table', function (e, settings, json, xhr) {
|
||||
$(".btn-editone,.btn-edit,.btn-add").data("area", ["100%", "100%"]);
|
||||
});
|
||||
|
||||
// 会员消息通知按钮点击事件
|
||||
$(document).on("click", ".btn-member-notification", function () {
|
||||
var ids = Table.api.selectedids(table);
|
||||
if (ids.length === 0) {
|
||||
Layer.msg("请至少选择一个会员");
|
||||
return false;
|
||||
}
|
||||
|
||||
// 打开通知表单弹窗
|
||||
Fast.api.open('wdsxh/member/person/send_notification?ids=' + ids.join(','), '发送会员消息通知', {
|
||||
area: ['800px', '600px'],
|
||||
callback: function (data) {
|
||||
table.bootstrapTable('refresh');
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
add: function () {
|
||||
Controller.api.bindevent();
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
},
|
||||
edit: function () {
|
||||
$(document).on('click','#select-user',function () {
|
||||
Fast.api.open('wdsxh/member/member/seluser','选择用户',{
|
||||
area:['80%','95%'],
|
||||
callback:function(data){
|
||||
console.log(data);
|
||||
if(data){
|
||||
$('#c-uid').val(data.id);
|
||||
$('#c-user').val(data.nickname);
|
||||
}else{
|
||||
Layer.alert("请选择用户");
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// 监听用户输入框变化,当清空时同时清空隐藏字段
|
||||
$(document).on('input', '#c-user', function() {
|
||||
if ($(this).val() === '') {
|
||||
$('#c-uid').val('');
|
||||
}
|
||||
});
|
||||
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
send_notification: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
80
public/assets/js/backend/wdsxh/member/promotion.js
Normal file
80
public/assets/js/backend/wdsxh/member/promotion.js
Normal file
@@ -0,0 +1,80 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
// 初始化表格参数配置
|
||||
Table.api.init({
|
||||
extend: {
|
||||
index_url: 'wdsxh/member/promotion/index' + location.search,
|
||||
table: 'wdsxh_member_promotion',
|
||||
}
|
||||
});
|
||||
|
||||
var table = $("#table");
|
||||
|
||||
// 初始化表格
|
||||
table.bootstrapTable({
|
||||
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
||||
pk: 'id',
|
||||
sortName: 'id',
|
||||
columns: [
|
||||
[
|
||||
{field: 'member.id', title: '会员ID'},
|
||||
{field: 'member.name', title: __('Member.name'), operate: 'LIKE'},
|
||||
{field: 'member.avatar', title: __('Member.avatar'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
||||
{field: 'member.mobile', title: __('Member.mobile'), operate: 'LIKE'},
|
||||
{field: 'level_name', title: __('Member.member_level_id'), operate: false},
|
||||
{field: 'member.join_time', title: __('Member.join_time'), operate:'RANGE', addclass:'datetimerange', autocomplete:false},
|
||||
{field: 'operate', title: __('Operate'), table: table, events: Table.api.events.operate, formatter: Table.api.formatter.operate,
|
||||
buttons:[
|
||||
{
|
||||
name: 'user',
|
||||
text: '普通用户',
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-info btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: 'wdsxh/user/wechat/user?wechat_id={wechat_id}',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
},
|
||||
{
|
||||
name: 'member',
|
||||
text: '商协会员',
|
||||
title: __('查看'),
|
||||
classname: 'btn btn-xs btn-primary btn-dialog',
|
||||
icon: 'fa fa-list',
|
||||
url: 'wdsxh/member/member/member?wechat_id={wechat_id}',
|
||||
callback: function (data) {
|
||||
Layer.alert("接收到回传数据:" + JSON.stringify(data), {title: "回传数据"});
|
||||
},
|
||||
visible: function (row) {
|
||||
//返回true时按钮显示,返回false隐藏
|
||||
return true;
|
||||
}
|
||||
}
|
||||
],
|
||||
|
||||
}
|
||||
]
|
||||
]
|
||||
});
|
||||
|
||||
// 为表格绑定事件
|
||||
Table.api.bindevent(table);
|
||||
},
|
||||
config: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
28
public/assets/js/backend/wdsxh/member/set.js
Normal file
28
public/assets/js/backend/wdsxh/member/set.js
Normal file
@@ -0,0 +1,28 @@
|
||||
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
||||
|
||||
var Controller = {
|
||||
index: function () {
|
||||
Controller.api.bindevent();
|
||||
},
|
||||
api: {
|
||||
bindevent: function () {
|
||||
$(document).on('change','input[name="row[expire_time_type]"]',function (){
|
||||
var type=$(this).val();
|
||||
switch (type){
|
||||
case "1":
|
||||
$('.fixed_date').addClass('hide');
|
||||
$('.days').removeClass('hide');
|
||||
break;
|
||||
case "2":
|
||||
$('.days').addClass('hide');
|
||||
$('.fixed_date').removeClass('hide');
|
||||
break;
|
||||
|
||||
}
|
||||
});
|
||||
Form.api.bindevent($("form[role=form]"));
|
||||
}
|
||||
}
|
||||
};
|
||||
return Controller;
|
||||
});
|
||||
Reference in New Issue
Block a user