SeeMerchantAuthInfo.js 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730
  1. var ExcelData, ExcelKind;
  2. function ConfirmImport() {
  3. var index = layer.load(1, {
  4. shade: [0.5, '#000']
  5. });
  6. $.ajax({
  7. type: "POST",
  8. url: "/Admin/StoreHouse/Import?r=" + Math.random(1),
  9. data: "Kind=" + ExcelKind + "&ExcelData=" + encodeURIComponent(JSON.stringify(ExcelData)),
  10. dataType: "text",
  11. success: function (data) {
  12. layer.close(index);
  13. if (data.indexOf("success") == 0) {
  14. layer.msg("成功操作" + data.split('|')[1] + "部机具", {
  15. time: 2000
  16. }, function () {
  17. window.location.reload();
  18. });
  19. } else {
  20. layer.msg(data);
  21. }
  22. }
  23. });
  24. }
  25. function CheckImport(table, key, loadindex, index) {
  26. $.ajax({
  27. url: "/Admin/StoreHouse/CheckImportV2?r=" + Math.random(1),
  28. data: "key=" + key,
  29. dataType: "json",
  30. success: function (data) {
  31. if (data.status == 1) {
  32. layer.msg("成功操作" + data.data + "部机具", {
  33. time: 2000
  34. }, function () {
  35. layer.close(index); //关闭弹层
  36. layer.close(loadindex);
  37. table.reload('LAY-list-manage'); //数据刷新
  38. });
  39. } else if (data.status == 2) {
  40. layer.close(index); //关闭弹层
  41. layer.close(loadindex);
  42. var content = '';
  43. for (var i = 0; i < data.errList.length; i++) {
  44. content += data.errList[i] + '<br/>'
  45. }
  46. layer.alert(content);
  47. } else {
  48. layer.msg(data.data, {
  49. time: 1000
  50. }, function () {
  51. CheckImport(table, key, loadindex, index);
  52. });
  53. }
  54. }
  55. });
  56. }
  57. var excel;
  58. layui.config({
  59. base: '/layuiadmin/' //静态资源所在路径
  60. }).extend({
  61. myexcel: 'layui/lay/modules/excel',
  62. index: 'lib/index' //主入口模块
  63. }).use(['index', 'table', 'excel', 'laydate'], function () {
  64. var $ = layui.$,
  65. form = layui.form,
  66. table = layui.table;
  67. //- 筛选条件-日期
  68. var laydate = layui.laydate;
  69. var layCreateDate = laydate.render({
  70. elem: '#CreateDate',
  71. type: 'date',
  72. range: true,
  73. trigger: 'click',
  74. change: function (value, date, endDate) {
  75. var op = true;
  76. if (date.year == endDate.year && endDate.month - date.month <= 1) {
  77. if (endDate.month - date.month == 1 && endDate.date > date.date) {
  78. op = false;
  79. layCreateDate.hint('日期范围请不要超过1个月');
  80. setTimeout(function () {
  81. $(".laydate-btns-confirm").addClass("laydate-disabled");
  82. }, 1);
  83. }
  84. } else {
  85. op = false;
  86. layCreateDate.hint('日期范围请不要超过1个月');
  87. setTimeout(function () {
  88. $(".laydate-btns-confirm").addClass("laydate-disabled");
  89. }, 1);
  90. }
  91. if (op) {
  92. $('#CreateDate').val(value);
  93. }
  94. }
  95. });
  96. //excel导入
  97. excel = layui.excel;
  98. $('#ExcelFile').change(function (e) {
  99. var files = e.target.files;
  100. excel.importExcel(files, {}, function (data) {
  101. ExcelData = data[0].Sheet1;
  102. });
  103. });
  104. //监听单元格编辑
  105. table.on('edit(LAY-list-manage)', function (obj) {
  106. var value = obj.value //得到修改后的值
  107. ,
  108. data = obj.data //得到所在行所有键值
  109. ,
  110. field = obj.field; //得到字段
  111. if (field == "Sort") {
  112. $.ajax({
  113. type: "POST",
  114. url: "/Admin/StoreHouse/Sort?r=" + Math.random(1),
  115. data: "Id=" + data.Id + "&Sort=" + value,
  116. dataType: "text",
  117. success: function (data) { }
  118. });
  119. }
  120. });
  121. //列表数据
  122. table.render({
  123. elem: '#LAY-list-manage'
  124. , url: '/Admin/SysTools/SeeMerchantAuthInfoDo' //模拟接口
  125. , cols: [[
  126. { type: 'checkbox', fixed: 'left' }
  127. , { field: 'Name', width: 200, title: '商户姓名', sort: true }
  128. , { field: 'Mobile', width: 200, title: '商户手机号', sort: true }
  129. , { field: 'IdcardNo', width: 200, title: '商户身份证号', sort: true }
  130. // , { field: 'IsRegist', width: 200, title: '是否已注册', sort: true }
  131. , { field: 'IsAuth', width: 200, title: '是否已认证', sort: true }
  132. , { field: 'Count', width: 200, title: '已关联机具数', sort: true }
  133. ]]
  134. , where: {
  135. }
  136. , page: true
  137. , limit: 30
  138. , height: 'full-' + String($('.layui-card-header').height() + 130)
  139. , text: '对不起,加载出现异常!'
  140. , done: function (res, curr, count) {
  141. $(".layui-none").text("无数据");
  142. }
  143. });
  144. $('.layui-btn').on('click', function () {
  145. var type = $(this).data('type');
  146. active[type] ? active[type].call(this) : '';
  147. });
  148. //监听工具条
  149. table.on('tool(LAY-list-manage)', function (obj) {
  150. var data = obj.data;
  151. if (obj.event === 'del') {
  152. var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
  153. $.ajax({
  154. type: "POST",
  155. url: "/Admin/StoreHouse/Delete?r=" + Math.random(1),
  156. data: "Id=" + data.Id,
  157. dataType: "text",
  158. success: function (data) {
  159. if (data == "success") {
  160. obj.del();
  161. layer.close(index);
  162. } else {
  163. parent.layer.msg(data);
  164. }
  165. }
  166. });
  167. });
  168. } else if (obj.event === 'sycn') {
  169. var index = layer.confirm('确定要同步该仓库的库存数据吗?', function (index) {
  170. layer.close(index);
  171. var loadindex = layer.load(1, {
  172. shade: [0.5, '#000']
  173. });
  174. $.ajax({
  175. type: "POST",
  176. url: "/Admin/StoreHouse/SycnData?r=" + Math.random(1),
  177. data: "Id=" + data.Id,
  178. dataType: "text",
  179. success: function (data) {
  180. layer.close(loadindex);
  181. if (data == "success") {
  182. layer.msg('同步成功');
  183. table.reload('LAY-list-manage');
  184. } else {
  185. layer.msg(data);
  186. }
  187. }
  188. });
  189. });
  190. } else if (obj.event === 'edit') {
  191. var tr = $(obj.tr);
  192. var perContent = layer.open({
  193. type: 2,
  194. title: '仓库-编辑',
  195. content: 'Edit?Id=' + data.Id + '',
  196. maxmin: true,
  197. area: ['800px', '650px'],
  198. btn: ['确定', '取消'],
  199. yes: function (index, layero) {
  200. var iframeWindow = window['layui-layer-iframe' + index],
  201. submitID = 'LAY-list-front-submit',
  202. submit = layero.find('iframe').contents().find('#' + submitID);
  203. setTimeout(function () {
  204. layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
  205. var errObj = $(this).find('.layui-form-danger');
  206. if (errObj.length > 0) {
  207. iframeWindow.element.tabChange('mytabbar', String(i + 1));
  208. submit.click();
  209. }
  210. });
  211. }, 300);
  212. //监听提交
  213. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  214. var field = data.field; //获取提交的字段
  215. var userdata = "";
  216. for (var prop in field) {
  217. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  218. }
  219. //提交 Ajax 成功后,静态更新表格中的数据
  220. //$.ajax({});
  221. $.ajax({
  222. type: "POST",
  223. url: "/Admin/StoreHouse/Edit?r=" + Math.random(1),
  224. data: userdata,
  225. dataType: "text",
  226. success: function (data) {
  227. if (data == "success") {
  228. layer.close(index); //关闭弹层
  229. table.reload('LAY-list-manage'); //数据刷新
  230. } else {
  231. layer.msg(data);
  232. }
  233. }
  234. });
  235. });
  236. submit.trigger('click');
  237. },
  238. success: function (layero, index) {
  239. }
  240. });
  241. } else if (obj.event === 'edits') {
  242. var tr = $(obj.tr);
  243. var perContent = layer.open({
  244. type: 2,
  245. title: '一键新建仓库',
  246. content: 'Edits?Id=' + data.Id + '',
  247. maxmin: true,
  248. area: ['860px', '650px'],
  249. btn: ['确定', '取消'],
  250. yes: function (index, layero) {
  251. var iframeWindow = window['layui-layer-iframe' + index],
  252. submitID = 'LAY-list-front-submit',
  253. submit = layero.find('iframe').contents().find('#' + submitID);
  254. setTimeout(function () {
  255. layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
  256. var errObj = $(this).find('.layui-form-danger');
  257. if (errObj.length > 0) {
  258. iframeWindow.element.tabChange('mytabbar', String(i + 1));
  259. submit.click();
  260. }
  261. });
  262. }, 300);
  263. //监听提交
  264. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  265. var field = data.field; //获取提交的字段
  266. var userdata = "";
  267. for (var prop in field) {
  268. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  269. }
  270. //提交 Ajax 成功后,静态更新表格中的数据
  271. //$.ajax({});
  272. $.ajax({
  273. type: "POST",
  274. url: "/Admin/StoreHouse/Edits?r=" + Math.random(1),
  275. data: userdata,
  276. dataType: "text",
  277. success: function (data) {
  278. if (data == "success") {
  279. layer.close(index); //关闭弹层
  280. table.reload('LAY-list-manage'); //数据刷新
  281. } else {
  282. layer.msg(data);
  283. }
  284. }
  285. });
  286. });
  287. submit.trigger('click');
  288. },
  289. success: function (layero, index) {
  290. }
  291. });
  292. }
  293. });
  294. //监听搜索
  295. form.on('submit(LAY-list-front-search)', function (data) {
  296. var field = data.field;
  297. //执行重载
  298. table.reload('LAY-list-manage', {
  299. where: field,
  300. page: {
  301. curr: 1
  302. }
  303. });
  304. });
  305. form.on('submit(LAY-list-front-searchall)', function (data) {
  306. table.reload('LAY-list-manage', {
  307. where: null,
  308. page: {
  309. curr: 1
  310. }
  311. });
  312. });
  313. //事件
  314. var active = {
  315. batchdel: function () {
  316. var checkStatus = table.checkStatus('LAY-list-manage'),
  317. data = checkStatus.data; //得到选中的数据
  318. if (data.length < 1) {
  319. parent.layer.msg("请选择要删除的项");
  320. } else {
  321. var ids = "";
  322. $.each(data, function (index, value) {
  323. ids += data[index].Id + ",";
  324. });
  325. ids = ids.substring(0, ids.length - 1);
  326. var index = layer.confirm('确定要删除吗?删除后不能恢复!', function (index) {
  327. $.ajax({
  328. type: "POST",
  329. url: "/Admin/StoreHouse/Delete?r=" + Math.random(1),
  330. data: "Id=" + ids,
  331. dataType: "text",
  332. success: function (data) {
  333. layer.close(index);
  334. if (data == "success") {
  335. table.reload('LAY-list-manage');
  336. } else {
  337. layer.msg(data);
  338. }
  339. }
  340. });
  341. });
  342. }
  343. },
  344. add: function () {
  345. var perContent = layer.open({
  346. type: 2,
  347. title: '仓库-添加',
  348. content: 'Add',
  349. maxmin: true,
  350. area: ['950px', '650px'],
  351. btn: ['确定', '取消'],
  352. yes: function (index, layero) {
  353. var iframeWindow = window['layui-layer-iframe' + index],
  354. submitID = 'LAY-list-front-submit',
  355. submit = layero.find('iframe').contents().find('#' + submitID);
  356. setTimeout(function () {
  357. layero.find('iframe').contents().find('.layui-tab-item').each(function (i) {
  358. var errObj = $(this).find('.layui-form-danger');
  359. if (errObj.length > 0) {
  360. iframeWindow.element.tabChange('mytabbar', String(i + 1));
  361. submit.click();
  362. }
  363. });
  364. }, 300);
  365. //监听提交
  366. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  367. var field = data.field; //获取提交的字段
  368. var userdata = "";
  369. for (var prop in field) {
  370. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  371. }
  372. //提交 Ajax 成功后,静态更新表格中的数据
  373. //$.ajax({});
  374. $.ajax({
  375. type: "POST",
  376. url: "/Admin/StoreHouse/Add?r=" + Math.random(1),
  377. data: userdata,
  378. dataType: "text",
  379. success: function (data) {
  380. if (data == "success") {
  381. layer.close(index); //关闭弹层
  382. table.reload('LAY-list-manage'); //数据刷新
  383. } else {
  384. layer.msg(data);
  385. }
  386. }
  387. });
  388. });
  389. submit.trigger('click');
  390. }
  391. });
  392. },
  393. ImportMachine: function () {
  394. var perContent = layer.open({
  395. type: 2,
  396. title: '机具入库',
  397. content: 'Import?ExcelKind=1',
  398. maxmin: true,
  399. area: ['650px', '350px'],
  400. btn: ['确定', '取消'],
  401. yes: function (index, layero) {
  402. var iframeWindow = window['layui-layer-iframe' + index],
  403. submitID = 'LAY-list-front-submit',
  404. submit = layero.find('iframe').contents().find('#' + submitID);
  405. //监听提交
  406. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  407. var field = data.field; //获取提交的字段
  408. var userdata = "";
  409. for (var prop in field) {
  410. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  411. }
  412. //提交 Ajax 成功后,静态更新表格中的数据
  413. //$.ajax({});
  414. var loadindex = layer.load(1, {
  415. shade: [0.5, '#000']
  416. });
  417. $.ajax({
  418. type: "POST",
  419. url: "/Admin/StoreHouse/ImportPost?r=" + Math.random(1),
  420. data: userdata,
  421. dataType: "text",
  422. success: function (data) {
  423. if (data.indexOf("success") == 0) {
  424. var datalist = data.split('|');
  425. var key = datalist[1];
  426. CheckImport(table, key, loadindex, index);
  427. } else {
  428. layer.msg(data);
  429. }
  430. }
  431. });
  432. });
  433. submit.trigger('click');
  434. }
  435. });
  436. },
  437. ImportChange: function () {
  438. var perContent = layer.open({
  439. type: 2,
  440. title: '仓库调拨',
  441. content: 'Import?ExcelKind=2',
  442. maxmin: true,
  443. area: ['650px', '350px'],
  444. btn: ['确定', '取消'],
  445. yes: function (index, layero) {
  446. var iframeWindow = window['layui-layer-iframe' + index],
  447. submitID = 'LAY-list-front-submit',
  448. submit = layero.find('iframe').contents().find('#' + submitID);
  449. //监听提交
  450. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  451. var field = data.field; //获取提交的字段
  452. var userdata = "";
  453. for (var prop in field) {
  454. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  455. }
  456. //提交 Ajax 成功后,静态更新表格中的数据
  457. //$.ajax({});
  458. var loadindex = layer.load(1, {
  459. shade: [0.5, '#000']
  460. });
  461. $.ajax({
  462. type: "POST",
  463. url: "/Admin/StoreHouse/ImportPost?r=" + Math.random(1),
  464. data: userdata,
  465. dataType: "text",
  466. success: function (data) {
  467. if (data.indexOf("success") == 0) {
  468. var datalist = data.split('|');
  469. var key = datalist[1];
  470. CheckImport(table, key, loadindex, index);
  471. } else {
  472. layer.msg(data);
  473. }
  474. }
  475. });
  476. });
  477. submit.trigger('click');
  478. }
  479. });
  480. },
  481. ImportSend: function () {
  482. var perContent = layer.open({
  483. type: 2,
  484. title: '仓库发货至创客',
  485. content: 'Import?ExcelKind=3',
  486. maxmin: true,
  487. area: ['650px', '350px'],
  488. btn: ['确定', '取消'],
  489. yes: function (index, layero) {
  490. var iframeWindow = window['layui-layer-iframe' + index],
  491. submitID = 'LAY-list-front-submit',
  492. submit = layero.find('iframe').contents().find('#' + submitID);
  493. //监听提交
  494. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  495. var field = data.field; //获取提交的字段
  496. var userdata = "";
  497. for (var prop in field) {
  498. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  499. }
  500. //提交 Ajax 成功后,静态更新表格中的数据
  501. //$.ajax({});
  502. var loadindex = layer.load(1, {
  503. shade: [0.5, '#000']
  504. });
  505. $.ajax({
  506. type: "POST",
  507. url: "/Admin/StoreHouse/ImportPost?r=" + Math.random(1),
  508. data: userdata,
  509. dataType: "text",
  510. success: function (data) {
  511. if (data.indexOf("success") == 0) {
  512. var datalist = data.split('|');
  513. var key = datalist[1];
  514. CheckImport(table, key, loadindex, index);
  515. } else {
  516. layer.msg(data);
  517. }
  518. }
  519. });
  520. });
  521. submit.trigger('click');
  522. }
  523. });
  524. },
  525. ImportBack: function () {
  526. var perContent = layer.open({
  527. type: 2,
  528. title: '机具回仓库',
  529. content: 'Import?ExcelKind=4',
  530. maxmin: true,
  531. area: ['650px', '350px'],
  532. btn: ['确定', '取消'],
  533. yes: function (index, layero) {
  534. var iframeWindow = window['layui-layer-iframe' + index],
  535. submitID = 'LAY-list-front-submit',
  536. submit = layero.find('iframe').contents().find('#' + submitID);
  537. //监听提交
  538. iframeWindow.layui.form.on('submit(' + submitID + ')', function (data) {
  539. var field = data.field; //获取提交的字段
  540. var userdata = "";
  541. for (var prop in field) {
  542. userdata += prop + "=" + encodeURIComponent(field[prop]) + "&";
  543. }
  544. //提交 Ajax 成功后,静态更新表格中的数据
  545. //$.ajax({});
  546. var loadindex = layer.load(1, {
  547. shade: [0.5, '#000']
  548. });
  549. $.ajax({
  550. type: "POST",
  551. url: "/Admin/StoreHouse/ImportPost?r=" + Math.random(1),
  552. data: userdata,
  553. dataType: "text",
  554. success: function (data) {
  555. if (data.indexOf("success") == 0) {
  556. var datalist = data.split('|');
  557. var key = datalist[1];
  558. CheckImport(table, key, loadindex, index);
  559. } else {
  560. layer.msg(data);
  561. }
  562. }
  563. });
  564. });
  565. submit.trigger('click');
  566. }
  567. });
  568. },
  569. ExportExcel: function () {
  570. var userdata = '';
  571. $(".layuiadmin-card-header-auto input").each(function (i) {
  572. userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
  573. });
  574. $(".layuiadmin-card-header-auto select").each(function (i) {
  575. userdata += $(this).attr('name') + '=' + encodeURIComponent($(this).val()) + '&';
  576. });
  577. $.ajax({
  578. type: "GET",
  579. url: "/Admin/StoreHouse/ExportExcel?r=" + Math.random(1),
  580. data: userdata,
  581. dataType: "json",
  582. success: function (data) {
  583. data.Obj.unshift(data.Fields);
  584. excel.exportExcel(data.Obj, data.Info, 'xlsx');
  585. }
  586. });
  587. },
  588. Open: function () {
  589. var checkStatus = table.checkStatus('LAY-list-manage'),
  590. data = checkStatus.data; //得到选中的数据
  591. if (data.length < 1) {
  592. parent.layer.msg("请选择要开启的项");
  593. } else {
  594. var ids = "";
  595. $.each(data, function (index, value) {
  596. ids += data[index].Id + ",";
  597. });
  598. ids = ids.substring(0, ids.length - 1);
  599. var index = layer.confirm('确定要开启吗?', function (index) {
  600. $.ajax({
  601. type: "POST",
  602. url: "/Admin/StoreHouse/Open?r=" + Math.random(1),
  603. data: "Id=" + ids,
  604. dataType: "text",
  605. success: function (data) {
  606. layer.close(index);
  607. if (data == "success") {
  608. table.reload('LAY-list-manage');
  609. } else {
  610. layer.msg(data);
  611. }
  612. }
  613. });
  614. });
  615. }
  616. },
  617. Close: function () {
  618. var checkStatus = table.checkStatus('LAY-list-manage'),
  619. data = checkStatus.data; //得到选中的数据
  620. if (data.length < 1) {
  621. parent.layer.msg("请选择要关闭的项");
  622. } else {
  623. var ids = "";
  624. $.each(data, function (index, value) {
  625. ids += data[index].Id + ",";
  626. });
  627. ids = ids.substring(0, ids.length - 1);
  628. var index = layer.confirm('确定要关闭吗?', function (index) {
  629. $.ajax({
  630. type: "POST",
  631. url: "/Admin/StoreHouse/Close?r=" + Math.random(1),
  632. data: "Id=" + ids,
  633. dataType: "text",
  634. success: function (data) {
  635. layer.close(index);
  636. if (data == "success") {
  637. table.reload('LAY-list-manage');
  638. } else {
  639. layer.msg(data);
  640. }
  641. }
  642. });
  643. });
  644. }
  645. },
  646. SycnData: function () {
  647. var index = layer.confirm('确定要同步所有仓库的库存数据吗?', function (index) {
  648. layer.close(index);
  649. var loadindex = layer.load(1, {
  650. shade: [0.5, '#000']
  651. });
  652. $.ajax({
  653. type: "POST",
  654. url: "/Admin/StoreHouse/SycnData?r=" + Math.random(1),
  655. data: "Id=0",
  656. dataType: "text",
  657. success: function (data) {
  658. layer.close(loadindex);
  659. if (data == "success") {
  660. layer.msg('同步成功');
  661. table.reload('LAY-list-manage');
  662. } else {
  663. layer.msg(data);
  664. }
  665. }
  666. });
  667. });
  668. },
  669. };
  670. $('.layui-btn').on('click', function () {
  671. var type = $(this).data('type');
  672. active[type] ? active[type].call(this) : '';
  673. });
  674. });