| | |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:add" lay-event="productQuestionAdd">手动新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:aiAdd" lay-event="productQuestionAiAdd">AI新增</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:aiAdd" lay-event="productQuestionStateOpen">启用</button> |
| | | <button class="layui-btn layui-btn-sm layui-btn-primary febs-button-green-plain" shiro:hasPermission="productQuestionList:aiAdd" lay-event="productQuestionStateClose">禁用</button> |
| | | </div> |
| | | </script> |
| | | |
| | |
| | | } |
| | | }); |
| | | } |
| | | if (layEvent === 'productQuestionStateOpen') { |
| | | var checkData = table.checkStatus('productQuestionTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择'); |
| | | return; |
| | | } |
| | | febs.modal.confirm('状态', '启用?', function () { |
| | | var ids = []; |
| | | layui.each(checkData, function (key, item) { |
| | | ids.push(item.id) |
| | | }); |
| | | productQuestionStateUpdate(ids.join(','), 1); |
| | | }); |
| | | } |
| | | if (layEvent === 'productQuestionStateClose') { |
| | | |
| | | var checkData = table.checkStatus('productQuestionTable').data; |
| | | if (checkData.length <= 0) { |
| | | febs.alert.warn('请选择'); |
| | | return; |
| | | } |
| | | febs.modal.confirm('状态', '禁用?', function () { |
| | | var ids = []; |
| | | layui.each(checkData, function (key, item) { |
| | | ids.push(item.id) |
| | | }); |
| | | productQuestionStateUpdate(ids.join(','), 0); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | | function productQuestionStateUpdate(ids, type) { |
| | | febs.post(ctx + 'admin/productQuestion/stateUpdate/' + type + "/"+ ids, null, function () { |
| | | febs.alert.success('操作成功'); |
| | | }); |
| | | } |
| | | |
| | | function initProductQuestionTable() { |
| | | tableIns = febs.table.init({ |
| | | elem: $view.find('table'), |