文件

1136 行
58 KiB
HTML
可执行文件

<!DOCTYPE html>
<html>
<!--[1.9.9]-->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>订单详情</title>
<script src="__PUBLIC__/jquery/js/jquery-2.0.3.min.js"></script>
<script src="__PUBLIC__/js/printarea.js"></script>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/css/page-common.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/vue/element-ui.2.8.2.css"/>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/layui-v2.4.3/layui/css/layui.css"/>
<style>
#app .printitem {
box-shadow: 1px 1px 1px rgba(0, 0, 0, 0.1), -1px -1px 1px rgba(0, 0, 0, 0.1);
}
.layui-table td, .layui-table th {
border-color: black;
color: #000000;
}
.printer_header {
position: relative;
min-height: 32px;
color: #000;
}
.printer_item {
box-sizing: border-box;
padding-right: 20px;
}
.printer_title {
font-weight: bold;
text-align: center;
flex: 1;
}
.printer_header .layui-input {
border: none;
min-height: 30px;
}
.printer_title .layui-input {
height: auto;
}
.layui-table {
margin: 0px;
}
.printer_border {
border: 1px solid #e6e6e6;
}
.flexleft {
justify-content: flex-start;
align-items: center;
}
.flexright {
justify-content: flex-end;
align-items: center;
}
.flexcenter {
justify-content: center;
align-items: center;
}
.flexbetween {
justify-content: space-between;
align-items: center;
}
#printhtml {
width: 100%;
height: 100%;
overflow-y: auto;
padding-right: 280px;
box-sizing: border-box;
}
body, html {
height: 100%;
}
.layui-table td, .layui-table th {
position: relative;
padding: 4px 8px;
min-height: 20px;
}
.printer_header {
display: inline-block;
box-sizing: border-box;
padding: 0px;
padding-left: 4%;
}
.printer_item {
display: inline-block;
box-sizing: border-box;
}
.printer_item_t {
display: inline-block;
width: 70px;
}
.printer_item_i {
display: inline-block;
width: calc(100% - 80px);
border-bottom: 1px solid #333;
}
.printer_item_b {
display: inline-block;
width: calc(100% - 80px);
}
[v-cloak] {
display: none;
}
</style>
</head>
<body>
<div id="app" style="position: relative;height: 100%;box-sizing: border-box;padding: 15px;overflow: hidden;" v-cloak>
<div id="printhtml" style="padding:15px;">
<div ref="printhtml" :style="{'width':width+'px'}">
<template v-for="(goodsarr,goodspage) in allgoodsarr">
<div class="printitem" style="height: 100%;" :ref="'printitemhtml'" :style="{'width':width+'px'}">
<div class="printer_header" :style="{'width':width+'px'}">
<div class="printer_title"
:style="{'font-size': titlesize+'px','margin-bottom':marginset.titlebottom+'px'}">
<span v-text="title"></span>
</div>
</div>
<div class="printer_header" :style="{'font-size': bodysize+'px','width':width+'px'}">
<div class="printer_item" v-if="headershow.shopname"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">客户名称:</div>
<div class="printer_item_i">
<span v-text="headerinfo.shopname"></span>
</div>
</div>
<div class="printer_item" v-if="headershow.addtime"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">开单日期:</div>
<div class="printer_item_i">
<span v-text="headerinfo.addtime"></span>
<!--<input type="text" class="layui-input" v-model="headerinfo.addtime">-->
</div>
</div>
<div class="printer_item" v-if="headershow.ordernum"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">单据号:</div>
<div class="printer_item_i">
<span v-text="headerinfo.ordernum"></span>
<!--<input type="text" class="layui-input" v-model="headerinfo.ordernum">-->
</div>
</div>
<div class="printer_item" v-if="headershow.address"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">联系地址:</div>
<div class="printer_item_i">
<span v-text="headerinfo.address"></span>
<!--<input type="text" class="layui-input" v-model="headerinfo.address">-->
</div>
</div>
<div class="printer_item" v-if="headershow.phone"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">联系电话:</div>
<div class="printer_item_i">
<span v-text="headerinfo.phone"></span>
</div>
</div>
<div class="printer_item" v-if="headershow.user"
:style="{'width':95/linenum+'%','margin-bottom':marginset.headerbottom+'px'}">
<div class="printer_item_t">业务员:</div>
<div class="printer_item_i">
<span v-text="headerinfo.user"></span>
</div>
</div>
</div>
<div style="margin: 0px;margin-top: 10px;"
:style="{'font-size': bodysize+'px','margin-bottom':marginset.footerbottom+'px'}">
<table class="layui-table">
<tr :style="{'height':marginset.tableheight+'px','line-height':marginset.tableheight+'px'}">
<th v-if="tablerowshow.index">序号</th>
<th v-if="tablerowshow.goods_name">商品名称</th>
<th v-if="tablerowshow.goods_number">货号</th>
<th v-if="tablerowshow.goods_code">条码</th>
<th v-if="tablerowshow.company">单位</th>
<th v-if="tablerowshow.specifications">规格</th>
<th v-if="tablerowshow.purch_price">原价</th>
<th v-if="tablerowshow.price">单价</th>
<th v-if="tablerowshow.goods_num">数量</th>
<th v-if="tablerowshow.vip_discount">折扣</th>
<th v-if="tablerowshow.all_money">小计</th>
<th v-if="tablerowshow.remark">备注</th>
</tr>
<template v-for="(item,index) in goodsarr.goodsinfo">
<tr :style="{'height':marginset.tableheight+'px','line-height':marginset.tableheight+'px'}">
<td v-if="tablerowshow.index">{{item.index}}</td>
<td v-if="tablerowshow.goods_name">
<span>
{{item.goods_info.goods_name}}
</span>
</td>
<td v-if="tablerowshow.goods_number">
<span v-if="item.attribute_state==1">
{{item.goods_info.goods_number}}
</span>
<span v-if="item.attribute_state==2">
{{item.goods_sku_info.sku_goods_number}}
</span>
</td>
<td v-if="tablerowshow.goods_code">
<span v-if="item.attribute_state==1">
{{item.goods_info.goods_code}}
</span>
<span v-if="item.attribute_state==2">
{{item.goods_sku_info.sku_code}}
</span>
</td>
<td v-if="tablerowshow.company">
<span>
{{item.goods_info.company||'--'}}
</span>
</td>
<td v-if="tablerowshow.specifications">
<span v-if="item.attribute_state==1">
{{item.goods_info.specifications}}
</span>
<span v-if="item.attribute_state==2">
{{item.goods_sku_info.skuname}}
</span>
</td>
<td v-if="tablerowshow.purch_price">
{{item. original_price}}
</td>
<td v-if="tablerowshow.price">
{{item.price}}
</td>
<td v-if="tablerowshow.goods_num">
{{item.goods_num}}
</td>
<td v-if="tablerowshow.vip_discount">
{{item.vip_discount}}
</td>
<td v-if="tablerowshow.all_money">
{{item.all_money}}
</td>
<td v-if="tablerowshow.remark && index==0" :rowspan="goodsarr.goodsinfo.length">
{{item.remark}}
</td>
</tr>
</template>
<template v-if="goodspage== allgoodsarr.length-1 && blankfill"
v-for="(myitem,myindex) in bankarr">
<tr :style="{'height':marginset.tableheight+'px','line-height':marginset.tableheight+'px'}">
<td v-if="tablerowshow.index"><span>&nbsp;</span></td>
<td v-if="tablerowshow.goods_name"><span>&nbsp;</span></td>
<td v-if="tablerowshow.goods_number"><span>&nbsp;</span></td>
<td v-if="tablerowshow.goods_code"><span>&nbsp;</span></td>
<td v-if="tablerowshow.company"><span>&nbsp;</span></td>
<td v-if="tablerowshow.specifications"><span>&nbsp;</span></td>
<td v-if="tablerowshow.purch_price"><span>&nbsp;</span></td>
<td v-if="tablerowshow.price"><span>&nbsp;</span></td>
<td v-if="tablerowshow.goods_num"><span>&nbsp;</span></td>
<td v-if="tablerowshow.vip_discount"><span>&nbsp;</span></td>
<td v-if="tablerowshow.all_money"><span>&nbsp;</span></td>
<td v-if="tablerowshow.remark"><span>&nbsp;</span></td>
</tr>
</template>
</table>
<table class="layui-table" :style="{'font-size': totalsize+'px'}"
v-if="totalshow.pagecount || totalshow.allcount || goodspage==allgoodsarr.length-1"
style="padding-left: 0px">
<tr :style="{'height':marginset.tableheight+'px','line-height':marginset.tableheight+'px'}">
<td width="15%" :style="{'font-size': totalsize+'px'}" v-if="totalshow.pagecount">
<div class="printer_item_b flexbetween printer_title" style="width:100%">
<span style="width:25%;">本</span>
<span style="width:25%;">页</span>
<span style="width:25%;">合</span>
<span style="width:25%;">计:</span>
</div>
</td>
<td width="25%" :style="{'font-size': totalsize+'px'}" v-if="totalshow.pagecount">
<div class="printer_item_b flexright printer_title" v-text="DX(goodsarr.money)"
style="width:100%">
</div>
</td>
<td width="10%" :style="{'font-size': totalsize+'px'}" v-if="totalshow.pagecount">
<div class="printer_item_b flexleft printer_title" v-text="goodsarr.money"
style="width:100%">
</div>
</td>
<td width="15%" :style="{'font-size': totalsize+'px'}"
v-if="totalshow.allcount || goodspage==allgoodsarr.length-1">
<div class="printer_item_b flexbetween printer_title" style="width:100%">
<span>总</span>
<span>计:</span>
</div>
</td>
<td width="25%" :style="{'font-size': totalsize+'px'}"
v-if="totalshow.allcount || goodspage==allgoodsarr.length-1">
<div class="printer_item_b flexright printer_title" v-text="DX(feeinfo.all_money)"
style="width:100%">
</div>
</td>
<td width="10%" :style="{'font-size': totalsize+'px'}"
v-if="totalshow.allcount || goodspage==allgoodsarr.length-1">
<div class="printer_item_b flexleft printer_title" v-text="feeinfo.all_money"
style="width:100%">
</div>
</td>
</tr>
</table>
</div>
<div class="printer_header" :style="{'font-size': bodysize+'px','width':width+'px'}"
v-if="footershow.address ||footershow.phone||footershow.linkman ">
<div class="printer_item" v-if="footershow.address"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">发货地址:</div>
<div class="printer_item_b">
<span v-text="shipments.address"></span>
</div>
</div>
<div class="printer_item" v-if="footershow.phone"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">电话:</div>
<div class="printer_item_b">
<span v-text="shipments.tel"></span>
</div>
</div>
<div class="printer_item" v-if="footershow.linkman"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">联系人:</div>
<div class="printer_item_b">
<span v-text="shipments.linkman"></span>
</div>
</div>
</div>
<div class="printer_header" :style="{'font-size': bodysize+'px','width':width+'px'}"
v-if="allshowfeeinfo">
<div class="printer_item" v-if="showfeeinfo.all_money"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">总费用:</div>
<div class="printer_item_b">
<span v-text="feeinfo.all_money"></span>
</div>
</div>
<div class="printer_item" v-if="showfeeinfo.delivery_fee"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">配送费:</div>
<div class="printer_item_b">
<span v-text="feeinfo.delivery_fee"></span>
</div>
</div>
<div class="printer_item" v-if="showfeeinfo.coupon_money && showfeeinfo.coupon_money>0"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">优惠券抵:</div>
<div class="printer_item_b">
<span v-text="feeinfo.coupon_money"></span>
</div>
</div>
<div class="printer_item" v-if="showfeeinfo.all_dis_money"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">其他优惠:</div>
<div class="printer_item_b">
<span v-text="feeinfo.all_dis_money"></span>
</div>
</div>
<div class="printer_item" v-if="showfeeinfo.refund_money"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">退款:</div>
<div class="printer_item_b">
<span v-text="feeinfo.refund_money"></span>
</div>
</div>
<div class="printer_item" v-if="showfeeinfo.small_changes_money"
:style="{'width':95/linenum+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">抹零:</div>
<div class="printer_item_b">
<span v-text="feeinfo.small_changes_money"></span>
</div>
</div>
<div class="printer_item"
:style="{'width':50+'%','margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t">下单时间:</div>
<div class="printer_item_b">
<span>{$bill['place_time']}</span>
</div>
</div>
</div>
<div class="printer_header" :style="{'font-size': bodysize+'px','width':width+'px'}"
v-if="footershow.tips">
<div class="printer_item" style="width: 100%"
:style="{'margin-bottom':marginset.footerbottom+'px'}">
<div class="printer_item_t" style="width: 100%">
<span v-text="shipments.tips"></span>
</div>
</div>
</div>
<div class="printer_header" :style="{'font-size': bodysize+'px','width':width+'px'}"
v-if="footershow.pageshow">
<div class="printer_item flexcenter" style="width: 100%;text-align: center"
v-text="'第 '+(goodspage+1)+' 页,共'+allpage+'页'"></div>
</div>
</div>
</template>
</div>
</div>
<div style="height: 40px;position: fixed;top:10px;right:10px" v-if="!showPrintSet">
<el-button type="primary" @click="showPrintSet=true">打印及设置</el-button>
</div>
<retail-drawer :show.sync="showPrintSet"
width="400px" height="100vh"
:show-model="false" title="设置及打印">
<template slot="body">
<el-scrollbar style="width: 100%;height: calc(100vh - 100px);">
<el-form size="small" label-width="130px" style="padding: 5px 15px 0">
<el-form-item label="打印界面宽">
<el-input-number v-model="width" :precision="0" :step="1" :max="1000000"
:min="0"></el-input-number>
</el-form-item>
<el-form-item label="每页商品数">
<el-input-number v-model="limit" :precision="0" :step="1" :max="1000000"
:min="1"></el-input-number>
</el-form-item>
<el-form-item label="头部底部每行显示">
<el-input-number v-model="linenum" :precision="0" :step="1" :max="3" :min="2"></el-input-number>
</el-form-item>
<el-form-item label="尾页是否填充空白行" label-width="150px">
<el-switch v-model="blankfill"
:active-text="blankfill?'是':'否'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-collapse accordion>
<el-collapse-item>
<template slot="title">
<el-form-item label="标题及字体" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="标题设置">
<el-input-number v-model="titlesize" :precision="0"
:step="1" :max="28" :min="12"></el-input-number>
<br>
<el-input v-model="title" placeholder="自定义标题" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="统计字体">
<el-input-number v-model="totalsize" :precision="0"
:step="1" :max="28" :min="12"></el-input-number>
</el-form-item>
<el-form-item label="其他字体">
<el-input-number v-model="bodysize" :precision="0"
:step="1" :max="28" :min="12"></el-input-number>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="间距和表格宽度" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="标题和头部">
<el-input-number v-model="marginset.titlebottom" :precision="0"
:step="1" :max="1000" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="头部与表格">
<el-input-number v-model="marginset.headerbottom" :precision="0"
:step="1" :max="1000" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="底部与表格">
<el-input-number v-model="marginset.footerbottom" :precision="0"
:step="1" :max="1000" :min="0"></el-input-number>
</el-form-item>
<el-form-item label="表格格高">
<el-input-number v-model="marginset.tableheight" :precision="0"
:step="1" :max="1000" :min="32"></el-input-number>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="头部数据" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="客户名称">
<el-switch v-model="headershow.shopname"
:active-text="headershow.shopname?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.shopname" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="开单时间">
<el-switch v-model="headershow.addtime"
:active-text="headershow.addtime?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.addtime" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="单据号">
<el-switch v-model="headershow.ordernum"
:active-text="headershow.ordernum?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.ordernum" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="联系地址">
<el-switch v-model="headershow.address"
:active-text="headershow.address?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.address" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="联系电话">
<el-switch v-model="headershow.phone"
:active-text="headershow.phone?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.phone" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="业务员">
<el-switch v-model="headershow.user"
:active-text="headershow.user?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="headerinfo.user" style="width: 220px"></el-input>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="表格数据" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="序号">
<el-switch v-model="tablerowshow.index"
:active-text="tablerowshow.index?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品名称">
<el-switch v-model="tablerowshow.goods_name"
:active-text="tablerowshow.goods_name?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品货号">
<el-switch v-model="tablerowshow.goods_number"
:active-text="tablerowshow.goods_number?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品条码">
<el-switch v-model="tablerowshow.goods_code"
:active-text="tablerowshow.goods_code?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品单位">
<el-switch v-model="tablerowshow.company"
:active-text="tablerowshow.company?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品规格">
<el-switch v-model="tablerowshow.specifications"
:active-text="tablerowshow.specifications?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品原价">
<el-switch v-model="tablerowshow.purch_price"
:active-text="tablerowshow.purch_price?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品价格">
<el-switch v-model="tablerowshow.price"
:active-text="tablerowshow.price?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品数量">
<el-switch v-model="tablerowshow.goods_num"
:active-text="tablerowshow.goods_num?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="会员折扣">
<el-switch v-model="tablerowshow.vip_discount"
:active-text="tablerowshow.vip_discount?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="商品小计">
<el-switch v-model="tablerowshow.all_money"
:active-text="tablerowshow.all_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="备注">
<el-switch v-model="tablerowshow.remark"
:active-text="tablerowshow.remark?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="统计设置" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="本页合计">
<el-switch v-model="totalshow.pagecount"
:active-text="totalshow.pagecount?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="总计">
<el-switch v-model="totalshow.allcount"
:active-text="totalshow.allcount?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="底部数据设置" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="发货地址">
<el-switch v-model="footershow.address"
:active-text="footershow.address?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="shipments.address" type="textarea" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="电话">
<el-switch v-model="footershow.phone"
:active-text="footershow.phone?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="shipments.tel" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="联系人">
<el-switch v-model="footershow.linkman"
:active-text="footershow.linkman?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="shipments.linkman" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="提示">
<el-switch v-model="footershow.tips"
:active-text="footershow.tips?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
<el-input v-model="shipments.tips" style="width: 220px"></el-input>
</el-form-item>
<el-form-item label="页码">
<el-switch v-model="footershow.pageshow"
:active-text="footershow.pageshow?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
</el-collapse-item>
<el-collapse-item>
<template slot="title">
<el-form-item label="费用栏目" style="margin-bottom: 0"></el-form-item>
</template>
<el-form-item label="总费用">
<el-switch v-model="showfeeinfo.all_money"
:active-text="showfeeinfo.all_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="整单折扣">
<el-switch v-model="showfeeinfo.all_dis_money"
:active-text="showfeeinfo.all_dis_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="配送费">
<el-switch v-model="showfeeinfo.delivery_fee"
:active-text="showfeeinfo.delivery_fee?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="优惠券抵扣">
<el-switch v-model="showfeeinfo.coupon_money"
:active-text="showfeeinfo.coupon_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="退款金额">
<el-switch v-model="showfeeinfo.refund_money"
:active-text="showfeeinfo.refund_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
<el-form-item label="抹零金额">
<el-switch v-model="showfeeinfo.small_changes_money"
:active-text="showfeeinfo.small_changes_money?'显示':'隐藏'"
:inactive-value="false"
:active-value="true"></el-switch>
</el-form-item>
</el-collapse-item>
</el-collapse>
</el-form>
</el-scrollbar>
<div style="display: flex;align-items: center;justify-content: center;border-top: 1px solid #EBEEF5;padding-top: 10px">
<el-button size="small" @click="reSetSetAndFooterMsg">重置设置</el-button>
<el-button size="small" type="primary" plain @click="toPrint">打印</el-button>
<el-button size="small" type="primary" @click="setPrintConf">保存设置</el-button>
</div>
</template>
</retail-drawer>
<div id="dayin">
</div>
</div>
<input type="hidden" id="floworderid" value="{$id}">
<script type="text/javascript" src="__PUBLIC__/vue/js/vue2.5.16.js"></script>
<script type="text/javascript" src="__PUBLIC__/vue/element-ui.2.8.2.js"></script>
<script type="text/javascript" src="__PUBLIC__/js/drawer.js"></script>
<script type="text/javascript" src="__PUBLIC__/retails/js/LodopFuncs.js?v=1.0"></script>
<script type="text/javascript">
var app = new Vue({
el: '#app',
data: function () {
return {
linenum: 3,
showgoods: false,
orderid: $('#floworderid').val(),
canchangenum: false,
settimeouttimer: "",
shade: false,
keyword: "",
shade2: false,
searchgoodsinfo: {},
goodsarr: [],
bankarr: [],
allgoodsarr: [], // 全部
skudetail: false,
skuAttr: [],
skuList: [],
len: 0,
allnum: 0,
all_money: 0,
pagemoney: 0,
chinesepagemoney: '',
chineseall_money: '',
shipments: {
address: '发货地址(可编辑)',
tel: '联系电话(可编辑)',
linkman: '联系人(可编辑)',
tips: '第一联:存根(白) 第二联:客户(红) 第三联:记账(黄) (可编辑)'
},
headershow: {
shopname: true,
addtime: true,
ordernum: true,
address: true,
phone: true,
user: true
},
tablerowshow: {
index: true,
goods_name: true,
goods_number: true,
goods_code: true,
company: true,
specifications: true,
purch_price: true,
price: true,
goods_num: true,
all_money: true,
remark: true,
vip_discount: true
},
totalshow: {
pagecount: true,
allcount: true
},
footershow: {
address: true,
linkman: true,
phone: true,
tips: true,
pageshow: true
},
width: 750,
blankfill: true,
limit: 5,
titlesize: 24,
totalsize: 16,
bodysize: 14,
title: 'XXX零售商品批发中心(可编辑)',
marginset: {
footerbottom: 10,
headerbottom: 10,
titlebottom: 30,
tableheight: 30
},
sethtmlwidth: 300,
showfeeinfo: {
all_money: true,
coupon_money: true,
refund_money: true,
all_dis_money: true,
small_changes_money: true,
delivery_fee: true
},
allpage: 1,
page: 1,
headerinfo: {
shopname: `{$address.name}`,
addtime: "{:date('Y-m-d')}",
ordernum: "{$bill['order_no']}",
address: `{$address.address}`,
phone: `{$address.phone}`,
user: ''
},
setactive: -1,
pagesarr: [],
allchecked: false,
feeinfo: {
all_money: "{$bill['all_money']}",
coupon_money: "{$bill['coupon_money']}",
refund_money: "{$bill['refund_money']}",
all_dis_money: "{$bill['all_dis_money']}",
small_changes_money: "{$bill['small_changes_money']}",
delivery_fee: "{$bill['delivery_fee']}"
},
allshowfeeinfo: true,
showPrintSet: true,
}
},
created() {
this.getgoodsarr();
var mydata = localStorage.getItem('merchant_orderprintset');
if (mydata) {
mydata = JSON.parse(mydata, true);
if (!mydata.tablerowshow.price) {
mydata.tablerowshow.price = true;
}
this.shipments = mydata.shipments;
this.headershow = mydata.headershow;
this.tablerowshow = mydata.tablerowshow;
this.totalshow = mydata.totalshow;
this.footershow = mydata.footershow;
this.width = mydata.width;
this.blankfill = mydata.blankfill;
this.limit = mydata.limit;
this.titlesize = mydata.titlesize;
this.totalsize = mydata.totalsize;
this.bodysize = mydata.bodysize;
this.title = mydata.title;
this.marginset = mydata.marginset;
this.sethtmlwidth = mydata.sethtmlwidth;
this.showfeeinfo = mydata.showfeeinfo;
this.$nextTick(() => {
this.setPrintConf();
localStorage.removeItem('merchant_orderprintset');
})
} else {
this.getPrintConf();
}
},
methods: {
setPrintConf() {
let data = {
shipments: this.shipments,
headershow: this.headershow,
tablerowshow: this.tablerowshow,
totalshow: this.totalshow,
footershow: this.footershow,
width: this.width,
blankfill: this.blankfill,
limit: this.limit,
bodysize: this.bodysize,
titlesize: this.titlesize,
totalsize: this.totalsize,
title: this.title,
marginset: this.marginset,
sethtmlwidth: this.sethtmlwidth,
showfeeinfo: this.showfeeinfo
};
$.ajax({
url: '/index.php/Retail/WebPrint/storeStyleSet',
type: 'post',
data: {
style_set: JSON.stringify(data),
set_type: 2,
},
success: (res) => {
if (res.status == 1) {
console.log(1);
this.$message.success(res.message);
} else {
this.$message.error(res.message);
}
}
});
},
getPrintConf() {
$.ajax({
url: '/index.php/Retail/WebPrint/storeGetPrintSet',
type: 'post',
data: {
set_type: 2,
},
success: (res) => {
if (res.status == 1) {
if (res.data) {
let data = JSON.parse(res.data, true);
if (!data.tablerowshow.price) {
data.tablerowshow.price = true;
}
this.shipments = data.shipments;
this.headershow = data.headershow;
this.tablerowshow = data.tablerowshow;
this.totalshow = data.totalshow;
this.footershow = data.footershow;
this.width = data.width;
this.blankfill = data.blankfill;
this.limit = data.limit;
this.titlesize = data.titlesize;
this.totalsize = data.totalsize;
this.bodysize = data.bodysize;
this.title = data.title;
this.marginset = data.marginset;
this.sethtmlwidth = data.sethtmlwidth;
this.showfeeinfo = data.showfeeinfo;
}
}
}
})
},
reSetSetAndFooterMsg: function () {
this.shipments = {
address: '发货地址(可编辑)',
tel: '联系电话(可编辑)',
linkman: '联系人(可编辑)',
tips: '第一联:存根(白) 第二联:客户(红) 第三联:记账(黄) (可编辑)'
};
this.headershow = {
shopname: true,
addtime: true,
ordernum: true,
address: true,
phone: true,
user: true
};
this.tablerowshow = {
index: true,
goods_name: true,
goods_number: true,
goods_code: true,
company: true,
specifications: true,
purch_price: true,
price: true,
goods_num: true,
all_money: true,
remark: true,
vip_discount: true
};
this.totalshow = {
pagecount: true,
allcount: true
};
this.footershow = {
address: true,
linkman: true,
phone: true,
tips: true,
pageshow: true
};
this.width = 750;
this.blankfill = true;
this.limit = 5;
this.titlesize = 24;
this.totalsize = 16;
this.bodysize = 14;
this.title = 'XXX零售商品批发中心(可编辑)';
this.marginset = {
footerbottom: 10,
headerbottom: 10,
titlebottom: 30,
tableheight: 30
};
this.sethtmlwidth = 300;
this.showfeeinfo = {
all_money: true,
coupon_money: true,
refund_money: true,
all_dis_money: true,
small_changes_money: true,
delivery_fee: true
};
this.setPrintConf();
},
getgoodsarr: function () {
var orderid = this.orderid;
var app = this;
var limit = this.limit;
$.ajax({
url: "{:U('orderDatainfo')}",
data: {
id: orderid,
limit: limit
},
type: 'post',
success: function (res) {
if (res.status == 1) {
app.allgoodsarr = res.allgoodsarr;
app.pagemoney = res.pagemoney;
app.len = res.info.allcount;
app.allnum = res.info.allnum;
app.all_money = res.info.all_money;
var allpage = Math.ceil(res.info.allcount / limit);
app.allpage = allpage;
var yu = res.info.allcount % limit;
var banarr = [];
if (yu != 0) {
for (var i = 0; i < limit - yu; i++) {
banarr.push(1);
}
}
app.bankarr = banarr;
var pagesarr = [];
for (var j = 0; j < allpage; j++) {
pagesarr.push({
'index': j,
'checked': false
});
}
app.pagesarr = pagesarr;
} else {
app.allgoodsarr = [];
}
},
error: (error) => {
this.$message.error('错误了。。。')
}
})
},
toPrint: function () {
var strStyleCSS = "",
styles = document.querySelectorAll('style,link');
for (var i = 0; i < styles.length; i++) {
strStyleCSS += styles[i].outerHTML;
}
var str = $("#printhtml").html();
str = strStyleCSS + "<body>" + str + "</body>";
$("#dayin").html(str);
$("#dayin").printArea();
$("#dayin").html("");
},
DX: function (n) {
return DX(n);
},
},
computed: {},
watch: {
pagemoney: function (n) {
this.chinesepagemoney = DX(n);
},
all_money: function (n) {
this.chineseall_money = DX(n);
},
limit: function (n, o) {
this.getgoodsarr();
},
pagesarr: {
handler: function (n, o) {
var allchecked = true;
for (var i = 0; i < n.length; i++) {
if (!n[i]['checked']) {
allchecked = false;
break;
}
}
// console.log(allchecked);
this.allchecked = allchecked;
},
deep: true
},
showfeeinfo: {
handler: function (n, o) {
var allchecked = false;
for (var i in n) {
if (n[i]) {
allchecked = true;
break;
}
}
console.log(allchecked);
this.allshowfeeinfo = allchecked;
},
deep: true
},
}
})
function DX(n) {
if (!n && !isNaN(Number(n))) {
return "";
}
if (!/^(0|[1-9]\d*)(\.\d+)?$/.test(n)) {
return "不是正确的金额";
}
var unit = "仟佰拾亿仟佰拾万仟佰拾元角分", str = "";
n += "00";
var p = n.indexOf('.');
if (p >= 0) {
n = n.substring(0, p) + n.substr(p + 1, 2);
}
unit = unit.substr(unit.length - n.length);
for (var i = 0; i < n.length; i++) {
str += '零壹贰叁肆伍陆柒捌玖'.charAt(n.charAt(i)) + unit.charAt(i);
}
return str.replace(/零(仟|佰|拾|角)/g, "零").replace(/(零)+/g, "零").replace(/零(万|亿|元)/g, "$1").replace(/(亿)万|壹(拾)/g, "$1$2").replace(/^元零?|零分/g, "").replace(/元$/g, "元整");
}
</script>
</body>
</html>