| | |
| | | <span>更多</span> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">订单状态</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HStatus" id="HStatus" lay-filter=""> |
| | | <option value="" selected="">全部</option> |
| | | <option value="未确认">未确认</option> |
| | | <option value="已确认">已确认</option> |
| | | <option value="已驳回">已驳回</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">单据号</label> |
| | | <div class="layui-input-block"> |
| | |
| | | <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="HOldMaterNumber" id="HOldMaterNumber"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">订单状态</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HStatus" id="HStatus" lay-filter=""> |
| | | <option value="" selected="">全部</option> |
| | | <option value="未确认">未确认</option> |
| | | <option value="已确认">已确认</option> |
| | | <option value="已驳回">已驳回</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">完成状态</label> |
| | | <div class="layui-input-block"> |
| | | <select name="HFinishStatus" id="HFinishStatus" lay-filter=""> |
| | | <option value="">全部</option> |
| | | <option value="未完成" selected="">未完成</option> |
| | | <option value="已完成">已完成</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <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-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> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>隐藏列设置</button> |
| | |
| | | <script src="../../../../Scripts/webConfig.js"></script> |
| | | <script> |
| | | var _cur_page = 1; |
| | | var sql = " and 1=1"; |
| | | var sql = ""; |
| | | var options = document.getElementById('HStatus').children; |
| | | function getUrlVars() { |
| | | var vars = [], hash; |
| | |
| | | laydate.render({ |
| | | elem: '#HDate2' |
| | | }); |
| | | //不需要显示的字段 可扩展 |
| | | var titleData = ["HItemID", "HParentID"]; |
| | | var option = []; |
| | | var HModName = "SRM_POOrderBillList"; |
| | | //#region 进入页面既加载 |
| | |
| | | $("#HPURCHASEORGID").append(Organization); |
| | | form.render('select'); |
| | | //初始化表格 |
| | | set_InitGrid(); |
| | | //set_InitGrid(); |
| | | //显示列数据 |
| | | DisPlay_HideColumn(); |
| | | //DisPlay_HideColumn(); |
| | | //直接执行列表筛选 加载数据到网格 |
| | | get_FastQuery(table, option) |
| | | } |
| | |
| | | , { 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: 100/*, fixed: true */} |
| | | , { field: '单据号', title: '单据号', width: 150, sort: true/*, fixed: 'left' */ } |
| | | , { field: '计划跟踪单号', title: '计划跟踪单号', sort: true, hide: true } |
| | | , { field: '自定义标识', title: '自定义标识', width: 120 } |
| | | , { field: '送货地点', title: '送货地点', width: 120 } |
| | | , { field: '包装标识', title: '包装标识', width: 120 } |
| | | , { field: '唯一ID', title: '唯一ID', width: 120 } |
| | | //, { 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: '已发货数量', sort: true } |
| | | , { field: '可发货数量', title: '可发货数量', sort: true } |
| | | , { field: '交货地点', title: '交货地点', sort: true } |
| | | , { field: '交货日期', title: '交货日期', width: 180, sort: true } |
| | | , { field: '日期', title: '日期', width: 120, 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: 'F_xbkf_Combo', title: '自定义标识', width: 120 } |
| | | , { field: 'FSHDD', title: '送货地点', width: 120 } |
| | | , { field: 'FStockInQty', title: '累计入库数量', width: 120 } |
| | | , { field: '包装标识', title: '包装标识', width: 120 } |
| | | , { field: 'FMRBQTY', title: '累计退料数量', width: 120 } |
| | | //, { 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 } |
| | |
| | | , totalRow: true |
| | | , limit: 500 |
| | | , height: 'full-50' |
| | | , cols: [columns] |
| | | //, cols: [columns] |
| | | , limits: [500, 5000, 20000] |
| | | , done: function (res, curr, count) { |
| | | |
| | | } |
| | | }; |
| | | ////设置列宽 |
| | | //var colWidth = getColumnsWidth(); |
| | | //if (colWidth == "" || colWidth == []) { |
| | | |
| | | //} |
| | | //else { |
| | | // $.each(columns, function (x, m) { |
| | | // m["width"] = colWidth[x]; |
| | | // }); |
| | | //} |
| | | } |
| | | //隐藏列设置 |
| | | function get_HideColumn() { |
| | |
| | | success: function (data1) { |
| | | if (data1.data.length != 0) { |
| | | var dataCol = [];//数据库查询出的列数据 |
| | | var titleData = [];//不需要显示的字段 可扩展 |
| | | |
| | | dataCol = data1.data[0].HGridString.split(','); |
| | | |
| | | for (var i = 0; i < option.cols[0].length - 2; i++) { |
| | | for (var i = 0; i < dataCol.length; i++) { |
| | | var dataCols = dataCol[i].split('|'); |
| | | //隐藏列 |
| | | if (dataCols[1] == 1) { |
| | | option.cols[0][i + 1]["hide"] = true; |
| | | } |
| | | //显示列 |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | //隐藏id |
| | | //设置列宽 |
| | | if (dataCols[3] > 0) { |
| | | option.cols[0][i + 1]["width"] = dataCols[3]; |
| | |
| | | //} else { |
| | | // option.cols[0][i + 1]["width"] = ""; |
| | | //} |
| | | //显示列 |
| | | if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) { |
| | | option.cols[0][i + 1]["hide"] = false; |
| | | } |
| | | |
| | | //字体所在位置(左 居中 右) |
| | | switch (dataCols[2]) { |
| | | case "L": |
| | |
| | | break; |
| | | } |
| | | } |
| | | |
| | | //取消冻结列 |
| | | for (var i = 1; i < option.cols[0].length - 1; i++) { |
| | | if (option.cols[0][i]["fixed"] != null) { |
| | |
| | | function get_Display(sqlWhere) { |
| | | var wait = layer.load();//遮罩 |
| | | $.ajax({ |
| | | type: "get", |
| | | type: "POST", |
| | | url: GetWEBURL() + "GetPOOrderBill", |
| | | async: true, |
| | | data: { "HSupNo": sessionStorage["HUserName"], "sqlWhere": sqlWhere }, |
| | | success: function (result) { |
| | | if (result.Message == "获取成功") { |
| | | option.data = result.data; |
| | | table.render(option); |
| | | success: function (data1) { |
| | | if (data1.Message == "获取成功") { |
| | | var data = []; |
| | | var col = []; |
| | | //给空的数组赋值 |
| | | for (var key in data1.list) { |
| | | data.push({ "id": data1.list[key].ColmCols, "name": data1.list[key].ColmCols, "Type": data1.list[key].ColmType }); |
| | | } |
| | | //在列表左边添加勾选框 |
| | | col.push({ type: 'checkbox', fixed: 'left' }); |
| | | for (var i = 0; i < data.length; i++) { |
| | | // if (data[i].name == 'HInterID' || data[i].name == 'HBillType' || data[i].name == 'hmainid') { |
| | | if ($.inArray(data[i].name, titleData) > -1) { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //隐藏id列 |
| | | } |
| | | else if (data[i].name.indexOf('id') > -1) |
| | | { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', hide: true }); //id列 |
| | | } |
| | | else { |
| | | 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 }); |
| | | break; |
| | | default: |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200 }); |
| | | } |
| | | } |
| | | } |
| | | //动态显示列名 |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , cols: [col] |
| | | , data: data1.data |
| | | , height: 'full-80' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | } |
| | | table.render(option); |
| | | //刷新表格数据 |
| | | DisPlay_HideColumn(); |
| | | layer.close(wait); |
| | | } else { |
| | | layer.close(wait); |
| | | layer.alert(result.Message, { icon: 5 }); |
| | | layer.alert(data1.Message, { icon: 5 }); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | |
| | | }); |
| | | //查询条件 |
| | | function get_FastQuery(table, option) { |
| | | var sqlWhere = " and 1=1 "; |
| | | var sqlWhere = ""; |
| | | if ($("#HFinishStatus").val() != "") |
| | | sqlWhere += " and 完成状态 like ^^%" + $("#HFinishStatus").val() + "%^^"; |
| | | if ($("#HStatus").val() != "") |
| | | sqlWhere += " and 状态 like ^^%" + $("#HStatus").val() + "%^^"; |
| | | if ($("#HBillNo").val() != "") |
| | | sqlWhere += " and 单据号 like ^^%" + $("#HBillNo").val() + "%^^"; |
| | | if ($("#HShortNumber").val() != "") |
| | | sqlWhere += " and 物料编码 like ^^%" + $("#HShortNumber").val() + "%^^"; |
| | | if ($("#HOldMaterNumber").val() != "") |
| | | sqlWhere += " and 旧物料编码 like ^^%" + $("#HOldMaterNumber").val() + "%^^"; |
| | | if ($("#HNumber").val() != "") |
| | | sqlWhere += " and 物料代码 like ^^%" + $("#HNumber").val() + "%^^"; |
| | | if ($("#HName").val() != "") |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , 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", |
| | | 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.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 }); |
| | | get_FastQuery(table, option); |
| | | } |
| | | }) |
| | | else { |
| | | // $("#verifycode").click(); |
| | | layer.msg(result.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | } |
| | | }) |
| | | layer.close(index); |
| | | }); |
| | | |
| | | layer.close(index); |
| | | }); |
| | | |
| | | } |
| | | else { |
| | | layer.msg("必须是未确认单据才能进行确认操作!", { icon: 5 }); |
| | | } |
| | | break; |
| | | case 'btn-back': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | |
| | | success: function (result) { |
| | | if (result.count == 1) { // 说明验证成功了, |
| | | layer.msg("拒绝成功!", { icon: 1 }); |
| | | RoadHBillNo(sql); |
| | | } |
| | | else { |
| | | // $("#verifycode").click(); |
| | |
| | | success: function (data) { |
| | | if (data.code == "0") { |
| | | layer.alert(data.Message, { icon: 5 }); |
| | | get_FastQuery(table, option); |
| | | hasPrivileage = false; |
| | | table.reload('mainTable', { |
| | | height: 'full-10' |
| | | height: 'full-10' |
| | | , page: { |
| | | curr: _cur_page //必须从第 1 页开始 |
| | | } |
| | |
| | | , 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"); |
| | | //} |
| | | ,end: function () { |
| | | get_FastQuery(table, option) |
| | | } |
| | | }) |
| | | } |
| | | break; |
| | | |
| | | case 'btn-barcode': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | //if (data[0].未生成条码数量 <= 0) { |
| | | // layer.msg("选中行已生成条码!", { icon: 5 }); |
| | | //} |
| | | if (data.length == 0) { |
| | | return layer.msg('请选择数据') |
| | | } |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |