979 lines
31 KiB
Vue
979 lines
31 KiB
Vue
<!--发票-->
|
||
<template>
|
||
<div class="app-center">
|
||
<div style="float: right;">
|
||
<span style="font-size: 5px">点击下载打印服务</span>
|
||
<el-button @click="downloadFile()" type="primary" icon="el-icon-download" circle></el-button>
|
||
|
||
</div>
|
||
<div id="report" ref="report" class="box-center">
|
||
<div class="box-title">交班统计</div>
|
||
<div class="box-ge" >
|
||
<div class="input-box">
|
||
<div>油站名称:</div>
|
||
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.storeName : '未知油站' }}</div>
|
||
</div>
|
||
<div class="input-box">
|
||
<div>收银员:</div>
|
||
<!-- <div>{{ handoverList.baseInfo.realName }}</div>-->
|
||
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.realName : '未知姓名' }}</div>
|
||
</div>
|
||
<div class="input-box">
|
||
<div>交班方式:</div>
|
||
<el-tag size="small" >{{handoverList && handoverList.baseInfo ? handoverList.baseInfo.handoverType : '未知'}}</el-tag>
|
||
</div>
|
||
<div class="input-box">
|
||
<div>开始时间:</div>
|
||
<!-- <div>{{ handoverList.baseInfo.startTime }}</div>-->
|
||
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.startTime : '-' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>结束时间:</div>
|
||
<!-- <div>{{ handoverList.baseInfo.endTime }}</div>-->
|
||
<div>{{ handoverList && handoverList.baseInfo ? handoverList.baseInfo.endTime : '-' }}</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="input-box">
|
||
<div>当前版本:</div>
|
||
<div>V1.0.1</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="boloicon">订单汇总</div>
|
||
<div class="input-hui">
|
||
<div>类型</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box">
|
||
<div>油品订单(订单)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilOrder : '0' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>油品订单(退款)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilRefund : '0' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>油品订单(实收)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilPaid : '0' }}</div>
|
||
|
||
</div>
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>油品优惠(实收)</div>-->
|
||
<!-- <div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.oilDiacount : '0' }}</div>-->
|
||
|
||
<!-- </div>-->
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>抹零总额(实收)</div>-->
|
||
<!-- <div>¥2164.55</div>-->
|
||
<!-- </div>-->
|
||
|
||
<el-divider></el-divider>
|
||
<!-- 六个一条线 -->
|
||
<div class="input-box">
|
||
<div>会员储值(订单)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardOrder : '0' }}</div>
|
||
|
||
</div>
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>会员储值(退款)</div>-->
|
||
<!-- <div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardRefund : '0' }}</div>-->
|
||
|
||
<!-- </div>-->
|
||
<div class="input-box">
|
||
<div>会员储值(实收)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardPaid : '0' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>储值赠送(订单)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftOrder : '0' }}</div>
|
||
|
||
</div>
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>储值赠送(退款)</div>-->
|
||
<!-- <div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftRefund : '0' }}</div>-->
|
||
|
||
<!-- </div>-->
|
||
<div class="input-box">
|
||
<div>储值赠送(实际)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.cardGiftPaid : '0' }}</div>
|
||
|
||
</div>
|
||
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>存油储值(订单)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelOrder : '0' }}</div>
|
||
|
||
</div>
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>存油储值(退款)</div>-->
|
||
<!-- <div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelRefund : '0' }}</div>-->
|
||
|
||
<!-- </div>-->
|
||
<div class="input-box">
|
||
<div>存油储值(实收)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.fuelPaid : '0' }}</div>
|
||
|
||
</div>
|
||
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>普通收款(订单)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsOrder : '0' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>普通收款(退款)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsRefund : '0' }}</div>
|
||
|
||
</div>
|
||
<div class="input-box">
|
||
<div>普通收款(实收)</div>
|
||
<div>¥{{ handoverList && handoverList.orderSummary ? handoverList.orderSummary.goodsPaid : '0' }}</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="boloicon">退款汇总</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>退款金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.refundAmount > 0">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.refundAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box" >
|
||
<div>合计</div>
|
||
<div>¥{{refundAggregateTotal}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">实收汇总</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('all')" v-if="item.paidAmount > 0">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalTotalOfActualReceipts}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">油品订单</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('oil')">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalOilOrders}}</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="boloicon">商品订单</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('goods')">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalOfProductOrders}}</div>
|
||
</div>
|
||
</div>
|
||
<!-- <div class="box-ge">-->
|
||
<!-- <div class="boloicon">普通订单</div>-->
|
||
<!-- <div class="input-hui">-->
|
||
<!-- <div>支付方式</div>-->
|
||
<!-- <div>金额</div>-->
|
||
<!-- </div>-->
|
||
<!-- <div class="input-box" v-for="item in paymentAggregation('goods')">-->
|
||
<!-- <div>{{calculateThePaymentMethod(item.payType)}}</div>-->
|
||
<!-- <div>¥{{item.paidAmount}}</div>-->
|
||
<!-- </div>-->
|
||
<!-- <el-divider></el-divider>-->
|
||
<!-- <div class="input-box">-->
|
||
<!-- <div>合计</div>-->
|
||
<!-- <div>¥0.00</div>-->
|
||
<!-- </div>-->
|
||
<!-- </div>-->
|
||
<div class="box-ge">
|
||
<div class="boloicon">会员储值</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('fg')">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalMemberStoredValue}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">积分商城</div>
|
||
<div class="input-hui">
|
||
<div>支付方式</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in paymentAggregation('point')" v-if="item.paidAmount>0">
|
||
<div>{{calculateThePaymentMethod(item.payType)}}</div>
|
||
<div>¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{pointsMallStatistics}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">油号统计</div>
|
||
<div class="input-hui-frou">
|
||
<div>油号</div>
|
||
<div>笔数</div>
|
||
<div>升数</div>
|
||
<div style="text-align: right">金额</div>
|
||
</div>
|
||
<div class="input-box-frou" v-for="item in oilNumberStatistics()">
|
||
<div>{{item.oilName}}</div>
|
||
<div>{{item.numberOfDeals}}</div>
|
||
<div>{{item.oilNum}}</div>
|
||
<div style="text-align: right">¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalOilNumberStatistics}}</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="boloicon">优惠统计</div>
|
||
<div class="input-hui">
|
||
<div>油品</div>
|
||
<div>金额</div>
|
||
</div>
|
||
<div class="input-box" v-for="item in oilNumberStatistics()">
|
||
<div>{{item.oilName}}</div>
|
||
<div>{{item.paidDiscount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{discountStatisticsTotal}}</div>
|
||
</div>
|
||
</div>
|
||
<div class="box-ge">
|
||
<div class="boloicon">油枪统计</div>
|
||
<div class="input-hui-frou">
|
||
<div>油枪</div>
|
||
<div>笔数</div>
|
||
<div>升数</div>
|
||
<div style="text-align: right">金额</div>
|
||
</div>
|
||
<div class="input-box-frou" v-for="item in greaseGunStatistics()">
|
||
<div>{{item.gunName}}</div>
|
||
<div>{{item.numberOfDeals}}</div>
|
||
<div>{{item.oilNum}}</div>
|
||
<div style="text-align: right">¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalOfOilGunStatistics}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">员工统计</div>
|
||
<div class="input-hui-frou">
|
||
<div>员工姓名</div>
|
||
<!-- <div>笔数</div>-->
|
||
<div>充值(笔数/金额)</div>
|
||
<div>加油(笔数/金额)</div>
|
||
<div>商品(笔数/金额)</div>
|
||
<div style="text-align: right">总笔数/总金额</div>
|
||
</div>
|
||
<div class="input-box-frou" v-for="item in employeeStatistics()">
|
||
<div>{{item.name}}</div>
|
||
<div>{{item.cardN+item.fuelN}}/¥{{item.cardP+item.fuelP}}</div>
|
||
<div>{{item.oilN}}/¥{{item.oilP}}</div>
|
||
<div>{{item.goodsN}}/¥{{item.goodsP}}</div>
|
||
<div style="text-align: right">{{item.numberOfDeals}}/¥{{item.paidAmount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{totalOfEmployeeStatistics}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
<div class="box-ge">
|
||
<div class="boloicon">挂账统计</div>
|
||
<el-divider>挂账详情</el-divider>
|
||
<div class="input-hui-frou">
|
||
<div>挂账单位</div>
|
||
<div>笔数</div>
|
||
<div style="text-align: right">金额</div>
|
||
</div>
|
||
<div class="input-box-frou" v-for="item in billingDetails()">
|
||
<div>{{item.name}}</div>
|
||
<div>{{item.numberOfDeals}}</div>
|
||
<div style="text-align: right">¥{{item.amount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{statisticsOfAccountDetails}}</div>
|
||
</div>
|
||
|
||
|
||
<el-divider>归还详情</el-divider>
|
||
<div class="input-hui-frou">
|
||
<div>挂账单位</div>
|
||
<div>笔数</div>
|
||
<div style="text-align: right">金额</div>
|
||
</div>
|
||
<div class="input-box-frou" v-for="item in returnedToTheAccount()">
|
||
<div>{{item.name}}</div>
|
||
<div>{{item.numberOfDeals}}</div>
|
||
<div style="text-align: right">¥{{item.amount}}</div>
|
||
</div>
|
||
<el-divider></el-divider>
|
||
<div class="input-box">
|
||
<div>合计</div>
|
||
<div>¥{{postedAccountReturnStatistics}}</div>
|
||
</div>
|
||
</div>
|
||
|
||
|
||
</div>
|
||
<div style="width: 100%; height: 100px"></div>
|
||
<div class="app-bottom">
|
||
<el-card >
|
||
<div class="bottom-xz">
|
||
<!-- <div class="anniu" v-if="handoverList && handoverList.baseInfo && handoverList.baseInfo.handoverPrem == 'yqx'" @click="shift">交班</div>-->
|
||
<div class="anniu" @click="shift">交班</div>
|
||
<div class="anniu">
|
||
<span @click="chooseStaff()">
|
||
{{staff.staffName?staff.staffName:"选择员工交班"}}
|
||
</span>
|
||
<i v-if="staff.staffName" class="el-icon-close" @click="clean()"></i>
|
||
</div>
|
||
<!-- <div class="anniu-lv">云打印</div> -->
|
||
<div class="anniu-lv" @click="printLocally()">本地打印</div>
|
||
<div ><el-link type="primary" @click="recording">交班记录</el-link></div>
|
||
</div>
|
||
</el-card>
|
||
</div>
|
||
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff"
|
||
append-to-body>
|
||
<select-staff @send-data="handleDataFromChild">
|
||
|
||
</select-staff>
|
||
</el-dialog>
|
||
</div>
|
||
</template>
|
||
|
||
<script>
|
||
import {addHandoverApi, getHandoverApi, printLocallyApi} from "@/api/cashier/handover";
|
||
import BigNumber from "bignumber.js";
|
||
import {removeUserId} from "@/utils/auth";
|
||
import { getLodop } from "@/api/LodopFuncs";
|
||
import Vue from 'vue';
|
||
import SelectStaff from "@/components/local/selectStaff.vue";
|
||
|
||
export default {
|
||
name: "Handover",
|
||
components: {SelectStaff},
|
||
data() {
|
||
return {
|
||
handoverList : {},
|
||
openStaff: false,
|
||
staff:{
|
||
staffId:'',
|
||
staffName:null
|
||
}
|
||
}
|
||
},
|
||
created() {
|
||
this.getHandover();
|
||
},
|
||
methods: {
|
||
clean() {
|
||
this.staff={
|
||
staffId:'',
|
||
staffName:null
|
||
}
|
||
this.getHandover()
|
||
},
|
||
// 选择员工
|
||
chooseStaff() {
|
||
this.openStaff = true
|
||
},
|
||
handleDataFromChild(data) {
|
||
this.openStaff = false
|
||
|
||
this.staff.staffId = data.mtStaffId,
|
||
this.staff.staffName = data.realName
|
||
console.log("realName",this.staff.staffName)
|
||
this.getHandover();
|
||
},
|
||
getHandover() {
|
||
|
||
getHandoverApi({staffId: this.staff.staffId}).then(res=>{
|
||
this.handoverList = res.data;
|
||
console.log("this.handoverList",this.handoverList)
|
||
// this.staff={
|
||
// staffId:'',
|
||
// staffName:null
|
||
// }
|
||
})
|
||
},
|
||
orderSummary() {
|
||
// 汇总
|
||
},
|
||
paymentAggregation(flag) {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
this.handoverList.paymentAggregation.forEach(res=> {
|
||
if (flag == 'fg') {
|
||
if (res.flag == "card" || res.flag == "fuel") {
|
||
let flag2 = false;
|
||
count.forEach(coun => {
|
||
if (res.payType === coun.payType) {
|
||
coun.paidAmount += res.paidAmount;
|
||
flag2 = true;
|
||
}
|
||
});
|
||
if (!flag2) {
|
||
// 创建新的对象,以防修改原始数据
|
||
let newRes = { ...res };
|
||
count.push(newRes);
|
||
}
|
||
}
|
||
}else if (res.flag == flag) {
|
||
count.push(res)
|
||
}
|
||
})
|
||
}
|
||
return count;
|
||
},
|
||
|
||
calculateThePaymentMethod(payType) {
|
||
switch (payType) {
|
||
case 'ALIPAY':
|
||
return '支付宝'
|
||
break;
|
||
case 'WECHAT':
|
||
return '微信'
|
||
break;
|
||
case 'UNIONPAY':
|
||
return '银联二维码'
|
||
break;
|
||
case 'CASH':
|
||
return '现金'
|
||
break;
|
||
}
|
||
return '未知'
|
||
},
|
||
oilNumberStatistics() {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.oilNumberStatistics) {
|
||
return this.handoverList.oilNumberStatistics
|
||
}
|
||
return count;
|
||
},
|
||
greaseGunStatistics() {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.greaseGunStatistics) {
|
||
return this.handoverList.greaseGunStatistics
|
||
}
|
||
return count;
|
||
},
|
||
employeeStatistics() {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.employeeStatistics) {
|
||
return this.handoverList.employeeStatistics
|
||
}
|
||
return count;
|
||
},
|
||
billingDetails() {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.billingDetails) {
|
||
return this.handoverList.billingDetails
|
||
}
|
||
return count;
|
||
},
|
||
returnedToTheAccount() {
|
||
let count = [];
|
||
if (this.handoverList && this.handoverList.returnedToTheAccount) {
|
||
return this.handoverList.returnedToTheAccount
|
||
}
|
||
return count;
|
||
},
|
||
// 交班记录
|
||
recording() {
|
||
this.$router.push({
|
||
path:'/HandoverDetails',
|
||
query:{
|
||
id:9
|
||
}
|
||
});
|
||
},
|
||
async printLocally() {
|
||
//初始化打印函数
|
||
let LODOP = getLodop(); // 初始化打印
|
||
LODOP.PRINT_INIT();
|
||
var bodyStyle = `<style>
|
||
.input-box{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 5px 0px;
|
||
}
|
||
.box-ge{
|
||
border-bottom: 1px solid #000000 ;
|
||
box-sizing: border-box;
|
||
padding: 10px;
|
||
}
|
||
.box-title{
|
||
font-size: 18px;
|
||
text-align: center;
|
||
align-items: center;
|
||
margin-top: 15px;
|
||
}
|
||
.input-hui{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 15px 0px;
|
||
background: #b2b2b2;
|
||
box-sizing: border-box;
|
||
padding: 5px 0px;
|
||
}
|
||
.input-hui-frou{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 15px 0px;
|
||
background: #b2b2b2;
|
||
box-sizing: border-box;
|
||
padding: 5px 0px;
|
||
div{
|
||
width: 25%;
|
||
text-align: left;
|
||
}
|
||
}
|
||
.input-box-frou{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 5px 0px;
|
||
div{
|
||
width: 25%;
|
||
text-align: left;
|
||
}
|
||
}
|
||
</style>
|
||
`
|
||
var fromHtml = bodyStyle+this.$refs.report.innerHTML
|
||
|
||
|
||
LODOP.ADD_PRINT_HTM(0, 0, "100%", "100%", fromHtml);
|
||
|
||
LODOP.SET_PRINT_MODE("FULL_WIDTH_FOR_OVERFLOW",true);
|
||
|
||
// LODOP.ADD_PRINT_BARCODE(10,40,100,100,'QRCode','123456789');
|
||
// let preview = LODOP.PREVIEW();
|
||
// console.log("preview",preview);
|
||
LODOP.PRINT();
|
||
|
||
|
||
},
|
||
|
||
downloadFile() {
|
||
window.location.href = process.env.VUE_APP_SERVER_URL+"business/handoverRecord/downloadFile";
|
||
|
||
},
|
||
|
||
|
||
// 交班
|
||
async shift() {
|
||
let msg = '交班并退出系统, 是否继续?'
|
||
let flag = false
|
||
if (this.handoverList && this.handoverList.baseInfo && this.handoverList.baseInfo.handoverOut == 'jbtc') {
|
||
flag = true
|
||
} else {
|
||
msg = '确定交班?'
|
||
}
|
||
|
||
this.$confirm(msg, '提示', {
|
||
confirmButtonText: '确定',
|
||
cancelButtonText: '取消',
|
||
type: 'warning'
|
||
}).then(() => {
|
||
let recordData = this.handoverList
|
||
let handoverRecord = {
|
||
startTime:this.handoverList.baseInfo.startTime,
|
||
recordData:JSON.stringify(recordData),
|
||
type:0,
|
||
status:this.handoverList.baseInfo.handoverType,
|
||
staffId:this.staff.staffId
|
||
}
|
||
addHandoverApi(handoverRecord).then(res=>{
|
||
if (flag) {
|
||
this.clean()
|
||
// removeUserId();
|
||
// this.$store.dispatch('LogOut').then(() => {
|
||
// location.href = '/';
|
||
// })
|
||
}
|
||
this.getHandover();
|
||
})
|
||
this.getHandover();
|
||
//
|
||
// this.$message({
|
||
// type: 'success',
|
||
// message: '删除成功!'
|
||
// });
|
||
}).catch(() => {
|
||
this.$message({
|
||
type: 'info',
|
||
message: '已取消交班'
|
||
});
|
||
});
|
||
}
|
||
},
|
||
computed:{
|
||
//退款汇总合计
|
||
refundAggregateTotal() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "all"){
|
||
num = num.plus(new BigNumber(res.refundAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
//实收汇总合计
|
||
totalTotalOfActualReceipts() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "all") {
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
//油品订单合计
|
||
totalOilOrders() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "oil") {
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
//商品订单合计
|
||
totalOfProductOrders() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "goods") {
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
//会员储值合计
|
||
totalMemberStoredValue() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "card" || res.flag == "fuel") {
|
||
// console.log("222",res)
|
||
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
// 积分商城统计
|
||
pointsMallStatistics() {
|
||
if (this.handoverList && this.handoverList.paymentAggregation) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.paymentAggregation.forEach(res => {
|
||
if (res.flag == "point") {
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
}
|
||
});
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0.00;
|
||
},
|
||
//油号统计合计
|
||
totalOilNumberStatistics() {
|
||
if (this.handoverList && this.handoverList.oilNumberStatistics) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.oilNumberStatistics.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
},
|
||
//优惠统计合计
|
||
discountStatisticsTotal() {
|
||
if (this.handoverList && this.handoverList.oilNumberStatistics) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.oilNumberStatistics.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.paidDiscount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
},
|
||
//油枪统计合计
|
||
totalOfOilGunStatistics() {
|
||
if (this.handoverList && this.handoverList.greaseGunStatistics) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.greaseGunStatistics.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
},
|
||
//员工统计合计
|
||
totalOfEmployeeStatistics() {
|
||
if (this.handoverList && this.handoverList.employeeStatistics) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.employeeStatistics.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.paidAmount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
},
|
||
// 挂账详情统计
|
||
statisticsOfAccountDetails(){
|
||
if (this.handoverList && this.handoverList.billingDetails) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.billingDetails.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.amount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
},
|
||
// 挂账归还统计
|
||
postedAccountReturnStatistics(){
|
||
if (this.handoverList && this.handoverList.returnedToTheAccount) {
|
||
let num = new BigNumber(0);
|
||
this.handoverList.returnedToTheAccount.forEach(res=>{
|
||
num = num.plus(new BigNumber(res.amount));
|
||
})
|
||
return Number(num.toString()); // 转换为数字
|
||
}
|
||
return 0;
|
||
}
|
||
}
|
||
|
||
}
|
||
</script>
|
||
|
||
<style scoped lang="scss">
|
||
#report {
|
||
|
||
/* 打印时缩放,防止页面溢出 */
|
||
//zoom: 0.6;
|
||
|
||
}
|
||
|
||
@media print {
|
||
@page {
|
||
//landscape横向,portrait;纵向,如果不设置,则页面有横向和纵向的选择框
|
||
// size: A4 portrait;
|
||
//国家标准公文页边距 GB/T 9704-2012
|
||
// margin: 3.7cm 2.6cm 3.5cm;
|
||
//margin: 0;
|
||
//margin: -1mm;
|
||
//zoom: 0.1;
|
||
|
||
/* size: A4 landscape; size: landscape横向,size: portrait;纵向,如果不设置,则页面有横向和纵向的选择框 */
|
||
}
|
||
//.cover{
|
||
// display: block;
|
||
//}
|
||
//
|
||
}
|
||
|
||
|
||
.app-center{
|
||
width: 100%;
|
||
|
||
box-sizing: border-box;
|
||
padding: 10px;
|
||
}
|
||
.box-center{
|
||
width: 508px;
|
||
height: 85vh;
|
||
background-color: white;
|
||
margin: 10px auto;
|
||
box-sizing: border-box;
|
||
overflow: auto;
|
||
}
|
||
.box-ge{
|
||
border-bottom: 1px solid #ececec ;
|
||
box-sizing: border-box;
|
||
padding: 10px;
|
||
}
|
||
.box-title{
|
||
font-size: 18px;
|
||
text-align: center;
|
||
align-items: center;
|
||
margin-top: 15px;
|
||
}
|
||
.input-box{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 5px 0px;
|
||
}
|
||
.input-box-frou{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 5px 0px;
|
||
div{
|
||
width: 25%;
|
||
text-align: left;
|
||
}
|
||
}
|
||
.input-hui{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 15px 0px;
|
||
background: #f7f7f7;
|
||
box-sizing: border-box;
|
||
padding: 5px 0px;
|
||
}
|
||
.input-hui-frou{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: space-between;
|
||
font-size: 14px;
|
||
margin: 15px 0px;
|
||
background: #f7f7f7;
|
||
box-sizing: border-box;
|
||
padding: 5px 0px;
|
||
div{
|
||
width: 25%;
|
||
text-align: left;
|
||
}
|
||
}
|
||
.boloicon{
|
||
font-weight: bold;
|
||
margin: 10px 0px;
|
||
}
|
||
.app-bottom{
|
||
position: fixed;
|
||
bottom: 0px;
|
||
height: 100px;
|
||
width: 90%;
|
||
}
|
||
.bottom-xz{
|
||
width: 100%;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
}
|
||
.anniu{
|
||
width: 100px;
|
||
height: 40px;
|
||
background: #00afff;
|
||
color: white;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
border-radius: 50px;
|
||
margin: 0px 15px;
|
||
cursor: pointer;
|
||
}
|
||
.anniu-lv{
|
||
background: #1ab394;
|
||
width: 100px;
|
||
height: 40px;
|
||
|
||
color: white;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
overflow: hidden;
|
||
border-radius: 50px;
|
||
margin: 0px 15px;
|
||
cursor: pointer;
|
||
}
|
||
|
||
</style>
|