| | |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | </form> |
| | | </div> |
| | | <div class="layui-tab-item"> |
| | | <form id="form2" class="layui-form layui-form-pane" action=""> |
| | |
| | | </div> |
| | | </div> |
| | | |
| | | </form> |
| | | </form> |
| | | </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 type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></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" lay-event="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"><i class="layui-icon layui-icon-close-fill"></i>驳回</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-exit"><i class="layui-icon layui-icon-return"></i>退出</button> |
| | | <table class="layui-hide" id="mainTable" lay-filter="mainTable"></table> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-view"><i class="layui-icon layui-icon-tips"></i>预览</button> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="btn-print"><i class="layui-icon layui-icon-print"></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" lay-event="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"><i class="layui-icon layui-icon-close-fill"></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> |
| | | <blockquote class="layui-elem-quote">采购订单</blockquote> |
| | | |
| | | </div> |
| | | </div> |
| | | </script> |
| | | <blockquote class="layui-elem-quote">采购订单</blockquote> |
| | | |
| | | </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模块 |
| | | |
| | | form.on('submit(Saver)', function (data) {//保存 |
| | | //debugger; |
| | |
| | | var sMainSub = sMainStr + ';' + sSubStr; |
| | | layer.load(3) |
| | | $.ajax( |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL()+"SaverPOOrder", //方法所在页面和方法名 |
| | | async: true, |
| | | data: { "msg": sMainSub }, |
| | | dataType: "json", |
| | | success: function (data) { |
| | | if (data.count == 1) { // 说明验证成功了, |
| | | layer.msg(data.Message, { icon: 1 }); |
| | | { |
| | | type: "POST", |
| | | url: GetWEBURL() + "SaverPOOrder", //方法所在页面和方法名 |
| | | 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); |
| | | } |
| | | else { |
| | | layer.msg(data.Message, { icon: 5 }); |
| | | } |
| | | layer.closeAll("loading"); |
| | | }, |
| | | error: function (err) { |
| | | f_alert("错误:" + err); |
| | | } |
| | | }); |
| | | }); |
| | | return false; |
| | | }); |
| | | |
| | | 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]; |
| | | 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; |
| | | } |
| | | return vars; |
| | | } |
| | | var params = getUrlVars(); |
| | | var linterid = params[params[0]]; |
| | | var lentryid = params[params[1]]; |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | var params = getUrlVars(); |
| | | var linterid = params[params[0]]; |
| | | var lentryid = params[params[1]]; |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | // debugger; |
| | | function RoadBillMain(linterid) |
| | | { |
| | | $.ajax({ |
| | | url: GetWEBURL()+"GetEntrustOrderShowBillMain", |
| | | 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); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | $("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HStatus").val(d.data[0].HStatus); |
| | | $("#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); |
| | | $("#HMaker").val(d.data[0].HMaker); |
| | | $("#HMakeDate").val(d.data[0].HMakeDate) |
| | | $("#HChecker").val(d.data[0].HChecker); |
| | | $("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HUpDater").val(d.data[0].HUpDater); |
| | | $("#HUpDateDate").val(d.data[0].HUpDateDate); |
| | | $("#HConfirmMan").val(d.data[0].HConfirmMan); |
| | | $("#HConfirmDate").val(d.data[0].HConfirmDate); |
| | | $("#HBacker").val(d.data[0].HBacker); |
| | | $("#HBackDate").val(d.data[0].HBackDate); |
| | | $("#HBackRemark").val(d.data[0].HBackRemark); |
| | | function RoadBillMain(linterid) { |
| | | $.ajax({ |
| | | url: GetWEBURL() + "GetEntrustOrderShowBillMain", //H_v_SRM_EntrustOrderBillMain_ForWeb |
| | | 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); |
| | | $("#HRemark").val(d.data[0].HRemark); |
| | | $("#HDate").val(d.data[0].HDateForWeb); |
| | | $("#HStatus").val(d.data[0].HStatus); |
| | | $("#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); |
| | | $("#HMaker").val(d.data[0].HMaker); |
| | | $("#HMakeDate").val(d.data[0].HMakeDate) |
| | | $("#HChecker").val(d.data[0].HChecker); |
| | | $("#HCheckDate").val(d.data[0].HCheckDate); |
| | | $("#HUpDater").val(d.data[0].HUpDater); |
| | | $("#HUpDateDate").val(d.data[0].HUpDateDate); |
| | | $("#HConfirmMan").val(d.data[0].HConfirmMan); |
| | | $("#HConfirmDate").val(d.data[0].HConfirmDate); |
| | | $("#HBacker").val(d.data[0].HBacker); |
| | | $("#HBackDate").val(d.data[0].HBackDate); |
| | | $("#HBackRemark").val(d.data[0].HBackRemark); |
| | | } |
| | | }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | ///加载显示数据 |
| | | function RoadBillSub(linterid) { |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"GetEntrustOrderShowBillSub", |
| | | 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() + "GetEntrustOrderShowBillSub",//[h_v_srm_EntrustOrderBillSub_ForWeb2] |
| | | 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 }); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | //监听提交 |
| | |
| | | layer.load(3) |
| | | table.render({ |
| | | elem: '#mainTable' |
| | | , url: GetWEBURL()+'GetEntrustOrderShowBillSub' |
| | | , url: GetWEBURL() + 'GetEntrustOrderShowBillSub' |
| | | , toolbar: '#toolbarDemo' //开启头部工具栏,并为其绑定左侧模板 |
| | | , defaultToolbar: ['filter', 'exports'] |
| | | , where: { sMsg: linterid } |
| | | ,cols: [[ |
| | | , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true , hide: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | | , { field: 'HMaterNumber', title: '物料代码', width: 200 } |
| | | , { 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: 'HDate', title: '要求交货日期', width: 150 } |
| | | //, { field: 'HDate2', title: '确认交货日期', width: 150 } |
| | | , { field: 'HPURCHASEORGID', title: '采购组织', width: 150 } |
| | | , { field: 'HSTOCKINORGID', title: '入库组织', width: 150 } |
| | | , { field: 'HINSTOCKOWNERID', title: '入库货主', width: 150 } |
| | | , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true } |
| | | , { field: 'HSourceBillNo', title: '源单单号', width: 200, hide: true } |
| | | , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true } |
| | | , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true } |
| | | , { field: 'HSeOrderBillNo', title: '销售订单号', width: 200, hide: true } |
| | | , { field: 'HSeOrderInterID', title: '销售订单主内码', width: 150, hide: true } |
| | | , { field: 'HSeOrderEntryID', title: '销售订单子内码', width: 150, hide: true } |
| | | , where: { sMsg: linterid } |
| | | , cols: [[ |
| | | , { field: 'HMTONO', title: '计划跟踪单号', width: 100, sort: true, fixed: true, hide: true } |
| | | , { field: 'HMaterID', title: '物料ID', width: 100, hide: true } |
| | | , { field: 'HMaterShortNumber', title: '物料编码', width: 120 } |
| | | , { field: 'HMaterNumber', title: '物料代码', width: 120 } |
| | | , { field: 'HMaterName', title: '物料名称', width: 120 } |
| | | , { field: 'HMaterModel', title: '规格型号', width: 120 } |
| | | , { 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, hide: true } |
| | | , { field: 'HMoney', title: '金额', width: 100, hide: true} |
| | | , { field: 'HDate', title: '要求交货日期', width: 150 } |
| | | //, { field: 'HDate2', title: '确认交货日期', width: 150 } |
| | | , { field: 'HPURCHASEORGID', title: '采购组织', width: 150 } |
| | | , { field: 'HSTOCKINORGID', title: '入库组织', width: 150 } |
| | | , { field: 'HINSTOCKOWNERID', title: '入库货主', width: 150 } |
| | | , { field: 'HSourceBillType', title: '源单类型', width: 100, hide: true } |
| | | , { field: 'HSourceBillNo', title: '源单单号', width: 200, hide: true } |
| | | , { field: 'HSourceInterID', title: '源单主内码', width: 150, hide: true } |
| | | , { field: 'HSourceEntryID', title: '源单子内码', width: 150, hide: true } |
| | | , { field: 'HSeOrderBillNo', title: '销售订单号', width: 200, hide: true } |
| | | , { field: 'HSeOrderInterID', title: '销售订单主内码', width: 150, hide: true } |
| | | , { field: 'HSeOrderEntryID', title: '销售订单子内码', width: 150, hide: true } |
| | | |
| | | ]] |
| | | // , data: [linterid] |
| | | //, page: true //是否显示分页 |
| | | //, limits: [10, 20, 50, 100] |
| | | //, limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | ]] |
| | | // , data: [linterid] |
| | | //, page: true //是否显示分页 |
| | | //, limits: [10, 20, 50, 100] |
| | | //, limit: 50 //每页默认显示的数量 |
| | | //, height: 500 |
| | | , done: function () { |
| | | layer.closeAll("loading"); |
| | | } |
| | | }); |
| | | //头工具栏事件 |
| | | table.on('toolbar(mainTable)', function (obj) { |
| | |
| | | window.open("../../views/WarM/HBarPlanPrint.html?linterid=" + linterid + "&Type=HEntrustOrderBill"); |
| | | break; |
| | | |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | //自定义头工具栏右侧图标 - 提示 |
| | | case 'btn-reload': |
| | | RoadBillMain(linterid); |
| | | RoadBillSub(linterid); |
| | | var demoReload = $('#mainTable'); |
| | | //执行重载 |
| | | table.reload('mainTable', { |
| | | where: { |
| | | key: { |
| | | id: demoReload.val() |
| | | } |
| | | } |
| | | where: { |
| | | key: { |
| | | id: demoReload.val() |
| | | } |
| | | } |
| | | }); |
| | | break; |
| | | case 'btn-confirm': |
| | | var HBillNo = $("#HBillNo").val() |
| | | if ($("#HStatus").val() == "未确认") { |
| | | layer.confirm('是否确认单据?', { icon: 3, title: '提示' }, function (index) { |
| | | $.ajax({ |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"EntrustOrderAccept", |
| | | url: GetWEBURL() + "EntrustOrderAccept", |
| | | data: { "HInterID": linterid, "HBillNo": HBillNo, "HUser": sessionStorage["HUserName"] }, |
| | | success: function (result) { |
| | | if (result.count == 1) { // 说明验证成功了, |
| | |
| | | HBackRemark = value.toString(); |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL()+"EntrustOrderRefuse", |
| | | url: GetWEBURL() + "EntrustOrderRefuse", |
| | | data: { "HInterID": linterid, "HBillNo": HBillNo, "HUser": sessionStorage["HUserName"], "HBackRemark": HBackRemark }, |
| | | success: function (result) { |
| | | if (result.count == 1) { // 说明验证成功了, |
| | |
| | | } |
| | | break; |
| | | case 'btn-details': |
| | | |
| | | |
| | | case 'btn-exit': |
| | | var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引 |
| | | parent.layer.close(index); //再执行关闭 |
| | |
| | | // layer.load(3) |
| | | // $.ajax( |
| | | // { |
| | | // type: "POST", |
| | | // type: "POST", |
| | | // url: GetWEBURL()+"SaverEntrustOrder", //方法所在页面和方法名 |
| | | // async:true, |
| | | // data: { msg: sMainSub }, |
| | |
| | | // 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> |