oil-station/fuintCashierWeb/src/views/cashier/NewComponents/homeindex.vue
2024-01-17 14:14:19 +08:00

3340 lines
124 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<template>
<div class="app-center">
<!-- 支付金额会员登录-->
<div class="center-left">
<div class="center-vh">
<div class="center-left-top">
<div class="vip-bottom" v-if="isMember == false" @click="dialogVisiblevip = true">
<div>会员登录</div>
</div>
<div v-else style="width: 96%;margin: 0 auto;display: flex;justify-content: space-between">
<div
style="display: flex;color: white;justify-content: space-around;width: 55%;
height: 90%;border-radius: 10px;
padding-top: 10px;
background-color: rgb(67,119,204)">
<div>
<template>
<img v-if="member.avatar" class="list-avatar" :src="baseUrl + member.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template>
</div>
<div style="text-align: center">
<span style="margin-bottom: 10px">{{ member.name }}</span><br/>
<span>{{ member.mobile }}</span>
</div>
<div style="background-color: rgba(46,82,142,0.65);width: 50px;height: 45px;padding-top: 5px;
border-radius: 5px;text-align: center">
<el-tooltip placement="top">
<div slot="content">
<p>会员储值账户余额:{{ member.cardBalance }}</p>
<p>积分余额:{{ member.points }}</p>
</div>
<i class="el-icon-bank-card" style="font-size: 35px"></i>
</el-tooltip>
</div>
<div style="background-color: rgba(46,82,142,0.65);width: 50px;height: 45px;padding-top: 5px;
border-radius: 5px;text-align: center">
<el-tooltip placement="top">
<div slot="content">
会员等级:{{ gradeName }}
</div>
<i class="el-icon-medal" style="font-size: 35px"></i>
</el-tooltip>
</div>
</div>
<div class="vip-bottom" style="height: 40px;margin-top: 10px" @click="resetMember">
<div>重置会员</div>
</div>
</div>
</div>
<div class="center-left-hj">
<div class="hj-box" style="justify-content: left">油品:¥{{ oilAmount }}</div>
<div class="hj-box" style="border-left: 1px solid #d1d1d4; border-right: 1px solid #d1d1d4;">商品:¥{{ goodsAmount }}</div>
<div class="hj-box" style="justify-content: flex-end">合计: ¥{{ oilAmount + goodsAmount }}</div>
</div>
<div class="center-left-hj">
<div>
<el-popover
placement="bottom-start"
width="400"
trigger="click">
<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">-¥{{ item.reduce }}</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>
</el-checkbox>
</el-checkbox-group>
</div>
<div v-else>
暂无满减油品信息
</div>
</div>
<div slot="reference">
<el-checkbox :disabled="fullReduceDiscount.length==0"
style="color: black;font-size: 16px"
v-model="checkAll1" @change="handleCheckAllChange1">
</el-checkbox><!--:indeterminate="isIndeterminate1"-->
满减活动
</div>
</el-popover>
</div>
<div>-¥{{ fullReduction }}</div>
</div>
<div class="center-left-hj" v-show="isMember && gradeDiscount.length>0">
<div>
<el-popover
placement="bottom-start"
width="400"
trigger="click">
<div>
<el-checkbox-group v-model="checkedCities2" @change="handleCheckedCitiesChange2">
<el-checkbox v-for="(item,index) in gradeDiscount" :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">-¥{{ oilDiscount }}</div>
<div v-if="item.type=='满减优惠'" style="color: grey">消费满{{ item.full }}元,立减{{ item.reduce }}元</div>
<div v-else style="color: grey">消费满{{ item.full }}元,每升优惠{{ item.liters }}元</div>
</div>
</div>
</el-checkbox>
</el-checkbox-group>
</div>
<div slot="reference">
<el-checkbox
style="color: black;font-size: 16px"
v-model="checkAll2" @change="handleCheckAllChange2">
</el-checkbox><!-- :indeterminate="isIndeterminate2"-->
等级优惠
</div>
</el-popover>
</div>
<div>-¥{{ oilDiscount }}</div>
</div>
<div class="center-left-hj" v-show="isMember && refuelMoney!=null">
<div>
<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 && balance>0">
<div>
<el-checkbox style="color: black;font-size: 16px"
v-model="checkAll4" @change="handleCheckAllChange4">
</el-checkbox>
储值卡
<span>(账户余额:{{ balance }}元)</span>
</div>
<div>-¥{{ consumeAmount }}</div>
</div>
<div class="center-left-hj" v-show="isMember && couponDiscount.length>0">
<div>
<el-popover
placement="bottom-start"
width="400"
trigger="click">
<div>
<el-radio-group v-model="checkedCities5" @input="handleCheckedCitiesChange5">
<el-radio v-for="(item,index) in couponDiscount"
:label="item.name" :key="index" style="display: flex;">
<div style="display: flex;justify-content: space-between;height: 40px;line-height: 40px;">
<div style="width: 200px">{{item.name}}</div>
<div style="line-height: 20px;width:150px;font-size: 12px;text-align: right">
<div style="color: red">-¥{{ item.reduce }}</div>
<div style="color: grey">满{{ item.full }}元,减{{ item.reduce }}元</div>
</div>
</div>
</el-radio>
</el-radio-group>
</div>
<div slot="reference">
<el-checkbox
style="color: black;font-size: 16px"
v-model="checkAll5" @change="handleCheckAllChange5">
</el-checkbox><!-- :indeterminate="isIndeterminate5"-->
优惠券
</div>
</el-popover>
</div>
<div>-¥{{ couponAmount }}</div>
</div>
<div class="center-left-th">
<div class="th-box">
<div>扫码支付</div>
<div class="bule">{{ +oilActualPay + (+goodsActualPay) }}</div>
</div>
<div class="th-box">
<div>找零</div>
<div class="bule">{{ seekZero }}</div>
</div>
<div class="th-box">
<div @click="dialogVisible = true">加油员</div>
<div style="cursor: pointer;color: crimson" @click="dialogVisible = true" >{{ staff.realName }}</div>
</div>
</div>
</div>
<div class="bottom-posi">
<div class="center-left-wrap">
<div class="wrap-box" v-for="item in payList"
:key="item.dictValue"
:value="item.dictValue"
:class="{ 'wrap-box2': item.dictValue == payType }"
@click="payMethod(item.dictValue)">
<span>{{ item.dictLabel }}</span>
</div>
<div class="wrap-box" value="credit"
:class="{ 'wrap-box2': 'credit' == payType }" >
<span @click="addCredits('credit')">挂账</span>
</div>
</div>
<div class="center-left-bottom">
<div>
<div class="bottom-price">¥{{ +oilActualPay + (+goodsActualPay) }}</div>
<div class="price-red">优惠合计:{{ oilDiscount + goodsDiscount }}元/{{consumeRefuelMoney}}L</div>
</div>
<el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
</div>
</div>
</div>
<!-- 油品选择-->
<div class="center-right">
<div class="center-top">
<div class="center-top-tab">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="全部" name="-1"></el-tab-pane>
<!-- <el-tab-pane v-for="item in oilNameList" :key="item.id"-->
<!-- :label="item.oilName" :name="item.id+''"></el-tab-pane>-->
<el-tab-pane v-for="(item,index) in oilNumberList" :key="index"
:label="getOilNamess(oilNameList,item.oilName)" :name="item.oilName+''">
<!-- {{getOilNamess(oilNameList,item.oilName)}}-->
</el-tab-pane>
</el-tabs>
</div>
<div class="center-top-data">
<div class="center-top-of">
<div class="wrap-wrap">
<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,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">
<img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">
<span style="font-size: 12px">{{ item.tankName }}</span>
</div>
</div>
</div>
</div>
<!-- -->
<div class="content-top-bottom">
<div>订单笔数 <span class="bule">{{ oilTotal }}件</span> </div>
<div>订单金额 <span class="bule">¥{{ oilAmount }}</span> </div>
</div>
</div>
</div>
<div class="center-left-bottom">
<div class="bottom-gd" @click="resetting">重置</div>
<!-- <div class="bottom-qk">解锁</div>-->
</div>
</div>
<!-- 商品选择-->
<div class="center-app">
<div class="center-top">
<div class="center-top-title">非油商品</div>
<div class="center-top-input">
<template>
<el-autocomplete
popper-class="my-autocomplete"
style="width: 94%"
v-model="goods"
:fetch-suggestions="querySearch"
placeholder="商品名称,商品关键词,商品条码"
@select="changeGoods">
<template slot-scope="{ item }">
<div style="display: flex;justify-content: space-between">
<span class="name">{{ item.name }}</span>
<span v-if="isMember" class="addr">{{ item.memberPrice }}</span>
<span v-else class="addr">{{ item.retailPrice }}</span>
</div>
</template>
</el-autocomplete>
</template>
</div>
<div class="center-top-data">
<div class="data-top">
<div class="data-top-title">商品</div>
<div class="data-top-three">
<div>库存</div>
<div v-if="isMember == false">单价</div>
<div v-else>会员价</div>
<div>数量</div>
<div>操作</div>
</div>
</div>
<div class="data-top-box" v-for="(item,index) in goodsOrder" :key="index">
<div class="data-top-title">{{ item.name }}</div>
<div class="data-top-three">
<div>{{ item.stock }}</div>
<div v-if="isMember == false">{{ item.retailPrice }}</div>
<div v-else>{{ item.memberPrice }}</div>
<div>
<el-input-number v-model="item.num" size="small" controls-position="right"
@change="handleChange" :min="1" :max="10"></el-input-number>
</div>
<div @click="delGoods(index)"><i class="el-icon-circle-close" style="font-size: 22px"></i></div>
</div>
</div>
<div class="content-top-bottom">
<div>商品数量 <span class="bule">{{ goodsTotal }}件</span> </div>
<div>商品总额 <span class="bule">¥{{ goodsAmount }}</span> </div>
</div>
</div>
</div>
<div class="center-left-bottom">
<div class="bottom-qk" @click="empty">清空</div>
<div style="display: flex">
<div class="bottom-qd" @click="dialogTakeOrder = true">取单</div>
<div class="bottom-gd" @click="dialogRegistration = true">挂单</div>
</div>
</div>
</div>
<!-- 加油员姓名-->
<el-dialog
title="选择加油员"
:visible.sync="dialogVisible"
width="30%"
:close-on-click-modal="false">
<div class="wrap-wrap">
<div class="of-box" v-for="(item,index) in staffList" :key="index"
@click="chooseStaff(item)"
:style="{'background-color': item.color}">
<div class="of-title">{{ item.realName }}</div>
<div style="text-align: center;font-size: 17px">{{ item.mobile }}</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false">关 闭</el-button>
<!-- <el-button type="primary" @click="dialogVisible = false">确 定</el-button>-->
</span>
</el-dialog>
<!-- 挂单-->
<el-dialog
title="挂单提示"
:visible.sync="dialogRegistration"
width="20%"
style="margin-top: 200px"
:close-on-click-modal="false">
<div class="wrap-wrap">
<p>
挂单只可将非油商品进行挂单,挂单成功后可在取单页面进行取单操作、挂单备注为选填
</p>
<div>
<el-input
type="textarea"
:rows="2"
style="width: 180%"
placeholder="请输入挂单备注(选填)"
v-model="registrationRemark">
</el-input>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogRegistration = false">关 闭</el-button>
<el-button type="primary" @click="registration">确 定</el-button>
</span>
</el-dialog>
<!-- 挂单成功提示-->
<el-dialog
title="挂单成功"
:visible.sync="dialogSuccess"
width="20%"
style="margin-top: 200px"
:close-on-click-modal="false">
<span>商品记录挂单成功</span>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="dialogVisible = false">取 消</el-button>-->
<el-button type="primary" @click="dialogSuccess = false">确 定</el-button>
</span>
</el-dialog>
<!-- 取单提示-->
<el-dialog
title="取单"
:visible.sync="dialogTakeOrder"
width="50%"
:close-on-click-modal="false">
<div style="height: 500px">
<el-row class="tac">
<el-col :span="6">
<el-input v-model="putRemark" placeholder="挂单备注检索" style="margin-bottom: 20px;width: 80%"></el-input>
<el-menu
default-active="2"
v-for="(item,index) in registrationList"
:key="index"
class="el-menu-vertical-demo">
<el-menu-item :index="index+''" @click="getTakeGoods(item,index)">
<span slot="title">{{ item.menu }}</span>
</el-menu-item>
</el-menu>
</el-col>
<el-col :span="18">
<el-table ref="tables" :data="takeList">
<el-table-column label="商品名称" align="center" prop="name" />
<el-table-column label="零售价" align="center" prop="retailPrice"/>
<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).toFixed(2) }}</span>
</template>
</el-table-column>
</el-table>
</el-col>
</el-row>
</div>
<span style="display: flex;justify-content: space-between">
<el-button class="elBut" @click="dialogTakeOrder = false" round>返 回</el-button>
<span>
<el-button class="elBut" type="danger" @click="cancel" round>作 废</el-button>
<el-button class="elBut" type="success" @click="pickOrder" round>取 单</el-button>
</span>
</span>
</el-dialog>
<!-- 立即结算-->
<el-dialog
title="扫码支付"
:visible.sync="dialogVisiblej"
width="30%"
:close-on-click-modal="false">
<div v-if="isPay==false"
v-loading="loading">
<div style="text-align: center;font-size: 15px;font-weight: bold">应收金额</div>
<div style="text-align: center;font-size: 30px;font-weight: bold;color: red;margin: 10px 0">
¥{{ +oilActualPay + (+goodsActualPay) }}
</div>
<div style="text-align: center;margin-bottom: 10px">
合计金额:{{ oilAmount + goodsAmount }}元、优惠合计{{ oilDiscount + goodsDiscount }}元
</div>
<div v-if="map.payType != 'CASH'">
<div>
<el-input v-model="authCode"
v-focus
autofocus
@keydown.enter.native="collection"
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
<i
slot="suffix">
<svg t="1697791915471" class="icon" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="1479" width="32" height="32"><path d="M149.333333 170.858667A21.546667 21.546667 0 0 1 170.858667 149.333333H384V106.666667H170.858667A64.213333 64.213333 0 0 0 106.666667 170.858667V384h42.666666V170.858667zM170.858667 874.666667A21.546667 21.546667 0 0 1 149.333333 853.141333V640H106.666667v213.141333A64.213333 64.213333 0 0 0 170.858667 917.333333H384v-42.666666H170.858667zM853.12 149.333333A21.546667 21.546667 0 0 1 874.666667 170.858667V384h42.666666V170.858667A64.213333 64.213333 0 0 0 853.141333 106.666667H640v42.666666h213.141333zM874.666667 853.141333A21.546667 21.546667 0 0 1 853.141333 874.666667H640v42.666666h213.141333A64.213333 64.213333 0 0 0 917.333333 853.141333V640h-42.666666v213.141333zM106.666667 490.666667h810.666666v42.666666H106.666667v-42.666666z" fill="#3D3D3D" p-id="1480"></path></svg>
</i>
</el-input>
</div>
<div class="demo-image"></div>
<div class="block" style="text-align: center">
<el-image
style="width: 200px; height: 200px"
fit="cover"
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
</div>
</div>
<div v-else>
<div>
<el-input v-model="authCode"
v-focus ref="getFocus"
autofocus
@input="changeSeekZero"
@keydown.enter.native="collection"
placeholder="请输入收款金额">
</el-input>
</div>
<div style="text-align: right;margin: 10px 0">
<span>应找零</span>
<span style="color: red;font-size: 18px"> ¥{{ seekZero }}</span>
</div>
</div>
<el-divider></el-divider>
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
<el-button @click="clear" class="but">取 消</el-button>
<el-button type="primary" class="but" @click="collection">确 定 收 款</el-button>
</span>
</div>
<div v-else>
<div v-if="isPaySuccess">
<el-result icon="success" title="收款成功">
<template slot="extra">
<el-button type="primary" @click="handClose">关 闭</el-button>
</template>
</el-result>
</div>
<div v-else>
<el-result icon="error" title="支付失败,请重新支付">
<template slot="extra">
<el-button type="primary" @click="handClose">关 闭</el-button>
</template>
</el-result>
</div>
</div>
</el-dialog>
<!-- 立即结算-->
<el-dialog
title="扫码支付"
:visible.sync="dialogVisiblejLoading"
width="30%"
:close-on-click-modal="false">
<div>
<el-result icon="info" title="支付状态未查询成功,请移至订单查看">
<template slot="extra">
<el-button type="primary" @click="handClose">关 闭</el-button>
</template>
</el-result>
</div>
</el-dialog>
<!-- 会员登录-->
<el-dialog
title="会员信息"
:visible.sync="dialogVisiblevip"
width="30%"
:close-on-click-modal="false">
<div >
<el-input placeholder="会员手机号、用户昵称" v-model="userNo"
clearable
@keyup.enter.native="getUser"
class="input-with-select" style="text-align: center;">
<el-select v-model="select1" slot="prepend" placeholder="请选择" style="width: 120px">
<el-option label="会员手机号" value="会员手机号"></el-option>
<el-option label="用户昵称" value="用户昵称"></el-option>
</el-select>
<el-button slot="append" @click="getUser">查询</el-button>
</el-input>
</div>
<el-row>
<el-descriptions title="会员信息" :column="2">
<el-descriptions-item label="手机号">{{member.mobile ? member.mobile : "--"}}</el-descriptions-item>
<el-descriptions-item label="会员昵称">{{member.name ? member.name : "--"}}</el-descriptions-item>
<el-descriptions-item label="积分">{{member.points ? member.points : "--"}}</el-descriptions-item>
<!-- <el-descriptions-item label="加油金余额">0</el-descriptions-item>-->
<el-descriptions-item label="车牌号">{{member.carNo ? member.carNo : "--"}}</el-descriptions-item>
<el-descriptions-item label="会员备注">{{member.remark ? member.remark : "--"}}</el-descriptions-item>
</el-descriptions>
<el-descriptions title="会员等级">
<el-descriptions-item label="等级名称">{{member.gradeId ? getGradeName(gradeList,member.gradeId) : "--"}}</el-descriptions-item>
</el-descriptions>
<el-descriptions title="储值余额">
<template slot="extra">
<!-- <span style="color: red;margin-right: 20px">余额充值</span>-->
<span style="font-weight: bold">¥{{member.cardBalance ? member.cardBalance : "--"}}</span>
</template>
<el-descriptions-item v-if="member.cardBalance!=0" label="账户余额">{{member.cardBalance ? member.cardBalance : "--"}}元</el-descriptions-item>
</el-descriptions>
</el-row>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblevip = false">取 消</el-button>
<el-button type="primary" :disabled="isSure" @click="chooseUser(member)">确 定</el-button>
</span>
</el-dialog>
<!-- 加油枪加油金额-->
<el-dialog
title="加油金额"
:close-on-click-modal="false"
:visible.sync="dialogVisibleamount"
width="30%">
<div class="amount">
<span>已选油品</span>
<span class="amountBlue">{{ getName(oilNameList,form.oilName) }}</span>
</div>
<div class="amount">
<span>已选油枪</span>
<span class="amountBlue">{{ form.gunName }}</span>
</div>
<div class="amount">
<span>油品单价</span>
<span class="amountBlue">{{ form.oilPrice }}元/L</span>
</div>
<div >
<el-input v-model="amount" v-focus @input="form.amount = amount" placeholder="请输入加油金额"
style="font-weight: 700;text-align: center;font-size: 20px;">
<el-select v-model="select" style="width: 70px" @change="changeSelect" slot="append" placeholder="请选择">
<el-option label="元" value="元"></el-option>
<el-option label="L" value="L"></el-option>
</el-select>
</el-input>
<!-- <el-input v-model="form.amount"></el-input>-->
</div>
<el-row :gutter="20">
<el-col :span="6" v-for="(item,index) in rise" :key="index">
<el-button class="grid-content bg-purple" @click="changeAmount(item.value)">{{ item.value }}</el-button>
</el-col>
</el-row>
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
<el-button @click="dialogVisibleamount = false" class="but">取 消</el-button>
<el-button type="primary" @click="getOilOrder" class="but">确 定</el-button>
</span>
</el-dialog>
<!-- 模糊查询会员列表信息-->
<el-dialog
title="请选择会员"
:visible.sync="dialogVisibleMember"
:close-on-click-modal="false">
<div class="wrap-wrap" style="height:700px;overflow-y: scroll;">
<el-table ref="tables" :data="memberList">
<el-table-column label="ID" align="center" prop="id" width="80" />
<el-table-column label="头像" align="center" width="70">
<template slot-scope="scope">
<img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template>
</el-table-column>
<el-table-column label="姓名" align="center" prop="name" />
<el-table-column label="手机号" align="center" prop="mobile"/>
<el-table-column label="注册时间" align="center" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
<template slot-scope="scope">
<el-button
type="primary" round
@click="handleChoose(scope.row)"
>选择</el-button>
</template>
</el-table-column>
</el-table>
</div>
</el-dialog>
<!-- 新增挂账信息-->
<el-dialog
title="挂账" width="700px"
:visible.sync="dialogVisibleCredit"
:close-on-click-modal="false">
<el-form ref="form" :model="form1" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="挂账单位" prop="unitName" style="width: 420px">
<el-autocomplete
popper-class="my-autocomplete"
v-model="form1.unitName"
style="width: 180%"
:fetch-suggestions="querySearch1"
placeholder="请选择挂账单位"
@select="changeUnit">
<template slot-scope="{ item }">
<div style="display: flex;justify-content: space-between">
{{item.unitName}}{{item.personCredit}} {{item.contactMobile}}
</div>
</template>
<el-button slot="append" @click="open1 = true">新增挂账单位</el-button>
</el-autocomplete>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="可用额度" prop="creditLimit">
<el-input v-model="form1.creditLimit" placeholder="请先选择挂账单位" disabled>
<template slot="append">元</template>
</el-input>
<span style="font-size: 12px;color: grey;">
可用额度为挂账人的最大可用额度,如挂账金额大于可用额度,将无法进行挂账,0为不限额
</span>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="挂账金额" prop="amount">
<el-input v-model="form1.amount" placeholder="请输入挂账金额" maxlength="30" >
<template slot="append">元</template>
</el-input>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注信息" prop="remark">
<el-input v-model="form1.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisibleCredit = false">取 消</el-button>
<el-button type="primary" @click="addHangbill">确 定</el-button>
</span>
</el-dialog>
<!-- 新增挂账单位信息-->
<el-dialog title="新增挂账单位" :visible.sync="open1" width="700px" append-to-body>
<el-form ref="formName" :model="form2" :rules="rules1" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="挂账单位" prop="unitName">
<el-input v-model="form2.unitName" show-word-limit placeholder="请输入挂账单位名称" maxlength="50" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="负责人" prop="personCredit">
<el-input v-model="form2.personCredit" show-word-limit placeholder="请输入挂账单位负责人姓名" maxlength="10" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="联系电话" prop="contactMobile">
<el-input v-model="form2.contactMobile" show-word-limit placeholder="请输入挂账单位联系电话" maxlength="15" />
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="挂账额度" prop="creditLimit">
<el-input v-model="form2.creditLimit" placeholder="请输入挂账额度为0则不限额" maxlength="30">
<template slot="append">元</template>
</el-input>
<span style="font-size: 12px;color: grey;">
0为不限额,额度为当前单位最大可挂账金额,如已挂账金额归还,额度将也同步返还
</span>
</el-form-item>
</el-col>
</el-row>
<el-form-item label="备注信息" prop="remark">
<el-input v-model="form2.remark" type="textarea" placeholder="请输入内容"></el-input>
</el-form-item>
<el-row>
<el-col :span="24">
<el-form-item label="单位状态" prop="status">
<el-radio-group v-model="form2.status">
<el-radio label="qy" value="qy">启用</el-radio>
<el-radio label="jy" value="jy">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="open1 = false"> </el-button>
<el-button type="primary" @click="addCredit"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import {getDicts} from "@/api/dict/data";
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
import {listgoods} from "@/api/cashier/ljgoods";
import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
import {getOilGun, getOilTank} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
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";
import {getSysConfig} from "@/api/staff/user/sysconfig";
import {cashierOrderByOrderNo} from "@/api/cashier/cashierorder";
const cityOptions = ['上海', '北京'];
export default {
name: "homeindex",
data(){
return{
baseUrl:process.env.VUE_APP_BASE_API,
// 满减全选
checkAll1: false,
isIndeterminate1: true,
checkedCities1: [],
cities1: cityOptions,
fullReduceDiscount: [],
// 等级全选
checkAll2: false,
isIndeterminate2: true,
checkedCities2: [],
cities2: cityOptions,
gradeDiscount: [],
// 囤油卡全选
checkAll3: false,
isIndeterminate3: true,
checkedCities3: [],
cities3: cityOptions,
// 储值卡全选
checkAll4: false,
isIndeterminate4: true,
checkedCities4: [],
cities4: cityOptions,
// 优惠券全选
checkAll5: false,
isIndeterminate5: true,
checkedCities5: "",
cities5: cityOptions,
couponDiscount: [],
// 优惠券列表
couponList:[],
// 消费升数
consumeRefuelMoney:0,
// 满减优惠
fullReduction:0,
// 囤油卡信息
refuelMoney:null,
// 会员消费金额(储值卡需要减少的金额)
consumeAmount:0,
// 账户余额
balance:0,
// 绑定金额数据
amount:0,
// 找零金额
seekZero:0,
// 等待中
loading:false,
// 油号
oilType:'',
oilNameID:'',
// 油品类型
type:"",
// 取单列表
takeList:[],
// 挂单备注检索
putRemark:"",
// 挂单备注
registrationRemark:"",
// 挂单列表
registrationList:[],
// 油品订单
oilOrder:[],
// 油品金额
oilAmount:0,
// 油品订单数
oilTotal:0,
// 油品实付金额
oilActualPay:0,
// 油品优惠金额
oilDiscount:0,
// 扣除升数后需要消费的金额
hoardAmount:0,
// 是否使用囤油卡
isOilStorageCard:false,
// 商品优惠金额
goodsDiscount:0,
// 商品实付金额
goodsActualPay:0,
// 商品订单
goodsOrder:[],
// 商品金额
goodsAmount:0,
// 商品订单数
goodsTotal:0,
// 加油金额
rise:[
{value:"¥100"},
{value:"¥150"},
{value:"¥200"},
{value:"¥300"},
],
// 会员信息
member:{},
// 会员列表信息
memberList:[],
select1:'会员手机号',
storeId:"",
// 查询会员信息参数
userNo:"",
// 查询的商品信息
goods:"",
select:"元",
form:{ amount : 0,exist:false },
form1:{},
form2:{
unitName:"",
personCredit:"",
contactMobile:"",
creditLimit:0,
remark:'',
status:'qy',
},
oilNumGunList:[],
authCode:'',
// 油号列表
oilNumList:[],
// 商品列表
goodsList:[],
// 油枪列表
oilGunList:[],
// 支付方式列表
payList:[],
// 倒计时
timestamp: 15,
dialogVisible: false,
dialogVisiblej: false,
dialogVisiblejLoading: false,
dialogVisiblevip:false,
dialogVisibleamount:false,
dialogVisibleMember:false,
dialogRegistration:false,
dialogSuccess:false,
dialogTakeOrder:false,
dialogVisibleCredit:false,
open1:false,
activeName: '-1',
tabarr:[
{name:'收银台',icon:'el-icon-s-platform'},
{name:'充值',icon: 'el-icon-s-finance'},
{name:'订单',icon: 'el-icon-s-order'},
{name:'会员',icon: 'el-icon-s-custom'},
{name:'核销',icon: 'el-icon-s-check'},
{name:'挂账',icon:'el-icon-s-claim'},
{name:'积分',icon:'el-icon-s-data'},
{name:'交班',icon: 'el-icon-s-flag'},
],
leftindex:0,
oilList:[],
colorList:[
{color:'#e5f0ff'},
{color:'#fff2e5'},
{color:'#e5edf1'},
{color:'#ecfae5'},
{color:'#fafafa'}
],
restaurants:'',
num: 1,
// 油号名称
oilNameList:'',
// 员工列表
staffList:[],
isMember: false,
// 员工信息
staff:"",
// 优惠券id
couponIds:[],
// 使用的优惠券id
useCouponIds:"",
payType:"WECHAT",
map:{
allAmount:0,
// 用户支付条码信息
authCode:'',
// 油品订单
oilOrder:"",
// 商品订单
goodsOrder:"",
// 支付方式
payType:"WECHAT",
// 油品订单金额
oilAmount:0,
// 商品订单金额
goodsAmount:0,
// 油品实付金额
oilActualPay:0,
// 商品实付金额
goodsActualPay:0,
// 付款用户
payUser:"",
// 油品优惠金额
oilDiscount:0,
// 商品优惠金额
goodsDiscount:0,
// 员工id
staffId:"",
// 优惠券id
couponId:"",
// 会员id
userId:"",
// 提成金额
commissionAmount:0,
// 使用积分数量
usePoint:0,
// 积分金额
pointAmount:0,
// 终端
terminal:"PC",
// 商品数量
goodsNum:0,
// 会员消费金额(储值卡需要减少的金额)
consumeAmount:0,
// 消费后的升数json
refuelMoney:"",
// 找零金额
seekZero:0,
},
// 会员等级名称
gradeName:"",
// 会员等级列表
gradeList:"",
menu:1,
index:0,
// 是否支付
isPay:false,
isPaySuccess:false,
// 订单号
orderNo:'',
timer: null,
// 是否一直查询
isQuery:true,
// 油枪列表
gunList:[],
// 油号列表
oilNumberList:[],
// 是否可以点会员确定按钮
isSure:true,
// 优惠券消费金额
couponAmount:0,
// 是否为满减互斥
isUseFull:false,
// 是否为储值卡互斥
isUseBalance:false,
// 互斥限制 -1没有限制 0满减互斥 1储值卡互斥
exclusion:-1,
isExistOilOrder:false,
// 是否存在固定等级会员优惠
isFixingLevel:false,
// 查询优惠活动信息所需参数
preferentialData:{
userId:"",
storeId:"",
gradeId:"",
oilName:"",
oilPrice:"",
oilLiters:"",
},
// 挂账单位信息
unitList:[],
// 表单校验
rules: {
unitName: [ { required: true, message: "请选择挂账单位", trigger: "blur" }, ],
amount: [{ required: true, message: "请输入挂账金额", trigger: "blur" }],
creditLimit: [{ required: true, message: "可用额度不可为空", trigger: "blur" }],
},
rules1: {
unitName: [ { required: true, message: "请填写挂账单位名称", trigger: "blur" }, ],
personCredit: [{ required: true, message: "请填写挂账单位负责人姓名", trigger: "blur" }],
contactMobile: [ { required: true, message: "请填写挂账单位联系电话", trigger: "blur" }, ],
creditLimit: [ { required: true, message: "请填写挂账额度", trigger: "blur" }, ],
status: [ { required: true, message: "请选择挂账单位状态", trigger: "blur" }, ],
},
}
},
created() {
this.getPayList();
this.getOilName();
this.getGoods();
this.getStaffList();
this.getStaff();
this.getList();
this.getCouponList();
this.getUnitList();
},
directives: {
// 注册一个局部的自定义指令 v-focus
focus: {
// 指令的定义
inserted: function (el) {
// 聚焦元素
el.querySelector('input').focus()
// this.$nextTick( () =>{
// this.$refs.getFocus.focus()
// })
},
},
},
methods:{
clear(){
this.dialogVisiblej = false
this.seekZero = 0
},
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;
},
getOilNamess(list,id){
let name = ""
if(list!=null && list!=""){
list.forEach(item => {
if (item.id == id){
name = item.oilName;
}
})
}
return name;
},
// 挂账
addCredits(type){
this.typeIdex = type
this.map.payType = "credit"
this.payType = "credit"
this.dialogVisibleCredit = true
this.form1.amount = this.oilAmount + this.goodsAmount
},
// 获取挂账单位列表
getUnitList(){
let obj = {};
let _this = this;
listCreditUnit().then( response => {
response.data.forEach(item => {
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
_this.unitList.push(obj)
})
})
},
// 添加挂账单位信息
addCredit(){
this.$refs["formName"].validate((valid) => {
if (valid) {
addCreditUnit(this.form2).then( response => {
this.$modal.msgSuccess("挂账单位信息创建成功");
this.open1 = false;
this.getUnitList();
})
}else {
return false;
}
})
},
// 添加挂账记录
addHangbill(){
this.$refs["form"].validate((valid) => {
if (valid) {
addHangBill(this.form1).then( response => {
if (response.data==0){
this.$modal.msgError("挂账单位可用额度不足,无法进行挂账");
}else {
this.$modal.msgSuccess("挂账记录添加成功");
this.dialogVisibleCredit = false;
this.resetMember();
this.resetting();
this.empty();
}
})
}else {
return false;
}
})
},
// 选择挂账单位
changeUnit(val){
this.form1.creditUnitId = val.id;
this.form1.creditLimit = val.creditLimit
return val.id
},
querySearch1(queryString, cb) {
let _this = this;
let obj = {};
let results = _this.unitList
if (queryString != "" && queryString!=undefined){
results = [];
_this.unitList.forEach(item => {
if (item.unitName.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
if (item.personCredit.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
if (item.contactMobile.includes(queryString)){
obj = item;
obj.value = `${item.unitName}${item.personCredit} ${item.contactMobile}`
results.push(obj)
}
})
}
cb(results);
},
// 计算找零金额
changeSeekZero(){
this.seekZero = (this.authCode - this.oilActualPay - this.goodsActualPay).toFixed(2)
},
// 获取会员等级id
getGradeName(list,id){
let name = "";
list.forEach(item => {
if (item.id == id){
name = item.name
}
})
this.gradeName = name;
return name;
},
// 选择优惠信息
handleCheckAllChange1(val) {
if (this.exclusion == 0){
if (val){
this.checkAll5 = false;
this.couponAmount = 0;
}
}
let list = []
this.fullReduceDiscount.forEach(item => {
list.push(item.type)
})
if (val){
this.fullReduction = 0;
this.fullReduceDiscount.forEach(item => {
this.fullReduction += +item.reduce
})
this.isUseFull = false;
}else {
this.fullReduction = 0;
this.isUseFull = true;
}
this.checkedCities1 = val ? list : [];
this.isIndeterminate1 = false;
this.isDefaultUseCard();
},
handleCheckedCitiesChange1(value) {
this.fullReduction = 0;
this.fullReduceDiscount.forEach(item => {
let reduces = 0
for (let i = 0; i < value.length; i++){
if (item.type == value[i]){
reduces = item.reduce
}
}
this.fullReduction += +reduces
})
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.fullReduceDiscount.length;
this.isDefaultUseCard();
},
handleCheckAllChange2(val) {
let list = []
this.gradeDiscount.forEach(item => {
list.push(item.type)
})
if (val){
this.gradeDiscount.forEach(item => {
this.oilDiscount += +item.reduce
})
}else {
this.oilDiscount = 0
}
this.checkedCities2 = val ? list : [];
this.isIndeterminate2 = false;
this.isDefaultUseCard();
},
handleCheckedCitiesChange2(value) {
this.oilDiscount = 0
this.gradeDiscount.forEach(item => {
let reduces = 0
for (let i = 0; i < value.length; i++){
if (item.type == value[i]){
reduces = item.reduce
}
}
this.oilDiscount += +reduces
})
let checkedCount = value.length;
this.checkAll2 = checkedCount === this.gradeDiscount.length;
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
this.isDefaultUseCard();
},
handleCheckAllChange3(val) {
if (val==false){
this.consumeRefuelMoney = 0;
// this.hoardAmount = 0;
this.isOilStorageCard = false;
}else {
this.isOilStorageCard = true;
this.changeRefuelMoney()
}
this.isDefaultUseCard();
},
handleCheckedCitiesChange3(value) {
let checkedCount = value.length;
this.checkAll3 = checkedCount === this.cities3.length;
this.isIndeterminate3 = checkedCount > 0 && checkedCount < this.cities3.length;
},
handleCheckAllChange4(val) {
if (val==false){
this.consumeAmount = 0;
this.isUseBalance = true;
}else {
this.isUseBalance = false;
}
this.isDefaultUseCard();
},
handleCheckedCitiesChange4(value) {
let checkedCount = value.length;
this.checkAll4 = checkedCount === this.cities4.length;
this.isIndeterminate4 = checkedCount > 0 && checkedCount < this.cities4.length;
},
handleCheckAllChange5(val) {
if (this.exclusion == 0){
if (val){
this.checkAll1 = false;
this.fullReduction = 0;
this.isUseFull = true;
this.checkedCities5 = this.couponDiscount[0].name;
}else {
this.isUseFull = false;
this.checkedCities5 = ""
}
}else if (this.exclusion == 0){
if (val){
this.checkAll4 = false;
this.consumeAmount = 0;
this.isUseBalance = true;
this.checkedCities5 = this.couponDiscount[0].name;
}else {
this.isUseBalance = false;
this.checkedCities5 = ""
}
}
if (val){
this.couponAmount = 0
this.couponAmount = this.couponDiscount[0].reduce
this.useCouponIds = ""
this.couponIds.forEach(item => {
if (item.name = this.couponDiscount[0].name){
this.useCouponIds = item.id
}
})
this.checkedCities5 = this.couponDiscount[0].name;
}else {
this.useCouponIds = ""
this.couponAmount = 0
this.checkedCities5 = ""
}
this.isDefaultUseCard();
},
handleCheckedCitiesChange5(value) {
this.couponAmount = 0;
this.couponDiscount.forEach(item => {
if (item.name == value){
this.couponAmount = item.reduce
}
})
this.useCouponIds = ""
this.couponIds.forEach(item => {
if (item.name == value){
this.useCouponIds = item.id
}
})
this.checkAll5 = true;
this.isDefaultUseCard();
},
// 模糊查询商品信息
querySearch(queryString, cb) {
let _this = this;
let results = _this.goodsList;
if (queryString != ""){
results = [];
_this.goodsList.forEach(item => {
if(item.name.includes(queryString)){
results.push(item)
}
if(item.goodsNo.includes(queryString)){
results.push(item)
}
})
}
cb(results);
},
// 取单
pickOrder(){
let list = this.takeList
this.goodsOrder = list;
let num = 0;
let amount = 0;
let _this = this;
list.forEach(item => {
num += item.num;
if (_this.isMember){
amount += +item.memberPrice;
}else {
amount += +item.retailPrice;
}
})
this.goodsTotal = num;
this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.dialogTakeOrder = false;
},
// 作废
cancel(){
this.registrationList.splice(this.index,1);
this.takeList = [];
},
// 取单列表
getTakeGoods(data,index){
this.takeList = data.children;
this.index = index;
},
// 挂单
registration(){
this.dialogRegistration = false;
this.registrationList.push({menu:this.menu,children:this.goodsOrder})
this.menu++;
this.goodsOrder = [];
this.goodsTotal = 0;
this.goodsAmount = 0;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.getTakeGoods(this.registrationList[0]);
this.dialogSuccess = true;
},
// 重置会员
resetMember(){
this.member = {};
this.isMember = false;
this.map.payUser == "";
this.balance = 0;
this.oilDiscount = 0;
this.goodsDiscount = 0;
this.userNo = "";
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
this.goodsActualPay = this.goodsAmount - this.goodsDiscount
this.isSure = false;
this.handleChange();
},
// 根据会员等级信息获取等级优惠信息
getGrade(userId,gradeId){
this.isFixingLevel = false
let _this = this;
this.oilDiscount = 0;
this.gradeDiscount = [];
userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => {
let gasolineDiscount = 0;
let dieselDiscount = 0;
let naturalGasDiscount = 0;
_this.gradeDiscount = [];
if (response.data) {
_this.oilOrder.forEach(item => {
let discount = {type: "", full: 0, reduce: 0, liters: 0}
if (item.type == "汽油") {
if (response.data.fixingLevel){
_this.isFixingLevel = true
let gasolineRule = JSON.parse(response.data.fixingLevel.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
}
}
}else {
if (response.data.userGrade) {
let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.gasolineDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = gasolineRule[i - 1].gasolineRule2
discount.reduce = gasolineRule[i - 1].gasolineRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
gasolineDiscount += +oilDiscount
} else if (response.data.userGrade.gasolineDiscount == "每升优惠") {
discount.type = "每升优惠"
let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++) {
// 将满减条件加入等级优惠列表
if (gasolineRule.length > 1) {
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
discount.liters = gasolineRule[i - 1].gasolineRule3
break;
}
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
} else {
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
discount.full = gasolineRule[i - 1].gasolineRule1
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
discount.liters = gasolineRule[i - 1].gasolineRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
gasolineDiscount += +oilDiscount
} else {
gasolineDiscount = 0;
}
}
}
}
}
if (item.type == "柴油") {
if (response.data.fixingLevel){
_this.isFixingLevel = true
let dieselRule = JSON.parse(response.data.fixingLevel.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "每升优惠"
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
}
}
}else {
if (response.data.userGrade) {
let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.dieselDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= dieselRule.length; i++) {
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = dieselRule[i - 1].dieselRule2
discount.reduce = dieselRule[i - 1].dieselRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
dieselDiscount += +oilDiscount
} else if (response.data.userGrade.dieselDiscount == "每升优惠") {
let oilDiscount = 0;
for (let i = 1; i <= dieselRule.length; i++) {
discount.type = "每升优惠"
// 将满减条件加入等级优惠列表
if (dieselRule.length > 1) {
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
break;
}
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
discount.full = dieselRule[i - 1].dieselRule1
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
} else {
discount.full = dieselRule[i - 1].dieselRule1
if (item.amount >= dieselRule[i - 1].dieselRule1) {
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
discount.liters = dieselRule[i - 1].dieselRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每升优惠')
}
dieselDiscount += +oilDiscount
} else {
dieselDiscount = 0;
}
}
}
}
}
if (item.type == "天然气") {
if (response.data.fixingLevel){
_this.isFixingLevel = true
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
}
}
}else {
if (response.data.userGrade.userGrade) {
let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
let oilDiscount = 0;
discount.type = "满减优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('满减优惠')
}
naturalGasDiscount += +oilDiscount
} else if (response.data.userGrade.naturalGasDiscount == "每单位优惠") {
let oilDiscount = 0;
discount.type = "每单位优惠"
for (let i = 1; i <= naturalGasRule.length; i++) {
// 将满减条件加入等级优惠列表
if (naturalGasRule.length > 1) {
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
break;
}
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
} else {
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
discount.full = naturalGasRule[i - 1].naturalGasRule1
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
discount.liters = naturalGasRule[i - 1].naturalGasRule3
}
}
}
if (discount.reduce != 0) {
_this.gradeDiscount.push(discount)
_this.checkedCities2.push('每单位优惠')
}
naturalGasDiscount += +oilDiscount
} else {
naturalGasDiscount = 0;
}
}
}
}
}
})
}
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
_this.checkAll2 = true;
_this.isDefaultUseCard();
})
},
// 选择会员
async chooseUser(data){
this.dialogVisiblevip = false
this.isMember = true;
this.map.payUser = data.mobile;
this.map.userId = data.id;
this.balance = this.member.cardBalance;
if (data.refuelMoney){
// 使用囤油卡
this.refuelMoney = JSON.parse(data.refuelMoney)
this.changeRefuelMoney();
}else
await this.getGrade(data.id,data.gradeId)
if (!this.isFixingLevel){
this.preferentialData.storeId = this.storeId;
this.preferentialData.userId = data.id;
this.preferentialData.gradeId = data.gradeId;
if (this.oilOrder.length>0){
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 =[];
_this.couponIds = [];
selectCoupon(_this.preferentialData).then(response => {
_this.couponAmount = 0;
_this.couponIds = response.data
if (response.data.length>0){
response.data.forEach(item => {
_this.useCouponIds = item.id
let discount = {type:item.type,discountType:item.discountType,name:item.name,oilName:item1.oilName,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){
if (_this.couponDiscount.length!=0){
_this.couponDiscount.forEach(item2 => {
if (item2.oilName!=discount.oilName) {
_this.couponDiscount.push(discount)
_this.checkedCities5 = item.name
_this.couponAmount = discount.reduce
}
if (item2.name!=discount.name && item2.oilName==discount.oilName) {
_this.couponDiscount.push(discount)
_this.checkedCities5 = item.name
_this.couponAmount = discount.reduce
}
})
}else {
_this.couponDiscount.push(discount)
_this.checkedCities5 = item.name
_this.couponAmount = discount.reduce
}
}
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.exclusion = item.exclusiveFunction
})
}
_this.checkAll5 = true;
_this.isDefaultUseCard();
})
})
},
// 使用囤油卡 囤油卡不参与任何优惠
countOilCard(){
if (this.hoardAmount>0){
if (this.balance!=0 && this.balance >= this.hoardAmount){
this.oilActualPay = 0
this.consumeAmount = this.hoardAmount
}else {
this.oilActualPay = (this.hoardAmount -this.balance).toFixed(2)
this.consumeAmount = this.balance
}
}else {
this.oilActualPay = 0
this.consumeAmount = 0
}
console.log("囤油卡",this.isOilStorageCard,this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
},
// 使用优惠券不使用满减
countAmountFull(){
if (this.isMember){
// 满减互斥
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
this.oilActualPay = 0
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount
}else {
this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.couponAmount).toFixed(2)
this.consumeAmount = this.balance
}
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
console.log("优惠券",this.oilAmount, this.oilDiscount,this.couponAmount)
},
// 使用优惠券和满减不使用储值卡
countAmountUnBalance(){
if (this.isMember){
this.oilActualPay = (this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount).toFixed(2)
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
this.consumeAmount = 0
console.log("优惠券和满减",this.oilAmount , this.fullReduction , this.oilDiscount , this.couponAmount)
},
// 使用储值卡不使用优惠券 || 使用满减不使用优惠券
countAmountBalance(){
if (this.isMember){
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
this.oilActualPay = 0
this.consumeAmount = (this.oilAmount*100 - this.oilDiscount*100 - this.fullReduction*100)/100
}else {
this.oilActualPay = (this.oilAmount -this.balance - this.oilDiscount - this.fullReduction).toFixed(2)
this.consumeAmount = this.balance
}
}else {
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2)
}
console.log("储值卡满减",this.oilAmount, this.oilDiscount,this.fullReduction)
},
// 判断互斥限制
isExclusion(){
if (this.exclusion == 1){
// 不使用满减
if (this.isUseBalance){
this.countAmountFull()
return;
}
// 储值卡互斥
if (this.isUseBalance){
this.countAmountUnBalance()
return;
}else {
this.countAmountBalance()
return;
}
}else if (this.exclusion == 0){
// 满减互斥
// 不使用储值卡
if (this.isUseBalance){
this.countAmountUnBalance()
return;
}
if (this.isUseFull){
this.countAmountFull()
return;
}else {
this.countAmountBalance()
return;
}
}else {
// 无互斥
// 不使用储值卡
if (this.isUseBalance){
this.countAmountUnBalance()
return;
}
// 不使用满减
if (this.isUseBalance){
this.countAmountFull()
return;
}
// 使用囤油卡
// if (this.isOilStorageCard){
// this.checkAll1 = false;
// this.fullReduction = 0;
// this.checkAll2 = false;
// this.checkedCities2 = [];
// this.oilDiscount = 0;
// this.checkAll5 = false;
// this.couponAmount = 0;
// this.countOilCard();
// return;
// }
this.countAmountBalance();
}
},
// 默认使用囤油卡
isDefaultUseCard(){
if (this.isOilStorageCard){
this.checkAll3 = true;
this.checkAll1 = false;
this.fullReduction = 0;
this.checkAll2 = false;
this.checkedCities2 = [];
this.oilDiscount = 0;
this.checkAll5 = false;
this.couponAmount = 0;
this.countOilCard();
if (this.hoardAmount>0 && this.balance > 0){
this.checkAll4 = true;
}
}else {
this.isExclusion()
}
},
// 调用优惠参数接口
preferential(){
let _this = this;
// _this.fullReduction = 0;
let fullReduction = 0;
_this.fullReduction = 0;
_this.oilOrder.forEach(item1 => {
_this.preferentialData.oilName = item1.oilName;
_this.preferentialData.oilPrice = item1.oilPrice;
_this.preferentialData.oilLiters = item1.liters;
selectPreferential(_this.preferentialData).then( response => {
if (response.data.length>0){
_this.fullReduceDiscount = []
response.data.forEach(item => {
if (item.participationCondition==1){
_this.exclusion = 0
}
let discount = {type:item.name,full:0,reduce:0,discount:0,exclusion:item.participationCondition}
let activeList = item.activeDiscountChildList;
if (activeList.length>0) {
for (let i = 1; i <= activeList.length; i++) {
if (activeList.length > 0) {
if (activeList[0].discount != null) {
// 折扣营销
if (item1.amount >= activeList[0].amount) {
discount.full = activeList[0].amount;
discount.discount = activeList[0].discount;
discount.reduce = item1.amount - (item1.amount * (activeList[0].discount / 10)).toFixed(2)
fullReduction = item1.amount - (item1.amount * (activeList[0].discount / 10)).toFixed(2);
}
} else {
// 满减
if (item1.amount >= activeList[0].amount) {
discount.full = activeList[0].amount;
discount.reduce = activeList[0].deductionAmount;
fullReduction = activeList[0].deductionAmount;
}
}
}
}
}
if (activeList.length==0){
fullReduction = 0
}
if (discount.reduce!=0){
_this.fullReduceDiscount.push(discount)
_this.checkedCities1.push(item.name)
_this.checkAll1 = true;
}
_this.fullReduction += +fullReduction
})
}
if (_this.isUseFull){
_this.checkAll1 = false;
_this.checkedCities1 = []
_this.fullReduction = 0
}
_this.isDefaultUseCard();
})
})
},
// 选择会员信息
handleChoose(data) {
this.isSure = false;
this.member = data;
// if (data.refuelMoney != null && data.refuelMoney != ""){
// this.refuelMoney = JSON.parse(data.refuelMoney)
// }
this.dialogVisibleMember = false;
},
// 清空商品订单列表
empty(){
this.goodsOrder = [];
this.goodsTotal = 0;
this.goodsAmount = 0;
this.goodsActualPay = 0;
this.goodsDiscount = 0;
},
// 获取当前账户信息
getStaff(){
staffInfo().then( response => {
this.staff = response.data;
this.map.staffId = this.staff.id;
})
},
// 选择员工信息
chooseStaff(data){
this.staff = data;
this.map.staffId = this.staff.id;
this.dialogVisible = false
},
// 删除商品列表信息
delGoods(index){
this.goodsOrder.splice(index,1)
this.handleChange()
},
// 添加商品列表信息
changeGoods(val){
let result = true;
let goods = this.goodsOrder;
let _this = this;
if (this.goodsOrder.length > 0) {
let amount = 0;
for (let i = 0; i < goods.length; i++) {
if (goods[i].id == val.id) {
if (val.stock<goods[i].num + 1){
this.$modal.msgError("商品库存不足请重新选择商品")
break;
}
goods[i].num = goods[i].num + 1;
this.goodsTotal += 1;
result = false;
break;
} else {
result = true;
}
if (_this.isMember) {
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
} else {
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
}
}
this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
} else {
result = true;
}
if (result) {
if (val.stock==0){
this.$modal.msgError("商品库存不足请重新选择商品")
return;
}
val.num = 1;
if (_this.isMember) {
this.goodsAmount += +val.memberPrice
} else {
this.goodsAmount += +val.retailPrice
}
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
this.goodsOrder.push(val);
this.goodsTotal += 1;
}else {
if (val.stock==0){
this.$modal.msgError("商品库存不足请重新选择商品")
return;
}
if (_this.isMember) {
this.goodsAmount += +val.memberPrice * val.num
} else {
this.goodsAmount += +val.retailPrice * val.num
}
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
}
this.goods = ""
},
// 立即结算
settlement(){
if (this.payType=="APPLET_CODE") {
if (this.goodsOrder.length > 0) {
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
}
this.authCode = ""
this.seekZero = 0;
this.isPay = false
this.dialogVisiblej = true
this.getStaff()
},
// 重置油品订单
resetting(){
this.seekZero = 0;
this.oilOrder = [];
this.oilActualPay = 0;
this.oilTotal = 0;
this.oilAmount = 0;
this.oilDiscount = 0;
this.consumeAmount = 0;
this.consumeRefuelMoney = 0;
this.fullReduction = 0;
this.couponAmount = 0;
this.fullReduceDiscount = [];
this.gradeDiscount = [];
this.couponDiscount = [];
if (this.member.refuelMoney!=null){
this.refuelMoney = JSON.parse(this.member.refuelMoney)
}
this.amount = 0;
},
// 获取员工列表
getStaffList(){
queryStaffs().then( response => {
this.staffList = response.data
})
},
// 油品订单信息
getOilOrder(){
this.dialogVisibleamount = false
this.form.oilType = this.oilNameID;
this.form.type = this.type;
// 计算油的升数
if (this.select == "元"){
let num = this.form.amount/this.form.oilPrice
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).toFixed(2)
}
// 校验油罐内油是否足够
getOilTank(this.form.tankId).then(res => {
if (res.data.storedQuantity-this.form.liters<0){
this.$modal.msgError("所加油的升数大于油罐内的升数请重新选择加油升数")
return;
}else {
// 判断此油品是否被加购
if (this.isExistOilOrder){
for (let i = 0; i<this.oilOrder.length;i++){
if (this.oilOrder[i].id == this.form.id){
this.oilOrder.splice(i,1,this.form)
}
}
}else {
this.oilOrder.push(this.form)
}
this.oilAmount = 0
this.oilOrder.forEach(item => {
this.oilAmount += +item.amount
})
this.oilActualPay = (this.oilAmount - this.oilDiscount).toFixed(2);
this.oilTotal = this.oilOrder.length;
this.select = "元";
if (this.isMember){
this.getGrade(this.member.id,this.member.gradeId)
this.changeRefuelMoney();
if (this.oilOrder.length>0){
this.preferential();
this.getCoupon();
}
}
}
})
},
// 囤油卡变化后总金额的变化
changeRefuelMoney(){
let _this = this;
_this.consumeRefuelMoney = 0;
_this.oilActualPay = 0;
_this.hoardAmount = 0;
_this.oilAmount = 0;
_this.oilOrder.forEach(item => {
let conRefMon = 0;
let hoardAmount = 0;
let id = ""
if (_this.refuelMoney){
for (let i = 0;i < _this.refuelMoney.length;i++){
// 囤油卡升数变化
if (_this.refuelMoney[i].oilType==item.oilType && _this.refuelMoney[i].refuelMoney>0){
id = item.id
_this.isOilStorageCard = true
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
conRefMon = item.liters
}else {
conRefMon = _this.refuelMoney[i].refuelMoney
// 扣除升数后需要消费的金额
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
}
}else {
hoardAmount = item.amount
}
}
}
_this.consumeRefuelMoney += +conRefMon
_this.hoardAmount += +hoardAmount
_this.oilAmount += +item.amount
// _this.changeBalance(_this.hoardAmount,id)
// if (_this.consumeRefuelMoney!=0){
// _this.isOilStorageCard = true;
// _this.checkAll3 = true;
// _this.consumeAmount = 0;
// }
_this.isDefaultUseCard();
})
},
changeBalance(hoardAmount,id){
if (this.balance>0 && id != ""){
this.oilOrder.forEach(item => {
if (this.balance >= item.amount){
this.consumeAmount = item.amount
}else {
this.consumeAmount = this.balance
this.oilActualPay = item.amount - this.balance
}
})
}
},
// 选择“元”或“L”
changeSelect(){
if(this.select == "元"){
this.rise = [
{value:"¥100"},
{value:"¥150"},
{value:"¥200"},
{value:"¥300"},
];
}else {
this.rise = [
{value:"100L"},
{value:"150L"},
{value:"200L"},
{value:"300L"},
];
}
},
// 改变加油金额
changeAmount(amount){
if (this.select == "元"){
this.amount = amount.slice(1)
this.form.amount = this.amount
}else {
this.amount = amount.slice(0,3)
this.form.amount = this.amount
}
},
// 获取油号名称
getName(oilNameList,id){
let name = ""
let oilType = ""
let _this = this;
if(oilNameList!=null && oilNameList!=""){
oilNameList.forEach(item => {
if (item.id == id){
name = item.oilName;
oilType = item.oilType;
_this.oilType = item.oilName;
_this.oilNameID = item.id;
_this.type = item.oilType;
}
})
}
return oilType+" "+name;
},
// 获取油号信息
getOilName(){
getOilNameList().then( response => {
this.oilNameList = response.data;
})
},
// 根据手机号查询会员信息
getUser(){
if(this.select1=="会员手机号"){
getUserInfoMobile({mobile:this.userNo}).then( response => {
if (response.data!=null){
this.member = response.data
this.storeId = response.data.storeId
this.isSure = false
}else {
this.$modal.msgError("会员信息不存在")
}
})
}else {
this.dialogVisibleMember = true;
getUserVoName({name:this.userNo}).then( response => {
this.memberList = response.data.userVo
this.storeId = response.data.storeId
})
}
},
// 查询所有商品信息
getGoods(){
listgoods().then( response => {
this.goodsList = response.data
})
},
// 加油金额
refuel(data){
this.select = "元";
this.rise = [
{value:"¥100"},
{value:"¥150"},
{value:"¥200"},
{value:"¥300"},
];
this.amount = 0
this.dialogVisibleamount = true;
let result = false
// 判断是否存在此油品的数据
this.oilOrder.forEach(item => {
if (item.id==data.id){
this.amount = item.amount
result = true
this.isExistOilOrder = true;
}
})
if (result){
return;
}
getOilNumberById(data.numberId).then( response => {
this.form = response.data;
this.form.tankId = data.tankId
this.gunList.forEach(item => {
if (item.id==data.id){
this.form.id = item.id
this.form.gunName = item.id
}
})
})
},
// 确定收款
async collection(){
if (this.payType=="CASH"){
if (this.authCode==undefined || this.authCode=="" || this.seekZero<0){
this.$modal.msgError("请输入正确的金额");
return;
}
}
if (!this.authCode && ((+this.oilActualPay) + (+this.goodsActualPay))>0){
this.$modal.msgError("请先扫码");
return;
}
// JSON.parse()
this.map.seekZero = this.seekZero;
this.map.oilAmount = this.oilAmount;
this.map.goodsAmount = this.goodsAmount;
this.map.oilActualPay = this.oilActualPay;
this.map.goodsActualPay = this.goodsActualPay;
this.map.oilDiscount = this.oilDiscount;
this.map.goodsDiscount = this.goodsDiscount;
this.map.goodsNum = this.goodsTotal;
this.map.oilOrder = JSON.stringify(this.oilOrder);
this.map.goodsOrder = JSON.stringify(this.goodsOrder);
this.map.authCode = this.authCode;
this.map.allAmount = +this.oilActualPay + +this.goodsActualPay
this.map.consumeAmount = this.consumeAmount;
this.updateRefuelMoney();
this.map.refuelMoney = JSON.stringify(this.refuelMoney)
this.map.couponId = this.useCouponIds
let _this = this;
if (this.payType=="APPLET_CODE"){
if (this.goodsOrder.length>0){
this.$modal.msgError("非油商品不可使用小程序码支付")
return;
}
await scanAppletQrCode(_this.map).then( resp => {
if (resp.data.success=='success'){
this.loading = true;
setTimeout(function (){
_this.loading = false;
_this.isPay = true;
_this.isPaySuccess = true;
_this.resetting1();
},3000)
}else {
this.loading = true;
setTimeout(function (){
_this.loading = false;
_this.isPay = true;
_this.isPaySuccess = false;
_this.resetting1();
this.$modal.msgError(resp.data.error)
},3000)
}
})
return;
}
await addLJGoods(_this.map).then( response => {
_this.orderNo = response.data.orderNo;
if (response.data.oilOrder!=null){
if (response.data.oilOrder.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.isPay = true;
_this.seekZero = 0
_this.amount = 0
return;
}
}
if (response.data.goodsOrder!=null){
if (response.data.goodsOrder.status == "paid"){
_this.isPaySuccess = true;
_this.isPay = true;
_this.seekZero = 0
_this.amount = 0
return;
}
}
if (response.data.error==1){
this.$modal.msgError("商品库存不足,请重新选择商品")
this.loading = false;
this.dialogVisiblej = false;
return;
}
if (response.data.error=="请先配置支付通道"){
this.$modal.msgError(response.data.error)
this.loading = false;
// this.dialogVisiblej = false;
return;
}
})
this.loading = true;
_this.queryPayStatus();
_this.resetting1();
},
resetting1(){
let _this = this;
this.authCode = "";
if (_this.isPaySuccess == true){
// _this.isPay = false;
_this.oilAmount = 0;
_this.oilActualPay = 0;
_this.oilDiscount = 0;
_this.goodsAmount = 0;
_this.goodsActualPay = 0;
_this.goodsDiscount = 0;
_this.consumeAmount = 0;
_this.consumeRefuelMoney = 0;
_this.oilTotal = 0;
_this.goodsTotal = 0;
_this.isMember = false;
_this.oilOrder = []
_this.goodsOrder = []
_this.amount = 0
_this.seekZero = 0;
};
this.userNo = ""
this.map = {
allAmount:0,
// 用户支付条码信息
authCode:'',
// 油品订单
oilOrder:"",
// 商品订单
goodsOrder:"",
// 支付方式
payType:"WECHAT",
// 油品订单金额
oilAmount:0,
// 商品订单金额
goodsAmount:0,
// 油品实付金额
oilActualPay:0,
// 商品实付金额
goodsActualPay:0,
// 付款用户
payUser:"",
// 油品优惠金额
oilDiscount:0,
// 商品优惠金额
goodsDiscount:0,
// 优惠券id
couponId:"",
// 提成金额
commissionAmount:0,
// 使用积分数量
usePoint:0,
// 积分金额
pointAmount:0,
// 终端
terminal:"PC",
// 商品数量
goodsNum:0,
// 会员消费金额(储值卡需要减少的金额)
consumeAmount:0,
typeIdex:'',
};
this.payType = "WECHAT"
},
updateRefuelMoney(){
let _this = this;
_this.oilOrder.forEach(item => {
if (_this.refuelMoney!=null){
_this.refuelMoney.forEach(i => {
if (i.oilType==item.oilType){
if ((i.refuelMoney-item.liters)>=0){
let refuelMoney = i.refuelMoney;
i.refuelMoney = refuelMoney-item.liters
}else {
i.refuelMoney = 0
}
}
})
}
})
},
// 查询订单支付状态
queryPayStatus(){
let _this = this;
let timer = setInterval(function (){
// "234520231228115544f073f4"
cashierOrderByOrderNo({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
if (response.data.status == "unpaid"){
_this.isQuery = true;
_this.dialogVisiblejLoading = true
}
if (response.data.status == "paid"){
_this.isPay = true;
_this.isPaySuccess = true;
_this.isQuery = false;
_this.amount = 0
_this.loading = false;
clearInterval(timer);
}
if (response.data.status == "payFail"){
_this.isPaySuccess = false;
// _this.isPay = true;
_this.isQuery = false;
_this.loading = false;
clearInterval(timer);
}
}
_this.resetting1();
})
},500)
let timer2 = setInterval(function () {
if (_this.isQuery || !_this.dialogVisiblej) {
_this.loading = false;
// _this.isPay = true;
// _this.countdown()
clearInterval(timer);
clearTimeout(timer3);
}
}, 500)
var timer3 = setTimeout(function () {
clearInterval(timer2);
clearInterval(timer);
_this.loading = false;
_this.isPay = true;
this.isPaySuccess = false;
}, 10000)
},
// 倒计时刷新
countdown(){
let _this = this
let timer = setInterval(() => {
// countdown减1
_this.timestamp--;
// 如果倒计时为0清除定时器
if(_this.timestamp === 0) {
clearInterval(timer)
_this.timestamp = 15
}
}, 1000);
},
handClose(){
this.dialogVisiblejLoading = false
// this.resetting1()
this.authCode = "";
this.userNo = ""
this.map = {
allAmount:0,
// 用户支付条码信息
authCode:'',
// 油品订单
oilOrder:"",
// 商品订单
goodsOrder:"",
// 支付方式
payType:"WECHAT",
// 油品订单金额
oilAmount:0,
// 商品订单金额
goodsAmount:0,
// 油品实付金额
oilActualPay:0,
// 商品实付金额
goodsActualPay:0,
// 付款用户
payUser:"",
// 油品优惠金额
oilDiscount:0,
// 商品优惠金额
goodsDiscount:0,
// 优惠券id
couponId:"",
// 提成金额
commissionAmount:0,
// 使用积分数量
usePoint:0,
// 积分金额
pointAmount:0,
// 终端
terminal:"PC",
// 商品数量
goodsNum:0,
// 会员消费金额(储值卡需要减少的金额)
consumeAmount:0,
typeIdex:'',
};
this.member = {};
this.isPaySuccess = false;
this.isPay = false;
this.dialogVisiblej = false
},
// 支付方式
payMethod(payType){
this.typeIdex = payType
this.map.payType = payType;
this.payType = payType;
},
// 获取支付方式
getPayList(){
getDicts("payment_type").then( response => {
this.payList = response.data;
})
// 获取油号列表信息
listOilNumGun().then( response => {
this.oilNumList = response.data
})
// 获取油号油枪对应信息
getOilNumGun({oilNum : "全部"}).then( response => {
this.oilNumGunList = response.data
})
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done();
})
.catch(_ => {});
},
handleChange(value) {
let goods = this.goodsOrder;
let num = 0;
let amount = 0;
let _this = this;
goods.forEach(item => {
num += item.num
if (_this.isMember){
amount += +(item.memberPrice*item.num).toFixed(2);
}else {
amount += +(item.retailPrice*item.num).toFixed(2);
}
})
this.goodsTotal = num;
this.goodsAmount = amount;
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
},
handleClick(tab, event) {
let oilNum = ""
this.oilNumberList.forEach(item => {
if (item.oilName == tab.name){
oilNum = item.numberId
}
})
if (tab.label == "全部"){
oilNum = ""
}
this.getList(oilNum)
// getOilNumGun({oilNum : oilNum}).then( response => {
// this.oilNumGunList = response.data
// })
},
gocomponents(index){
this.leftindex = index
},
// 获取优惠券列表信息
getCouponList(){
listCardFavorableRecord().then(response => {
this.couponList = response.data.records
})
let map = {
page:1,
pageSize:20,
}
listUserGrade(map).then(response => {
this.gradeList = response.data.records
})
},
// 获取油枪列表信息
getList(numberId){
getOilGun({numberId:numberId}).then(response => {
this.gunList = response.data.records;
})
oilNumberList().then(response => {
this.oilNumberList = response.data.records;
})
},
},
}
</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;
border-radius: 50px;
font-size: 20px;
}
.amountBlue{
color: #00afff;
font-weight: bold;
}
.amount{
display: flex;
justify-content: space-between;
font-size: 16px;
width: 100%;
padding: 0 10px;
margin: 10px auto;
height: 50px;
line-height: 50px;
background-color: #f6f6f6;
border-radius: 5px;
}
.app-center{
width: 100%;
display: flex;
box-sizing: border-box;
padding: 10px;
}
.center-left{
width: 33%;
border-radius: 8px;
overflow: hidden;
height: 98vh;
position: relative;
}
.bottom-posi{
width: 100%;
position: absolute;
bottom: 0px;
}
.center-app{
width: 33%;
border-radius: 8px;
overflow: hidden;
/*background: white;*/
}
.center-right{
width: 33%;
border-radius: 8px;
overflow: hidden;
margin: 0px 10px;
}
.center-top{
width: 100%;
height: 86vh;
background: white;
margin-bottom: 10px;
box-sizing: border-box;
padding: 10px;
position: relative;
}
.center-top-title{
box-sizing: border-box;
padding: 10px 0px;
padding-bottom: 15px;
border-bottom: 1px solid #ececec;
font-size: 18px;
margin-bottom: 10px;
}
.center-top-tab{
box-sizing: border-box;
padding: 15px 0px;
}
.center-top-input{
width: 100%;
height: 60px;
background: #f8f8f8;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
input{
width: 90%;
font-size: 18px;
border: none;
outline: none;
background-color:transparent;
}
}
.center-top-data{
width: 100%;
border-radius: 8px;
overflow: hidden;
margin-top: 10px;
/*background-color: #f8f8f8;*/
}
.center-top-of{
width: 100%;
/*background-color: #99a9bf;*/
height: 70vh;
overflow: auto;
}
.wrap-wrap{
display: flex;
flex-wrap: wrap;
}
.of-box{
width: 31%;
margin-right: 10px;
margin-bottom: 10px;
border-radius: 8px;
box-sizing: border-box;
background-color: #b4d5ff;
height: 110px;
padding: 10px;
color: #3e4f60;
}
.of-title{
font-weight: bold;
font-size: 22px;
text-align: center;
margin: 13px;
}
.data-top{
width: 100%;
background-color: #ededed;
box-sizing: border-box;
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.data-top-box{
width: 100%;
/*background-color: #ededed;*/
box-sizing: border-box;
padding: 15px 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.data-top-three{
width: 55%;
display: flex;
align-items: center;
justify-content: space-between;
}
.data-top-title{
width: 45%;
overflow: hidden;
}
.content-top-bottom{
position: absolute;
bottom:-16px;
width: 98%;
border-top: 1px solid #ececec;
height: 40px;
display: flex;
align-items: center;
justify-content: space-between;
transform: translate(-50%,-50%);
left: 50%;
color: #2c3e50;
font-size: 18px;
box-sizing: border-box;
padding: 15px ;
background-color: white;
}
.center-left-top{
width: 100%;
background: #5393ff;
height: 70px;
display: flex;
align-items: center;
justify-content: center;
}
.center-vh{
/*height: 68vh;*/
}
.center-left-hj{
background: white;
display: flex;
justify-content: space-between;
align-items: center;
box-sizing: border-box;
padding: 15px;
margin-bottom: 2px;
}
.center-left-th{
background: white;
box-sizing: border-box;
padding: 15px;
margin: 10px auto;
}
.center-left-wrap{
display: flex;
justify-content: space-between;
flex-wrap: wrap;
/*margin-top: 280px;*/
}
.wrap-box{
width: 31%;
background: #ffffff;
border-radius: 8px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
margin-bottom: 10px;
cursor: pointer;
}
.wrap-box2{
background: #30a1ff !important;
color: white;
//width: 100%;
//height: 100%;
//border-radius: 8px;
//height: 80px;
//display: flex;
//align-items: center;
//justify-content: center;
//border: 1px solid #20b400;
//cursor: pointer;
//color: #20b400;
}
.wrap-box :hover{
/*background: #00afff !important;*/
width: 100%;
height: 100%;
border-radius: 8px;
height: 80px;
display: flex;
align-items: center;
justify-content: center;
border: 1px solid #00afff;
cursor: pointer;
/*color: white;*/
}
.center-left-bottom{
width: 100%;
background-color: white;
border-radius: 8px;
box-sizing: border-box;
padding: 10px;
display: flex;
align-items: center;
justify-content: space-between;
}
.bottom-qk{
border: 1px solid #99a9bf;
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
color: #99a9bf;
margin: 15px 0px ;
}
.bottom-qd{
border: 1px solid #13ce66;
background: #13ce66;
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
color: #ffffff;
margin: 15px 10px ;
}
.bottom-gd{
border: 1px solid #5393ff;
background: #5393ff;
box-sizing: border-box;
padding: 14px 20px;
border-radius: 50px;
color: #ffffff;
margin: 15px 10px ;
}
.bottom-price{
font-size: 26px;
font-weight: bold;
}
.price-red{
color: red;
}
.center-left-lv{
width: 60%;
height: 80px;
background-color: #13ce66;
color: white;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
font-size: 22px;
}
.th-box{
width: 100%;
display: flex;
justify-content: space-between;
align-items: center;
border-bottom: 1px solid #f6f8f9;
box-sizing: border-box;
padding: 10px 0px;
}
.hj-box{
width: 33%;
display: flex;
align-items: center;
justify-content: center;
}
.bule{
font-weight: 700;
color: #5393ff !important;
}
.vip-bottom{
border: 1px solid #ffffff;
box-sizing: border-box;
padding: 5px 15px;
border-radius: 50px;
display: flex;
align-items: center;
justify-content: center;
color: white;
cursor: pointer;
}
.el-row {
margin-top: 20px;
margin-bottom: 20px;
&:last-child {
margin-bottom: 0;
}
}
.el-col {
border-radius: 2px;
text-align: center;
font-size: 20px;
height: 50px;
line-height: 50px;
}
.bg-purple-dark {
background: #eeeeee;
}
.bg-purple {
background: #d3dce6;
}
.bg-purple-light {
background: #e5e9f2;
}
.grid-content {
height: 50px;
font-size: 20px;
width: 120px;
border-radius: 4px;
min-height: 36px;
}
.row-bg {
padding: 10px 0;
background-color: #eeeeee;
}
.elBut{
width: 85px;
height: 50px;
font-size: 18px;
}
.addr{
color: grey;
font-size: 12px;
}
</style>