| | |
| | | <div class="layui-col-xs3"> |
| | | <label class="layui-form-label"> 物流单号:</label> |
| | | <div class="layui-input-inline"> |
| | | <input class="layui-input" name="HDeliveryNo" id="HDeliveryNo" autocomplete="off"> |
| | | <input class="layui-input" name="HDeliveryNo" id="HDeliveryNo" autocomplete="off"> |
| | | </div> |
| | | </div> |
| | | |
| | |
| | | </script> |
| | | <blockquote class="layui-elem-quote">送货单</blockquote> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <!--<script src="../../layuiadmin/layui/lay/modules/mobile/jquery-3.3.1.min.js"></script>--> |
| | |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'table', 'form', 'element'], function () { |
| | | var table = layui.table |
| | | , $ = layui.$ |
| | | , form = layui.form |
| | | , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块 |
| | | , $ = layui.$ |
| | | , form = layui.form |
| | | , element = layui.element; //Tab的切换功能,切换事件监听等,需要依赖element模块 |
| | | |
| | | function getUrlVars() { |
| | | var vars = [], hash; |
| | | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
| | | for (var i = 0; i < hashes.length; i++) { |
| | | hash = hashes[i].split('='); |
| | | vars.push(hash[0]); |
| | | vars[hash[0]] = hash[1]; |
| | | } |
| | | return vars; |
| | | } |
| | | var params = getUrlVars(); |
| | | var linterid = params[params[0]]; |
| | | var lentryid = params[params[1]]; |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | // debugger; |
| | | function RoadBillMain(linterid) { |
| | | $.ajax({ |
| | | url: GetWEBURL()+"GetPOInStockShowBillMain", |
| | | type: "GET", |
| | | data: { "sMsg": linterid }, |
| | | success: function (d) { |
| | | console.log(d.data); |
| | | //$("#HDate").val(d.) |
| | | $("#HInterID").val(d.data[0].HInterID); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HStatus").val(d.data[0].HStatus); |
| | | $("#HInnerBillNo").val(d.data[0].HInnerBillNo); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | $("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HMaker").val(d.data[0].HMaker); |
| | | $("#HMakerDate").val(d.data[0].HMakerDate) |
| | | $("#HChecker").val(d.data[0].HChecker); |
| | | $("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HDeptID").val(d.data[0].HDeptID); |
| | | $("#HDeptName").val(d.data[0].HDeptName); |
| | | $("#HSupID").val(d.data[0].HSupID); |
| | | $("#HSupName").val(d.data[0].HSupName); |
| | | $("#HEmpID").val(d.data[0].HEmpID); |
| | | $("#HEmpName").val(d.data[0].HEmpName); |
| | | $("#HManagerID").val(d.data[0].HManagerID); |
| | | $("#HManagerName").val(d.data[0].HManagerName); |
| | | $("#HDeliveryNo").val(d.data[0].HDeliveryNo); |
| | | function getUrlVars() { |
| | | var vars = [], hash; |
| | | var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'); |
| | | for (var i = 0; i < hashes.length; i++) { |
| | | hash = hashes[i].split('='); |
| | | vars.push(hash[0]); |
| | | vars[hash[0]] = hash[1]; |
| | | } |
| | | }); |
| | | } |
| | | return vars; |
| | | } |
| | | var params = getUrlVars(); |
| | | var linterid = params[params[0]]; |
| | | var lentryid = params[params[1]]; |
| | | var btntype = params[params[1]]; |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | // debugger; |
| | | function RoadBillMain(linterid) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetPOInStockShowBillMain", |
| | | type: "GET", |
| | | data: { "sMsg": linterid }, |
| | | success: function (d) { |
| | | console.log(d.data); |
| | | //$("#HDate").val(d.) |
| | | $("#HInterID").val(d.data[0].HInterID); |
| | | $("#HBillNo").val(d.data[0].HBillNo); |
| | | $("#HStatus").val(d.data[0].HStatus); |
| | | $("#HInnerBillNo").val(d.data[0].HInnerBillNo); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | $("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HMaker").val(d.data[0].HMaker); |
| | | $("#HMakerDate").val(d.data[0].HMakerDate) |
| | | $("#HChecker").val(d.data[0].HChecker); |
| | | $("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HDeptID").val(d.data[0].HDeptID); |
| | | $("#HDeptName").val(d.data[0].HDeptName); |
| | | $("#HSupID").val(d.data[0].HSupID); |
| | | $("#HSupName").val(d.data[0].HSupName); |
| | | $("#HEmpID").val(d.data[0].HEmpID); |
| | | $("#HEmpName").val(d.data[0].HEmpName); |
| | | $("#HManagerID").val(d.data[0].HManagerID); |
| | | $("#HManagerName").val(d.data[0].HManagerName); |
| | | $("#HDeliveryNo").val(d.data[0].HDeliveryNo); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ///加载显示数据 |
| | | function RoadBillSub(linterid) { |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"GetPOInStockShowBillSub", |
| | | async: true, |
| | | data: { sMsg: linterid}, |
| | | success: function (result) { |
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | table.reload('mainTable', { |
| | | data: ajaxReturnData |
| | | , height: 'full-10' |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | function RoadBillSub(linterid) { |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "GetPOInStockShowBillSub", |
| | | async: true, |
| | | data: { sMsg: linterid }, |
| | | success: function (result) { |
| | | ajaxReturnData = JSON.parse(JSON.stringify(result)).data; |
| | | table.reload('mainTable', { |
| | | data: ajaxReturnData |
| | | , height: 'full-10' |
| | | , loading: false |
| | | , done: function (index, res) { |
| | | |
| | | } |
| | | }); |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 }); |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | }); |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | //layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 }); |
| | | } |
| | | }); |
| | | } |
| | | //监听提交 |
| | | //form.verify({ |
| | | // numberOrEmpty: function (value, item) { |
| | |
| | | // //} |
| | | // } |
| | | //}); |
| | | layer.load(3) |
| | | table.render({ |
| | | elem: '#mainTable' |
| | | , url: GetWEBURL()+'GetPOInStockShowBillSub' |
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板 |
| | | , defaultToolbar: ['filter', 'exports'] |
| | | //, where: { sMsg: linterid } |
| | | , where: { sMsg: linterid } |
| | | , cols: [[ |
| | | // , { field: 'HMTONO', title: '计划跟踪单号', width: 100,, sort: true, fixed: true edit: 'text', hide: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HMaterNumber', title: '物料代码', width: 100} |
| | | , { field: 'HMaterName', title: '物料名称', width: 200} |
| | | , { field: 'HMaterModel', title: '规格型号', width: 200} |
| | | , { field: 'HUnitName', title: '计量单位', width: 100} |
| | | , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true } |
| | | , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true } |
| | | , { field: 'HQty', title: '数量', width: 100} |
| | | , { field: 'HPrice', title: '单价', width: 100} |
| | | , { field: 'HMoney', title: '金额', width: 100} |
| | | , { field: 'HWHName', title: '收料仓库', width: 100 } |
| | | , { field: 'HWHNumber', title: '收料仓库代码', width: 100, hide: true } |
| | | , { field: 'HWHID', title: '收料仓库ID', width: 100, hide: true } |
| | | , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true } |
| | | , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true } |
| | | , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 } |
| | | , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderDetaiLID', title: '委外订单明细内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200 } |
| | | , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true } |
| | | , { field: 'HSourceBillNo', title: '源单单号', width: 200} |
| | | , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true } |
| | | , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true } |
| | | ]] |
| | | // , data: [linterid] |
| | | // , page: true |
| | | //, height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | layer.load(3) |
| | | table.render({ |
| | | elem: '#mainTable' |
| | | , url: GetWEBURL() + 'GetPOInStockShowBillSub' |
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板 |
| | | , defaultToolbar: ['filter', 'exports'] |
| | | //, where: { sMsg: linterid } |
| | | , where: { sMsg: linterid } |
| | | , cols: [[ |
| | | // , { field: 'HMTONO', title: '计划跟踪单号', width: 100,, sort: true, fixed: true edit: 'text', hide: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, edit: 'text', hide: true } |
| | | , { field: 'HMaterNumber', title: '物料代码', width: 100 } |
| | | , { field: 'HMaterName', title: '物料名称', width: 200 } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 200 } |
| | | , { field: 'HUnitName', title: '计量单位', width: 100 } |
| | | , { field: 'HUnitNumber', title: '计量单位代码', width: 100, hide: true } |
| | | , { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true } |
| | | , { field: 'HQty', title: '数量', width: 100 } |
| | | , { field: 'HPrice', title: '单价', width: 100 } |
| | | , { field: 'HMoney', title: '金额', width: 100 } |
| | | , { field: 'HWHName', title: '收料仓库', width: 100 } |
| | | , { field: 'HWHNumber', title: '收料仓库代码', width: 100, hide: true } |
| | | , { field: 'HWHID', title: '收料仓库ID', width: 100, hide: true } |
| | | , { field: 'HPOOrderInterID', title: '采购订单主内码', width: 150, hide: true } |
| | | , { field: 'HPOOrderEntryID', title: '采购订单子内码', width: 150, hide: true } |
| | | , { field: 'HPOOrderBillNo', title: '采购订单号', width: 200 } |
| | | , { field: 'HWWOrderInterID', title: '委外订单主内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderEntryID', title: '委外订单子内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderDetaiLID', title: '委外订单明细内码', width: 150, hide: true } |
| | | , { field: 'HWWOrderBillNo', title: '委外订单号', width: 200 } |
| | | , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true } |
| | | , { field: 'HSourceBillNo', title: '源单单号', width: 200 } |
| | | , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true } |
| | | , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true } |
| | | ]] |
| | | // , data: [linterid] |
| | | // , page: true |
| | | //, height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | //头工具栏事件 |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | | var checkStatus = table.checkStatus(obj.config.id); |
| | |
| | | window.open("../../views/SRM/HBarPlanPrint.html?linterid=" + linterid + "&Type=HPOInStockBill"); |
| | | break; |
| | | |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | case 'btn-reload': |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | break; |
| | | |
| | | |
| | | case 'btn-exit': |
| | | var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
| | | parent.layer.close(index); //再执行关闭 |
| | |
| | | |
| | | case 'btn-Save': |
| | | var HDeliveryNo = $("#HDeliveryNo").val(); |
| | | $.ajax( |
| | | { |
| | | type: "GET", |
| | | url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.Message.indexOf("成功") > 0) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | if (btntype == "changebg") { |
| | | $.ajax( |
| | | { |
| | | type: "GET", |
| | | url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.Message.indexOf("成功") > 0) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | break; |
| | | }; |
| | | }); |
| | | }); |
| | | form.on('submit(Saver)', function (data) {//保存 |
| | | //debugger; |
| | | var sMainStr = JSON.stringify(data.field); |
| | |
| | | var sMainSub = sMainStr + ';' + sSubStr; |
| | | layer.load(3) |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL()+"SaverPOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | |
| | | data: { "msg": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | return false; |
| | | }); |
| | | form.on('submit(Save)', function (data) {//更新物流单号 |
| | | //debugger; |
| | | var HDeliveryNo = $("#HDeliveryNo").val(); |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名 |
| | | url: GetWEBURL() + "SaverPOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo }, |
| | | |
| | | data: { "msg": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.Message.indexOf("成功") > 0) { // 说明验证成功了, |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | } |
| | | else { |
| | |
| | | }); |
| | | return false; |
| | | }); |
| | | form.on('submit(Save)', function (data) {//更新物流单号 |
| | | //debugger; |
| | | //获取上个页面传过来的按钮事件 |
| | | if (btntype == "changebg") { |
| | | var HDeliveryNo = $("#HDeliveryNo").val(); |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SavePOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "HmainId": linterid, "HDeliveryNo": HDeliveryNo }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.Message.indexOf("成功") > 0) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | return false; |
| | | } |
| | | }); |
| | | |
| | | |
| | | |
| | |
| | | //jiuajax从服务器获取 |
| | | layer.load(3) |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL()+"SaverPOInStock", //方法所在页面和方法名 |
| | | async:true, |
| | | data: { msg: sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SaverPOInStock", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { msg: sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | } |
| | | else { |
| | | // $("#verifycode").click(); |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | else { |
| | | // $("#verifycode").click(); |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | }); |
| | | } |
| | | function f_alert(sMsg) { |
| | | layer.alert(sMsg, { icon: 5 }); |
| | |
| | | // return JSON.stringify(ajaxData).replace(/(")/g, "\\\""); |
| | | // // return false; |
| | | //}); |
| | | |
| | | |
| | | //function f_SaveBefore() { |
| | | // //保存前处理(字段格式:int类型不能为空,日期类型符合格式,bool类型) |
| | | // if ($("#HInterID").val() == '') { |
| | |
| | | var type = $(this).data('type'); |
| | | active[type] ? active[type].call(this) : ''; |
| | | }); |
| | | }); |
| | | }); |
| | | </script> |
| | | </body> |
| | | </html> |