| | |
| | | //var WEBURL = "http://10.0.2.11:8083/WEB-API/"; |
| | | //var WEBURL = "http://192.168.31.47:8083/WEB-API/"; |
| | | //var WEBURL = "http://localhost:8082/srmAPI/"; //章紫柔本地配置 |
| | | var WEBURL = "http://localhost:8082/srmAPI/"; //杨露本地配置 |
| | | //var WEBURL = "http://localhost:8082/srmAPI/"; //杨露本地配置 |
| | | var WEBURL = "http://localhost:8082/SRMAPI/"; //杨乐本地配置 |
| | | |
| | | return WEBURL |
| | | } |
| | |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_EntrustOrderTrackBill.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_POInStockTrackBill.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_POOrderBillList - 复制.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_POOrderBillList_Excel.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_SystemLogList.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_POOrderTrackBill.html" /> |
| | | <Content Include="layuiAdmin.std-v1.2.1\src\views\SRM\SRM_POOrderBillList.html" /> |
| | |
| | | , { field: '单据号', title: '单据号', width: 150, sort: true/*, fixed: true*/ }
|
| | | , { field: '送货单号', title: '送货单号', width: 150, sort: true/*, fixed: true*/ }
|
| | | , { field: 'F_xbkf_Combo', title: '自定义标识', width: 120 }
, { field: '源单单号', title: '源单单号', width: 180 }
|
| | | , { field: '包装标识', title: '包装标识', width: 180 }
|
| | | //, { field: '物流单号', title: '物流单号', width: 150, sort: true/*, fixed: true*/ }
|
| | | //, { field: '物料编码', title: '物料编码', width: 120, sort: true }
|
| | | , { field: '物料代码', title: '物料代码', width: 120, 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 } |
New file |
| | |
| | | <!DOCTYPE html> |
| | | <html> |
| | | <head> |
| | | <meta charset="utf-8" /> |
| | | <title>Excel导入</title> |
| | | <link rel="stylesheet" href="../../layuiadmin/layui/css/layui.css" media="all"> |
| | | <link rel="stylesheet" href="../../layuiadmin/style/admin.css" media="all"> |
| | | <script src="../../layuiadmin/layui/layui.js" charset="utf-8"></script> |
| | | <script src="../../../../Scripts/webConfig.js"></script> |
| | | </head> |
| | | <body> |
| | | <div class="layui-fluid" style="padding: 0;"> |
| | | <div class="layui-card" style="padding: 2px;background-color: #efefef;"> |
| | | <div class="layui-card-body" style="padding: 1px;"> |
| | | <form class="layui-form" action="" lay-filter="formData" style="background-color:white;"> |
| | | <div style="padding: 10px; "> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">生成送货单</button> |
| | | <button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="UpLoad" id="UpLoad">文件上传</button> |
| | | </div> |
| | | <div class="layui-tab" lay-filter="tab-POStockInBill"> |
| | | <div class="layui-tab-content"> |
| | | <div class="layui-tab-item layui-show"> |
| | | <div class="layui-form-item" style="padding-top: 10px;"> |
| | | <div class="layui-row"> |
| | | <!--表头筛选条件--> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="layui-tab layui-tab-card" lay-filter="TabTest"> |
| | | <ul class="layui-tab-title" lay-filter="tab-all"> |
| | | <li lay-id="1" style="padding:1px;" class="layui-this">导入信息</li> |
| | | <li lay-id="2" style="padding:1px;">采购订单信息</li> |
| | | </ul> |
| | | <div class="layui-tab-content"> |
| | | <!--导入信息--> |
| | | <div class="layui-tab-item layui-show"> |
| | | <table class="" id="mainTable" lay-filter="mainTable"></table> |
| | | </div> |
| | | <!--采购订单信息--> |
| | | <div class="layui-tab-item"> |
| | | <table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <script type="text/html" id="toolbarDemo"> |
| | | <div class="layui-btn-container"> |
| | | <button type="button" class="layui-btn layui-btn-sm" lay-event="set_BatchFill"><i class="layui-icon layui-icon-file-b"></i>批量填充</button> |
| | | </div> |
| | | </script> |
| | | </form> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </body> |
| | | </html> |
| | | <script type="text/html" id="barDemo"> |
| | | <!--<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>--> |
| | | </script> |
| | | <script> |
| | | layui.config({ |
| | | base: '../../layuiadmin/' //静态资源所在路径 |
| | | }).extend({ |
| | | index: 'lib/index' //主入口模块 |
| | | }).use(['index', 'form', 'laydate', 'table', 'element', 'upload'], function () { |
| | | |
| | | //#region 公共变量 |
| | | |
| | | var $ = layui.$ |
| | | , admin = layui.admin |
| | | , layer = layui.layer |
| | | , table = layui.table |
| | | , form = layui.form |
| | | , laydate = layui.laydate |
| | | , excel = layui.excel |
| | | , upload = layui.upload |
| | | , element = layui.element; |
| | | |
| | | var option = []; |
| | | var option2 = []; |
| | | //#endregion |
| | | |
| | | //#region 进入页面即加载 |
| | | |
| | | //初始化界面 |
| | | set_ClearBill(); |
| | | |
| | | //#endregion |
| | | |
| | | //#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等 |
| | | |
| | | //文件上传 |
| | | upload.render({ |
| | | elem: '#UpLoad', |
| | | url: GetWEBURL() + '/POOrderBillExcel/POOrderBillExcelImport', |
| | | contentType: 'application/json', |
| | | exts: 'xls|xlsx', //允许上传的类型 |
| | | before: function (data) { |
| | | loadIndex = layer.load(2); |
| | | }, |
| | | done: function (data1) { |
| | | if (data1.count == 1) { |
| | | option.data = data1.data; |
| | | table.render(option); |
| | | set_InitGrid2(); |
| | | get_Display2(); |
| | | layer.close(loadIndex); |
| | | } else { |
| | | layer.close(loadIndex); |
| | | layer.alert(data1.code + data1.Message, { icon: 5 }); |
| | | } |
| | | }, |
| | | error: function (err) { |
| | | debugger |
| | | layer.alert('导入出现异常', { icon: 2 }); |
| | | } |
| | | }); |
| | | |
| | | //导入 保存数据 |
| | | form.on('submit(btnSave)', function (data) { |
| | | if (table.cache["mainTable"] != null) { |
| | | set_AddNew(data); |
| | | } |
| | | else { |
| | | layer.msg("无数据,请先导入数据!"); |
| | | } |
| | | }) |
| | | |
| | | //#endregion |
| | | |
| | | //#region 此页面所有的方法 |
| | | |
| | | //#region 初始化界面 |
| | | function set_ClearBill() { |
| | | ////初始化表格 导入信息 |
| | | set_InitGrid1(); |
| | | } |
| | | |
| | | //#endregion |
| | | |
| | | //初始化表格 导入信息 |
| | | function set_InitGrid1() { |
| | | var columns = []; |
| | | columns.push({ type: 'checkbox', fixed: 'left' }); |
| | | columns.push({ field: '组织', title: '组织', width: 150 }); |
| | | columns.push({ field: '供应商', title: '供应商', width: 150 }); |
| | | columns.push({ field: '收料仓库', title: '收料仓库', width: 150 }); |
| | | columns.push({ field: '物料编码', title: '物料编码', width: 150 }); |
| | | columns.push({ field: '数量', title: '数量', width: 150 }); |
| | | columns.push({ field: '包装标识', title: '包装标识', width: 150 }); |
| | | //columns.push({ fixed: 'right', title: '操作', toolbar: '#barDemo' }); |
| | | |
| | | option = { |
| | | elem: '#mainTable' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-190' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , loading: false |
| | | , cols: [columns] |
| | | }; |
| | | |
| | | //渲染页面 |
| | | table.render(option); |
| | | } |
| | | |
| | | //初始化表格 采购订单信息 |
| | | function set_InitGrid2() { |
| | | var columns = []; |
| | | columns.push({ type: 'checkbox', fixed: 'left' }); |
| | | columns.push({ field: '采购组织', title: '组织', width: 150 }); |
| | | columns.push({ field: '供应商', title: '供应商', width: 150 }); |
| | | columns.push({ field: '收料仓库', title: '收料仓库', width: 150 }); |
| | | columns.push({ field: '物料编码', title: '物料编码', width: 150 }); |
| | | columns.push({ field: '单据号', title: '采购订单号', width: 150 }); |
| | | columns.push({ field: 'HRQty', title: '应收数量', width: 150 }); |
| | | columns.push({ field: '实收数量', title: '实收数量', width: 150 }); |
| | | columns.push({ field: '包装标识', title: '包装标识', width: 150 }); |
| | | columns.push({ field: '创建日期', title: '创建日期', width: 150, templet: "<div>{{d.创建日期 ==null ?'':layui.util.toDateString(d.创建日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }); |
| | | columns.push({ field: '交货日期', title: '交货日期', width: 150, templet: "<div>{{d.交货日期 ==null ?'':layui.util.toDateString(d.交货日期, 'yyyy-MM-dd HH:mm:ss')}}</div>" }); |
| | | //columns.push({ fixed: 'right', title: '操作', toolbar: '#barDemo' }); |
| | | |
| | | option2 = { |
| | | elem: '#mainTable2' |
| | | , toolbar: '#toolbarDemo' |
| | | , height: 'full-190' |
| | | , page: true |
| | | , cellMinWidth: 90 |
| | | , limit: 50 |
| | | , limits: [50, 500, 5000, 20000] |
| | | , loading: false |
| | | , cols: [columns] |
| | | }; |
| | | } |
| | | |
| | | //采购订单信息查询 |
| | | function get_Display2() { |
| | | $.ajax({ |
| | | type: "get", |
| | | url: GetWEBURL() + "/POOrderBillExcel/POOrderBillExcelList", |
| | | async: true, |
| | | data: { "sqlWhere": "" }, |
| | | success: function (result) { |
| | | option2.data = result.data; |
| | | table.render(option2); |
| | | }, |
| | | error: function (result) { |
| | | console.log(result); |
| | | } |
| | | }); |
| | | } |
| | | |
| | | //生成送货单(保存) |
| | | function set_AddNew(data) { |
| | | var checkStatus = table.cache['mainTable2'] |
| | | , data = checkStatus; |
| | | //根据选中的采购订单,重新从金蝶云同步采购订单关联数量过来。考虑采购订单删除和关闭状态,同步状态 |
| | | 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('mainTable2', { |
| | | 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() + ';'; |
| | | } |
| | | else { |
| | | HEntry += (i + 1) + ','; |
| | | } |
| | | } |
| | | if (HEntry != '') { |
| | | HEntry = HEntry.substring(0, HEntry.length - 1); |
| | | layer.msg("第" + HEntry + "行未确认!", { icon: 5 }); |
| | | } |
| | | else { |
| | | layer.open({ |
| | | type: 2 |
| | | , area: ['100%', '100%'] |
| | | , title: '送货单' |
| | | , shade: 0.6 //遮罩透明度 |
| | | , maxmin: false //允许全屏最小化 |
| | | , anim: 0 //0-6的动画形式,-1不开启 |
| | | , content: ['../../views/SRM/SRM_POInStockBill_Edit.html?linterid=' + data[0].hmainid.toString()+'&lentryid=1,12&lSourceBillType=Excel', 'yes'] |
| | | , resize: false |
| | | //, cancel: function () { |
| | | // $(".layui-btn").removeClass("layui-btn-disabled"); |
| | | //} |
| | | }) |
| | | } |
| | | } |
| | | |
| | | //#endregion |
| | | |
| | | }); |
| | | |
| | | </script> |
| | |
| | | <dd data-name="SRM_POOrderBillList_UnConfirm"><a lay-href="SRM/SRM_POOrderBillList.html?type=UnConfirm">未确认采购订单</a> </dd> |
| | | <dd data-name="SRM_POOrderBillList_ReConfirm"><a lay-href="SRM/SRM_POOrderBillList.html?type=ReConfirm">已确认采购订单</a></dd> |
| | | <dd data-name="SRM_POOrderBillList_ReBack"><a lay-href="SRM/SRM_POOrderBillList.html?type=ReBack">已驳回采购订单</a></dd> |
| | | <dd data-name="SRM_POOrderBillList_Excel"><a lay-href="SRM/SRM_POOrderBillList_Excel.html">Excel导入</a></dd> |
| | | </dl> |
| | | </dd> |
| | | <dd> |
| | |
| | | success: function (data1) { |
| | | document.getElementById("mydiv").innerHTML = '<iframe src="home/console.html" frameborder="0" class="layadmin-iframe"></iframe>'; |
| | | if (data1.data.OA_InformBillMain.length > 0) { |
| | | console.log(data1); |
| | | //console.log(data1); |
| | | if (flag == 0) { |
| | | $(".layui-badge").html(data1.data.OA_InformBillMain.length); |
| | | } |