| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料编码</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HShortNumber" id="HShortNumber"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料代码</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">产品名称</label> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HName" id="HName"> |
| | | </div> |
| | |
| | | <label class="layui-form-label">关闭状态</label> |
| | | <div class="layui-input-block"> |
| | | <select id="HClStatus" name="HClStatus" lay-filter=""> |
| | | <option value="">全部</option> |
| | | <option value="未关闭" selected="">未关闭</option> |
| | | <option value="" selected>全部</option> |
| | | <option value="未关闭">未关闭</option> |
| | | <option value="已关闭">已关闭</option> |
| | | </select> |
| | | </div> |
| | |
| | | <label class="layui-form-label">交货时间</label> |
| | | <div class="layui-input-block"> |
| | | <select id="Time" name="Time" lay-filter=""> |
| | | <option value="0" selected>全部</option> |
| | | <option value="1">一周内交货</option> |
| | | <option value="2">二周内交货</option> |
| | | <option value="3">一月内交货</option> |
| | |
| | | <option value="5">三月内交货</option> |
| | | <option value="6">半年内交货</option> |
| | | <option value="7">一年内交货</option> |
| | | <option value="8" selected="">长期交货</option> |
| | | <option value="8">长期交货</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">采购组织</label> |
| | | <div class="layui-input-block"> |
| | | <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter=""> |
| | | <option value="">组织1</option> |
| | | <option value="">组织2</option> |
| | | </select> |
| | | </div> |
| | | <select id="HPURCHASEORGID" name="HPURCHASEORGID" lay-filter=""> |
| | | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">是否已下推送货单</label> |
| | | <div class="layui-input-block"> |
| | | <select id="HISGenerate" name="HISGenerate" lay-filter=""> |
| | | <option value="全部">全部</option> |
| | | <option value="全部" selected>全部</option> |
| | | <option value="是">是</option> |
| | | <option value="否" selected="">否</option> |
| | | <option value="否">否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | <!--</div>--> |
| | |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-reload"><i class="layui-icon layui-icon-refresh"></i>刷新</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-confirm" id="btn_confirm"><i class="layui-icon layui-icon-ok-circle"></i>确认</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-back" id="btn_back"><i class="layui-icon layui-icon-close-fill"></i>驳回</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-report" id="btn_report"><i class="layui-icon layui-icon-close-fill"></i>汇报</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-barcode"><i class="layui-icon layui-icon-file"></i>生成条码</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button> |
| | | </div> |
| | |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () { |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , laydate = layui.laydate |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , laydate = layui.laydate |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | //常规用法 |
| | | laydate.render({ |
| | | elem: '#HDate1' |
| | |
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板 |
| | | , defaultToolbar: ['filter', 'exports', 'print'] |
| | | // , where: { msg: "", NowPage: 1, OnePage: 10 } |
| | | , cellMinWidth: 100 |
| | | , cols: [[ |
| | | //{ checkbox: true, fixed: true } |
| | | { type: 'checkbox', fixed: 'left' } |
| | | //{ type: 'radio', fixed: true } |
| | | , { field: 'sorderid', title: '序号', width: 80, fixed: true } |
| | | , { field: 'hmainid', title: 'hmainid', sort: true, fixed: true, hide: true } |
| | | , { field: 'hsubid', title: 'hsubid', sort: true, fixed: true, hide: true } |
| | | , { field: '状态', title: '状态', sort: true, fixed: true } |
| | | , { field: '单据号', title: '单据号', width: 180, sort: true, fixed: 'left' } |
| | | , { field: '日期', title: '日期', width: 180, sort: true, fixed: 'left' } |
| | | , { field: '供应商', title: '供应商', width: 180, sort: true, fixed: 'left' } |
| | | , { field: '计划跟踪单号', title: '计划跟踪单号', sort: true, hide: true } |
| | | , { field: '物料代码', title: '物料代码', width: 180, sort: true } |
| | | , { field: '物料名称', title: '物料名称', width: 180, sort: true } |
| | | , { field: '规格型号', title: '规格型号', width: 180, sort: true } |
| | | , { field: '计量单位', title: '计量单位', width: 80, sort: true } |
| | | , { field: '数量', title: '订货数量', sort: true } |
| | | , { field: '交货地点', title: '交货地点', sort: true } |
| | | , { field: '交货日期', title: '交货日期', width: 180, sort: true } |
| | | , { field: '关联数量', title: '关联数量', sort: true } |
| | | , { field: '未关联数量', title: '未关联数量', sort: true } |
| | | , { field: '剩余入库数量', title: '剩余入库数量', sort: true } |
| | | , { field: '剩余收料数量', title: '剩余收料数量', sort: true } |
| | | , { field: '关闭状态', title: '关闭状态', sort: true } |
| | | , { field: '变更状态', title: '变更状态', sort: true } |
| | | , { field: '采购组织', title: '采购组织', sort: true } |
| | | , { field: '确认人', title: '确认人', sort: true, hide: true } |
| | | , { field: '确认日期', title: '确认日期', sort: true, hide: true } |
| | | , { field: '驳回人', title: '驳回人', sort: true, hide: true } |
| | | , { field: '驳回日期', title: '驳回日期', sort: true, hide: true } |
| | | , { field: '驳回理由', title: '驳回理由', sort: true, hide: true } |
| | | ]] |
| | | , cellMinWidth: 100 |
| | | , cols: [[ |
| | | //{ checkbox: true, fixed: true } |
| | | { type: 'checkbox', fixed: 'left' } |
| | | //{ type: 'radio', fixed: true } |
| | | , { field: 'sorderid', title: '序号', width: 80/*, fixed: true */} |
| | | , { field: 'hmainid', title: 'hmainid', sort: true, /*fixed: true,*/ hide: true } |
| | | , { field: 'hsubid', title: 'hsubid', sort: true, /*fixed: true,*/ hide: true } |
| | | , { field: '状态', title: '状态', sort: true/*, fixed: true */} |
| | | , { field: '反馈状态', title: '反馈状态', width: 100/*, fixed: true */} |
| | | , { field: '优先级', title: '优先级', width: 100/*, fixed: true */} |
| | | , { field: '单据号', title: '单据号', width: 180, sort: true/*, fixed: 'left' */} |
| | | , { field: '日期', title: '日期', width: 180, sort: true/*, fixed: 'left' */} |
| | | , { field: 'HSupID', title: 'HSupID', width: 180, hide: true } |
| | | , { field: '供应商', title: '供应商', width: 180, sort: true/*, fixed: 'left' */} |
| | | , { field: '计划跟踪单号', title: '计划跟踪单号', sort: true, hide: true } |
| | | , { field: '物料编码', title: '物料编码', width: 120, sort: true } |
| | | , { field: '物料代码', title: '物料代码', width: 120, sort: true } |
| | | , { field: '物料名称', title: '物料名称', width: 120, sort: true } |
| | | , { field: '规格型号', title: '规格型号', width: 120, sort: true } |
| | | , { field: '计量单位', title: '计量单位', width: 80, sort: true } |
| | | , { field: '数量', title: '订货数量', sort: true } |
| | | , { field: '交货地点', title: '交货地点', sort: true } |
| | | , { field: '交货日期', title: '交货日期', width: 180, sort: true } |
| | | , { field: '关联数量', title: '关联数量', sort: true } |
| | | , { field: '未关联数量', title: '未关联数量', sort: true } |
| | | , { field: '剩余入库数量', title: '剩余入库数量', sort: true } |
| | | , { field: '剩余收料数量', title: '剩余收料数量', sort: true } |
| | | , { field: '关闭状态', title: '关闭状态', sort: true } |
| | | , { field: '变更状态', title: '变更状态', sort: true } |
| | | , { field: '采购组织', title: '采购组织', sort: true } |
| | | , { field: '确认人', title: '确认人', sort: true, hide: true } |
| | | , { field: '确认日期', title: '确认日期', sort: true, hide: true } |
| | | , { field: '驳回人', title: '驳回人', sort: true, hide: true } |
| | | , { field: '驳回日期', title: '驳回日期', sort: true, hide: true } |
| | | , { field: '驳回理由', title: '驳回理由', sort: true, hide: true } |
| | | ]] |
| | | //, skin: 'row' //表格风格 |
| | | // , even: true |
| | | , page: true //是否显示分页 |
| | | , limits: [10, 20, 50, 100] |
| | | , limit: 50 //每页默认显示的数量 |
| | | , page: true //是否显示分页 |
| | | , limits: [10, 20, 50, 100] |
| | | , limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function (res, curr, count) { |
| | | _cur_page = curr; |
| | | layer.closeAll("loading"); |
| | | } |
| | | , done: function (res, curr, count) { |
| | | _cur_page = curr; |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | |
| | | //头工具栏事件 |
| | |
| | | var data = checkStatus.data; |
| | | layer.alert(JSON.stringify(data)); |
| | | break; |
| | | //case 'getCheckLength': |
| | | // var data = checkStatus.data; |
| | | // layer.msg('选中了:' + data.length + ' 个'); |
| | | // break; |
| | | //case 'isAll': |
| | | // layer.msg(checkStatus.isAll ? '全选' : '未全选'); |
| | | // break; |
| | | //case 'getCheckLength': |
| | | // var data = checkStatus.data; |
| | | // layer.msg('选中了:' + data.length + ' 个'); |
| | | // break; |
| | | //case 'isAll': |
| | | // layer.msg(checkStatus.isAll ? '全选' : '未全选'); |
| | | // break; |
| | | |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | case 'btn-reload': |
| | | _cur_page = $(".layui-laypage-em").next().html(); |
| | | RoadHBillNo(sql); |
| | | break; |
| | | case 'btn-confirm': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | , data = checkStatus.data; |
| | | _cur_page = $(".layui-laypage-em").next().html(); |
| | | if (data[0]["状态"] == "未确认") { |
| | | layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) { |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"POOrderAccept", |
| | | url: GetWEBURL() + "POOrderAccept", |
| | | data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { // 说明验证成功了, |
| | |
| | | break; |
| | | case 'btn-back': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | , data = checkStatus.data; |
| | | _cur_page = $(".layui-laypage-em").next().html(); |
| | | var HBackRemark; |
| | | if (data[0]["状态"] == "未确认") { |
| | |
| | | HBackRemark = value.toString(); |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"POOrderRefuse", |
| | | url: GetWEBURL() + "POOrderRefuse", |
| | | data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"], "HBackRemark": HBackRemark }, |
| | | success: function (result) { |
| | | if (result.count == 1) { // 说明验证成功了, |
| | |
| | | break; |
| | | case 'btn-details': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | , data = checkStatus.data; |
| | | |
| | | var linterid = data[0].hmainid.toString(); |
| | | //if (AllowLoadData(sSubStr) != false) {//非空验证 |
| | |
| | | break; |
| | | case 'btn-generate': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | , data = checkStatus.data; |
| | | ajaxLabelData = data; |
| | | //根据选中的采购订单,重新从金蝶云同步采购订单关联数量过来。考虑采购订单删除和关闭状态,同步状态 |
| | | |
| | | |
| | | var rows = ''; |
| | | var HEntry = ''; |
| | | for (var i = 0; i < data.length; i++) { |
| | | if (data[i]["未关联数量"] == 0) { |
| | | layer.msg("单据号:" + data[i]["单据号"] + "已全部生成送货单!", { icon: 5 }); |
| | | return; |
| | | } |
| | | if (data[i]["状态"] == "已确认") { |
| | | rows += data[i].hmainid.toString() + ',' + data[i].hsubid.toString() + ';'; |
| | | } |
| | |
| | | HEntry = HEntry.substring(0, HEntry.length - 1); |
| | | layer.msg("第" + HEntry + "行未确认!", { icon: 5 }); |
| | | } |
| | | else{ |
| | | else { |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |
| | | , title: '送货单' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString() + '&lSourceBillType=1102', 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | } |
| | | break; |
| | | btn - barcode |
| | | case 'btn-barcode': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | //if (data[0].未生成条码数量 <= 0) { |
| | | // layer.msg("选中行已生成条码!", { icon: 5 }); |
| | | //} |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |
| | | , title: '送货单' |
| | | , title: '条码生成' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString() + '&lentryid=' + rows.toString() + '&lSourceBillType=1102', 'yes'] |
| | | , content: ['../../views/SRM/SRM_BarCodeBill.html?linterid=' + data[0].hmainid + '&lentryid=' + data[0].hsubid + '&type =SRM_POOrderBillList', 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | , cancel: function () { |
| | | $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | } |
| | | }) |
| | | } |
| | | break; |
| | | case 'btn-exit': |
| | | //var index = parent.layer.getFrameIndex(window.name); |
| | |
| | | parent.layui.admin.events.closeThisTabs(); |
| | | //parent.layer.close(index); |
| | | break; |
| | | case 'btn-report': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | _cur_page = $(".layui-laypage-em").next().html(); |
| | | var arr = new Array(); |
| | | var checkStatus = table.checkStatus('mainTable'), |
| | | data = checkStatus.data; |
| | | if (checkStatus.data.length == 0) { |
| | | return layer.msg('请选择数据'); |
| | | } |
| | | for (var i = 0; i < data.length; i++) { |
| | | arr.push(data[i].hmainid + '-' + data[i].hsubid); |
| | | } |
| | | var OrderBackId = ""; |
| | | layer.open({ |
| | | type: 2, |
| | | skin: 'layui-layer-rim', //加上边框 |
| | | title: '订单反馈状态', |
| | | closeBtn: 1, |
| | | shift: 2, |
| | | area: ['80%', '80%'], |
| | | maxmin: true, |
| | | content: ['../PublicPage/OrderBackInfomation.html', 'yes'], |
| | | btn: ['确定', '取消'] |
| | | , btn1: function (index, layero) { |
| | | |
| | | //按钮【按钮一】的回调 |
| | | var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面 |
| | | var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test" |
| | | if (checkStatus.data.length === 0) { |
| | | return layer.msg('请选择数据'); |
| | | } |
| | | OrderBackId = checkStatus.data[0].HItemID.toString(); |
| | | |
| | | $.ajax({ |
| | | url: GetWEBURL() + 'POOrderBack', |
| | | //url: 'http://localhost:8082/LuBaoAPI/' + 'POOrderBack', |
| | | async: false, |
| | | type: "GET", |
| | | dataType: "json", |
| | | data: { "HmainidList": arr.toString(), "OrderBackId": OrderBackId }, |
| | | success: function (data1) { |
| | | if (data1.Message.indexOf("成功") > 0) { |
| | | layer.msg("操作成功", { time: 3 * 1000, icon: 1 }, function () { |
| | | var index = layer.getFrameIndex(window.name); |
| | | //关闭当前frame |
| | | layer.close(index); |
| | | //修改为功后刷新界面 |
| | | window.location.reload(); |
| | | }); |
| | | } else { |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }, error: function (e) { |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }); |
| | | } |
| | | , btn2: function (index, layero) { |
| | | //按钮【按钮二】的回调 |
| | | //return false 开启该代码可禁止点击该按钮关闭 |
| | | }, |
| | | end: function () { |
| | | }, |
| | | success: function (layero, index) { |
| | | |
| | | } |
| | | }); |
| | | |
| | | //layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) { |
| | | // $.ajax({ |
| | | // type: "get", |
| | | // url: GetWEBURL() + "POOrderAccept", |
| | | // data: { "HInterID": data[0]["hmainid"].toString(), "HBillNo": data[0]["单据号"].toString(), "HUser": sessionStorage["HUserName"] }, |
| | | // success: function (result) { |
| | | // if (result.count == 1) { // 说明验证成功了, |
| | | // layer.msg(result.Message, { icon: 1 }); |
| | | // RoadHBillNo(sql); |
| | | // } |
| | | // else { |
| | | // // $("#verifycode").click(); |
| | | // layer.msg(result.Message, { icon: 5 }); |
| | | // } |
| | | // layer.closeAll("loading"); |
| | | // } |
| | | // }) |
| | | |
| | | // layer.close(index); |
| | | //}); |
| | | |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | |
| | | //渲染采购组织 |
| | | var Organization = '<option value=' + sessionStorage["OrganizationID"] + ' style="color:red;">' + sessionStorage["Organization"] + '</option>'; |
| | | $("#HPURCHASEORGID").append(Organization); |
| | | form.render('select'); |
| | | |
| | | ///加载显示数据 |
| | | function RoadHBillNo(sqlWhere) { |
| | | where = sqlWhere; |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"GetPOOrderBill", |
| | | url: GetWEBURL() + "GetPOOrderBill", |
| | | async: true, |
| | | data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere }, |
| | | success: function (result) { |
| | |
| | | sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^"; |
| | | if ($("#HBillNo").val() != "") |
| | | sqlWhere += " and 单据号 like ^^%" + $("#HBillNo").val() + "%^^"; |
| | | if ($("#HShortNumber").val() != "") |
| | | sqlWhere += " and 物料编码 like ^^%" + $("#HShortNumber").val() + "%^^"; |
| | | if ($("#HNumber").val() != "") |
| | | sqlWhere += " and 物料代码 like ^^%" + $("#HNumber").val() + "%^^"; |
| | | if ($("#HName").val() != "") |
| | |
| | | sqlWhere += " and 规格型号 like ^^%" + $("#HModel").val() + "%^^"; |
| | | if ($("#HClStatus").val() != "") |
| | | sqlWhere += " and 关闭状态 like ^^%" + $("#HClStatus").val() + "%^^"; |
| | | if ($("#HPURCHASEORGID").val() != "") |
| | | sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | //if ($("#HPURCHASEORGID").val() != "") |
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | if ($("#HDate1").val() != "") { |
| | | sqlWhere += " and 日期 >= ^^" + $("#HDate1").val() + "^^"; |
| | | } |
| | |
| | | sqlWhere += " and 日期 <= ^^" + $("#HDate2").val() + "^^"; |
| | | } |
| | | if ($("#HISGenerate").val() != "") { |
| | | if ($("#HISGenerate").val() == "是") |
| | | { |
| | | if ($("#HISGenerate").val() == "是") { |
| | | sqlWhere += " and 未关联数量 <= 0"; |
| | | } |
| | | else if ($("#HISGenerate").val() == "否") { |
| | | sqlWhere += " and 未关联数量 > 0"; |
| | | } |
| | | } |
| | | |
| | | |
| | | |
| | | var Time = $("#Time").val(); |
| | | var dd = new Date(); |
| | | var dt; |
| | | switch (Time) { |
| | | case 1: dd = new Date(dd.setDate(dd.getDate() + 7)); |
| | | case 2: dd = new Date(dd.setDate(dd.getDate() + 14)); |
| | | case 3: dd = new Date(dd.setMonth(dd.getMonth() + 1)); |
| | | case 4: dd = new Date(dd.setMonth(dd.getMonth() + 2)); |
| | | case 5: dd = new Date(dd.setMonth(dd.getMonth() + 3)); |
| | | case 6: dd = new Date(dd.setMonth(dd.getMonth() + 6)); |
| | | case 7: dd = new Date(dd.setMonth(dd.getMonth() + 12)); |
| | | default: dd = new Date(dd.setDate(dd.getDate())); |
| | | } |
| | | dt = dd.getFullYear().toString(); |
| | | if (dd.getMonth() + 1 < 10) { |
| | | dt = dt + "-0" + (dd.getMonth() + 1).toString(); |
| | | } |
| | | else { |
| | | dt = dt + "-0" + (dd.getMonth() + 1).toString(); |
| | | } |
| | | if (dd.getDate() < 10) { |
| | | dt = dt + "-0" + dd.getDate().toString(); |
| | | } |
| | | else { |
| | | dt = dt + "-" + dd.getDate().toString(); |
| | | } |
| | | if (Time != 8) { |
| | | sqlWhere += " and 交货日期 <= ^^" + dt + "^^"; |
| | | if (Time > 0) { |
| | | var dd = new Date(); |
| | | var dt; |
| | | switch (Time) { |
| | | case 1: dd = new Date(dd.setDate(dd.getDate() + 7)); |
| | | case 2: dd = new Date(dd.setDate(dd.getDate() + 14)); |
| | | case 3: dd = new Date(dd.setMonth(dd.getMonth() + 1)); |
| | | case 4: dd = new Date(dd.setMonth(dd.getMonth() + 2)); |
| | | case 5: dd = new Date(dd.setMonth(dd.getMonth() + 3)); |
| | | case 6: dd = new Date(dd.setMonth(dd.getMonth() + 6)); |
| | | case 7: dd = new Date(dd.setMonth(dd.getMonth() + 12)); |
| | | default: dd = new Date(dd.setDate(dd.getDate())); |
| | | } |
| | | dt = dd.getFullYear().toString(); |
| | | if (dd.getMonth() + 1 < 10) { |
| | | dt = dt + "-0" + (dd.getMonth() + 1).toString(); |
| | | } |
| | | else { |
| | | dt = dt + "-0" + (dd.getMonth() + 1).toString(); |
| | | } |
| | | if (dd.getDate() < 10) { |
| | | dt = dt + "-0" + dd.getDate().toString(); |
| | | } |
| | | else { |
| | | dt = dt + "-" + dd.getDate().toString(); |
| | | } |
| | | if (Time != 8) { |
| | | sqlWhere += " and 交货日期 <= ^^" + dt + "^^"; |
| | | } |
| | | } |
| | | sql = sqlWhere; |
| | | //从第一页开始 |