| | |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-CoreCmsPlanOrder-search"><i class="layui-icon layui-icon-search"></i>筛选</button> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-doBatchDelete"><i class="layui-icon layui-icon-add-circle"></i>批量锁单</button> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-selectchakan"><i class="layui-icon layui-icon-add-circle"></i>批量查看</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="upIndexPopupWindowImageUrlBtn">上传计划订单</button> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button> |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button> |
| | |
| | | var checkStatus = table.checkStatus("LAY-app-CoreCmsPlanOrder-tableBox"); |
| | | doSelectExportExcel(checkStatus); |
| | | }); |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-selectchakan)', |
| | | function (data) { |
| | | var checkStatus = table.checkStatus("LAY-app-CoreCmsPlanOrder-tableBox"); |
| | | doSelectselectchakan(checkStatus); |
| | | }); |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-doBatchDelete)', |
| | | function (data) { |
| | |
| | | text: {none: '暂无相关数据'}, |
| | | cols: [ |
| | | [ |
| | | { type: "checkbox", fixed: "left" }, |
| | | { type: "checkbox" }, |
| | | { field: 'zizeng', width: 50, title: '序号', type: 'numbers' }, |
| | | { field: 'orderId', title: '订单号', sort: false,width: 135 }, |
| | | { field: 'shi', title: '市', sort: false, width: 50 }, |
| | | { field: 'quxian', title: '区县', sort: false, width: 50 }, |
| | | { field: 'pianqu', title: '片区', sort: false, width: 115 }, |
| | | { field: 'pianqu', title: '片区', sort: false, width: 65 }, |
| | | /* { field: 'userId', title: '用户ID 关联user.id', sort: false,width: 105 },*/ |
| | | { field: 'shipAddress', title: '学校', sort: false, width: 135 }, |
| | | { field: 'shipName', title: '联系人', sort: false,width: 55 }, |
| | | { field: 'shipMobile', title: '联系电话', sort: false, width: 115 }, |
| | | { field: 'shouhuoAddress', title: '收货地址', sort: false, width: 265 }, |
| | | { field: 'shouhuoAddress', title: '收货地址', sort: false, width: 165 }, |
| | | { field: 'oldOrderAmount', title: '计划金额', sort: false, width: 75 }, |
| | | { field: 'orderAmount', title: '调整金额', sort: false, width: 75 }, |
| | | { field: 'keYongAmount', title: '可用余额', sort: false, width: 75 }, |
| | | { field: 'keYongAmount', title: '可用余额', sort: false, width: 65 }, |
| | | { field: 'createTime', title: '建立时间', width: 95, sort: false}, |
| | | { field: 'upDataTime', title: '修改时间', width: 95, sort: false}, |
| | | //{ field: 'createBy', title: '创建人', sort: false,width: 105 }, |
| | | //{ field: 'upDataBy', title: '修改人', sort: false,width: 105 }, |
| | | //{ field: 'isdelete', title: '删除标志', width: 95, templet: '#switch_isdelete', sort: false , unresize: true}, |
| | | { field: 'statusText', title: '订单状态', sort: false, width: 65 }, |
| | | { width: 222, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' } |
| | | { field: 'statusText', title: '订单状态', sort: false, width: 55 }, |
| | | { width: 222, align: 'center', title:'操作', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' } |
| | | ] |
| | | ] |
| | | ], done: function (res, curr, count) { |
| | | |
| | | console.log(res); |
| | | // 创建合计行的HTML |
| | | var totalRowHtml = '<tr class="layui-table-total" style="background-color: #f2f2f2; font-weight: bold;">\ |
| | | <td></td><td></td><td colspan="8">当页合计</td><td> '+ res.otherData.heji1 + '</td><td> ' + res.otherData.heji2 + '</td><td> ' + res.otherData.heji3 + '</td><td></td><td></td><td></td><td></td>\ |
| | | </tr>\ |
| | | <tr class="layui-table-total" style="background-color: #e9e9e9; font-weight: bold;">\ |
| | | <td></td><td></td><td colspan="8">总合计</td><td> '+ res.otherData.heji4 + '</td><td> ' + res.otherData.heji5 + '</td><td> ' + res.otherData.heji6 + '</td><td></td><td></td><td></td><td></td>\ |
| | | </tr>'; |
| | | |
| | | // 将合计行添加到表格底部 |
| | | $('#LAY-app-CoreCmsPlanOrder-tableBox').next().find('.layui-table-body tbody').append(totalRowHtml); |
| | | } |
| | | }); |
| | | //监听排序事件 |
| | | table.on('sort(LAY-app-CoreCmsPlanOrder-tableBox)', function(obj){ |
| | |
| | | } |
| | | //执行单个删除 |
| | | function doDelete(obj) { |
| | | if (obj.data.status == 2) { |
| | | layer.msg("已经锁单!"); |
| | | return; |
| | | } |
| | | layer.confirm('确定锁单吗?', |
| | | function (index) { |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoDelete", { id: obj.data.orderId }, function (e) { |
| | |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | //执行选择目录导出数据 |
| | | function doSelectselectchakan(checkStatus) { |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length === 0) { |
| | | return layer.msg('请选择您要查看的数据'); |
| | | } |
| | | var delidsStr = []; |
| | | layui.each(checkData, |
| | | function (index, item) { |
| | | delidsStr.push(item.orderId); |
| | | }); |
| | | |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/Selectselectchakan", { id: delidsStr }, function (e) { |
| | | if (e.code === 0) { |
| | | admin.popup({ |
| | | shadeClose: false, |
| | | title: '查看详情', |
| | | area: ['1200px', '90%'], |
| | | id: 'LAY-popup-CoreCmsPlanOrder-details', |
| | | success: function (layero, index) { |
| | | view(this.id).render('CoreCmsPlanOrder/Selectselectchakan', { data: e.data }).done(function () { |
| | | form.render(); |
| | | }); |
| | | // 禁止弹窗出现滚动条 |
| | | /* $(layero).children('.layui-layer-content').css('overflow', 'visible');*/ |
| | | } |
| | | }); |
| | | } else { |
| | | layer.msg(e.msg); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //执行选择目录导出数据 |
| | | function doSelectExportExcel(checkStatus){ |
| | | var checkData = checkStatus.data; |