|
@@ -157,24 +157,24 @@
|
|
|
}
|
|
|
|
|
|
function openIdDelete(userId) {
|
|
|
- $.ajax({
|
|
|
- url: '/admin/deleteOpenId.json',
|
|
|
- data: { userId: userId },
|
|
|
- type: 'post',
|
|
|
- success: function (data) {
|
|
|
- if (data.success) {
|
|
|
- layer.msg("删除成功");
|
|
|
- initTable();
|
|
|
- $('#myModal').modal('toggle');
|
|
|
-
|
|
|
- } else {
|
|
|
- layer.msg(data.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- layer.msg("网络异常");
|
|
|
- }
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // url: '/admin/deleteOpenId.json',
|
|
|
+ // data: { userId: userId },
|
|
|
+ // type: 'post',
|
|
|
+ // success: function (data) {
|
|
|
+ // if (data.success) {
|
|
|
+ // layer.msg("删除成功");
|
|
|
+ // initTable();
|
|
|
+ // $('#myModal').modal('toggle');
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // layer.msg(data.msg);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error: function () {
|
|
|
+ // layer.msg("网络异常");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
function userBind() {
|
|
@@ -184,17 +184,17 @@
|
|
|
}
|
|
|
|
|
|
function choosedPlace() {
|
|
|
- var data = $('#bindModal').find('form').formGet();
|
|
|
- top.layer.open({
|
|
|
- type: 2,
|
|
|
- title: '绑定二维码',
|
|
|
- shadeClose: false,
|
|
|
- resize: true,
|
|
|
- anim: 0,
|
|
|
- skin: 'layer-class',
|
|
|
- area: ['264px', '308px'],
|
|
|
- content: '/admin/user_bind_qr_png?placeId=' + data.placeId1
|
|
|
- });
|
|
|
+ // var data = $('#bindModal').find('form').formGet();
|
|
|
+ // top.layer.open({
|
|
|
+ // type: 2,
|
|
|
+ // title: '绑定二维码',
|
|
|
+ // shadeClose: false,
|
|
|
+ // resize: true,
|
|
|
+ // anim: 0,
|
|
|
+ // skin: 'layer-class',
|
|
|
+ // area: ['264px', '308px'],
|
|
|
+ // content: '/admin/user_bind_qr_png?placeId=' + data.placeId1
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
function saveForm() {
|
|
@@ -224,25 +224,25 @@
|
|
|
url = '/admin/user_addnew.json';
|
|
|
}
|
|
|
|
|
|
- $.ajax({
|
|
|
- url: url,
|
|
|
- contentType: "application/json; charset=utf-8",
|
|
|
- data: JSON.stringify(data),
|
|
|
- type: 'post',
|
|
|
- success: function (data) {
|
|
|
- if (data.success) {
|
|
|
- layer.msg("保存成功");
|
|
|
- initTable();
|
|
|
- $('#myModal').modal('toggle');
|
|
|
-
|
|
|
- } else {
|
|
|
- layer.msg(data.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- layer.msg("网络异常");
|
|
|
- }
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // url: url,
|
|
|
+ // contentType: "application/json; charset=utf-8",
|
|
|
+ // data: JSON.stringify(data),
|
|
|
+ // type: 'post',
|
|
|
+ // success: function (data) {
|
|
|
+ // if (data.success) {
|
|
|
+ // layer.msg("保存成功");
|
|
|
+ // initTable();
|
|
|
+ // $('#myModal').modal('toggle');
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // layer.msg(data.msg);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error: function () {
|
|
|
+ // layer.msg("网络异常");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
function userEdit(row) {
|
|
@@ -265,154 +265,154 @@
|
|
|
data.beActive = 'Y';
|
|
|
}
|
|
|
|
|
|
- $.ajax({
|
|
|
- url: '/admin/user_edit.json',
|
|
|
- contentType: "application/json; charset=utf-8",
|
|
|
- data: JSON.stringify(data),
|
|
|
- type: 'post',
|
|
|
- success: function (data) {
|
|
|
- if (data.success) {
|
|
|
- if (row.beActive === 'Y') {
|
|
|
- layer.msg('已启用当前角色');
|
|
|
- } else if (row.beActive === 'N') {
|
|
|
- layer.msg('已禁用当前角色');
|
|
|
- }
|
|
|
- initTable();
|
|
|
-
|
|
|
- } else {
|
|
|
- layer.msg(data.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- layer.msg("网络异常");
|
|
|
- }
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // url: '/admin/user_edit.json',
|
|
|
+ // contentType: "application/json; charset=utf-8",
|
|
|
+ // data: JSON.stringify(data),
|
|
|
+ // type: 'post',
|
|
|
+ // success: function (data) {
|
|
|
+ // if (data.success) {
|
|
|
+ // if (row.beActive === 'Y') {
|
|
|
+ // layer.msg('已启用当前角色');
|
|
|
+ // } else if (row.beActive === 'N') {
|
|
|
+ // layer.msg('已禁用当前角色');
|
|
|
+ // }
|
|
|
+ // initTable();
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // layer.msg(data.msg);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error: function () {
|
|
|
+ // layer.msg("网络异常");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
function initTable() {
|
|
|
- $('#thetable').bootstrapTable('destroy').bootstrapTable({
|
|
|
- url: '/admin/user.json',
|
|
|
- method: 'get',
|
|
|
- queryParams: function (params) {
|
|
|
- $('#theform').serializeArray().forEach(function fn(v) {
|
|
|
- params[v.name] = v.value;
|
|
|
- });
|
|
|
- return params;
|
|
|
- },
|
|
|
- responseHandler: responseHandler,
|
|
|
- idField: 'user_id',
|
|
|
- exportDataType: 'all',
|
|
|
- exportTypes: ['txt', 'excel'],
|
|
|
- dataShowExport: true,
|
|
|
- search: false,
|
|
|
- sortStable: false,
|
|
|
- sidePagination: 'server',
|
|
|
- pagination: true,
|
|
|
- columns: [
|
|
|
- {
|
|
|
- field: 'userId',
|
|
|
- title: '操作',
|
|
|
- width: '50px',
|
|
|
- formatter: function (v, row) {
|
|
|
- row.sense_id = 'select';
|
|
|
- var ts = [];
|
|
|
- if (row.userType === 'A' || row.userType === 'C') {
|
|
|
- ts.push('<button class="btn btn-sm btn-default" onclick=\'userEdit(' + JSON.stringify(row) + ')\'>编辑</button>');
|
|
|
-
|
|
|
- } else {
|
|
|
- ts.push('<button class="btn btn-sm btn-dark" onclick="openIdDelete(\'' + row.userId + '\')">删除</button>');
|
|
|
- }
|
|
|
- return ts.join('\n');
|
|
|
- }
|
|
|
- }, {
|
|
|
- field: 'loginName',
|
|
|
- title: '登录名'
|
|
|
- }, {
|
|
|
- field: 'staffName',
|
|
|
- title: '员工姓名'
|
|
|
- }, {
|
|
|
- field: 'phone',
|
|
|
- title: '手机'
|
|
|
- }, {
|
|
|
- field: 'placeName',
|
|
|
- title: '场地名称'
|
|
|
- }, {
|
|
|
- field: 'userType',
|
|
|
- title: '角色',
|
|
|
- formatter: function (v, row) {
|
|
|
- if (v === 'A') {
|
|
|
- return '管理员';
|
|
|
- } else if (v === 'C') {
|
|
|
- return '收银员';
|
|
|
- } else if (v === '1') {
|
|
|
- return '一级分销';
|
|
|
- } else if (v === '2') {
|
|
|
- return '二级分销';
|
|
|
- }
|
|
|
- return v;
|
|
|
- }
|
|
|
- }, {
|
|
|
- field: 'beActive',
|
|
|
- title: '状态',
|
|
|
- formatter: function (v, row) {
|
|
|
- var ts = [];
|
|
|
- if (row.userType === 'A' || row.userType === 'C') {
|
|
|
- if (row.beActive === 'Y') {
|
|
|
- ts.push('<button class="btn btn-sm btn-default" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>启用中</button>');
|
|
|
- } else if (row.beActive === 'N') {
|
|
|
- ts.push('<button class="btn btn-sm btn-dark" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>已禁用</button>');
|
|
|
- }
|
|
|
- return ts.join('\n');
|
|
|
- }
|
|
|
- return '启用中';
|
|
|
- }
|
|
|
- }, {
|
|
|
- field: 'loginCount',
|
|
|
- title: '登录次数'
|
|
|
- }
|
|
|
- ]
|
|
|
- });
|
|
|
+ // $('#thetable').bootstrapTable('destroy').bootstrapTable({
|
|
|
+ // url: '/admin/user.json',
|
|
|
+ // method: 'get',
|
|
|
+ // queryParams: function (params) {
|
|
|
+ // $('#theform').serializeArray().forEach(function fn(v) {
|
|
|
+ // params[v.name] = v.value;
|
|
|
+ // });
|
|
|
+ // return params;
|
|
|
+ // },
|
|
|
+ // responseHandler: responseHandler,
|
|
|
+ // idField: 'user_id',
|
|
|
+ // exportDataType: 'all',
|
|
|
+ // exportTypes: ['txt', 'excel'],
|
|
|
+ // dataShowExport: true,
|
|
|
+ // search: false,
|
|
|
+ // sortStable: false,
|
|
|
+ // sidePagination: 'server',
|
|
|
+ // pagination: true,
|
|
|
+ // columns: [
|
|
|
+ // {
|
|
|
+ // field: 'userId',
|
|
|
+ // title: '操作',
|
|
|
+ // width: '50px',
|
|
|
+ // formatter: function (v, row) {
|
|
|
+ // row.sense_id = 'select';
|
|
|
+ // var ts = [];
|
|
|
+ // if (row.userType === 'A' || row.userType === 'C') {
|
|
|
+ // ts.push('<button class="btn btn-sm btn-default" onclick=\'userEdit(' + JSON.stringify(row) + ')\'>编辑</button>');
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // ts.push('<button class="btn btn-sm btn-dark" onclick="openIdDelete(\'' + row.userId + '\')">删除</button>');
|
|
|
+ // }
|
|
|
+ // return ts.join('\n');
|
|
|
+ // }
|
|
|
+ // }, {
|
|
|
+ // field: 'loginName',
|
|
|
+ // title: '登录名'
|
|
|
+ // }, {
|
|
|
+ // field: 'staffName',
|
|
|
+ // title: '员工姓名'
|
|
|
+ // }, {
|
|
|
+ // field: 'phone',
|
|
|
+ // title: '手机'
|
|
|
+ // }, {
|
|
|
+ // field: 'placeName',
|
|
|
+ // title: '场地名称'
|
|
|
+ // }, {
|
|
|
+ // field: 'userType',
|
|
|
+ // title: '角色',
|
|
|
+ // formatter: function (v, row) {
|
|
|
+ // if (v === 'A') {
|
|
|
+ // return '管理员';
|
|
|
+ // } else if (v === 'C') {
|
|
|
+ // return '收银员';
|
|
|
+ // } else if (v === '1') {
|
|
|
+ // return '一级分销';
|
|
|
+ // } else if (v === '2') {
|
|
|
+ // return '二级分销';
|
|
|
+ // }
|
|
|
+ // return v;
|
|
|
+ // }
|
|
|
+ // }, {
|
|
|
+ // field: 'beActive',
|
|
|
+ // title: '状态',
|
|
|
+ // formatter: function (v, row) {
|
|
|
+ // var ts = [];
|
|
|
+ // if (row.userType === 'A' || row.userType === 'C') {
|
|
|
+ // if (row.beActive === 'Y') {
|
|
|
+ // ts.push('<button class="btn btn-sm btn-default" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>启用中</button>');
|
|
|
+ // } else if (row.beActive === 'N') {
|
|
|
+ // ts.push('<button class="btn btn-sm btn-dark" onclick=\'userDisable(' + JSON.stringify(row) + ')\'>已禁用</button>');
|
|
|
+ // }
|
|
|
+ // return ts.join('\n');
|
|
|
+ // }
|
|
|
+ // return '启用中';
|
|
|
+ // }
|
|
|
+ // }, {
|
|
|
+ // field: 'loginCount',
|
|
|
+ // title: '登录次数'
|
|
|
+ // }
|
|
|
+ // ]
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
function getPlaceAndRole() {
|
|
|
- $.ajax({
|
|
|
- url: '/admin/get_place_role.json',
|
|
|
- contentType: "application/json; charset=utf-8",
|
|
|
- type: 'get',
|
|
|
- success: function (data) {
|
|
|
- if (data.success) {
|
|
|
-
|
|
|
- $('#placeId').empty();
|
|
|
- $('#placeId').append($('<option value="">请选择</option>'));
|
|
|
-
|
|
|
- data.data.place.forEach(function (p) {
|
|
|
- $('#placeId').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
|
|
|
- });
|
|
|
-
|
|
|
- $('#placeId1').empty();
|
|
|
- $('#placeId1').append($('<option value="">请选择</option>'));
|
|
|
-
|
|
|
- data.data.place.forEach(function (p) {
|
|
|
- $('#placeId1').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
|
|
|
- });
|
|
|
-
|
|
|
- $('#userType').empty();
|
|
|
- $('#userType').append($('<option value="">请选择</option>'));
|
|
|
- data.data.role.forEach(function (p) {
|
|
|
- $('#userType').append($('<option value="' + p.role + '">' + p.roleName + '</option>'));
|
|
|
- });
|
|
|
-
|
|
|
- } else {
|
|
|
- layer.msg(data.msg);
|
|
|
- }
|
|
|
- },
|
|
|
- error: function () {
|
|
|
- layer.msg("网络异常");
|
|
|
- }
|
|
|
- });
|
|
|
+ // $.ajax({
|
|
|
+ // url: '/admin/get_place_role.json',
|
|
|
+ // contentType: "application/json; charset=utf-8",
|
|
|
+ // type: 'get',
|
|
|
+ // success: function (data) {
|
|
|
+ // if (data.success) {
|
|
|
+ //
|
|
|
+ // $('#placeId').empty();
|
|
|
+ // $('#placeId').append($('<option value="">请选择</option>'));
|
|
|
+ //
|
|
|
+ // data.data.place.forEach(function (p) {
|
|
|
+ // $('#placeId').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // $('#placeId1').empty();
|
|
|
+ // $('#placeId1').append($('<option value="">请选择</option>'));
|
|
|
+ //
|
|
|
+ // data.data.place.forEach(function (p) {
|
|
|
+ // $('#placeId1').append($('<option value="' + p.placeId + '">' + p.placeName + '</option>'));
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // $('#userType').empty();
|
|
|
+ // $('#userType').append($('<option value="">请选择</option>'));
|
|
|
+ // data.data.role.forEach(function (p) {
|
|
|
+ // $('#userType').append($('<option value="' + p.role + '">' + p.roleName + '</option>'));
|
|
|
+ // });
|
|
|
+ //
|
|
|
+ // } else {
|
|
|
+ // layer.msg(data.msg);
|
|
|
+ // }
|
|
|
+ // },
|
|
|
+ // error: function () {
|
|
|
+ // layer.msg("网络异常");
|
|
|
+ // }
|
|
|
+ // });
|
|
|
}
|
|
|
|
|
|
|