| | |
| | | <span>更多</span> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">订单状态</label> |
| | | <label class="layui-form-label">订单单号</label> |
| | | <div class="layui-input-block" style="width:130px;"> |
| | | <input type="text" class="layui-input" name="HBillNo" id="HBillNo"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料编码</label> |
| | | <div class="layui-input-block" style="width:130px;"> |
| | | <input type="text" class="layui-input" name="HShortNumber" id="HShortNumber"> |
| | | </div> |
| | | </div> |
| | | <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="HOldMaterNumber" id="HOldMaterNumber"> |
| | | </div> |
| | | </div> |
| | | <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="HNumber" id="HNumber"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">物料名称</label> |
| | | <div class="layui-input-block" style="width:130px;"> |
| | | <input type="text" class="layui-input" name="HName" id="HName"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">开始日期</label> |
| | | <div class="layui-input-block" style="width:100px;"> |
| | | <input type="text" class="layui-input" name="HDate1" id="HDate1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">结束日期</label> |
| | | <div class="layui-input-block" style="width:100px;"> |
| | | <input type="text" class="layui-input" name="HDate2" id="HDate2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select name="HStatus" id="HStatus" lay-filter=""> |
| | | <option value="" selected="">全部</option> |
| | | <option value="未确认">未确认</option> |
| | |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">单据号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HBillNo" id="HBillNo"> |
| | | <label class="layui-form-label">关闭状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select id="HClStatus" name="HClStatus" lay-filter=""> |
| | | <option value="" selected>全部</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" style="width:120px"> |
| | | <select id="HIsClose" name="HIsClose" lay-filter=""> |
| | | <option value="全部" selected>全部</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"> |
| | | <input type="text" class="layui-input" name="HShortNumber" id="HShortNumber"> |
| | | <label class="layui-form-label">冻结状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select id="HIsFreeze" name="HIsFreeze" lay-filter=""> |
| | | <option value="全部" selected>全部</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"> |
| | | <input type="text" class="layui-input" name="HNumber" id="HNumber"> |
| | | <label class="layui-form-label">完成状态</label> |
| | | <div class="layui-input-block" style="width:120px"> |
| | | <select name="HFinishStatus" id="HFinishStatus" 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> |
| | | <label class="layui-form-label">业务终止</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HName" id="HName"> |
| | | <select id="HIsStop" name="HIsStop" lay-filter=""> |
| | | <option value="全部">全部</option> |
| | | <option value="是">是</option> |
| | | <option value="否" selected>否</option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | <div class="layui-inline"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | |
| | | <label class="layui-form-label">规格型号</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HModel" id="HModel"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">关闭状态</label> |
| | | <div class="layui-input-block"> |
| | | <select id="HClStatus" name="HClStatus" lay-filter=""> |
| | | <option value="" selected>全部</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"> |
| | | <input type="text" class="layui-input" name="HDate1" id="HDate1"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | | <label class="layui-form-label">结束日期</label> |
| | | <div class="layui-input-block"> |
| | | <input type="text" class="layui-input" name="HDate2" id="HDate2"> |
| | | </div> |
| | | </div> |
| | | <div class="layui-inline"> |
| | |
| | | </select> |
| | | </div> |
| | | </div> |
| | | |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch"> |
| | | <i class="layui-icon layui-icon-search layuiadmin-button-btn"></i> |
| | | </button> |
| | | <!--<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-getCheckData"><i class="layui-icon layui-icon-tips"></i>预览</button>--> |
| | | <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" id="btn_reload" lay-submit="" 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> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-HideColumn"><i class="layui-icon layui-icon-return"></i>隐藏列设置</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_details" lay-event="btn-details"><i class="layui-icon layui-icon-form"></i>详情</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_barcode" lay-event="btn-barcode"><i class="layui-icon layui-icon-file"></i>生成条码</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_generate" lay-event="btn-generate"><i class="layui-icon layui-icon-file"></i>生成送货单</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_backData" lay-event="btn_backData"><i class="layui-icon layui-icon-add-1"></i>返回数据</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" id="btn_exit" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></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" id="set_dao" lay-event="set_dao"><i class="layui-icon layui-icon-form"></i>导出</button> |
| | | </div> |
| | | </script> |
| | | </div> |
| | |
| | | </div> |
| | | </div> |
| | | <script src="../../layuiadmin/layui/layui.js" charset="utf-8"></script> |
| | | <script src="../../layuiadmin/Scripts/json2.js" type="text/javascript"></script> |
| | | <script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script> |
| | | <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; |
| | |
| | | } |
| | | var params = getUrlVars(); |
| | | var type = params[params[0]]; |
| | | switch (type) { |
| | | case "UnConfirm": |
| | | options[1].selected = true; |
| | | sql += " and 状态 like ^^%未确认%^^"; |
| | | //$("#HStatus").attr("disabled", true) |
| | | break; |
| | | case "ReConfirm": |
| | | options[2].selected = true; |
| | | sql += " and 状态 like ^^%已确认%^^"; |
| | | sql += " and 未关联数量 > 0"; |
| | | break; |
| | | case "ReBack": |
| | | options[3].selected = true; |
| | | sql += " and 状态 like ^^%已驳回%^^"; |
| | | break; |
| | | } |
| | | |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer'], function () { |
| | | }).use(['index', 'form', 'laydate', 'code', 'table', 'element', 'layer','excel'], function () { |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , laydate = layui.laydate |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , element = layui.element; |
| | | , element = layui.element |
| | | , excel = layui.excel; |
| | | //常规用法 |
| | | laydate.render({ |
| | | elem: '#HDate1' |
| | |
| | | laydate.render({ |
| | | elem: '#HDate2' |
| | | }); |
| | | |
| | | //不需要显示的字段 可扩展 |
| | | var titleData = ["HItemID", "HParentID", "单据号", "日期", "数量", "状态", "单位", "金额"]; |
| | | var option = []; |
| | | var HModName = "SRM_POOrderBillList"; |
| | | var sqlWhere = ""; |
| | | //#region 进入页面既加载 |
| | | switch (type) { |
| | | case "UnConfirm": |
| | | options[1].selected = true; |
| | | sql += " and 状态 like ^^%未确认%^^"; |
| | | //$("#HStatus").attr("disabled", true) |
| | | break; |
| | | case "ReConfirm": |
| | | options[2].selected = true; |
| | | sql += " and 状态 like ^^%已确认%^^"; |
| | | sql += " and 未关联数量 > 0"; |
| | | break; |
| | | case "ReBack": |
| | | options[3].selected = true; |
| | | sql += " and 状态 like ^^%已驳回%^^"; |
| | | break; |
| | | //case "AddRow": |
| | | // $("#HStatus").attr("disabled", "disabled"); |
| | | // $("#HStatus").val('已确认'); |
| | | // $("#HFinishStatus").attr("disabled", "disabled"); |
| | | // form.render('select'); |
| | | // sqlWhere += " and 状态 like ^^%已确认%^^"; |
| | | // sqlWhere += " and 完成状态 like ^^%" + $("#HFinishStatus").val() + "%^^"; |
| | | // $('#btn_reload').addClass("layui-btn-disabled").attr("visibility", "hidden"); |
| | | // $('#btn_confirm').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#btn_back').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#btn_report').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#btn_details').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#btn_barcode').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#btn_generate').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // $('#set_dao').addClass("layui-btn-disabled").attr("disabled", true); |
| | | // break; |
| | | } |
| | | |
| | | set_ClearBill(); |
| | | //#region 此页面所有方法 |
| | | function set_ClearBill() { |
| | |
| | | $("#HPURCHASEORGID").append(Organization); |
| | | form.render('select'); |
| | | //初始化表格 |
| | | set_InitGrid(); |
| | | //set_InitGrid(); |
| | | //显示列数据 |
| | | DisPlay_HideColumn(); |
| | | //DisPlay_HideColumn(); |
| | | //直接执行列表筛选 加载数据到网格 |
| | | get_FastQuery(table, option) |
| | | } |
| | |
| | | //$("#HBeginDate").val("2022-03-14"); |
| | | //$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd")); |
| | | var columns = [ |
| | | { type: 'checkbox', fixed: 'left' } |
| | | { type: 'checkbox', fixed: 'left', totalRowText: '合计' } |
| | | //{ 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: 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, totalRow: true } |
| | | , { field: '可发货数量', title: '可发货数量', sort: true, totalRow: 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]; |
| | | if (option.cols[0][i + 1]["field"] == '供应商交期回复') { |
| | | option.cols[0][i + 1]["width"] = 120; |
| | | } else { |
| | | option.cols[0][i + 1]["width"] = dataCols[3]; |
| | | } |
| | | } |
| | | //设置内容字体大小 |
| | | if (data1.data[0].HFontSize != 0) { |
| | |
| | | //} 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", |
| | | url: GetWEBURL() + "GetPOOrderBill", |
| | | type: "POST", |
| | | url: GetWEBURL() + "GetPOOrderBill", //H_p_SRM_POOrderBillList |
| | | 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', totalRowText: '合计' }); |
| | | 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: |
| | | 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 == '入库数量') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, totalRow: true }); |
| | | } else if (data[i].name == '供应商交期回复') { |
| | | col.push({ field: data[i].id, title: data[i].name, align: 'center', sort: true, width: 200, event: 'HSupSendGoodsDateRemark' }); |
| | | } else { |
| | | 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' |
| | | ,totalRow: true |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 500 |
| | | , 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() != "") |
| | |
| | | sqlWhere += " and 规格型号 like ^^%" + $("#HModel").val() + "%^^"; |
| | | if ($("#HClStatus").val() != "") |
| | | sqlWhere += " and 关闭状态 like ^^%" + $("#HClStatus").val() + "%^^"; |
| | | //if ($("#HPURCHASEORGID").val() != "") |
| | | // sqlWhere += " and 采购组织 like ^^%" + $("#HPURCHASEORGID").val() + "%^^"; |
| | | if ($("#HPURCHASEORGID").val() != "" && $("#HPURCHASEORGID option:selected").text() != "安瑞集团") |
| | | sqlWhere += " and HPURCHASEORGID = ^^" + $("#HPURCHASEORGID").val() + "^^"; |
| | | if ($("#HDate1").val() != "") { |
| | | sqlWhere += " and 日期 >= ^^" + $("#HDate1").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 业务冻结 = ^^业务冻结^^"; |
| | | } |
| | | } |
| | | if ($("#HIsStop").val() != "") { |
| | | if ($("#HIsStop").val() == "是") { |
| | | sqlWhere += " and 业务终止 = ^^业务终止^^"; |
| | | } |
| | | else if ($("#HIsStop").val() == "否") { |
| | | sqlWhere += " and 业务终止 = ^^正常^^"; |
| | | } |
| | | } |
| | | |
| | | var Time = $("#Time").val(); |
| | | if (Time > 0) { |
| | | var dd = new Date(); |
| | |
| | | _cur_page = 1; |
| | | get_Display(sqlWhere); |
| | | } |
| | | |
| | | //监听单元格事件 |
| | | table.on('tool(mainTable)', function (obj) { |
| | | var data = obj.data; |
| | | if (obj.event === 'HSupSendGoodsDateRemark') { |
| | | layer.prompt({ |
| | | formType: 2 |
| | | , area: ['400px', '50px'] //自定义文本域宽高 |
| | | , title: '修改订单号为 【 ' + data.单据号 + ' 】 ,物料代码为 【 ' + data.物料代码 + ' 】 的供应商交期回复' |
| | | , value: data.供应商交期回复 |
| | | }, function (value, index) { |
| | | layer.close(index); |
| | | //更新供应商交期回复 |
| | | $.ajax({ |
| | | type: "GET", |
| | | url: GetWEBURL() + "Cg_Poorder/UpdateSupSendGoodsDateRemark", |
| | | async: false, |
| | | data: { "HInterID": data.hmainid, "HEntryID": data.hsubid, "HSupSendGoodsDateRemark": value}, |
| | | success: function (result) { |
| | | if (result.code == 1) { |
| | | //同步更新表格和缓存对应的值 |
| | | obj.update({ |
| | | 供应商交期回复: value |
| | | }); |
| | | } else { |
| | | layer.alert(result.Message, { icon: 5 }); |
| | | } |
| | | }, |
| | | error: function (result) { |
| | | layer.alert(result.Message, { icon: 5 }); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | }); |
| | | |
| | | //头工具栏事件 |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | |
| | | 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"); |
| | | |
| | | var HInterIDArr = ""; |
| | | var HBillNoArr = ""; |
| | | var HBillInter = ""; |
| | | |
| | | for (let i = 0; i < data.length; i++) { |
| | | HInterIDArr += data[i].hmainid.toString() + ","; |
| | | HBillNoArr += "'" + data[i].单据号.toString() + "'" + ","; |
| | | HBillInter += data[i].单据号.toString() + "@" + data[i].hmainid.toString() + ","; |
| | | } |
| | | |
| | | HInterIDArr = HInterIDArr.substring(0, HInterIDArr.length - 1)//内码 |
| | | HBillNoArr = HBillNoArr.substring(0, HBillNoArr.length - 1)//单据号 |
| | | HBillInter = HBillInter.substring(0, HBillInter.length - 1)//单据号 + @ + 内码拼接 |
| | | |
| | | var oData = JSON.stringify(HInterIDArr) + ";" + JSON.stringify(HBillInter) + ";" + sessionStorage["HUserName"]; |
| | | |
| | | layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) { |
| | | $.ajax({ |
| | | type: "post", |
| | | url: GetWEBURL() + "POOrderAccept", |
| | | data: { "oData": oData }, |
| | | 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(); |
| | |
| | | layer.alert("请选择数据", { icon: 5 }); |
| | | return; |
| | | } |
| | | if (data[0].完成状态 == "已完成") { |
| | | return layer.msg('订单已完成!') |
| | | } |
| | | ajaxLabelData = data; |
| | | //根据选中的采购订单,重新从金蝶云同步采购订单关联数量过来。考虑采购订单删除和关闭状态,同步状态 |
| | | var ids = ""; |
| | |
| | | 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('请选择数据') |
| | | } |
| | | if (data[0].完成状态 == "已完成") { |
| | | return layer.msg('订单已完成!') |
| | | } |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |
| | |
| | | } |
| | | }); |
| | | break; |
| | | case 'set_dao': |
| | | //获取列表列数据源 |
| | | var ColName = []; |
| | | for (var i = 1; i < option.cols[0].length; i++) { |
| | | if (option.cols[0][i]["hide"] != true) { |
| | | ColName.push(option.cols[0][i]["field"]); |
| | | } |
| | | } |
| | | //绑定数据 |
| | | var data = excel.filterExportData(option.data, ColName) |
| | | |
| | | //赋值于表头列名 |
| | | var Title = []; |
| | | for (var i = 0; i < ColName.length; i++) { |
| | | Title.push("\"" + ColName[i] + "\":\"" + ColName[i] + "\""); |
| | | } |
| | | var TitleName = JSON.parse("{" + Title.toString() + "}"); |
| | | data.unshift(TitleName); |
| | | |
| | | //导出 sheet1 工作表名 |
| | | excel.exportExcel({ |
| | | sheet1: data |
| | | }, '采购订单列表.xlsx', 'xlsx'); |
| | | break; |
| | | case 'btn_backData': |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | parent.GetPoorderValue(data); |
| | | var index = parent.layer.getFrameIndex(window.name); |
| | | parent.layer.close(index); |
| | | break; |
| | | }; |
| | | }); |
| | | |
| | | //行监听事件 |
| | | table.on('row(mainTable)', function (obj) { |
| | | var flag = !obj.tr.find(':checkbox:first').prop('checked'); |
| | | obj.tr.find(':checkbox').prop('checked', flag); |
| | | if (flag) { |
| | | obj.tr.find('.layui-form-checkbox').addClass('layui-form-checked'); //设置复选框选中样式 |
| | | $(obj.tr.selector).attr({ "style": "background:#ceedfa;color:black" });//改变当前tr背景颜色和字体颜色 |
| | | } else { |
| | | obj.tr.find('.layui-form-checkbox').removeClass('layui-form-checked');//取消复选框选中样式 |
| | | $(obj.tr.selector).attr({ "style": "background:" });//取消当前tr颜色 |
| | | } |
| | | //mainTable 为表格ID 注意此处如果ID不正确将导致你在监听复选框时获取不到你选择的数据,前面的只是添加或删除选中未选中样式以及设置背景色,字体颜色 |
| | | layui.each(table.cache.mainTable, function (i, l) { |
| | | if (obj.tr.index() == l.LAY_TABLE_INDEX) { |
| | | l.LAY_CHECKED = flag; |
| | | } |
| | | }); |
| | | }); |
| | | |
| | | }); |
| | | </script> |
| | | </body> |