美文网首页
lodop打印小票

lodop打印小票

作者: 奋斗live | 来源:发表于2018-06-24 11:18 被阅读0次
    <!DOCTYPE html>
    <html lang="zh-cn">
       <head>
          <meta charset="utf-8">
          <meta http-equiv="X-UA-Compatible" content="IE=edge">
          <meta name="viewport" content="width=device-width, initial-scale=1">
          <title>{$CONF['shopTitle']['fieldValue']}后台管理中心</title>
          <script src="LodopFuncs.js"></script>
       </head>
       <body class="ykwl-page">
           <form name="myform" method="post" id="myform">
            <input type='hidden' id='id' value='{$object.bankId}'/>
            <table class="table table-hover table-striped table-bordered ykwl-form">
               <tr>
                 <td style=" background: #f9f9f9;">
                 <span style='font-weight:bold;' id="orderNo">订单号:{$object['orderNo']}</span>
                 <span style='margin-left:100px;'>
                                           订单状态:<if condition="$object['orderStatus'] eq 2">未付款
                   <elseif condition='$object["orderStatus"] eq 0'/>未受理
                   <elseif condition='$object["orderStatus"] eq 1'/>待配送
                   <elseif condition='$object["orderStatus"] eq 3'/>配送中
                   <elseif condition='$object["orderStatus"] eq 4'/>用户确认到货
                   <elseif condition='$object["orderStatus"] eq 7'/>商户确认到货
                   <elseif condition='$object["orderStatus"] eq 5'/>店铺拒接单
                   <elseif condition='$object["orderStatus"] eq 6'/>过期自动取消
                   <else />用户取消
                   </if>
                 </span></td>
               </tr>
               <tr>
                 <td style='font-weight:bold; background: #f9f9f9;'>订单信息</td>
               </tr>
               <tr>
                 <td>
                 <table width='700'>
                    <tr>
                      <td width='120' style='text-align:right'>支付方式:</td>
                      <td>
                      在线支付
                      </td>
                    </tr>
                    <tr>
                      <td style='text-align:right'>配送方式:</td>
                      <td>
                      <if condition='$object["isSelf"] eq 1'>
                                                                      自提
                      <else/>
                        <if condition='$object["deliverType"] eq 1'>店铺配送<else/>商城配送</if>
                      </if>                                                
                      </td>
                    </tr>
                    <notempty name="name">
                    <tr>
                      <td style='text-align:right'>送货时间:</td>
                      <td>{$object['requireTime']}
                      </td>
                    </tr>
                    </notempty>
                    </table>
                 </td>
               </tr>
               <if condition='$object["isRefund"] eq 1'>
               <tr>
                 <td style='font-weight:bold;'>退款说明</td>
               </tr>
               <tr>
                 <td>
                 <table width='700'>
                    <tr>
                      <td width='120' style='text-align:right'>说明:</td>
                      <td>
                      {$object['refundRemark']}
                      </td>
                    </tr>
                    </table>
                 </td>
               </tr>
               </if>
               <if condition='$object["isInvoice"] eq 1'>
               <tr>
                 <td style='font-weight:bold;'>发票信息</td>
               </tr>
               <tr>
                 <td>
                 <table width='700'>
                    <tr>
                      <td width='120' style='text-align:right'>发票抬头:</td>
                      <td>
                      {$object['invoiceClient']}
                      </td>
                    </tr>
                    </table>
                 </td>
               </tr>
               </if>
               <tr>
                 <td style='font-weight:bold; background: #f9f9f9;'>收货人信息</td>
               </tr>
               <tr>
                 <td>
                    <table width='700'>
                    <tr>
                      <td width='120' style='text-align:right'>收货人:</td>
                      <td>{$object['userName']}</td>
                    </tr>
                    <tr>
                      <td style='text-align:right'>地址:</td>
                      <td>{$object['userAddress']}</td>
                    </tr>
                    <tr>
                      <td style='text-align:right'>联系方式:</td>
                      <td>
                      <notmpty name='object['userPhone']'>
                      {$object['userPhone']}
                      </notmpty>
                      <notmpty name='object['userTel']'>
                      {$object['userTel']}
                      </notmpty>
                      </td>
                    </tr>
                    </table>
                 </td>
               </tr>
               <tr>
                  <td style='font-weight:bold; background: #f9f9f9;'>商品信息</td>
               </tr>
               <tr>
                  <td style=" padding:0;">
                    <table width="100%" cellspadding="0" sellpadding="0" class="shopdetials">
                    <tr>
                       <th width='70' colspan='1'>商品图片</th>
                      <th width='450' colspan='1'>商品名称</th>
                      <th width='350'>价格</th>
                      <th width='130'>数量</th>
                      <th width='130'>总金额</th>
                    </tr>
                    <volist name="object['goodslist']" id="goods">
                    <tr>
                      <td width='50'><img src='http://{:session("UULIFE_SHOP.mallDomain")}/{$goods["goodsImg"]}' style='margin:2px;' width='50' height='50'/></td>
                      <td width='400' style='text-align:left; padding-left:10px;'>{$goods["goodsName"]}<if condition="$goods['goodsAttrName'] neq ''">【{$goods['goodsAttrName']}】</if></td>
                      <td width='350'>¥{$goods["goodsPrice"]}</td>
                      <td width='130'>{$goods["goodsNums"]}</td>
                      <td width='130'>¥{$goods["goodsPrice"]*$goods["goodsNums"]}</td>
                    </tr>
                    </volist>
                    </table>
                  </td>
               </tr>
               <tr>
                  <td style='text-align:right;padding-right:10px; padding-top:30px;'>商品总金额:¥{$object['totalMoney']}<br/>+ 运费:¥{$object['deliverMoney']}<br/>- 优惠券:¥
                  <notempty name="object['disc']">{$object['disc']}
                  <else />0.00</notempty>
                  <br/>
                  <if condition='$object["useScore"] gt 0'>使用积分:{$object["useScore"]} 点<br/></if>
                  <span>订单金额:</span><span style='font-weight:bold;font-size:20px;color:red;'>¥{$object['totalMoney']+$object['deliverMoney']}</span><br/>
                  <span style='font-weight:bold;font-size:20px'>实付金额:</span><span style='font-weight:bold;font-size:20px;color:red;'>¥{$object['realTotalMoney']}</span></td>
               </tr>
               <tr>
                 <td colspan='2' align='center'>
                     <button type="button" class="btn btn-primary" onclick='javascript:location.href=history.go(-1);'>返&nbsp;回</button>
                      <button type="button" class="btn btn-primary" onclick="excelExport()">打&nbsp;印</button>
                 </td>
               </tr>
            </table>
           </form>
    <script language="javascript" type="text/javascript"> 
        var LODOP; //声明为全局变量
        function OpenPreview() {
                LODOP = getLodop(document.getElementById('LODOP_X'),document.getElementById('LODOP_EM'));
                //打印时间
                //nowTime = getDate();
                //订单号
                //orderNo = $("#orderNo").text();
                //
                LODOP.NEWPAGEA();
                //LODOP.ADD_PRINT_RECT(10,18,324,392,0,1);
                LODOP.ADD_PRINT_TEXT(30,10,258,54,"****#1 尤友订单****");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                
                LODOP.ADD_PRINT_TEXT(80,50,258,54,"中交和美新城(后门)");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",10);
                
                LODOP.ADD_PRINT_TEXT(120,40,258,54,"--已在线支付--");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                
                LODOP.ADD_PRINT_TEXT(150,15,258,54,"................................");
                LODOP.ADD_PRINT_TEXT(180,15,258,54,"【下单时间】2018-12-01 04:02:00");
                LODOP.ADD_PRINT_TEXT(210,15,258,54,"..............商品..............");
                //商品列表
                LODOP.ADD_PRINT_TEXT(230,15,100,54,"蒙牛奶特香草味牛奶243ml*12盒");
                LODOP.ADD_PRINT_TEXT(230,130,40,54,"*1");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",14);
                LODOP.ADD_PRINT_TEXT(230,170,40,54,"22");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",14);
                
                LODOP.ADD_PRINT_TEXT(270,15,100,54,"蒙牛未来星妙妙儿童成长牛奶原味125ml*20盒");
                LODOP.ADD_PRINT_TEXT(270,130,40,54,"*1");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",14);
                LODOP.ADD_PRINT_TEXT(270,170,40,54,"22");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",14);
                //其他
                LODOP.ADD_PRINT_TEXT(320,15,258,54,"..............其他..............");
                LODOP.ADD_PRINT_TEXT(340,15,258,54,"配送费:0.00元");
                LODOP.ADD_PRINT_TEXT(360,15,258,54,"优惠券:0.00元");
                LODOP.ADD_PRINT_TEXT(380,15,258,54,"商品总金额:0.00元");
                LODOP.ADD_PRINT_TEXT(400,15,258,54,"................................");
                //总计
                LODOP.ADD_PRINT_TEXT(420,15,258,54,"总计:");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                LODOP.ADD_PRINT_TEXT(420,100,100,54,"¥136.06");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                //地址
                LODOP.ADD_PRINT_TEXT(460,15,200,54,"海上五月花5期天马路海上五月花5期7幢1001");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                //收货人
                LODOP.ADD_PRINT_TEXT(540,15,200,54,"依恋");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                LODOP.ADD_PRINT_TEXT(570,15,200,54,"18859669092");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                LODOP.ADD_PRINT_TEXT(600,10,258,54,"*******#1 完******");
                LODOP.SET_PRINT_STYLEA(0,"fontsize",16);
                //设定打印页面大小
                LODOP.SET_PRINT_PAGESIZE(3,590,45,"订单页面");
                LODOP.PREVIEW();        
        };
        if (needCLodop()) {
            window.On_CLodop_Opened=function(){
                OpenPreview();                          
                window.On_CLodop_Opened=null;
            };                  
        } else 
            window.onload = function(){
            OpenPreview();
        };
        
        
    function getDate() {
        var date = new Date();
        var seperator1 = "-";
        var seperator2 = ":";
        var month = date.getMonth() + 1;
        var strDate = date.getDate();
        if (month >= 1 && month <= 9) {
            month = "0" + month;
        }
        if (strDate >= 0 && strDate <= 9) {
            strDate = "0" + strDate;
        }
        var currentdate = date.getFullYear() + seperator1 + month + seperator1 + strDate
                + " " + date.getHours() + seperator2 + date.getMinutes()
                + seperator2 + date.getSeconds();
        return currentdate;
    }
    </script>
       </body>
    </html>
    

    相关文章

      网友评论

          本文标题:lodop打印小票

          本文链接:https://www.haomeiwen.com/subject/xnhclxtx.html