文件
mashangyoujiu/Application/Retail/View/Sale/recebles.html

413 行
20 KiB
HTML
可执行文件

<!--[1.9.20]-->
<link rel="stylesheet" href="/Public/Retail/css/order-details.css">
<link rel="stylesheet" href="/Public/css/component-serial.css">
<link rel="stylesheet" href="/Public/css/component-serial-modify-record.css">
<link rel="stylesheet" href="/Public/css/component-blessing.css">
<div id="receblesApp" v-cloak>
<div class="page-tips">
<p>默认展示当月数据</p>
</div>
<el-form :inline="true" size="small">
<el-form-item>
<date-picker-range :date-time.sync="time"></date-picker-range>
</el-form-item>
<el-form-item>
<el-input placeholder="订单号搜索" type="text" class="page-input" v-model="order_no" clearable
@keydown.enter.exact.native.prevent="search">
</el-input>
</el-form-item>
<el-form-item v-if="!mecPayType">
<el-input placeholder="会员号搜索" type="text" class="page-input" v-model="member_number" clearable
@keydown.enter.exact.native.prevent="search" style="width:193px">
</el-input>
</el-form-item>
<el-form-item>
<select-cashier :cashier-id.sync="cashier_id"></select-cashier>
</el-form-item>
<el-form-item>
<select-bill-pay-type :pay-type.sync="pay_type" :need-other-pay="true" :other-pay-id.sync="other_type">
</select-bill-pay-type>
</el-form-item>
<el-form-item>
<el-select v-model="order_type" placeholder="选择订单类型" clearable>
<el-option label="购买订单" value="1"></el-option>
<el-option label="退款订单" value="2"></el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-select v-model="user_type" placeholder="选择用户类型" clearable>
<el-option v-if="!mecPayType" label="会员" value="1"></el-option>
<el-option v-if="mecPayType" label="德育币会员" value="3"></el-option>
<el-option label="散客" value="2"></el-option>
</el-select>
</el-form-item>
<template v-if="mecPayType">
<el-form-item>
<el-input placeholder="德育币会员ID/名称" type="text" class="page-input" v-model="mec_vip_key" clearable
@keydown.enter.exact.native.prevent="search" style="width:193px">
</el-input>
</el-form-item>
<el-form-item>
<el-input placeholder="德育币村镇ID" type="text" class="page-input" v-model="mec_villages_id" clearable
@keydown.enter.exact.native.prevent="search" style="width:193px">
</el-input>
</el-form-item>
</template>
<el-form-item>
<el-button type="primary" @click="search">查询</el-button>
<el-button v-if="storeAuth.data_export==1 && operate.export" @click="exportRec">导出
</el-button>
</el-form-item>
</el-form>
<div class="table-top-card-box">
<div class="table-top-card">
<div class="table-top-card-header">销售笔数</div>
<div class="table-top-card-body">{{sell_count}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">销售总额</div>
<div class="table-top-card-body">{{sell_money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">退款笔数</div>
<div class="table-top-card-body">{{refund_count}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">退款总额</div>
<div class="table-top-card-body">{{refund_money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">实收总额</div>
<div class="table-top-card-body">{{money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">会员折扣金额</div>
<div class="table-top-card-body">{{dismoney}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">收银单品折扣金额</div>
<div class="table-top-card-body">{{cashier_manual_money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">收银整单折扣金额</div>
<div class="table-top-card-body">{{cashierdiscountmoney}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">优惠券总额</div>
<div class="table-top-card-body">{{exchange_money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">代金券总额</div>
<div class="table-top-card-body">{{pay_coupon_money}}</div>
</div>
<div class="table-top-card">
<div class="table-top-card-header">抹零</div>
<div class="table-top-card-body">{{small_changes_money}}</div>
</div>
</div>
<div style="max-width: calc(100vw - 208px);margin-top: 20px;">
<el-table border :data="list" size="mini" max-height="500"
:header-cell-style="{background:'#F5F7FA',color:'#606266'}">
<el-table-column align="center" type="index" label="序号" width="50"></el-table-column>
<el-table-column align="center" prop="order_no" label="订单号" show-overflow-tooltip min-width="180">
</el-table-column>
<el-table-column align="center" prop="vip_name" label="消费对象" min-width="80" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="vip_mobile" label="会员手机号" min-width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="card_key" label="实体卡号" min-width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="all_money" label="支付金额" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<el-button type="text" size="mini"
@click="details_order_no=scope.row.order_no;showPayDetails=true;">
{{scope.row.all_money}}
</el-button>
</template>
</el-table-column>
<el-table-column align="center" prop="use_integral" label="使用积分" min-width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column prop="pay_name" align="center" label="支付类型" width="120"></el-table-column>
<el-table-column align="center" prop="add_time" label="消费时间" min-width="140" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="adminname" label="收银员" min-width="80" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="guide_name" label="导购员" min-width="80" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" label="优惠券" min-width="100" show-overflow-tooltip>
<template slot-scope="scope">
<template v-if="scope.row.reduction==2">
<p v-if="scope.row.coupon_money">{{scope.row.coupon_money}}</p>
<p v-if="scope.row.pay_coupon_fee">{{scope.row.pay_coupon_fee}}</p>
</template>
<span v-else>——</span>
</template>
</el-table-column>
<el-table-column align="center" prop="discount" label="手动折扣" min-width="120" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="cashier_dis_money" label="手动折扣优惠" min-width="100"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="cashier_manual_money" label="单品折扣优惠" min-width="100"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="vip_dis_money" label="会员价及会员折扣优惠" min-width="150"
show-overflow-tooltip></el-table-column>
<el-table-column align="center" prop="small_changes_money" label="抹零" min-width="60" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="total_discount" label="总优惠" min-width="100" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="status_name" label="订单类型" min-width="80" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" prop="business_remark" label="订单备注" min-width="80" show-overflow-tooltip>
</el-table-column>
<el-table-column align="center" fixed="right" label="操作" width="170">
<template slot-scope="scope">
<el-button type="text" size="mini"
@click="details_order_no=scope.row.order_no;showOrderDetails=true">
详情
</el-button>
<el-button type="text" @click="wifi(scope.row.id)" v-if="operate.wifiPrint" size="mini">wifi打印
</el-button>
<el-button type="text" @click="print(scope.row.id)" v-if="operate.orderPrint" size="mini">打印单据
</el-button>
<el-button v-if="blessingAuthority" type="text" @click="openBlessingDialog(scope.row.id)"
size="mini">
祝福
</el-button>
</template>
</el-table-column>
<div slot="empty" v-if="!loading">暂无数据</div>
<div slot="empty" v-else><span class="el-icon-loading"></span></div>
</el-table>
<el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="currentPage"
:page-sizes="[10, 15, 20, 25, 30, 35, 40, 45, 50]" :page-size="100"
layout="total, sizes, prev, pager, next, jumper" :total="currentLen">
</el-pagination>
</div>
<!--订单详情-->
<order-details :show.sync="showOrderDetails" :order-no="details_order_no"></order-details>
<!--支付详情-->
<pay-order-details :show.sync="showPayDetails" order-genre="0" :order-no="details_order_no"></pay-order-details>
<!-- 祝福语 -->
<component-blessing :visible.sync="blessingDialogVisible" :id="blessingOrderId"></component-blessing>
</div>
<script src="/Public/Retail/js/select-cashier.js"></script>
<script src="/Public/Retail/js/select-pay-type.js"></script>
<script src="/Public/js/component-serial.js?v=1.0.0"></script>
<script src="/Public/js/component-serial-modify-record.js?v=1.0.0"></script>
<script src="/Public/Retail/js/order-details.js"></script>
<script src="/Public/js/component-blessing.js?v=1.0.0"></script>
<script type="text/javascript">
var receblesApp = new Vue({
el: '#receblesApp',
data: {
list: [],
currentPage: 1,
currentLimit: 10,
currentLen: 0,
operate: {},
sell_count: '',
refund_count: '',
sell_money: '',
refund_money: '',
money: '',
exchange_money: '',
dismoney: '',
cashier_manual_money: '',
cashierdiscountmoney: '',
small_changes_money: '',
pay_coupon_money: '',
time: '',
order_no: '',
member_number: '',
mec_vip_key: '',
mec_villages_id: '',
cashier_id: '',
pay_type: '',
order_type: '',
user_type: '',
showOrderDetails: false,
showPayDetails: false,
loading: false, // 加载
other_type: '', // 其他支付类型
details_order_no: '',//查看详情的订单号
blessingDialogVisible: false, //祝福语组件开关
blessingOrderId: null, //当前祝福语订单ID
blessingAuthority: false, //当前门店是否具备祝福语权限
mecPayType: false,//德育币会员
},
methods: {
handleSizeChange(val) {
this.currentLimit = val;//切换每页数量
this.currentPage = 1;
this.getData();
},
handleCurrentChange(val) {
this.currentPage = val;
this.getData();//切换页数
},
//搜索
search() {
this.currentPage = 1;
this.getData();
this.getDataTotal();
},
getData() {
this.loading = true;
$.ajax({
url: "{:U('get_store_sell_list')}",
type: "POST",
data: {
page: this.currentPage,
limit: this.currentLimit,
time: this.time,
order_no: this.order_no,
member_number: this.member_number,
mec_vip_key: this.mec_vip_key,
mec_villages_id: this.mec_villages_id,
cashier_id: this.cashier_id,
pay_type: this.pay_type,
order_type: this.order_type,
user_type: this.user_type,
other_type: this.other_type
},
success: (res) => {
this.loading = false;
if (res.code == 0) {
this.list = [];
this.list = res.data;
this.currentLen = parseInt(res.count);
this.list = res.data;
this.blessingAuthority = res.jurisdiction_blessing == 1 ? true : false
} else {
this.$message.error('数据获取失败');
}
}
})
},
getDataTotal() {
$.ajax({
url: "{:U('getSellListTotal')}",
type: "POST",
data: {
time: this.time,
order_no: this.order_no,
member_number: this.member_number,
mec_vip_key: this.mec_vip_key,
mec_villages_id: this.mec_villages_id,
cashier_id: this.cashier_id,
pay_type: this.pay_type,
order_type: this.order_type,
user_type: this.user_type,
},
success: (res) => {
if (res.status == 1) {
this.sell_count = res.sell_count;
this.refund_count = res.refund_count;
this.sell_money = res.sell_money;
this.refund_money = res.refund_money;
this.money = res.money;
this.exchange_money = res.exchange_money;
this.dismoney = res.dismoney;
this.cashier_manual_money = res.cashier_manual_money;
this.cashierdiscountmoney = res.cashierdiscountmoney;
this.small_changes_money = res.small_changes_money;
this.pay_coupon_money = res.pay_coupon_money;
} else {
this.$message.error('数据获取失败');
}
}
})
},
exportRec() {
let time = JSON.stringify(this.time);
let order_no = this.order_no;
let member_number = this.member_number;
let mec_vip_key = this.mec_vip_key;
let mec_villages_id = this.mec_villages_id;
let cashier_id = this.cashier_id;
let pay_type = this.pay_type;
let order_type = this.order_type;
let user_type = this.user_type;
let other_type = this.other_type;
if (!this.time.length) {
this.$confirm('确认导出?(默认导出当月订单明细)', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'error'
}).then(() => {
time = JSON.stringify(this.getThisMonthTime());
window.location.href = "{:U('Sale/export')}?time=" + time + "&order_no=" + order_no + "&member_number=" + member_number + "&mec_vip_key=" + mec_vip_key + "&mec_villages_id=" + mec_villages_id + "&cashier_id=" + cashier_id + "&pay_type=" + pay_type + "&order_type=" + order_type + "&user_type=" + user_type + "&other_type=" + other_type;
}).catch(() => {
});
} else {
window.location.href = "{:U('Sale/export')}?time=" + time + "&order_no=" + order_no + "&member_number=" + member_number + "&mec_vip_key=" + mec_vip_key + "&mec_villages_id=" + mec_villages_id + "&cashier_id=" + cashier_id + "&pay_type=" + pay_type + "&order_type=" + order_type + "&user_type=" + user_type + "&other_type=" + other_type;
}
},
print(id) {
layer.open({
type: 2,
content: "{:U('Retail/WebPrint/orderPrint')}?id=" + id,
title: "打印订单",
area: ['calc(100% - 160px)', 'calc(100% - 65px)'],
shade: 0,
offset: 'rb',
})
},
wifi(id) {
$.ajax({
url: "{:U('storeIdGet')}",
type: "post",
data: {bill_id: id},
success: (res) => {
if (res.status == 0) {
this.$message.error(res.msg)
}
}
})
},
/**
* @description 打开祝福语弹窗
* @param {Number} id 订单ID
*/
openBlessingDialog(id) {
this.blessingOrderId = id
this.blessingDialogVisible = true
}
},
created() {
this.time = this.getThisMonthTime();
this.getData();
this.getDataTotal();
this.checkOperateAuth({
export: '/index.php/Retail/Sale/export',
sell_goods_info: '/index.php/Retail/Sale/sell_goods_info',
wifiPrint: '/index.php/Retail/Sale/storeIdGet',
orderPrint: '/index.php/Retail/WebPrint/orderPrint',
}, (data) => {
this.operate = data;
})
this.sendRequest('Retail/Mgoods/getPlatformType', {
success: (res) => {
if (res.status == 1 && res.moral_education_coin) {
this.mecPayType = true;
}
}
})
}
})
</script>