优化项
This commit is contained in:
parent
dd15966c48
commit
cff6a8942b
@ -42,6 +42,14 @@ export function getUserMobile(data) {
|
|||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 根据手机号查询会员详细
|
||||||
|
export function getUserPhone(data) {
|
||||||
|
return request({
|
||||||
|
url: '/business/userManager/user/phone' ,
|
||||||
|
method: 'post',
|
||||||
|
data: data
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// 新增会员
|
// 新增会员
|
||||||
export function addUser(data) {
|
export function addUser(data) {
|
||||||
|
@ -38,18 +38,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<!-- <el-form-item>-->
|
||||||
<el-date-picker
|
<!-- <el-date-picker-->
|
||||||
v-model="dateRange"
|
<!-- v-model="dateRange"-->
|
||||||
style="width: 240px"
|
<!-- style="width: 240px"-->
|
||||||
size="medium"
|
<!-- size="medium"-->
|
||||||
value-format="yyyy-MM-dd"
|
<!-- value-format="yyyy-MM-dd"-->
|
||||||
type="daterange"
|
<!-- type="daterange"-->
|
||||||
range-separator="-"
|
<!-- range-separator="-"-->
|
||||||
start-placeholder="开始日期"
|
<!-- start-placeholder="开始日期"-->
|
||||||
end-placeholder="结束日期"
|
<!-- end-placeholder="结束日期"-->
|
||||||
></el-date-picker>
|
<!-- ></el-date-picker>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQueryMember">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQueryMember">搜索</el-button>
|
||||||
@ -73,18 +73,18 @@
|
|||||||
/>
|
/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item>
|
<!-- <el-form-item>-->
|
||||||
<el-date-picker
|
<!-- <el-date-picker-->
|
||||||
v-model="dateRange"
|
<!-- v-model="dateRange"-->
|
||||||
style="width: 240px"
|
<!-- style="width: 240px"-->
|
||||||
size="medium"
|
<!-- size="medium"-->
|
||||||
value-format="yyyy-MM-dd"
|
<!-- value-format="yyyy-MM-dd"-->
|
||||||
type="daterange"
|
<!-- type="daterange"-->
|
||||||
range-separator="-"
|
<!-- range-separator="-"-->
|
||||||
start-placeholder="开始日期"
|
<!-- start-placeholder="开始日期"-->
|
||||||
end-placeholder="结束日期"
|
<!-- end-placeholder="结束日期"-->
|
||||||
></el-date-picker>
|
<!-- ></el-date-picker>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
|
|
||||||
<el-form-item>
|
<el-form-item>
|
||||||
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
|
||||||
|
@ -2,11 +2,11 @@
|
|||||||
<div class="app-container">
|
<div class="app-container">
|
||||||
<el-card >
|
<el-card >
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||||
<el-form-item label="来源油站" prop="storeIds">
|
<!-- <el-form-item label="来源油站" prop="storeIds">-->
|
||||||
<el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">
|
<!-- <el-select v-model="queryParams.storeId" filterable clearable placeholder="来源油站" style="width: 100%;">-->
|
||||||
<el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>
|
<!-- <el-option v-for="item in storeList" :key="item.id" :label="item.name" :value="item.id"/>-->
|
||||||
</el-select>
|
<!-- </el-select>-->
|
||||||
</el-form-item>
|
<!-- </el-form-item>-->
|
||||||
<el-form-item label="会员号" prop="userNo">
|
<el-form-item label="会员号" prop="userNo">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.userNo"
|
v-model="queryParams.userNo"
|
||||||
@ -448,7 +448,7 @@ import {
|
|||||||
delUser,
|
delUser,
|
||||||
exportUsers,
|
exportUsers,
|
||||||
getUser,
|
getUser,
|
||||||
getUserMobile,
|
getUserMobile, getUserPhone,
|
||||||
listStatistic,
|
listStatistic,
|
||||||
listUser, listUserStatistic,
|
listUser, listUserStatistic,
|
||||||
updateUser
|
updateUser
|
||||||
@ -732,8 +732,8 @@ export default {
|
|||||||
this.getList();
|
this.getList();
|
||||||
});
|
});
|
||||||
} else {
|
} else {
|
||||||
getUserMobile({mobile:this.form.mobile}).then( response => {
|
getUserPhone({mobile:this.form.mobile}).then( response => {
|
||||||
if(response.data!=null){
|
if(response.data){
|
||||||
this.$modal.msgError("手机号已存在");
|
this.$modal.msgError("手机号已存在");
|
||||||
}else {
|
}else {
|
||||||
addUser(this.form).then(response => {
|
addUser(this.form).then(response => {
|
||||||
|
@ -14,7 +14,7 @@
|
|||||||
<div style="display: flex;margin-top: 20px">
|
<div style="display: flex;margin-top: 20px">
|
||||||
<div class="left">
|
<div class="left">
|
||||||
<div>
|
<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">
|
<img v-else src="@/assets/images/avatar.png" style="width: 80px;height: 80px">
|
||||||
</div>
|
</div>
|
||||||
<el-button type="warning" plain round size="mini" style="margin: 10px" @click="bindIdCard">绑定实体卡</el-button><br>
|
<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>
|
<span style="color: #00afff" @click="changeName">{{form.name ? form.name : "--"}}</span>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="实体卡号">{{form.idcard ? form.idcard : "--"}}</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="会员状态">
|
<el-descriptions-item label="会员状态">
|
||||||
<dict-tag :options="dict.type.zhzt" :value="form.status"/>
|
<dict-tag :options="dict.type.zhzt" :value="form.status"/>
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
@ -43,10 +43,10 @@
|
|||||||
<el-descriptions-item label="会员等级">
|
<el-descriptions-item label="会员等级">
|
||||||
{{ grade.name }}
|
{{ grade.name }}
|
||||||
</el-descriptions-item>
|
</el-descriptions-item>
|
||||||
<el-descriptions-item label="储值优惠">--</el-descriptions-item>
|
<!-- <el-descriptions-item label="储值优惠">--</el-descriptions-item>-->
|
||||||
<el-descriptions-item label="每日笔数">
|
<!-- <el-descriptions-item label="每日笔数">-->
|
||||||
<span style="color: #00afff" @click="configuration">跟随全局总配置</span>
|
<!-- <span style="color: #00afff" @click="configuration">跟随全局总配置</span>-->
|
||||||
</el-descriptions-item>
|
<!-- </el-descriptions-item>-->
|
||||||
<el-descriptions-item label="固定等级">
|
<el-descriptions-item label="固定等级">
|
||||||
<span style="color: #00afff" @click="level">
|
<span style="color: #00afff" @click="level">
|
||||||
{{form.fixingLevel ? fixingLevelinfo(fixingLevelList,form.fixingLevel) : "--"}}
|
{{form.fixingLevel ? fixingLevelinfo(fixingLevelList,form.fixingLevel) : "--"}}
|
||||||
@ -716,6 +716,7 @@ export default {
|
|||||||
dicts: ['official','zhzt','zcrzdj','payment_type'],
|
dicts: ['official','zhzt','zcrzdj','payment_type'],
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
|
baseUrl:process.env.VUE_APP_BASE_API,
|
||||||
flag:null,
|
flag:null,
|
||||||
fixingLevelList:[],
|
fixingLevelList:[],
|
||||||
// 充值余额列表
|
// 充值余额列表
|
||||||
|
@ -166,18 +166,18 @@
|
|||||||
<el-col :span="8">
|
<el-col :span="8">
|
||||||
<el-form-item label="角色组" prop="roleId">
|
<el-form-item label="角色组" prop="roleId">
|
||||||
<el-select v-model="form.roleId" placeholder="请选择角色">
|
<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
|
<el-option
|
||||||
v-for="dict in dict.type.staff_role"
|
v-for="item in roleList"
|
||||||
:key="dict.value"
|
:key="item.dutyId"
|
||||||
:label="dict.label"
|
:label="item.dutyName"
|
||||||
:value="dict.value"
|
: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-option value="收银员">收银员</el-option>-->
|
<!-- <el-option value="收银员">收银员</el-option>-->
|
||||||
</el-select>
|
</el-select>
|
||||||
@ -569,7 +569,7 @@
|
|||||||
:title="title"
|
:title="title"
|
||||||
:visible.sync="dialogVisible"
|
:visible.sync="dialogVisible"
|
||||||
style="margin-top: 100px"
|
style="margin-top: 100px"
|
||||||
width="20%">
|
width="23%">
|
||||||
<div style="text-align: center">
|
<div style="text-align: center">
|
||||||
<img id="qrCodeImg" class="qrcode" :src="baseUrl+imgUrl" />
|
<img id="qrCodeImg" class="qrcode" :src="baseUrl+imgUrl" />
|
||||||
</div>
|
</div>
|
||||||
@ -987,8 +987,8 @@ export default {
|
|||||||
margin-bottom: 20px;
|
margin-bottom: 20px;
|
||||||
}
|
}
|
||||||
.qrcode{
|
.qrcode{
|
||||||
width: 200px;
|
width: 80%;
|
||||||
height: 300px;
|
margin: 0 auto;
|
||||||
margin-top: 15px;
|
margin-top: 15px;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -29,7 +29,7 @@ export function addIndexBanner(data) {
|
|||||||
// 修改首页轮播图信息
|
// 修改首页轮播图信息
|
||||||
export function updateIndexBanner(data) {
|
export function updateIndexBanner(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/indexBanner/lists',
|
url: '/business/indexBanner',
|
||||||
method: 'put',
|
method: 'put',
|
||||||
data: data
|
data: data
|
||||||
})
|
})
|
||||||
|
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>
|
<div>
|
||||||
<el-card class="card">
|
<el-card class="card">
|
||||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" label-width="68px">
|
||||||
<el-form-item label="店铺" prop="name">
|
<el-form-item label="店铺" prop="storeId">
|
||||||
<el-input
|
<el-select v-model="queryParams.storeId" placeholder="请选择店铺" style="width: 100%">
|
||||||
v-model="queryParams.realName"
|
<el-option v-for="item in storeList"
|
||||||
placeholder="请输入姓名"
|
:key="item.id" clearable
|
||||||
clearable
|
:label="item.name" :value="item.id"
|
||||||
style="width: 240px;"
|
@keyup.enter.native="handleQuery"></el-option>
|
||||||
@keyup.enter.native="handleQuery"
|
</el-select>
|
||||||
/>
|
|
||||||
</el-form-item>
|
</el-form-item>
|
||||||
<el-form-item label="路由" prop="mobile">
|
<el-form-item label="路由" prop="routeUrl">
|
||||||
<el-input
|
<el-input
|
||||||
v-model="queryParams.mobile"
|
v-model="queryParams.routeUrl"
|
||||||
placeholder="请输入手机号"
|
placeholder="请输入路由地址"
|
||||||
clearable
|
clearable
|
||||||
style="width: 240px;"
|
style="width: 240px;"
|
||||||
@keyup.enter.native="handleQuery"
|
@keyup.enter.native="handleQuery"
|
||||||
@ -44,7 +43,12 @@
|
|||||||
<span>{{scope.row.storeId ? storeName(storeList,scope.row.storeId) : "--"}}</span>
|
<span>{{scope.row.storeId ? storeName(storeList,scope.row.storeId) : "--"}}</span>
|
||||||
</template>
|
</template>
|
||||||
</el-table-column>
|
</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="routeUrl" />
|
||||||
<el-table-column label="备注" align="center" prop="remark" >
|
<el-table-column label="备注" align="center" prop="remark" >
|
||||||
<template slot-scope="scope">
|
<template slot-scope="scope">
|
||||||
@ -57,7 +61,7 @@
|
|||||||
size="mini"
|
size="mini"
|
||||||
type="text"
|
type="text"
|
||||||
icon="el-icon-edit"
|
icon="el-icon-edit"
|
||||||
@click="handleUpdate(scope.row)"
|
@click="handleUpdate(scope.row.id)"
|
||||||
>修改</el-button>
|
>修改</el-button>
|
||||||
<el-button
|
<el-button
|
||||||
size="mini"
|
size="mini"
|
||||||
@ -79,12 +83,29 @@
|
|||||||
</el-card>
|
</el-card>
|
||||||
|
|
||||||
<el-dialog
|
<el-dialog
|
||||||
:title="title"
|
:title="title" width="35%"
|
||||||
:visible.sync="dialogVisible">
|
: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">
|
<span slot="footer" class="dialog-footer">
|
||||||
<el-button @click="dialogVisible = false">取 消</el-button>
|
<el-button @click="clear">取 消</el-button>
|
||||||
<el-button type="primary" @click="dialogVisible = false">确 定</el-button>
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
||||||
</span>
|
</span>
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
|
||||||
@ -92,10 +113,18 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import {listIndexBanner} from "@/api/indexBanner/indexBanner";
|
import {
|
||||||
|
addIndexBanner,
|
||||||
|
deleteIndexBanner,
|
||||||
|
indexBannerInfo,
|
||||||
|
listIndexBanner,
|
||||||
|
updateIndexBanner
|
||||||
|
} from "@/api/indexBanner/indexBanner";
|
||||||
import {ljStoreList} from "@/api/indexBanner/ljstore";
|
import {ljStoreList} from "@/api/indexBanner/ljstore";
|
||||||
|
import imgUpload from "@/views/indexBanner/imgUpload/imgUpload.vue"
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
components: {imgUpload},
|
||||||
data(){
|
data(){
|
||||||
return{
|
return{
|
||||||
queryParams:{
|
queryParams:{
|
||||||
@ -108,6 +137,20 @@ export default {
|
|||||||
title:'',
|
title:'',
|
||||||
total:0,
|
total:0,
|
||||||
storeList:[],
|
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() {
|
created() {
|
||||||
@ -115,6 +158,22 @@ export default {
|
|||||||
this.getStoreList()
|
this.getStoreList()
|
||||||
},
|
},
|
||||||
methods:{
|
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){
|
storeName(list,id){
|
||||||
let name = ""
|
let name = ""
|
||||||
list.forEach(item => {
|
list.forEach(item => {
|
||||||
@ -135,7 +194,6 @@ export default {
|
|||||||
// 获取列表信息
|
// 获取列表信息
|
||||||
getList(){
|
getList(){
|
||||||
listIndexBanner(this.queryParams).then(res => {
|
listIndexBanner(this.queryParams).then(res => {
|
||||||
console.log(res)
|
|
||||||
if (res.data){
|
if (res.data){
|
||||||
this.list = res.data.records;
|
this.list = res.data.records;
|
||||||
this.total = res.data.total;
|
this.total = res.data.total;
|
||||||
@ -144,16 +202,69 @@ export default {
|
|||||||
},
|
},
|
||||||
// 新增轮播图配置信息
|
// 新增轮播图配置信息
|
||||||
handleAdd(){
|
handleAdd(){
|
||||||
|
this.form = {}
|
||||||
this.title = "新增配置"
|
this.title = "新增配置"
|
||||||
this.dialogVisible = true;
|
this.dialogVisible = true;
|
||||||
|
this.flag = true
|
||||||
},
|
},
|
||||||
// 修改轮播图配置信息
|
// 修改轮播图配置信息
|
||||||
handleUpdate(id){
|
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() {
|
handleQuery() {
|
||||||
@ -165,5 +276,8 @@ export default {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style lang="scss" scoped>
|
<style lang="scss" scoped>
|
||||||
|
.imgBanner{
|
||||||
|
width: 150px;
|
||||||
|
height: 100px;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.api.fuyou.service.impl;
|
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.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
|
import com.fuint.api.fuyou.entity.FuYouPublicMerchant;
|
||||||
@ -128,7 +129,12 @@ public class MerchantConfigServiceImpl extends ServiceImpl<MerchantConfigMapper,
|
|||||||
}
|
}
|
||||||
merchantConfig.setAppid(FuYouPublicMerchant.appid);
|
merchantConfig.setAppid(FuYouPublicMerchant.appid);
|
||||||
merchantConfig.setAlipayAppid(FuYouPublicMerchant.alipayAppid);
|
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.setIsOpenRule("0");
|
||||||
merchantConfig.setAmount(0.0);
|
merchantConfig.setAmount(0.0);
|
||||||
row = baseMapper.insert(merchantConfig);
|
row = baseMapper.insert(merchantConfig);
|
||||||
|
@ -64,7 +64,7 @@ public class IndexBannerServiceImpl extends ServiceImpl<IndexBannerMapper, Index
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int updateIndexBanner(IndexBanner indexBanner) {
|
public int updateIndexBanner(IndexBanner indexBanner) {
|
||||||
return 0;
|
return baseMapper.updateById(indexBanner);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.member.service.impl;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.business.member.mapper.LJDutyMapper;
|
import com.fuint.business.member.mapper.LJDutyMapper;
|
||||||
import com.fuint.business.member.service.ILJDutyService;
|
import com.fuint.business.member.service.ILJDutyService;
|
||||||
@ -16,7 +17,9 @@ public class LJDutyServiceImpl extends ServiceImpl<LJDutyMapper, TDuty> implemen
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public List<TDuty> selectDutyList() {
|
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
|
@Override
|
||||||
public void deleteStaffByIds(Integer[] ids) {
|
public void deleteStaffByIds(Integer[] ids) {
|
||||||
for (int id : ids){
|
for (int id : ids){
|
||||||
baseMapper.deleteById(id);
|
this.deleteStaffById(id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +118,8 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
|||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void deleteStaffById(Integer id) {
|
public void deleteStaffById(Integer id) {
|
||||||
|
LJStaff staff = this.selectStaffById(id);
|
||||||
|
accountService.deleteAccountByUserName(staff.getMobile());
|
||||||
baseMapper.deleteById(id);
|
baseMapper.deleteById(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -152,7 +154,7 @@ public class LJStaffServiceImpl extends ServiceImpl<LJStaffMapper, LJStaff> impl
|
|||||||
account.setAccountName(staff.getMobile());
|
account.setAccountName(staff.getMobile());
|
||||||
account.setAccountStatus(1);
|
account.setAccountStatus(1);
|
||||||
account.setRealName(staff.getRealName());
|
account.setRealName(staff.getRealName());
|
||||||
account.setRoleIds("0");
|
account.setRoleIds(staff.getRoleId());
|
||||||
account.setStaffId(staff1.getId());
|
account.setStaffId(staff1.getId());
|
||||||
account.setCreateTime(new Date());
|
account.setCreateTime(new Date());
|
||||||
account.setUpdateTime(new Date());
|
account.setUpdateTime(new Date());
|
||||||
|
@ -743,8 +743,8 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
|
|
||||||
oilOrder.setTankId(tankId);
|
oilOrder.setTankId(tankId);
|
||||||
|
|
||||||
Map<String, Object> applet = null;
|
Map<String, Object> applet = new HashMap<>();
|
||||||
|
applet.put("success","");
|
||||||
if (!map.get("payAmount").equals("0")) {
|
if (!map.get("payAmount").equals("0")) {
|
||||||
// 调用支付接口
|
// 调用支付接口
|
||||||
// 判断是否开启支付规则
|
// 判断是否开启支付规则
|
||||||
@ -777,6 +777,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
oilOrder.setPayTime(new Date());
|
oilOrder.setPayTime(new Date());
|
||||||
oilOrder.setOrderStatus("paid");
|
oilOrder.setOrderStatus("paid");
|
||||||
baseMapper.updateById(oilOrder);
|
baseMapper.updateById(oilOrder);
|
||||||
|
applet.put("success","ok");
|
||||||
}
|
}
|
||||||
return applet;
|
return applet;
|
||||||
}
|
}
|
||||||
@ -885,7 +886,7 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
Integer dieselGrowthValue = null;
|
Integer dieselGrowthValue = null;
|
||||||
Integer naturalGrowthValue = null;
|
Integer naturalGrowthValue = null;
|
||||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userid,storeId);
|
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
|
||||||
int growth = balance.getGrowthValue();
|
int growth = balance.getGrowthValue();
|
||||||
balance.setRefuelMoney(refuelMoney);
|
balance.setRefuelMoney(refuelMoney);
|
||||||
// 查询会员等级列表信息
|
// 查询会员等级列表信息
|
||||||
@ -944,15 +945,18 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
|
|||||||
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
// 根据用户id查询用户余额信息
|
// 根据用户id查询用户余额信息
|
||||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
LJStore store = storeService.selectStoreByStoreId(storeId);
|
||||||
UserBalance balance = userBalanceService.selectUserBalanceByStorId(userId,storeId);
|
UserBalance balance = userBalanceService.selectUserBalance(userId,store.getChainStoreId());
|
||||||
// 修改余额信息
|
if (ObjectUtil.isNotEmpty(balance)){
|
||||||
Double beforeBalance = balance.getCardBalance();
|
// 修改余额信息
|
||||||
Double afterBalance = beforeBalance - amount;
|
Double beforeBalance = balance.getCardBalance();
|
||||||
balance.setCardBalance(afterBalance);
|
Double afterBalance = beforeBalance - amount;
|
||||||
|
balance.setCardBalance(afterBalance);
|
||||||
// 修改加油次数
|
// 修改加油次数
|
||||||
Integer consumeNum = balance.getConsumeNum();
|
Integer consumeNum = balance.getConsumeNum();
|
||||||
balance.setConsumeNum(consumeNum+1);
|
balance.setConsumeNum(consumeNum+1);
|
||||||
userBalanceService.updateUserBalance(balance);
|
userBalanceService.updateUserBalance(balance);
|
||||||
|
}
|
||||||
|
|
||||||
// 添加余额记录信息
|
// 添加余额记录信息
|
||||||
CardBalanceChange cardBalanceChange = new CardBalanceChange();
|
CardBalanceChange cardBalanceChange = new CardBalanceChange();
|
||||||
cardBalanceChange.setUserId(userId);
|
cardBalanceChange.setUserId(userId);
|
||||||
|
@ -57,7 +57,7 @@ public class ExportController extends BaseController{
|
|||||||
if (list.size() >= 1) {
|
if (list.size() >= 1) {
|
||||||
for (int i = 0; i < list.size(); i++) {
|
for (int i = 0; i < list.size(); i++) {
|
||||||
LJUserVo user = (LJUserVo) list.get(i);
|
LJUserVo user = (LJUserVo) list.get(i);
|
||||||
LJUser user1 = service.selectUserByMobile(user.getMobile());
|
LJUserVo user1 = service.selectUserByMobileAndChantStoreId(user.getMobile());
|
||||||
if (user1!=null){
|
if (user1!=null){
|
||||||
repeat += 1;
|
repeat += 1;
|
||||||
}else {
|
}else {
|
||||||
|
@ -113,6 +113,17 @@ public class LJUserController extends BaseController {
|
|||||||
return getSuccessResult(user);
|
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")
|
@GetMapping("/getByUniApp")
|
||||||
public ResponseObject getByUniApp(Integer chainStoreId){
|
public ResponseObject getByUniApp(Integer chainStoreId){
|
||||||
LJUserVo user = userService.getByUniApp(chainStoreId);
|
LJUserVo user = userService.getByUniApp(chainStoreId);
|
||||||
@ -128,6 +139,18 @@ public class LJUserController extends BaseController {
|
|||||||
return getSuccessResult(userBalanceService.getUserBalance());
|
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
|
* @param map
|
||||||
|
@ -6,16 +6,19 @@ import com.fuint.business.userManager.entity.LJUserGrade;
|
|||||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||||
import com.fuint.framework.web.BaseController;
|
import com.fuint.framework.web.BaseController;
|
||||||
import com.fuint.framework.web.ResponseObject;
|
import com.fuint.framework.web.ResponseObject;
|
||||||
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员等级信息 controller层
|
* 会员等级信息 controller层
|
||||||
*/
|
*/
|
||||||
@RestController
|
@RestController
|
||||||
|
@Slf4j
|
||||||
@RequestMapping("/business/userManager/userGrade")
|
@RequestMapping("/business/userManager/userGrade")
|
||||||
public class LJUserGradeController extends BaseController {
|
public class LJUserGradeController extends BaseController {
|
||||||
@Autowired
|
@Autowired
|
||||||
@ -72,13 +75,21 @@ public class LJUserGradeController extends BaseController {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询会员等级信息
|
* 根据id查询会员等级信息
|
||||||
* @param id
|
* @param map
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@GetMapping("/isUse/{id}")
|
@PostMapping("/isUse")
|
||||||
public ResponseObject userGrade(@PathVariable Integer id){
|
public ResponseObject userGrade(@RequestBody Map<String,String> map){
|
||||||
LJUserGrade userGrade = userGradeService.selectUserGradeByIdIsUse(id);
|
Map<String, Object> map1 =new HashMap<>();
|
||||||
return getSuccessResult(userGrade);
|
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);
|
public List<LJUserVo> queryUserList(@Param("storeId") int storeId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号和连锁店id查询会员信息
|
||||||
|
* @param mobile
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LJUserVo selectUserByMobileAndChantStoreId(@Param("mobile") String mobile,@Param("chainStoreId") int chainStoreId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询用户信息
|
* 根据id查询用户信息
|
||||||
* @param id
|
* @param id
|
||||||
@ -35,6 +42,13 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
|
|||||||
*/
|
*/
|
||||||
public LJUserVo selectUserById(@Param("id") Integer id);
|
public LJUserVo selectUserById(@Param("id") Integer id);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据连锁店id查询用户信息
|
||||||
|
* @param chainStoreId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public LJUserVo queryUserByChainStoreId(@Param("userId") int userId,@Param("chainStoreId") int chainStoreId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* uniapp使用
|
* uniapp使用
|
||||||
* @param id
|
* @param id
|
||||||
|
@ -4,22 +4,25 @@
|
|||||||
<sql id="selectUser">
|
<sql id="selectUser">
|
||||||
select mu.*,mub.grade_id,mub.card_balance,mub.points,mub.consume_num,mub.growth_value,mub.refuel_money,
|
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.second_card,mub.fixing_level,
|
||||||
mi.storeId,mi.staffId,mi.inviterId,mi.chain_store_id from mt_user mu
|
mi.storeId,mi.staffId,mi.inviterId,mub.chain_store_id from mt_user mu
|
||||||
left join mt_user_balance mub on mu.id = mub.mt_user_id
|
inner join mt_user_balance mub on mu.id = mub.mt_user_id
|
||||||
left join mt_invitation mi on mu.id = mi.userId
|
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>
|
</sql>
|
||||||
|
|
||||||
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
<select id="selectUserList" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||||
<include refid="selectUser"></include>
|
<include refid="selectUserAndBalance"></include>
|
||||||
<where>
|
<where>
|
||||||
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
<if test="user.chainStoreId != null and user.chainStoreId != ''">
|
||||||
and mi.chain_store_id = #{user.chainStoreId}
|
and mub.chain_store_id = #{user.chainStoreId}
|
||||||
</if>
|
</if>
|
||||||
<if test="user.storeId != null and user.storeId != ''">
|
<if test="user.storeId != null and user.storeId != ''">
|
||||||
and mi.storeId = #{user.storeId}
|
and mub.store_id = #{user.storeId}
|
||||||
</if>
|
|
||||||
<if test="user.storeId == 0">
|
|
||||||
and mi.storeId = #{user.storeId}
|
|
||||||
</if>
|
</if>
|
||||||
<if test="user.mobile != null and user.mobile != ''">
|
<if test="user.mobile != null and user.mobile != ''">
|
||||||
and mu.mobile like concat('%', #{user.mobile}, '%')
|
and mu.mobile like concat('%', #{user.mobile}, '%')
|
||||||
@ -57,7 +60,7 @@
|
|||||||
<!-- 根据手机号查询会员信息-->
|
<!-- 根据手机号查询会员信息-->
|
||||||
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
<select id="selectUserByMobile" resultType="com.fuint.business.userManager.vo.LJUserVo"
|
||||||
parameterType="java.lang.String">
|
parameterType="java.lang.String">
|
||||||
<include refid="selectUser"></include>
|
<include refid="selectUserAndBalance"></include>
|
||||||
<where>
|
<where>
|
||||||
mu.mobile = #{mobile}
|
mu.mobile = #{mobile}
|
||||||
</where>
|
</where>
|
||||||
@ -70,6 +73,24 @@
|
|||||||
</where>
|
</where>
|
||||||
</select>
|
</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 id="selectAllInfoById" resultType="com.fuint.business.userManager.vo.LJUserVo">
|
||||||
select mu.*,
|
select mu.*,
|
||||||
mub.id balanceId,
|
mub.id balanceId,
|
||||||
|
@ -24,12 +24,20 @@ public interface CertifiedMemberService extends IService<CertifiedMember> {
|
|||||||
public CertifiedMember selectCertifiedMemberById(int id);
|
public CertifiedMember selectCertifiedMemberById(int id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据会员id查询认证会员信息
|
* 根据会员id和店铺id查询认证会员信息
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public CertifiedMember selectCertifiedMemberByUserId(int userId);
|
public CertifiedMember selectCertifiedMemberByUserId(int userId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据会员id和店铺id查询认证会员信息
|
||||||
|
* @param userId
|
||||||
|
* @param storeId
|
||||||
|
* @return
|
||||||
|
*/
|
||||||
|
public CertifiedMember selectCertifiedMemberByUserIdAndStoreId(int userId,String storeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据固定等级id删除认证会员信息
|
* 根据固定等级id删除认证会员信息
|
||||||
* @param fixingLevelId
|
* @param fixingLevelId
|
||||||
|
@ -7,6 +7,7 @@ import com.fuint.business.userManager.entity.LJUserGrade;
|
|||||||
import com.fuint.repository.model.MtUserGrade;
|
import com.fuint.repository.model.MtUserGrade;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 会员等级信息 业务层
|
* 会员等级信息 业务层
|
||||||
@ -47,10 +48,12 @@ public interface LJUserGradeService extends IService<LJUserGrade> {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据id查询会员等级信息是否可使用
|
* 根据id查询会员等级信息是否可使用
|
||||||
* @param id
|
* @param userId
|
||||||
|
* @param storeId
|
||||||
|
* @param gradeId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public LJUserGrade selectUserGradeByIdIsUse(int id);
|
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据会员等级名称查询会员等级信息
|
* 根据会员等级名称查询会员等级信息
|
||||||
|
@ -53,6 +53,20 @@ public interface LJUserService extends IService<LJUser> {
|
|||||||
*/
|
*/
|
||||||
public LJUserVo selectUserById(int id);
|
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);
|
public LJUserVo getByUniApp(Integer chainStoreId);
|
||||||
|
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.userManager.service.impl;
|
package com.fuint.business.userManager.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
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.mapper.CertifiedMemberMapper;
|
||||||
import com.fuint.business.userManager.service.CertifiedMemberService;
|
import com.fuint.business.userManager.service.CertifiedMemberService;
|
||||||
import com.fuint.business.userManager.service.LJUserService;
|
import com.fuint.business.userManager.service.LJUserService;
|
||||||
|
import com.fuint.business.userManager.vo.LJUserVo;
|
||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.StringUtils;
|
import com.fuint.common.util.StringUtils;
|
||||||
import com.fuint.common.util.TokenUtil;
|
import com.fuint.common.util.TokenUtil;
|
||||||
@ -57,14 +59,30 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 根据会员id查询认证会员信息
|
* 根据会员id和店铺id查询认证会员信息
|
||||||
* @param userId
|
* @param userId
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public CertifiedMember selectCertifiedMemberByUserId(int userId) {
|
public CertifiedMember selectCertifiedMemberByUserId(int userId) {
|
||||||
|
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
queryWrapper.eq("user_id",userId);
|
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);
|
CertifiedMember certifiedMember = baseMapper.selectOne(queryWrapper);
|
||||||
return certifiedMember;
|
return certifiedMember;
|
||||||
}
|
}
|
||||||
@ -113,8 +131,8 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
|
|||||||
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
|
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
|
||||||
return 2;
|
return 2;
|
||||||
}
|
}
|
||||||
LJUser user = userService.selectUserByMobile(certifiedMember.getMobile());
|
LJUserVo user = userService.selectUserByMobileAndChantStoreId(certifiedMember.getMobile());
|
||||||
if (user==null){
|
if (ObjectUtil.isEmpty(user)){
|
||||||
return 3;
|
return 3;
|
||||||
}
|
}
|
||||||
QueryWrapper queryWrapper = new QueryWrapper<>();
|
QueryWrapper queryWrapper = new QueryWrapper<>();
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
package com.fuint.business.userManager.service.impl;
|
package com.fuint.business.userManager.service.impl;
|
||||||
|
|
||||||
|
import cn.hutool.core.util.ObjectUtil;
|
||||||
import com.alibaba.fastjson2.JSONArray;
|
import com.alibaba.fastjson2.JSONArray;
|
||||||
import com.alibaba.fastjson2.JSONObject;
|
import com.alibaba.fastjson2.JSONObject;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import com.fuint.business.storeInformation.entity.LJStore;
|
import com.fuint.business.storeInformation.entity.LJStore;
|
||||||
import com.fuint.business.storeInformation.service.ILJStoreService;
|
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.ChainStoreConfig;
|
||||||
|
import com.fuint.business.userManager.entity.FixingLevel;
|
||||||
import com.fuint.business.userManager.entity.LJUserGrade;
|
import com.fuint.business.userManager.entity.LJUserGrade;
|
||||||
import com.fuint.business.userManager.mapper.LJUserGradeMapper;
|
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.ChainStoreConfigService;
|
||||||
|
import com.fuint.business.userManager.service.FixingLevelService;
|
||||||
import com.fuint.business.userManager.service.LJUserGradeService;
|
import com.fuint.business.userManager.service.LJUserGradeService;
|
||||||
import com.fuint.common.dto.AccountInfo;
|
import com.fuint.common.dto.AccountInfo;
|
||||||
import com.fuint.common.util.StringUtils;
|
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.repository.model.MtUserGrade;
|
||||||
import com.fuint.system.config.service.SysConfigService;
|
import com.fuint.system.config.service.SysConfigService;
|
||||||
import org.springframework.beans.factory.annotation.Autowired;
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.context.annotation.Lazy;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
@Service
|
@Service
|
||||||
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUserGrade> implements LJUserGradeService {
|
||||||
@ -79,21 +87,40 @@ public class LJUserGradeServiceImpl extends ServiceImpl<LJUserGradeMapper, LJUse
|
|||||||
private ILJStoreService storeService;
|
private ILJStoreService storeService;
|
||||||
@Autowired
|
@Autowired
|
||||||
private ChainStoreConfigService chainStoreConfigService;
|
private ChainStoreConfigService chainStoreConfigService;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private CertifiedMemberService certifiedMemberService;
|
||||||
|
@Autowired
|
||||||
|
@Lazy
|
||||||
|
private FixingLevelService fixingLevelService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LJUserGrade selectUserGradeByIdIsUse(int id) {
|
public Map<String,Object> selectUserGradeByIdIsUse(Integer userId, String storeId, String gradeId) {
|
||||||
LJStore store = storeService.selectStoreById();
|
Map<String,Object> res = new HashMap<>();
|
||||||
ChainStoreConfig chainStoreConfig = chainStoreConfigService.selectChainStoreById(store.getChainStoreId());
|
// 查询此会员是否认证固定等级信息
|
||||||
String isEnableLevel = chainStoreConfig.getIsEnableLevel();
|
CertifiedMember certifiedMember = certifiedMemberService.selectCertifiedMemberByUserIdAndStoreId(userId, storeId);
|
||||||
if (isEnableLevel.equals("yes")){
|
if (ObjectUtil.isNotEmpty(certifiedMember)){
|
||||||
LJUserGrade ljUserGrade = baseMapper.selectById(id);
|
FixingLevel fixingLevel = fixingLevelService.selectFixingLevelById(certifiedMember.getFixingLevelId());
|
||||||
if (ljUserGrade.getStatus().equals("qy")){
|
if (fixingLevel.getStatus().equals("qy")){
|
||||||
return baseMapper.selectById(id);
|
res.put("fixingLevel",fixingLevel);
|
||||||
}else {
|
}
|
||||||
return null;
|
}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
|
@Override
|
||||||
|
@ -130,6 +130,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
return baseMapper.selectUserById(id);
|
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
|
@Resource
|
||||||
UserBalanceService userBalanceService;
|
UserBalanceService userBalanceService;
|
||||||
|
|
||||||
@ -249,16 +267,24 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
user1.setStatus(user.getStatus());
|
user1.setStatus(user.getStatus());
|
||||||
user1.setDescription(user.getDescription());
|
user1.setDescription(user.getDescription());
|
||||||
user1.setOfficial(user.getOfficial());
|
user1.setOfficial(user.getOfficial());
|
||||||
int row = baseMapper.insert(user1);
|
// 查询添加后的用户id
|
||||||
|
|
||||||
// 查询添加后的用户id
|
|
||||||
LJUser ljUser = this.selectUserByMobile(user.getMobile());
|
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();
|
UserBalance balance = new UserBalance();
|
||||||
balance.setMtUserId(ljUser.getId());
|
balance.setMtUserId(ljUser.getId());
|
||||||
balance.setCardBalance(user.getCardBalance());
|
balance.setCardBalance(user.getCardBalance());
|
||||||
balance.setPoints(user.getPoints());
|
balance.setPoints(user.getPoints());
|
||||||
balance.setStoreId(storeId);
|
balance.setStoreId(storeId);
|
||||||
|
balance.setChainStoreId(store.getChainStoreId());
|
||||||
if (user.getGradeId()!=null){
|
if (user.getGradeId()!=null){
|
||||||
balance.setGradeId(user.getGradeId());
|
balance.setGradeId(user.getGradeId());
|
||||||
}else {
|
}else {
|
||||||
@ -270,17 +296,15 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
|
|||||||
balance.setFixingLevel(user.getFixingLevel());
|
balance.setFixingLevel(user.getFixingLevel());
|
||||||
balanceService.insertUserBalance(balance);
|
balanceService.insertUserBalance(balance);
|
||||||
Integer chainStoreId = null;
|
Integer chainStoreId = null;
|
||||||
// 根据店铺id查询店铺所对应的连锁店id
|
|
||||||
LJStore store = storeService.selectStoreByStoreId(storeId);
|
|
||||||
if (!ObjectUtil.isEmpty(store)){
|
|
||||||
chainStoreId = store.getChainStoreId();
|
|
||||||
}
|
|
||||||
// 添加邀请注册信息
|
// 添加邀请注册信息
|
||||||
MtInvitation invitation = new MtInvitation();
|
MtInvitation invitation = new MtInvitation();
|
||||||
|
if (ObjectUtil.isNotEmpty(store)){
|
||||||
|
chainStoreId = store.getChainStoreId();
|
||||||
|
invitation.setChainStoreId(chainStoreId);
|
||||||
|
}
|
||||||
invitation.setUserId(ljUser.getId());
|
invitation.setUserId(ljUser.getId());
|
||||||
invitation.setStoreId(storeId);
|
invitation.setStoreId(storeId);
|
||||||
invitation.setStaffId(nowAccountInfo.getStaffId());
|
invitation.setStaffId(nowAccountInfo.getStaffId());
|
||||||
invitation.setChainStoreId(chainStoreId);
|
|
||||||
invitation.setStatus("qy");
|
invitation.setStatus("qy");
|
||||||
invitationMapper.insert(invitation);
|
invitationMapper.insert(invitation);
|
||||||
return row;
|
return row;
|
||||||
|
@ -61,6 +61,12 @@ public interface AccountService extends IService<TAccount> {
|
|||||||
*/
|
*/
|
||||||
TAccount selectAccountByUserName(String accountName);
|
TAccount selectAccountByUserName(String accountName);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据用户名删除账户信息
|
||||||
|
* @param accountName
|
||||||
|
*/
|
||||||
|
void deleteAccountByUserName(String accountName);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取账号角色ID
|
* 获取账号角色ID
|
||||||
*
|
*
|
||||||
|
@ -208,6 +208,7 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
|||||||
account.setStoreId(tAccount.getStoreId());
|
account.setStoreId(tAccount.getStoreId());
|
||||||
account.setDeptId(tAccount.getDeptId());
|
account.setDeptId(tAccount.getDeptId());
|
||||||
account.setPassword(tAccount.getPassword());
|
account.setPassword(tAccount.getPassword());
|
||||||
|
account.setStaffId(tAccount.getStaffId());
|
||||||
this.entryptPassword(account);
|
this.entryptPassword(account);
|
||||||
int id = tAccountMapper.insert(account);
|
int id = tAccountMapper.insert(account);
|
||||||
|
|
||||||
@ -234,6 +235,14 @@ public class AccountServiceImpl extends ServiceImpl<TAccountMapper, TAccount> im
|
|||||||
return baseMapper.selectOne(queryWrapper);
|
return baseMapper.selectOne(queryWrapper);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void deleteAccountByUserName(String accountName) {
|
||||||
|
TAccount tAccount = this.selectAccountByUserName(accountName);
|
||||||
|
if (ObjectUtil.isNotEmpty(tAccount)){
|
||||||
|
baseMapper.deleteById(tAccount.getAcctId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取账号角色ID
|
* 获取账号角色ID
|
||||||
*
|
*
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
# \u57FA\u672C\u914D\u7F6E
|
# \u57FA\u672C\u914D\u7F6E
|
||||||
server.port=8008
|
server.port=8080
|
||||||
env.profile=dev
|
env.profile=dev
|
||||||
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
#env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||||
env.properties.path=D:/code/oilSystem/fuintBackend/configure/
|
env.properties.path=D:/workspaces/oilSystem/fuintBackend/configure/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -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) {
|
export function getUserVoName(data) {
|
||||||
return request({
|
return request({
|
||||||
|
@ -18,10 +18,11 @@ export function getUserGrade(id) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// 查询会员等级详细是否能使用
|
// 查询会员等级详细是否能使用
|
||||||
export function userGradeInfo(id) {
|
export function userGradeInfo(data) {
|
||||||
return request({
|
return request({
|
||||||
url: '/business/userManager/userGrade/isUse/' + id,
|
url: '/business/userManager/userGrade/isUse',
|
||||||
method: 'get'
|
method: 'post',
|
||||||
|
data:data,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -786,7 +786,7 @@
|
|||||||
import {getDicts} from "@/api/dict/data";
|
import {getDicts} from "@/api/dict/data";
|
||||||
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
|
import {getOilNameList, getOilNumGun, listOilNumGun} from "@/api/cashier/oilnumgun";
|
||||||
import {listgoods} from "@/api/cashier/ljgoods";
|
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 {queryStaffs, staffInfo} from "@/api/cashier/staff";
|
||||||
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
|
import {addLJGoods, goodsOrder, oilOrder, scanAppletQrCode} from "@/api/cashier/oilorder";
|
||||||
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
|
import {getUserGrade, listUserGrade, userGradeInfo} from "@/api/cashier/usergrade";
|
||||||
@ -1451,228 +1451,456 @@
|
|||||||
this.handleChange();
|
this.handleChange();
|
||||||
},
|
},
|
||||||
// 根据会员等级信息获取等级优惠信息
|
// 根据会员等级信息获取等级优惠信息
|
||||||
getGrade(id){
|
getGrade(userId,gradeId){
|
||||||
let _this = this;
|
let _this = this;
|
||||||
this.oilDiscount = 0;
|
this.oilDiscount = 0;
|
||||||
this.gradeDiscount = [];
|
this.gradeDiscount = [];
|
||||||
userGradeInfo(id).then(response => {
|
userGradeInfo({userId:userId,gradeId:gradeId,storeId:""}).then(response => {
|
||||||
let gasolineDiscount = 0;
|
let gasolineDiscount = 0;
|
||||||
let dieselDiscount = 0;
|
let dieselDiscount = 0;
|
||||||
let naturalGasDiscount = 0;
|
let naturalGasDiscount = 0;
|
||||||
_this.gradeDiscount = [];
|
_this.gradeDiscount = [];
|
||||||
if (response.data!=null) {
|
if (response.data) {
|
||||||
_this.oilOrder.forEach(item => {
|
_this.oilOrder.forEach(item => {
|
||||||
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
let discount = {type: "", full: 0, reduce: 0, liters: 0}
|
||||||
if (item.type == "汽油") {
|
if (item.type == "汽油") {
|
||||||
let gasolineRule = JSON.parse(response.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
if (response.data.fixingLevel){
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
let gasolineRule = JSON.parse(response.data.fixingLevel.gasolineRule).sort((a, b) => a.gasolineRule1 - b.gasolineRule1);
|
||||||
if (response.data.gasolineDiscount == "满减优惠") {
|
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
let oilDiscount = 0;
|
if (response.data.fixingLevel.gasolineDiscount == "满减优惠") {
|
||||||
discount.type = "满减优惠"
|
let oilDiscount = 0;
|
||||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
discount.type = "满减优惠"
|
||||||
// 将满减条件加入等级优惠列表
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
if (gasolineRule.length > 1) {
|
// 将满减条件加入等级优惠列表
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
if (gasolineRule.length > 1) {
|
||||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||||
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||||
discount.reduce = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
oilDiscount = gasolineRule[gasolineRule.length - 1].gasolineRule2
|
||||||
break;
|
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
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
}
|
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||||
} else {
|
}
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
} else {
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
oilDiscount = gasolineRule[i - 1].gasolineRule2
|
||||||
|
discount.reduce = gasolineRule[i - 1].gasolineRule2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (discount.reduce != 0) {
|
||||||
if (discount.reduce != 0) {
|
_this.gradeDiscount.push(discount)
|
||||||
_this.gradeDiscount.push(discount)
|
_this.checkedCities2.push('满减优惠')
|
||||||
_this.checkedCities2.push('满减优惠')
|
}
|
||||||
}
|
gasolineDiscount += +oilDiscount
|
||||||
gasolineDiscount += +oilDiscount
|
} else if (response.data.fixingLevel.gasolineDiscount == "每升优惠") {
|
||||||
} else if (response.data.gasolineDiscount == "每升优惠") {
|
discount.type = "每升优惠"
|
||||||
discount.type = "每升优惠"
|
let oilDiscount = 0;
|
||||||
let oilDiscount = 0;
|
for (let i = 1; i <= gasolineRule.length; i++) {
|
||||||
for (let i = 1; i <= gasolineRule.length; i++) {
|
// 将满减条件加入等级优惠列表
|
||||||
// 将满减条件加入等级优惠列表
|
if (gasolineRule.length > 1) {
|
||||||
if (gasolineRule.length > 1) {
|
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
||||||
if (item.amount >= gasolineRule[gasolineRule.length - 1].gasolineRule1) {
|
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
||||||
discount.full = gasolineRule[gasolineRule.length - 1].gasolineRule1
|
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
||||||
oilDiscount = (item.liters * gasolineRule[gasolineRule.length - 1].gasolineRule3).toFixed(2);
|
discount.reduce = (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
|
||||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
break;
|
||||||
break;
|
}
|
||||||
}
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1 && item.amount < gasolineRule[i].gasolineRule1) {
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||||
discount.liters = gasolineRule[i - 1].gasolineRule3
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
||||||
if (item.amount >= gasolineRule[i - 1].gasolineRule1) {
|
discount.full = gasolineRule[i - 1].gasolineRule1
|
||||||
discount.full = gasolineRule[i - 1].gasolineRule1
|
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
oilDiscount = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
||||||
discount.reduce = (item.liters * gasolineRule[i - 1].gasolineRule3).toFixed(2)
|
discount.liters = gasolineRule[i - 1].gasolineRule3
|
||||||
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 == "柴油") {
|
if (item.type == "柴油") {
|
||||||
let dieselRule = JSON.parse(response.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
if (response.data.fixingLevel){
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
let dieselRule = JSON.parse(response.data.fixingLevel.dieselRule).sort((a, b) => a.dieselRule1 - b.dieselRule1);
|
||||||
if (response.data.dieselDiscount == "满减优惠") {
|
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
let oilDiscount = 0;
|
if (response.data.fixingLevel.dieselDiscount == "满减优惠") {
|
||||||
discount.type = "满减优惠"
|
let oilDiscount = 0;
|
||||||
for (let i = 1; i <= dieselRule.length; i++) {
|
discount.type = "满减优惠"
|
||||||
// 将满减条件加入等级优惠列表
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
if (dieselRule.length > 1) {
|
// 将满减条件加入等级优惠列表
|
||||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
if (dieselRule.length > 1) {
|
||||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||||
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||||
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
oilDiscount = dieselRule[dieselRule.length - 1].dieselRule2
|
||||||
break;
|
discount.reduce = dieselRule[dieselRule.length - 1].dieselRule2
|
||||||
}
|
break;
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
}
|
||||||
|
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
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
oilDiscount = dieselRule[i - 1].dieselRule2
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
discount.reduce = dieselRule[i - 1].dieselRule2
|
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) {
|
||||||
if (discount.reduce != 0) {
|
_this.gradeDiscount.push(discount)
|
||||||
_this.gradeDiscount.push(discount)
|
_this.checkedCities2.push('满减优惠')
|
||||||
_this.checkedCities2.push('满减优惠')
|
}
|
||||||
}
|
dieselDiscount += +oilDiscount
|
||||||
dieselDiscount += +oilDiscount
|
} else if (response.data.fixingLevel.dieselDiscount == "每升优惠") {
|
||||||
} else if (response.data.dieselDiscount == "每升优惠") {
|
let oilDiscount = 0;
|
||||||
let oilDiscount = 0;
|
for (let i = 1; i <= dieselRule.length; i++) {
|
||||||
for (let i = 1; i <= dieselRule.length; i++) {
|
discount.type = "每升优惠"
|
||||||
discount.type = "每升优惠"
|
// 将满减条件加入等级优惠列表
|
||||||
// 将满减条件加入等级优惠列表
|
if (dieselRule.length > 1) {
|
||||||
if (dieselRule.length > 1) {
|
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
||||||
if (item.amount >= dieselRule[dieselRule.length - 1].dieselRule1) {
|
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
||||||
discount.full = dieselRule[dieselRule.length - 1].dieselRule1
|
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
||||||
oilDiscount = (item.liters * dieselRule[dieselRule.length - 1].dieselRule3).toFixed(2);
|
discount.reduce = (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
|
||||||
discount.liters = dieselRule[dieselRule.length - 1].dieselRule3
|
break;
|
||||||
break;
|
}
|
||||||
}
|
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1 && item.amount < dieselRule[i].dieselRule1) {
|
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
|
discount.full = dieselRule[i - 1].dieselRule1
|
||||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
||||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
discount.liters = dieselRule[i - 1].dieselRule3
|
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
||||||
}
|
discount.liters = dieselRule[i - 1].dieselRule3
|
||||||
} else {
|
}
|
||||||
discount.full = dieselRule[i - 1].dieselRule1
|
|
||||||
if (item.amount >= dieselRule[i - 1].dieselRule1) {
|
|
||||||
oilDiscount = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
|
||||||
discount.reduce = (item.liters * dieselRule[i - 1].dieselRule3).toFixed(2)
|
|
||||||
discount.liters = dieselRule[i - 1].dieselRule3
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (discount.reduce != 0) {
|
||||||
|
_this.gradeDiscount.push(discount)
|
||||||
|
_this.checkedCities2.push('每升优惠')
|
||||||
|
}
|
||||||
|
dieselDiscount += +oilDiscount
|
||||||
|
} else {
|
||||||
|
dieselDiscount = 0;
|
||||||
}
|
}
|
||||||
if (discount.reduce != 0) {
|
}
|
||||||
_this.gradeDiscount.push(discount)
|
|
||||||
_this.checkedCities2.push('每升优惠')
|
}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 == "天然气") {
|
if (item.type == "天然气") {
|
||||||
let naturalGasRule = JSON.parse(response.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
if (response.data.fixingLevel){
|
||||||
if (response.data.preferential == '自定义优惠' && response.data.status == 'qy') {
|
let naturalGasRule = JSON.parse(response.data.fixingLevel.naturalGasRule).sort((a, b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||||
if (response.data.naturalGasDiscount == "满减优惠") {
|
if (response.data.fixingLevel.discountType == '自定义优惠' && response.data.fixingLevel.status == 'qy') {
|
||||||
let oilDiscount = 0;
|
if (response.data.fixingLevel.naturalGasDiscount == "满减优惠") {
|
||||||
discount.type = "满减优惠"
|
let oilDiscount = 0;
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
discount.type = "满减优惠"
|
||||||
// 将满减条件加入等级优惠列表
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
if (naturalGasRule.length > 1) {
|
// 将满减条件加入等级优惠列表
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
if (naturalGasRule.length > 1) {
|
||||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||||
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||||
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
oilDiscount = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2;
|
||||||
break;
|
discount.reduce = naturalGasRule[naturalGasRule.length - 1].naturalGasRule2
|
||||||
}
|
break;
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
}
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||||
}
|
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||||
} else {
|
}
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
} else {
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||||
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
oilDiscount = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
discount.reduce = naturalGasRule[i - 1].naturalGasRule2
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
if (discount.reduce != 0) {
|
||||||
if (discount.reduce != 0) {
|
_this.gradeDiscount.push(discount)
|
||||||
_this.gradeDiscount.push(discount)
|
_this.checkedCities2.push('满减优惠')
|
||||||
_this.checkedCities2.push('满减优惠')
|
}
|
||||||
}
|
naturalGasDiscount += +oilDiscount
|
||||||
naturalGasDiscount += +oilDiscount
|
} else if (response.data.fixingLevel.naturalGasDiscount == "每单位优惠") {
|
||||||
} else if (response.data.naturalGasDiscount == "每单位优惠") {
|
let oilDiscount = 0;
|
||||||
let oilDiscount = 0;
|
discount.type = "每单位优惠"
|
||||||
discount.type = "每单位优惠"
|
for (let i = 1; i <= naturalGasRule.length; i++) {
|
||||||
for (let i = 1; i <= naturalGasRule.length; i++) {
|
// 将满减条件加入等级优惠列表
|
||||||
// 将满减条件加入等级优惠列表
|
if (naturalGasRule.length > 1) {
|
||||||
if (naturalGasRule.length > 1) {
|
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
||||||
if (item.amount >= naturalGasRule[naturalGasRule.length - 1].naturalGasRule1) {
|
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
||||||
discount.full = naturalGasRule[naturalGasRule.length - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
||||||
oilDiscount = (item.liters * naturalGasRule[gasolineRule.length - 1].naturalGasRule3).toFixed(2)
|
discount.reduce = (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
|
||||||
discount.liters = naturalGasRule[naturalGasRule.length - 1].naturalGasRule3
|
break;
|
||||||
break;
|
}
|
||||||
}
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1 && item.amount < naturalGasRule[i].naturalGasRule1) {
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||||
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
}
|
||||||
}
|
} else {
|
||||||
} else {
|
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
||||||
if (item.amount >= naturalGasRule[i - 1].naturalGasRule1) {
|
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
||||||
discount.full = naturalGasRule[i - 1].naturalGasRule1
|
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
oilDiscount = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
||||||
discount.reduce = (item.liters * naturalGasRule[i - 1].naturalGasRule3).toFixed(2)
|
discount.liters = naturalGasRule[i - 1].naturalGasRule3
|
||||||
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.payUser = data.mobile;
|
||||||
this.map.userId = data.id;
|
this.map.userId = data.id;
|
||||||
this.balance = this.member.cardBalance;
|
this.balance = this.member.cardBalance;
|
||||||
this.getGrade(data.gradeId)
|
this.getGrade(data.id,data.gradeId)
|
||||||
this.changeRefuelMoney();
|
this.changeRefuelMoney();
|
||||||
this.handleChange();
|
this.handleChange();
|
||||||
this.preferentialData.storeId = data.storeId;
|
this.preferentialData.storeId = data.storeId;
|
||||||
@ -2114,7 +2342,7 @@
|
|||||||
this.oilTotal = this.oilOrder.length;
|
this.oilTotal = this.oilOrder.length;
|
||||||
this.select = "元";
|
this.select = "元";
|
||||||
if (this.isMember){
|
if (this.isMember){
|
||||||
this.getGrade(this.member.gradeId)
|
this.getGrade(this.member.id,this.member.gradeId)
|
||||||
this.changeRefuelMoney();
|
this.changeRefuelMoney();
|
||||||
if (this.oilOrder.length>0){
|
if (this.oilOrder.length>0){
|
||||||
this.preferential();
|
this.preferential();
|
||||||
@ -2211,7 +2439,7 @@
|
|||||||
// 根据手机号查询会员信息
|
// 根据手机号查询会员信息
|
||||||
getUser(){
|
getUser(){
|
||||||
if(this.select1=="会员手机号"){
|
if(this.select1=="会员手机号"){
|
||||||
getUserVoMobile({mobile:this.userNo}).then( response => {
|
getUserInfoMobile({mobile:this.userNo}).then( response => {
|
||||||
if (response.data!=null){
|
if (response.data!=null){
|
||||||
this.member = response.data
|
this.member = response.data
|
||||||
}else {
|
}else {
|
||||||
|
@ -196,7 +196,7 @@
|
|||||||
let str = q.split("?")[1];
|
let str = q.split("?")[1];
|
||||||
let arr = str.split("&");
|
let arr = str.split("&");
|
||||||
|
|
||||||
let storeId = "21";
|
let storeId = "19";
|
||||||
|
|
||||||
let staffId = "";
|
let staffId = "";
|
||||||
arr.forEach(item => {
|
arr.forEach(item => {
|
||||||
@ -214,9 +214,7 @@
|
|||||||
if (uni.getStorageSync("storeId")) {
|
if (uni.getStorageSync("storeId")) {
|
||||||
this.storeId = uni.getStorageSync("storeId")
|
this.storeId = uni.getStorageSync("storeId")
|
||||||
} else {
|
} else {
|
||||||
|
let storeId = "24";
|
||||||
let storeId = "21";
|
|
||||||
|
|
||||||
uni.setStorageSync("storeId", storeId)
|
uni.setStorageSync("storeId", storeId)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -117,7 +117,7 @@
|
|||||||
show: false,
|
show: false,
|
||||||
pic: 0,
|
pic: 0,
|
||||||
hindex: 0,
|
hindex: 0,
|
||||||
qindex: null,
|
qindex: 0,
|
||||||
aindex: null,
|
aindex: null,
|
||||||
sindex: null,
|
sindex: null,
|
||||||
// 店铺信息
|
// 店铺信息
|
||||||
@ -168,7 +168,7 @@
|
|||||||
},
|
},
|
||||||
onLoad(query) {
|
onLoad(query) {
|
||||||
const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
|
const q = decodeURIComponent(query.q) // 获取到二维码原始链接内容
|
||||||
if (q == undefined) {
|
if (query.q) {
|
||||||
let str = q.split("?")[1];
|
let str = q.split("?")[1];
|
||||||
let arr = str.split("&");
|
let arr = str.split("&");
|
||||||
let storeId = "";
|
let storeId = "";
|
||||||
@ -184,6 +184,9 @@
|
|||||||
uni.setStorageSync("inviteStaffId", staffId)
|
uni.setStorageSync("inviteStaffId", staffId)
|
||||||
this.storeId = uni.getStorageSync("storeId")
|
this.storeId = uni.getStorageSync("storeId")
|
||||||
this.staffId = uni.getStorageSync("inviteStaffId")
|
this.staffId = uni.getStorageSync("inviteStaffId")
|
||||||
|
uni.showLoading({
|
||||||
|
title:storeId +"++"+staffId
|
||||||
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
|
@ -137,7 +137,7 @@
|
|||||||
map: {
|
map: {
|
||||||
page: 1,
|
page: 1,
|
||||||
pageSize: 10,
|
pageSize: 10,
|
||||||
storeId: "",
|
storeId: uni.getStorageSync("storeId"),
|
||||||
orderStatus: "",
|
orderStatus: "",
|
||||||
remark: "",
|
remark: "",
|
||||||
},
|
},
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
</view>
|
</view>
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="desc" >
|
<view class="desc" v-if="isFullPreferential">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
活动优惠
|
活动优惠
|
||||||
<!-- <span style="display: flex;">(满减活动)</span> -->
|
<!-- <span style="display: flex;">(满减活动)</span> -->
|
||||||
@ -81,12 +81,13 @@
|
|||||||
<view class="desc" v-if="isGradePreferential">
|
<view class="desc" v-if="isGradePreferential">
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
会员等级优惠
|
会员等级优惠
|
||||||
<span style="display: flex;">({{userGrade.name}})</span>
|
<!-- <span style="display: flex;">({{userGrade.name}})</span> -->
|
||||||
</view>
|
</view>
|
||||||
<view style="display: flex;">
|
<view style="display: flex;">
|
||||||
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
<span style="margin-right: 10px;">-¥{{gradeRedece}}</span>
|
||||||
</view>
|
</view>
|
||||||
</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 style="margin: 10px 20px 0;color: red;font-size: 12px;">注:囤油卡不参与任何优惠活动</view>
|
||||||
</view>
|
</view>
|
||||||
@ -184,17 +185,21 @@
|
|||||||
isStoreValueCard:false,
|
isStoreValueCard:false,
|
||||||
// 是否存在可使用的等级优惠
|
// 是否存在可使用的等级优惠
|
||||||
isGradePreferential:false,
|
isGradePreferential:false,
|
||||||
|
// 是否存在可使用的满减或折扣优惠
|
||||||
|
isFullPreferential:false,
|
||||||
transferDTO:{
|
transferDTO:{
|
||||||
type:0,
|
type:0,
|
||||||
amount:0,
|
amount:0,
|
||||||
oilId:"",
|
oilId:"",
|
||||||
mtUserLevel:"",
|
mtUserLevel:"",
|
||||||
}
|
storeId:uni.getStorageSync("storeId")
|
||||||
|
},
|
||||||
|
fixingLevel:{},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad(e) {
|
onLoad(e) {
|
||||||
this.orderNo = e.orderNo
|
this.orderNo = e.orderNo
|
||||||
// this.orderNo = "234520231229140854e4c4ca"
|
// this.orderNo = "234520240104104141863b59"
|
||||||
},
|
},
|
||||||
onShow() {
|
onShow() {
|
||||||
this.getOilOrder();
|
this.getOilOrder();
|
||||||
@ -225,13 +230,19 @@
|
|||||||
method: 'post',
|
method: 'post',
|
||||||
data: map,
|
data: map,
|
||||||
}).then(res => {
|
}).then(res => {
|
||||||
console.log(res,_this.appltType)
|
// console.log(res,_this.appltType)
|
||||||
let payProvider = "wxpay"
|
let payProvider = "wxpay"
|
||||||
if (_this.appltType== "WECHAT"){
|
if (_this.appltType== "WECHAT"){
|
||||||
payProvider = "wxpay"
|
payProvider = "wxpay"
|
||||||
}else{
|
}else{
|
||||||
payProvider = "alipay"
|
payProvider = "alipay"
|
||||||
}
|
}
|
||||||
|
if(res.data.success == "ok"){
|
||||||
|
uni.reLaunch({
|
||||||
|
url: '/pagesRefuel/orderSuccess/index'
|
||||||
|
})
|
||||||
|
return;
|
||||||
|
}
|
||||||
if (res.data.data.reservedPayInfo){
|
if (res.data.data.reservedPayInfo){
|
||||||
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
_this.orderInfo = JSON.parse(res.data.data.reservedPayInfo);
|
||||||
uni.requestPayment({
|
uni.requestPayment({
|
||||||
@ -310,7 +321,7 @@
|
|||||||
})
|
})
|
||||||
if (falg == false) {
|
if (falg == false) {
|
||||||
this.chooseCardBalance(0)
|
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.deductAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||||
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
this.payAmount = this.oilOrder.orderAmount - this.balanceRedece
|
||||||
}
|
}
|
||||||
this.preferential.amount = this.deductAmount
|
|
||||||
}else{
|
}else{
|
||||||
// 使用囤油卡
|
// 使用囤油卡
|
||||||
// 扣除囤油卡金额后需要支付的金额
|
// 扣除囤油卡金额后需要支付的金额
|
||||||
@ -344,152 +354,297 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
// 查看是否有可使用的会员等级优惠
|
// 查看是否有可使用的会员等级优惠
|
||||||
chooseGrade(id){
|
chooseGrade(userId,gradeId){
|
||||||
let that = this;
|
let that = this;
|
||||||
request({
|
request({
|
||||||
url: "business/userManager/userGrade/isUse/" + id,
|
url: "business/userManager/userGrade/isUse",
|
||||||
method: 'get',
|
method: 'post',
|
||||||
|
data:{userId:userId,gradeId:gradeId,storeId:that.oilOrder.storeId}
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
if (res.data != null && res.data != ""){
|
if (res.data){
|
||||||
that.userGrade = res.data
|
if (res.data.fixingLevel){
|
||||||
that.chooseFullOrCoupon();
|
if (res.data.fixingLevel.discountType== "自定义优惠"){
|
||||||
if (res.data.preferential== "自定义优惠"){
|
if (that.oilType == "汽油"){
|
||||||
if (that.oilType == "汽油"){
|
// 将数组按照金额从小到大排序
|
||||||
// 将数组按照金额从小到大排序
|
let gasolineRule = JSON.parse(res.data.fixingLevel.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
||||||
let gasolineRule = JSON.parse(res.data.gasolineRule).sort((a,b) => a.gasolineRule1 - b.gasolineRule1);
|
if (res.data.fixingLevel.gasolineDiscount == "满减优惠"){
|
||||||
if (res.data.gasolineDiscount == "满减优惠"){
|
if (gasolineRule.length > 1){
|
||||||
if (gasolineRule.length > 1){
|
for (let i = 1; i<gasolineRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
that.gradeRedece = gasolineRule[gasolineRule.length-1].gasolineRule2
|
||||||
that.isGradePreferential = true
|
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.fixingLevel.gasolineDiscount == "每升优惠"){
|
||||||
if (res.data.gasolineDiscount == "每升优惠"){
|
if (gasolineRule.length > 1){
|
||||||
if (gasolineRule.length > 1){
|
for (let i = 1; i<gasolineRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= gasolineRule[gasolineRule.length-1].gasolineRule1){
|
||||||
// 计算升数 和 优惠金额
|
|
||||||
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
that.gradeRedece = (that.deductAmount/that.oilPrice * gasolineRule[gasolineRule.length-1].gasolineRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
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 == "柴油"){
|
||||||
if (that.oilType == "柴油"){
|
// 将数组按照金额从小到大排序
|
||||||
// 将数组按照金额从小到大排序
|
let dieselRule = JSON.parse(res.data.fixingLevel.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
||||||
let dieselRule = JSON.parse(res.data.dieselRule).sort((a,b) => a.dieselRule1 - b.dieselRule1);
|
if (res.data.fixingLevel.dieselDiscount == "满减优惠"){
|
||||||
if (res.data.dieselDiscount == "满减优惠"){
|
if (dieselRule.length > 1){
|
||||||
if (dieselRule.length > 1){
|
for (let i = 1; i<dieselRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
that.gradeRedece = dieselRule[dieselRule.length-1].dieselRule2
|
||||||
that.isGradePreferential = true
|
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.fixingLevel.dieselDiscount == "每升优惠"){
|
||||||
if (res.data.dieselDiscount == "每升优惠"){
|
if (dieselRule.length > 1){
|
||||||
if (dieselRule.length > 1){
|
for (let i = 1; i<dieselRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= dieselRule[dieselRule.length-1].dieselRule1){
|
||||||
// 计算升数 和 优惠金额
|
|
||||||
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
that.gradeRedece = (that.deductAmount/that.oilPrice * dieselRule[dieselRule.length-1].dieselRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
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 == "天然气"){
|
||||||
if (that.oilType == "天然气"){
|
// 将数组按照金额从小到大排序
|
||||||
// 将数组按照金额从小到大排序
|
let naturalGasRule = JSON.parse(res.data.fixingLevel.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
||||||
let naturalGasRule = JSON.parse(res.data.naturalGasRule).sort((a,b) => a.naturalGasRule1 - b.naturalGasRule1);
|
if (res.data.fixingLevel.naturalGasDiscount == "满减优惠"){
|
||||||
if (res.data.naturalGasDiscount == "满减优惠"){
|
if (naturalGasRule.length > 1){
|
||||||
if (naturalGasRule.length > 1){
|
for (let i = 1; i<naturalGasRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
that.gradeRedece = naturalGasRule[naturalGasRule.length-1].naturalGasRule2
|
||||||
that.isGradePreferential = true
|
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.fixingLevel.naturalGasDiscount == "每升优惠"){
|
||||||
if (res.data.naturalGasDiscount == "每升优惠"){
|
if (naturalGasRule.length > 1){
|
||||||
if (naturalGasRule.length > 1){
|
for (let i = 1; i<naturalGasRule.length; i++){
|
||||||
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){
|
if (that.deductAmount >= naturalGasRule[naturalGasRule.length-1].naturalGasRule1){
|
||||||
// 计算升数 和 优惠金额
|
|
||||||
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
that.gradeRedece = (that.deductAmount/that.oilPrice * naturalGasRule[naturalGasRule.length-1].naturalGasRule3).toFixed(2)
|
||||||
that.isGradePreferential = true
|
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()
|
that.countPayMent()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
@ -499,17 +654,17 @@
|
|||||||
this.transferDTO.amount = this.deductAmount
|
this.transferDTO.amount = this.deductAmount
|
||||||
this.transferDTO.mtUserLevel = this.userGrade.id
|
this.transferDTO.mtUserLevel = this.userGrade.id
|
||||||
this.transferDTO.oilId = this.oilId
|
this.transferDTO.oilId = this.oilId
|
||||||
console.log(this.transferDTO)
|
|
||||||
let _this = this;
|
let _this = this;
|
||||||
request({
|
request({
|
||||||
url: "business/marketingActivity/activeExchange/test",
|
url: "business/marketingActivity/activeExchange/test",
|
||||||
method: 'post',
|
method: 'post',
|
||||||
data:_this.transferDTO,
|
data:_this.transferDTO,
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
console.log(res)
|
// console.log(res)
|
||||||
if (res.data.amount!=0){
|
if (res.data.amount>0){
|
||||||
_this.payAmount = res.data.amount - _this.gradeRedece
|
_this.payAmount = res.data.amount - _this.gradeRedece
|
||||||
_this.fullRedece = res.data.favorableAmount
|
_this.fullRedece = res.data.favorableAmount
|
||||||
|
_this.isFullPreferential = true
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
@ -523,7 +678,7 @@
|
|||||||
getUser(id){
|
getUser(id){
|
||||||
let _this = this;
|
let _this = this;
|
||||||
request({
|
request({
|
||||||
url: "business/userManager/user/" + id,
|
url: "business/userManager/user/storeUser/" + _this.oilOrder.storeId,
|
||||||
method: 'get',
|
method: 'get',
|
||||||
}).then((res) => {
|
}).then((res) => {
|
||||||
_this.user = res.data;
|
_this.user = res.data;
|
||||||
|
@ -27,7 +27,7 @@
|
|||||||
export default {
|
export default {
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
timestamp:5,
|
timestamp:3,
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onLoad() {
|
onLoad() {
|
||||||
@ -44,7 +44,7 @@
|
|||||||
if(_this.timestamp === 0) {
|
if(_this.timestamp === 0) {
|
||||||
_this.goBack()
|
_this.goBack()
|
||||||
clearInterval(timer)
|
clearInterval(timer)
|
||||||
_this.timestamp = 5
|
_this.timestamp = 3
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user