2024-11-04 15:00:20 +08:00
|
|
|
|
define(['jquery', 'bootstrap', 'backend', 'table', 'form'], function ($, undefined, Backend, Table, Form) {
|
|
|
|
|
|
|
|
|
|
var Controller = {
|
|
|
|
|
index: function () {
|
|
|
|
|
// 初始化表格参数配置
|
|
|
|
|
Table.api.init({
|
|
|
|
|
extend: {
|
|
|
|
|
index_url: 'manystore/index/index',
|
|
|
|
|
add_url: 'manystore/index/add',
|
|
|
|
|
edit_url: 'manystore/index/edit',
|
|
|
|
|
del_url: 'manystore/index/del',
|
2024-11-18 19:01:04 +08:00
|
|
|
|
free_url: 'manystore/index/free',
|
2024-11-04 15:00:20 +08:00
|
|
|
|
multi_url: 'manystore/index/multi',
|
|
|
|
|
}
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
var table = $("#table");
|
|
|
|
|
|
|
|
|
|
// 初始化表格
|
|
|
|
|
table.bootstrapTable({
|
|
|
|
|
url: $.fn.bootstrapTable.defaults.extend.index_url,
|
2024-11-16 18:01:16 +08:00
|
|
|
|
pk: 'id',
|
|
|
|
|
fixedColumns: true,
|
|
|
|
|
fixedRightNumber: 1,
|
2024-11-04 15:00:20 +08:00
|
|
|
|
columns: [
|
|
|
|
|
[
|
2024-11-16 18:01:16 +08:00
|
|
|
|
{checkbox: true},
|
2024-11-26 17:59:18 +08:00
|
|
|
|
{field: 'operate', title: __('Operate'),width:980, table: table , buttons: [
|
2024-11-18 19:01:04 +08:00
|
|
|
|
{name: 'free',
|
|
|
|
|
text: '免登录进入机构后台',
|
|
|
|
|
icon: 'fa fa-sign-in',
|
|
|
|
|
classname: 'btn btn-xs btn-warning btn-magic btn-ajax',
|
|
|
|
|
url: $.fn.bootstrapTable.defaults.extend.free_url,
|
|
|
|
|
confirm: '确认免登录进入机构后台?如果已登录其他机构,对方账号将被强制退出。',
|
|
|
|
|
success: function (data, ret) {
|
|
|
|
|
Layer.alert(ret.msg );
|
|
|
|
|
$(".btn-refresh").trigger("click");
|
|
|
|
|
//js获取当前域名
|
|
|
|
|
|
|
|
|
|
|
2024-11-20 18:05:45 +08:00
|
|
|
|
window.open(shop_backend_url, '_blank');
|
2024-11-18 19:01:04 +08:00
|
|
|
|
},
|
|
|
|
|
error: function (data, ret) {
|
|
|
|
|
Layer.alert(ret.msg);
|
|
|
|
|
return false;
|
|
|
|
|
},
|
|
|
|
|
visible: function (row) {
|
|
|
|
|
//显示条件 只能待入住订单
|
|
|
|
|
// if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "1" ){
|
|
|
|
|
return true;
|
|
|
|
|
// }
|
|
|
|
|
// return false;
|
|
|
|
|
}},
|
|
|
|
|
{
|
|
|
|
|
name: 'classes_spec',
|
|
|
|
|
text: __('机构课程'),
|
|
|
|
|
title: __('机构课程'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: classes_spec_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
{
|
|
|
|
|
name: 'teacher',
|
|
|
|
|
text: __('主讲老师信息'),
|
|
|
|
|
title: __('主讲老师信息'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: teacher_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'verification',
|
|
|
|
|
text: __('核销员信息'),
|
|
|
|
|
title: __('核销员信息'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: verification_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
name: 'virtual_user',
|
|
|
|
|
text: __('机构虚拟参与者'),
|
|
|
|
|
title: __('机构虚拟参与者'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: virtual_user_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
2024-11-20 18:05:45 +08:00
|
|
|
|
{
|
|
|
|
|
name: 'order',
|
2024-11-21 18:03:23 +08:00
|
|
|
|
text: __('机构课程购买订单'),
|
|
|
|
|
title: __('机构课程购买订单'),
|
2024-11-20 18:05:45 +08:00
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: order_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
2024-11-21 18:03:23 +08:00
|
|
|
|
{
|
|
|
|
|
name: 'hourorder',
|
|
|
|
|
text: __('机构课时预约记录'),
|
|
|
|
|
title: __('机构课时预约记录'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: hourorder_url,
|
|
|
|
|
callback: function (data) {
|
|
|
|
|
|
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
2024-11-26 17:59:18 +08:00
|
|
|
|
{
|
|
|
|
|
name: 'user_auth',
|
|
|
|
|
text: __('机构授权用户'),
|
|
|
|
|
title: __('机构授权用户'),
|
|
|
|
|
classname: 'btn btn-xs btn-primary btn-dialog',
|
|
|
|
|
icon: 'fa fa-list',
|
|
|
|
|
url: user_auth_url,
|
|
|
|
|
callback: function (data) {
|
2024-11-18 19:01:04 +08:00
|
|
|
|
|
2024-11-26 17:59:18 +08:00
|
|
|
|
},
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// return row.status == '2'||row.status == '3';
|
|
|
|
|
// }
|
|
|
|
|
},
|
2024-11-18 19:01:04 +08:00
|
|
|
|
//
|
|
|
|
|
// {name: 'unsetmockauth',
|
|
|
|
|
// text: '取消加圈资格',
|
|
|
|
|
// icon: 'fa fa-sign-in',
|
|
|
|
|
// classname: 'btn btn-xs btn-danger btn-magic btn-ajax',
|
|
|
|
|
// url: $.fn.bootstrapTable.defaults.extend.unsetmockauth_url,
|
|
|
|
|
// confirm: '(分车版本)确认取消用户加圈资格!',
|
|
|
|
|
// success: function (data, ret) {
|
|
|
|
|
// Layer.alert(ret.msg );
|
|
|
|
|
// $(".btn-refresh").trigger("click");
|
|
|
|
|
// },
|
|
|
|
|
// error: function (data, ret) {
|
|
|
|
|
// Layer.alert(ret.msg);
|
|
|
|
|
// return false;
|
|
|
|
|
// },
|
|
|
|
|
// visible: function (row) {
|
|
|
|
|
// //显示条件 只能待入住订单
|
|
|
|
|
// if((row.status == 2 || row.status == 3) && row.mock_type == "base" && row.add_mock_status == "2"){
|
|
|
|
|
// return true;
|
|
|
|
|
// }
|
|
|
|
|
// return false;
|
|
|
|
|
// }},
|
|
|
|
|
|
|
|
|
|
], events: Table.api.events.operate, formatter: Table.api.formatter.operate},
|
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
{field: 'id', title: 'ID'},
|
2024-11-16 18:01:16 +08:00
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
{field: 'username', title: __('Username')},
|
|
|
|
|
{field: 'nickname', title: __('Nickname')},
|
|
|
|
|
{field: 'email', title: __('Email')},
|
|
|
|
|
{field: 'status', title: __("Status"), formatter: Table.api.formatter.status},
|
2024-11-16 18:01:16 +08:00
|
|
|
|
{field: 'shop.status', title: __('Auth_status'), searchList: {"0":__('Auth_status 0'),"1":__('Auth_status 1'),"2":__('Auth_status 2')}, formatter: Table.api.formatter.status},
|
2024-11-21 18:03:23 +08:00
|
|
|
|
{field: 'user_id', title: __('User_id')},
|
2024-11-16 18:01:16 +08:00
|
|
|
|
{field: 'shop.type', title: __('Type'), searchList: {"1":__('Type 1'),"2":__('Type 2')}, formatter: Table.api.formatter.normal},
|
|
|
|
|
|
|
|
|
|
{field: 'user.nickname', title: __('User.nickname'), operate: 'LIKE'},
|
|
|
|
|
{field: 'user.mobile', title: __('User.mobile'), operate: 'LIKE'},
|
|
|
|
|
{field: 'user.avatar', title: __('User.avatar'), operate: 'LIKE', events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
|
|
|
|
|
|
|
|
2024-11-21 18:03:23 +08:00
|
|
|
|
// {field: 'user_id', title: __('申请姓名|机构名'), operate: 'LIKE'},
|
2024-11-16 18:01:16 +08:00
|
|
|
|
{field: 'shop.name', title: __('申请姓名|机构名'), operate: 'LIKE'},
|
|
|
|
|
{field: 'shop.logo', title: __('Logo'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
|
|
{field: 'shop.image', title: __('Image'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
|
|
{field: 'shop.address_city', title: __('Address_city'), operate: 'LIKE', table: table, class: 'autocontent', formatter: Table.api.formatter.content},
|
|
|
|
|
{field: 'shop.province', title: __('Province'),visible:false},
|
|
|
|
|
{field: 'shop.city', title: __('City'),visible:false},
|
|
|
|
|
{field: 'shop.district', title: __('District'),visible:false},
|
|
|
|
|
{field: 'shop.address', title: __('Address'), operate: 'LIKE',visible:false},
|
|
|
|
|
{field: 'shop.address_detail', title: __('Address_detail'), operate: 'LIKE',visible:false},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{field: 'shop.yyzz_images', title: __('Yyzz_images'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.images},
|
|
|
|
|
{field: 'shop.front_idcard_image', title: __('身份证正面'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
|
|
{field: 'shop.reverse_idcard_image', title: __('身份证反面'), operate: false, events: Table.api.events.image, formatter: Table.api.formatter.image},
|
|
|
|
|
{field: 'shop.tel', title: __('Tel'), operate: 'LIKE'},
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
{field: 'logintime', title: __('Login time'), formatter: Table.api.formatter.datetime, operate: 'RANGE', addclass: 'datetimerange', sortable: true},
|
2024-11-16 18:01:16 +08:00
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
]
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
// 为表格绑定事件
|
|
|
|
|
Table.api.bindevent(table);
|
|
|
|
|
},
|
|
|
|
|
add: function () {
|
|
|
|
|
$("#c-address_city").on("cp:updated", function() {
|
|
|
|
|
var citypicker = $(this).data("citypicker");
|
|
|
|
|
var province = citypicker.getCode("province");
|
|
|
|
|
var city = citypicker.getCode("city");
|
|
|
|
|
var district = citypicker.getCode("district");
|
|
|
|
|
if(province){
|
|
|
|
|
$("#province").val(province);
|
|
|
|
|
}
|
|
|
|
|
if(city){
|
|
|
|
|
$("#city").val(city);
|
|
|
|
|
}
|
|
|
|
|
if(district){
|
|
|
|
|
$("#district").val(district);
|
|
|
|
|
}
|
|
|
|
|
$(this).blur();
|
|
|
|
|
});
|
2024-11-20 18:05:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.btn-changeuser', function (event) {
|
|
|
|
|
var url = $(this).attr('data-url');
|
|
|
|
|
if(!url) return false;
|
|
|
|
|
var title = $(this).attr('title');
|
|
|
|
|
var width = $(this).attr('data-width');
|
|
|
|
|
var height = $(this).attr('data-height');
|
|
|
|
|
// var ids = $(this).attr('data-id');
|
|
|
|
|
var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%'];
|
|
|
|
|
var options = {
|
|
|
|
|
shadeClose: false,
|
|
|
|
|
shade: [0.3, '#393D49'],
|
|
|
|
|
area: area,
|
|
|
|
|
callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
|
|
|
|
|
Fast.api.close(ret);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
Fast.api.open(url,title,options);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
|
|
},
|
|
|
|
|
edit: function () {
|
|
|
|
|
$("#c-address_city").on("cp:updated", function() {
|
|
|
|
|
var citypicker = $(this).data("citypicker");
|
|
|
|
|
var province = citypicker.getCode("province");
|
|
|
|
|
var city = citypicker.getCode("city");
|
|
|
|
|
var district = citypicker.getCode("district");
|
|
|
|
|
if(province){
|
|
|
|
|
$("#province").val(province);
|
|
|
|
|
}
|
|
|
|
|
if(city){
|
|
|
|
|
$("#city").val(city);
|
|
|
|
|
}
|
|
|
|
|
if(district){
|
|
|
|
|
$("#district").val(district);
|
|
|
|
|
}
|
|
|
|
|
});
|
2024-11-20 18:05:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$(document).on('click', '.btn-changeuser', function (event) {
|
|
|
|
|
var url = $(this).attr('data-url');
|
|
|
|
|
if(!url) return false;
|
|
|
|
|
var title = $(this).attr('title');
|
|
|
|
|
var width = $(this).attr('data-width');
|
|
|
|
|
var height = $(this).attr('data-height');
|
|
|
|
|
// var ids = $(this).attr('data-id');
|
|
|
|
|
var area = [$(window).width() > 800 ? (width?width:'800px') : '95%', $(window).height() > 600 ? (height?height:'600px') : '95%'];
|
|
|
|
|
var options = {
|
|
|
|
|
shadeClose: false,
|
|
|
|
|
shade: [0.3, '#393D49'],
|
|
|
|
|
area: area,
|
|
|
|
|
callback:function(ret){//回调方法,需要在本页面Controller中增加方法监听且调用Fast.api.close(ret)传递结果;
|
|
|
|
|
Fast.api.close(ret);
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
Fast.api.open(url,title,options);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
Form.api.bindevent($("form[role=form]"));
|
|
|
|
|
}
|
|
|
|
|
};
|
2024-11-18 19:01:04 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var classes_spec_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/classes_lib/index?shop_id='+row.shop_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
var virtual_user_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/virtual_user/index?shop_id='+row.shop_id;
|
|
|
|
|
}
|
|
|
|
|
var teacher_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/teacher/index?shop_id='+row.shop_id;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var verification_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/verification/index?shop_id='+row.shop_id;
|
|
|
|
|
}
|
2024-11-20 18:05:45 +08:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var order_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/order/order/index?shop_id='+row.id;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-21 18:03:23 +08:00
|
|
|
|
//hourorder_url
|
|
|
|
|
var hourorder_url = function (row,dom) {
|
|
|
|
|
return 'school/classes/hourorder/order/index?shop_id='+row.id;
|
|
|
|
|
}
|
2024-11-20 18:05:45 +08:00
|
|
|
|
|
2024-11-26 17:59:18 +08:00
|
|
|
|
var user_auth_url = function (row,dom) {
|
|
|
|
|
return 'manystore/user_auth/index?shop_id='+row.id;
|
|
|
|
|
}
|
|
|
|
|
|
2024-11-04 15:00:20 +08:00
|
|
|
|
return Controller;
|
|
|
|
|
});
|