Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
18eaab3435
@ -42,6 +42,14 @@ export function getUserMobile(data) {
|
||||
data: data
|
||||
})
|
||||
}
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserPhone(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/phone' ,
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 新增会员
|
||||
export function addUser(data) {
|
||||
|
@ -38,18 +38,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
size="medium"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="dateRange"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- size="medium"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- range-separator="-"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- ></el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQueryMember">搜索</el-button>
|
||||
@ -73,18 +73,18 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-date-picker
|
||||
v-model="dateRange"
|
||||
style="width: 240px"
|
||||
size="medium"
|
||||
value-format="yyyy-MM-dd"
|
||||
type="daterange"
|
||||
range-separator="-"
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
></el-date-picker>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item>-->
|
||||
<!-- <el-date-picker-->
|
||||
<!-- v-model="dateRange"-->
|
||||
<!-- style="width: 240px"-->
|
||||
<!-- size="medium"-->
|
||||
<!-- value-format="yyyy-MM-dd"-->
|
||||
<!-- type="daterange"-->
|
||||
<!-- range-separator="-"-->
|
||||
<!-- start-placeholder="开始日期"-->
|
||||
<!-- end-placeholder="结束日期"-->
|
||||
<!-- ></el-date-picker>-->
|
||||
<!-- </el-form-item>-->
|
||||
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||
|
@ -2,11 +2,11 @@
|
||||
<div class="app-container">
|
||||
<el-card >
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="来源油站" prop="storeIds">
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="来源油站" prop="storeIds">-->
|
||||
<!-- <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-select>-->
|
||||
<!-- </el-form-item>-->
|
||||
<el-form-item label="会员号" prop="userNo">
|
||||
<el-input
|
||||
v-model="queryParams.userNo"
|
||||
@ -448,7 +448,7 @@ import {
|
||||
delUser,
|
||||
exportUsers,
|
||||
getUser,
|
||||
getUserMobile,
|
||||
getUserMobile, getUserPhone,
|
||||
listStatistic,
|
||||
listUser, listUserStatistic,
|
||||
updateUser
|
||||
@ -732,8 +732,8 @@ export default {
|
||||
this.getList();
|
||||
});
|
||||
} else {
|
||||
getUserMobile({mobile:this.form.mobile}).then( response => {
|
||||
if(response.data!=null){
|
||||
getUserPhone({mobile:this.form.mobile}).then( response => {
|
||||
if(response.data){
|
||||
this.$modal.msgError("手机号已存在");
|
||||
}else {
|
||||
addUser(this.form).then(response => {
|
||||
|
@ -14,7 +14,7 @@
|
||||
<div style="display: flex;margin-top: 20px">
|
||||
<div class="left">
|
||||
<div>
|
||||
<img v-if="form.avatar" :src="form.avatar" style="width: 80px;height: 80px">
|
||||
<img v-if="form.avatar" :src="baseUrl+form.avatar" style="width: 80px;height: 80px;border-radius: 50%">
|
||||
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
|
||||
</div>
|
||||
<el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>
|
||||
@ -29,7 +29,7 @@
|
||||
<span style="color: #00afff" @click="changeName">{{form.name ? form.name : "--"}}</span>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="实体卡号">{{form.idcard ? form.idcard : "--"}}</el-descriptions-item>
|
||||
<el-descriptions-item label="绑定信息">--</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="绑定信息">--</el-descriptions-item>-->
|
||||
<el-descriptions-item label="会员状态">
|
||||
<dict-tag :options="dict.type.zhzt" :value="form.status"/>
|
||||
</el-descriptions-item>
|
||||
@ -43,10 +43,10 @@
|
||||
<el-descriptions-item label="会员等级">
|
||||
{{ grade.name }}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="储值优惠">--</el-descriptions-item>
|
||||
<el-descriptions-item label="每日笔数">
|
||||
<span style="color: #00afff" @click="configuration">跟随全局总配置</span>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="储值优惠">--</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="每日笔数">-->
|
||||
<!-- <span style="color: #00afff" @click="configuration">跟随全局总配置</span>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item label="固定等级">
|
||||
<span style="color: #00afff" @click="level">
|
||||
{{form.fixingLevel ? fixingLevelinfo(fixingLevelList,form.fixingLevel) : "--"}}
|
||||
@ -716,6 +716,7 @@ export default {
|
||||
dicts: ['official','zhzt','zcrzdj','payment_type'],
|
||||
data(){
|
||||
return{
|
||||
baseUrl:process.env.VUE_APP_BASE_API,
|
||||
flag:null,
|
||||
fixingLevelList:[],
|
||||
// 充值余额列表
|
||||
|
@ -166,18 +166,18 @@
|
||||
<el-col :span="8">
|
||||
<el-form-item label="角色组" prop="roleId">
|
||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="item in roleList"-->
|
||||
<!-- :key="item.dutyId"-->
|
||||
<!-- :label="item.dutyName"-->
|
||||
<!-- :value="item.dutyId"-->
|
||||
<!-- ></el-option>-->
|
||||
<el-option
|
||||
v-for="dict in dict.type.staff_role"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
v-for="item in roleList"
|
||||
:key="item.dutyId"
|
||||
:label="item.dutyName"
|
||||
:value="item.dutyId"
|
||||
></el-option>
|
||||
<!-- <el-option-->
|
||||
<!-- v-for="dict in dict.type.staff_role"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :label="dict.label"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- />-->
|
||||
<!-- <el-option value="普通员工">普通员工</el-option>-->
|
||||
<!-- <el-option value="收银员">收银员</el-option>-->
|
||||
</el-select>
|
||||
@ -569,7 +569,7 @@
|
||||
:title="title"
|
||||
:visible.sync="dialogVisible"
|
||||
style="margin-top: 100px"
|
||||
width="20%">
|
||||
width="23%">
|
||||
<div style="text-align: center">
|
||||
<img id="qrCodeImg" class="qrcode" :src="baseUrl+imgUrl" />
|
||||
</div>
|
||||
@ -987,8 +987,8 @@ export default {
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.qrcode{
|
||||
width: 200px;
|
||||
height: 300px;
|
||||
width: 80%;
|
||||
margin: 0 auto;
|
||||
margin-top: 15px;
|
||||
}
|
||||
</style>
|
||||
|
@ -11,5 +11,8 @@ VUE_APP_BASE_API = '/dev-api'
|
||||
VUE_APP_PUBLIC_PATH = '/'
|
||||
|
||||
# 后端接口地址
|
||||
VUE_APP_SERVER_URL = 'http://192.168.0.138:8080/'
|
||||
# VUE_APP_SERVER_URL = 'http://192.168.0.138:8080/'
|
||||
VUE_APP_SERVER_URL = 'http://192.168.0.178:8008/'
|
||||
|
||||
# cp端地址
|
||||
VUE_PC_SERVER_URL = 'http://192.168.0.178:82/'
|
||||
|
@ -29,7 +29,7 @@ export function addIndexBanner(data) {
|
||||
// 修改首页轮播图信息
|
||||
export function updateIndexBanner(data) {
|
||||
return request({
|
||||
url: '/business/indexBanner/lists',
|
||||
url: '/business/indexBanner',
|
||||
method: 'put',
|
||||
data: data
|
||||
})
|
||||
|
@ -159,10 +159,12 @@ export function updateAuthRole(data) {
|
||||
}
|
||||
|
||||
// 查询部门下拉树结构
|
||||
export function deptTreeSelect() {
|
||||
export function deptTreeSelect(data) {
|
||||
return request({
|
||||
url: '/system/dept/deptTree',
|
||||
method: 'get'
|
||||
method: 'get',
|
||||
params: data
|
||||
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -47,6 +47,7 @@ Vue.prototype.addDateRange = addDateRange
|
||||
Vue.prototype.getName = getName
|
||||
Vue.prototype.download = download
|
||||
Vue.prototype.handleTree = handleTree
|
||||
Vue.prototype.pcUrl = 'http://192.168.0.178:82/'
|
||||
|
||||
// 全局组件挂载
|
||||
Vue.component('DictTag', DictTag)
|
||||
|
@ -8,7 +8,8 @@
|
||||
|
||||
<el-input
|
||||
placeholder="请输入机构名称查询"
|
||||
v-model="filterText">
|
||||
v-model="filterText"
|
||||
@input="inputDeptName()">
|
||||
</el-input>
|
||||
<div style="width: 100%; height: 20px"></div>
|
||||
|
||||
@ -787,7 +788,7 @@
|
||||
/** 查询用户列表 */
|
||||
async getList() {
|
||||
console.log("123123123",this.form)
|
||||
await deptTreeSelect().then(response => {
|
||||
await deptTreeSelect({deptName :this.filterText}).then(response => {
|
||||
this.Thetree = response.data
|
||||
if(this.Thetree.length>0 && !this.queryParams.deptId) {
|
||||
this.queryParams.deptId = this.Thetree[0].id
|
||||
@ -1075,6 +1076,9 @@
|
||||
// 提交上传文件
|
||||
submitFileForm() {
|
||||
this.$refs.upload.submit();
|
||||
},
|
||||
inputDeptName() {
|
||||
this.getList()
|
||||
}
|
||||
}
|
||||
};
|
||||
|
@ -455,13 +455,9 @@
|
||||
}
|
||||
singleSignOnApi(this.id).then(res=>{
|
||||
if (res.code == 200) {
|
||||
let url =
|
||||
// let url = process.env.VUE_APP_SERVER_URL
|
||||
console.log("url",url)
|
||||
window.open( 'http://localhost:81/index?entrance='+this.id)
|
||||
window.open(this.pcUrl+'index?entrance='+this.id)
|
||||
}
|
||||
})
|
||||
// 在token+入
|
||||
},
|
||||
|
||||
|
||||
|
@ -20,6 +20,7 @@
|
||||
</el-switch>
|
||||
</div>
|
||||
</div>
|
||||
<div style="margin-top: 20px"><el-button type="primary" icon="el-icon-plus" @click="addMerchant">添加商户信息</el-button></div>
|
||||
<div class="content-box">
|
||||
<!-- <el-card class="box-card" shadow="hover" v-for="(item,index) in 10" :key="index">-->
|
||||
<!-- <div slot="header" class="clearfix">-->
|
||||
@ -30,13 +31,14 @@
|
||||
<!-- </el-card>-->
|
||||
<el-card class="box-card" shadow="hover" v-for="item in merchantList" :key="item.id">
|
||||
<div slot="header" class="clearfix">
|
||||
<span>{{ item.merchantName }}</span>
|
||||
<span><dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/></span>
|
||||
<el-button v-if="item.isUse=='0'"
|
||||
@click="editStatus(item,1)"
|
||||
style="float: right; padding: 3px 0" type="text">切换为当前通道</el-button>
|
||||
<el-tag v-else effect="dark" type="success" style="float: right">当前使用中</el-tag>
|
||||
</div>
|
||||
<div>商户编号:{{ item.mchntCd }}</div>
|
||||
<div>商户编号: {{ item.mchntCd }}</div>
|
||||
<div>备注: <span style="color: #00afff;margin-left: 3px" @click="editRemark(item.id)">{{ item.remark ? item.remark : "--" }}</span></div>
|
||||
</el-card>
|
||||
</div>
|
||||
<el-divider></el-divider>
|
||||
@ -101,18 +103,67 @@
|
||||
<!-- </div>-->
|
||||
<div class="hsize">注:规则按照顺序进行处理并自动更换支付通道,新增或变更规则后需要发布当前规则才生效,发布生效后的规则将从序号1的配置生效</div>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%">
|
||||
<el-form :model="form1" ref="form1" :rules="rules" >
|
||||
<el-form-item label="支付通道" :label-width="formLabelWidth" prop="merchantName" width="300px">
|
||||
<el-select
|
||||
v-model="form1.merchantName"
|
||||
placeholder="全部"
|
||||
clearable
|
||||
style="width: 240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in dict.type.payment_channel"
|
||||
:key="dict.value"
|
||||
:label="dict.label"
|
||||
:value="dict.value"
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户号" :label-width="formLabelWidth" prop="mchntCd" >
|
||||
<el-input v-model="form1.mchntCd" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" :label-width="formLabelWidth" prop="remark" >
|
||||
<el-input v-model="form1.remark" autocomplete="off"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitMerchant">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<el-dialog :title="title" :visible.sync="show" width="25%" style="margin-top: 200px">
|
||||
<span>请输入备注信息</span>
|
||||
<el-input placeholder="请输入备注信息" style="margin-top: 20px"
|
||||
v-model="merchantConfig.remark"
|
||||
clearable>
|
||||
</el-input>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="show = false">取 消</el-button>
|
||||
<el-button type="primary" @click="submitRemark">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 编辑通道规则-->
|
||||
<el-dialog title="编辑通道规则" :visible.sync="dialogFormVisible"
|
||||
<el-dialog :title="title" :visible.sync="dialogFormVisible"
|
||||
width="30%">
|
||||
<el-form :model="form" ref="form">
|
||||
|
||||
<el-form-item label="支付通道" :label-width="formLabelWidth" width="300px">
|
||||
<el-select v-model="form.merchConfigId"
|
||||
@change="changeMerch"
|
||||
:disabled="isDis" placeholder="请选择商户信息">
|
||||
<el-option v-for="item in merchantList" :key="item.id"
|
||||
:label="item.merchantName"
|
||||
:value="item.id"></el-option>
|
||||
:disabled="isDis" placeholder="请选择商户信息" style="width: 100%">
|
||||
<el-option
|
||||
v-for="item in merchantList" :key="item.id"
|
||||
:label="item.merchantName"
|
||||
:value="item.id">
|
||||
<span style="float: left">
|
||||
<dict-tag :options="dict.type.payment_channel" :value="item.merchantName"/>
|
||||
</span>
|
||||
<span style="color: #00ff80">(111({{ item.remark ? item.remark : "--" }}))</span>
|
||||
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.mchntCd }}</span>
|
||||
</el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="商户号" :label-width="formLabelWidth">
|
||||
@ -149,7 +200,13 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {editMerchant, listMerchant2} from "@/api/payConfig/merchantconfig";
|
||||
import {
|
||||
addMerchant,
|
||||
editMerchant,
|
||||
editMerchantRemark,
|
||||
listMerchant,
|
||||
merchantInfo
|
||||
} from "@/api/payConfig/merchantconfig";
|
||||
import {
|
||||
addOilConfig,
|
||||
delOilConfig,
|
||||
@ -161,9 +218,8 @@ import {
|
||||
import {addUser, getUserMobile, updateUser} from "@/api/staff/user/user";
|
||||
|
||||
export default {
|
||||
dicts: ['payment_channel'],
|
||||
name: 'peizhi',
|
||||
props: ["id"],
|
||||
|
||||
data(){
|
||||
return{
|
||||
// 是否禁用
|
||||
@ -185,17 +241,67 @@ export default {
|
||||
resource: '',
|
||||
desc: ''
|
||||
},
|
||||
formLabelWidth: '70px',
|
||||
form1:{},
|
||||
formLabelWidth: '80px',
|
||||
dialogFormVisible:false,
|
||||
dialogVisible:false,
|
||||
show:false,
|
||||
value:false,
|
||||
value1:true,
|
||||
labelPosition: 'singleDay',
|
||||
title:"",
|
||||
merchantConfig:{},
|
||||
rules:{
|
||||
merchantName: [
|
||||
{ required: true, message: '请选择支付通道', trigger: 'blur' },
|
||||
],
|
||||
mchntCd: [
|
||||
{ required: true, message: '请填写商户号', trigger: 'blur' },
|
||||
],
|
||||
}
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getList();
|
||||
},
|
||||
methods:{
|
||||
// 修改商户备注信息
|
||||
submitRemark(){
|
||||
editMerchantRemark(this.merchantConfig).then(res => {
|
||||
if (res.data===1){
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.getList()
|
||||
this.show = false
|
||||
}
|
||||
})
|
||||
},
|
||||
// 打开修改商户备注信息对话框
|
||||
editRemark(id){
|
||||
this.title = "备注"
|
||||
this.show = true
|
||||
merchantInfo(id).then(res => {
|
||||
this.merchantConfig = res.data
|
||||
})
|
||||
},
|
||||
submitMerchant(){
|
||||
this.$refs["form1"].validate(valid => {
|
||||
if (valid) {
|
||||
addMerchant(this.form1).then(res => {
|
||||
if (res.data == 1){
|
||||
this.$modal.msgSuccess("添加成功");
|
||||
this.getList()
|
||||
this.dialogVisible = false
|
||||
}
|
||||
})
|
||||
}
|
||||
})
|
||||
},
|
||||
// 添加商户号信息
|
||||
addMerchant(){
|
||||
this.title = "添加商户信息"
|
||||
this.dialogVisible = true
|
||||
this.form1 = {}
|
||||
},
|
||||
// 删除支付配置信息
|
||||
deleteOilConfig(id){
|
||||
this.$confirm('确认删除此通道规则吗?', '提示', {
|
||||
@ -216,6 +322,7 @@ export default {
|
||||
},
|
||||
// 添加商户信息
|
||||
addOil(){
|
||||
this.title = "添加商户规则"
|
||||
this.dialogFormVisible = true;
|
||||
this.form = {
|
||||
name: '',
|
||||
@ -243,7 +350,7 @@ export default {
|
||||
if (valid) {
|
||||
if (this.form.id) {
|
||||
editOilConfig(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改会员成功");
|
||||
this.$modal.msgSuccess("修改通道成功");
|
||||
this.getList();
|
||||
this.dialogFormVisible = false;
|
||||
this.isDis = false;
|
||||
@ -253,7 +360,7 @@ export default {
|
||||
if (response.data==0){
|
||||
this.$modal.msgError("已存在当前通道商户号的规则");
|
||||
}else {
|
||||
this.$modal.msgSuccess("新增会员成功");
|
||||
this.$modal.msgSuccess("新增通道成功");
|
||||
this.getList();
|
||||
this.dialogFormVisible = false;
|
||||
this.isDis = false;
|
||||
@ -270,6 +377,7 @@ export default {
|
||||
},
|
||||
// 修改支付配置信息
|
||||
editOilConfig(id){
|
||||
this.title = "修改商户规则"
|
||||
this.isDis = true;
|
||||
this.dialogFormVisible = true;
|
||||
oilConfigInfo(id).then( response => {
|
||||
@ -344,7 +452,7 @@ export default {
|
||||
},
|
||||
// 获取商户列表信息
|
||||
getList(){
|
||||
listMerchant2({storeId : this.id}).then( response => {
|
||||
listMerchant().then( response => {
|
||||
this.merchantList = response.data;
|
||||
this.merchantList.forEach(item => {
|
||||
if (item.isOpenRule == "1"){
|
||||
|
270
fuintAdmin_zt/src/views/indexBanner/imgUpload/imgUpload.vue
Normal file
270
fuintAdmin_zt/src/views/indexBanner/imgUpload/imgUpload.vue
Normal file
@ -0,0 +1,270 @@
|
||||
<template>
|
||||
<div class="component-upload-image">
|
||||
<el-upload
|
||||
multiple
|
||||
:action="uploadImgUrl"
|
||||
list-type="picture-card"
|
||||
:on-success="handleUploadSuccess"
|
||||
:before-upload="handleBeforeUpload"
|
||||
:limit="limit"
|
||||
:on-error="handleUploadError"
|
||||
:on-exceed="handleExceed"
|
||||
ref="imageUpload"
|
||||
:on-remove="handleDelete"
|
||||
:show-file-list="true"
|
||||
:headers="headers"
|
||||
:file-list="fileList"
|
||||
:on-preview="handlePictureCardPreview"
|
||||
:class="{hide: this.fileList.length >= this.limit}"
|
||||
>
|
||||
<!-- <div style="display: flex;height: 100%;">-->
|
||||
<!-- <img v-if="doorList!=[]"-->
|
||||
<!-- v-for="(item,index) in doorList"-->
|
||||
<!-- :src="item"-->
|
||||
<!-- style="display: block; max-width: 100%; margin: 0 auto;margin-right: 20px"-->
|
||||
<!-- />-->
|
||||
<!-- </div>-->
|
||||
<!-- <div v-else>-->
|
||||
<img
|
||||
v-if="dialogImageUrl"
|
||||
:src="dialogImageUrl"
|
||||
style="display: block; max-width: 100%; margin: 0 auto;height: 100%"
|
||||
/>
|
||||
<i v-else class="el-icon-plus"></i>
|
||||
<!-- </div>-->
|
||||
</el-upload>
|
||||
|
||||
<!-- 上传提示 -->
|
||||
<div class="el-upload__tip" slot="tip" v-if="showTip">
|
||||
请上传
|
||||
<template v-if="fileSize"> 大小不超过 <b style="color: #f56c6c">{{ fileSize }}MB</b> </template>
|
||||
<template v-if="fileType"> 格式为 <b style="color: #f56c6c">{{ fileType.join("/") }}</b> </template>
|
||||
的文件
|
||||
</div>
|
||||
|
||||
<!-- <el-dialog-->
|
||||
<!-- :visible.sync="dialogVisible"-->
|
||||
<!-- title="预览"-->
|
||||
<!-- width="800"-->
|
||||
<!-- append-to-body-->
|
||||
<!-- >-->
|
||||
<!-- <img-->
|
||||
<!-- :src="dialogImageUrl"-->
|
||||
<!-- style="display: block; max-width: 100%; margin: 0 auto"-->
|
||||
<!-- />-->
|
||||
<!-- </el-dialog>-->
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { getToken } from "@/utils/auth";
|
||||
|
||||
export default {
|
||||
props: {
|
||||
value: [String, Object, Array],
|
||||
// 图片数量限制
|
||||
limit: {
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
// 大小限制(MB)
|
||||
fileSize: {
|
||||
type: Number,
|
||||
default: 5,
|
||||
},
|
||||
// 文件类型, 例如['png', 'jpg', 'jpeg']
|
||||
fileType: {
|
||||
type: Array,
|
||||
default: () => ["png", "jpg", "jpeg"],
|
||||
},
|
||||
// 是否显示提示
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
imgUrl:"",
|
||||
doorUrl:"",
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
number: 0,
|
||||
uploadList: [],
|
||||
dialogImageUrl: "",
|
||||
dialogVisible: false,
|
||||
hideUpload: false,
|
||||
baseUrl:process.env.VUE_APP_BASE_API,
|
||||
uploadImgUrl: process.env.VUE_APP_BASE_API + "/backendApi/file/upload", // 上传的图片服务器地址
|
||||
headers: {
|
||||
"Access-Token" : getToken(),
|
||||
},
|
||||
fileList: [],
|
||||
doorList:[],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
value: {
|
||||
handler(val) {
|
||||
if (val) {
|
||||
// 首先将值转为数组
|
||||
const list = Array.isArray(val) ? val : this.value.split(',');
|
||||
// 然后将数组转为对象数组
|
||||
this.fileList = list.map(item => {
|
||||
if (typeof item === "string") {
|
||||
item = { name: item, url: item };
|
||||
}
|
||||
return item;
|
||||
});
|
||||
} else {
|
||||
this.fileList = [];
|
||||
return [];
|
||||
}
|
||||
},
|
||||
deep: true,
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 是否显示提示
|
||||
showTip() {
|
||||
return this.isShowTip && (this.fileType || this.fileSize);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
// this.dialogImageUrl = this.baseUrl + this.imgUrl;
|
||||
this.handlePictureCardPreview();
|
||||
},
|
||||
methods: {
|
||||
// 上传前loading加载
|
||||
handleBeforeUpload(file) {
|
||||
let isImg = false;
|
||||
if (this.fileType.length) {
|
||||
let fileExtension = "";
|
||||
if (file.name.lastIndexOf(".") > -1) {
|
||||
fileExtension = file.name.slice(file.name.lastIndexOf(".") + 1);
|
||||
}
|
||||
isImg = this.fileType.some(type => {
|
||||
if (file.type.indexOf(type) > -1) return true;
|
||||
if (fileExtension && fileExtension.indexOf(type) > -1) return true;
|
||||
return false;
|
||||
});
|
||||
} else {
|
||||
isImg = file.type.indexOf("image") > -1;
|
||||
}
|
||||
|
||||
if (!isImg) {
|
||||
this.$modal.msgError(`文件格式不正确, 请上传${this.fileType.join("/")}图片格式文件!`);
|
||||
return false;
|
||||
}
|
||||
if (this.fileSize) {
|
||||
const isLt = file.size / 1024 / 1024 < this.fileSize;
|
||||
if (!isLt) {
|
||||
this.$modal.msgError(`上传头像图片大小不能超过 ${this.fileSize} MB!`);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
this.$modal.loading("正在上传图片,请稍候...");
|
||||
this.number++;
|
||||
},
|
||||
// 文件个数超出
|
||||
handleExceed() {
|
||||
this.$modal.msgError(`上传文件数量不能超过 ${this.limit} 个!`);
|
||||
},
|
||||
// 上传成功回调
|
||||
handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
||||
this.uploadedSuccessfully();
|
||||
} else {
|
||||
this.number--;
|
||||
this.$modal.closeLoading();
|
||||
this.$modal.msgError(res.msg);
|
||||
this.$refs.imageUpload.handleRemove(file);
|
||||
this.uploadedSuccessfully();
|
||||
}
|
||||
},
|
||||
// 删除图片
|
||||
handleDelete(file) {
|
||||
const findex = this.fileList.map(f => f.name).indexOf(file.name);
|
||||
if (findex > -1) {
|
||||
this.fileList.splice(findex, 1);
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
}
|
||||
},
|
||||
// 上传失败
|
||||
handleUploadError() {
|
||||
this.$modal.msgError("上传图片失败,请重试");
|
||||
this.$modal.closeLoading();
|
||||
},
|
||||
// 上传结束处理
|
||||
uploadedSuccessfully() {
|
||||
if (this.number > 0 && this.uploadList.length === this.number) {
|
||||
this.fileList = this.fileList.concat(this.uploadList);
|
||||
this.uploadList = [];
|
||||
this.number = 0;
|
||||
this.$emit("input", this.listToString(this.fileList));
|
||||
this.$modal.closeLoading();
|
||||
}
|
||||
},
|
||||
// 预览
|
||||
handlePictureCardPreview(file) {
|
||||
if (this.imgUrl){
|
||||
if (this.imgUrl.includes("http")){
|
||||
this.dialogImageUrl = this.imgUrl;
|
||||
}else {
|
||||
this.dialogImageUrl = this.baseUrl + this.imgUrl;
|
||||
}
|
||||
}else {
|
||||
if (file!=undefined){
|
||||
this.dialogImageUrl = file.url;
|
||||
}else {
|
||||
this.dialogImageUrl = ""
|
||||
}
|
||||
}
|
||||
if (this.doorUrl != "" && this.doorUrl != undefined && this.doorUrl != []){
|
||||
let list = JSON.parse(this.doorUrl)
|
||||
list.forEach(item => {
|
||||
let data = {name:"",url:""}
|
||||
data.name = item.split("/")[item.split("/").length-1]
|
||||
data.url = this.baseUrl + item
|
||||
this.fileList.push(data)
|
||||
// this.dialogImageUrl = this.baseUrl + item;
|
||||
// this.doorList.push(this.baseUrl + item);
|
||||
})
|
||||
}else {
|
||||
if (file!=undefined){
|
||||
this.dialogImageUrl = file.url;
|
||||
}
|
||||
}
|
||||
// this.dialogVisible = true;
|
||||
},
|
||||
// 对象转成指定字符串分隔
|
||||
listToString(list, separator) {
|
||||
let strs = "";
|
||||
separator = separator || ",";
|
||||
for (let i in list) {
|
||||
if (list[i].url) {
|
||||
strs += list[i].url.replace(this.baseUrl, "") + separator;
|
||||
}
|
||||
}
|
||||
return strs != '' ? strs.substr(0, strs.length - 1) : '';
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
<style scoped lang="scss">
|
||||
// .el-upload--picture-card 控制加号部分
|
||||
::v-deep.hide .el-upload--picture-card {
|
||||
display: none;
|
||||
}
|
||||
// 去掉动画效果
|
||||
::v-deep .el-list-enter-active,
|
||||
::v-deep .el-list-leave-active {
|
||||
transition: all 0s;
|
||||
}
|
||||
|
||||
::v-deep .el-list-enter, .el-list-leave-active {
|
||||
opacity: 0;
|
||||
transform: translateY(0);
|
||||
}
|
||||
</style>
|
||||
|
@ -2,19 +2,18 @@
|
||||
<div>
|
||||
<el-card class="card">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||
<el-form-item label="店铺" prop="name">
|
||||
<el-input
|
||||
v-model="queryParams.realName"
|
||||
placeholder="请输入姓名"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
<el-form-item label="店铺" prop="storeId">
|
||||
<el-select v-model="queryParams.storeId" placeholder="请选择店铺" style="width: 100%">
|
||||
<el-option v-for="item in storeList"
|
||||
:key="item.id" clearable
|
||||
:label="item.name" :value="item.id"
|
||||
@keyup.enter.native="handleQuery"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由" prop="mobile">
|
||||
<el-form-item label="路由" prop="routeUrl">
|
||||
<el-input
|
||||
v-model="queryParams.mobile"
|
||||
placeholder="请输入手机号"
|
||||
v-model="queryParams.routeUrl"
|
||||
placeholder="请输入路由地址"
|
||||
clearable
|
||||
style="width: 240px;"
|
||||
@keyup.enter.native="handleQuery"
|
||||
@ -44,7 +43,12 @@
|
||||
<span>{{scope.row.storeId ? storeName(storeList,scope.row.storeId) : "--"}}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="轮播图" align="center" prop="bannerUrl" />
|
||||
<el-table-column label="轮播图" align="center" prop="bannerUrl" >
|
||||
<template slot-scope="scope">
|
||||
<span v-if="!scope.row.bannerUrl">--</span>
|
||||
<img class="imgBanner" v-else :src="getBannerUrl(scope.row.bannerUrl)">
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="路由地址" align="center" prop="routeUrl" />
|
||||
<el-table-column label="备注" align="center" prop="remark" >
|
||||
<template slot-scope="scope">
|
||||
@ -57,7 +61,7 @@
|
||||
size="mini"
|
||||
type="text"
|
||||
icon="el-icon-edit"
|
||||
@click="handleUpdate(scope.row)"
|
||||
@click="handleUpdate(scope.row.id)"
|
||||
>修改</el-button>
|
||||
<el-button
|
||||
size="mini"
|
||||
@ -79,12 +83,29 @@
|
||||
</el-card>
|
||||
|
||||
<el-dialog
|
||||
:title="title"
|
||||
:title="title" width="35%"
|
||||
:visible.sync="dialogVisible">
|
||||
<span>这是一段信息</span>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="店铺" prop="storeId">
|
||||
<el-select v-model="form.storeId" placeholder="请选择店铺" style="width: 100%">
|
||||
<el-option v-for="item in storeList"
|
||||
:key="item.id"
|
||||
:label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="轮播图" prop="bannerUrl">
|
||||
<imgUpload v-if="flag" :imgUrl="form.bannerUrl" :limit="1" @input="getImgUrl"></imgUpload>
|
||||
</el-form-item>
|
||||
<el-form-item label="路由地址" prop="routeUrl">
|
||||
<el-input v-model="form.routeUrl" placeholder="请填写路由地址"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="form.remark" type="textarea"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<span slot="footer" class="dialog-footer">
|
||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
||||
<el-button @click="clear">取 消</el-button>
|
||||
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||
</span>
|
||||
</el-dialog>
|
||||
|
||||
@ -92,10 +113,18 @@
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import {listIndexBanner} from "@/api/indexBanner/indexBanner";
|
||||
import {
|
||||
addIndexBanner,
|
||||
deleteIndexBanner,
|
||||
indexBannerInfo,
|
||||
listIndexBanner,
|
||||
updateIndexBanner
|
||||
} from "@/api/indexBanner/indexBanner";
|
||||
import {ljStoreList} from "@/api/indexBanner/ljstore";
|
||||
import imgUpload from "@/views/indexBanner/imgUpload/imgUpload.vue"
|
||||
|
||||
export default {
|
||||
components: {imgUpload},
|
||||
data(){
|
||||
return{
|
||||
queryParams:{
|
||||
@ -108,6 +137,20 @@ export default {
|
||||
title:'',
|
||||
total:0,
|
||||
storeList:[],
|
||||
baseUrl:process.env.VUE_APP_BASE_API,
|
||||
form:{},
|
||||
flag: false,
|
||||
rules:{
|
||||
storeId: [
|
||||
{ required: true, message: '请选择店铺', trigger: 'change' }
|
||||
],
|
||||
bannerUrl: [
|
||||
{ required: true, message: '请插入活动图片', trigger: 'change' }
|
||||
],
|
||||
routeUrl: [
|
||||
{ required: true, message: '请填写路由地址', trigger: 'change' }
|
||||
],
|
||||
},
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@ -115,6 +158,22 @@ export default {
|
||||
this.getStoreList()
|
||||
},
|
||||
methods:{
|
||||
// 获取图片url地址
|
||||
getImgUrl(val){
|
||||
let list = val.split("/static")
|
||||
this.form.bannerUrl = "/static"+list[list.length-1]
|
||||
},
|
||||
// 返回图片路径
|
||||
getBannerUrl(url){
|
||||
let imgurl = ""
|
||||
if (url.includes("http")){
|
||||
imgurl = url
|
||||
}else {
|
||||
imgurl = this.baseUrl + url
|
||||
}
|
||||
return imgurl;
|
||||
},
|
||||
// 获取店铺名称
|
||||
storeName(list,id){
|
||||
let name = ""
|
||||
list.forEach(item => {
|
||||
@ -135,7 +194,6 @@ export default {
|
||||
// 获取列表信息
|
||||
getList(){
|
||||
listIndexBanner(this.queryParams).then(res => {
|
||||
console.log(res)
|
||||
if (res.data){
|
||||
this.list = res.data.records;
|
||||
this.total = res.data.total;
|
||||
@ -144,16 +202,69 @@ export default {
|
||||
},
|
||||
// 新增轮播图配置信息
|
||||
handleAdd(){
|
||||
this.form = {}
|
||||
this.title = "新增配置"
|
||||
this.dialogVisible = true;
|
||||
this.flag = true
|
||||
},
|
||||
// 修改轮播图配置信息
|
||||
handleUpdate(id){
|
||||
|
||||
indexBannerInfo(id).then(res => {
|
||||
if (res.data){
|
||||
this.form = res.data
|
||||
this.title = "修改配置"
|
||||
this.dialogVisible = true;
|
||||
this.flag = true
|
||||
}
|
||||
})
|
||||
},
|
||||
// 删除轮播图配置信息
|
||||
handleDelete(id){
|
||||
|
||||
handleDelete(row){
|
||||
const name = this.storeName(this.storeList,row.storeId) || this.id;
|
||||
this.$modal.confirm('是否确认删除"' + name + '"的路由配置信息?').then(function() {
|
||||
return deleteIndexBanner(row.id);
|
||||
}).then(() => {
|
||||
this.queryParams.page = 1
|
||||
this.getList();
|
||||
this.$modal.msgSuccess("删除成功");
|
||||
}).catch(() => {});
|
||||
},
|
||||
// 提交信息
|
||||
submitForm(){
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
if (this.form.id){
|
||||
updateIndexBanner(this.form).then(res => {
|
||||
console.log(res)
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("修改成功")
|
||||
this.dialogVisible = false
|
||||
this.flag = false
|
||||
this.getList()
|
||||
this.getStoreList()
|
||||
}
|
||||
})
|
||||
}else {
|
||||
addIndexBanner(this.form).then(res => {
|
||||
console.log(res)
|
||||
if (res.data==1){
|
||||
this.$modal.msgSuccess("添加成功")
|
||||
this.dialogVisible = false
|
||||
this.flag = false
|
||||
this.getList()
|
||||
this.getStoreList()
|
||||
}else {
|
||||
this.$modal.msgError("当前店铺已存在跳转此页面的路由信息")
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
})
|
||||
},
|
||||
// 取消按钮
|
||||
clear(){
|
||||
this.dialogVisible = false
|
||||
this.flag = false
|
||||
},
|
||||
// 搜索按钮操作
|
||||
handleQuery() {
|
||||
@ -165,5 +276,8 @@ export default {
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
.imgBanner{
|
||||
width: 150px;
|
||||
height: 100px;
|
||||
}
|
||||
</style>
|
||||
|
@ -120,7 +120,8 @@
|
||||
>
|
||||
<el-option key="1" label="超级管理员" value="1"/>
|
||||
<el-option key="2" label="普通管理员" value="2"/>
|
||||
<el-option key="3" label="用户角色" value="3"/>
|
||||
<!-- <el-option key="3" label="用户角色" value="3"/> -->
|
||||
<el-option key="3" label="员工角色" value="3"/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态">
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.api.fuyou.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
|
||||
@ -128,7 +129,12 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
||||
}
|
||||
merchantConfig.setAppid(FuYouPublicMerchant.appid);
|
||||
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
|
||||
merchantConfig.setIsUse("0");
|
||||
MerchantConfig merchantConfig1 = this.selectMeChByIdIsUse(nowAccountInfo.getStoreId());
|
||||
if (ObjectUtil.isEmpty(merchantConfig1)){
|
||||
merchantConfig.setIsUse("1");
|
||||
}else {
|
||||
merchantConfig.setIsUse("0");
|
||||
}
|
||||
merchantConfig.setIsOpenRule("0");
|
||||
merchantConfig.setAmount(0.0);
|
||||
row = baseMapper.insert(merchantConfig);
|
||||
|
@ -64,7 +64,7 @@ public class IndexBannerServiceImpl extends ServiceImpl<IndexBannerMapper, Index
|
||||
|
||||
@Override
|
||||
public int updateIndexBanner(IndexBanner indexBanner) {
|
||||
return 0;
|
||||
return baseMapper.updateById(indexBanner);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -88,7 +88,7 @@ public interface IntegralDetailMapper {
|
||||
*/
|
||||
List<IntegralDetail> signInGifts(@Param("type") String type);
|
||||
|
||||
List<IntegralDetail> signInGiftsYesterday(@Param("type") String type);
|
||||
List<IntegralDetail> signInGiftsYesterday(@Param("type") String type,@Param("userId") Integer userId,@Param("chainStoreId") Integer chainStoreId);
|
||||
|
||||
}
|
||||
|
||||
|
@ -184,8 +184,14 @@
|
||||
id, user_id, points_change, current_points, type, change_reason, store_id, create_time, update_time, create_by, update_by,change_type
|
||||
from integral_detail
|
||||
WHERE DATE(create_time) = CURDATE() - INTERVAL 1 DAY
|
||||
<if test="userId != null">
|
||||
and user_id = #{userId}
|
||||
</if>
|
||||
<if test="chainStoreId != null">
|
||||
and chain_store_id = #{chainStoreId}
|
||||
</if>
|
||||
<if test="type != null">
|
||||
and type = #{type}
|
||||
and type = #{type}
|
||||
</if>
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
@ -215,6 +215,9 @@
|
||||
<if test="integralOrders.exchangeQuantity != null">
|
||||
and io.exchange_quantity = #{integralOrders.exchangeQuantity}
|
||||
</if>
|
||||
<if test="integralOrders.chainStoreId != null">
|
||||
and io.chain_store_id = #{integralOrders.chainStoreId}
|
||||
</if>
|
||||
</where>
|
||||
order by io.create_time desc
|
||||
|
||||
|
@ -20,8 +20,13 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.fuint.business.integral.vo.IntegralGiftVO;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersRequest;
|
||||
import com.fuint.business.integral.vo.IntegralOrdersVO;
|
||||
import com.fuint.business.marketingActivity.cardExchange.entity.CardExchangeRecord;
|
||||
import com.fuint.business.marketingActivity.cardExchange.service.CardExchangeRecordService;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.entity.CardFavorableRecord;
|
||||
import com.fuint.business.marketingActivity.cardFavorable.service.CardFavorableRecordService;
|
||||
import com.fuint.business.marketingActivity.cardValue.entity.CardValueRecord;
|
||||
import com.fuint.business.member.entity.LJStaff;
|
||||
import com.fuint.business.member.mapper.LJStaffMapper;
|
||||
import com.fuint.business.userManager.entity.UserBalance;
|
||||
import com.fuint.business.userManager.mapper.LJUserMapper;
|
||||
import com.fuint.business.userManager.service.UserBalanceService;
|
||||
@ -244,11 +249,13 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
* @return
|
||||
*/
|
||||
|
||||
// @Resource
|
||||
// IntegralGiftService integralGiftService;
|
||||
@Resource
|
||||
@Resource
|
||||
CardExchangeRecordService cardExchangeRecordService;
|
||||
// todo 判断积分商城兑换类型 根据类型在进行处理
|
||||
|
||||
@Resource
|
||||
CardFavorableRecordService cardFavorableRecordService;
|
||||
@Resource
|
||||
LJStaffMapper ljStaffMapper;
|
||||
@Override
|
||||
public IntegralOrders checkTheStatusOfYourPaymentByIntegral(String orderNo) {
|
||||
|
||||
@ -256,28 +263,51 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
// 查询订单信息
|
||||
// List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo, nowAccountInfo.getStoreId());
|
||||
List<IntegralOrders> listByOrderNo = integralOrdersDao.getListByOrderNo2(orderNo);
|
||||
|
||||
if ("paid".equals(listByOrderNo.get(0).getStatus())) {
|
||||
// 查询用户信息
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(listByOrderNo.get(0).getUserId(), listByOrderNo.get(0).getChainStoreId());
|
||||
// 查询用户信息
|
||||
BigDecimal totalPoints = new BigDecimal(0);
|
||||
|
||||
for (IntegralOrders integralOrders : listByOrderNo) {
|
||||
// 查询员工信息
|
||||
LJStaff ljStaff = ljStaffMapper.selectById(integralOrders.getStaffId());
|
||||
|
||||
totalPoints = totalPoints.add(new BigDecimal(integralOrders.getIntegral()));
|
||||
// 加兑换卷和优惠券判断
|
||||
IntegralGift integralGift = integralGiftService.queryById(integralOrders.getGiftId());
|
||||
if (integralGift.getGiftType().equals("兑换券")) {
|
||||
// 兑换卷处理
|
||||
integralGift.getVoucherId();
|
||||
// cardExchangeRecordService
|
||||
// 兑换券:CardExchangeRecordService的addCardExchangeRecord方法 传参:
|
||||
}
|
||||
|
||||
if (integralGift.getGiftType().equals("优惠券")) {
|
||||
// integralGift.getVoucherId();
|
||||
CardExchangeRecord cardExchangeRecord = new CardExchangeRecord();
|
||||
cardExchangeRecord.setCardExchangeId(integralGift.getVoucherId());
|
||||
cardExchangeRecord.setStoreId(integralOrders.getStoreId());
|
||||
cardExchangeRecord.setMtUserId(integralOrders.getUserId());
|
||||
cardExchangeRecord.setName(ljUserVos.getName());
|
||||
cardExchangeRecord.setMobile(ljUserVos.getMobile());
|
||||
cardExchangeRecord.setPhoto(ljUserVos.getAvatar());
|
||||
cardExchangeRecord.setMtStaffId(ljStaff.getId());
|
||||
cardExchangeRecord.setRealName(ljStaff.getRealName());
|
||||
cardExchangeRecord.setStaffMobile(ljStaff.getMobile());
|
||||
cardExchangeRecord.setStatus("0");
|
||||
cardExchangeRecord.setExchangeFrom("积分兑换");
|
||||
cardExchangeRecordService.addCardExchangeRecord(cardExchangeRecord);
|
||||
}else if (integralGift.getGiftType().equals("优惠券")) {
|
||||
// 优惠卷处理
|
||||
integralGift.getCouponId();
|
||||
CardFavorableRecord cardFavorableRecord = new CardFavorableRecord();
|
||||
cardFavorableRecord.setCardFavorableId(integralGift.getCouponId());
|
||||
cardFavorableRecord.setStoreId(integralOrders.getStoreId());
|
||||
cardFavorableRecord.setMtUserId(integralOrders.getUserId());
|
||||
cardFavorableRecord.setName(ljUserVos.getName());
|
||||
cardFavorableRecord.setMobile(ljUserVos.getMobile());
|
||||
cardFavorableRecord.setStatus("0");
|
||||
cardFavorableRecord.setExchangeFrom("积分兑换");
|
||||
cardFavorableRecordService.addCardFavorableRecord(cardFavorableRecord);
|
||||
}
|
||||
|
||||
}
|
||||
// 查询用户信息
|
||||
LJUserVo ljUserVos = ljUserMapper.selectAllInfoById2(listByOrderNo.get(0).getUserId(), listByOrderNo.get(0).getChainStoreId());
|
||||
|
||||
// 用户积分余额变动
|
||||
if (totalPoints.doubleValue() > 0) {
|
||||
@ -457,8 +487,6 @@ public class IntegralOrdersServiceImpl implements IntegralOrdersService {
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
@Override
|
||||
public Boolean checkTheRedemptionLimit(Integer giftId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
|
@ -262,7 +262,7 @@ public class IntegralSettingsServiceImpl implements IntegralSettingsService {
|
||||
// 签到规则
|
||||
JSONArray jsonArray = JSON.parseArray(integralSetting.getPointsObtained());
|
||||
// 查询昨天是否签到
|
||||
List<IntegralDetail> signInGifts = integralDetailMapper.signInGiftsYesterday("签到赠送");
|
||||
List<IntegralDetail> signInGifts = integralDetailMapper.signInGiftsYesterday("签到赠送",ljUserVos.getId(),ljUserVos.getChainStoreId());
|
||||
|
||||
if (ObjectUtil.isEmpty(signInGifts)) {
|
||||
extracted(ljUserVos, jsonArray, 0);
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.member.service.impl;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.member.mapper.LJDutyMapper;
|
||||
import com.fuint.business.member.service.ILJDutyService;
|
||||
@ -16,7 +17,9 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
|
||||
*/
|
||||
@Override
|
||||
public List<TDuty> selectDutyList() {
|
||||
return baseMapper.selectList(null);
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("duty_type","4");
|
||||
return baseMapper.selectList(queryWrapper);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -108,7 +108,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
@Override
|
||||
public void deleteStaffByIds(Integer[] ids) {
|
||||
for (int id : ids){
|
||||
baseMapper.deleteById(id);
|
||||
this.deleteStaffById(id);
|
||||
}
|
||||
}
|
||||
|
||||
@ -118,6 +118,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
*/
|
||||
@Override
|
||||
public void deleteStaffById(Integer id) {
|
||||
LJStaff staff = this.selectStaffById(id);
|
||||
accountService.deleteAccountByUserName(staff.getMobile());
|
||||
baseMapper.deleteById(id);
|
||||
}
|
||||
|
||||
@ -152,7 +154,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
||||
account.setAccountName(staff.getMobile());
|
||||
account.setAccountStatus(1);
|
||||
account.setRealName(staff.getRealName());
|
||||
account.setRoleIds("0");
|
||||
account.setRoleIds(staff.getRoleId());
|
||||
account.setStaffId(staff1.getId());
|
||||
account.setCreateTime(new Date());
|
||||
account.setUpdateTime(new Date());
|
||||
|
@ -743,8 +743,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
|
||||
oilOrder.setTankId(tankId);
|
||||
|
||||
Map<String, Object> applet = null;
|
||||
|
||||
Map<String, Object> applet = new HashMap<>();
|
||||
applet.put("success","");
|
||||
if (!map.get("payAmount").equals("0")) {
|
||||
// 调用支付接口
|
||||
// 判断是否开启支付规则
|
||||
@ -777,6 +777,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
oilOrder.setPayTime(new Date());
|
||||
oilOrder.setOrderStatus("paid");
|
||||
baseMapper.updateById(oilOrder);
|
||||
applet.put("success","ok");
|
||||
}
|
||||
return applet;
|
||||
}
|
||||
@ -885,7 +886,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
Integer dieselGrowthValue = null;
|
||||
Integer naturalGrowthValue = null;
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userid,storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
|
||||
int growth = balance.getGrowthValue();
|
||||
balance.setRefuelMoney(refuelMoney);
|
||||
// 查询会员等级列表信息
|
||||
@ -944,15 +945,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
// 根据用户id查询用户余额信息
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
|
||||
// 修改余额信息
|
||||
Double beforeBalance = balance.getCardBalance();
|
||||
Double afterBalance = beforeBalance - amount;
|
||||
balance.setCardBalance(afterBalance);
|
||||
UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
|
||||
if (ObjectUtil.isNotEmpty(balance)){
|
||||
// 修改余额信息
|
||||
Double beforeBalance = balance.getCardBalance();
|
||||
Double afterBalance = beforeBalance - amount;
|
||||
balance.setCardBalance(afterBalance);
|
||||
// 修改加油次数
|
||||
Integer consumeNum = balance.getConsumeNum();
|
||||
balance.setConsumeNum(consumeNum+1);
|
||||
userBalanceService.updateUserBalance(balance);
|
||||
Integer consumeNum = balance.getConsumeNum();
|
||||
balance.setConsumeNum(consumeNum+1);
|
||||
userBalanceService.updateUserBalance(balance);
|
||||
}
|
||||
|
||||
// 添加余额记录信息
|
||||
CardBalanceChange cardBalanceChange = new CardBalanceChange();
|
||||
cardBalanceChange.setUserId(userId);
|
||||
|
@ -57,7 +57,7 @@ public class ExportController extends BaseController{
|
||||
if (list.size() >= 1) {
|
||||
for (int i = 0; i < list.size(); i++) {
|
||||
LJUserVo user = (LJUserVo) list.get(i);
|
||||
LJUser user1 = service.selectUserByMobile(user.getMobile());
|
||||
LJUserVo user1 = service.selectUserByMobileAndChantStoreId(user.getMobile());
|
||||
if (user1!=null){
|
||||
repeat += 1;
|
||||
}else {
|
||||
|
@ -113,6 +113,17 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据storeId查询会员信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/storeUser/{storeId}")
|
||||
public ResponseObject userVoInfo(@PathVariable Integer storeId){
|
||||
LJUserVo user = userService.queryUserByStoreId(storeId);
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
@GetMapping("/getByUniApp")
|
||||
public ResponseObject getByUniApp(Integer chainStoreId){
|
||||
LJUserVo user = userService.getByUniApp(chainStoreId);
|
||||
@ -128,6 +139,18 @@ public class LJUserController extends BaseController {
|
||||
return getSuccessResult(userBalanceService.getUserBalance());
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@PostMapping("/phone")
|
||||
public ResponseObject userInfoByPhone(@Validated @RequestBody Map<String ,String > map){
|
||||
String mobile = map.get("mobile");
|
||||
LJUserVo user = userService.selectUserByMobileAndChantStoreId(mobile);
|
||||
return getSuccessResult(user);
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据手机号查询会员信息
|
||||
* @param map
|
||||
|
@ -6,16 +6,19 @@ import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.framework.web.BaseController;
|
||||
import com.fuint.framework.web.ResponseObject;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员等级信息 controller层
|
||||
*/
|
||||
@RestController
|
||||
@Slf4j
|
||||
@RequestMapping("/business/userManager/userGrade")
|
||||
public class LJUserGradeController extends BaseController {
|
||||
@Autowired
|
||||
@ -72,13 +75,21 @@ public class LJUserGradeController extends BaseController {
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息
|
||||
* @param id
|
||||
* @param map
|
||||
* @return
|
||||
*/
|
||||
@GetMapping("/isUse/{id}")
|
||||
public ResponseObject userGrade(@PathVariable Integer id){
|
||||
LJUserGrade userGrade = userGradeService.selectUserGradeByIdIsUse(id);
|
||||
return getSuccessResult(userGrade);
|
||||
@PostMapping("/isUse")
|
||||
public ResponseObject userGrade(@RequestBody Map<String,String> map){
|
||||
Map<String, Object> map1 =new HashMap<>();
|
||||
try {
|
||||
Integer userId = Integer.valueOf(map.get("userId"));
|
||||
String storeId = map.get("storeId");
|
||||
String gradeId = map.get("gradeId");
|
||||
map1 = userGradeService.selectUserGradeByIdIsUse(userId, storeId, gradeId);
|
||||
}catch (Exception e){
|
||||
log.error(e.getMessage());
|
||||
}
|
||||
return getSuccessResult(map1);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -28,6 +28,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
*/
|
||||
public List<LJUserVo> queryUserList(@Param("storeId") int storeId);
|
||||
|
||||
/**
|
||||
* 根据手机号和连锁店id查询会员信息
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo selectUserByMobileAndChantStoreId(@Param("mobile") String mobile,@Param("chainStoreId") int chainStoreId);
|
||||
|
||||
/**
|
||||
* 根据id查询用户信息
|
||||
* @param id
|
||||
@ -35,6 +42,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
||||
*/
|
||||
public LJUserVo selectUserById(@Param("id") Integer id);
|
||||
|
||||
/**
|
||||
* 根据连锁店id查询用户信息
|
||||
* @param chainStoreId
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo queryUserByChainStoreId(@Param("userId") int userId,@Param("chainStoreId") int chainStoreId);
|
||||
|
||||
/**
|
||||
* uniapp使用
|
||||
* @param id
|
||||
|
@ -4,22 +4,25 @@
|
||||
<sql id="selectUser">
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,
|
||||
mi.storeId,mi.staffId,mi.inviterId,mi.chain_store_id from mt_user mu
|
||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
left join mt_invitation mi on mu.id = mi.userId
|
||||
mi.storeId,mi.staffId,mi.inviterId,mub.chain_store_id from mt_user mu
|
||||
inner join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
inner join mt_invitation mi on mu.id = mi.userId
|
||||
</sql>
|
||||
<sql id="selectUserAndBalance">
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level
|
||||
FROM mt_user mu
|
||||
LEFT JOIN mt_user_balance mub ON mu.id = mub.mt_user_id
|
||||
</sql>
|
||||
|
||||
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
<include refid="selectUser"></include>
|
||||
<include refid="selectUserAndBalance"></include>
|
||||
<where>
|
||||
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
||||
and mi.chain_store_id = #{user.chainStoreId}
|
||||
and mub.chain_store_id = #{user.chainStoreId}
|
||||
</if>
|
||||
<if test="user.storeId != null and user.storeId != ''">
|
||||
and mi.storeId = #{user.storeId}
|
||||
</if>
|
||||
<if test="user.storeId == 0">
|
||||
and mi.storeId = #{user.storeId}
|
||||
and mub.store_id = #{user.storeId}
|
||||
</if>
|
||||
<if test="user.mobile != null and user.mobile != ''">
|
||||
and mu.mobile like concat('%', #{user.mobile}, '%')
|
||||
@ -57,7 +60,7 @@
|
||||
<!-- 根据手机号查询会员信息-->
|
||||
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||
parameterType="java.lang.String">
|
||||
<include refid="selectUser"></include>
|
||||
<include refid="selectUserAndBalance"></include>
|
||||
<where>
|
||||
mu.mobile = #{mobile}
|
||||
</where>
|
||||
@ -70,6 +73,24 @@
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectUserByMobileAndChantStoreId" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
||||
mub.second_card,mub.fixing_level,mub.chain_store_id from mt_user mu
|
||||
inner join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||
<where>
|
||||
mu.mobile = #{mobile} and
|
||||
mub.chain_store_id = #{chainStoreId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="queryUserByChainStoreId" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
<include refid="selectUserAndBalance"></include>
|
||||
<where>
|
||||
mu.id = #{userId} and
|
||||
mub.chain_store_id = #{chainStoreId}
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectAllInfoById" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||
select mu.*,
|
||||
mub.id balanceId,
|
||||
|
@ -24,12 +24,20 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
|
||||
public CertifiedMember selectCertifiedMemberById(int id);
|
||||
|
||||
/**
|
||||
* 根据会员id查询认证会员信息
|
||||
* 根据会员id和店铺id查询认证会员信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
public CertifiedMember selectCertifiedMemberByUserId(int userId);
|
||||
|
||||
/**
|
||||
* 根据会员id和店铺id查询认证会员信息
|
||||
* @param userId
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(int userId,String storeId);
|
||||
|
||||
/**
|
||||
* 根据固定等级id删除认证会员信息
|
||||
* @param fixingLevelId
|
||||
|
@ -7,6 +7,7 @@ import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* 会员等级信息 业务层
|
||||
@ -47,10 +48,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
||||
|
||||
/**
|
||||
* 根据id查询会员等级信息是否可使用
|
||||
* @param id
|
||||
* @param userId
|
||||
* @param storeId
|
||||
* @param gradeId
|
||||
* @return
|
||||
*/
|
||||
public LJUserGrade selectUserGradeByIdIsUse(int id);
|
||||
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId);
|
||||
|
||||
/**
|
||||
* 根据会员等级名称查询会员等级信息
|
||||
|
@ -28,6 +28,12 @@ public interface LJUserService extends IService<LJUser> {
|
||||
*/
|
||||
LJUser selectUserByUserId();
|
||||
|
||||
/**
|
||||
* 根据id查询用户信息
|
||||
* @return
|
||||
*/
|
||||
LJUser queryUserByUserId(int userId);
|
||||
|
||||
/**
|
||||
*
|
||||
* @return
|
||||
@ -53,6 +59,20 @@ public interface LJUserService extends IService<LJUser> {
|
||||
*/
|
||||
public LJUserVo selectUserById(int id);
|
||||
|
||||
/**
|
||||
* 根据storeId获取连锁店id 根据连锁店id查询用户信息
|
||||
* @param storeId
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo queryUserByStoreId(int storeId);
|
||||
|
||||
/**
|
||||
* 根据手机号和连锁店id查询会员信息
|
||||
* @param mobile
|
||||
* @return
|
||||
*/
|
||||
public LJUserVo selectUserByMobileAndChantStoreId(String mobile);
|
||||
|
||||
|
||||
public LJUserVo getByUniApp(Integer chainStoreId);
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
@ -10,6 +11,7 @@ import com.fuint.business.userManager.entity.LJUser;
|
||||
import com.fuint.business.userManager.mapper.CertifiedMemberMapper;
|
||||
import com.fuint.business.userManager.service.CertifiedMemberService;
|
||||
import com.fuint.business.userManager.service.LJUserService;
|
||||
import com.fuint.business.userManager.vo.LJUserVo;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
import com.fuint.common.util.TokenUtil;
|
||||
@ -57,14 +59,30 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
||||
}
|
||||
|
||||
/**
|
||||
* 根据会员id查询认证会员信息
|
||||
* 根据会员id和店铺id查询认证会员信息
|
||||
* @param userId
|
||||
* @return
|
||||
*/
|
||||
@Override
|
||||
public CertifiedMember selectCertifiedMemberByUserId(int userId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",userId);
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
|
||||
return certifiedMember;
|
||||
}
|
||||
|
||||
@Override
|
||||
public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(int userId, String storeId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.eq("user_id",userId);
|
||||
if (StringUtils.isNotEmpty(storeId)){
|
||||
queryWrapper.eq("store_id",storeId);
|
||||
}else {
|
||||
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
|
||||
}
|
||||
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
|
||||
return certifiedMember;
|
||||
}
|
||||
@ -113,8 +131,8 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
||||
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
|
||||
return 2;
|
||||
}
|
||||
LJUser user = userService.selectUserByMobile(certifiedMember.getMobile());
|
||||
if (user==null){
|
||||
LJUserVo user = userService.selectUserByMobileAndChantStoreId(certifiedMember.getMobile());
|
||||
if (ObjectUtil.isEmpty(user)){
|
||||
return 3;
|
||||
}
|
||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||
|
@ -1,5 +1,6 @@
|
||||
package com.fuint.business.userManager.service.impl;
|
||||
|
||||
import cn.hutool.core.util.ObjectUtil;
|
||||
import com.alibaba.fastjson2.JSONArray;
|
||||
import com.alibaba.fastjson2.JSONObject;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
@ -9,10 +10,14 @@ import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||
import com.fuint.business.storeInformation.entity.LJStore;
|
||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
||||
import com.fuint.business.userManager.entity.CertifiedMember;
|
||||
import com.fuint.business.userManager.entity.ChainStoreConfig;
|
||||
import com.fuint.business.userManager.entity.FixingLevel;
|
||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
|
||||
import com.fuint.business.userManager.service.CertifiedMemberService;
|
||||
import com.fuint.business.userManager.service.ChainStoreConfigService;
|
||||
import com.fuint.business.userManager.service.FixingLevelService;
|
||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||
import com.fuint.common.dto.AccountInfo;
|
||||
import com.fuint.common.util.StringUtils;
|
||||
@ -20,9 +25,12 @@ import com.fuint.common.util.TokenUtil;
|
||||
import com.fuint.repository.model.MtUserGrade;
|
||||
import com.fuint.system.config.service.SysConfigService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.context.annotation.Lazy;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
@Service
|
||||
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
||||
@ -79,21 +87,40 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
||||
private ILJStoreService storeService;
|
||||
@Autowired
|
||||
private ChainStoreConfigService chainStoreConfigService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private CertifiedMemberService certifiedMemberService;
|
||||
@Autowired
|
||||
@Lazy
|
||||
private FixingLevelService fixingLevelService;
|
||||
|
||||
@Override
|
||||
public LJUserGrade selectUserGradeByIdIsUse(int id) {
|
||||
LJStore store = storeService.selectStoreById();
|
||||
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
|
||||
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
|
||||
if (isEnableLevel.equals("yes")){
|
||||
LJUserGrade ljUserGrade = baseMapper.selectById(id);
|
||||
if (ljUserGrade.getStatus().equals("qy")){
|
||||
return baseMapper.selectById(id);
|
||||
}else {
|
||||
return null;
|
||||
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId) {
|
||||
Map<String,Object> res = new HashMap<>();
|
||||
// 查询此会员是否认证固定等级信息
|
||||
CertifiedMember certifiedMember = certifiedMemberService.selectCertifiedMemberByUserIdAndStoreId(userId, storeId);
|
||||
if (ObjectUtil.isNotEmpty(certifiedMember)){
|
||||
FixingLevel fixingLevel = fixingLevelService.selectFixingLevelById(certifiedMember.getFixingLevelId());
|
||||
if (fixingLevel.getStatus().equals("qy")){
|
||||
res.put("fixingLevel",fixingLevel);
|
||||
}
|
||||
}else {
|
||||
LJStore store = storeService.selectStoreById();
|
||||
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
|
||||
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
|
||||
if (isEnableLevel.equals("yes")){
|
||||
if (StringUtils.isNotEmpty(gradeId)){
|
||||
LJUserGrade ljUserGrade = baseMapper.selectById(Integer.valueOf(gradeId));
|
||||
if (ljUserGrade.getStatus().equals("qy")){
|
||||
res.put("userGrade",baseMapper.selectById(Integer.valueOf(gradeId)));
|
||||
return res;
|
||||
}else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return null;
|
||||
return res;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -69,6 +69,11 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return baseMapper.selectById(nowAccountInfo.getId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUser queryUserByUserId(int userId) {
|
||||
return baseMapper.selectById(userId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUser queryUserByUserId() {
|
||||
return null;
|
||||
@ -130,6 +135,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
return baseMapper.selectUserById(id);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUserVo queryUserByStoreId(int storeId) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
return baseMapper.queryUserByChainStoreId(nowAccountInfo.getId(),store.getChainStoreId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public LJUserVo selectUserByMobileAndChantStoreId(String mobile) {
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
|
||||
LJUserVo ljUserVo = new LJUserVo();
|
||||
if (ObjectUtil.isNotEmpty(store)){
|
||||
ljUserVo = baseMapper.selectUserByMobileAndChantStoreId(mobile,store.getChainStoreId());
|
||||
}
|
||||
return ljUserVo;
|
||||
}
|
||||
|
||||
@Resource
|
||||
UserBalanceService userBalanceService;
|
||||
|
||||
@ -249,16 +272,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
user1.setStatus(user.getStatus());
|
||||
user1.setDescription(user.getDescription());
|
||||
user1.setOfficial(user.getOfficial());
|
||||
int row = baseMapper.insert(user1);
|
||||
|
||||
// 查询添加后的用户id
|
||||
// 查询添加后的用户id
|
||||
LJUser ljUser = this.selectUserByMobile(user.getMobile());
|
||||
int row = 0;
|
||||
if (ObjectUtil.isEmpty(ljUser)){
|
||||
row = baseMapper.insert(user1);
|
||||
ljUser = this.selectUserByMobile(user.getMobile());
|
||||
}
|
||||
|
||||
// 根据店铺id查询店铺所对应的连锁店id
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
|
||||
// 添加用户储值卡信息
|
||||
UserBalance balance = new UserBalance();
|
||||
balance.setMtUserId(ljUser.getId());
|
||||
balance.setCardBalance(user.getCardBalance());
|
||||
balance.setPoints(user.getPoints());
|
||||
balance.setStoreId(storeId);
|
||||
balance.setChainStoreId(store.getChainStoreId());
|
||||
if (user.getGradeId()!=null){
|
||||
balance.setGradeId(user.getGradeId());
|
||||
}else {
|
||||
@ -270,17 +301,15 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
||||
balance.setFixingLevel(user.getFixingLevel());
|
||||
balanceService.insertUserBalance(balance);
|
||||
Integer chainStoreId = null;
|
||||
// 根据店铺id查询店铺所对应的连锁店id
|
||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||
if (!ObjectUtil.isEmpty(store)){
|
||||
chainStoreId = store.getChainStoreId();
|
||||
}
|
||||
// 添加邀请注册信息
|
||||
MtInvitation invitation = new MtInvitation();
|
||||
if (ObjectUtil.isNotEmpty(store)){
|
||||
chainStoreId = store.getChainStoreId();
|
||||
invitation.setChainStoreId(chainStoreId);
|
||||
}
|
||||
invitation.setUserId(ljUser.getId());
|
||||
invitation.setStoreId(storeId);
|
||||
invitation.setStaffId(nowAccountInfo.getStaffId());
|
||||
invitation.setChainStoreId(chainStoreId);
|
||||
invitation.setStatus("qy");
|
||||
invitationMapper.insert(invitation);
|
||||
return row;
|
||||
|
@ -61,6 +61,12 @@ public interface AccountService extends IService<TAccount> {
|
||||
*/
|
||||
TAccount selectAccountByUserName(String accountName);
|
||||
|
||||
/**
|
||||
* 根据用户名删除账户信息
|
||||
* @param accountName
|
||||
*/
|
||||
void deleteAccountByUserName(String accountName);
|
||||
|
||||
/**
|
||||
* 获取账号角色ID
|
||||
*
|
||||
|
@ -208,6 +208,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
account.setStoreId(tAccount.getStoreId());
|
||||
account.setDeptId(tAccount.getDeptId());
|
||||
account.setPassword(tAccount.getPassword());
|
||||
account.setStaffId(tAccount.getStaffId());
|
||||
this.entryptPassword(account);
|
||||
int id = tAccountMapper.insert(account);
|
||||
|
||||
@ -234,6 +235,14 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
||||
return baseMapper.selectOne(queryWrapper);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void deleteAccountByUserName(String accountName) {
|
||||
TAccount tAccount = this.selectAccountByUserName(accountName);
|
||||
if (ObjectUtil.isNotEmpty(tAccount)){
|
||||
baseMapper.deleteById(tAccount.getAcctId());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取账号角色ID
|
||||
*
|
||||
|
@ -10,7 +10,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
from sys_dept d
|
||||
where 1=1
|
||||
<if test="dept.deptId != null and dept.deptId != 0">
|
||||
AND dept_id = #{dept.deptId}
|
||||
AND (dept_id = #{dept.deptId} or ancestors like concat (#{ownDeptStr},'%'))
|
||||
</if>
|
||||
<if test="dept.parentId != null and dept.parentId != 0">
|
||||
AND parent_id = #{dept.parentId}
|
||||
@ -21,14 +21,16 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
<if test="dept.status != null and dept.status != ''">
|
||||
AND status = #{dept.status}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
<if test="ownDeptStr != null and ownDeptStr!=''">
|
||||
AND ancestors like concat (#{ownDeptStr},'%')
|
||||
</if>
|
||||
|
||||
|
||||
order by d.parent_id, d.order_num
|
||||
</select>
|
||||
|
||||
|
||||
<!-- <!– 数据范围过滤 –>-->
|
||||
<!-- <if test="ownDeptStr != null and ownDeptStr!=''">-->
|
||||
<!-- AND ancestors like concat (#{ownDeptStr},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- -->
|
||||
<select id="selectDeptListByRoleId" resultType="Long">
|
||||
select d.dept_id
|
||||
from sys_dept d
|
||||
|
@ -54,7 +54,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptMapper,SysDept> imple
|
||||
{
|
||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||
SysDept sysDept = baseMapper.selectDeptById(nowAccountInfo.getDeptId());
|
||||
return baseMapper.selectDeptList(dept,sysDept.getAncestors());
|
||||
StringBuilder ancestors = new StringBuilder();
|
||||
ancestors.append(sysDept.getAncestors()).append(",").append(nowAccountInfo.getDeptId());
|
||||
return baseMapper.selectDeptList(dept,ancestors.toString());
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -1,8 +1,8 @@
|
||||
# \u57FA\u672C\u914D\u7F6E
|
||||
server.port=8008
|
||||
server.port=8080
|
||||
env.profile=dev
|
||||
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
||||
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||
|
||||
|
||||
|
||||
|
@ -1,31 +1,47 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.fuint.repository.mapper.TAccountMapper">
|
||||
<!-- <select id="listAccount" resultType="com.fuint.repository.model.TAccount">-->
|
||||
<!-- SELECT-->
|
||||
<!-- ta.*,sd.dept_name-->
|
||||
<!-- FROM-->
|
||||
<!-- `t_account` ta-->
|
||||
<!-- left join sys_dept sd on sd.dept_id = ta.dept_id-->
|
||||
<!-- <if test="accountInfo.realName != null and accountInfo.realName != ''">-->
|
||||
<!-- AND ta.real_name = like concat('%',#{accountInfo.realName},'%')-->
|
||||
<!-- </if>-->
|
||||
<!-- <if test="accountInfo.deptId != null">-->
|
||||
<!-- AND ta.dept_id = #{accountInfo.deptId}-->
|
||||
<!-- </if>-->
|
||||
<!-- <!– 数据范围过滤 –>-->
|
||||
<!-- <if test="ancestors != null and ancestors!=''">-->
|
||||
<!-- AND sd.ancestors like concat (#{ancestors},'%')-->
|
||||
<!-- </if>-->
|
||||
|
||||
<!-- order by create_time desc-->
|
||||
|
||||
<!-- </select>-->
|
||||
<!--<!– where account_status != -1–>-->
|
||||
|
||||
|
||||
<select id="listAccount" resultType="com.fuint.repository.model.TAccount">
|
||||
SELECT
|
||||
ta.*,sd.dept_name
|
||||
FROM
|
||||
`t_account` ta
|
||||
left join sys_dept sd on sd.dept_id = ta.dept_id
|
||||
|
||||
|
||||
SELECT
|
||||
ta.*,sd.dept_name
|
||||
FROM
|
||||
`t_account` ta
|
||||
left join sys_dept sd on sd.dept_id = ta.dept_id
|
||||
where account_status != -1
|
||||
<if test="accountInfo.realName != null and accountInfo.realName != ''">
|
||||
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
|
||||
</if>
|
||||
<if test="accountInfo.deptId != null">
|
||||
AND ta.dept_id = #{accountInfo.deptId}
|
||||
</if>
|
||||
<!-- 数据范围过滤 -->
|
||||
<if test="ancestors != null and ancestors!=''">
|
||||
AND sd.ancestors like concat (#{ancestors},'%')
|
||||
</if>
|
||||
|
||||
order by create_time desc
|
||||
<if test="accountInfo.realName != null and accountInfo.realName != ''">
|
||||
AND ta.real_name = like concat('%',#{accountInfo.realName},'%')
|
||||
</if>
|
||||
<if test="accountInfo.deptId != null">
|
||||
AND (ta.dept_id = #{accountInfo.deptId} or FIND_IN_SET(#{accountInfo.deptId}, sd.ancestors))
|
||||
</if>
|
||||
|
||||
order by create_time desc
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getStationmasterByStoreId" resultType="com.fuint.repository.model.TAccount">
|
||||
select
|
||||
ta.*
|
||||
|
@ -26,6 +26,15 @@ export function getUserVoMobile(data) {
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserInfoMobile(data) {
|
||||
return request({
|
||||
url: '/business/userManager/user/phone',
|
||||
method: 'post',
|
||||
data: data
|
||||
})
|
||||
}
|
||||
|
||||
// 根据手机号查询会员详细
|
||||
export function getUserVoName(data) {
|
||||
return request({
|
||||
|
@ -18,10 +18,11 @@ export function getUserGrade(id) {
|
||||
}
|
||||
|
||||
// 查询会员等级详细是否能使用
|
||||
export function userGradeInfo(id) {
|
||||
export function userGradeInfo(data) {
|
||||
return request({
|
||||
url: '/business/userManager/userGrade/isUse/' + id,
|
||||
method: 'get'
|
||||
url: '/business/userManager/userGrade/isUse',
|
||||
method: 'post',
|
||||
data:data,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -35,6 +35,11 @@ export const constantRoutes = [
|
||||
component: () => import('@/views/login/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/',
|
||||
component: () => import('@/views/login/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/404',
|
||||
component: () => import('@/views/error/404'),
|
||||
|
@ -581,7 +581,9 @@ import {
|
||||
// 获取当前账户信息
|
||||
getStaff(){
|
||||
staffInfo().then( response => {
|
||||
this.staff = response.data;
|
||||
// this.staff = response.data;
|
||||
console.log("response",response.data.accountInfo)
|
||||
this.staff = response.data.accountInfo;
|
||||
// this.map.staffId = this.staff.id;
|
||||
})
|
||||
},
|
||||
|
@ -786,7 +786,7 @@
|
||||
import {getDicts} from "@/api/dict/data";
|
||||
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
|
||||
import {listgoods} from "@/api/cashier/ljgoods";
|
||||
import {getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
||||
import {getUserInfoMobile, getUserVoMobile, getUserVoName} from "@/api/cashier/user";
|
||||
import {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
||||
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
|
||||
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
|
||||
@ -1451,228 +1451,456 @@
|
||||
this.handleChange();
|
||||
},
|
||||
// 根据会员等级信息获取等级优惠信息
|
||||
getGrade(id){
|
||||
getGrade(userId,gradeId){
|
||||
let _this = this;
|
||||
this.oilDiscount = 0;
|
||||
this.gradeDiscount = [];
|
||||
userGradeInfo(id).then(response => {
|
||||
userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => {
|
||||
let gasolineDiscount = 0;
|
||||
let dieselDiscount = 0;
|
||||
let naturalGasDiscount = 0;
|
||||
_this.gradeDiscount = [];
|
||||
if (response.data!=null) {
|
||||
if (response.data) {
|
||||
_this.oilOrder.forEach(item => {
|
||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||
if (item.type == "汽油") {
|
||||
let gasolineRule = JSON.parse(response.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
if (response.data.fixingLevel){
|
||||
let gasolineRule = JSON.parse(response.data.fixingLevel.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.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 if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade) {
|
||||
let gasolineRule = JSON.parse(response.data.userGrade.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.gasolineDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.gasolineDiscount == "每升优惠") {
|
||||
discount.type = "每升优惠"
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (gasolineRule.length > 1) {
|
||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
}
|
||||
}
|
||||
gasolineDiscount += +oilDiscount
|
||||
} else {
|
||||
gasolineDiscount = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "柴油") {
|
||||
let dieselRule = JSON.parse(response.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
if (response.data.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
if (response.data.fixingLevel){
|
||||
let dieselRule = JSON.parse(response.data.fixingLevel.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
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) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.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) {
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
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 (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('每升优惠')
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade) {
|
||||
let dieselRule = JSON.parse(response.data.userGrade.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.dieselDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.dieselDiscount == "每升优惠") {
|
||||
let oilDiscount = 0;
|
||||
for (let i = 1; i <= dieselRule.length; i++) {
|
||||
discount.type = "每升优惠"
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (dieselRule.length > 1) {
|
||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.reduce = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
} else {
|
||||
discount.full = dieselRule[i - 1].dieselRule1
|
||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
discount.liters = dieselRule[i - 1].dieselRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每升优惠')
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
}
|
||||
}
|
||||
dieselDiscount += +oilDiscount
|
||||
} else {
|
||||
dieselDiscount = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
if (item.type == "天然气") {
|
||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
||||
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 = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
if (response.data.fixingLevel){
|
||||
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.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 if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
|
||||
}else {
|
||||
if (response.data.userGrade.userGrade) {
|
||||
let naturalGasRule = JSON.parse(response.data.userGrade.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (response.data.userGrade.preferential == '自定义优惠' && response.data.userGrade.status == 'qy') {
|
||||
if (response.data.userGrade.naturalGasDiscount == "满减优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "满减优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('满减优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else if (response.data.userGrade.naturalGasDiscount == "每单位优惠") {
|
||||
let oilDiscount = 0;
|
||||
discount.type = "每单位优惠"
|
||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||
// 将满减条件加入等级优惠列表
|
||||
if (naturalGasRule.length > 1) {
|
||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
||||
break;
|
||||
}
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
} else {
|
||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||
}
|
||||
}
|
||||
}
|
||||
if (discount.reduce != 0) {
|
||||
_this.gradeDiscount.push(discount)
|
||||
_this.checkedCities2.push('每单位优惠')
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
}
|
||||
}
|
||||
naturalGasDiscount += +oilDiscount
|
||||
} else {
|
||||
naturalGasDiscount = 0;
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -1690,7 +1918,7 @@
|
||||
this.map.payUser = data.mobile;
|
||||
this.map.userId = data.id;
|
||||
this.balance = this.member.cardBalance;
|
||||
this.getGrade(data.gradeId)
|
||||
this.getGrade(data.id,data.gradeId)
|
||||
this.changeRefuelMoney();
|
||||
this.handleChange();
|
||||
this.preferentialData.storeId = data.storeId;
|
||||
@ -2114,7 +2342,7 @@
|
||||
this.oilTotal = this.oilOrder.length;
|
||||
this.select = "元";
|
||||
if (this.isMember){
|
||||
this.getGrade(this.member.gradeId)
|
||||
this.getGrade(this.member.id,this.member.gradeId)
|
||||
this.changeRefuelMoney();
|
||||
if (this.oilOrder.length>0){
|
||||
this.preferential();
|
||||
@ -2211,7 +2439,7 @@
|
||||
// 根据手机号查询会员信息
|
||||
getUser(){
|
||||
if(this.select1=="会员手机号"){
|
||||
getUserVoMobile({mobile:this.userNo}).then( response => {
|
||||
getUserInfoMobile({mobile:this.userNo}).then( response => {
|
||||
if (response.data!=null){
|
||||
this.member = response.data
|
||||
}else {
|
||||
|
@ -214,7 +214,7 @@
|
||||
if (uni.getStorageSync("storeId")) {
|
||||
this.storeId = uni.getStorageSync("storeId")
|
||||
} else {
|
||||
let storeId = "19";
|
||||
let storeId = "24";
|
||||
uni.setStorageSync("storeId", storeId)
|
||||
}
|
||||
}
|
||||
|
@ -117,7 +117,7 @@
|
||||
show: false,
|
||||
pic: 0,
|
||||
hindex: 0,
|
||||
qindex: null,
|
||||
qindex: 0,
|
||||
aindex: null,
|
||||
sindex: null,
|
||||
// 店铺信息
|
||||
@ -168,7 +168,7 @@
|
||||
},
|
||||
onLoad(query) {
|
||||
const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
|
||||
if (q == undefined) {
|
||||
if (query.q) {
|
||||
let str = q.split("?")[1];
|
||||
let arr = str.split("&");
|
||||
let storeId = "";
|
||||
@ -184,6 +184,9 @@
|
||||
uni.setStorageSync("inviteStaffId", staffId)
|
||||
this.storeId = uni.getStorageSync("storeId")
|
||||
this.staffId = uni.getStorageSync("inviteStaffId")
|
||||
uni.showLoading({
|
||||
title:storeId +"++"+staffId
|
||||
})
|
||||
}
|
||||
},
|
||||
onShow() {
|
||||
|
@ -49,11 +49,11 @@
|
||||
<view class="gang-box">
|
||||
<view class="left-size">快递单号</view>
|
||||
|
||||
<view class="right-size" v-if="shippingType == '物流配送'">
|
||||
<view class="right-size" v-if="form.shippingType == '物流配送'">
|
||||
|
||||
<span>{{form.courierCompanies}}{{form.theTrackingNumber}}</span>
|
||||
</view>
|
||||
<view class="right-size" else>门店自提</view>
|
||||
<view v-else class="right-size">门店自提</view>
|
||||
</view>
|
||||
<view class="gang-box">
|
||||
<view class="left-size">兑换时间</view>
|
||||
|
@ -204,6 +204,14 @@
|
||||
let _this = this
|
||||
let integralOrdersList = []
|
||||
|
||||
if (_this.value <= 0) {
|
||||
uni.showToast({
|
||||
title: "请选择商品!",
|
||||
icon: "error"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
let integralOrders = {
|
||||
giftId: this.goodsInfo.id,
|
||||
amount: _this.allAmout,
|
||||
@ -216,6 +224,27 @@
|
||||
shippingType: _this.shippingType,
|
||||
|
||||
}
|
||||
if (this.shippingType == "物流配送") {
|
||||
if (addrInfo) {
|
||||
integralOrders.addressId = addrInfo.id
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: "请填写配送信息!",
|
||||
icon: "error"
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
let check = await this.checkTheRedemptionLimit(this.goodsInfo.id)
|
||||
if (check) {
|
||||
uni.showToast({
|
||||
title: "达到兑换上限!",
|
||||
icon: "error"
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
integralOrdersList.push(integralOrders)
|
||||
request({
|
||||
url: "business/integral/integralOrders/integralOrdersProcessingUni",
|
||||
|
@ -137,7 +137,7 @@
|
||||
map: {
|
||||
page: 1,
|
||||
pageSize: 10,
|
||||
storeId: "",
|
||||
storeId: uni.getStorageSync("storeId"),
|
||||
orderStatus: "",
|
||||
remark: "",
|
||||
},
|
||||
|
@ -58,7 +58,7 @@
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="desc" >
|
||||
<view class="desc" v-if="isFullPreferential">
|
||||
<view style="display: flex;">
|
||||
活动优惠
|
||||
<!-- <span style="display: flex;">(满减活动)</span> -->
|
||||
@ -81,12 +81,13 @@
|
||||
<view class="desc" v-if="isGradePreferential">
|
||||
<view style="display: flex;">
|
||||
会员等级优惠
|
||||
<span style="display: flex;">({{userGrade.name}})</span>
|
||||
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
||||
</view>
|
||||
<view style="display: flex;">
|
||||
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
||||
</view>
|
||||
</view>
|
||||
<view class="desc" v-if="!isFullPreferential && !isGradePreferential && !isOilStorageCard && !isStoreValueCard">无优惠</view>
|
||||
|
||||
<view style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
||||
</view>
|
||||
@ -184,17 +185,21 @@
|
||||
isStoreValueCard:false,
|
||||
// 是否存在可使用的等级优惠
|
||||
isGradePreferential:false,
|
||||
// 是否存在可使用的满减或折扣优惠
|
||||
isFullPreferential:false,
|
||||
transferDTO:{
|
||||
type:0,
|
||||
amount:0,
|
||||
oilId:"",
|
||||
mtUserLevel:"",
|
||||
}
|
||||
storeId:uni.getStorageSync("storeId")
|
||||
},
|
||||
fixingLevel:{},
|
||||
}
|
||||
},
|
||||
onLoad(e) {
|
||||
this.orderNo = e.orderNo
|
||||
// this.orderNo = "234520231229140854e4c4ca"
|
||||
// this.orderNo = "234520240104104141863b59"
|
||||
},
|
||||
onShow() {
|
||||
this.getOilOrder();
|
||||
@ -225,13 +230,19 @@
|
||||
method: 'post',
|
||||
data: map,
|
||||
}).then(res => {
|
||||
console.log(res,_this.appltType)
|
||||
// console.log(res,_this.appltType)
|
||||
let payProvider = "wxpay"
|
||||
if (_this.appltType== "WECHAT"){
|
||||
payProvider = "wxpay"
|
||||
}else{
|
||||
payProvider = "alipay"
|
||||
}
|
||||
if(res.data.success == "ok"){
|
||||
uni.reLaunch({
|
||||
url: '/pagesRefuel/orderSuccess/index'
|
||||
})
|
||||
return;
|
||||
}
|
||||
if (res.data.data.reservedPayInfo){
|
||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||
uni.requestPayment({
|
||||
@ -310,7 +321,7 @@
|
||||
})
|
||||
if (falg == false) {
|
||||
this.chooseCardBalance(0)
|
||||
this.chooseGrade(this.user.gradeId)
|
||||
this.chooseGrade(this.user.id,this.user.gradeId)
|
||||
}
|
||||
},
|
||||
// 查看是否有可使用的储值卡金额
|
||||
@ -326,7 +337,6 @@
|
||||
this.deductAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||
}
|
||||
this.preferential.amount = this.deductAmount
|
||||
}else{
|
||||
// 使用囤油卡
|
||||
// 扣除囤油卡金额后需要支付的金额
|
||||
@ -344,152 +354,297 @@
|
||||
}
|
||||
},
|
||||
// 查看是否有可使用的会员等级优惠
|
||||
chooseGrade(id){
|
||||
chooseGrade(userId,gradeId){
|
||||
let that = this;
|
||||
request({
|
||||
url: "business/userManager/userGrade/isUse/" + id,
|
||||
method: 'get',
|
||||
url: "business/userManager/userGrade/isUse",
|
||||
method: 'post',
|
||||
data:{userId:userId,gradeId:gradeId,storeId:that.oilOrder.storeId}
|
||||
}).then((res) => {
|
||||
if (res.data != null && res.data != ""){
|
||||
that.userGrade = res.data
|
||||
that.chooseFullOrCoupon();
|
||||
if (res.data.preferential== "自定义优惠"){
|
||||
if (that.oilType == "汽油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (res.data.gasolineDiscount == "满减优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (res.data){
|
||||
if (res.data.fixingLevel){
|
||||
if (res.data.fixingLevel.discountType== "自定义优惠"){
|
||||
if (that.oilType == "汽油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let gasolineRule = JSON.parse(res.data.fixingLevel.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (res.data.fixingLevel.gasolineDiscount == "满减优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.gasolineDiscount == "每升优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (res.data.fixingLevel.gasolineDiscount == "每升优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (that.oilType == "柴油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let dieselRule = JSON.parse(res.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (res.data.dieselDiscount == "满减优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (that.oilType == "柴油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let dieselRule = JSON.parse(res.data.fixingLevel.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = dieselRule[i - 1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = dieselRule[i - 1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.dieselDiscount == "每升优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (res.data.fixingLevel.dieselDiscount == "每升优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (that.oilType == "天然气"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let naturalGasRule = JSON.parse(res.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (res.data.naturalGasDiscount == "满减优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (that.oilType == "天然气"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let naturalGasRule = JSON.parse(res.data.fixingLevel.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.naturalGasDiscount == "每升优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (res.data.fixingLevel.naturalGasDiscount == "每升优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if(res.data.userGrade){
|
||||
that.userGrade = res.data.userGrade
|
||||
that.chooseFullOrCoupon();
|
||||
if (res.data.userGrade.preferential== "自定义优惠"){
|
||||
if (that.oilType == "汽油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let gasolineRule = JSON.parse(res.data.userGrade.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||
if (res.data.userGrade.gasolineDiscount == "满减优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = gasolineRule[i - 1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.userGrade.gasolineDiscount == "每升优惠"){
|
||||
if (gasolineRule.length > 1){
|
||||
for (let i = 1; i<gasolineRule.length; i++){
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= gasolineRule[i - 1].gasolineRule1 && that.deductAmount < gasolineRule[i].gasolineRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (that.oilType == "柴油"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let dieselRule = JSON.parse(res.data.userGrade.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||
if (res.data.userGrade.dieselDiscount == "满减优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = dieselRule[i - 1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.userGrade.dieselDiscount == "每升优惠"){
|
||||
if (dieselRule.length > 1){
|
||||
for (let i = 1; i<dieselRule.length; i++){
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= dieselRule[i - 1].dieselRule1 && that.deductAmount < dieselRule[i].dieselRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (that.oilType == "天然气"){
|
||||
// 将数组按照金额从小到大排序
|
||||
let naturalGasRule = JSON.parse(res.data.userGrade.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||
if (res.data.userGrade.naturalGasDiscount == "满减优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = naturalGasRule[i - 1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
if (res.data.userGrade.naturalGasDiscount == "每升优惠"){
|
||||
if (naturalGasRule.length > 1){
|
||||
for (let i = 1; i<naturalGasRule.length; i++){
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
// 计算升数 和 优惠金额
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
break;
|
||||
}
|
||||
if (that.deductAmount >= naturalGasRule[i - 1].naturalGasRule1 && that.deductAmount < naturalGasRule[i].naturalGasRule1) {
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}else{
|
||||
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||
that.isGradePreferential = true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
that.countPayMent()
|
||||
}
|
||||
})
|
||||
@ -499,17 +654,17 @@
|
||||
this.transferDTO.amount = this.deductAmount
|
||||
this.transferDTO.mtUserLevel = this.userGrade.id
|
||||
this.transferDTO.oilId = this.oilId
|
||||
console.log(this.transferDTO)
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/marketingActivity/activeExchange/test",
|
||||
method: 'post',
|
||||
data:_this.transferDTO,
|
||||
}).then((res) => {
|
||||
console.log(res)
|
||||
if (res.data.amount!=0){
|
||||
// console.log(res)
|
||||
if (res.data.amount>0){
|
||||
_this.payAmount = res.data.amount - _this.gradeRedece
|
||||
_this.fullRedece = res.data.favorableAmount
|
||||
_this.isFullPreferential = true
|
||||
}
|
||||
})
|
||||
},
|
||||
@ -523,7 +678,7 @@
|
||||
getUser(id){
|
||||
let _this = this;
|
||||
request({
|
||||
url: "business/userManager/user/" + id,
|
||||
url: "business/userManager/user/storeUser/" + _this.oilOrder.storeId,
|
||||
method: 'get',
|
||||
}).then((res) => {
|
||||
_this.user = res.data;
|
||||
|
@ -27,7 +27,7 @@
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
timestamp:5,
|
||||
timestamp:3,
|
||||
}
|
||||
},
|
||||
onLoad() {
|
||||
@ -44,7 +44,7 @@
|
||||
if(_this.timestamp === 0) {
|
||||
_this.goBack()
|
||||
clearInterval(timer)
|
||||
_this.timestamp = 5
|
||||
_this.timestamp = 3
|
||||
}
|
||||
}, 1000);
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user