收银台
This commit is contained in:
parent
b51938071a
commit
f0a970479f
@ -8,3 +8,12 @@ export function getOilNumberById(id) {
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询所有油号
|
||||
export function oilNumberList() {
|
||||
return request({
|
||||
url: '/business/petrolStationManagement/oilNumber/getList',
|
||||
method: 'get',
|
||||
// data: data
|
||||
})
|
||||
}
|
||||
|
@ -8,3 +8,12 @@ export function selectPreferential(data) {
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
||||
// 查询优惠券信息
|
||||
export function selectCoupon(data) {
|
||||
return request({
|
||||
url: '/business/marketingActivity/activeExchange/selectCardFavorableList',
|
||||
method: 'get',
|
||||
params: data
|
||||
})
|
||||
}
|
||||
|
@ -808,6 +808,7 @@ import {getDicts} from "@/api/dict/data";
|
||||
this.dialogVisiblej = false;
|
||||
this.open2 = false;
|
||||
this.open4 = false;
|
||||
this.getList();
|
||||
},
|
||||
// 收款
|
||||
collection(){
|
||||
|
@ -60,31 +60,36 @@
|
||||
width="400"
|
||||
trigger="click">
|
||||
<div>
|
||||
<el-checkbox-group v-model="checkedCities1" @change="handleCheckedCitiesChange1">
|
||||
<el-checkbox v-for="(item,index) in fullReduceDiscount" :label="item.type" :key="index">
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
|
||||
<div style="width: 200px">{{item.type}}</div>
|
||||
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
|
||||
<div style="color: red">-¥{{ fullReduction }}</div>
|
||||
<div style="color: grey" v-if="item.discount!=0">满{{ item.full }}元,打{{ item.discount }}折</div>
|
||||
<div style="color: grey" v-else>满{{ item.full }}元,减{{ item.reduce }}元</div>
|
||||
<div v-if="fullReduceDiscount.length>0">
|
||||
<el-checkbox-group v-model="checkedCities1" @change="handleCheckedCitiesChange1">
|
||||
<el-checkbox v-for="(item,index) in fullReduceDiscount" :label="item.type" :key="index">
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
|
||||
<div style="width: 200px">{{item.type}}</div>
|
||||
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
|
||||
<div style="color: red">-¥{{ fullReduction }}</div>
|
||||
<div style="color: grey" v-if="item.discount!=0">满{{ item.full }}元,打{{ item.discount }}折</div>
|
||||
<div style="color: grey" v-else>满{{ item.full }}元,减{{ item.reduce }}元</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div v-else>
|
||||
暂无满减油品信息
|
||||
</div>
|
||||
</div>
|
||||
<div slot="reference">
|
||||
<el-checkbox :indeterminate="isIndeterminate1"
|
||||
<el-checkbox :disabled="fullReduceDiscount.length==0"
|
||||
style="color: black;font-size: 16px"
|
||||
v-model="checkAll1" @change="handleCheckAllChange1">
|
||||
</el-checkbox>
|
||||
</el-checkbox><!--:indeterminate="isIndeterminate1"-->
|
||||
满减活动
|
||||
</div>
|
||||
</el-popover>
|
||||
</div>
|
||||
<div>-¥{{ fullReduction + goodsDiscount }}</div>
|
||||
<div>-¥{{ fullReduction }}</div>
|
||||
</div>
|
||||
<div class="center-left-hj" v-show="isMember">
|
||||
<div class="center-left-hj" v-show="isMember && gradeDiscount.length>0">
|
||||
<div>
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
@ -117,67 +122,68 @@
|
||||
</div>
|
||||
<div class="center-left-hj" v-show="isMember && refuelMoney!=null">
|
||||
<div>
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="400"
|
||||
trigger="click">
|
||||
<div>
|
||||
<el-checkbox-group v-model="checkedCities3" @change="handleCheckedCitiesChange3">
|
||||
<el-checkbox v-for="city in cities3" :label="city" :key="city">
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
|
||||
<div style="width: 200px">{{city}}</div>
|
||||
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
|
||||
<div style="color: red">-¥1.56</div>
|
||||
<div style="color: grey">满100元每升优惠0.2元</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div slot="reference">
|
||||
<el-checkbox :indeterminate="isIndeterminate3"
|
||||
style="color: black;font-size: 16px"
|
||||
v-model="checkAll3" @change="handleCheckAllChange3">
|
||||
</el-checkbox>
|
||||
囤油卡
|
||||
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
|
||||
({{ item.type }}卡
|
||||
<span style="color: #00afff">{{ item.oilType }}</span>
|
||||
余额:{{ item.refuelMoney }}L)
|
||||
</div>
|
||||
</div>
|
||||
</el-popover>
|
||||
<!-- <el-popover-->
|
||||
<!-- placement="bottom-start"-->
|
||||
<!-- width="400"-->
|
||||
<!-- trigger="click">-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-checkbox-group v-model="checkedCities3" @change="handleCheckedCitiesChange3">-->
|
||||
<!-- <el-checkbox v-for="city in cities3" :label="city" :key="city">-->
|
||||
<!-- <div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">-->
|
||||
<!-- <div style="width: 200px">{{city}}</div>-->
|
||||
<!-- <div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">-->
|
||||
<!-- <div style="color: red">-¥1.56</div>-->
|
||||
<!-- <div style="color: grey">满100元每升优惠0.2元</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- </el-checkbox-group>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div slot="reference">-->
|
||||
<!-- -->
|
||||
<!-- </div>-->
|
||||
<!-- </el-popover>-->
|
||||
<el-checkbox
|
||||
style="color: black;font-size: 16px"
|
||||
v-model="checkAll3" @change="handleCheckAllChange3">
|
||||
</el-checkbox><!--:indeterminate="isIndeterminate3"-->
|
||||
囤油卡
|
||||
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index">
|
||||
({{ item.type }}卡
|
||||
<span style="color: #00afff">{{ item.oilType }}</span>
|
||||
余额:{{ item.refuelMoney }}L)
|
||||
</div>
|
||||
</div>
|
||||
<div>- {{ consumeRefuelMoney }}L</div>
|
||||
</div>
|
||||
<div class="center-left-hj" v-show="isMember">
|
||||
<div>
|
||||
<el-popover
|
||||
placement="bottom-start"
|
||||
width="400"
|
||||
trigger="click">
|
||||
<div>
|
||||
<el-checkbox-group v-model="checkedCities4" @change="handleCheckedCitiesChange4">
|
||||
<el-checkbox v-for="city in cities4" :label="city" :key="city">
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
|
||||
<div style="width: 200px">{{city}}</div>
|
||||
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
|
||||
<div style="color: red">-¥1.56</div>
|
||||
<div style="color: grey">满100元每升优惠0.2元</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div slot="reference">
|
||||
<el-checkbox :indeterminate="isIndeterminate4"
|
||||
style="color: black;font-size: 16px"
|
||||
v-model="checkAll4" @change="handleCheckAllChange4">
|
||||
</el-checkbox>
|
||||
储值卡
|
||||
<span>(账户余额:{{ balance }}元)</span>
|
||||
</div>
|
||||
</el-popover>
|
||||
<!-- <el-popover-->
|
||||
<!-- placement="bottom-start"-->
|
||||
<!-- width="400"-->
|
||||
<!-- trigger="click">-->
|
||||
<!-- <div>-->
|
||||
<!-- <el-checkbox-group v-model="checkedCities4" @change="handleCheckedCitiesChange4">-->
|
||||
<!-- <el-checkbox v-for="city in cities4" :label="city" :key="city">-->
|
||||
<!-- <div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">-->
|
||||
<!-- <div style="width: 200px">{{city}}</div>-->
|
||||
<!-- <div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">-->
|
||||
<!-- <div style="color: red">-¥1.56</div>-->
|
||||
<!-- <div style="color: grey">满100元每升优惠0.2元</div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<!-- </el-checkbox>-->
|
||||
<!-- </el-checkbox-group>-->
|
||||
<!-- </div>-->
|
||||
<!-- <div slot="reference">-->
|
||||
<!-- -->
|
||||
<!-- </div>-->
|
||||
<!-- </el-popover>-->
|
||||
<el-checkbox style="color: black;font-size: 16px"
|
||||
v-model="checkAll4" @change="handleCheckAllChange4">
|
||||
</el-checkbox>
|
||||
储值卡
|
||||
<span>(账户余额:{{ balance }}元)</span>
|
||||
</div>
|
||||
<div>-¥{{ consumeAmount }}</div>
|
||||
</div>
|
||||
@ -188,13 +194,13 @@
|
||||
width="400"
|
||||
trigger="click">
|
||||
<div>
|
||||
<el-checkbox-group v-model="checkedCities5" @change="handleCheckedCitiesChange5">
|
||||
<el-checkbox v-for="city in cities5" :label="city" :key="city">
|
||||
<el-checkbox-group v-model="checkedCities5 && couponDiscount.length>0" @change="handleCheckedCitiesChange5">
|
||||
<el-checkbox v-for="(item,index) in couponDiscount" :label="item.name" :key="index">
|
||||
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
|
||||
<div style="width: 200px">{{city}}</div>
|
||||
<div style="width: 200px">{{item.name}}</div>
|
||||
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
|
||||
<div style="color: red">-¥1.56</div>
|
||||
<div style="color: grey">满100元每升优惠0.2元</div>
|
||||
<div style="color: red">-¥{{ item.reduce }}</div>
|
||||
<div style="color: grey">满{{ item.full }}元,减{{ item.reduce }}元</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-checkbox>
|
||||
@ -242,7 +248,7 @@
|
||||
<div class="bottom-price">¥{{ oilActualPay + goodsActualPay }}</div>
|
||||
<div class="price-red">优惠合计:{{ oilDiscount + goodsDiscount }}元/{{consumeRefuelMoney}}L</div>
|
||||
</div>
|
||||
<div class="center-left-lv" @click="settlement">立即结算</div>
|
||||
<div class="center-left-lv" @click="settlement" :disabled="(oilActualPay + goodsActualPay)==0">立即结算</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -267,8 +273,9 @@
|
||||
<div class="of-box" v-for="(item,index) in gunList" :key="index"
|
||||
:style="{'background-color': colorList[index%5].color}"
|
||||
@click="refuel(item)">
|
||||
<!-- <div>{{ getName(oilNameList,item.oilName) }}</div>-->
|
||||
<div>{{ item.oilNumber }}</div>
|
||||
<div>{{ getName(oilNameList,getOilNames(oilNumberList,item.numberId)) }}</div>
|
||||
<!-- <div>{{ getOilNames(oilNumberList,item.numberId) }}</div>-->
|
||||
<!-- <div>{{ item.oilNumber }}</div>-->
|
||||
|
||||
<div class="of-title" >{{item.gunName}}</div>
|
||||
<div style="display: flex;justify-content: space-between">
|
||||
@ -276,16 +283,21 @@
|
||||
<span style="font-size: 12px">{{ item.tankName }}</span>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="of-box" v-for="(item,index) in oilNumGunList" :key="index"-->
|
||||
<!-- :style="{'background-color': colorList[index%5].color}"-->
|
||||
<!-- @click="refuel(item.id)">-->
|
||||
<!-- <div>{{ getName(oilNameList,item.oilName) }}</div>-->
|
||||
<!-- 点击之后样式测试-->
|
||||
<div class="after-box">
|
||||
<div>11</div>
|
||||
|
||||
<!-- <div class="of-title" >{{item.oilGunNum}}号枪</div>-->
|
||||
<!-- <div>-->
|
||||
<div class="of-title" >1号枪</div>
|
||||
<div>
|
||||
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
|
||||
<!-- </div>-->
|
||||
<!-- </div>-->
|
||||
<span>
|
||||
<svg t="1700561564710" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="9686" width="16" height="16"><path d="M661.8 868.4V455.8h27.9c15.3-0.1 27.8 12.3 27.9 27.6V746c-0.1 67.5 54.5 122.3 121.9 122.4S961.9 813.9 962 746.5V241.6c0.1-25.4-10.1-49.8-28.3-67.5l-99.4-98.5c-18-18-47.2-18-65.2 0s-18 47.2 0 65.2l64.3 64.8-47.7 49.5c-15.8 16-15.8 41.6 0 57.6 7.4 7.8 17.6 12.2 28.3 12.1h54v422.1c0 15.4-12.5 27.9-27.9 27.9-15.4 0-27.9-12.5-27.9-27.9V484.1c0.1-67.3-54.3-121.8-121.6-121.9H662.3v-225c-0.1-41.5-33.7-75.1-75.1-75.1H193.4c-41.5 0.1-75.1 33.7-75.1 75.1v731.2h-9.4c-25.8 0-46.8 21-46.8 46.8C62 941 83 962 108.8 962h562.5c25.8 0 46.8-20.9 46.8-46.8 0-25.8-20.9-46.8-46.8-46.8h-9.5zM253.2 155.6h273.6c22.8 0 41.3 18.4 41.4 41.2v199.1c0 22.8-18.4 41.3-41.2 41.4H253.2c-22.8 0-41.3-18.4-41.4-41.2V197c0-22.8 18.4-41.3 41.2-41.4h0.2z" fill="#FFFFFF" p-id="9687"></path></svg>
|
||||
</span>
|
||||
<span style="margin-right: 10px">
|
||||
<svg t="1700561410052" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="5197" width="16" height="16"><path d="M365.714286 365.714286h109.714285v365.714285H365.714286V365.714286z m182.857143 0H658.285714v365.714285H548.571429V365.714286z m329.142857-36.571429v438.857143A182.857143 182.857143 0 0 1 694.857143 950.857143h-365.714286A182.857143 182.857143 0 0 1 146.285714 768v-438.857143h109.714286v416.256c0 45.129143 47.104 95.744 93.037714 95.744h326.217143c57.563429 0 92.745143-52.370286 92.745143-95.744V329.142857H877.714286zM676.571429 146.285714h182.857142a54.857143 54.857143 0 0 1 54.857143 54.857143v54.857143h-804.571428v-54.857143A54.857143 54.857143 0 0 1 164.571429 146.285714h182.857142l38.4-51.2a54.857143 54.857143 0 0 1 43.885715-21.942857h164.571428a54.857143 54.857143 0 0 1 43.885715 21.942857l38.4 51.2z" fill="#FFFFFF" p-id="5198"></path></svg>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -465,7 +477,7 @@
|
||||
<el-table-column label="数量" align="center" prop="num"/>
|
||||
<el-table-column label="金额" align="center">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ scope.row.retailPrice * scope.row.num }}</span>
|
||||
<span>{{ (scope.row.retailPrice * scope.row.num).toFixed(2) }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@ -795,8 +807,8 @@
|
||||
import {getUserGrade, listUserGrade} from "@/api/cashier/usergrade";
|
||||
import {getOilGun} from "@/api/cashier/oilGuns";
|
||||
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
|
||||
import {getOilNumberById} from "@/api/cashier/oilnumber";
|
||||
import {selectPreferential} from "@/api/cashier/preferential";
|
||||
import {getOilNumberById, oilNumberList} from "@/api/cashier/oilnumber";
|
||||
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
|
||||
import {addHangBill} from "@/api/cashier/hangbill";
|
||||
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
|
||||
|
||||
@ -818,20 +830,21 @@
|
||||
cities2: cityOptions,
|
||||
gradeDiscount: [],
|
||||
// 囤油卡全选
|
||||
checkAll3: false,
|
||||
checkAll3: true,
|
||||
isIndeterminate3: true,
|
||||
checkedCities3: ['上海'],
|
||||
checkedCities3: [],
|
||||
cities3: cityOptions,
|
||||
// 储值卡全选
|
||||
checkAll4: false,
|
||||
checkAll4: true,
|
||||
isIndeterminate4: true,
|
||||
checkedCities4: ['上海'],
|
||||
checkedCities4: [],
|
||||
cities4: cityOptions,
|
||||
// 优惠券全选
|
||||
checkAll5: false,
|
||||
isIndeterminate5: true,
|
||||
checkedCities5: ['上海'],
|
||||
checkedCities5: [],
|
||||
cities5: cityOptions,
|
||||
couponDiscount: [],
|
||||
// 优惠券列表
|
||||
couponList:[],
|
||||
// 消费升数
|
||||
@ -870,6 +883,8 @@
|
||||
oilActualPay:0,
|
||||
// 油品优惠金额
|
||||
oilDiscount:0,
|
||||
// 囤油卡消费金额
|
||||
hoardAmount:0,
|
||||
// 商品优惠金额
|
||||
goodsDiscount:0,
|
||||
// 商品实付金额
|
||||
@ -1019,10 +1034,16 @@
|
||||
isQuery:true,
|
||||
// 油枪列表
|
||||
gunList:[],
|
||||
// 油号列表
|
||||
oilNumberList:[],
|
||||
// 是否可以点会员确定按钮
|
||||
isSure:true,
|
||||
// 优惠券消费金额
|
||||
couponAmount:0,
|
||||
// 是否为满减互斥
|
||||
isUseFull:false,
|
||||
// 是否为储值卡互斥
|
||||
isUseBalance:false,
|
||||
// 查询优惠活动信息所需参数
|
||||
preferentialData:{
|
||||
userId:"",
|
||||
@ -1060,6 +1081,19 @@
|
||||
this.getUnitList();
|
||||
},
|
||||
methods:{
|
||||
getOilNames(list,id){
|
||||
let name = ""
|
||||
let _this = this;
|
||||
if(list!=null && list!=""){
|
||||
list.forEach(item => {
|
||||
if (item.numberId == id){
|
||||
name = item.oilName;
|
||||
// _this.oilType = item.oilName;
|
||||
}
|
||||
})
|
||||
}
|
||||
return name;
|
||||
},
|
||||
// 挂账
|
||||
addCredits(){
|
||||
this.dialogVisibleCredit = true
|
||||
@ -1164,6 +1198,19 @@
|
||||
this.fullReduceDiscount.forEach(item => {
|
||||
list.push(item.type)
|
||||
})
|
||||
if (val){
|
||||
this.fullReduceDiscount.forEach(item => {
|
||||
if (item.discount!=0){
|
||||
this.fullReduction = this.oilAmount - (this.oilAmount * item.discount).toFixed(2)
|
||||
}else {
|
||||
this.fullReduction = item.reduce
|
||||
}
|
||||
})
|
||||
|
||||
}else {
|
||||
this.fullReduction = 0;
|
||||
this.getGrade(this.member.id)
|
||||
}
|
||||
this.checkedCities1 = val ? list : [];
|
||||
this.isIndeterminate1 = false;
|
||||
},
|
||||
@ -1186,8 +1233,25 @@
|
||||
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
|
||||
},
|
||||
handleCheckAllChange3(val) {
|
||||
this.checkedCities3 = val ? cityOptions : [];
|
||||
this.isIndeterminate3 = false;
|
||||
if (val==false){
|
||||
this.consumeAmount = 0;
|
||||
if (this.isUseFull){
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
if (this.isUseBalance){
|
||||
this.countAmountUnBalance()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
}else {
|
||||
this.changeRefuelMoney()
|
||||
}
|
||||
},
|
||||
handleCheckedCitiesChange3(value) {
|
||||
let checkedCount = value.length;
|
||||
@ -1195,8 +1259,23 @@
|
||||
this.isIndeterminate3 = checkedCount > 0 && checkedCount < this.cities3.length;
|
||||
},
|
||||
handleCheckAllChange4(val) {
|
||||
this.checkedCities4 = val ? cityOptions : [];
|
||||
this.isIndeterminate4 = false;
|
||||
if (val==false){
|
||||
this.consumeAmount = 0;
|
||||
if (this.isUseFull){
|
||||
this.countAmountFull()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
if (this.isUseBalance){
|
||||
this.countAmountUnBalance()
|
||||
return;
|
||||
}else {
|
||||
this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
}
|
||||
},
|
||||
handleCheckedCitiesChange4(value) {
|
||||
let checkedCount = value.length;
|
||||
@ -1204,13 +1283,31 @@
|
||||
this.isIndeterminate4 = checkedCount > 0 && checkedCount < this.cities4.length;
|
||||
},
|
||||
handleCheckAllChange5(val) {
|
||||
this.checkedCities5 = val ? cityOptions : [];
|
||||
let list = []
|
||||
this.couponDiscount.forEach(item => {
|
||||
list.push(item.name)
|
||||
})
|
||||
if (val){
|
||||
this.couponAmount = 0
|
||||
this.couponDiscount.forEach(item2 => {
|
||||
this.couponAmount += item2.reduce
|
||||
})
|
||||
}else {
|
||||
this.couponAmount = 0
|
||||
}
|
||||
this.checkedCities5 = val ? list : [];
|
||||
this.isIndeterminate5 = false;
|
||||
},
|
||||
handleCheckedCitiesChange5(value) {
|
||||
this.couponAmount = 0;
|
||||
for (let i = 0; i < this.couponDiscount.length; i++){
|
||||
if (this.couponDiscount[i].name == value[i]){
|
||||
this.couponAmount += this.couponDiscount[i].reduce
|
||||
}
|
||||
}
|
||||
let checkedCount = value.length;
|
||||
this.checkAll5 = checkedCount === this.cities5.length;
|
||||
this.isIndeterminate5 = checkedCount > 0 && checkedCount < this.cities5.length;
|
||||
this.checkAll5 = checkedCount === this.couponDiscount.length;
|
||||
this.isIndeterminate5 = checkedCount > 0 && checkedCount < this.couponDiscount.length;
|
||||
},
|
||||
// 模糊查询商品信息
|
||||
querySearch(queryString, cb) {
|
||||
@ -1280,7 +1377,7 @@
|
||||
this.oilDiscount = 0;
|
||||
this.goodsDiscount = 0;
|
||||
this.userNo = "";
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||
this.goodsActualPay = this.goodsAmount - this.goodsDiscount
|
||||
this.isSure = true;
|
||||
this.handleChange();
|
||||
@ -1493,20 +1590,30 @@
|
||||
}
|
||||
})
|
||||
|
||||
let oilActualPay = _this.oilActualPay;
|
||||
// let oilActualPay = _this.oilActualPay;
|
||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||
_this.oilActualPay = oilActualPay - _this.oilDiscount;
|
||||
// _this.oilActualPay = oilActualPay - _this.oilDiscount;
|
||||
// 储值卡余额
|
||||
// 如果总金额为0 则表示没有使用囤油卡
|
||||
if (oilActualPay == 0){
|
||||
oilActualPay = _this.oilAmount - _this.oilDiscount;
|
||||
}
|
||||
if (_this.balance>=(_this.oilAmount - _this.oilDiscount)){
|
||||
_this.consumeAmount = _this.oilAmount - _this.oilDiscount;
|
||||
_this.oilActualPay = 0;
|
||||
// if (oilActualPay == 0){
|
||||
// oilActualPay = _this.oilAmount - _this.oilDiscount - _this.fullReduction;
|
||||
// }
|
||||
// if (_this.balance>=(_this.oilAmount - _this.oilDiscount)){
|
||||
// _this.consumeAmount = _this.oilAmount - _this.oilDiscount - _this.fullReduction;
|
||||
// _this.oilActualPay = 0;
|
||||
// }else {
|
||||
// _this.consumeAmount = _this.balance;
|
||||
// _this.oilActualPay = oilActualPay - _this.oilDiscount - _this.balance - _this.fullReduction;
|
||||
// }
|
||||
if (_this.isUseFull){
|
||||
_this.countAmountFull()
|
||||
}else {
|
||||
_this.consumeAmount = _this.balance;
|
||||
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.balance;
|
||||
_this.countAmountBalance()
|
||||
}
|
||||
if (_this.isUseBalance){
|
||||
_this.countAmountUnBalance()
|
||||
}else {
|
||||
_this.countAmountBalance()
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -1524,12 +1631,130 @@
|
||||
this.preferentialData.userId = data.id;
|
||||
this.preferentialData.gradeId = data.gradeId;
|
||||
if (this.oilOrder.length>0){
|
||||
// this.oilOrder.forEach(item => {
|
||||
// this.preferentialData.oilName = item.oilName;
|
||||
// this.preferentialData.oilPrice = item.oilPrice;
|
||||
// this.preferentialData.oilLiters = item.liters;
|
||||
// })
|
||||
this.preferential();
|
||||
this.getCoupon();
|
||||
}
|
||||
},
|
||||
// 调用优惠券接口
|
||||
getCoupon(){
|
||||
let _this = this;
|
||||
_this.oilOrder.forEach(item1 => {
|
||||
_this.preferentialData.oilName = item1.oilName;
|
||||
_this.preferentialData.oilPrice = item1.oilPrice;
|
||||
_this.preferentialData.oilLiters = item1.liters;
|
||||
_this.couponDiscount =[];
|
||||
selectCoupon(_this.preferentialData).then(response => {
|
||||
let couponAmount = 0;
|
||||
if (response.data.length>0){
|
||||
response.data.forEach(item => {
|
||||
let discount = {type:item.type,discountType:item.discountType,name:item.name,full:0,reduce:0,discount:0}
|
||||
discount.full = item.satisfiedAmount
|
||||
if (item.type==0){
|
||||
// 油品券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}else if (item.type==1){
|
||||
// 商品券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}else {
|
||||
// 通用券
|
||||
if (item.discountType==0){
|
||||
// 满减券
|
||||
discount.reduce = item.discountAmount
|
||||
}else {
|
||||
// 折扣券
|
||||
discount.discount = item.specialDiscount
|
||||
discount.reduce = item.discountOffset
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0){
|
||||
_this.couponDiscount.push(discount)
|
||||
_this.checkedCities5.push(item.name)
|
||||
}
|
||||
if (item.exclusiveFunction == 0){
|
||||
// 满减互斥
|
||||
_this.checkAll1 = false
|
||||
_this.checkAll4 = true;
|
||||
_this.fullReduction = 0
|
||||
_this.isUseFull = true;
|
||||
}else {
|
||||
// 储值卡付款互斥
|
||||
_this.checkAll1 = true
|
||||
_this.checkAll4 = false;
|
||||
_this.consumeAmount = 0;
|
||||
_this.isUseBalance = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
_this.couponDiscount.forEach(item2 => {
|
||||
couponAmount = item2.reduce
|
||||
_this.couponAmount += couponAmount
|
||||
})
|
||||
if (_this.isUseFull){
|
||||
_this.countAmountFull()
|
||||
return;
|
||||
}else {
|
||||
_this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
if (_this.isUseBalance){
|
||||
_this.countAmountUnBalance()
|
||||
return;
|
||||
}else {
|
||||
_this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
// 使用优惠券不使用满减
|
||||
countAmountFull(){
|
||||
if (this.isMember){
|
||||
// 满减互斥
|
||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
this.consumeAmount = this.balance
|
||||
}
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||
}
|
||||
},
|
||||
// 使用优惠券不使用储值卡
|
||||
countAmountUnBalance(){
|
||||
if (this.isMember){
|
||||
this.oilActualPay = this.oilOrder - this.fullReduction - this.oilDiscount - this.couponAmount - this.hoardAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||
}
|
||||
},
|
||||
// 使用储值卡不使用优惠券 || 使用满减不使用优惠券
|
||||
countAmountBalance(){
|
||||
if (this.isMember){
|
||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
|
||||
this.oilActualPay = 0
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction - this.hoardAmount
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction - this.hoardAmount
|
||||
this.consumeAmount = this.balance
|
||||
}
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||
}
|
||||
},
|
||||
// 调用优惠参数接口
|
||||
@ -1537,7 +1762,6 @@
|
||||
let _this = this;
|
||||
// _this.fullReduction = 0;
|
||||
let fullReduction = 0;
|
||||
let oilActualPay = _this.oilActualPay
|
||||
_this.fullReduction = 0;
|
||||
_this.oilOrder.forEach(item1 => {
|
||||
_this.preferentialData.oilName = item1.oilName;
|
||||
@ -1555,7 +1779,7 @@
|
||||
if (item1.amount>=activeList[0].amount){
|
||||
discount.full = activeList[0].amount;
|
||||
discount.discount = activeList[0].discount;
|
||||
fullReduction = item1.amount - item1.amount * (activeList[0].discount / 10);
|
||||
fullReduction = item1.amount - (item1.amount * (activeList[0].discount / 10)).toFixed(2);
|
||||
}else {
|
||||
fullReduction = 0
|
||||
}
|
||||
@ -1571,17 +1795,33 @@
|
||||
}
|
||||
}else {
|
||||
_this.fullReduction = 0;
|
||||
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
|
||||
// _this.countAmountBalance();
|
||||
// _this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
|
||||
}
|
||||
}
|
||||
if (discount.reduce!=0 || discount.discount!=0){
|
||||
_this.fullReduceDiscount.push(discount)
|
||||
_this.checkedCities1 = [item.name]
|
||||
_this.checkAll1 = true;
|
||||
}
|
||||
})
|
||||
}
|
||||
_this.fullReduction += +fullReduction
|
||||
_this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
|
||||
if (_this.isUseFull){
|
||||
_this.countAmountFull()
|
||||
return;
|
||||
}else {
|
||||
_this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
if (_this.isUseBalance){
|
||||
_this.countAmountUnBalance()
|
||||
return;
|
||||
}else {
|
||||
_this.countAmountBalance()
|
||||
return;
|
||||
}
|
||||
// _this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction - _this.balance
|
||||
})
|
||||
})
|
||||
// selectPreferential(data).then( response => {
|
||||
@ -1624,10 +1864,6 @@
|
||||
// let oilActualPay = _this.oilActualPay
|
||||
// _this.oilActualPay = oilActualPay - _this.oilDiscount - _this.fullReduction
|
||||
// })
|
||||
},
|
||||
// 查询该会员是否可使用优惠券
|
||||
queryCoupon(list,id){
|
||||
|
||||
},
|
||||
// 选择会员信息
|
||||
handleChoose(data){
|
||||
@ -1669,9 +1905,9 @@
|
||||
let amount = 0;
|
||||
for (let i = 0; i<goods.length; i++){
|
||||
if (_this.isMember){
|
||||
amount += goods[i].memberPrice * goods[i].num
|
||||
amount += (goods[i].memberPrice * goods[i].num).toFixed(2)
|
||||
}else {
|
||||
amount += goods[i].retailPrice * goods[i].num
|
||||
amount += (goods[i].retailPrice * goods[i].num).toFixed(2)
|
||||
}
|
||||
if (goods[i].id == val.id){
|
||||
goods[i].num = goods[i].num + 1;
|
||||
@ -1717,6 +1953,7 @@
|
||||
this.consumeAmount = 0;
|
||||
this.consumeRefuelMoney = 0;
|
||||
this.fullReduction = 0;
|
||||
this.couponAmount = 0;
|
||||
if (this.member.refuelMoney!=null){
|
||||
this.refuelMoney = JSON.parse(this.member.refuelMoney)
|
||||
}
|
||||
@ -1738,7 +1975,7 @@
|
||||
this.form.liters = (Math.ceil(num*100)/100).toFixed(2)
|
||||
}else {
|
||||
this.form.liters = this.form.amount
|
||||
this.form.amount = this.form.oilPrice * this.form.amount
|
||||
this.form.amount = (this.form.oilPrice * this.form.amount).toFixed(2)
|
||||
}
|
||||
// 获取油号信息
|
||||
// let name1 = this.getName(this.oilNameList,this.form.oilName);
|
||||
@ -1747,21 +1984,21 @@
|
||||
|
||||
if (this.select == "元"){
|
||||
this.oilAmount = +this.form.amount + this.oilAmount;
|
||||
if (this.balance!=0){
|
||||
if (this.balance>=(this.oilAmount - this.oilDiscount)){
|
||||
this.consumeAmount = this.oilAmount - this.oilDiscount;
|
||||
this.oilActualPay = 0;
|
||||
}else {
|
||||
this.consumeAmount = this.balance;
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount - this.balance;
|
||||
}
|
||||
}else {
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount;
|
||||
}
|
||||
// if (this.balance!=0){
|
||||
// if (this.balance>=(this.oilAmount - this.oilDiscount)){
|
||||
// this.consumeAmount = this.oilAmount - this.oilDiscount;
|
||||
// this.oilActualPay = 0;
|
||||
// }else {
|
||||
// this.consumeAmount = this.balance;
|
||||
// this.oilActualPay = this.oilAmount - this.oilDiscount - this.balance;
|
||||
// }
|
||||
// }else {
|
||||
// this.oilActualPay = this.oilAmount - this.oilDiscount;
|
||||
// }
|
||||
}else {
|
||||
this.oilAmount = this.form.amount + this.oilAmount;
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount;
|
||||
}
|
||||
this.oilActualPay = this.oilAmount - this.oilDiscount;
|
||||
|
||||
this.oilTotal += 1;
|
||||
this.select = "元";
|
||||
@ -1769,12 +2006,8 @@
|
||||
this.getGrade(this.member.gradeId)
|
||||
this.changeRefuelMoney();
|
||||
if (this.oilOrder.length>0){
|
||||
// this.oilOrder.forEach(item => {
|
||||
// this.preferentialData.oilName = item.oilName;
|
||||
// this.preferentialData.oilPrice = item.oilPrice;
|
||||
// this.preferentialData.oilLiters = item.liters;
|
||||
// })
|
||||
this.preferential();
|
||||
this.getCoupon();
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -1783,9 +2016,12 @@
|
||||
let _this = this;
|
||||
_this.consumeRefuelMoney = 0;
|
||||
_this.oilActualPay = 0;
|
||||
let oilActPay = 0;
|
||||
_this.hoardAmount = 0;
|
||||
_this.oilOrder.forEach(item => {
|
||||
let conRefMon = 0;
|
||||
let oilActualPay = 0;
|
||||
let hoardAmount = 0;
|
||||
if (_this.refuelMoney!=null){
|
||||
let result = false;
|
||||
for (let i = 0;i < _this.refuelMoney.length;i++){
|
||||
@ -1797,6 +2033,7 @@
|
||||
}else {
|
||||
conRefMon = _this.refuelMoney[i].refuelMoney
|
||||
oilActualPay = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
hoardAmount = (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||
}
|
||||
result = true;
|
||||
}else {
|
||||
@ -1807,7 +2044,8 @@
|
||||
}
|
||||
}
|
||||
_this.consumeRefuelMoney += +conRefMon
|
||||
_this.oilActualPay += +oilActualPay
|
||||
oilActPay += +oilActualPay
|
||||
_this.hoardAmount += +hoardAmount
|
||||
})
|
||||
},
|
||||
// 选择“元”或“L”
|
||||
@ -1846,7 +2084,7 @@
|
||||
oilNameList.forEach(item => {
|
||||
if (item.id == id){
|
||||
name = item.oilName;
|
||||
_this.oilType = item.oilType;
|
||||
_this.oilType = item.oilName;
|
||||
}
|
||||
})
|
||||
}
|
||||
@ -1884,8 +2122,21 @@
|
||||
// 加油金额
|
||||
refuel(data){
|
||||
this.select = "元";
|
||||
this.rise = [
|
||||
{value:"¥100"},
|
||||
{value:"¥150"},
|
||||
{value:"¥200"},
|
||||
{value:"¥300"},
|
||||
];
|
||||
this.amount = 0
|
||||
this.dialogVisibleamount = true;
|
||||
// 判断是否存在此油品的数据
|
||||
this.oilOrder.forEach(item => {
|
||||
// if (item.==data.){
|
||||
// this.form = item
|
||||
// }
|
||||
// return;
|
||||
})
|
||||
getOilNumberById(data.numberId).then( response => {
|
||||
this.form = response.data;
|
||||
this.gunList.forEach(item => {
|
||||
@ -1894,9 +2145,6 @@
|
||||
}
|
||||
})
|
||||
})
|
||||
// getOilNumGunById(id).then( response => {
|
||||
// this.form = response.data;
|
||||
// })
|
||||
},
|
||||
// 确定收款
|
||||
collection(){
|
||||
@ -2102,9 +2350,9 @@
|
||||
goods.forEach(item => {
|
||||
num += item.num
|
||||
if (_this.isMember){
|
||||
amount += item.memberPrice*item.num;
|
||||
amount += (item.memberPrice*item.num).toFixed(2);
|
||||
}else {
|
||||
amount += item.retailPrice*item.num;
|
||||
amount += (item.retailPrice*item.num).toFixed(2);
|
||||
}
|
||||
})
|
||||
this.goodsTotal = num;
|
||||
@ -2147,6 +2395,9 @@
|
||||
getOilGun({numberId:numberId}).then(response => {
|
||||
this.gunList = response.data.records;
|
||||
})
|
||||
oilNumberList().then(response => {
|
||||
this.oilNumberList = response.data.records;
|
||||
})
|
||||
},
|
||||
},
|
||||
|
||||
@ -2154,6 +2405,17 @@
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
.after-box{
|
||||
width: 31%;
|
||||
margin-right: 10px;
|
||||
margin-bottom: 10px;
|
||||
border-radius: 8px;
|
||||
box-sizing: border-box;
|
||||
background-color: #0270ff;
|
||||
height: 110px;
|
||||
padding: 10px;
|
||||
color: white;
|
||||
}
|
||||
.but{
|
||||
width: 150px;
|
||||
height: 50px;
|
||||
|
Loading…
Reference in New Issue
Block a user