| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">业务状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select id="HIsClose" name="HIsClose" lay-filter=""> |
| | | <option value="">全部</option> |
| | | <option value="正常" selected>正常</option> |
| | | <option value="业务关闭">业务关闭</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">冻结状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select id="HIsFreeze" name="HIsFreeze" lay-filter=""> |
| | | <option value="">全部</option> |
| | | <option value="正常" selected>正常</option> |
| | | <option value="业务冻结">业务冻结</option> |
| | | </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=""> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-inline" style="display:none;"> |
| | | <label class="layui-form-label">日期间隔</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HInitTimeCycle" id="HInitTimeCycle" class="ForFilteringSchemes" lay-filter="HInitTimeCycle" style="width:190px;"> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-inline" style="display:none;"> |
| | | <label class="layui-form-label">开始日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HBeginDate" id="HBeginDate"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <div class="layui-inline" style="display:none;"> |
| | | <label class="layui-form-label">结束日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HEndDate" id="HEndDate"> |
| | |
| | | <i class="layui-icon layui-icon-file"></i>生成送货单 |
| | | </button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_HideColumn" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>隐藏列设置</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="get_export" id="get_export"><i class="layui-icon layui-icon-export"></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> |
| | | </script> |
| | |
| | | optionPage = { |
| | | elem: 'page', //注意,这里的 page 是 ID,不用加 # 号 |
| | | count: 10000, //数据总数,从服务端得到 |
| | | limit: 2, |
| | | limits: [2,50, 500, 5000, 50000], |
| | | limit: 50, |
| | | limits: [50, 500, 5000, 50000], |
| | | layout: ['count', 'prev', 'page', 'next', 'limit', 'skip'], |
| | | jump: function (obj, first) { |
| | | //console.log(obj) |
| | |
| | | case 'btn-HideColumn': |
| | | get_HideColumn(); |
| | | break; |
| | | //导出excel |
| | | case 'get_export': |
| | | get_Export(); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | |
| | | switch (data[i].Type) { |
| | | //int |
| | | case 'DateTime': |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>", width: 200 }); |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', templet: "<div>{{d." + data[i].name + " ==null ?'':layui.util.toDateString(d." + data[i].name + ", 'yyyy-MM-dd')}}</div>",width: 200 }); |
| | | break; |
| | | default: |
| | | if (data[i].name == '订单数量' || data[i].name == '已发货数量' || data[i].name == '未发货数量' || data[i].name == '剩余收料数量' || data[i].name == '未到货数量' || data[i].name == '累计收料数量' || data[i].name == '剩余入库数量' || data[i].name == '入库数量' || data[i].name == '可发货数量') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true }); |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 200, totalRow: true }); |
| | | }else { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', width: 200 }); |
| | | } |
| | | } |
| | | } |
| | |
| | | sqlWhere += " and 关闭状态 like ^^%" + $("#HClStatus").val() + "%^^"; |
| | | //if ($("#HPURCHASEORGID").val() != "") |
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | if ($("#HBeginDate").val() != "") { |
| | | sqlWhere += " and 日期 >= ^^" + $("#HBeginDate").val() + "^^"; |
| | | } |
| | | if ($("#HEndDate").val() != "") { |
| | | sqlWhere += " and 日期 <= ^^" + $("#HEndDate").val() + "^^"; |
| | | } |
| | | //if ($("#HBeginDate").val() != "") { |
| | | //sqlWhere += " and 日期 >= ^^" + $("#HBeginDate").val() + "^^"; |
| | | //} |
| | | //if ($("#HEndDate").val() != "") { |
| | | //sqlWhere += " and 日期 <= ^^" + $("#HEndDate").val() + "^^"; |
| | | //} |
| | | if ($("#HISGenerate").val() != "") { |
| | | if ($("#HISGenerate").val() == "是") { |
| | | sqlWhere += " and 未关联数量 <= 0"; |
| | |
| | | } |
| | | } |
| | | |
| | | if ($("#HIsClose").val() != "") { |
| | | if ($("#HIsClose").val() == "正常") { |
| | | sqlWhere += " and 业务关闭 = ^^正常^^"; |
| | | } |
| | | else if ($("#HIsClose").val() == "业务关闭") { |
| | | sqlWhere += " and 业务关闭 = ^^业务关闭^^"; |
| | | } |
| | | } |
| | | if ($("#HIsFreeze").val() != "") { |
| | | if ($("#HIsFreeze").val() == "正常") { |
| | | sqlWhere += " and 业务冻结 = ^^正常^^"; |
| | | } |
| | | else if ($("#HIsFreeze").val() == "业务冻结") { |
| | | sqlWhere += " and 业务冻结 = ^^业务冻结^^"; |
| | | } |
| | | } |
| | | |
| | | var Time = $("#Time").val(); |
| | | if (Time > 0) { |
| | |
| | | sqlWhere += " and 关闭状态 like ^^%" + $("#HClStatus").val() + "%^^"; |
| | | //if ($("#HPURCHASEORGID").val() != "") |
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | if ($("#HBeginDate").val() != "") { |
| | | sqlWhere += " and 日期 >= ^^" + $("#HBeginDate").val() + "^^"; |
| | | } |
| | | if ($("#HEndDate").val() != "") { |
| | | sqlWhere += " and 日期 <= ^^" + $("#HEndDate").val() + "^^"; |
| | | } |
| | | //if ($("#HBeginDate").val() != "") { |
| | | //sqlWhere += " and 日期 >= ^^" + $("#HBeginDate").val() + "^^"; |
| | | //} |
| | | //if ($("#HEndDate").val() != "") { |
| | | //sqlWhere += " and 日期 <= ^^" + $("#HEndDate").val() + "^^"; |
| | | //} |
| | | if ($("#HISGenerate").val() != "") { |
| | | if ($("#HISGenerate").val() == "是") { |
| | | sqlWhere += " and 未关联数量 <= 0"; |
| | | } |
| | | else if ($("#HISGenerate").val() == "否") { |
| | | sqlWhere += " and 未关联数量 > 0"; |
| | | } |
| | | } |
| | | |
| | | if ($("#HIsClose").val() != "") { |
| | | if ($("#HIsClose").val() == "正常") { |
| | | sqlWhere += " and 业务关闭 = ^^正常^^"; |
| | | } |
| | | else if ($("#HIsClose").val() == "业务关闭") { |
| | | sqlWhere += " and 业务关闭 = ^^业务关闭^^"; |
| | | } |
| | | } |
| | | if ($("#HIsFreeze").val() != "") { |
| | | if ($("#HIsFreeze").val() == "正常") { |
| | | sqlWhere += " and 业务冻结 = ^^正常^^"; |
| | | } |
| | | else if ($("#HIsFreeze").val() == "业务冻结") { |
| | | sqlWhere += " and 业务冻结 = ^^业务冻结^^"; |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | //#endregion |
| | | |
| | | //#region 导出Execel |
| | | function get_Export() { |
| | | option.data.forEach((item) => { |
| | | for (let itemobj in item) { |
| | | if (item[itemobj] == null) { |
| | | item[itemobj] = ""; |
| | | } |
| | | if (item[itemobj].length > 0) { // 假设字段名为field |
| | | item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, '').replaceAll(',', ',').replaceAll(';', ';').replaceAll('"', '“').replaceAll('\'', '‘'); // 将换行符替换为空字符串 |
| | | } |
| | | } |
| | | }); |
| | | |
| | | table.exportFile(ins.config.id, option.data, "xls"); |
| | | } |
| | | //#endregion |
| | | |
| | | //隐藏列设置 |
| | | function get_HideColumn() { |
| | | var colName = ""; |