This commit is contained in:
wangh 2023-11-17 16:37:39 +08:00
commit db19da43e8
32 changed files with 950 additions and 406 deletions

View File

@ -1,5 +1,23 @@
import request from '@/utils/request' import request from '@/utils/request'
// 油品大类
export function getoiltype() {
return request({
url: 'system/dict/data/type/oil_type',
method: 'get',
})
}
export function getoilName(query) {
return request({
url: 'business/petrolStationManagement/oilNumber/getOilName',
method: 'get',
params: query
})
}
// 查询消费有礼活动列表 // 查询消费有礼活动列表
export function listActiveConsumption(query) { export function listActiveConsumption(query) {
return request({ return request({

View File

@ -1,5 +1,6 @@
import request from '@/utils/request' import request from '@/utils/request'
// 查询折扣营销列表 // 查询折扣营销列表
export function listActiveDiscount(query) { export function listActiveDiscount(query) {
return request({ return request({
@ -8,6 +9,14 @@ export function listActiveDiscount(query) {
params: query params: query
}) })
} }
export function getoilName(query) {
return request({
url: 'business/petrolStationManagement/oilNumber/getOilName',
method: 'get',
params: query
})
}
// 查询折扣营销详细 // 查询折扣营销详细
export function getActiveDiscount(id) { export function getActiveDiscount(id) {

View File

@ -8,6 +8,13 @@ export function listActiveFullminus(query) {
params: query params: query
}) })
} }
export function getoilName(query) {
return request({
url: 'business/petrolStationManagement/oilNumber/getOilName',
method: 'get',
params: query
})
}
// 查询满减营销详细 // 查询满减营销详细
export function getActiveFullminus(id) { export function getActiveFullminus(id) {

View File

@ -8,6 +8,13 @@ export function listActiveNewlyweds(query) {
params: query params: query
}) })
} }
export function getoilName(query) {
return request({
url: 'business/petrolStationManagement/oilNumber/getOilName',
method: 'get',
params: query
})
}
// 查询新人有礼活动详细 // 查询新人有礼活动详细
export function getActiveNewlyweds(id) { export function getActiveNewlyweds(id) {

View File

@ -31,6 +31,13 @@ export function getActiveRecommend(id) {
method: 'get' method: 'get'
}) })
} }
export function getoilName(query) {
return request({
url: 'business/petrolStationManagement/oilNumber/getOilName',
method: 'get',
params: query
})
}
// 新增推荐有礼 // 新增推荐有礼
export function addActiveRecommend(data) { export function addActiveRecommend(data) {

View File

@ -1,6 +1,7 @@
<template> <template>
<div title="帮助文档" class="nav-icon"> <div title="帮助文档" class="nav-icon">
<svg-icon icon-class="question" @click="goto" /> <!-- <svg-icon icon-class="question" @click="goto" />-->
<i class="el-icon-s-platform" @click="goto" style="font-size: 24px"></i>
</div> </div>
</template> </template>
@ -9,7 +10,9 @@ export default {
name: 'FuintDoc', name: 'FuintDoc',
data() { data() {
return { return {
url: 'https://www.fuint.cn/docs/index/' // url: 'https://www.fuint.cn/docs/index/'
url: 'http://192.168.0.181:82/#/homeindex?id=0'
} }
}, },
methods: { methods: {

View File

@ -12,7 +12,7 @@
}, },
methods:{ methods:{
goToWebsite() { goToWebsite() {
window.open('http://admin.sgkjsc.cn/#/') window.open('https://www.wanjunshijie.com/demo/shujudaping/zhihuizhaoming/vue3/#/home')
this.toggleFullscreen() this.toggleFullscreen()
}, },
toggleFullscreen() { toggleFullscreen() {

View File

@ -44,7 +44,7 @@
<el-table v-loading="loading" :data="activeConsumptionList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeConsumptionList" @selection-change="handleSelectionChange">
<el-table-column label="活动id" align="center" prop="id" /> <el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="满足金额" align="center" prop="participationConditionMoney" > <el-table-column label="满足金额" align="center" prop="participationConditionMoney" >
@ -59,22 +59,11 @@
<span v-if="scope.row.adaptUserType == 2">等级会员</span> <span v-if="scope.row.adaptUserType == 2">等级会员</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" > <el-table-column label="会员等级" align="center" prop="dieselUserLevel" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span> <span v-for="(item,index) in scope.row.dieselUserLevel "> {{item}} </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="汽油会员等级" align="center" prop="gasolineUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.gasolineUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.naturalUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="活动状态" align="center" prop="status" > <el-table-column label="活动状态" align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
@ -125,8 +114,9 @@
<el-form-item label="可用油品" prop="adaptOil" > <el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil"> <el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="city in oillist" :label="city" :key="city">{{city}}</el-checkbox> <el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="适用用户" prop="adaptUserType"> <el-form-item label="适用用户" prop="adaptUserType">
<el-radio-group v-model="form.adaptUserType"> <el-radio-group v-model="form.adaptUserType">
@ -331,45 +321,12 @@
placeholder="请选择活动结束时间"> placeholder="请选择活动结束时间">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item v-if="form.adaptUserType == 2" label="柴油会员等级" prop="dieselUserLevel"> <el-form-item label="请选择会员等级" prop="dieselUserLevel" v-if="form.adaptUserType == 2" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择柴油会员等级"> <el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-option label="V1会员" value="1"></el-option> <el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.adaptUserType == 2" label="汽油会员等级" prop="gasolineUserLevel">
<el-select v-model="form.gasolineUserLevel" multiple clearable placeholder="请选择汽油会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item v-if="form.adaptUserType == 2" label="天然气会员等级" prop="naturalUserLevel">
<el-select v-model="form.naturalUserLevel" multiple clearable placeholder="请选择天然气会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与条件" prop="participationCondition"> <el-form-item label="参与条件" prop="participationCondition">
<el-select v-model="form.participationCondition" clearable placeholder="请选择天参与条件"> <el-select v-model="form.participationCondition" clearable placeholder="请选择天参与条件">
<el-option label="不限制" value="0"></el-option> <el-option label="不限制" value="0"></el-option>
@ -388,12 +345,6 @@
<el-form-item label="赠送积分" prop="points"> <el-form-item label="赠送积分" prop="points">
<el-input-number v-model="form.points" controls-position="right" :min="1" :max="999999"></el-input-number> <el-input-number v-model="form.points" controls-position="right" :min="1" :max="999999"></el-input-number>
</el-form-item> </el-form-item>
<!-- <el-form-item label="是否上线" prop="isonline">-->
<!-- <el-select v-model="form.isonline" clearable placeholder="请选择参与次数类别">-->
<!-- <el-option label="上线" value="0"></el-option>-->
<!-- <el-option label="下线" value="1"></el-option>-->
<!-- </el-select>-->
<!-- </el-form-item>-->
</el-form> </el-form>
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitForm"> </el-button> <el-button type="primary" @click="submitForm"> </el-button>
@ -553,12 +504,14 @@
</template> </template>
<script> <script>
import { listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable } from "@/api/EventMarketing/activeConsumption"; import { getoiltype,getoilName, listActiveConsumption,listExchange,listLJGoods, getActiveConsumption, delActiveConsumption, addActiveConsumption, updateActiveConsumption,listFavorable } from "@/api/EventMarketing/activeConsumption";
import {listUserGrade} from "@/api/staff/user/usergrade";
export default { export default {
name: "ActiveConsumption", name: "ActiveConsumption",
data() { data() {
return { return {
userGradeList:[],
pdidlist:[],//id pdidlist:[],//id
pddhidlist:[],//id pddhidlist:[],//id
pdswidlist:[],//id pdswidlist:[],//id
@ -708,6 +661,9 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
// this.getoiltypeliet()
this.getoilName()
this.listUserGrade()
}, },
methods: { methods: {
/** 查询消费有礼活动列表 */ /** 查询消费有礼活动列表 */
@ -719,8 +675,30 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
swchange(e){ listUserGrade(){
listUserGrade().then(res=>{
if(res.code == 200){
this.userGradeList = res.data.records
}
})
},
//
getoiltypeliet(){
getoiltype().then(res=>{
console.log(res)
})
},
//
getoilName(){
getoilName().then(res=>{
console.log(res)
this.oillist = res.data
})
},
swchange(e){
console.log(this.shopdata) console.log(this.shopdata)
}, },
// //

View File

@ -44,23 +44,15 @@
<el-table v-loading="loading" :data="activeDiscountList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeDiscountList" @selection-change="handleSelectionChange">
<el-table-column label="活动id" align="center" prop="id" /> <el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" > <el-table-column label="会员等级" align="center" prop="dieselUserLevel" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span> <span v-for="(item,index) in scope.row.dieselUserLevel "> {{item}} </span>
</template>
</el-table-column>
<el-table-column label="汽油会员等级" align="center" prop="gasolineUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.gasolineUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.naturalUserLevel "> V{{item}}会员 </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="活动状态 " align="center" prop="status" > <el-table-column label="活动状态 " align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span style="cursor: pointer;" @click="qiyong(scope.row)" v-if="scope.row.status == 0"> <el-tag>启用</el-tag > </span> <span style="cursor: pointer;" @click="qiyong(scope.row)" v-if="scope.row.status == 0"> <el-tag>启用</el-tag > </span>
@ -75,7 +67,6 @@
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate(scope.row)"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
@ -140,48 +131,17 @@
</el-form-item> </el-form-item>
<el-form-item label="可用油品" prop="adaptOil" > <el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil"> <el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="city in oillist" :label="city" :key="city">{{city}}</el-checkbox> <el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="柴油会员等级" prop="dieselUserLevel">
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择柴油会员等级"> <el-form-item label="请选择会员等级" prop="dieselUserLevel" >
<el-option label="V1会员" value="1"></el-option> <el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-option label="V2会员" value="2"></el-option> <el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="汽油会员等级" prop="gasolineUserLevel">
<el-select v-model="form.gasolineUserLevel" multiple clearable placeholder="请选择汽油会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="天然气会员等级" prop="naturalUserLevel">
<el-select v-model="form.naturalUserLevel" multiple clearable placeholder="请选择天然气会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与条件" prop="participationCondition"> <el-form-item label="参与条件" prop="participationCondition">
<el-select v-model="form.participationCondition" clearable placeholder="请选择天参与条件"> <el-select v-model="form.participationCondition" clearable placeholder="请选择天参与条件">
<el-option label="不限制" value="0"></el-option> <el-option label="不限制" value="0"></el-option>
@ -215,7 +175,8 @@
<script> <script>
import { listActiveDiscount, getActiveDiscount, delActiveDiscount, addActiveDiscount, updateActiveDiscount } from "@/api/EventMarketing/activeDiscount"; import { listActiveDiscount, getActiveDiscount, delActiveDiscount, addActiveDiscount, updateActiveDiscount } from "@/api/EventMarketing/activeDiscount";
import {getActiveConsumption, updateActiveConsumption} from "@/api/EventMarketing/activeConsumption"; import {getActiveConsumption, getoilName, updateActiveConsumption} from "@/api/EventMarketing/activeConsumption";
import {listUserGrade} from "@/api/staff/user/usergrade";
export default { export default {
name: "ActiveDiscount", name: "ActiveDiscount",
@ -223,6 +184,7 @@ export default {
return { return {
discount:'', discount:'',
amount:'', amount:'',
userGradeList:[],
oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'], oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'],
// //
loading: true, loading: true,
@ -303,6 +265,8 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getoilName();
this.listUserGrade()
}, },
methods: { methods: {
/** 查询折扣营销列表 */ /** 查询折扣营销列表 */
@ -315,6 +279,22 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getoilName(){
getoilName().then(res=>{
console.log(res)
this.oillist = res.data
})
},
listUserGrade(){
listUserGrade().then(res=>{
if(res.code == 200){
this.userGradeList = res.data.records
}
})
},
// //
addactiveDiscountChildList(){ addactiveDiscountChildList(){
let data = { let data = {

View File

@ -44,23 +44,15 @@
<el-table v-loading="loading" :data="activeFullminusList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeFullminusList" @selection-change="handleSelectionChange">
<el-table-column label="活动id" align="center" prop="id" /> <el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="柴油会员等级" align="center" prop="dieselUserLevel" > <el-table-column label="会员等级" align="center" prop="dieselUserLevel" >
<template slot-scope="scope"> <template slot-scope="scope">
<span v-for="(item,index) in scope.row.dieselUserLevel "> V{{item}}会员 </span> <span v-for="(item,index) in scope.row.dieselUserLevel "> {{item}} </span>
</template>
</el-table-column>
<el-table-column label="汽油会员等级" align="center" prop="gasolineUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.gasolineUserLevel "> V{{item}}会员 </span>
</template>
</el-table-column>
<el-table-column label="天然气会员等级 " align="center" prop="naturalUserLevel" >
<template slot-scope="scope">
<span v-for="(item,index) in scope.row.naturalUserLevel "> V{{item}}会员 </span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="活动状态 " align="center" prop="status" > <el-table-column label="活动状态 " align="center" prop="status" >
<template slot-scope="scope"> <template slot-scope="scope">
<span style="cursor: pointer;" @click="qiyong(scope.row)" v-if="scope.row.status == 0"> <el-tag>启用</el-tag > </span> <span style="cursor: pointer;" @click="qiyong(scope.row)" v-if="scope.row.status == 0"> <el-tag>启用</el-tag > </span>
@ -146,46 +138,12 @@
</el-form-item> </el-form-item>
<el-form-item label="可用油品" prop="adaptOil" > <el-form-item label="可用油品" prop="adaptOil" >
<el-checkbox-group v-model="form.adaptOil"> <el-checkbox-group v-model="form.adaptOil">
<el-checkbox v-for="city in oillist" :label="city" :key="city">{{city}}</el-checkbox> <el-checkbox v-for="(item,index) in oillist" :label="item.id" :key="index">{{item.oilType}}{{item.oilName}}</el-checkbox>
</el-checkbox-group> </el-checkbox-group>
</el-form-item> </el-form-item>
<el-form-item label="柴油会员等级" prop="dieselUserLevel"> <el-form-item label="请选择会员等级" prop="dieselUserLevel" >
<el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择柴油会员等级"> <el-select v-model="form.dieselUserLevel" multiple clearable placeholder="请选择会员等级">
<el-option label="V1会员" value="1"></el-option> <el-option :label="item.name" :value="item.id.toString()" v-for="(item,index) in userGradeList" :key="index" > </el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="汽油会员等级" prop="gasolineUserLevel">
<el-select v-model="form.gasolineUserLevel" multiple clearable placeholder="请选择汽油会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select>
</el-form-item>
<el-form-item label="天然气会员等级" prop="naturalUserLevel">
<el-select v-model="form.naturalUserLevel" multiple clearable placeholder="请选择天然气会员等级">
<el-option label="V1会员" value="1"></el-option>
<el-option label="V2会员" value="2"></el-option>
<el-option label="V3会员" value="3"></el-option>
<el-option label="V4会员" value="4"></el-option>
<el-option label="V5会员" value="5"></el-option>
<el-option label="V6会员" value="6"></el-option>
<el-option label="V7会员" value="7"></el-option>
<el-option label="V8会员" value="8"></el-option>
<el-option label="V9会员" value="9"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="参与条件" prop="participationCondition"> <el-form-item label="参与条件" prop="participationCondition">
@ -222,12 +180,15 @@
<script> <script>
import { listActiveFullminus, getActiveFullminus, delActiveFullminus, addActiveFullminus, updateActiveFullminus } from "@/api/EventMarketing/activeFullminus"; import { listActiveFullminus, getActiveFullminus, delActiveFullminus, addActiveFullminus, updateActiveFullminus } from "@/api/EventMarketing/activeFullminus";
import {getActiveDiscount, updateActiveDiscount} from "@/api/EventMarketing/activeDiscount"; import {getActiveDiscount, updateActiveDiscount} from "@/api/EventMarketing/activeDiscount";
import {getoilName} from "@/api/EventMarketing/activeConsumption";
import {listUserGrade} from "@/api/staff/user/usergrade";
export default { export default {
name: "ActiveFullminus", name: "ActiveFullminus",
data() { data() {
return { return {
oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'], oillist:['92#','95#','98#','0#','-10#','LNG','CNG','京92#','京95#','京0#'],
userGradeList: [],
// //
loading: true, loading: true,
// //
@ -307,6 +268,8 @@ export default {
}, },
created() { created() {
this.getList(); this.getList();
this.getoilName()
this.listUserGrade()
}, },
methods: { methods: {
/** 查询满减营销列表 */ /** 查询满减营销列表 */
@ -318,6 +281,21 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getoilName(){
getoilName().then(res=>{
console.log(res)
this.oillist = res.data
})
},
listUserGrade(){
listUserGrade().then(res=>{
if(res.code == 200){
this.userGradeList = res.data.records
}
})
},
// //
addactiveDiscountChildList(){ addactiveDiscountChildList(){
let data = { let data = {

View File

@ -45,7 +45,7 @@
<el-table v-loading="loading" :data="activeNewlywedsList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="activeNewlywedsList" @selection-change="handleSelectionChange">
<el-table-column label="活动id" align="center" prop="id" /> <el-table-column label="活动编号" align="center" prop="id" />
<el-table-column label="活动名称" align="center" prop="name" /> <el-table-column label="活动名称" align="center" prop="name" />
<el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180"> <el-table-column label="活动开始时间" align="center" prop="activeStartTime" width="180">
<template slot-scope="scope"> <template slot-scope="scope">
@ -432,7 +432,7 @@
<script> <script>
import { listActiveNewlyweds, getActiveNewlyweds, delActiveNewlyweds, addActiveNewlyweds, updateActiveNewlyweds } from "@/api/EventMarketing/activeNewlyweds"; import { listActiveNewlyweds, getActiveNewlyweds, delActiveNewlyweds, addActiveNewlyweds, updateActiveNewlyweds } from "@/api/EventMarketing/activeNewlyweds";
import {listExchange, listFavorable} from "@/api/EventMarketing/activeConsumption"; import {getoilName, listExchange, listFavorable} from "@/api/EventMarketing/activeConsumption";
import QRCode from "qrcodejs2"; import QRCode from "qrcodejs2";
import {getActiveFullminus, updateActiveFullminus} from "@/api/EventMarketing/activeFullminus"; import {getActiveFullminus, updateActiveFullminus} from "@/api/EventMarketing/activeFullminus";
@ -543,6 +543,14 @@ export default {
this.loading = false; this.loading = false;
}); });
}, },
getoilName(){
getoilName().then(res=>{
console.log(res)
this.oillist = res.data
})
},
qrcodelook(url) { qrcodelook(url) {
this.loadingdialog = true this.loadingdialog = true
this.centerDialogVisible = true this.centerDialogVisible = true

View File

@ -42,7 +42,7 @@
style="width: 100%"> style="width: 100%">
<el-table-column <el-table-column
prop="id" prop="id"
label="活动ID" label="活动编号"
width="110"> width="110">
</el-table-column> </el-table-column>
<el-table-column <el-table-column
@ -167,11 +167,14 @@
<el-select v-model="ruleForm.oilType" placeholder="请选择" > <el-select v-model="ruleForm.oilType" placeholder="请选择" >
<el-option <el-option
v-for="dict in oilList" v-for="dict in oilList"
:key="dict.oilName"
:key="dict.id.toString()"
:label="dict.oilName" :label="dict.oilName"
:value="dict.oilName">
:value="dict.id.toString()">
</el-option> </el-option>
</el-select> </el-select>
<!-- <el-radio-group v-model="ruleForm.oilType" >--> <!-- <el-radio-group v-model="ruleForm.oilType" >-->
<!-- <el-radio--> <!-- <el-radio-->
<!-- v-for="dict in oilList"--> <!-- v-for="dict in oilList"-->
@ -325,12 +328,22 @@
watch:{ watch:{
'ruleForm.rechargeBalance':{ 'ruleForm.rechargeBalance':{
handler: function() { handler: function() {
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
}else {
this.ruleForm.incomeLitres = 0
}
}, },
}, },
'ruleForm.lockupPrice':{ 'ruleForm.lockupPrice':{
handler: function() { handler: function() {
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
if(this.ruleForm.rechargeBalance != 0 && this.ruleForm.lockupPrice != 0 ){
this.ruleForm.incomeLitres = this.ruleForm.rechargeBalance / this.ruleForm.lockupPrice
}else {
this.ruleForm.incomeLitres = 0
}
}, },
} }
}, },
@ -346,6 +359,7 @@
}, },
methods:{ methods:{
//
radiovalue(){ radiovalue(){
this.oilList = [] this.oilList = []
@ -371,6 +385,7 @@
lockupPrice: 0 , lockupPrice: 0 ,
rechargeBalance:0, rechargeBalance:0,
incomeLitres:0, incomeLitres:0,
points:'', points:'',
activeTime:'1', activeTime:'1',
activeStatus:'1', activeStatus:'1',

View File

@ -13,14 +13,17 @@ import com.fuint.business.marketingActivity.activeConsumption.service.ActiveCons
import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService; import com.fuint.business.marketingActivity.activeConsumption.service.ActiveConsumptionService;
import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO; import com.fuint.business.marketingActivity.activeConsumption.vo.ActiveConsumptionVO;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -37,6 +40,8 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
private StoreService storeService; private StoreService storeService;
@Resource @Resource
private ActiveConsumptionChildService activeConsumptionChildService; private ActiveConsumptionChildService activeConsumptionChildService;
@Autowired
private LJUserGradeService userGradeService;
/** /**
* 新增数据 * 新增数据
* @param activeConsumptionDTO * @param activeConsumptionDTO
@ -111,11 +116,16 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers); List<ActiveConsumptionChild> activeConsumptionChildList = activeConsumptionChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeConsumptionVO); BeanUtils.copyProperties(s,activeConsumptionVO);
activeConsumptionVO.setAdaptOil(s.getAdaptOil().split(",")); activeConsumptionVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeConsumptionVO.setActiveGift(s.getActiveGift().split(",")); activeConsumptionVO.setActiveGift(s.getActiveGift().split(","));
activeConsumptionVO.setDieselUserLevel(s.getDieselUserLevel().split(",")); //获取会员等级
activeConsumptionVO.setGasolineUserLevel(s.getGasolineUserLevel().split(",")); String str = "";
activeConsumptionVO.setNaturalUserLevel(s.getNaturalUserLevel().split(",")); for (String gradeId : s.getDieselUserLevel().split(",")) {
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
}
activeConsumptionVO.setDieselUserLevel(str.split(","));
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList); activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
return activeConsumptionVO; return activeConsumptionVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -146,7 +156,9 @@ public class ActiveConsumptionServiceImpl extends ServiceImpl<ActiveConsumptionM
activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(",")); activeConsumptionVO.setDieselUserLevel(consumption.getDieselUserLevel().split(","));
activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(",")); activeConsumptionVO.setGasolineUserLevel(consumption.getGasolineUserLevel().split(","));
activeConsumptionVO.setNaturalUserLevel(consumption.getNaturalUserLevel().split(",")); activeConsumptionVO.setNaturalUserLevel(consumption.getNaturalUserLevel().split(","));
activeConsumptionVO.setAdaptOil(consumption.getAdaptOil().split(",")); activeConsumptionVO.setAdaptOil(Arrays.stream(consumption.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeConsumptionVO.setActiveGift(consumption.getActiveGift().split(",")); activeConsumptionVO.setActiveGift(consumption.getActiveGift().split(","));
activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList); activeConsumptionVO.setActiveConsumptionChildList(activeConsumptionChildList);
} }

View File

@ -33,7 +33,8 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime; private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0# //适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil; private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员 //适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType; private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员 //会员类型 0汽油会员 1柴油会员 2天然气会员
@ -155,11 +156,19 @@ public class ActiveConsumptionVO extends Model<ActiveConsumptionVO> {
this.activeEndTime = activeEndTime; this.activeEndTime = activeEndTime;
} }
public String[] getAdaptOil() { public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil; return adaptOil;
} }
public void setAdaptOil(String[] adaptOil) { public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil; this.adaptOil = adaptOil;
} }

View File

@ -16,14 +16,17 @@ import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscoun
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService; import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService;
import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO; import com.fuint.business.marketingActivity.activeDiscount.vo.ActiveDiscountVO;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -40,6 +43,8 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
private StoreService storeService; private StoreService storeService;
@Resource @Resource
private ActiveDiscountChildService activeDiscountChildService; private ActiveDiscountChildService activeDiscountChildService;
@Autowired
private LJUserGradeService userGradeService;
/** /**
* 新增数据 * 新增数据
* @param activeDiscountDTO * @param activeDiscountDTO
@ -112,10 +117,15 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers); List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeDiscountVO); BeanUtils.copyProperties(s,activeDiscountVO);
activeDiscountVO.setAdaptOil(s.getAdaptOil().split(",")); activeDiscountVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
activeDiscountVO.setDieselUserLevel(s.getDieselUserLevel().split(",")); .map(Integer::valueOf)
activeDiscountVO.setGasolineUserLevel(s.getGasolineUserLevel().split(",")); .toArray(Integer[]::new));
activeDiscountVO.setNaturalUserLevel(s.getNaturalUserLevel().split(",")); //获取会员等级
String str = "";
for (String gradeId : s.getDieselUserLevel().split(",")) {
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
}
activeDiscountVO.setDieselUserLevel(str.split(","));
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList); activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
return activeDiscountVO; return activeDiscountVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -145,7 +155,9 @@ public class ActiveDiscountServiceImpl extends ServiceImpl<ActiveDiscountMapper,
activeDiscountVO.setDieselUserLevel(activeDiscount.getDieselUserLevel().split(",")); activeDiscountVO.setDieselUserLevel(activeDiscount.getDieselUserLevel().split(","));
activeDiscountVO.setGasolineUserLevel(activeDiscount.getGasolineUserLevel().split(",")); activeDiscountVO.setGasolineUserLevel(activeDiscount.getGasolineUserLevel().split(","));
activeDiscountVO.setNaturalUserLevel(activeDiscount.getNaturalUserLevel().split(",")); activeDiscountVO.setNaturalUserLevel(activeDiscount.getNaturalUserLevel().split(","));
activeDiscountVO.setAdaptOil(activeDiscount.getAdaptOil().split(",")); activeDiscountVO.setAdaptOil(Arrays.stream(activeDiscount.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList); activeDiscountVO.setActiveDiscountChildList(activeDiscountChildList);
} }
} }

View File

@ -26,7 +26,8 @@ public class ActiveDiscountVO implements Serializable{
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime; private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0# //适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil; private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员 //适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType; private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员 //会员类型 0汽油会员 1柴油会员 2天然气会员
@ -110,11 +111,19 @@ public class ActiveDiscountVO implements Serializable{
this.activeEndTime = activeEndTime; this.activeEndTime = activeEndTime;
} }
public String[] getAdaptOil() { public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil; return adaptOil;
} }
public void setAdaptOil(String[] adaptOil) { public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil; this.adaptOil = adaptOil;
} }

View File

@ -1,10 +1,9 @@
package com.fuint.business.marketingActivity.activeExchange.controller; package com.fuint.business.marketingActivity.activeExchange.controller;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO; import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO;
import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService; import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService;
import com.fuint.business.marketingActivity.activeExchange.dto.TransferDTO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.framework.web.BaseController; import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
@ -28,7 +27,7 @@ public class ActiveExchangeController extends BaseController {
private ActiveExchangeService activeExchangeService; private ActiveExchangeService activeExchangeService;
/** /**
* 分页查询所有数据 * 分页查询所有优惠券兑换券数据
* @param pageNo * @param pageNo
* @param pageSize * @param pageSize
* @param cardExchangeRecord * @param cardExchangeRecord
@ -53,5 +52,18 @@ public class ActiveExchangeController extends BaseController {
return getSuccessResult(this.activeExchangeService.updateOneById(activeExchangeRecordDTO)); return getSuccessResult(this.activeExchangeService.updateOneById(activeExchangeRecordDTO));
} }
/**
* 查询满减活动
* @param pageNo
* @param pageSize
* @param transferDTO
* @return
*/
@GetMapping("selectConsumptionList")
public ResponseObject selectConsumptionList(@RequestParam(value = "pageNo",defaultValue = "1") Integer pageNo,
@RequestParam(value = "pageSize",defaultValue = "10") Integer pageSize,
@Param("transferDTO") TransferDTO transferDTO) {
return getSuccessResult(this.activeExchangeService.selectConsumptionList(pageNo,pageSize, transferDTO));
}
} }

View File

@ -0,0 +1,66 @@
package com.fuint.business.marketingActivity.activeExchange.dto;
import java.io.Serializable;
public class TransferDTO implements Serializable {
//所属店铺id
private Integer storeId;
//用户id
private Integer userId;
//会员等级id
private Integer gradeId;
//油号id
private Integer oilName;
//油品价格
private Double oilPrice;
//油品升数
private Double oilLiters;
public Integer getStoreId() {
return storeId;
}
public void setStoreId(Integer storeId) {
this.storeId = storeId;
}
public Integer getUserId() {
return userId;
}
public void setUserId(Integer userId) {
this.userId = userId;
}
public Integer getGradeId() {
return gradeId;
}
public void setGradeId(Integer gradeId) {
this.gradeId = gradeId;
}
public Integer getOilName() {
return oilName;
}
public void setOilName(Integer oilName) {
this.oilName = oilName;
}
public Double getOilPrice() {
return oilPrice;
}
public void setOilPrice(Double oilPrice) {
this.oilPrice = oilPrice;
}
public Double getOilLiters() {
return oilLiters;
}
public void setOilLiters(Double oilLiters) {
this.oilLiters = oilLiters;
}
}

View File

@ -1,9 +1,9 @@
package com.fuint.business.marketingActivity.activeExchange.service; package com.fuint.business.marketingActivity.activeExchange.service;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO; import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO;
import com.fuint.business.marketingActivity.activeExchange.vo.ActiveExchangeRecordVO; import com.fuint.business.marketingActivity.activeExchange.vo.ActiveExchangeRecordVO;
import com.fuint.business.marketingActivity.activeExchange.dto.TransferDTO;
import com.fuint.business.marketingActivity.activeExchange.vo.MaxoutVO;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import java.util.List; import java.util.List;
@ -23,4 +23,13 @@ public interface ActiveExchangeService {
* @return * @return
*/ */
boolean updateOneById(ActiveExchangeRecordDTO activeExchangeRecordDTO); boolean updateOneById(ActiveExchangeRecordDTO activeExchangeRecordDTO);
/**
* 查询满减活动
* @param pageNo
* @param pageSize
* @param transferVO
* @return
*/
List<MaxoutVO> selectConsumptionList(Integer pageNo, Integer pageSize, TransferDTO transferDTO);
} }

View File

@ -3,15 +3,23 @@ package com.fuint.business.marketingActivity.activeExchange.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountChildService;
import com.fuint.business.marketingActivity.activeDiscount.service.ActiveDiscountService;
import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO; import com.fuint.business.marketingActivity.activeExchange.dto.ActiveExchangeRecordDTO;
import com.fuint.business.marketingActivity.activeExchange.dto.TransferDTO;
import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService; import com.fuint.business.marketingActivity.activeExchange.service.ActiveExchangeService;
import com.fuint.business.marketingActivity.activeExchange.vo.ActiveExchangeRecordVO; import com.fuint.business.marketingActivity.activeExchange.vo.ActiveExchangeRecordVO;
import com.fuint.business.marketingActivity.activeExchange.vo.MaxoutVO;
import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullminus;
import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService;
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord; import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService; import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord; import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService; import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
import com.fuint.business.userManager.service.LJUserGradeService;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -29,9 +37,17 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
private CardExchangeRecordService cardExchangeRecordService; private CardExchangeRecordService cardExchangeRecordService;
@Resource @Resource
private CardFavorableRecordService cardFavorableRecordService; private CardFavorableRecordService cardFavorableRecordService;
@Resource
private ActiveDiscountService activeDiscountService;
@Resource
private ActiveDiscountChildService activeDiscountChildService;
@Resource
private ActiveFullminusService activeFullminusService;
@Autowired
private LJUserGradeService userGradeService;
/** /**
* 分页查询所有 * 分页查询所有
* @param page * @param
* @param cardExchangeRecord * @param cardExchangeRecord
* @return * @return
*/ */
@ -119,4 +135,20 @@ public class ActiveExchangeServiceImpl implements ActiveExchangeService {
} }
return update; return update;
} }
@Override
public List<MaxoutVO> selectConsumptionList(Integer pageNo, Integer pageSize, TransferDTO transferDTO) {
//构造满减券查询条件
LambdaQueryWrapper<ActiveFullminus> fullminusLambdaQueryWrapper = new LambdaQueryWrapper<>();
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getStoreId,transferDTO.getStoreId());
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getIsonline,0);
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getStatus,0);
//会员等级判断
fullminusLambdaQueryWrapper.in(ActiveFullminus::getDieselUserLevel,userGradeService.selectUserGradeById(transferDTO.getGradeId()).getId());
fullminusLambdaQueryWrapper.eq(ActiveFullminus::getDieselUserLevel,transferDTO.getGradeId());
//activeFullminusService.list()
return null;
}
} }

View File

@ -0,0 +1,113 @@
package com.fuint.business.marketingActivity.activeExchange.vo;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fuint.business.marketingActivity.activeDiscount.entity.ActiveDiscountChild;
import java.io.Serializable;
import java.util.Date;
import java.util.List;
public class MaxoutVO implements Serializable {
//主键id
private Integer id;
//活动名称
private String name;
//参与条件 0不限制 1优惠订单不参与
private String participationCondition;
//参与次数类别0不限制 1限制
private String participationAcount;
//限制次数
private Integer limitAcount;
//满减折扣集合
private List<ActiveDiscountChild> activeDiscountChildList;
//创建者
private String createBy;
//创建时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
//更新者
private String updateBy;
//更新时间
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date updateTime;
public Integer getId() {
return id;
}
public void setId(Integer id) {
this.id = id;
}
public String getName() {
return name;
}
public void setName(String name) {
this.name = name;
}
public String getParticipationCondition() {
return participationCondition;
}
public void setParticipationCondition(String participationCondition) {
this.participationCondition = participationCondition;
}
public String getParticipationAcount() {
return participationAcount;
}
public void setParticipationAcount(String participationAcount) {
this.participationAcount = participationAcount;
}
public Integer getLimitAcount() {
return limitAcount;
}
public void setLimitAcount(Integer limitAcount) {
this.limitAcount = limitAcount;
}
public List<ActiveDiscountChild> getActiveDiscountChildList() {
return activeDiscountChildList;
}
public void setActiveDiscountChildList(List<ActiveDiscountChild> activeDiscountChildList) {
this.activeDiscountChildList = activeDiscountChildList;
}
public String getCreateBy() {
return createBy;
}
public void setCreateBy(String createBy) {
this.createBy = createBy;
}
public Date getCreateTime() {
return createTime;
}
public void setCreateTime(Date createTime) {
this.createTime = createTime;
}
public String getUpdateBy() {
return updateBy;
}
public void setUpdateBy(String updateBy) {
this.updateBy = updateBy;
}
public Date getUpdateTime() {
return updateTime;
}
public void setUpdateTime(Date updateTime) {
this.updateTime = updateTime;
}
}

View File

@ -15,13 +15,16 @@ import com.fuint.business.marketingActivity.activeFullminus.entity.ActiveFullmin
import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService; import com.fuint.business.marketingActivity.activeFullminus.service.ActiveFullminusService;
import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO; import com.fuint.business.marketingActivity.activeFullminus.vo.ActiveFullminusVO;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.business.userManager.service.LJUserGradeService;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.BeanUtils; import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import javax.annotation.Resource; import javax.annotation.Resource;
import java.io.Serializable; import java.io.Serializable;
import java.util.Arrays;
import java.util.List; import java.util.List;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -38,6 +41,8 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
private StoreService storeService; private StoreService storeService;
@Resource @Resource
private ActiveDiscountChildService activeDiscountChildService; private ActiveDiscountChildService activeDiscountChildService;
@Autowired
private LJUserGradeService userGradeService;
/** /**
* 新增数据 * 新增数据
* @param activeFullminusDTO * @param activeFullminusDTO
@ -109,10 +114,15 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers); List<ActiveDiscountChild> activeDiscountChildList = activeDiscountChildService.list(queryWrappers);
BeanUtils.copyProperties(s,activeFullminusVO); BeanUtils.copyProperties(s,activeFullminusVO);
activeFullminusVO.setAdaptOil(s.getAdaptOil().split(",")); activeFullminusVO.setAdaptOil(Arrays.stream(s.getAdaptOil().split(","))
activeFullminusVO.setDieselUserLevel(s.getDieselUserLevel().split(",")); .map(Integer::valueOf)
activeFullminusVO.setGasolineUserLevel(s.getGasolineUserLevel().split(",")); .toArray(Integer[]::new));
activeFullminusVO.setNaturalUserLevel(s.getNaturalUserLevel().split(",")); //获取会员等级
String str = "";
for (String gradeId : s.getDieselUserLevel().split(",")) {
str += userGradeService.selectUserGradeById(Integer.parseInt(gradeId)).getName() + ",";
}
activeFullminusVO.setDieselUserLevel(str.split(","));
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList); activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
return activeFullminusVO; return activeFullminusVO;
}).collect(Collectors.toList()); }).collect(Collectors.toList());
@ -142,7 +152,9 @@ public class ActiveFullminusServiceImpl extends ServiceImpl<ActiveFullminusMappe
activeFullminusVO.setDieselUserLevel(activeFullminus.getDieselUserLevel().split(",")); activeFullminusVO.setDieselUserLevel(activeFullminus.getDieselUserLevel().split(","));
activeFullminusVO.setGasolineUserLevel(activeFullminus.getGasolineUserLevel().split(",")); activeFullminusVO.setGasolineUserLevel(activeFullminus.getGasolineUserLevel().split(","));
activeFullminusVO.setNaturalUserLevel(activeFullminus.getNaturalUserLevel().split(",")); activeFullminusVO.setNaturalUserLevel(activeFullminus.getNaturalUserLevel().split(","));
activeFullminusVO.setAdaptOil(activeFullminus.getAdaptOil().split(",")); activeFullminusVO.setAdaptOil(Arrays.stream(activeFullminus.getAdaptOil().split(","))
.map(Integer::valueOf)
.toArray(Integer[]::new));
activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList); activeFullminusVO.setActiveDiscountChildList(activeDiscountChildList);
} }
} }

View File

@ -26,7 +26,8 @@ public class ActiveFullminusVO implements Serializable {
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date activeEndTime; private Date activeEndTime;
//适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0# //适用油品092# 1: 95# 298# 30# 4-10# 5 LNG 6CNG 7京92# 8京95# 9京0#
private String[] adaptOil; private String[] adaptOils;
private Integer[] adaptOil;
//适用会员类型 0:全部用户 1全部会员 2等级会员 //适用会员类型 0:全部用户 1全部会员 2等级会员
private String adaptUserType; private String adaptUserType;
//会员类型 0汽油会员 1柴油会员 2天然气会员 //会员类型 0汽油会员 1柴油会员 2天然气会员
@ -110,11 +111,19 @@ public class ActiveFullminusVO implements Serializable {
this.activeEndTime = activeEndTime; this.activeEndTime = activeEndTime;
} }
public String[] getAdaptOil() { public String[] getAdaptOils() {
return adaptOils;
}
public void setAdaptOils(String[] adaptOils) {
this.adaptOils = adaptOils;
}
public Integer[] getAdaptOil() {
return adaptOil; return adaptOil;
} }
public void setAdaptOil(String[] adaptOil) { public void setAdaptOil(Integer[] adaptOil) {
this.adaptOil = adaptOil; this.adaptOil = adaptOil;
} }

View File

@ -9,6 +9,8 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel; import com.fuint.business.marketingActivity.cardFule.entity.CardFuelDiesel;
import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService; import com.fuint.business.marketingActivity.cardFule.service.CardFuelDieselService;
import com.fuint.business.petrolStationManagement.entity.OilName;
import com.fuint.business.petrolStationManagement.service.OilNameService;
import com.fuint.business.store.service.StoreService; import com.fuint.business.store.service.StoreService;
import com.fuint.common.dto.AccountInfo; import com.fuint.common.dto.AccountInfo;
import com.fuint.common.util.TokenUtil; import com.fuint.common.util.TokenUtil;
@ -16,6 +18,7 @@ import com.fuint.framework.web.BaseController;
import com.fuint.framework.web.ResponseObject; import com.fuint.framework.web.ResponseObject;
import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.ObjectUtils;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
@ -39,6 +42,8 @@ public class CardFuelDieselController extends BaseController {
private CardFuelDieselService cardFuelDieselService; private CardFuelDieselService cardFuelDieselService;
@Resource @Resource
private StoreService storeService; private StoreService storeService;
@Autowired
private OilNameService oilNameService;
/** /**
* 分页查询所有数据 * 分页查询所有数据
@ -68,6 +73,7 @@ public class CardFuelDieselController extends BaseController {
List<CardFuelDiesel> records = page1.getRecords(); List<CardFuelDiesel> records = page1.getRecords();
//返回囤油卡状态 //返回囤油卡状态
for (CardFuelDiesel record : records) { for (CardFuelDiesel record : records) {
record.setOilType(oilNameService.selectOilNameById(Integer.parseInt(record.getOilType())).getOilName());
record.setStatus(record.getStatus().equals("1") ? "true" : "false"); record.setStatus(record.getStatus().equals("1") ? "true" : "false");
if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){ if(ObjectUtils.isNotEmpty(record.getActiveTime()) && "1".equals(record.getActiveTime())){
record.setActivityProgress("1"); record.setActivityProgress("1");

View File

@ -64,7 +64,7 @@ public class OilOrder extends BaseEntity implements Serializable {
/** /**
* 油枪号 * 油枪号
*/ */
private Integer oilGunNum; private String oilGunNum;
/** /**
* 油品数量 * 油品数量
*/ */

View File

@ -209,7 +209,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
order.setStaffId(staffId); order.setStaffId(staffId);
order.setTerminal(terminal); order.setTerminal(terminal);
order.setOils((String) jsonObjects.get(i).get("oilName")); order.setOils((String) jsonObjects.get(i).get("oilName"));
order.setOilGunNum(Integer.valueOf(jsonObjects.get(i).get("oilGunNum").toString())); order.setOilGunNum(jsonObjects.get(i).get("gunName").toString());
order.setOilNum(oilNum); order.setOilNum(oilNum);
order.setDiscountAmount(oilDiscount); order.setDiscountAmount(oilDiscount);
order.setPayUser(payUser); order.setPayUser(payUser);

View File

@ -29,11 +29,12 @@
<!--查询指定行数据--> <!--查询指定行数据-->
<select id="queryAllByLimit" resultMap="OilGunMap"> <select id="queryAllByLimit" resultMap="OilGunMap">
select select
og.id, og.gun_name, og.tank_id, og.status, og.store_id, og.create_time,og.update_time, og.create_by, og.update_by, ot.oil_number, ot.number_id og.id, og.gun_name, og.tank_id, og.status, og.store_id, og.create_time,og.update_time, og.create_by,
og.update_by, ot.oil_number, ot.number_id, ot.tank_name
from oil_gun og from oil_gun og
left join oil_tank ot on og.tank_id = ot.id left join oil_tank ot on og.tank_id = ot.id
<where> <where>
og.store_id = #{oilGun.storeId} og.store_id = #{oilGun.storeId} and og.status = '启用'
<if test="oilGun.numberId != null"> <if test="oilGun.numberId != null">
and ot.number_id = #{oilGun.numberId} and ot.number_id = #{oilGun.numberId}

View File

@ -40,7 +40,7 @@
<!-- from oil_number--> <!-- from oil_number-->
<select id="selectOilNumberById" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber"> <select id="selectOilNumberById" resultType="com.fuint.business.petrolStationManagement.entity.OilNumber">
<include refid="selectOilNumber"></include> <include refid="selectOilNumber"></include>
where number_id = #{numberId} where number_id = #{id}
</select> </select>
<insert id="insertOilNumber"> <insert id="insertOilNumber">
insert into oil_number insert into oil_number

View File

@ -113,7 +113,7 @@
top: 0; top: 0;
width: 51%; width: 51%;
height: 100%; height: 100%;
background: #9df1f1; background: #409eff;
z-index: 1000; z-index: 1000;
-webkit-transform: translateX(0); -webkit-transform: translateX(0);
-ms-transform: translateX(0); -ms-transform: translateX(0);

View File

@ -1,5 +1,14 @@
import request from "@/utils/request"; import request from "@/utils/request";
// 查询油枪列表信息
export function getOilGun(data) {
return request({
url: '/business/petrolStationManagement/oilGun/queryByPage',
method: 'get',
params: data
})
}
// 查询油罐列表 // 查询油罐列表
export function getGunApi(data) { export function getGunApi(data) {
return request({ return request({
@ -8,6 +17,7 @@ export function getGunApi(data) {
params: data params: data
}) })
} }
// 新增有关信息 // 新增有关信息
export function insertGunApi(data) { export function insertGunApi(data) {
return request({ return request({

View File

@ -0,0 +1,10 @@
import request from '@/utils/request'
// 根据id查询油号油枪列表
export function getOilNumberById(id) {
return request({
url: '/business/petrolStationManagement/oilNumber/' +id ,
method: 'get',
// data: data
})
}

View File

@ -54,31 +54,162 @@
<div class="hj-box" style="justify-content: flex-end">合计: {{ oilAmount + goodsAmount }}</div> <div class="hj-box" style="justify-content: flex-end">合计: {{ oilAmount + goodsAmount }}</div>
</div> </div>
<div class="center-left-hj"> <div class="center-left-hj">
<div>满减活动</div> <div>
<div>-{{ oilDiscount + goodsDiscount }}</div> <el-popover
placement="bottom-start"
width="400"
trigger="click">
<div>
<el-checkbox-group v-model="checkedCities1" @change="handleCheckedCitiesChange1">
<el-checkbox v-for="city in cities1" :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="isIndeterminate1"
style="color: black;font-size: 16px"
v-model="checkAll1" @change="handleCheckAllChange1">
</el-checkbox>
满减活动
</div>
</el-popover>
</div>
<div>-{{ fullReduction + goodsDiscount }}</div>
</div> </div>
<div class="center-left-hj" v-show="isMember"> <div class="center-left-hj" v-show="isMember">
<div>充值优惠</div> <div>
<div>-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.reduce }}</div>
</div>
</div>
</el-checkbox>
</el-checkbox-group>
</div>
<div slot="reference">
<el-checkbox :indeterminate="isIndeterminate2"
style="color: black;font-size: 16px"
v-model="checkAll2" @change="handleCheckAllChange2">
</el-checkbox>
等级优惠
</div>
</el-popover>
</div>
<div>-{{ oilDiscount + goodsDiscount }}</div>
</div> </div>
<div class="center-left-hj" v-show="isMember && refuelMoney!=null"> <div class="center-left-hj" v-show="isMember && refuelMoney!=null">
<div> <div>
囤油卡 <el-popover
<div style="margin: 5px 0" v-for="(item,index) in refuelMoney" :key="index"> placement="bottom-start"
{{ item.type }} width="400"
<span style="color: #00afff">{{ item.oilType }}</span> trigger="click">
余额{{ item.refuelMoney }}L <div>
</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>
</div> </div>
<div>- {{ consumeRefuelMoney }}L</div> <div>- {{ consumeRefuelMoney }}L</div>
</div> </div>
<div class="center-left-hj" v-show="isMember"> <div class="center-left-hj" v-show="isMember">
<div> <div>
储值卡 <el-popover
<span>账户余额{{ balance }}</span> 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>
</div> </div>
<div>-{{ consumeAmount }}</div> <div>-{{ consumeAmount }}</div>
</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="checkedCities5" @change="handleCheckedCitiesChange5">
<el-checkbox v-for="city in cities5" :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="isIndeterminate5"
style="color: black;font-size: 16px"
v-model="checkAll5" @change="handleCheckAllChange5">
</el-checkbox>
优惠券
</div>
</el-popover>
</div>
<div>-{{ couponAmount }}</div>
</div>
<div class="center-left-th"> <div class="center-left-th">
<div class="th-box"> <div class="th-box">
<div>扫码支付</div> <div>扫码支付</div>
@ -86,7 +217,7 @@
</div> </div>
<div class="th-box"> <div class="th-box">
<div>找零</div> <div>找零</div>
<div class="bule">0</div> <div class="bule">{{ seekZero }}</div>
</div> </div>
<div class="th-box"> <div class="th-box">
<div @click="dialogVisible = true">加油员</div> <div @click="dialogVisible = true">加油员</div>
@ -129,6 +260,18 @@
<div class="center-top-data"> <div class="center-top-data">
<div class="center-top-of"> <div class="center-top-of">
<div class="wrap-wrap"> <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,item.oilName) }}</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 class="of-box" v-for="(item,index) in oilNumGunList" :key="index"--> <!-- <div class="of-box" v-for="(item,index) in oilNumGunList" :key="index"-->
<!-- :style="{'background-color': colorList[index%5].color}"--> <!-- :style="{'background-color': colorList[index%5].color}"-->
<!-- @click="refuel(item.id)">--> <!-- @click="refuel(item.id)">-->
@ -139,16 +282,6 @@
<!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">--> <!-- <img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">-->
<!-- </div>--> <!-- </div>-->
<!-- </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="of-title" >{{item.oilGunNum}}号枪</div>
<div>
<img src="../../../assets/images/jya.png" style="width: 18px;height: 18px;">
</div>
</div>
</div> </div>
</div> </div>
@ -359,18 +492,19 @@
<div style="text-align: center;margin-bottom: 10px"> <div style="text-align: center;margin-bottom: 10px">
合计金额{{ oilAmount + goodsAmount }}优惠合计{{ oilDiscount + goodsDiscount }} 合计金额{{ oilAmount + goodsAmount }}优惠合计{{ oilDiscount + goodsDiscount }}
</div> </div>
<div> <div v-if="map.payType != 'CASH'">
<el-input v-model="authCode" <div>
autofocus="autofocus" <el-input v-model="authCode"
@keydown.enter.native="collection" autofocus="autofocus"
placeholder="扫描或输入付款码、支持微信、支付宝、云闪付"> @keydown.enter.native="collection"
<i placeholder="扫描或输入付款码、支持微信、支付宝、云闪付">
slot="suffix"> <i
<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> slot="suffix">
</i> <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>
</el-input> </i>
</div> </el-input>
<div class="demo-image"> </div>
<div class="demo-image"></div>
<div class="block" style="text-align: center"> <div class="block" style="text-align: center">
<el-image <el-image
style="width: 200px; height: 200px" style="width: 200px; height: 200px"
@ -378,6 +512,20 @@
src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image> src="https://oil.wudb.cn/static/img/scan-demo.fcb8b1ab.png"></el-image>
</div> </div>
</div> </div>
<div v-else>
<div>
<el-input v-model="authCode"
autofocus="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> <el-divider></el-divider>
<span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around"> <span slot="footer" class="dialog-footer" style="display: flex;justify-content: space-around">
<el-button @click="dialogVisiblej = false" class="but"> </el-button> <el-button @click="dialogVisiblej = false" class="but"> </el-button>
@ -430,7 +578,7 @@
<el-descriptions-item label="会员备注">{{member.remark ? member.remark : "--"}}</el-descriptions-item> <el-descriptions-item label="会员备注">{{member.remark ? member.remark : "--"}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="会员等级"> <el-descriptions title="会员等级">
<el-descriptions-item label="等级名称">{{member.gradeId ? member.gradeId : "--"}}</el-descriptions-item> <el-descriptions-item label="等级名称">{{member.gradeId ? getGradeName(gradeList,member.gradeId) : "--"}}</el-descriptions-item>
</el-descriptions> </el-descriptions>
<el-descriptions title="储值余额"> <el-descriptions title="储值余额">
<template slot="extra"> <template slot="extra">
@ -442,7 +590,7 @@
</el-row> </el-row>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisiblevip = false"> </el-button> <el-button @click="dialogVisiblevip = false"> </el-button>
<el-button type="primary" @click="chooseUser(member)"> </el-button> <el-button type="primary" :disabled="isSure" @click="chooseUser(member)"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
@ -458,7 +606,7 @@
</div> </div>
<div class="amount"> <div class="amount">
<span>已选油枪</span> <span>已选油枪</span>
<span class="amountBlue">{{ form.oilGunNum }}号枪</span> <span class="amountBlue">{{ form.gunName }}</span>
</div> </div>
<div class="amount"> <div class="amount">
<span>油品单价</span> <span>油品单价</span>
@ -527,26 +675,58 @@
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user"; import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
import {queryStaffs, staffInfo} from "@/api/cashier/staff"; import {queryStaffs, staffInfo} from "@/api/cashier/staff";
import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder"; import {addLJGoods, goodsOrder, oilOrder} from "@/api/cashier/oilorder";
import {getUserGrade} from "@/api/cashier/usergrade"; import {getUserGrade, listUserGrade} from "@/api/cashier/usergrade";
import {getGunApi} from "@/api/cashier/oilGuns"; import {getOilGun} from "@/api/cashier/oilGuns";
import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord"; import {listCardFavorableRecord} from "@/api/cashier/cardfavorablerecord";
import {getOilNumberById} from "@/api/cashier/oilnumber";
const cityOptions = ['上海', '北京'];
export default { export default {
name: "homeindex", name: "homeindex",
data(){ data(){
return{ return{
//
checkAll1: false,
isIndeterminate1: true,
checkedCities1: ['上海'],
cities1: cityOptions,
//
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,
// //
couponList:[], couponList:[],
// //
consumeRefuelMoney:0, consumeRefuelMoney:0,
//
fullReduction:0,
// //
refuelMoney:null, refuelMoney:null,
// //
consumeAmount:0, consumeAmount:0,
// //
balance:0, balance:0,
// //
amount:0, amount:0,
//
seekZero:0,
// //
loading:false, loading:false,
// //
@ -591,7 +771,7 @@
// //
memberList:[], memberList:[],
select1:'会员手机号', select1:'会员手机号',
// //
userNo:"", userNo:"",
// //
goods:"", goods:"",
@ -653,7 +833,7 @@
// //
goodsOrder:"", goodsOrder:"",
// //
payType:"WECHAT", payType:"CASH",
// //
oilAmount:0, oilAmount:0,
// //
@ -688,16 +868,29 @@
consumeAmount:0, consumeAmount:0,
// json // json
refuelMoney:"", refuelMoney:"",
//
seekZero:0,
}, },
//
gradeName:"", gradeName:"",
//
gradeList:"",
menu:1, menu:1,
index:0, index:0,
//
isPay:true, isPay:true,
isPaySuccess:false, isPaySuccess:false,
//
orderNo:'', orderNo:'',
timer: null, timer: null,
//
isQuery:true, isQuery:true,
//
gunList:[], gunList:[],
//
isSure:true,
//
couponAmount:0,
} }
}, },
created() { created() {
@ -710,6 +903,71 @@
this.getCouponList(); this.getCouponList();
}, },
methods:{ methods:{
//
changeSeekZero(){
this.seekZero = this.authCode - this.oilActualPay - this.goodsActualPay
},
// id
getGradeName(list,id){
let name = "";
list.forEach(item => {
if (item.id == id){
name = item.name
}
})
this.gradeName = name;
return name;
},
//
handleCheckAllChange1(val) {
this.checkedCities1 = val ? cityOptions : [];
this.isIndeterminate1 = false;
},
handleCheckedCitiesChange1(value) {
let checkedCount = value.length;
this.checkAll1 = checkedCount === this.cities1.length;
this.isIndeterminate1 = checkedCount > 0 && checkedCount < this.cities1.length;
},
handleCheckAllChange2(val) {
let list = []
this.gradeDiscount.forEach(item => {
list.push(item.type)
})
this.checkedCities2 = val ? list : [];
this.isIndeterminate2 = false;
},
handleCheckedCitiesChange2(value) {
let checkedCount = value.length;
this.checkAll2 = checkedCount === this.gradeDiscount.length;
this.isIndeterminate2 = checkedCount > 0 && checkedCount < this.gradeDiscount.length;
},
handleCheckAllChange3(val) {
this.checkedCities3 = val ? cityOptions : [];
this.isIndeterminate3 = false;
},
handleCheckedCitiesChange3(value) {
let checkedCount = value.length;
this.checkAll3 = checkedCount === this.cities3.length;
this.isIndeterminate3 = checkedCount > 0 && checkedCount < this.cities3.length;
},
handleCheckAllChange4(val) {
this.checkedCities4 = val ? cityOptions : [];
this.isIndeterminate4 = false;
},
handleCheckedCitiesChange4(value) {
let checkedCount = value.length;
this.checkAll4 = checkedCount === this.cities4.length;
this.isIndeterminate4 = checkedCount > 0 && checkedCount < this.cities4.length;
},
handleCheckAllChange5(val) {
this.checkedCities5 = val ? cityOptions : [];
this.isIndeterminate5 = false;
},
handleCheckedCitiesChange5(value) {
let checkedCount = value.length;
this.checkAll5 = checkedCount === this.cities5.length;
this.isIndeterminate5 = checkedCount > 0 && checkedCount < this.cities5.length;
},
// //
querySearch(queryString, cb) { querySearch(queryString, cb) {
let _this = this; let _this = this;
@ -778,14 +1036,16 @@
this.oilDiscount = 0; this.oilDiscount = 0;
this.goodsDiscount = 0; this.goodsDiscount = 0;
this.userNo = ""; this.userNo = "";
this.oilActualPay = this.oilAmount - this.oilDiscount this.oilActualPay = this.oilAmount - this.oilDiscount - this.couponAmount
this.goodsActualPay = this.goodsAmount - this.goodsDiscount this.goodsActualPay = this.goodsAmount - this.goodsDiscount
this.isSure = true;
this.handleChange(); this.handleChange();
}, },
// //
getGrade(id){ getGrade(id){
let _this = this; let _this = this;
this.oilDiscount = 0; this.oilDiscount = 0;
this.gradeDiscount = [];
getUserGrade(id).then( response => { getUserGrade(id).then( response => {
let gasolineDiscount = 0; let gasolineDiscount = 0;
let dieselDiscount = 0; let dieselDiscount = 0;
@ -796,40 +1056,58 @@
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.gasolineDiscount=="满减优惠"){ if (response.data.gasolineDiscount=="满减优惠"){
let oilDiscount = 0; let oilDiscount = 0;
let discount = {type:"满减优惠",full:0,reduce:0}
for (let i = 1; i <= gasolineRule.length; i++){ for (let i = 1; i <= gasolineRule.length; i++){
//
discount.full = gasolineRule[i-1].gasolineRule1
if (gasolineRule.length>1){ if (gasolineRule.length>1){
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){ if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[gasolineRule.length-1].gasolineRule1 * oilDiscount = (item.amount/gasolineRule[gasolineRule.length-1].gasolineRule1 *
gasolineRule[gasolineRule.length-1].gasolineRule2).toFixed(2); gasolineRule[gasolineRule.length-1].gasolineRule2).toFixed(2);
discount.reduce = gasolineRule[i-1].gasolineRule2
break; break;
} }
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){ if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2) oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2)
discount.reduce = gasolineRule[i-1].gasolineRule2
} }
}else { }else {
if (item.amount >= gasolineRule[i-1].gasolineRule1){ if (item.amount >= gasolineRule[i-1].gasolineRule1){
oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2); oilDiscount = (item.amount/gasolineRule[i-1].gasolineRule1 * gasolineRule[i-1].gasolineRule2).toFixed(2);
discount.reduce = gasolineRule[i-1].gasolineRule2
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
}
gasolineDiscount += +oilDiscount gasolineDiscount += +oilDiscount
}else if (response.data.gasolineDiscount=="每升优惠"){ }else if (response.data.gasolineDiscount=="每升优惠"){
let discount = {type:"每升优惠",full:0,reduce:0}
let oilDiscount = 0; let oilDiscount = 0;
for (let i = 1; i <= gasolineRule.length; i++){ for (let i = 1; i <= gasolineRule.length; i++){
//
discount.full = gasolineRule[i-1].gasolineRule1
if (gasolineRule.length>1){ if (gasolineRule.length>1){
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){ if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2); oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
discount.reduce = gasolineRule[i-1].gasolineRule3
break; break;
} }
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){ if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2) oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.reduce = gasolineRule[i-1].gasolineRule3
} }
}else { }else {
if (item.amount >= gasolineRule[i-1].gasolineRule1){ if (item.amount >= gasolineRule[i-1].gasolineRule1){
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2) oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
discount.reduce = gasolineRule[i-1].gasolineRule3
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
}
gasolineDiscount += +oilDiscount gasolineDiscount += +oilDiscount
}else { }else {
gasolineDiscount = 0; gasolineDiscount = 0;
@ -841,40 +1119,60 @@
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.dieselDiscount=="满减优惠"){ if (response.data.dieselDiscount=="满减优惠"){
let oilDiscount = 0; let oilDiscount = 0;
let discount = {type:"满减优惠",full:0,reduce:0}
for (let i = 1; i <= dieselRule.length; i++){ for (let i = 1; i <= dieselRule.length; i++){
//
discount.full = dieselRule[i-1].dieselRule1
if (dieselRule.length>1){ if (dieselRule.length>1){
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){ if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
oilDiscount = (item.amount/dieselRule[dieselRule.length-1].dieselRule1 * oilDiscount = (item.amount/dieselRule[dieselRule.length-1].dieselRule1 *
dieselRule[dieselRule.length-1].dieselRule2).toFixed(2); dieselRule[dieselRule.length-1].dieselRule2).toFixed(2);
discount.reduce = dieselRule[i-1].dieselRule2
break; break;
} }
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){ if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2); oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2);
discount.reduce = dieselRule[i-1].dieselRule2
} }
}else { }else {
if (item.amount >= dieselRule[i-1].dieselRule1){ if (item.amount >= dieselRule[i-1].dieselRule1){
oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2); oilDiscount = (item.amount/dieselRule[i-1].dieselRule1 * dieselRule[i-1].dieselRule2).toFixed(2);
discount.reduce = dieselRule[i-1].dieselRule2
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
_this.checkedCities2 = ['满减优惠']
}
dieselDiscount += +oilDiscount dieselDiscount += +oilDiscount
}else if (response.data.dieselDiscount=="每升优惠"){ }else if (response.data.dieselDiscount=="每升优惠"){
let oilDiscount = 0; let oilDiscount = 0;
let discount = {type:"每升优惠",full:0,reduce:0}
for (let i = 1; i <= dieselRule.length; i++){ for (let i = 1; i <= dieselRule.length; i++){
//
discount.full = dieselRule[i-1].dieselRule1
_this.gradeDiscount.push(discount)
if (dieselRule.length>1){ if (dieselRule.length>1){
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){ if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
oilDiscount = (item.liters * dieselRule[gasolineRule.length-1].dieselRule3).toFixed(2); oilDiscount = (item.liters * dieselRule[gasolineRule.length-1].dieselRule3).toFixed(2);
discount.reduce = dieselRule[i-1].dieselRule3
break; break;
} }
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){ if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2) oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.reduce = dieselRule[i-1].dieselRule3
} }
}else { }else {
if (item.amount >= dieselRule[i-1].dieselRule1){ if (item.amount >= dieselRule[i-1].dieselRule1){
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2) oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
discount.reduce = dieselRule[i-1].dieselRule3
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
}
dieselDiscount += +oilDiscount dieselDiscount += +oilDiscount
}else { }else {
dieselDiscount = 0; dieselDiscount = 0;
@ -886,40 +1184,58 @@
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){ if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
if (response.data.naturalGasDiscount=="满减优惠"){ if (response.data.naturalGasDiscount=="满减优惠"){
let oilDiscount = 0; let oilDiscount = 0;
let discount = {type:"满减优惠",full:0,reduce:0}
for (let i = 1; i <= naturalGasRule.length; i++){ for (let i = 1; i <= naturalGasRule.length; i++){
//
discount.full = naturalGasRule[i-1].naturalGasRule1
if (naturalGasRule.length>1){ if (naturalGasRule.length>1){
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){ if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[naturalGasRule.length-1].naturalGasRule1 * oilDiscount = (item.amount/naturalGasRule[naturalGasRule.length-1].naturalGasRule1 *
naturalGasRule[naturalGasRule.length-1].naturalGasRule2).toFixed(2); naturalGasRule[naturalGasRule.length-1].naturalGasRule2).toFixed(2);
discount.reduce = naturalGasRule[i-1].naturalGasRule2
break; break;
} }
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){ if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2); oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2);
discount.reduce = naturalGasRule[i-1].naturalGasRule2
} }
}else { }else {
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){ if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2); oilDiscount = (item.amount/naturalGasRule[i-1].naturalGasRule1 * naturalGasRule[i-1].naturalGasRule2).toFixed(2);
discount.reduce = naturalGasRule[i-1].naturalGasRule2
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
}
naturalGasDiscount += +oilDiscount naturalGasDiscount += +oilDiscount
}else if (response.data.naturalGasDiscount=="每单位优惠"){ }else if (response.data.naturalGasDiscount=="每单位优惠"){
let oilDiscount = 0; let oilDiscount = 0;
let discount = {type:"每单位优惠",full:0,reduce:0}
for (let i = 1; i <= naturalGasRule.length; i++){ for (let i = 1; i <= naturalGasRule.length; i++){
//
discount.full = naturalGasRule[i-1].naturalGasRule1
if (naturalGasRule.length>1){ if (naturalGasRule.length>1){
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){ if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2) oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
discount.reduce = naturalGasRule[i-1].naturalGasRule3
break; break;
} }
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){ if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2) oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.reduce = naturalGasRule[i-1].naturalGasRule3
} }
}else { }else {
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){ if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2) oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
discount.reduce = naturalGasRule[i-1].naturalGasRule3
} }
} }
} }
if (discount.reduce!=0){
_this.gradeDiscount.push(discount)
}
naturalGasDiscount += +oilDiscount naturalGasDiscount += +oilDiscount
}else { }else {
naturalGasDiscount = 0; naturalGasDiscount = 0;
@ -927,143 +1243,15 @@
} }
} }
}) })
// if (_this.oilType == ""){
// let gasolineRule = JSON.parse(response.data.gasolineRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.gasolineDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < gasolineRule.length; i++){
// if (gasolineRule.length>1){
// if (item.amount >= gasolineRule[i].gasolineRule1 && item.amount < gasolineRule[i+1].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[i].gasolineRule1 * gasolineRule[i].gasolineRule2
// }
// if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[gasolineRule.length-1].gasolineRule1 * gasolineRule[gasolineRule.length-1].gasolineRule2
// }
// }else {
// if (item.amount >= gasolineRule[i].gasolineRule1){
// oilDiscount = item.amount/gasolineRule[i].gasolineRule1 * gasolineRule[i].gasolineRule2
// }
// }
// }
// gasolineDiscount += oilDiscount
// }else if (response.data.gasolineDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < gasolineRule.length; i++){
// if (gasolineRule.length>1){
// if (item.amount >= gasolineRule[i].gasolineRule1 && item.amount < gasolineRule[i+1].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// }else {
// if (item.amount >= gasolineRule[i].gasolineRule1){
// oilDiscount = item.liters * gasolineRule[i].gasolineRule3
// }
// }
// }
// gasolineDiscount += oilDiscount
// }else {
// gasolineDiscount = 0;
// }
// })
// }
// }
// if (_this.oilType == ""){
// let dieselRule = JSON.parse(response.data.dieselRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.dieselDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < dieselRule.length; i++){
// if (dieselRule.length>1){
// if (item.amount >= dieselRule[i].dieselRule1 && item.amount < dieselRule[i+1].dieselRule1){
// oilDiscount = item.amount/dieselRule[i].dieselRule1 * dieselRule[i].dieselRule2
// }
// if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
// oilDiscount = item.amount/dieselRule[dieselRule.length-1].dieselRule1 * dieselRule[dieselRule.length-1].dieselRule2
// }
// }else {
// if (item.amount >= dieselRule[i].dieselRule1){
// oilDiscount = item.amount/dieselRule[i].dieselRule1 * dieselRule[i].dieselRule2
// }
// }
// }
// dieselDiscount += oilDiscount
// }else if (response.data.dieselDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < dieselRule.length; i++){
// if (dieselRule.length>1){
// if (item.amount >= dieselRule[i].dieselRule1 && item.amount < dieselRule[i+1].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// }else {
// if (item.amount >= dieselRule[i].dieselRule1){
// oilDiscount = item.liters * dieselRule[i].dieselRule3
// }
// }
// }
// dieselDiscount += oilDiscount
// }else {
// dieselDiscount = 0;
// }
// })
// }
// }
// if (_this.oilType == ""){
// let naturalGasRule = JSON.parse(response.data.naturalGasRule);
// if (response.data.preferential == '' && response.data.status == 'qy'){
// _this.oilOrder.forEach(item => {
// if (response.data.naturalGasDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < naturalGasRule.length; i++){
// if (naturalGasRule.length>1){
// if (item.amount >= naturalGasRule[i].naturalGasRule1 && item.amount < naturalGasRule[i+1].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[i].naturalGasRule1 * naturalGasRule[i].naturalGasRule2
// }
// if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[naturalGasRule.length-1].naturalGasRule1 * naturalGasRule[naturalGasRule.length-1].naturalGasRule2
// }
// }else {
// if (item.amount >= naturalGasRule[i].naturalGasRule1){
// oilDiscount = item.amount/naturalGasRule[i].naturalGasRule1 * naturalGasRule[i].naturalGasRule2
// }
// }
// }
// naturalGasDiscount += oilDiscount
// }else if (response.data.naturalGasDiscount==""){
// let oilDiscount = 0;
// for (let i = 0; i < naturalGasRule.length; i++){
// if (naturalGasRule.length>1){
// if (item.amount >= naturalGasRule[i].naturalGasRule1 && item.amount < naturalGasRule[i+1].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// }else {
// if (item.amount >= naturalGasRule[i].naturalGasRule1){
// oilDiscount = item.liters * naturalGasRule[i].naturalGasRule3
// }
// }
// }
// naturalGasDiscount += oilDiscount
// }else {
// naturalGasDiscount = 0;
// }
// })
// }
// }
let oilActualPay = _this.oilActualPay; let oilActualPay = _this.oilActualPay;
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount _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)){ if (_this.balance>=(_this.oilAmount - _this.oilDiscount)){
_this.consumeAmount = _this.oilAmount - _this.oilDiscount; _this.consumeAmount = _this.oilAmount - _this.oilDiscount;
_this.oilActualPay = 0; _this.oilActualPay = 0;
@ -1083,19 +1271,22 @@
this.getGrade(data.gradeId) this.getGrade(data.gradeId)
this.changeRefuelMoney(); this.changeRefuelMoney();
this.handleChange(); this.handleChange();
this.queryCoupon(this.couponList,data.id);
}, },
// 使 // 使
queryCoupon(list,id){ queryCoupon(list,id){
let result = false; // let result = false;
list.forEach(item => { // list.forEach(item => {
if (item.mtUserId==id){ // if (item.mtUserId==id){
// let startTime = item.startTime;
} // let endTime = item.endTime;
}) // let date = new Date();
// let sysDate = `${date.getFullYear()}-${date.getMonth() - 1}-${date.getDate()}`
// }
// })
}, },
// //
handleChoose(data){ handleChoose(data){
this.isSure = false;
this.member = data; this.member = data;
this.refuelMoney = JSON.parse(data.refuelMoney) this.refuelMoney = JSON.parse(data.refuelMoney)
this.dialogVisibleMember = false; this.dialogVisibleMember = false;
@ -1166,6 +1357,8 @@
}, },
// //
settlement(){ settlement(){
this.authCode = ""
this.seekZero = 0;
this.isPay = true this.isPay = true
this.dialogVisiblej = true this.dialogVisiblej = true
}, },
@ -1199,8 +1392,8 @@
this.form.amount = this.form.oilPrice * this.form.amount this.form.amount = this.form.oilPrice * this.form.amount
} }
// //
let name1 = this.getName(this.oilNameList,this.form.oilName); // let name1 = this.getName(this.oilNameList,this.form.oilName);
this.form.oilType = name1; // this.form.oilType = name1;
this.oilOrder.push(this.form) this.oilOrder.push(this.form)
if (this.select == "元"){ if (this.select == "元"){
@ -1228,6 +1421,7 @@
this.changeRefuelMoney(); this.changeRefuelMoney();
} }
}, },
//
changeRefuelMoney(){ changeRefuelMoney(){
let _this = this; let _this = this;
_this.consumeRefuelMoney = 0; _this.consumeRefuelMoney = 0;
@ -1331,17 +1525,26 @@
}) })
}, },
// //
refuel(id){ refuel(data){
this.select = "元"; this.select = "元";
this.amount = 0 this.amount = 0
this.dialogVisibleamount = true; this.dialogVisibleamount = true;
getOilNumGunById(id).then( response => { getOilNumberById(data.numberId).then( response => {
this.form = response.data; this.form = response.data;
this.gunList.forEach(item => {
if (item.id==data.id){
this.form.gunName = item.gunName
}
})
}) })
// getOilNumGunById(id).then( response => {
// this.form = response.data;
// })
}, },
// //
collection(){ collection(){
// JSON.parse() // JSON.parse()
this.map.seekZero = this.seekZero;
this.map.oilAmount = this.oilAmount; this.map.oilAmount = this.oilAmount;
this.map.goodsAmount = this.goodsAmount; this.map.goodsAmount = this.goodsAmount;
this.map.oilActualPay = this.oilActualPay; this.map.oilActualPay = this.oilActualPay;
@ -1500,8 +1703,10 @@
this.goodsActualPay = 0; this.goodsActualPay = 0;
this.goodsDiscount = 0; this.goodsDiscount = 0;
this.consumeAmount = 0; this.consumeAmount = 0;
this.consumeRefuelMoney = 0;
this.oilTotal = 0; this.oilTotal = 0;
this.goodsTotal = 0; this.goodsTotal = 0;
this.isMember = false;
} }
this.isPay = true; this.isPay = true;
this.dialogVisiblej = false this.dialogVisiblej = false
@ -1557,11 +1762,12 @@
} }
}) })
if (tab.label == "全部"){ if (tab.label == "全部"){
oilNum = "全部" oilNum = ""
} }
getOilNumGun({oilNum : oilNum}).then( response => { this.getList(oilNum)
this.oilNumGunList = response.data // getOilNumGun({oilNum : oilNum}).then( response => {
}) // this.oilNumGunList = response.data
// })
}, },
gocomponents(index){ gocomponents(index){
this.leftindex = index this.leftindex = index
@ -1571,12 +1777,18 @@
listCardFavorableRecord().then(response => { listCardFavorableRecord().then(response => {
this.couponList = response.data.records this.couponList = response.data.records
}) })
let map = {
page:1,
pageSize:20,
}
listUserGrade(map).then(response => {
this.gradeList = response.data.records
})
}, },
// //
getList(){ getList(numberId){
getGunApi().then(response => { getOilGun({numberId:numberId}).then(response => {
this.gunList = response.data; this.gunList = response.data.records;
// console.log(this.gunList)
}) })
}, },
}, },