收银台
This commit is contained in:
parent
f706797001
commit
ec27a74ce8
@ -9,10 +9,11 @@ export function listOilConfig() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 是否开启支付规则
|
// 是否开启支付规则
|
||||||
export function isOpenOilConfig(isOpen) {
|
export function isOpenOilConfig(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/api/oilConfig/'+isOpen,
|
url: '/api/oilConfig/isOpen',
|
||||||
method: 'get',
|
method: 'post',
|
||||||
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -123,10 +123,15 @@
|
|||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="姓名" align="center" prop="name" />
|
<el-table-column label="姓名" align="center" prop="name" />
|
||||||
<el-table-column label="车牌号" align="center" prop="carNumber"/>
|
<el-table-column label="车牌号" align="center" prop="carNumber">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.carNumber ? scope.row.carNumber:"--"}}</span>
|
||||||
|
</template>
|
||||||
|
</el-table-column>
|
||||||
<el-table-column label="认证资料" align="center" prop="attestationData">
|
<el-table-column label="认证资料" align="center" prop="attestationData">
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
<!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>-->
|
<!-- <p v-for="(item,index) in scope.row.imgUrlList" :key="index">{{item.imageUrl1}}</p>-->
|
||||||
|
<span v-if="scope.row.imgUrlList==null || scope.row.imgUrlList==''">--</span>
|
||||||
<span v-for="(item,index) in scope.row.imgUrlList" :key="index">
|
<span v-for="(item,index) in scope.row.imgUrlList" :key="index">
|
||||||
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
|
<img v-if="item.imageUrl1" :src="'/dev-api'+item.imageUrl1" class="attImg">
|
||||||
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
|
<img v-if="item.imageUrl2" :src="'/dev-api'+item.imageUrl2" class="attImg">
|
||||||
@ -134,7 +139,11 @@
|
|||||||
</span>
|
</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</el-table-column>
|
||||||
<el-table-column label="备注" align="center" prop="remark"/>
|
<el-table-column label="备注" align="center" prop="remark">
|
||||||
|
<template slot-scope="scope">
|
||||||
|
<span>{{scope.row.remark ? scope.row.remark:"--"}}</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">
|
||||||
<dict-tag :options="dict.type.rzzt" :value="scope.row.status"/>
|
<dict-tag :options="dict.type.rzzt" :value="scope.row.status"/>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
<el-card >
|
<el-card >
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="来源油站" prop="storeIds">
|
<el-form-item label="来源油站" prop="storeIds">
|
||||||
<el-select v-model="storeIds" filterable clearable placeholder="来源油站" style="width: 100%;">
|
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
||||||
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
|
<el-option v-for="item in storeList" :key="item.id+''" :label="item.name" :value="item.id+''"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
@ -623,7 +623,9 @@ export default {
|
|||||||
resetQuery() {
|
resetQuery() {
|
||||||
this.dateRange = [];
|
this.dateRange = [];
|
||||||
this.resetForm("queryForm");
|
this.resetForm("queryForm");
|
||||||
this.queryParams.storeIds = '';
|
this.queryParams.storeId = '';
|
||||||
|
this.queryParams.official = "";
|
||||||
|
this.ifBalance = ""
|
||||||
this.storeIds = [];
|
this.storeIds = [];
|
||||||
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
this.$refs.tables.sort(this.defaultSort.prop, this.defaultSort.order);
|
||||||
this.handleQuery();
|
this.handleQuery();
|
||||||
|
@ -433,7 +433,7 @@
|
|||||||
<div style="display: flex">
|
<div style="display: flex">
|
||||||
<div style="width: 7%;line-height: 40px">油品类型</div>
|
<div style="width: 7%;line-height: 40px">油品类型</div>
|
||||||
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
<el-radio-group v-model="tabOilType" style="margin-bottom: 30px;">
|
||||||
<el-radio-button v-for="item,index in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
<el-radio-button v-for="(item,index) in oilTypeList" :label="item.oilType" @click.native="tabOilTypeClick(item.status)">{{ item.type }}</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
</div>
|
</div>
|
||||||
</el-col>
|
</el-col>
|
||||||
|
@ -54,9 +54,9 @@
|
|||||||
|
|
||||||
<div style="display: flex;align-items: center">
|
<div style="display: flex;align-items: center">
|
||||||
<div class="mingc">规则周期</div>
|
<div class="mingc">规则周期</div>
|
||||||
<el-radio-group v-model="labelPosition" size="small">
|
<el-radio-group v-model="labelPosition" @input="ruleCycle == labelPosition" size="small">
|
||||||
<el-radio-button label="left">永久</el-radio-button>
|
<el-radio-button label="permanent">永久</el-radio-button>
|
||||||
<el-radio-button label="right">单日</el-radio-button>
|
<el-radio-button label="singleDay">单日</el-radio-button>
|
||||||
</el-radio-group>
|
</el-radio-group>
|
||||||
<div class="mingc">功能状态</div>
|
<div class="mingc">功能状态</div>
|
||||||
<el-switch
|
<el-switch
|
||||||
@ -79,8 +79,8 @@
|
|||||||
<!-- <div> 交易满 </div>-->
|
<!-- <div> 交易满 </div>-->
|
||||||
<div> 交易占比 </div>
|
<div> 交易占比 </div>
|
||||||
<div class="jiaong"> {{ item.proportion }} </div>
|
<div class="jiaong"> {{ item.proportion }} </div>
|
||||||
<div> %更换支付通道 参与次数 </div>
|
<div style="margin-right: 20px"> %更换支付通道 </div>
|
||||||
<div class="jiaong"> 不固定次数 </div>
|
<!-- <div class="jiaong"> 参与次数不固定次数 </div>-->
|
||||||
|
|
||||||
<el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button>
|
<el-button type="primary" icon="el-icon-edit" @click="editOilConfig(item.id)">编辑</el-button>
|
||||||
<el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button>
|
<el-button type="danger" icon="el-icon-close" @click="deleteOilConfig(item.id)">删除</el-button>
|
||||||
@ -101,7 +101,9 @@
|
|||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<div class="hsize">注:规则按照顺序进行处理并自动更换支付通道,新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
|
<div class="hsize">注:规则按照顺序进行处理并自动更换支付通道,新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
|
||||||
|
|
||||||
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible">
|
<!-- 编辑通道规则-->
|
||||||
|
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
|
||||||
|
width="30%">
|
||||||
<el-form :model="form" ref="form">
|
<el-form :model="form" ref="form">
|
||||||
|
|
||||||
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
|
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
|
||||||
@ -116,24 +118,24 @@
|
|||||||
<el-form-item label="商户号" :label-width="formLabelWidth">
|
<el-form-item label="商户号" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
|
<el-input v-model="form.mchntCd" disabled autocomplete="off"></el-input>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="消费满笔数" :label-width="formLabelWidth">
|
<el-form-item label="交易占比" :label-width="formLabelWidth">
|
||||||
<el-input v-model="form.proportion" autocomplete="off">
|
<el-input v-model="form.proportion" autocomplete="off">
|
||||||
<template slot="append">%</template>
|
<template slot="append">%</template>
|
||||||
</el-input>
|
</el-input>
|
||||||
<div>消费笔数满足后切换到下一个支付通道</div>
|
<div>交易占比满足规则后切换到下一个支付通道</div>
|
||||||
</el-form-item>
|
|
||||||
<el-form-item label="参与次数" :label-width="formLabelWidth">
|
|
||||||
<el-radio-group v-model="form.resource" >
|
|
||||||
<el-radio label="不固定次数"></el-radio>
|
|
||||||
<el-radio label="固定次数"></el-radio>
|
|
||||||
</el-radio-group>
|
|
||||||
<div>是否限制当前配置在生效期间内的参与次数</div>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
|
<!-- <el-form-item label="参与次数" :label-width="formLabelWidth">-->
|
||||||
|
<!-- <el-radio-group v-model="form.resource" >-->
|
||||||
|
<!-- <el-radio label="不固定次数"></el-radio>-->
|
||||||
|
<!-- <el-radio label="固定次数"></el-radio>-->
|
||||||
|
<!-- </el-radio-group>-->
|
||||||
|
<!-- <div>是否限制当前配置在生效期间内的参与次数</div>-->
|
||||||
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
<el-form-item label="排序" :label-width="formLabelWidth">
|
<!-- <el-form-item label="排序" :label-width="formLabelWidth">-->
|
||||||
<el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>
|
<!-- <el-input-number v-model="form.num" controls-position="right" :min="1" :max="100"></el-input-number>-->
|
||||||
<div>数值越大顺序越在前</div>
|
<!-- <div>数值越大顺序越在前</div>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
|
|
||||||
</el-form>
|
</el-form>
|
||||||
@ -168,6 +170,8 @@ export default {
|
|||||||
merchantList:[],
|
merchantList:[],
|
||||||
// 商品规则配置信息
|
// 商品规则配置信息
|
||||||
oilConfigList:[],
|
oilConfigList:[],
|
||||||
|
// 规则周期
|
||||||
|
ruleCycle:"singleDay",
|
||||||
form: {
|
form: {
|
||||||
name: '',
|
name: '',
|
||||||
region: '',
|
region: '',
|
||||||
@ -179,11 +183,11 @@ export default {
|
|||||||
resource: '',
|
resource: '',
|
||||||
desc: ''
|
desc: ''
|
||||||
},
|
},
|
||||||
formLabelWidth: '120px',
|
formLabelWidth: '70px',
|
||||||
dialogFormVisible:false,
|
dialogFormVisible:false,
|
||||||
value:false,
|
value:false,
|
||||||
value1:true,
|
value1:true,
|
||||||
labelPosition: 'right',
|
labelPosition: 'singleDay',
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created() {
|
created() {
|
||||||
@ -197,12 +201,15 @@ export default {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
delOilConfig(id).then( response => {})
|
delOilConfig(id).then( response => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'success',
|
type: 'success',
|
||||||
message: '规则数据删除成功'
|
message: '规则数据删除成功'
|
||||||
});
|
});
|
||||||
this.getList();
|
this.getList();
|
||||||
|
this.value1 = true;
|
||||||
|
this.changeStatus1();
|
||||||
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
// 添加商户信息
|
// 添加商户信息
|
||||||
@ -270,20 +277,50 @@ export default {
|
|||||||
// 修改启用状态
|
// 修改启用状态
|
||||||
changeStatus(){
|
changeStatus(){
|
||||||
if (this.value){
|
if (this.value){
|
||||||
this.value1 = false;
|
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
isOpenOilConfig(1).then( response => {})
|
if (response.data!=1){
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||||
|
});
|
||||||
|
this.value = false;
|
||||||
|
this.value1 = true;
|
||||||
|
}else {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '发布成功!'
|
||||||
|
});
|
||||||
|
this.value1 = false;
|
||||||
|
}
|
||||||
|
})
|
||||||
}else {
|
}else {
|
||||||
this.value1 = true;
|
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
isOpenOilConfig(0).then( response => {})
|
this.value1 = true;
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
changeStatus1(){
|
changeStatus1(){
|
||||||
if (this.value1){
|
if (this.value1){
|
||||||
this.value = false;
|
isOpenOilConfig({isOpen:0,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
isOpenOilConfig(0).then( response => {})
|
this.value = false;
|
||||||
|
})
|
||||||
}else {
|
}else {
|
||||||
this.value = true;
|
isOpenOilConfig({isOpen:1,ruleCycle:this.ruleCycle}).then( response => {
|
||||||
isOpenOilConfig(1).then( response => {})
|
if (response.data!=1){
|
||||||
|
this.$message({
|
||||||
|
type: 'error',
|
||||||
|
message: '支付通道切换失败,请确保交易占比相加满足百分之百'
|
||||||
|
});
|
||||||
|
this.value = false;
|
||||||
|
this.value1 = true;
|
||||||
|
}else {
|
||||||
|
this.$message({
|
||||||
|
type: 'success',
|
||||||
|
message: '发布成功!'
|
||||||
|
});
|
||||||
|
this.value = true;
|
||||||
|
}
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 修改商户使用状态
|
// 修改商户使用状态
|
||||||
@ -294,12 +331,13 @@ export default {
|
|||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
data.isUse = isUse
|
data.isUse = isUse
|
||||||
editMerchant(data).then( response => {})
|
editMerchant(data).then( response => {
|
||||||
this.$message({
|
this.getList();
|
||||||
type: 'success',
|
this.$message({
|
||||||
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
|
type: 'success',
|
||||||
});
|
message: '支付通道切换成功,已实时切换为商户号('+data.mchntCd+')'
|
||||||
this.getList();
|
});
|
||||||
|
})
|
||||||
}).catch(() => {});
|
}).catch(() => {});
|
||||||
},
|
},
|
||||||
// 获取商户列表信息
|
// 获取商户列表信息
|
||||||
@ -323,10 +361,8 @@ export default {
|
|||||||
cancelButtonText: '取消',
|
cancelButtonText: '取消',
|
||||||
type: 'warning'
|
type: 'warning'
|
||||||
}).then(() => {
|
}).then(() => {
|
||||||
this.$message({
|
this.value1 = false;
|
||||||
type: 'success',
|
this.changeStatus1()
|
||||||
message: '发布成功!'
|
|
||||||
});
|
|
||||||
}).catch(() => {
|
}).catch(() => {
|
||||||
this.$message({
|
this.$message({
|
||||||
type: 'info',
|
type: 'info',
|
||||||
|
@ -642,7 +642,7 @@ export default {
|
|||||||
],
|
],
|
||||||
mobile: [
|
mobile: [
|
||||||
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
{ required: true, message: "手机号不能为空", trigger: "blur" },
|
||||||
{ min: 11, max: 20, message: '手机号长度必须11', trigger: 'blur' },
|
{ min: 6, max: 13, message: '手机号不正确', trigger: 'blur' }
|
||||||
],
|
],
|
||||||
roleId: [
|
roleId: [
|
||||||
{ required: true, message: "请选择员工角色", trigger: "blur" }
|
{ required: true, message: "请选择员工角色", trigger: "blur" }
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card class="card">
|
<el-card class="card">
|
||||||
<div slot="header" class="clearfix">
|
<div slot="header" class="clearfix">
|
||||||
<span>{{ store.oilStationName }}({{ store.description }})</span>
|
<span>{{ store.name }}{{store.description? "("+store.description+")":"" }}</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
|
<map-componment :pform="form" ref="mapRef" @pform="getForm"></map-componment>
|
||||||
@ -116,7 +116,9 @@ export default {
|
|||||||
this.form.lat = this.store.latitude;
|
this.form.lat = this.store.latitude;
|
||||||
this.form.lng = this.store.longitude;
|
this.form.lng = this.store.longitude;
|
||||||
this.form.address = this.store.address;
|
this.form.address = this.store.address;
|
||||||
this.welfare = this.store.welfare.split(",")
|
if (this.store.welfare!=null){
|
||||||
|
this.welfare = this.store.welfare.split(",")
|
||||||
|
}
|
||||||
this.$refs.mapRef.initAMap();
|
this.$refs.mapRef.initAMap();
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -157,17 +159,19 @@ export default {
|
|||||||
light: "#fff"//背景色
|
light: "#fff"//背景色
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//this.QRlink 生成的二维码地址url
|
if (this.qrcode.length > 0){
|
||||||
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
|
//this.QRlink 生成的二维码地址url
|
||||||
if (err) throw err
|
QRCode.toDataURL(this.qrcode[0].collection, opts , (err, url) => {
|
||||||
//将生成的二维码路径复制给data的QRImgUrl
|
if (err) throw err
|
||||||
this.collectionImg= url
|
//将生成的二维码路径复制给data的QRImgUrl
|
||||||
})
|
this.collectionImg= url
|
||||||
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
|
})
|
||||||
if (err) throw err
|
QRCode.toDataURL(this.qrcode[0].payment, opts , (err, url) => {
|
||||||
//将生成的二维码路径复制给data的QRImgUrl
|
if (err) throw err
|
||||||
this.paymentImg= url
|
//将生成的二维码路径复制给data的QRImgUrl
|
||||||
})
|
this.paymentImg= url
|
||||||
|
})
|
||||||
|
}
|
||||||
},
|
},
|
||||||
// 根据dom生成图片并下载到本地
|
// 根据dom生成图片并下载到本地
|
||||||
handleDownloadqrCode(id) {
|
handleDownloadqrCode(id) {
|
||||||
|
@ -456,6 +456,8 @@ export default {
|
|||||||
return {
|
return {
|
||||||
level1:true,
|
level1:true,
|
||||||
level2:false,
|
level2:false,
|
||||||
|
// 是否开启等级功能
|
||||||
|
isEnableLevel:"",
|
||||||
// 优惠值
|
// 优惠值
|
||||||
gasolinePreferential:[
|
gasolinePreferential:[
|
||||||
{
|
{
|
||||||
@ -564,16 +566,21 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
this.getClearConfig();
|
this.getClearConfig();
|
||||||
this.getRule();
|
this.getRule();
|
||||||
|
this.getISEnableLevel();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
checkName(rule, value, callback){
|
// 是否开启等级功能
|
||||||
queryUserGrade({name:this.form.name}).then( response => {
|
getISEnableLevel(){
|
||||||
if(response.data!=null){
|
getSysConfig('is_enable_level').then(response => {
|
||||||
callback(new Error("会员等级名称已存在"))
|
this.isEnableLevel = response.data
|
||||||
|
if (response.data=="no"){
|
||||||
|
this.level1 = true;
|
||||||
|
this.level2 = false;
|
||||||
}else {
|
}else {
|
||||||
callback();
|
this.level1 = false;
|
||||||
|
this.level2 = true;
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
},
|
},
|
||||||
editLevel1(){
|
editLevel1(){
|
||||||
this.level1 = false;
|
this.level1 = false;
|
||||||
@ -744,7 +751,7 @@ export default {
|
|||||||
this.reset();
|
this.reset();
|
||||||
},
|
},
|
||||||
// 提交按钮
|
// 提交按钮
|
||||||
submitForm: function() {
|
submitForm() {
|
||||||
this.$refs["form"].validate(valid => {
|
this.$refs["form"].validate(valid => {
|
||||||
if (valid) {
|
if (valid) {
|
||||||
this.form.gasolineRule = JSON.stringify(this.gasolinePreferential)
|
this.form.gasolineRule = JSON.stringify(this.gasolinePreferential)
|
||||||
@ -761,19 +768,17 @@ export default {
|
|||||||
if(response.data!=null){
|
if(response.data!=null){
|
||||||
this.$modal.msgError("会员等级名称已存在");
|
this.$modal.msgError("会员等级名称已存在");
|
||||||
}else {
|
}else {
|
||||||
addUserGrade(this.form).then(response => {
|
addUserGrade(this.form).then(res => {
|
||||||
this.$modal.msgSuccess("新增成功");
|
if (res.data==1){
|
||||||
this.open = false;
|
this.$modal.msgSuccess("新增成功");
|
||||||
this.getList();
|
this.open = false;
|
||||||
|
this.getList();
|
||||||
|
}else {
|
||||||
|
this.$modal.msgError("新增失败,最多支持20个等级");
|
||||||
|
}
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
// saveUserGrade(this.form).then(response => {
|
|
||||||
// this.$modal.msgSuccess("新增成功");
|
|
||||||
// this.open = false;
|
|
||||||
// this.getList();
|
|
||||||
// });
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
@ -10,6 +10,8 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 支付配置信息 controller层
|
* 支付配置信息 controller层
|
||||||
*/
|
*/
|
||||||
@ -32,17 +34,28 @@ public class OilConfigController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 查看支付配置规则是否开启
|
* 查看支付配置规则是否开启
|
||||||
* @param isOpen
|
* @param map
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/{isOpen}")
|
@PostMapping("/isOpen")
|
||||||
public ResponseObject isOpen(@PathVariable String isOpen){
|
public ResponseObject isOpen(@Validated @RequestBody Map<String,String> map){
|
||||||
|
String isOpen = map.get("isOpen");
|
||||||
|
String ruleCycle = map.get("ruleCycle");
|
||||||
|
// 2 代表不启用规则
|
||||||
|
int result = 2;
|
||||||
|
// isOpen=1开启规则
|
||||||
if (isOpen.equals("1")){
|
if (isOpen.equals("1")){
|
||||||
oilConfigService.oilRule();
|
result = oilConfigService.judgmentProportion();
|
||||||
|
if (result==1){
|
||||||
|
oilConfigService.oilRule();
|
||||||
|
// 开启定时关闭规则
|
||||||
|
oilConfigService.ruleCycle(ruleCycle);
|
||||||
|
}
|
||||||
}else {
|
}else {
|
||||||
|
// 不开启规则
|
||||||
merchantConfigService.updateMerchIsOpen("0");
|
merchantConfigService.updateMerchIsOpen("0");
|
||||||
}
|
}
|
||||||
return getSuccessResult(0);
|
return getSuccessResult(result);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -38,6 +38,10 @@ public class OilConfig extends BaseEntity implements Serializable {
|
|||||||
* 交易占比
|
* 交易占比
|
||||||
*/
|
*/
|
||||||
private Integer proportion;
|
private Integer proportion;
|
||||||
|
/**
|
||||||
|
* 规则周期
|
||||||
|
*/
|
||||||
|
private String ruleCycle;
|
||||||
/**
|
/**
|
||||||
* key值
|
* key值
|
||||||
*/
|
*/
|
||||||
|
@ -15,6 +15,17 @@ public interface OilConfigService extends IService<OilConfig> {
|
|||||||
*/
|
*/
|
||||||
public void oilRule();
|
public void oilRule();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 判断占比相加是否为100% 是返回1 不是返回0
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public int judgmentProportion();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 规则周期是否为当日
|
||||||
|
*/
|
||||||
|
public void ruleCycle(String ruleCycle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 查询油品配置信息
|
* 查询油品配置信息
|
||||||
* @return
|
* @return
|
||||||
|
@ -12,6 +12,7 @@ import com.fuint.api.fuyou.vo.OilConfigVo;
|
|||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.config.ScheduledTaskRegistrar;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@ -59,6 +60,28 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
|
|||||||
merchantConfigService.updateMerch(merchantConfig);
|
merchantConfigService.updateMerch(merchantConfig);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int judgmentProportion() {
|
||||||
|
int result = 0;
|
||||||
|
int percentage = 0;
|
||||||
|
List<OilConfig> list = baseMapper.selectList(null);
|
||||||
|
for (OilConfig config : list) {
|
||||||
|
percentage += config.getProportion();
|
||||||
|
}
|
||||||
|
if (percentage==100){
|
||||||
|
result = 1;
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void ruleCycle(String ruleCycle) {
|
||||||
|
// 如果是单日的话则开启定时任务
|
||||||
|
if (ruleCycle.equals("singleDay")){
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<OilConfigVo> selectOilConfigList() {
|
public List<OilConfigVo> selectOilConfigList() {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
@ -0,0 +1,17 @@
|
|||||||
|
package com.fuint.api.fuyou.util;
|
||||||
|
|
||||||
|
import com.fuint.api.fuyou.service.MerchantConfigService;
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.scheduling.annotation.Scheduled;
|
||||||
|
import org.springframework.stereotype.Component;
|
||||||
|
|
||||||
|
@Component
|
||||||
|
public class SchudelUtil {
|
||||||
|
@Autowired
|
||||||
|
private MerchantConfigService merchantConfigService;
|
||||||
|
|
||||||
|
@Scheduled(fixedDelay=86400000)
|
||||||
|
public void teak1(){
|
||||||
|
merchantConfigService.updateMerchIsOpen("0");
|
||||||
|
}
|
||||||
|
}
|
@ -32,14 +32,16 @@ public class StaffCommissionServiceImpl extends ServiceImpl<StaffCommissionMappe
|
|||||||
commission.setStoreId(storeId);
|
commission.setStoreId(storeId);
|
||||||
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
IPage<StaffCommission> staffCommissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||||
for (StaffCommission record : staffCommissionIPage.getRecords()) {
|
for (StaffCommission record : staffCommissionIPage.getRecords()) {
|
||||||
String substring = record.getTakeEffect().substring(24, 43);
|
if (record.getTakeEffect()!=null && record.getTakeEffect().equals("")){
|
||||||
Date date = new Date();
|
String substring = record.getTakeEffect().substring(24, 43);
|
||||||
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
Date date = new Date();
|
||||||
String now = dateFormat.format(date);
|
SimpleDateFormat dateFormat= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
int row = substring.compareTo(now);
|
String now = dateFormat.format(date);
|
||||||
if (row == -1){
|
int row = substring.compareTo(now);
|
||||||
record.setStatus("jy");
|
if (row == -1){
|
||||||
baseMapper.updateById(record);
|
record.setStatus("jy");
|
||||||
|
baseMapper.updateById(record);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
|
IPage<StaffCommission> commissionIPage = baseMapper.selectCommissionList(page, commission);
|
||||||
|
@ -9,6 +9,9 @@
|
|||||||
<include refid="selectOrders"></include>
|
<include refid="selectOrders"></include>
|
||||||
<where>
|
<where>
|
||||||
store_id = #{order.storeId}
|
store_id = #{order.storeId}
|
||||||
|
<if test="order.userId != null and order.userId != ''">
|
||||||
|
and user_id = #{order.userId}
|
||||||
|
</if>
|
||||||
<if test="order.staffId != null and order.staffId != ''">
|
<if test="order.staffId != null and order.staffId != ''">
|
||||||
and staff_id = #{order.staffId}
|
and staff_id = #{order.staffId}
|
||||||
</if>
|
</if>
|
||||||
|
@ -147,7 +147,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
|
|
||||||
// 支付状态
|
// 支付状态
|
||||||
String payStatus = "unpaid";
|
String payStatus = "unpaid";
|
||||||
if (payType.equals("CASH")){
|
if (payType.equals("CASH") && map.get("allAmount").equals("0")){
|
||||||
payStatus = "paid";
|
payStatus = "paid";
|
||||||
}else {
|
}else {
|
||||||
payStatus = "unpaid";
|
payStatus = "unpaid";
|
||||||
|
@ -3,13 +3,15 @@
|
|||||||
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
|
<mapper namespace="com.fuint.business.userManager.mapper.LJUserMapper">
|
||||||
<sql id="selectUser">
|
<sql id="selectUser">
|
||||||
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu
|
select mu.*,mub.card_balance,mub.points,mub.growth_value,mub.refuel_money from mt_user mu
|
||||||
inner join mt_user_balance mub on mu.id = mub.mt_user_id
|
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||||
</sql>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||||
<include refid="selectUser"></include>
|
<include refid="selectUser"></include>
|
||||||
<where>
|
<where>
|
||||||
mu.store_id = #{user.storeId}
|
<if test="user.storeId != null and user.storeId != ''">
|
||||||
|
and mu.store_id = #{user.storeId}
|
||||||
|
</if>
|
||||||
<if test="user.mobile != null and user.mobile != ''">
|
<if test="user.mobile != null and user.mobile != ''">
|
||||||
and mu.mobile like concat('%', #{user.mobile}, '%')
|
and mu.mobile like concat('%', #{user.mobile}, '%')
|
||||||
</if>
|
</if>
|
||||||
@ -26,10 +28,10 @@
|
|||||||
and mu.official = #{user.official}
|
and mu.official = #{user.official}
|
||||||
</if>
|
</if>
|
||||||
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2">
|
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 2">
|
||||||
and mub.cardBalance = 0
|
and mub.card_balance = 0
|
||||||
</if>
|
</if>
|
||||||
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1">
|
<if test="user.cardBalance != null and user.cardBalance != '' and user.cardBalance == 1">
|
||||||
and mub.cardBalance != 0
|
and mub.card_balance != 0
|
||||||
</if>
|
</if>
|
||||||
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
<if test="user.params.beginTime != null and user.params.beginTime != ''"><!-- 开始时间检索 -->
|
||||||
and date_format(mu.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
|
and date_format(mu.create_time,'%y%m%d') >= date_format(#{user.params.beginTime},'%y%m%d')
|
||||||
|
@ -59,7 +59,16 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int insertUserGrade(LJUserGrade userGrade) {
|
public int insertUserGrade(LJUserGrade userGrade) {
|
||||||
int row = baseMapper.insert(userGrade);
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
|
Integer storeId = nowAccountInfo.getStoreId();
|
||||||
|
Integer num = baseMapper.selectCount(null);
|
||||||
|
int row = 0;
|
||||||
|
if (num<20){
|
||||||
|
userGrade.setStoreId(storeId);
|
||||||
|
row = baseMapper.insert(userGrade);
|
||||||
|
}else {
|
||||||
|
row = 0;
|
||||||
|
}
|
||||||
return row;
|
return row;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -37,9 +37,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user) {
|
public IPage<LJUserVo> selectUserList(Page page, LJUserVo user) {
|
||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
// AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
Integer storeId = nowAccountInfo.getStoreId();
|
// Integer storeId = nowAccountInfo.getStoreId();
|
||||||
user.setStoreId(storeId);
|
// user.setStoreId(storeId);
|
||||||
IPage<LJUserVo> ljUserIPage = baseMapper.selectUserList(page, user);
|
IPage<LJUserVo> ljUserIPage = baseMapper.selectUserList(page, user);
|
||||||
return ljUserIPage;
|
return ljUserIPage;
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@
|
|||||||
<div class="bottom-price">¥{{ oilActualPay + goodsActualPay }}</div>
|
<div class="bottom-price">¥{{ oilActualPay + goodsActualPay }}</div>
|
||||||
<div class="price-red">优惠合计:{{ oilDiscount + goodsDiscount }}元/{{consumeRefuelMoney}}L</div>
|
<div class="price-red">优惠合计:{{ oilDiscount + goodsDiscount }}元/{{consumeRefuelMoney}}L</div>
|
||||||
</div>
|
</div>
|
||||||
<el-button class="center-left-lv" :disabled="(oilActualPay + goodsActualPay)==0" @click="settlement">立即结算</el-button>
|
<el-button class="center-left-lv" :disabled="(oilAmount + goodsAmount)==0" @click="settlement">立即结算</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -789,6 +789,7 @@
|
|||||||
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
|
import {selectCoupon, selectPreferential} from "@/api/cashier/preferential";
|
||||||
import {addHangBill} from "@/api/cashier/hangbill";
|
import {addHangBill} from "@/api/cashier/hangbill";
|
||||||
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
|
import {addCreditUnit, listCreditUnit} from "@/api/cashier/creditunit";
|
||||||
|
import {getSysConfig} from "@/api/staff/user/sysconfig";
|
||||||
|
|
||||||
const cityOptions = ['上海', '北京'];
|
const cityOptions = ['上海', '北京'];
|
||||||
export default {
|
export default {
|
||||||
@ -808,7 +809,7 @@
|
|||||||
cities2: cityOptions,
|
cities2: cityOptions,
|
||||||
gradeDiscount: [],
|
gradeDiscount: [],
|
||||||
// 囤油卡全选
|
// 囤油卡全选
|
||||||
checkAll3: true,
|
checkAll3: false,
|
||||||
isIndeterminate3: true,
|
isIndeterminate3: true,
|
||||||
checkedCities3: [],
|
checkedCities3: [],
|
||||||
cities3: cityOptions,
|
cities3: cityOptions,
|
||||||
@ -863,8 +864,10 @@
|
|||||||
oilActualPay:0,
|
oilActualPay:0,
|
||||||
// 油品优惠金额
|
// 油品优惠金额
|
||||||
oilDiscount:0,
|
oilDiscount:0,
|
||||||
// 囤油卡消费金额
|
// 扣除升数后需要消费的金额
|
||||||
hoardAmount:0,
|
hoardAmount:0,
|
||||||
|
// 是否使用囤油卡
|
||||||
|
isOilStorageCard:false,
|
||||||
// 商品优惠金额
|
// 商品优惠金额
|
||||||
goodsDiscount:0,
|
goodsDiscount:0,
|
||||||
// 商品实付金额
|
// 商品实付金额
|
||||||
@ -954,7 +957,7 @@
|
|||||||
// 优惠券id
|
// 优惠券id
|
||||||
couponIds:[],
|
couponIds:[],
|
||||||
// 使用的优惠券id
|
// 使用的优惠券id
|
||||||
useCouponIds:[],
|
useCouponIds:"",
|
||||||
map:{
|
map:{
|
||||||
allAmount:0,
|
allAmount:0,
|
||||||
// 用户支付条码信息
|
// 用户支付条码信息
|
||||||
@ -1194,7 +1197,7 @@
|
|||||||
if (val){
|
if (val){
|
||||||
this.fullReduction = 0;
|
this.fullReduction = 0;
|
||||||
this.fullReduceDiscount.forEach(item => {
|
this.fullReduceDiscount.forEach(item => {
|
||||||
this.fullReduction += item.reduce
|
this.fullReduction += +item.reduce
|
||||||
})
|
})
|
||||||
this.isUseFull = false;
|
this.isUseFull = false;
|
||||||
}else {
|
}else {
|
||||||
@ -1214,7 +1217,7 @@
|
|||||||
reduces = item.reduce
|
reduces = item.reduce
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.fullReduction += reduces
|
this.fullReduction += +reduces
|
||||||
})
|
})
|
||||||
let checkedCount = value.length;
|
let checkedCount = value.length;
|
||||||
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
|
this.checkAll1 = checkedCount === this.fullReduceDiscount.length;
|
||||||
@ -1256,8 +1259,10 @@
|
|||||||
handleCheckAllChange3(val) {
|
handleCheckAllChange3(val) {
|
||||||
if (val==false){
|
if (val==false){
|
||||||
this.consumeRefuelMoney = 0;
|
this.consumeRefuelMoney = 0;
|
||||||
this.hoardAmount = 0;
|
// this.hoardAmount = 0;
|
||||||
|
this.isOilStorageCard = false;
|
||||||
}else {
|
}else {
|
||||||
|
this.isOilStorageCard = true;
|
||||||
this.changeRefuelMoney()
|
this.changeRefuelMoney()
|
||||||
}
|
}
|
||||||
this.isExclusion();
|
this.isExclusion();
|
||||||
@ -1363,9 +1368,9 @@
|
|||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
num += item.num;
|
num += item.num;
|
||||||
if (_this.isMember){
|
if (_this.isMember){
|
||||||
amount += item.memberPrice;
|
amount += +item.memberPrice;
|
||||||
}else {
|
}else {
|
||||||
amount += item.retailPrice;
|
amount += +item.retailPrice;
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.goodsTotal = num;
|
this.goodsTotal = num;
|
||||||
@ -1414,231 +1419,235 @@
|
|||||||
let _this = this;
|
let _this = this;
|
||||||
this.oilDiscount = 0;
|
this.oilDiscount = 0;
|
||||||
this.gradeDiscount = [];
|
this.gradeDiscount = [];
|
||||||
getUserGrade(id).then( response => {
|
getSysConfig('is_enable_level').then(res => {
|
||||||
let gasolineDiscount = 0;
|
if (res.data=="yes") {
|
||||||
let dieselDiscount = 0;
|
getUserGrade(id).then(response => {
|
||||||
let naturalGasDiscount = 0;
|
let gasolineDiscount = 0;
|
||||||
_this.gradeDiscount = [];
|
let dieselDiscount = 0;
|
||||||
_this.oilOrder.forEach(item => {
|
let naturalGasDiscount = 0;
|
||||||
let discount = {type:"",full:0,reduce:0,liters:0}
|
_this.gradeDiscount = [];
|
||||||
if (item.type == "汽油"){
|
_this.oilOrder.forEach(item => {
|
||||||
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
if (item.type == "汽油") {
|
||||||
if (response.data.gasolineDiscount=="满减优惠"){
|
let gasolineRule = JSON.parse(response.data.gasolineRule);
|
||||||
let oilDiscount = 0;
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
discount.type = "满减优惠"
|
if (response.data.gasolineDiscount == "满减优惠") {
|
||||||
for (let i = 1; i <= gasolineRule.length; i++){
|
let oilDiscount = 0;
|
||||||
// 将满减条件加入等级优惠列表
|
discount.type = "满减优惠"
|
||||||
if (gasolineRule.length>1){
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
// 将满减条件加入等级优惠列表
|
||||||
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1
|
if (gasolineRule.length > 1) {
|
||||||
oilDiscount = gasolineRule[gasolineRule.length-1].gasolineRule2
|
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||||
discount.reduce = gasolineRule[gasolineRule.length-1].gasolineRule2
|
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||||
break;
|
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||||
|
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||||
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
|
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
|
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
|
if (discount.reduce != 0) {
|
||||||
discount.full = gasolineRule[i-1].gasolineRule1
|
_this.gradeDiscount.push(discount)
|
||||||
oilDiscount = gasolineRule[i-1].gasolineRule2
|
_this.checkedCities2.push('满减优惠')
|
||||||
discount.reduce = gasolineRule[i-1].gasolineRule2
|
|
||||||
}
|
}
|
||||||
}else {
|
gasolineDiscount += +oilDiscount
|
||||||
if (item.amount >= gasolineRule[i-1].gasolineRule1){
|
} else if (response.data.gasolineDiscount == "每升优惠") {
|
||||||
discount.full = gasolineRule[i-1].gasolineRule1
|
discount.type = "每升优惠"
|
||||||
oilDiscount = gasolineRule[i-1].gasolineRule2
|
let oilDiscount = 0;
|
||||||
discount.reduce = gasolineRule[i-1].gasolineRule2
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
|
// 将满减条件加入等级优惠列表
|
||||||
|
if (gasolineRule.length > 1) {
|
||||||
|
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||||
|
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||||
|
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||||
|
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||||
|
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||||
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
|
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
|
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
|
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
|
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (discount.reduce != 0) {
|
||||||
|
_this.gradeDiscount.push(discount)
|
||||||
|
_this.checkedCities2.push('每升优惠')
|
||||||
|
}
|
||||||
|
gasolineDiscount += +oilDiscount
|
||||||
|
} else {
|
||||||
|
gasolineDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
gasolineDiscount += +oilDiscount
|
|
||||||
}else if (response.data.gasolineDiscount=="每升优惠"){
|
|
||||||
discount.type = "每升优惠"
|
|
||||||
let oilDiscount = 0;
|
|
||||||
for (let i = 1; i <= gasolineRule.length; i++){
|
|
||||||
// 将满减条件加入等级优惠列表
|
|
||||||
if (gasolineRule.length>1){
|
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
|
||||||
discount.full = gasolineRule[gasolineRule.length-1].gasolineRule1
|
|
||||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
|
|
||||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2);
|
|
||||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (item.amount >= gasolineRule[i-1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1){
|
|
||||||
discount.full = gasolineRule[i-1].gasolineRule1
|
|
||||||
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
|
||||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (item.amount >= gasolineRule[i-1].gasolineRule1){
|
|
||||||
discount.full = gasolineRule[i-1].gasolineRule1
|
|
||||||
oilDiscount = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * gasolineRule[i-1].gasolineRule3).toFixed(2)
|
|
||||||
discount.liters = gasolineRule[i-1].gasolineRule3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('每升优惠')
|
|
||||||
}
|
|
||||||
gasolineDiscount += +oilDiscount
|
|
||||||
}else {
|
|
||||||
gasolineDiscount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
if (item.type == "柴油") {
|
||||||
}
|
let dieselRule = JSON.parse(response.data.dieselRule);
|
||||||
if (item.type == "柴油"){
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
let dieselRule = JSON.parse(response.data.dieselRule);
|
if (response.data.dieselDiscount == "满减优惠") {
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
let oilDiscount = 0;
|
||||||
if (response.data.dieselDiscount=="满减优惠"){
|
discount.type = "满减优惠"
|
||||||
let oilDiscount = 0;
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
discount.type = "满减优惠"
|
// 将满减条件加入等级优惠列表
|
||||||
for (let i = 1; i <= dieselRule.length; i++){
|
if (dieselRule.length > 1) {
|
||||||
// 将满减条件加入等级优惠列表
|
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||||
if (dieselRule.length>1){
|
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||||
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
|
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||||
discount.full = dieselRule[dieselRule.length-1].dieselRule1
|
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||||
oilDiscount = dieselRule[dieselRule.length-1].dieselRule2
|
break;
|
||||||
discount.reduce = dieselRule[dieselRule.length-1].dieselRule2
|
}
|
||||||
break;
|
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||||
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
|
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||||
|
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
|
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||||
|
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
|
if (discount.reduce != 0) {
|
||||||
discount.full = dieselRule[i-1].dieselRule1
|
_this.gradeDiscount.push(discount)
|
||||||
oilDiscount = dieselRule[i-1].dieselRule2
|
_this.checkedCities2.push('满减优惠')
|
||||||
discount.reduce = dieselRule[i-1].dieselRule2
|
|
||||||
}
|
}
|
||||||
}else {
|
dieselDiscount += +oilDiscount
|
||||||
discount.full = dieselRule[i-1].dieselRule1
|
} else if (response.data.dieselDiscount == "每升优惠") {
|
||||||
if (item.amount >= dieselRule[i-1].dieselRule1){
|
let oilDiscount = 0;
|
||||||
oilDiscount = dieselRule[i-1].dieselRule2
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
discount.reduce = dieselRule[i-1].dieselRule2
|
discount.type = "每升优惠"
|
||||||
|
// 将满减条件加入等级优惠列表
|
||||||
|
if (dieselRule.length > 1) {
|
||||||
|
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||||
|
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||||
|
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||||
|
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||||
|
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||||
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
|
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
|
discount.liters = dieselRule[i - 1].dieselRule3
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
|
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
|
discount.liters = dieselRule[i - 1].dieselRule3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (discount.reduce != 0) {
|
||||||
|
_this.gradeDiscount.push(discount)
|
||||||
|
_this.checkedCities2.push('每升优惠')
|
||||||
|
}
|
||||||
|
dieselDiscount += +oilDiscount
|
||||||
|
} else {
|
||||||
|
dieselDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
dieselDiscount += +oilDiscount
|
|
||||||
}else if (response.data.dieselDiscount=="每升优惠"){
|
|
||||||
let oilDiscount = 0;
|
|
||||||
for (let i = 1; i <= dieselRule.length; i++){
|
|
||||||
discount.type = "每升优惠"
|
|
||||||
// 将满减条件加入等级优惠列表
|
|
||||||
if (dieselRule.length>1){
|
|
||||||
if (item.amount >= dieselRule[dieselRule.length-1].dieselRule1){
|
|
||||||
discount.full = dieselRule[dieselRule.length-1].dieselRule1
|
|
||||||
oilDiscount = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
|
|
||||||
discount.reduce = (item.liters * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2);
|
|
||||||
discount.liters = dieselRule[dieselRule.length-1].dieselRule3
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (item.amount >= dieselRule[i-1].dieselRule1 && item.amount < dieselRule[i].dieselRule1){
|
|
||||||
discount.full = dieselRule[i-1].dieselRule1
|
|
||||||
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
|
||||||
discount.liters = dieselRule[i-1].dieselRule3
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
discount.full = dieselRule[i-1].dieselRule1
|
|
||||||
if (item.amount >= dieselRule[i-1].dieselRule1){
|
|
||||||
oilDiscount = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * dieselRule[i-1].dieselRule3).toFixed(2)
|
|
||||||
discount.liters = dieselRule[i-1].dieselRule3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('每升优惠')
|
|
||||||
}
|
|
||||||
dieselDiscount += +oilDiscount
|
|
||||||
}else {
|
|
||||||
dieselDiscount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
if (item.type == "天然气") {
|
||||||
}
|
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
||||||
if (item.type == "天然气"){
|
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule);
|
if (response.data.naturalGasDiscount == "满减优惠") {
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy'){
|
let oilDiscount = 0;
|
||||||
if (response.data.naturalGasDiscount=="满减优惠"){
|
discount.type = "满减优惠"
|
||||||
let oilDiscount = 0;
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
discount.type = "满减优惠"
|
// 将满减条件加入等级优惠列表
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++){
|
if (naturalGasRule.length > 1) {
|
||||||
// 将满减条件加入等级优惠列表
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||||
if (naturalGasRule.length>1){
|
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||||
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1
|
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||||
oilDiscount = naturalGasRule[naturalGasRule.length-1].naturalGasRule2;
|
break;
|
||||||
discount.reduce = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
}
|
||||||
break;
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||||
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
|
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||||
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
|
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
|
if (discount.reduce != 0) {
|
||||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
_this.gradeDiscount.push(discount)
|
||||||
oilDiscount = naturalGasRule[i-1].naturalGasRule2
|
_this.checkedCities2.push('满减优惠')
|
||||||
discount.reduce = naturalGasRule[i-1].naturalGasRule2
|
|
||||||
}
|
}
|
||||||
}else {
|
naturalGasDiscount += +oilDiscount
|
||||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
|
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
||||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
let oilDiscount = 0;
|
||||||
oilDiscount = naturalGasRule[i-1].naturalGasRule2
|
discount.type = "每单位优惠"
|
||||||
discount.reduce = naturalGasRule[i-1].naturalGasRule2
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
|
// 将满减条件加入等级优惠列表
|
||||||
|
if (naturalGasRule.length > 1) {
|
||||||
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||||
|
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||||
|
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||||
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||||
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
|
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
if (discount.reduce != 0) {
|
||||||
|
_this.gradeDiscount.push(discount)
|
||||||
|
_this.checkedCities2.push('每单位优惠')
|
||||||
|
}
|
||||||
|
naturalGasDiscount += +oilDiscount
|
||||||
|
} else {
|
||||||
|
naturalGasDiscount = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('满减优惠')
|
|
||||||
}
|
|
||||||
naturalGasDiscount += +oilDiscount
|
|
||||||
}else if (response.data.naturalGasDiscount=="每单位优惠"){
|
|
||||||
let oilDiscount = 0;
|
|
||||||
discount.type = "每单位优惠"
|
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++){
|
|
||||||
// 将满减条件加入等级优惠列表
|
|
||||||
if (naturalGasRule.length>1){
|
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
|
||||||
discount.full = naturalGasRule[naturalGasRule.length-1].naturalGasRule1
|
|
||||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.liters = naturalGasRule[naturalGasRule.length-1].naturalGasRule3
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1){
|
|
||||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
|
||||||
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.liters = naturalGasRule[i-1].naturalGasRule3
|
|
||||||
}
|
|
||||||
}else {
|
|
||||||
if (item.amount >= naturalGasRule[i-1].naturalGasRule1){
|
|
||||||
discount.full = naturalGasRule[i-1].naturalGasRule1
|
|
||||||
oilDiscount = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * naturalGasRule[i-1].naturalGasRule3).toFixed(2)
|
|
||||||
discount.liters = naturalGasRule[i-1].naturalGasRule3
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if (discount.reduce!=0){
|
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('每单位优惠')
|
|
||||||
}
|
|
||||||
naturalGasDiscount += +oilDiscount
|
|
||||||
}else {
|
|
||||||
naturalGasDiscount = 0;
|
|
||||||
}
|
}
|
||||||
}
|
})
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
_this.oilDiscount = gasolineDiscount + dieselDiscount + naturalGasDiscount
|
||||||
_this.checkAll2 = true;
|
_this.checkAll2 = true;
|
||||||
_this.isExclusion();
|
_this.isExclusion();
|
||||||
|
})
|
||||||
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 选择会员
|
// 选择会员
|
||||||
@ -1748,15 +1757,29 @@
|
|||||||
})
|
})
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
|
// 使用囤油卡 囤油卡不参与任何优惠
|
||||||
|
countOilCard(){
|
||||||
|
if (this.hoardAmount!=0){
|
||||||
|
if (this.balance!=0 && this.balance >= (this.oilAmount - this.hoardAmount)){
|
||||||
|
this.oilActualPay = 0
|
||||||
|
this.consumeAmount = this.hoardAmount
|
||||||
|
}else {
|
||||||
|
this.oilActualPay = this.oilAmount - this.hoardAmount -this.balance
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
this.oilActualPay = 0
|
||||||
|
this.consumeAmount = 0
|
||||||
|
}
|
||||||
|
},
|
||||||
// 使用优惠券不使用满减
|
// 使用优惠券不使用满减
|
||||||
countAmountFull(){
|
countAmountFull(){
|
||||||
if (this.isMember){
|
if (this.isMember){
|
||||||
// 满减互斥
|
// 满减互斥
|
||||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
|
if (this.balance >= (this.oilAmount - this.oilDiscount - this.couponAmount)){
|
||||||
this.oilActualPay = 0
|
this.oilActualPay = 0
|
||||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount - this.hoardAmount
|
this.consumeAmount = this.oilAmount - this.oilDiscount - this.couponAmount
|
||||||
}else {
|
}else {
|
||||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount - this.hoardAmount
|
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.couponAmount
|
||||||
this.consumeAmount = this.balance
|
this.consumeAmount = this.balance
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
@ -1766,7 +1789,7 @@
|
|||||||
// 使用优惠券和满减不使用储值卡
|
// 使用优惠券和满减不使用储值卡
|
||||||
countAmountUnBalance(){
|
countAmountUnBalance(){
|
||||||
if (this.isMember){
|
if (this.isMember){
|
||||||
this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount - this.hoardAmount
|
this.oilActualPay = this.oilAmount - this.fullReduction - this.oilDiscount - this.couponAmount
|
||||||
}else {
|
}else {
|
||||||
this.oilActualPay = this.oilAmount - this.oilDiscount
|
this.oilActualPay = this.oilAmount - this.oilDiscount
|
||||||
}
|
}
|
||||||
@ -1777,9 +1800,9 @@
|
|||||||
if (this.isMember){
|
if (this.isMember){
|
||||||
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
|
if (this.balance >= (this.oilAmount - this.oilDiscount - this.fullReduction)){
|
||||||
this.oilActualPay = 0
|
this.oilActualPay = 0
|
||||||
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction - this.hoardAmount
|
this.consumeAmount = this.oilAmount - this.oilDiscount - this.fullReduction
|
||||||
}else {
|
}else {
|
||||||
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction - this.hoardAmount
|
this.oilActualPay = this.oilAmount -this.balance - this.oilDiscount - this.fullReduction
|
||||||
this.consumeAmount = this.balance
|
this.consumeAmount = this.balance
|
||||||
}
|
}
|
||||||
}else {
|
}else {
|
||||||
@ -1828,6 +1851,18 @@
|
|||||||
this.countAmountFull()
|
this.countAmountFull()
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
// 使用囤油卡
|
||||||
|
if (this.isOilStorageCard){
|
||||||
|
this.checkAll1 = false;
|
||||||
|
this.fullReduction = 0;
|
||||||
|
this.checkAll2 = false;
|
||||||
|
this.checkedCities2 = [],
|
||||||
|
this.oilDiscount = 0;
|
||||||
|
this.checkAll5 = false;
|
||||||
|
this.couponAmount = 0;
|
||||||
|
this.countOilCard();
|
||||||
|
return;
|
||||||
|
}
|
||||||
this.countAmountBalance();
|
this.countAmountBalance();
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -1845,7 +1880,7 @@
|
|||||||
if (response.data.length>0){
|
if (response.data.length>0){
|
||||||
_this.fullReduceDiscount = []
|
_this.fullReduceDiscount = []
|
||||||
response.data.forEach(item => {
|
response.data.forEach(item => {
|
||||||
let discount = {type:item.name,full:0,reduce:0,discount:0}
|
let discount = {type:item.name,full:0,reduce:0,discount:0,exclusion:item.participationCondition}
|
||||||
let activeList = item.activeDiscountChildList;
|
let activeList = item.activeDiscountChildList;
|
||||||
for (let i = 1;i<=activeList.length;i++){
|
for (let i = 1;i<=activeList.length;i++){
|
||||||
if (activeList.length>0){
|
if (activeList.length>0){
|
||||||
@ -1927,9 +1962,9 @@
|
|||||||
let amount = 0;
|
let amount = 0;
|
||||||
for (let i = 0; i<goods.length; i++){
|
for (let i = 0; i<goods.length; i++){
|
||||||
if (_this.isMember){
|
if (_this.isMember){
|
||||||
amount += (goods[i].memberPrice * goods[i].num).toFixed(2)
|
amount += +(goods[i].memberPrice * goods[i].num).toFixed(2)
|
||||||
}else {
|
}else {
|
||||||
amount += (goods[i].retailPrice * goods[i].num).toFixed(2)
|
amount += +(goods[i].retailPrice * goods[i].num).toFixed(2)
|
||||||
}
|
}
|
||||||
if (goods[i].id == val.id){
|
if (goods[i].id == val.id){
|
||||||
goods[i].num = goods[i].num + 1;
|
goods[i].num = goods[i].num + 1;
|
||||||
@ -1948,9 +1983,9 @@
|
|||||||
if (result){
|
if (result){
|
||||||
val.num = 1;
|
val.num = 1;
|
||||||
if (_this.isMember){
|
if (_this.isMember){
|
||||||
this.goodsAmount += val.memberPrice
|
this.goodsAmount += +val.memberPrice
|
||||||
}else {
|
}else {
|
||||||
this.goodsAmount += val.retailPrice
|
this.goodsAmount += +val.retailPrice
|
||||||
}
|
}
|
||||||
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
|
this.goodsActualPay = this.goodsAmount - this.goodsDiscount;
|
||||||
this.goodsOrder.push(val);
|
this.goodsOrder.push(val);
|
||||||
@ -2036,35 +2071,30 @@
|
|||||||
let _this = this;
|
let _this = this;
|
||||||
_this.consumeRefuelMoney = 0;
|
_this.consumeRefuelMoney = 0;
|
||||||
_this.oilActualPay = 0;
|
_this.oilActualPay = 0;
|
||||||
let oilActPay = 0;
|
|
||||||
_this.hoardAmount = 0;
|
_this.hoardAmount = 0;
|
||||||
_this.oilOrder.forEach(item => {
|
_this.oilOrder.forEach(item => {
|
||||||
let conRefMon = 0;
|
let conRefMon = 0;
|
||||||
let oilActualPay = 0;
|
|
||||||
let hoardAmount = 0;
|
let hoardAmount = 0;
|
||||||
if (_this.refuelMoney!=null){
|
if (_this.refuelMoney!=null){
|
||||||
let result = false;
|
|
||||||
for (let i = 0;i < _this.refuelMoney.length;i++){
|
for (let i = 0;i < _this.refuelMoney.length;i++){
|
||||||
// 囤油卡升数变化
|
// 囤油卡升数变化
|
||||||
if (_this.refuelMoney[i].oilType==item.oilType){
|
if (_this.refuelMoney[i].oilType==item.oilType){
|
||||||
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
|
if ((_this.refuelMoney[i].refuelMoney-item.liters)>=0){
|
||||||
conRefMon = item.liters
|
conRefMon = item.liters
|
||||||
oilActualPay = 0;
|
|
||||||
}else {
|
}else {
|
||||||
conRefMon = _this.refuelMoney[i].refuelMoney
|
conRefMon = _this.refuelMoney[i].refuelMoney
|
||||||
oilActualPay = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
// 扣除升数后需要消费的金额
|
||||||
hoardAmount = (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
hoardAmount = item.amount - (_this.refuelMoney[i].refuelMoney * item.oilPrice).toFixed(2)
|
||||||
}
|
|
||||||
result = true;
|
|
||||||
}else {
|
|
||||||
if (result==false){
|
|
||||||
oilActualPay = item.amount
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
_this.consumeRefuelMoney += +conRefMon
|
_this.consumeRefuelMoney += +conRefMon
|
||||||
oilActPay += +oilActualPay
|
if (_this.consumeRefuelMoney!=0){
|
||||||
|
_this.isOilStorageCard = true;
|
||||||
|
_this.checkAll3 = true;
|
||||||
|
_this.consumeAmount = 0;
|
||||||
|
}
|
||||||
_this.hoardAmount += +hoardAmount
|
_this.hoardAmount += +hoardAmount
|
||||||
})
|
})
|
||||||
_this.isExclusion();
|
_this.isExclusion();
|
||||||
@ -2381,9 +2411,9 @@
|
|||||||
goods.forEach(item => {
|
goods.forEach(item => {
|
||||||
num += item.num
|
num += item.num
|
||||||
if (_this.isMember){
|
if (_this.isMember){
|
||||||
amount += (item.memberPrice*item.num).toFixed(2);
|
amount += +(item.memberPrice*item.num).toFixed(2);
|
||||||
}else {
|
}else {
|
||||||
amount += (item.retailPrice*item.num).toFixed(2);
|
amount += +(item.retailPrice*item.num).toFixed(2);
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
this.goodsTotal = num;
|
this.goodsTotal = num;
|
||||||
|
@ -493,7 +493,7 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<div style="margin: 20px 0;text-align: center">
|
<div style="margin: 20px 0;text-align: center">
|
||||||
<el-button type="primary" @click="confirm(1)">确认充值</el-button>
|
<el-button type="primary" @click="confirm(1)">确认充值</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="openRecharge = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
@ -575,12 +575,13 @@
|
|||||||
</el-row>
|
</el-row>
|
||||||
<div style="margin: 20px 0;text-align: center">
|
<div style="margin: 20px 0;text-align: center">
|
||||||
<el-button type="primary" @click="confirm(2)">确认充值</el-button>
|
<el-button type="primary" @click="confirm(2)">确认充值</el-button>
|
||||||
<el-button @click="cancel">取 消</el-button>
|
<el-button @click="openRecharge = false">取 消</el-button>
|
||||||
</div>
|
</div>
|
||||||
</el-tab-pane>
|
</el-tab-pane>
|
||||||
</el-tabs>
|
</el-tabs>
|
||||||
</template>
|
</template>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
<!-- 选择员工-->
|
<!-- 选择员工-->
|
||||||
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
|
<el-dialog :close-on-click-modal="false" width="50%" height="50%" title="选择员工" :visible.sync="openStaff" append-to-body>
|
||||||
<select-staff @send-data="handleDataFromChild">
|
<select-staff @send-data="handleDataFromChild">
|
||||||
|
@ -0,0 +1,59 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<el-table ref="tables" v-loading="loading" :data="list">
|
||||||
|
<el-table-column label="所属油站" prop="id" align="center"/>
|
||||||
|
<el-table-column label="订单时间" align="center"/>
|
||||||
|
<el-table-column label="交易终端" align="center" prop="userNo"/>
|
||||||
|
<el-table-column label="油品/油枪" align="center" prop="name" />
|
||||||
|
<el-table-column label="订单金额" align="center" prop="mobile"/>
|
||||||
|
<el-table-column label="优惠金额" align="center" prop="gradeId"/>
|
||||||
|
<el-table-column label="实付金额" align="center" prop="balance"/>
|
||||||
|
<el-table-column label="付款类型" align="center" prop="balance"/>
|
||||||
|
<el-table-column label="订单号" align="center" prop="balance"/>
|
||||||
|
<el-table-column label="订单类型" align="center" prop="point"/>
|
||||||
|
</el-table>
|
||||||
|
|
||||||
|
<pagination
|
||||||
|
:total="total"
|
||||||
|
:page.sync="queryParams.page"
|
||||||
|
:limit.sync="queryParams.pageSize"
|
||||||
|
@pagination="getList"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import {listOilOrder} from "@/api/cashier/oilorder";
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props:["pid"],
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
loading:false,
|
||||||
|
list:[],
|
||||||
|
total:0,
|
||||||
|
queryParams:{
|
||||||
|
page:1,
|
||||||
|
pageSize:10,
|
||||||
|
userId:"",
|
||||||
|
},
|
||||||
|
// 会员id
|
||||||
|
userId:"",
|
||||||
|
}
|
||||||
|
},
|
||||||
|
created() {
|
||||||
|
this.getList();
|
||||||
|
},
|
||||||
|
methods:{
|
||||||
|
getList(){
|
||||||
|
listOilOrder(this.queryParams).then(res => {
|
||||||
|
console.log(res)
|
||||||
|
})
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<style lang="scss" scoped>
|
||||||
|
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user