123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071 |
- var ExcelData, ExcelKind;
- function ConfirmImport() {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Import?r=" + Math.random(1),
- data: "Kind=" + ExcelKind + "&ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
- dataType: "text",
- success: function (data) {
- if (data == "success") {
- layer.msg("导入成功", { time: 2000 }, function () {
- window.location.reload();
- });
- } else if (data.indexOf("warning") == 0) {
- var datalist = data.split('|');
- layer.alert(datalist[0], { time: 20000 }, function () {
- window.location.reload();
- });
- } else {
- layer.msg(data);
- }
- }
- });
- }
- layui.config({
- base: '/layuiadmin/' //静态资源所在路径
- }).extend({
- myexcel: 'layui/lay/modules/excel',
- index: 'lib/index' //主入口模块
- }).use(['index', 'table', 'excel', 'laydate'], function () {
- var $ = layui.$
- , form = layui.form
- , table = layui.table;
- //- 筛选条件-日期
- var laydate = layui.laydate;
- var layCreateDate = laydate.render({
- elem: '#CreateDate',
- type: 'date',
- range: true,
- trigger: 'click',
- change: function (value, date, endDate) {
- var op = true;
- if (date.year == endDate.year && endDate.month - date.month <= 1) {
- if (endDate.month - date.month == 1 && endDate.date > date.date) {
- op = false;
- layCreateDate.hint('日期范围请不要超过1个月');
- setTimeout(function () {
- $(".laydate-btns-confirm").addClass("laydate-disabled");
- }, 1);
- }
- } else {
- op = false;
- layCreateDate.hint('日期范围请不要超过1个月');
- setTimeout(function () {
- $(".laydate-btns-confirm").addClass("laydate-disabled");
- }, 1);
- }
- if (op) {
- $('#CreateDate').val(value);
- }
- }
- });
- //excel导入
- var excel = layui.excel;
- $('#ExcelFile').change(function (e) {
- var files = e.target.files;
- excel.importExcel(files, {}, function (data) {
- ExcelData = data[0].Sheet1;
- });
- });
- //监听单元格编辑
- table.on('edit(LAY-list-manage)', function (obj) {
- var value = obj.value //得到修改后的值
- , data = obj.data //得到所在行所有键值
- , field = obj.field; //得到字段
- if (field == "Sort") {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Sort?r=" + Math.random(1),
- data: "Id=" + data.Id + "&Sort=" + value,
- dataType: "text",
- success: function (data) {
- }
- });
- }
- });
- //列表数据
- table.render({
- elem: '#LAY-list-manage'
- , url: '/Admin/Users/IndexData' //模拟接口
- , cols: [[
- { type: 'checkbox', fixed: 'left' }
- , { field: 'Id', width: 100, title: 'ID', sort: true }
- , { field: 'MakerCode', width: 200, title: '创客编号', sort: true, templet: '#MakerCodeTpl' }
- , { field: 'RealName', width: 200, title: '创客姓名', sort: true }
- , { field: 'UserLevel', width: 200, title: '创客等级', sort: true }
- , { field: 'AgentAreas', width: 200, title: '展业地区', sort: true }
- , { field: 'SettleAmount', width: 200, title: '提现金额(元)', sort: true }
- , { field: 'FreezeAmount', width: 200, title: '冻结金额(元)', sort: true }
- , { field: 'CertId', width: 200, title: '身份证号', sort: true }
- , { field: 'Mobile', width: 200, title: '联系手机', sort: true }
- , { field: 'MerchantType', width: 200, title: '商户创客类型', sort: true }
- , { field: 'MerchantDate', width: 200, title: '成为商户创客时间', sort: true }
- , { field: 'ParentMakerCode', width: 200, title: '直属创客编号', sort: true }
- , { field: 'ParentRealName', width: 200, title: '直属创客名称', sort: true }
- , { field: 'TopMakerCode', width: 200, title: '顶级创客编号', sort: true }
- , { field: 'TopRealName', width: 200, title: '顶级创客名称', sort: true }
- , { field: 'AuthFlagName', width: 200, title: '实名状态', sort: true }
- , { field: 'RiskFlagName', width: 200, title: '风控状态', sort: true }
- , { field: 'CreateDate', width: 200, title: '注册时间', sort: true }
- , { title: '操作', width: 2000, align: 'left', toolbar: '#table-list-tools' }
- ]]
- , where: {
- SelfId: SelfId,
- ParentId: ParentId,
- MakerCode: MakerCode
- }
- , page: true
- , limit: 30
- , height: 'full-' + String($('.layui-card-header').height() + 130)
- , text: '对不起,加载出现异常!'
- , done: function (res, curr, count) {
- $(".layui-none").text("无数据");
- }
- });
- //监听工具条
- table.on('tool(LAY-list-manage)', function (obj) {
- var data = obj.data;
- if (obj.event === 'del') {
- var index = layer.confirm('是否确定注销' + data.MakerCode + ',' + data.RealName + '?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Delete?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- if (data == "success") {
- obj.del();
- layer.close(index);
- parent.layer.msg('已注销');
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'cancle') {
- var index = layer.confirm('是否确定注销' + data.MakerCode + ',' + data.RealName + '?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Cancel?r=" + Math.random(1),
- data: "UserId=" + data.Id,
- dataType: "text",
- success: function (data) {
- if (data == "success") {
- obj.del();
- layer.close(index);
- parent.layer.msg('已注销');
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'sycn') {
- var index = layer.confirm('确定要同步该创客的机具数吗?', function (index) {
- layer.close(index);
- var loadindex = layer.load(1, {
- shade: [0.5, '#000']
- });
- $.ajax({
- type: "POST",
- url: "/Admin/Users/SycnData?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(loadindex);
- if (data == "success") {
- layer.msg('同步成功');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'edit') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '服务商信息管理'
- , content: 'Edit?Id=' + data.Id
- , maxmin: true
- , area: ['500px', '550px']
- , btn: ['修改', '三要素验证', '四要素验证', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- setTimeout(function () {
- layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
- var errObj = $(this).find('.layui-form-danger');
- if (errObj.length > 0) {
- iframeWindow.element.tabChange('mytabbar', String(i + 1));
- submit.click();
- }
- });
- }, 300);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Edit?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("保存成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , btn2: function () {
- layer.msg('验证通过');
- return false;
- }
- , btn3: function () {
- layer.msg('验证通过');
- return false;
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'EditSettleAmount') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '修改结算金额'
- , content: 'EditSettleAmount?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '550px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/EditSettleAmount?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("保存成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'EditCashFreezeAmt') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '修改账户金额'
- , content: 'EditCashFreezeAmt?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '550px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/EditCashFreezeAmt?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("保存成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'EditBalance') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '账户操作'
- , content: 'EditBalance?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '600px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/EditBalance?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("保存成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'LockEnterpriseMaker') {
- var index = layer.confirm('是否确定取消' + data.MakerCode + ',' + data.RealName + '的企业账户权限?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/CloseEnterpriseMaker?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("已取消", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'EnterpriseMaker') {
- var index = layer.confirm('是否确定设置' + data.MakerCode + ',' + data.RealName + '的账号为企业账户权限?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/OpenEnterpriseMaker?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("设置成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'SetBigLeader') {
- var index = layer.confirm('是否确定设置' + data.MakerCode + ',' + data.RealName + '的账户为大盟主?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/SetBigLeader?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("设置成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'SetSmallLeader') {
- var index = layer.confirm('是否确定设置' + data.MakerCode + ',' + data.RealName + '的账号为小盟主?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/SetSmallLeader?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("设置成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'ChangeLeaderAmount') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '修改盟主金额'
- , content: 'ChangeLeaderAmount?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '550px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/ChangeLeaderAmount?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("修改成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'detail') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '创客详情'
- , content: 'Detail?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '500px']
- , btn: ['关闭']
- , yes: function (index, layero) {
- layer.close(index); //关闭弹层
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'Lock') {
- var index = layer.confirm('是否确定锁定' + data.MakerCode + ',' + data.RealName + '的账号,禁止他登录与提现?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Open?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("已锁定", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'UnLock') {
- var index = layer.confirm('是否确定恢复' + data.MakerCode + ',' + data.RealName + '的账号,恢复他登录?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Close?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("已解锁", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'Risk') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '风控'
- , content: 'Risk?Id=' + data.Id
- , maxmin: false
- , area: ['450px', '600px']
- , btn: ['保存', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Risk?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("保存成功", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- } else if (obj.event === 'UnRisk') {
- var index = layer.confirm('确定要解除风控吗?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/UnRisk?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.msg("已解除风控", { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'ResetPwd') {
- var index = layer.confirm('是否确定重置' + data.MakerCode + ',' + data.RealName + '的登录密码?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/ResetPwd?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(index); //关闭弹层
- if (data.indexOf("success|") > -1) {
- var datalist = data.split('|');
- layer.alert('密码重置为:' + datalist[1]);
- } else {
- parent.layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'sycnamount') {
- var index = layer.confirm('确定要重置该创客的小分仓额度吗?', function (index) {
- layer.close(index);
- var loadindex = layer.load(1, {
- shade: [0.5, '#000']
- });
- $.ajax({
- type: "POST",
- url: "/Admin/Users/SycnAmountData?r=" + Math.random(1),
- data: "Id=" + data.Id,
- dataType: "text",
- success: function (data) {
- layer.close(loadindex);
- if (data == "success") {
- layer.msg('重置成功');
- table.reload('LAY-list-manage');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- } else if (obj.event === 'sycntrade') {
- var tr = $(obj.tr);
- var perContent = layer.open({
- type: 2
- , title: '同步交易额'
- , content: 'SycnTradeAmount?Id=' + data.Id
- , maxmin: false
- , area: ['550px', '700px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- var loadindex = layer.load(1, {
- shade: [0.5, '#000']
- });
- $.ajax({
- type: "POST",
- url: "/Admin/Users/SycnTradeAmountDo?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- layer.close(loadindex); //关闭弹层
- layer.close(index); //关闭弹层
- if (data == "success") {
- layer.alert('重置程序已启动,请稍后核对创客交易额');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- }
- });
- //监听搜索
- form.on('submit(LAY-list-front-search)', function (data) {
- var field = data.field;
- field.ShowFlag = 1;
- if (field.MakerCode == "" && field.RealName == "" && field.ParentMakerCode == "" && field.ParentRealName == "" && field.Mobile == "" && field.CertId == "" && field.CreateDateData == "" && field.UserLevel == "" && field.AuthFlagSelect == "" && field.RiskFlagSelect == "" && field.MerchantTypeSelect == "") {
- layer.alert('请输入查询条件');
- }
- else {
- //执行重载
- table.reload('LAY-list-manage', {
- where: field
- });
- }
- });
- form.on('submit(LAY-list-front-searchall)', function (data) {
- table.reload('LAY-list-manage', {
- where: {
- SelfId: SelfId,
- ParentId: ParentId,
- MakerCode: MakerCode
- }
- });
- });
- //事件
- var active = {
- batchdel: function () {
- var checkStatus = table.checkStatus('LAY-list-manage')
- , data = checkStatus.data; //得到选中的数据
- if (data.length < 1) {
- parent.layer.msg("请选择要注销的项");
- } else {
- var ids = "";
- $.each(data, function (index, value) {
- ids += data[index].Id + ",";
- });
- ids = ids.substring(0, ids.length - 1);
- var index = layer.confirm('确定要注销吗?注销后不能恢复!', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Delete?r=" + Math.random(1),
- data: "Id=" + ids,
- dataType: "text",
- success: function (data) {
- layer.close(index);
- if (data == "success") {
- table.reload('LAY-list-manage');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- }
- }
- , add: function () {
- var perContent = layer.open({
- type: 2
- , title: '创客-添加'
- , content: 'Add'
- , maxmin: true
- , area: ['500px', '550px']
- , btn: ['确定', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- setTimeout(function () {
- layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
- var errObj = $(this).find('.layui-form-danger');
- if (errObj.length > 0) {
- iframeWindow.element.tabChange('mytabbar', String(i + 1));
- submit.click();
- }
- });
- }, 300);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Add?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- if (data == "success") {
- layer.close(index); //关闭弹层
- layer.msg('新增成功', { time: 1500 }, function () {
- table.reload('LAY-list-manage'); //数据刷新
- });
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- });
- }
- , ImportSettleAmount: function () {
- ExcelKind = 1;
- layer.open({
- type: 1,
- title: '导入',
- maxmin: false,
- area: ['460px', '280px'],
- content: $('#excelForm'),
- cancel: function () {
- }
- });
- $("#excelTemp").html('<a href="/users/批量修改提现结算金额模版.xlsx">点击下载批量修改提现结算金额模版</a>');
- }
- , ImportFreezeAmt: function () {
- ExcelKind = 2;
- layer.open({
- type: 1,
- title: '导入',
- maxmin: false,
- area: ['460px', '280px'],
- content: $('#excelForm'),
- cancel: function () {
- }
- });
- $("#excelTemp").html('<a href="/users/批量修改提现冻结金额模版.xlsx">点击下载批量修改提现冻结金额模版</a>');
- }
- , ImportRisk: function () {
- ExcelKind = 3;
- layer.open({
- type: 1,
- title: '导入',
- maxmin: false,
- area: ['460px', '280px'],
- content: $('#excelForm'),
- cancel: function () {
- }
- });
- $("#excelTemp").html('<a href="/users/提现风控模版.xlsx">点击下载提现风控模版</a>');
- }
- //new function 2022-05-24
- , ImportEditAmt: function () {
- ExcelKind = 4;
- layer.open({
- type: 1,
- title: '导入',
- maxmin: false,
- area: ['460px', '280px'],
- content: $('#excelForm'),
- cancel: function () {
- }
- });
- $("#excelTemp").html('<a href="/users/批量修改金额模版.xlsx">点击下载批量修改金额模版</a>');
- }
- , ExportExcel: function () {
- var userdata = '';
- $(".layuiadmin-card-header-auto input").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $(".layuiadmin-card-header-auto select").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $.ajax({
- type: "GET",
- url: "/Admin/Users/ExportExcel?r=" + Math.random(1),
- data: userdata,
- dataType: "json",
- success: function (data) {
- data.Obj.unshift(data.Fields);
- excel.exportExcel(data.Obj, data.Info, 'xlsx');
- }
- });
- }
- , ExportZSExcel: function () {
- var userdata = '';
- $(".layuiadmin-card-header-auto input").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $(".layuiadmin-card-header-auto select").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $.ajax({
- type: "GET",
- url: "/Admin/Users/ExportZSExcel?r=" + Math.random(1),
- data: userdata,
- dataType: "json",
- success: function (data) {
- data.Obj.unshift(data.Fields);
- excel.exportExcel(data.Obj, data.Info, 'xlsx');
- }
- });
- }
- , ExportSJExcel: function () {
- var userdata = '';
- $(".layuiadmin-card-header-auto input").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $(".layuiadmin-card-header-auto select").each(function (i) {
- userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
- });
- $.ajax({
- type: "GET",
- url: "/Admin/Users/ExportSJExcel?r=" + Math.random(1),
- data: userdata,
- dataType: "json",
- success: function (data) {
- data.Obj.unshift(data.Fields);
- excel.exportExcel(data.Obj, data.Info, 'xlsx');
- }
- });
- }
- , ThreeElement: function () {
- var perContent = layer.open({
- type: 2
- , title: '三/四要素验证'
- , content: 'ThreeElement'
- , maxmin: false
- , area: ['450px', '450px']
- , btn: ['验证', '取消']
- , yes: function (index, layero) {
- var iframeWindow = window['layui-layer-iframe' + index]
- , submitID = 'LAY-list-front-submit'
- , submit = layero.find('iframe').contents().find('#' + submitID);
- //监听提交
- iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
- var field = data.field; //获取提交的字段
- var userdata = "";
- for (var prop in field) {
- userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
- }
- //提交 Ajax 成功后,静态更新表格中的数据
- //$.ajax({});
- $.ajax({
- type: "POST",
- url: "/Admin/Users/ThreeElement?r=" + Math.random(1),
- data: userdata,
- dataType: "text",
- success: function (data) {
- if (data == "success") {
- layer.msg("验证通过");
- } else {
- layer.msg(data);
- }
- }
- });
- });
- submit.trigger('click');
- }
- , success: function (layero, index) {
- }
- });
- }
- , Open: function () {
- var checkStatus = table.checkStatus('LAY-list-manage')
- , data = checkStatus.data; //得到选中的数据
- if (data.length < 1) {
- parent.layer.msg("请选择要开启的项");
- } else {
- var ids = "";
- $.each(data, function (index, value) {
- ids += data[index].Id + ",";
- });
- ids = ids.substring(0, ids.length - 1);
- var index = layer.confirm('确定要开启吗?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Open?r=" + Math.random(1),
- data: "Id=" + ids,
- dataType: "text",
- success: function (data) {
- layer.close(index);
- if (data == "success") {
- table.reload('LAY-list-manage');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- }
- }
- , Close: function () {
- var checkStatus = table.checkStatus('LAY-list-manage')
- , data = checkStatus.data; //得到选中的数据
- if (data.length < 1) {
- parent.layer.msg("请选择要关闭的项");
- } else {
- var ids = "";
- $.each(data, function (index, value) {
- ids += data[index].Id + ",";
- });
- ids = ids.substring(0, ids.length - 1);
- var index = layer.confirm('确定要关闭吗?', function (index) {
- $.ajax({
- type: "POST",
- url: "/Admin/Users/Close?r=" + Math.random(1),
- data: "Id=" + ids,
- dataType: "text",
- success: function (data) {
- layer.close(index);
- if (data == "success") {
- table.reload('LAY-list-manage');
- } else {
- layer.msg(data);
- }
- }
- });
- });
- }
- }
- };
- $('.layui-btn').on('click', function () {
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
- });
|