| | |
| | | </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> |
| | |
| | | <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> |
| | | </div> |
| | |
| | | <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> |
| | |
| | | <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> |
| | |
| | | //{ 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: 180, sort: true, fixed: 'left' } |
| | | , { field: '日期', title: '日期', width: 180, sort: true, fixed: 'left' } |
| | | , { field: '供应商', title: '供应商', width: 180, sort: true, fixed: 'left' } |
| | | , { 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: 150, sort: true/*, fixed: 'left' */ } |
| | | , { 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: '物料代码', title: '物料代码', width: 180, sort: true } |
| | | , { field: '物料名称', title: '物料名称', width: 180, sort: true } |
| | | , { field: '规格型号', title: '规格型号', width: 180, sort: 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 } |
| | |
| | | //, skin: 'row' //表格风格 |
| | | // , even: true |
| | | , page: true //是否显示分页 |
| | | , limits: [10, 20, 50, 100] |
| | | , limits: [10, 20, 50, 100,500,1000,5000,10000] |
| | | , limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function (res, curr, count) { |
| | |
| | | var checkStatus = table.checkStatus('mainTable') |
| | | , data = checkStatus.data; |
| | | ajaxLabelData = data; |
| | | //根据选中的采购订单,重新从金蝶云同步采购订单关联数量过来。考虑采购订单删除和关闭状态,同步状态 |
| | | var ids = ""; |
| | | var entryids = ""; |
| | | $.each(data, function (obj) { |
| | | ids += data[obj].hmainid + ","; |
| | | entryids += data[obj].hsubid + ","; |
| | | }) |
| | | ids = ids.substring(0, ids.length - 1); |
| | | entryids = entryids.substring(0, entryids.length - 1); |
| | | var hasPrivileage = true; |
| | | $.ajax({ |
| | | url: GetWEBURL() + 'TestSaverPOInStock', |
| | | type: 'get', |
| | | async: false, |
| | | traditional: true, //重点 |
| | | data: { |
| | | "ids": ids, |
| | | "entryids": entryids //重点 |
| | | }, |
| | | success: function (data) { |
| | | if (data.code == "0") { |
| | | layer.alert(data.Message, { icon: 5 }); |
| | | hasPrivileage = false; |
| | | table.reload('mainTable', { |
| | | data: ajaxReturnData |
| | | , height: 'full-10' |
| | | , page: { |
| | | curr: _cur_page //必须从第 1 页开始 |
| | | } |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | |
| | | } |
| | | }); |
| | | return hasPrivileage; |
| | | } |
| | | }, |
| | | error: function (e) { |
| | | layer.alert(e.Message, { icon: 5 }); |
| | | } |
| | | }); |
| | | if (!hasPrivileage) { |
| | | return; |
| | | } |
| | | 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() + ';'; |
| | | } |
| | |
| | | //} |
| | | }) |
| | | } |
| | | break; |
| | | |
| | | 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: '条码生成' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , 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"); |
| | | } |
| | | }) |
| | | break; |
| | | case 'btn-exit': |
| | | //var index = parent.layer.getFrameIndex(window.name); |
| | |
| | | }; |
| | | }); |
| | | |
| | | |
| | | //渲染采购组织 |
| | | var Organization = '<option value=' + sessionStorage["OrganizationID"] + ' style="color:red;">' + sessionStorage["Organization"] + '</option>'; |
| | | $("#HPURCHASEORGID").append(Organization); |
| | | form.render('select'); |
| | | |
| | | ///加载显示数据 |
| | | function RoadHBillNo(sqlWhere) { |
| | |
| | | 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() + "^^"; |
| | | } |
| | |
| | | |
| | | |
| | | 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; |
| | | //从第一页开始 |