| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752 |
- <!DOCTYPE html>
- <html>
- <head>
- <meta charset="utf-8">
- <title>订单管理</title>
- <script src="../../js/min-loader-next.js"></script>
- </head>
- <body class="body-content">
- <div class="order-body">
- <div class="order-tiaojian back-gray">
- <div class="tiaojian-part1" id="conditions">
- <div class="fl f12-gray4-op mt4">所选条件:</div>
- </div>
- <div class="tiaojian-part2 fr demoTable">
- <button class="order-bnt1" onclick="reload();">查询</button>
- <button class="order-bnt2" onclick="cancle();">重置</button>
- <a href="#" id="toggle" class="top">收起<i class="iconfont up iconSelect_drop-down"></i></a>
- </div>
- </div>
- <form class="layui-form" action="javascript:void(0)" id = "formNameTwo" >
- <div class="order-select back-border" id="content" style="display: block;">
- <div class="layui-inline">
- <label class="f12-gray4">合同单号:</label>
- <input type="text" class="search-select" id="contractNoTwo" autocomplete="off" placeholder="合同单号">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">订单名称:</label>
- <input type="tel" name="orderName" id ="orderNameTwo" autocomplete="off" placeholder="请输入订单名称" class="search-select">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">客户名称:</label>
- <input type="tel" name="customerName" id ="customerNameTwo" autocomplete="off" placeholder="请输入客户名称" class="search-select">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">出入库时间:</label>
- <input type="text" id ="entyTime" autocomplete="off" placeholder="请选择出入库时间" class="search-select">
- </div>
- <div class="d-dashed" style="margin:10px 0;"></div>
- <div class="layui-inline">
- <label class="f12-gray4">订单编号:</label>
- <input type="tel" name="orderId" id ="orderIdTwo" autocomplete="off" placeholder="请输入订单编号" class="search-select">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">合同编号:</label>
- <input type="tel" name="contractId" id ="contractIdTwo" autocomplete="off" placeholder="请输入合同编号" class="search-select">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">创建时间:</label>
- <input type="text" id ="datesTwo" autocomplete="off" placeholder="请输入创建时间" class="search-select">
- </div>
- <div class="d-dashed" style="margin:10px 0;"></div>
- <div class="layui-inline">
- <label class="f12-gray4">合同月:</label>
- <input type="text" id ="htYue" placeholder="请输入合同月" class="search-select">
- </div>
- <div class="layui-inline">
- <label class="f12-gray4">区域:</label>
- <div id = "regionDiv" class="layui-inline">
- </div>
- </div>
- <div class="layui-inline" id="allStockDiv">
- <label class="f12-gray4">选中明细总量:</label>
- <div class="layui-input-inline">
- <input type="text" class="layui-input" id="totalWeight" name="totalWeight" value = "0" style="border:none;color: red" disabled="disabled" class="search-select">
- </div>
- </div>
- </div>
- </form>
- </div>
- <div class="shadow-content" >
- <div class="gray-title demoTableTwo">
- <button class="layui-btn left-bnt1 in-b" data-type="jieSuanpL" id="jieSuanpL">
- <i class="layui-icon"></i> 结算单打印
- </button>
- <button class="layui-btn left-bnt1 in-b" id="down">
- <i class="layui-icon"></i> 导出
- </button>
- <button class="layui-btn left-bnt1 in-b" id="downDetail">
- <i class="layui-icon"></i> 导出明细
- </button>
- <button class="layui-btn left-bnt1 in-b" id="relPrice">
- 批量修改实际单价
- </button>
- <button class="layui-btn left-bnt1 in-b" id="batchPrintOut">
- 批量打印出库单
- </button>
- <button class="layui-btn left-bnt1 in-b" id="batchPrintCheck">
- 批量打印查款单
- </button>
- <button class="layui-btn left-bnt1 in-b" id="WarehouseCheckMore">
- 批量打印出库单(提货单)
- </button>
- <button class="layui-btn left-bnt1 in-b" id="WarehouseCheckMoreNew">
- 新批量打印出库单(提货单)
- </button>
- <button class="layui-btn left-bnt1 in-b" id="printWarehouseOrder">
- 打印入库单
- </button>
- <button class="layui-btn left-bnt1 in-b" id="invoiceHandoverForm">
- 发票交接单
- </button>
- <button class="layui-btn left-bnt1 in-b" id="closeOprate" status = "on">
- <i class="layui-icon"></i> 操作栏靠右
- </button>
- </div>
- <table id="tableTestTwo" lay-filter="tableFilterTwo"></table>
- </div>
- <!--操作功能-->
- <script type="text/html" id="barDemoTwo">
- <a class="f12-black3 ml0-4" lay-event="manage">管理</a>
- <a class="f12-blue ml0-4" lay-event="edit">编辑</a>
- <!-- 重庆公司新增 -->
- {{# if(branchid == '100754' && d.invoiceOrNotCode == "00" ){ }}
- <a class="f12-blue ml0-4" lay-event="invoiceOrNot">已开票</a>
- {{# } }}
- {{# if(!isYHL(branchid) && conType == '00' && (!isEmpty(d.contractNo))){ }}
- <a class="f12-green ml0-4" lay-event="jiesuan">结算单</a>
- <a class="f12-green ml0-4" lay-event="ruku">发票入库单</a>
- {{# } }}
- <a class="f12-red2 ml0-4" lay-event="delete" >删除</a>
- </script>
-
- <script>
- $("#toggle").click(function() {
- $(this).html($("#content").is(":hidden") ? "收起" + "<i class='iconfont up iconSelect_drop-down'/></i>" : "展开" +
- "<i class='iconfont up iconSelect_drop-down'/></i>");
- $("#content").slideToggle();
- });
- var gloable_pm_id = new Array();// 复选框选中的唯一标识
- var table_data = new Array();// 表格数据缓存
- var conType = getQueryString("conType");
- var branchid = getTempVal("branchid");
- var contractType = "01";
- var tabPageId = getQueryString("tabPageId");
- // 合同进入
- var contractId = getQueryString("contractId");
- if (!isEmpty(contractId)) {
- $("#contractIdTwo").val(contractId);
- $("#contractIdTwo").attr("readOnly", true);
- }
-
- if(!isYHL(branchid)){//铝---显示
- $("#jieSuanpL").attr("style","display:show();");
- }else{//隐藏
- $("#jieSuanpL").attr("style","display:none;");
- }
-
- if(!isYHL(branchid)){//铝---显示
- $("#relPrice").attr("style","display:show();");
- $("#downDetail").attr("style","display:show();");
- }else{
- $("#relPrice").attr("style","display:none;");
- $("#downDetail").attr("style","display:none;");
- }
-
- if(!isYHL(branchid) && conType =='01'){//销售铝---显示
- $("#batchPrintOut").attr("style","display:show();");
- $("#batchPrintCheck").attr("style","display:show();");
- $("#WarehouseCheckMore").attr("style","display:show();");
- $("#WarehouseCheckMoreNew").show();
- }else{//隐藏
- $("#batchPrintOut").attr("style","display:none;");
- $("#batchPrintCheck").attr("style","display:none;");
- $("#WarehouseCheckMore").attr("style","display:none;");
- $("#WarehouseCheckMoreNew").hide();
- }
-
- if(!isYHL(branchid) && conType =='00'){//采购铝---显示
- $("#printWarehouseOrder").attr("style","display:show();");
- $("#invoiceHandoverForm").attr("style","display:show();");
- }else{//隐藏
- $("#printWarehouseOrder").attr("style","display:none;");
- $("#invoiceHandoverForm").attr("style","display:none;");
- }
-
- layui.use(['laydate','form'], function(){
- var laydate = layui.laydate;
- var form = layui.form;
- initSelect('regionDiv', "PB_REGION", "region", '', true);
- form.render();
-
- //日期范围
- laydate.render({
- elem: '#datesTwo'
- ,range: true
- ,format:'yyyyMMdd'
- ,trigger: 'click'
- });
- laydate.render({
- elem: '#entyTime'
- ,range: true
- ,format:'yyyyMMdd'
- ,trigger: 'click'
- });
- })
-
- layui.use('element', function(){
- var element = layui.element;
- element.init();
- });
-
- //固定块
- layui.use('util', function(){
- var util = layui.util;
- //执行
- util.fixbar({
- bar1: ''
- ,bar2: ''
- ,click: function(type){
- console.log(type);
- if (isEmpty(gloable_pm_id) || gloable_pm_id.length == 0) {
- $.ErrorAlert("未勾选数据");
- return;
- }
- if(type === 'bar1'){
- setTempVal("chooseTableData", gloable_pm_id);
- setTempVal("chooseTableDataCols", cols);
- layer.open({
- type: 2,
- title: '选中数据详情',
- shadeClose: true,
- // shade: true ,
- shade: 0.8,
- //maxmin: true, //开启最大化最小化按钮
- area: ['95%', '80%'],
- content: '../common/showChooseTable.html?primaryKey=orderId'
- });
- } else if (type === 'bar2') {
- layer.confirm('确认清空所有选中数据?', function(index){
- layer.close(index);
- gloable_pm_id.splice(0,gloable_pm_id.length);
-
-
- // 不刷新 删除选中数据
- var checkBoxs = $(".layui-table-fixed-l").find("tbody").find(".layui-unselect");
- var checkAll = $(".layui-table-fixed-l").find("thead").find(".layui-unselect");
- if ($(checkAll).attr("class").indexOf("layui-form-checked") != -1) {
- $(checkAll).click();
- } else {
- for (var i = 0; i < checkBoxs.length; i ++) {
- if ($(checkBoxs[i]).attr("class").indexOf("layui-form-checked") != -1) {
- $(checkBoxs[i]).click();
- }
- }
- }
- });
- }
- }
- });
- });
- // 清空选中数据
- function clearChooseData(primaryKey, data) {
- gloable_pm_id.splice(0,gloable_pm_id.length);
- gloable_pm_id = data;
- var currentData = table.cache['tableTestTwo'];
- for (var i = 0; i < currentData.length; i ++) {
- // 删除的是本页选中数据
- if (currentData[i].orderId == primaryKey) {
- var checkBoxs = $(".layui-table-fixed-l").find("tbody").find(".layui-unselect");
- // 是选中状态
- if ($(checkBoxs[i]).attr("class").indexOf("layui-form-checked") != -1) {
- $(checkBoxs[i]).click();
- }
- break;
- }
- }
- }
-
- var cols = [[ //表头
- {type: 'numbers',title: '序号',width:"5%"}
- ,{field: 'contractNo', title: '合同号', width:"20%", sort: true}
- ,{field: 'orderName', title: '订单名称', width:"10%", sort: true}
- ,{field: 'warehouseName', title: '仓库名称', width:"10%"}
- ,{field: 'buyerNameAll', title: '采购方', width:"10%"}
- ,{field: 'sellerNameAll', title: '销售方', width:"10%"}
- ,{field: 'htYueDesc', title: '合同月', width:"10%"}
- ,{field: 'reaWeight', title: '计划量', width:"10%"}
- ,{field: 'detailStockNum', title: '明细总量', width:"10%"}
- ,{field: 'realPrice', title: '实际单价', width:"10%"}
- ,{field: 'conStartDate', title: '合同开始时间',width:"10%",templet: function (d) { return isEmpty(d.conStartDate)?'':d.conStartDate;}}
- ,{field: 'conEndDate', title: '合同结束时间',width:"10%",templet: function (d) { return isEmpty(d.conEndDate)?'':d.conEndDate;}}
- // ,{field: 'createTime', title: '创建时间',width:"10%"}
- ,{field: 'editDate', title: '日期',width:"10%"}
- ,{field: 'orderStateDesc', title: '订单状态',width:"10%"}
- ,{field: 'operate', title: '操作',width:"8%", toolbar: '#barDemoOne', fixed: 'right'}
- ]];
-
-
- var table;
- layui.use('table', function(){
- table = layui.table;
- table.render({
- id : 'tableTestTwo'
- ,elem: '#tableTestTwo'
- ,limit:10
- ,loading: true //翻页加loading
- ,url: 'OrderManageAction/queryOrder' //数据接口
- ,method: 'post'
- ,where:{MINView:"JSON",conType : conType, contractType:contractType, contractId : contractId}
- ,page: true //开启分页
- ,cols: [[ //表头
- {type:'checkbox',width:'5%',fixed:'left'}
- ,{type:'numbers',title: '序号',width:"5%"}
- ,{field: 'orderName', title: '订单名称', width:"13%", sort: true}
- ,{field: 'invoiceOrNot', title: '是否开票', width:"10%"}
- ,{field: 'warehouseName', title: '仓库名称', width:"10%"}
- ,{field: 'buyerNameAll', title: '采购方', width:"10%"}
- ,{field: 'sellerNameAll', title: '销售方', width:"10%"}
- ,{field: 'htYueDesc', title: '合同月', width:"10%"}
- ,{field: 'reaWeight', title: '计划量', width:"10%"}
- ,{field: 'detailStockNum', title: '明细总量', width:"10%"}
- ,{field: 'realPrice', title: '实际单价', width:"10%"}
- ,{field: 'contractNo', title: '合同号', width:"20%", sort: true}
- ,{field: 'huoyuanfang', title: '货源方', width:"10%"}
- ,{field: 'orderId', title: '订单编号', width:"10%"}
- ,{field: 'conStartDate', title: '合同开始时间',width:"10%",templet: function (d) { return isEmpty(d.conStartDate)?'':d.conStartDate;}}
- ,{field: 'conEndDate', title: '合同结束时间',width:"10%",templet: function (d) { return isEmpty(d.conEndDate)?'':d.conEndDate;}}
- ,{field: 'editDate', title: '日期',width:"10%"}
- ,{field: 'orderStateDesc', title: '订单状态',width:"10%"}
- ,{field: 'operate', title: '操作',width:"20%", toolbar: '#barDemoTwo', fixed: 'right'}
- ]]
- ,done: function(res, curr, count){
- //如果是异步请求数据方式,res即为你接口返回的信息。
- console.log(res);
- //得到当前页码
- console.log(curr);
- //得到数据总量
- console.log(count);
- //缓存表数据
- table_data = res.data;
- //跨页选中复选框处理
- checkTrue(res,gloable_pm_id,"orderId","tableTestTwo");
- if(conType=='00'){//采购
- $("[data-field='huoyuanfang']").css('display','none');
- }
- }
- ,even: true //开启隔行背景
- });
- table.on('checkbox(tableFilterTwo)', function(obj){
-
- //选中复选框值存入缓存列表中
- gloable_pm_id = checkBoxCache(obj,"orderId",gloable_pm_id,table_data);
- var checkWeight = 0;
- for (var i = 0; i < gloable_pm_id.length; i ++) {
- checkWeight = accAdd(checkWeight,gloable_pm_id[i].detailStockNum,4);
- }
- $("#totalWeight").val(checkWeight);
- });
- // 监听工具条(操作)
- table.on('tool(tableFilterTwo)', function(obj){ //注:tool是工具条事件名,tableFilter是table原始容器的属性 lay-filter="对应的值"
- var data = obj.data; //获得当前行数据
- var layEvent = obj.event; //获得 lay-event 对应的值(也可以是表头的 event 参数对应的值)
- var tr = obj.tr; //获得当前行 tr 的DOM对象
- var orderId = data.orderId;
- var contractId = data.contractId;
- if(layEvent === 'delete'){ //删除
- layer.confirm('确认删除当前订单?', function(index){
- layer.close(index);
- //向服务端发送删除指令roleDelete
- $.request({
- action : "OrderManageAction/deleteOrder",
- data : {
- orderId : orderId
- },
- success : function(resData) {
- if (resData.MINStatus == 0) {
- layer.alert('操作成功!', {icon: 1});
- reload();
- } else {
- layer.alert(resData.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- },
- error : function(data2){
- layer.alert(data2.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- });
- });
- }else if(layEvent === 'invoiceOrNot'){ //删除
- layer.confirm('确认已开票?', function(index){
- layer.close(index);
- //向服务端发送删除指令roleDelete
- $.request({
- action : "OrderChongqingAction/orderInvoice",
- data : {
- orderId : orderId
- },
- success : function(resData) {
- if (resData.MINStatus == 0) {
- layer.alert('操作成功!', {icon: 1});
- reload();
- } else {
- layer.alert(resData.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- },
- error : function(data2){
- layer.alert(data2.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- });
- });
- }else if(layEvent === 'edit'){ //编辑
- editDetail(data);
- }else if(layEvent === 'manage'){ //管理
- manageDetail(orderId,conType,data,contractId);
- }else if(layEvent == 'jiesuan'){ //结算单
- jiesuanDetail(data);
- }else if(layEvent == 'ruku'){ //结算单
- rukuDetail(data);
- }
- });
- var $ = layui.$, active = {
- jieSuanpL : function(){
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- //没有合同号的订单打印结算单,会出错误
- for(var i = 0 ; i < datas.length;i++ ){
- if(isEmpty(datas[i].contractNo)){
- layer.msg("第"+(i+1)+"条订单合同号为空,合同号为空的不可以打印结算单", {icon: 5});
- return;
- }
-
- }
- setTempVal('jieSuanInfo', datas);
- openMainTabPageParent(tabPageId+'-12', '打印结算单', 'orderManage/someOutPrintCd.html?&tabPageId='+tabPageId+'-12&conType='+conType,'',tabPageId,null);
- }
- };
- $('.demoTableTwo .layui-btn').on('click', function(){
- var type = $(this).data('type');
- active[type] ? active[type].call(this) : '';
- });
-
- });
-
- //编辑
- function editDetail(data) {
- var params = {};
- params.columnNumber = 2; //每行显示两个字段
- // 寄存当前数据
- layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
- openMainTabPageParent(tabPageId+'-01', '编辑订单', 'orderManage/editOrder.html?tabPageId='+tabPageId+'-01','',tabPageId,reload);
- }
- //管理
- function manageDetail(orderId,conType,data,contractId) {
- var params = {};
- params.columnNumber = 2; //每行显示两个字段
- // 要显示的数据
- params.fields = [
- {field: 'orderId', title: '订单编号'}
- ,{field: 'orderName', title: '订单名称'}
- ,{field: 'buyerName', title: '采购方'}
- ,{field: 'sellerName', title: '销售方'}
- ,{field: 'contractName', title: '所属合同'}
- ,{field: 'contractId', title: '合同单号'}
- //,{field: 'orderAmt', title: '订单金额(元)'}
- ,{field: 'conStartDate', title: '合同开始时间'}
- ,{field: 'conEndDate', title: '合同结束时间'}
- ,{field: 'createUser', title: '创建人'}
- ,{field: 'createTime', title: '创建时间'}
- ];
- // 寄存当前数据
- setNowRowData(data, params);
- layui.sessionData("ROW_DATA_ORDERTWO", {key:"NOW_ROW_ORDERTWO", value:data});
- openMainTabPageParent(tabPageId+'-01', '管理订单', 'orderManage/manageDetail.html?orderId='+orderId+'&conType='+conType+'&type=two'+'&tabPageId='+tabPageId+'-01&contractId='+contractId,'',tabPageId,reload);
- }
- function reload(){
- var customerName = $('#customerNameTwo').val();
- var orderId = $('#orderIdTwo').val();
- var contractId = $('#contractIdTwo').val();
- var orderName = $('#orderNameTwo').val();
- var dates = $("#datesTwo").val();
- var contractNo = $("#contractNoTwo").val();
- var htYue = $("#htYue").val();
- var entyTime = $("#entyTime").val();
- var region = $("#regionDiv").find("select option:selected").val();
- //执行重载
- table.reload('tableTestTwo', {
- page: {
- curr: 1 //重新从第 1 页开始
- }
- ,where: {
- customerName : customerName,
- orderId : orderId,
- contractId : contractId,
- orderName : orderName,
- dates :dates,
- contractNo :contractNo,
- conType : conType,
- region : region,
- htYue : htYue,
- entyTime:entyTime,
- contractType : contractType,
- }
- });
- }
- function cancle(){
- $('#formNameTwo')[0].reset();
- }
-
- //现货结算单
- function jiesuanDetail(data) {
- //没有合同号的订单打印结算单,会出错误
- if(isEmpty(data.contractNo)){
- layer.msg("订单合同号为空,合同号为空的不可以打印结算单", {icon: 5});
- return;
- }
- var sendArray = new Array();
- sendArray.push(data);
- setTempVal('jieSuanInfo', sendArray);
- openMainTabPageParent(tabPageId+'-11', '订单结算', 'orderManage/someOutPrintCd.html?tabPageId='+tabPageId+'-11&conType='+conType,'',tabPageId,null);
- }
-
-
-
-
- function rukuDetail(data) {
- var orderId = data.orderId;
- var params = {};
- params.columnNumber = 2; //每行显示两个字段
- // 寄存当前数据
- layui.sessionData("ROW_DATA", {key:"NOW_ROW", value:data});
- openMainTabPageParent(tabPageId+'-09', '入库单', 'orderManage/enterPrint.html?orderId='+orderId+'&tabPageId='+tabPageId+'-09','',tabPageId,reload);
- }
-
- $(document).on('click','#down',function(){
- /* var warename = $('#warename').val();
- var proName = $('#proName').val();
- var dates = $("#dates").val();
- var weight = $("#weight").val();
- var buyName = $("#buyName").val();
- var orderName= $("#orderName").val();
- var param = {};
- param.warename = warename;
- param.proName = proName;
- param.dates = dates;
- param.weight = weight;
- param.buyName = buyName;
- param.orderName = orderName;
- param.type = "01"; */
- var customerName = $('#customerNameTwo').val();
- var orderId = $('#orderIdTwo').val();
- var contractId = $('#contractIdTwo').val();
- var orderName = $('#orderNameTwo').val();
- var dates = $("#datesTwo").val();
- var contractNo = $("#contractNoTwo").val();
- var htYue = $("#htYue").val();
- var entyTime = $("#entyTime").val();
- var region = $("#regionDiv").find("select option:selected").val();
- var param = {};
- param.conType = conType;//采购、销售
- param.customerName = customerName;
- param.orderId = orderId;
- param.contractId = contractId;
- param.orderName = orderName;
- param.dates = dates;
- param.contractNo = contractNo;
- param.contractType = contractType;//长单、现货、期货
- param.htYue = htYue;
- param.region = region;
- param.entyTime = entyTime;
- if(!isYHL(branchid)){
- exportExcel("../../OrderManageAction/orderToexcel?",param);
- }else{
- exportExcel("../../OrderManageAction/orderToexcels?",param);
- }
- });
-
-
- //批量修改实际单价
- $(document).on('click','#relPrice',function(){
- if(gloable_pm_id.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
-
- layer.prompt({title : "请输入实际单价",maxlength: 20},function(value, index, elem){
- if(isEmpty(value)){
- $.ErrorAlert('请输入实际单价!');
- return;
- }
- var regPos = /^\d+(\.\d+)?$/; //非负浮点数
- var regNeg = /^(-(([0-9]+\.[0-9]*[1-9][0-9]*)|([0-9]*[1-9][0-9]*\.[0-9]+)|([0-9]*[1-9][0-9]*)))$/; //负浮点数
- if(!regPos.test(value) && !regNeg.test(value)){
- $.ErrorAlert('请输入数字');
- return;
- }
-
- //向服务端发送删除指令roleDelete
- $.request({
- action : "WarehouseStockManageAction/updateRealPrice",
- data : {
- tabData : JSON.stringify(gloable_pm_id),
- relPrice : value
- },
- success : function(resData) {
- layer.close(index);
- if (resData.MINStatus == 0) {
- reload();
- layer.alert('保存成功!', function(){
- layer.close(layer.index);
- });
- } else {
- layer.alert(resData.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- },
- error : function(data2){
- layer.alert(data2.MINErrorMessage, {
- icon: 5,
- title: "提示"
- });
- }
- });
- });
- });
-
- $(document).on('click','#closeOprate',function(){
- var status = $("#closeOprate").attr("status");
- //关闭操作栏
- if (status == "on") {
- $("#closeOprate").html('<i class="layui-icon"></i> 固定操作栏');
- $(".layui-table-fixed-r").hide();
- $("#closeOprate").attr("status", "off");
- } else {
- $("#closeOprate").html('<i class="layui-icon"></i> 操作栏靠右');
- $(".layui-table-fixed-r").show();
- $("#closeOprate").attr("status", "on");
- }
-
- });
-
- //打印出库单
- $(document).on('click','#batchPrintOut',function(){
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- setTempVal('batchPrintOut', datas);
- openMainTabPageParent(tabPageId+'-13', '批量打印出库单', 'orderManage/batchOutPrintlv.html?&tabPageId='+tabPageId+'-13&conType='+conType,'',tabPageId,reload);
- });
- //查款单打印
- $(document).on('click','#batchPrintCheck',function(){
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- setTempVal('batchPrintOut',datas);
- openMainTabPageParent(tabPageId+'-20', '打印查款单', 'stockManage/printCheckMore.html?conType='+conType+'&tabPageId='+tabPageId+'-20','',tabPageId,null);
- });
- //出库单(提货单)打印
- $(document).on('click','#WarehouseCheckMore',function(){
- var datas = gloable_pm_id;
-
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- console.log(datas)
- var warehouseName = null;
- for (var i = 0; i < datas.length; i ++) {
- if (!isEmpty(warehouseName)) {
- if (datas[i].warehouseName != warehouseName) {
- $.ErrorAlert("请选择相同仓库的数据!");
- return;
- }
- } else {
- warehouseName = datas[i].warehouseName;
- }
- }
- setTempVal('batchPrintOut', datas);
- var orderName = encodeURI(encodeURI(datas[0].orderName));
- openMainTabPageParent(tabPageId+'-21', '打印出库单(提货单)', 'stockManage/enteringWarehouseCheckMore.html?orderName='+orderName+'&conType='+conType+'&new=0'+'&tabPageId='+tabPageId+'-21','',tabPageId,null);
- });
- $(document).on('click','#WarehouseCheckMoreNew',function(){
- var datas = gloable_pm_id;
-
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- console.log(datas)
- var warehouseName = null;
- for (var i = 0; i < datas.length; i ++) {
- if (!isEmpty(warehouseName)) {
- if (datas[i].warehouseName != warehouseName) {
- $.ErrorAlert("请选择相同仓库的数据!");
- return;
- }
- } else {
- warehouseName = datas[i].warehouseName;
- }
- }
- setTempVal('batchPrintOut', datas);
- var orderName = encodeURI(encodeURI(datas[0].orderName));
- openMainTabPageParent(tabPageId+'-22', '打印出库单(提货单)', 'stockManage/enteringWarehouseCheckMore.html?orderName='+orderName+'&conType='+conType+'&new=1'+'&tabPageId='+tabPageId+'-22','',tabPageId,null);
- });
-
- $(document).on('click','#downDetail',function(){
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- var param = {};
- param.checkDatas = JSON.stringify(datas);
- exportExcel("../../DeriveManageAction/downOrderDetail?",param);
- });
-
-
- $(document).on('click','#printWarehouseOrder',function(){//批量打印入库单
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- setTempVal('printWarehouseOrder', datas);
- openMainTabPageParent(tabPageId+'-22', '打印入库单', 'orderManage/printStockOrder.html?tabPageId='+tabPageId+'-22','',tabPageId,null);
- });
-
- $(document).on('click','#invoiceHandoverForm',function(){//发票交接单
- var datas = gloable_pm_id;
- if(datas.length == 0){
- layer.msg('请勾选订单!', {icon: 5});
- return;
- }
- setTempVal('invoiceHandoverForm', datas);
- openMainTabPageParent(tabPageId+'-23', '发票交接单', 'orderManage/invoiceHandoverForm.html?tabPageId='+tabPageId+'-23','',tabPageId,null);
- });
- </script>
- </body>
- </html>
|