| | |
| | | <input type="text" name="orderAmount" placeholder="请输入调整订单金额" class="layui-input"> |
| | | </div> |
| | | </div>--> |
| | | |
| | | |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="status">订单状态</label> |
| | | <div class="layui-input-inline"> |
| | | <select name="status"> |
| | | <option value="">请选择</option> |
| | | <option value="1">未提交</option> |
| | | <option value="2">已提交</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-input-inline"> |
| | | <select name="status"> |
| | | <option value="">请选择</option> |
| | | <option value="1">未锁单</option> |
| | | <option value="2">已锁单</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <!--<div class="layui-inline"> |
| | | <label class="layui-form-label" for="userId">用户ID 关联user.id</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="userId" placeholder="请输入用户ID 关联user.id" class="layui-input"> |
| | | </div> |
| | | </div>--> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="shi">市</label> |
| | | <div class="layui-input-inline"> |
| | | <!--<input type="text" name="shi" placeholder="请输入市" class="layui-input">--> |
| | | |
| | | <select name="shi" id="shi" lay-filter="cityFilter" > |
| | | <option value="0">请选择</option> |
| | | {{# layui.each(indexData, function(index, item){ }} |
| | | <option value="{{ item.id }}">{{ item.name }}</option> |
| | | {{# }); }} |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="quxian">区县</label> |
| | | <div class="layui-input-inline"> |
| | | <!--<input type="text" name="quxian" placeholder="请输入区县" class="layui-input">--> |
| | | <select name="quxian" id="quxian" lay-filter="quxian"> |
| | | |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="shipAddress">学校</label> |
| | | <div class="layui-input-inline"> |
| | |
| | | <label class="layui-form-label" for="shipMobile">联系电话</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="shipMobile" placeholder="请输入联系电话" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label" for="shouhuoAddress">收货地址</label> |
| | | <div class="layui-input-inline"> |
| | | <input type="text" name="shouhuoAddress" placeholder="收货地址" class="layui-input"> |
| | | </div> |
| | | </div> |
| | | <!--<div class="layui-inline"> |
| | |
| | | </div>--> |
| | | <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> |
| | | <a class="layui-btn layui-btn-sm" href="/static/jihuageshi/上传计划订单.xlsx">上传模板</a> |
| | | |
| | | <button class="layui-btn layui-btn-sm" lay-submit lay-filter="LAY-app-DeldoBatchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="LAY-app-CoreCmsPlanOrder-pagebar"> |
| | | |
| | | <div class="layui-btn-container"> |
| | | <!--<button class="layui-btn layui-btn-sm" lay-event="addData"><i class="layui-icon layui-icon-add-1"></i>添加数据</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>--> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="upIndexPopupWindowImageUrlBtn">上传计划订单</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="batchDelete"><i class="layui-icon layui-icon-delete"></i>批量删除</button>--> |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" id="upIndexPopupWindowImageUrlBtn">上传计划订单</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="selectExportExcel"><i class="layui-icon layui-icon-add-circle"></i>选择导出</button> |
| | | <button class="layui-btn layui-btn-sm" lay-event="queryExportExcel"><i class="layui-icon layui-icon-download-circle"></i>查询导出</button> |
| | | <a class="layui-btn layui-btn-sm" href="/static/jihuageshi/上传计划订单.xlsx" >上传模板</a> |
| | | <a class="layui-btn layui-btn-sm" href="/static/jihuageshi/上传计划订单.xlsx" >上传模板</a>--> |
| | | </div> |
| | | </script> |
| | | |
| | | <script type="text/html" id="LAY-app-CoreCmsPlanOrder-tableBox-bar"> |
| | | <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="detail">查看</a> |
| | | <!--<a class="layui-btn layui-btn-xs" lay-event="edit">编辑</a> |
| | | <a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsPlanOrderTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a>--> |
| | | <a class="layui-btn layui-btn-xs" lay-event="edit">修改</a> |
| | | <a class="layui-btn layui-btn-xs" lay-event="del">锁单</a> |
| | | <a class="layui-btn layui-btn-xs" lay-event="deldel">删除</a> |
| | | <!--<a class="layui-btn layui-btn-danger layui-btn-xs" data-dropdown="#CoreCmsPlanOrderTbDelDrop{{d.LAY_INDEX}}" no-shade="true">删除</a> |
| | | <div class="dropdown-menu-nav dropdown-popconfirm dropdown-top-right layui-hide" id="CoreCmsPlanOrderTbDelDrop{{d.LAY_INDEX}}" |
| | | style="max-width: 200px;white-space: normal;min-width: auto;margin-left: 10px;"> |
| | | <div class="dropdown-anchor"></div> |
| | |
| | | <a class="layui-btn layui-btn-primary cursor" btn-cancel>取消</a> |
| | | <a class="layui-btn layui-btn-normal cursor" lay-event="del">确定</a> |
| | | </div> |
| | | </div> |
| | | </div>--> |
| | | </script> |
| | | |
| | | <script> |
| | | |
| | | var indexData; |
| | | var debug= layui.setter.debug; |
| | | layui.data.done = function (d) { |
| | |
| | | //执行重载 |
| | | table.reloadData('LAY-app-CoreCmsPlanOrder-tableBox',{ where: field }); |
| | | }); |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-selectExportExcel)', |
| | | function (data) { |
| | | 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) { |
| | | var checkStatus = table.checkStatus("LAY-app-CoreCmsPlanOrder-tableBox"); |
| | | doBatchDelete(checkStatus); |
| | | }); |
| | | |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-DeldoBatchDelete)', |
| | | function (data) { |
| | | var checkStatus = table.checkStatus("LAY-app-CoreCmsPlanOrder-tableBox"); |
| | | doBatchDeleteDel(checkStatus); |
| | | }); |
| | | |
| | | |
| | | //监听搜索 |
| | | form.on('submit(LAY-app-queryExportExcel)', |
| | | function (data) { |
| | | doQueryExportexcel(); |
| | | }); |
| | | // 监听提交事件 |
| | | form.on('select(cityFilter)', function (data) { |
| | | var city = $("#shi").val(); |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: layui.setter.apiUrl + 'Api/CoreCmsPlanOrder/GetAreaId?cityid=' + city, |
| | | dataType: "json", |
| | | global: false, |
| | | data: "", |
| | | success: function (data) { |
| | | console.log(data.data); |
| | | var quxian = $("#quxian"); |
| | | quxian.find('option').remove(); |
| | | var aaa = '<option value="0">请选择</option>'; |
| | | quxian.append(aaa); |
| | | if (data.data.length > 0) { |
| | | for (var i = 0; i < data.data.length; i++) { |
| | | |
| | | var o = '<option value="' + data.data[i].id + '" >' + data.data[i].name + '</option>'; |
| | | quxian.append(o); |
| | | } |
| | | // 使用form.render方法重新渲染select |
| | | form.render('select'); |
| | | } |
| | | }, |
| | | error: function () { |
| | | |
| | | |
| | | parent.layer.msg('失败', { icon: 5 }); |
| | | } |
| | | }); |
| | | }); |
| | | //数据绑定 |
| | | table.render({ |
| | | elem: '#LAY-app-CoreCmsPlanOrder-tableBox', |
| | |
| | | cols: [ |
| | | [ |
| | | { type: "checkbox", fixed: "left" }, |
| | | { field: 'orderId', title: '订单号', sort: false,width: 115 }, |
| | | |
| | | |
| | | { 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: 'userId', title: '用户ID 关联user.id', sort: false,width: 105 },*/ |
| | | { field: 'shipAddress', title: '学校', sort: false,width: 335 }, |
| | | { field: 'shipName', title: '联系人', sort: false,width: 115 }, |
| | | { field: 'shipMobile', title: '联系电话', sort: false,width: 115 }, |
| | | { field: 'oldOrderAmount', title: '计划金额', sort: false, width: 115 }, |
| | | { field: 'orderAmount', title: '调整金额', sort: false, width: 115 }, |
| | | { field: 'keYongAmount', title: '可用余额', sort: false,width: 115 }, |
| | | { field: 'createTime', title: '建立时间', width: 140, sort: false}, |
| | | { field: 'upDataTime', title: '修改时间', width: 140, sort: false}, |
| | | { 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: 'oldOrderAmount', title: '计划金额', sort: false, width: 75 }, |
| | | { field: 'orderAmount', title: '调整金额', sort: false, width: 75 }, |
| | | { field: 'keYongAmount', title: '可用余额', sort: false, width: 75 }, |
| | | { 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: 115 }, |
| | | { width: 172, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' } |
| | | { field: 'statusText', title: '订单状态', sort: false, width: 65 }, |
| | | { width: 222, align: 'center', title:'操作', fixed: 'right', toolbar: '#LAY-app-CoreCmsPlanOrder-tableBox-bar' } |
| | | ] |
| | | ] |
| | | }); |
| | |
| | | doDelete(obj); |
| | | } else if (obj.event === 'edit') { |
| | | doEdit(obj) |
| | | } |
| | | } else if (obj.event === 'deldel') { |
| | | doDeletedel(obj); |
| | | } |
| | | }); |
| | | //执行创建操作 |
| | | function doCreate(){ |
| | |
| | | } |
| | | //执行编辑操作 |
| | | function doEdit(obj){ |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/GetEdit", {id:obj.data.id}, function (e) { |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/GetEdit", { id: obj.data.orderId }, function (e) { |
| | | if (e.code === 0) { |
| | | admin.popup({ |
| | | shadeClose: false, |
| | |
| | | area: ['1200px', '90%'], |
| | | id: 'LAY-popup-CoreCmsPlanOrder-edit', |
| | | success: function (layero, index) { |
| | | view(this.id).render('base/CoreCmsPlanOrder/edit', { data: e.data }).done(function () { |
| | | view(this.id).render('CoreCmsPlanOrder/edit', { data: e.data }).done(function () { |
| | | //监听提交 |
| | | form.on('submit(LAY-app-CoreCmsPlanOrder-editForm-submit)', |
| | | function(data) { |
| | | var field = data.field; //获取提交的字段 |
| | | |
| | | field.isdelete = field.isdelete == 'on'; |
| | | |
| | | //field.isdelete = field.isdelete == 'on'; |
| | | delete field["itemNumarray"]; |
| | | var newarray = Array(); |
| | | for (v = 0; v < $("input[name='itemNumarray']").size(); v++) { |
| | | newarray.push($("input[name='itemNumarray']:eq("+v+")").val()) |
| | | } |
| | | field["itemNumarray"] = newarray; |
| | | |
| | | |
| | | delete field["itemIdarray"]; |
| | | var newarray = Array(); |
| | | for (v = 0; v < $("input[name='itemIdarray']").size(); v++) { |
| | | newarray.push($("input[name='itemIdarray']:eq(" + v + ")").val()) |
| | | } |
| | | field["itemIdarray"] = newarray; |
| | | |
| | | |
| | | if (debug) { console.log(field); } //开启调试返回数据 |
| | | console.log(field); |
| | | //提交 Ajax 成功后,关闭当前弹层并重载表格 |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoEdit", field, function (e) { |
| | | console.log(e) |
| | |
| | | }); |
| | | }) |
| | | // 禁止弹窗出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | /* $(layero).children('.layui-layer-content').css('overflow', 'visible');*/ |
| | | } |
| | | , btn: ['确定', '取消'] |
| | | , yes: function (index, layero) { |
| | |
| | | form.render(); |
| | | }); |
| | | // 禁止弹窗出现滚动条 |
| | | $(layero).children('.layui-layer-content').css('overflow', 'visible'); |
| | | /* $(layero).children('.layui-layer-content').css('overflow', 'visible');*/ |
| | | } |
| | | }); |
| | | } else { |
| | |
| | | }); |
| | | } |
| | | //执行单个删除 |
| | | function doDelete(obj){ |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoDelete", { id: obj.data.id }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | table.reloadData('LAY-app-CoreCmsPlanOrder-tableBox'); |
| | | layer.msg(e.msg); |
| | | function doDelete(obj) { |
| | | layer.confirm('确定锁单吗?', |
| | | function (index) { |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoDelete", { id: obj.data.orderId }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | table.reloadData('LAY-app-CoreCmsPlanOrder-tableBox'); |
| | | layer.msg(e.msg); |
| | | }); |
| | | }); |
| | | |
| | | } |
| | | //执行单个删除 |
| | | function doDeletedel(obj) { |
| | | layer.confirm('确定删除吗?', |
| | | function (index) { |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoDeletedel", { id: obj.data.orderId }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | table.reloadData('LAY-app-CoreCmsPlanOrder-tableBox'); |
| | | layer.msg(e.msg); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | |
| | | //执行批量删除 |
| | | function doBatchDelete(checkStatus){ |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length === 0) { |
| | | return layer.msg('请选择要删除的数据'); |
| | | return layer.msg('请选择要锁单的数据'); |
| | | } |
| | | layer.confirm('确定删除吗?删除后将无法恢复。', |
| | | layer.confirm('确定锁单吗?锁单后将无法修改。', |
| | | function(index) { |
| | | var delidsStr = []; |
| | | layui.each(checkData, |
| | | function(index, item) { |
| | | delidsStr.push(item.id); |
| | | delidsStr.push(item.orderId); |
| | | }); |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoBatchDelete", { id: delidsStr }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | |
| | | layer.msg(e.msg); |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | //执行批量删除 |
| | | function doBatchDeleteDel(checkStatus) { |
| | | var checkData = checkStatus.data; |
| | | if (checkData.length === 0) { |
| | | return layer.msg('请选择要删除的数据'); |
| | | } |
| | | layer.confirm('确定删除吗?', |
| | | function (index) { |
| | | var delidsStr = []; |
| | | layui.each(checkData, |
| | | function (index, item) { |
| | | delidsStr.push(item.orderId); |
| | | }); |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/DoBatchDeletedel", { id: delidsStr }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | table.reloadData('LAY-app-CoreCmsPlanOrder-tableBox'); |
| | | layer.msg(e.msg); |
| | | }); |
| | | }); |
| | | } |
| | | |
| | | //执行查询条件导出excel |
| | | function doQueryExportexcel(){ |
| | | layer.confirm('确定根据当前的查询条件导出数据吗?', |
| | |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | } |
| | | |
| | | |
| | | //执行选择目录导出数据 |
| | | 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; |
| | |
| | | var delidsStr = []; |
| | | layui.each(checkData, |
| | | function(index, item) { |
| | | delidsStr.push(item.id); |
| | | delidsStr.push(item.orderId); |
| | | }); |
| | | layer.close(index); |
| | | coreHelper.Post("Api/CoreCmsPlanOrder/SelectExportExcel", { id: delidsStr }, function (e) { |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | if (debug) { console.log(e); } //开启调试返回数据 |
| | | if (e.code === 0) { |
| | | window.open(e.data); |
| | | } else { |
| | |
| | | form.render(); |
| | | }); |
| | | }; |
| | | |
| | | |
| | | |
| | | |
| | | </script> |
| | | |
| | | <!--设置删除标志--> |