This commit is contained in:
cun-nan 2024-01-11 13:55:20 +08:00
parent a6cc143bed
commit 2a9b7cae2e
11 changed files with 368 additions and 64 deletions

View File

@ -551,7 +551,7 @@ export default {
rules: { rules: {
name: [ name: [
{ required: true, message: "会员名称不能为空", trigger: "blur" }, { required: true, message: "会员名称不能为空", trigger: "blur" },
{ min: 2, max: 200, message: '会员名称长度必须介于2 和 100 之间', trigger: 'blur' } // { min: 2, max: 200, message: '2 100 ', trigger: 'blur' }
], ],
gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }], gradeId: [{ required: true, message: "请选择会员等级", trigger: "blur" }],
status: [{ required: true, message: "请选择会员状态", trigger: "blur" }], status: [{ required: true, message: "请选择会员状态", trigger: "blur" }],

View File

@ -541,7 +541,133 @@
<!-- 子卡管理--> <!-- 子卡管理-->
<el-dialog :title="title" :visible.sync="openSubCard" append-to-body> <el-dialog :title="title" :visible.sync="openSubCard" append-to-body>
<cardValueChild :pUserId="form.id"></cardValueChild> <!-- <cardValueChild :pUserId="form.id" :handleUpdate="handleUpdate1" :handleAdd="handleAdd1"></cardValueChild>-->
<el-tabs v-model="subCardActive" @tab-click="handleClick">
<el-tab-pane label="子卡管理" name="subCardManage">
<div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">会员信息{{form.mobile}}</div>
<el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="cardValueChildList">
<el-table-column label="子卡ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
<el-table-column label="创建时间" align="center" width="160" prop="createTime">
<template slot-scope="scope">
<span>{{ parseTime(scope.row.createTime) }}</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed='right'>
<template slot-scope="scope">
<el-button
size="mini"
type="text"
icon="el-icon-edit"
@click="handleUpdate1(scope.row)"
>修改</el-button>
<el-button
size="mini"
type="text"
icon="el-icon-document"
@click="handleOrder(scope.row)"
>交易记录</el-button>
</template>
</el-table-column>
</el-table>
<!-- <pagination-->
<!-- :total="total"-->
<!-- :page.sync="queryParams.page"-->
<!-- :limit.sync="queryParams.pageSize"-->
<!-- @pagination="getList"-->
<!-- />-->
</div>
<el-alert
title="关于子卡"
type="info"
style="margin-top: 20px"
:closable="false"
description="子卡为会员子母卡功能,子卡共享母卡的储值额度及信息,子卡为实体会员卡信息,消费需在小程序中才可进行使用">
</el-alert>
</el-tab-pane>
<el-tab-pane label="子卡消费记录" name="consumption">
<div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">
<el-form :model="subCardList" ref="queryForm" size="small" :inline="true" label-width="85px">
<el-form-item label="子卡手机号" prop="cardChildPhones">
<el-input
v-model="subCardList.cardChildPhones"
placeholder="请输入子卡手机号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="支付状态" prop="status">
<el-select
v-model="subCardList.status"
placeholder="全部"
clearable
style="width: 240px"
>
<el-option
v-for="dict in dict.type.pay_status"
:key="dict.value"
:label="dict.label"
:value="dict.value"
/>
</el-select>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="handleQuery">搜索</el-button>
</el-form-item>
</el-form>
</div>
</div>
<div>
<el-table ref="tables" v-loading="loading" :data="orderList">
<el-table-column type="expand">
<template slot-scope="props">
<el-form label-position="left" class="demo-table-expand" style="margin-left: 20px">
<el-form-item label="备注信息">
<span>{{ props.row.remark }}</span>
</el-form-item>
</el-form>
</template>
</el-table-column>
<el-table-column label="ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center" />
<el-table-column label="订单号" prop="orderNo" align="center" />
<el-table-column label="订单金额" prop="amount" align="center" />
<el-table-column label="消费金额" prop="payAmount" align="center" />
<el-table-column label="支付状态" prop="status" align="center" >
<template slot-scope="scope">
<dict-tag :options="dict.type.pay_status" :value="scope.row.status"/>
</template>
</el-table-column>
<el-table-column label="支付时间" prop="payTime" align="center" >
<template slot-scope="scope">
<span>{{ scope.row.payTime ? parseTime(scope.row.payTime) :"--" }}</span>
</template>
</el-table-column>
</el-table>
<pagination
:total="total"
:page.sync="subCardList.page"
:limit.sync="subCardList.pageSize"
@pagination="getOrderList"
/>
</div>
<el-alert
title="关于子卡"
type="info"
style="margin-top: 20px"
:closable="false"
description="当前会员的所有子卡消费记录信息,可根据对应子卡卡号进行检索查询">
</el-alert>
</el-tab-pane>
</el-tabs>
</el-dialog> </el-dialog>
<!-- 每日交易次数--> <!-- 每日交易次数-->
@ -598,6 +724,43 @@
</div> </div>
</el-dialog> </el-dialog>
<!-- 添加或修改子卡信息-->
<el-dialog :close-on-click-modal="false" :title="title" :visible.sync="openSubCard1" width="30%">
<el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-row>
<el-col :span="24">
<el-form-item label="主卡信息" prop="userId" style="width: 420px">
<el-select
v-model="form1.userId"
placeholder="全部"
clearable
disabled
style="width: 100%"
>
<el-option
:label="form.mobile"
:value="form.id"
/>
</el-select>
</el-form-item>
</el-col>
</el-row>
<el-row>
<el-col :span="24">
<el-form-item label="子卡手机号" prop="cardChildPhones" style="width: 420px">
<el-input
v-model.number="form1.cardChildPhones"
placeholder="请输入子卡手机号"
/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="openSubCard1 = false"> </el-button>
<el-button type="primary" @click="submitSubCard"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -628,6 +791,12 @@ import growthValueRecord from "@/views/member/userInfoOrder/growthValueRecord.vu
import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.vue"; import refuelMoneyRecord from "@/views/member/userInfoOrder/refuelMoneyRecord.vue";
import cardValueChild from "@/views/member/userInfoOrder/cardValueChild.vue"; import cardValueChild from "@/views/member/userInfoOrder/cardValueChild.vue";
import {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel"; import {allFixingLevel, getFixingLevel} from "@/api/staff/user/fixinglevel";
import {
addCardValueChild,
cardValueChildInfo,
editCardValueChild,
listCardValueChild, listCardValueChildOrder
} from "@/api/staff/user/cardvaluechild";
export default { export default {
components: { components: {
@ -646,9 +815,11 @@ export default {
return item return item
} }
}, },
dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type'], dicts: ['official', 'zhzt', 'zcrzdj', 'payment_type','pay_status'],
data() { data() {
return { return {
orderList:[],
openSubCard1:false,
baseUrl: process.env.VUE_APP_BASE_API, baseUrl: process.env.VUE_APP_BASE_API,
flag: null, flag: null,
fixingLevelList: [], fixingLevelList: [],
@ -744,11 +915,13 @@ export default {
tabOilType: '92', tabOilType: '92',
// //
aboutSecondCard: [], aboutSecondCard: [],
cardValueChildList:[],
// //
loading: false, loading: false,
id: '', id: '',
// //
form: {}, form: {},
form1: {},
// //
store: '', store: '',
// //
@ -766,7 +939,13 @@ export default {
name: '', name: '',
status: '', status: '',
}, },
subCardList: [], subCardList:{
page:1,
pageSize:10,
cardChildPhones:'',
userId:'',
status:''
},
list: [], list: [],
// //
rules: { rules: {
@ -774,6 +953,8 @@ export default {
name: [{required: true, message: "请输入会员昵称,内容不可为空", trigger: "blur"}], name: [{required: true, message: "请输入会员昵称,内容不可为空", trigger: "blur"}],
type: [{required: true, message: "请选择操作类型", trigger: "blur"}], type: [{required: true, message: "请选择操作类型", trigger: "blur"}],
fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}], fixingLevel: [{required: true, message: "请选择认证信息", trigger: "blur"}],
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
} }
} }
}, },
@ -788,8 +969,73 @@ export default {
this.getInformation(); this.getInformation();
this.getFixingLevelList(); this.getFixingLevelList();
this.getStore(); this.getStore();
this.getCardList()
this.getOrderList()
}, },
methods: { methods: {
handleQuery(){
this.subCardList.page = 1;
this.getOrderList()
},
handleOrder(data){
this.subCardList.cardChildPhones = data.cardChildPhones
this.subCardActive = "consumption"
this.subCardList.page = 1;
this.getOrderList()
},
//
getOrderList(){
this.subCardList.userId = this.id
listCardValueChildOrder(this.subCardList).then(res => {
this.orderList = res.data.records
this.total = res.data.total
})
},
//
getCardList(){
listCardValueChild(this.id).then(res => {
this.cardValueChildList = res.data
})
},
handleAdd1(){
this.title = "添加子卡信息"
this.openSubCard1 = true
},
handleUpdate1(data){
cardValueChildInfo(data.id).then(res => {
this.form1 = res.data
this.title = "修改子卡信息"
this.openSubCard1 = true
})
},
//
submitSubCard(){
this.$refs["form1"].validate(valid => {
if (valid) {
if (this.form1.id) {
editCardValueChild(this.form1).then(res => {
if (res.data==1){
this.$modal.msgSuccess("修改成功!")
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError("手机号已存在,请重新添加")
}
})
}else {
addCardValueChild(this.form1).then(res => {
if (res.data.success=="添加成功!"){
this.$modal.msgSuccess("添加成功!")
this.openSubCard1 = false
this.getCardList()
}else {
this.$modal.msgError(res.data.error)
}
})
}
}
})
},
fixingLevelinfo(list, id) { fixingLevelinfo(list, id) {
let name = ""; let name = "";
list.forEach(item => { list.forEach(item => {

View File

@ -4,10 +4,10 @@
<el-tab-pane label="子卡管理" name="subCardManage"> <el-tab-pane label="子卡管理" name="subCardManage">
<div style="display: flex;justify-content: space-between;margin: 10px 0"> <div style="display: flex;justify-content: space-between;margin: 10px 0">
<div style="font-size: 16px">会员信息{{form.mobile}}</div> <div style="font-size: 16px">会员信息{{form.mobile}}</div>
<el-button type="primary" :disabled="list.length>=2" @click="handleAdd">新增子卡</el-button> <el-button type="primary" :disabled="cardValueChildList.length>=2" @click="handleAdd1">新增子卡</el-button>
</div> </div>
<div> <div>
<el-table ref="tables" v-loading="loading" :data="list"> <el-table ref="tables" v-loading="loading" :data="cardValueChildList">
<el-table-column label="子卡ID" prop="id" align="center" width="60"/> <el-table-column label="子卡ID" prop="id" align="center" width="60"/>
<el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/> <el-table-column label="子卡手机号" prop="cardChildPhones" align="center"/>
<el-table-column label="创建时间" align="center" width="160" prop="createTime"> <el-table-column label="创建时间" align="center" width="160" prop="createTime">
@ -21,7 +21,7 @@
size="mini" size="mini"
type="text" type="text"
icon="el-icon-edit" icon="el-icon-edit"
@click="handleUpdate(scope.row)" @click="handleUpdate1(scope.row)"
>修改</el-button> >修改</el-button>
<el-button <el-button
size="mini" size="mini"
@ -127,8 +127,8 @@
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<el-dialog :title="title" :visible.sync="dialogVisible" width="30%"> <el-dialog :title="title" :visible.sync="openSubCard1" width="30%">
<el-form ref="form" :model="form1" :rules="rules" label-width="120px"> <el-form ref="form1" :model="form1" :rules="rules" label-width="120px">
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="主卡信息" prop="userId" style="width: 420px"> <el-form-item label="主卡信息" prop="userId" style="width: 420px">
@ -159,8 +159,8 @@
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button> <el-button @click="openSubCard1 = false"> </el-button>
<el-button type="primary" @click="submitFrom"> </el-button> <el-button type="primary" @click="submitSubCard"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -191,7 +191,7 @@ export default {
page:1, page:1,
pageSize:10, pageSize:10,
}, },
list:[], cardValueChildList:[],
userId:"", userId:"",
subCardList: { subCardList: {
page:1, page:1,
@ -201,7 +201,7 @@ export default {
}, },
orderList:[], orderList:[],
title:"", title:"",
dialogVisible:false, openSubCard1:false,
rules:{ rules:{
userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }], userId:[{ required: true, message: '请选择主卡信息', trigger: 'change' }],
cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}], cardChildPhones:[{required: true, message: "请输入子卡手机号", trigger: "blur"}],
@ -212,7 +212,7 @@ export default {
this.userId = this.$route.query.id; this.userId = this.$route.query.id;
this.getUser() this.getUser()
this.getList() this.getCardList()
this.getOrderList() this.getOrderList()
}, },
methods:{ methods:{
@ -223,9 +223,9 @@ export default {
}) })
}, },
// //
getList(){ getCardList(){
listCardValueChild(this.userId).then(res => { listCardValueChild(this.userId).then(res => {
this.list = res.data this.cardValueChildList = res.data
}) })
}, },
// //
@ -235,27 +235,29 @@ export default {
this.total = res.data.total this.total = res.data.total
}) })
}, },
handleAdd(){ handleAdd1(){
this.title = "添加子卡信息" // this.title = ""
this.dialogVisible = true // this.openSubCard1 = true
this.$emit("handleAdd")
}, },
handleUpdate(data){ handleUpdate1(data){
cardValueChildInfo(data.id).then(res => { // cardValueChildInfo(data.id).then(res => {
this.form1 = res.data // this.form1 = res.data
this.title = "修改子卡信息" // this.title = ""
this.dialogVisible = true // this.openSubCard1 = true
}) // })
this.$emit("handleUpdate")
}, },
// //
submitFrom(){ submitSubCard(){
this.$refs["form"].validate(valid => { this.$refs["form1"].validate(valid => {
if (valid) { if (valid) {
if (this.form1.id) { if (this.form1.id) {
editCardValueChild(this.form1).then(res => { editCardValueChild(this.form1).then(res => {
if (res.data==1){ if (res.data==1){
this.$modal.msgSuccess("修改成功!") this.$modal.msgSuccess("修改成功!")
this.dialogVisible = false this.openSubCard1 = false
this.getList() this.getCardList()
}else { }else {
this.$modal.msgError("手机号已存在,请重新添加") this.$modal.msgError("手机号已存在,请重新添加")
} }
@ -264,8 +266,8 @@ export default {
addCardValueChild(this.form1).then(res => { addCardValueChild(this.form1).then(res => {
if (res.data.success=="添加成功!"){ if (res.data.success=="添加成功!"){
this.$modal.msgSuccess("添加成功!") this.$modal.msgSuccess("添加成功!")
this.dialogVisible = false this.openSubCard1 = false
this.getList() this.getCardList()
}else { }else {
this.$modal.msgError(res.data.error) this.$modal.msgError(res.data.error)
} }

View File

@ -3,7 +3,8 @@
<mapper namespace="com.fuint.business.order.mapper.CardValueChildOrderMapper"> <mapper namespace="com.fuint.business.order.mapper.CardValueChildOrderMapper">
<select id="selectCardValueChildOrderList" resultType="com.fuint.business.order.vo.CardValueChildOrderVo"> <select id="selectCardValueChildOrderList" resultType="com.fuint.business.order.vo.CardValueChildOrderVo">
select cvco.*,cvc.card_child_phones from card_value_child_order cvco left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id select cvco.*,cvc.card_child_phones from card_value_child_order cvco
left join card_valud_childrens cvc on cvco.card_value_child_id = cvc.id
<where> <where>
<if test="order.storeId != null and order.storeId != ''"> <if test="order.storeId != null and order.storeId != ''">
and cvco.store_id = #{order.storeId} and cvco.store_id = #{order.storeId}
@ -11,6 +12,12 @@
<if test="order.cardChildPhones != null and order.cardChildPhones != ''"> <if test="order.cardChildPhones != null and order.cardChildPhones != ''">
and cvc.card_child_phones = #{order.cardChildPhones} and cvc.card_child_phones = #{order.cardChildPhones}
</if> </if>
<if test="order.userId != null and order.userId != ''">
and cvc.user_id = #{order.userId}
</if>
<if test="order.status != null and order.status != ''">
and cvco.status = #{order.status}
</if>
order by cvco.pay_time desc order by cvco.pay_time desc
</where> </where>
</select> </select>

View File

@ -1,5 +1,6 @@
package com.fuint.business.order.service.impl; package com.fuint.business.order.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.core.metadata.IPage; import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
@ -30,10 +31,13 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
@Override @Override
public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) { public IPage<CardValueChildOrderVo> selectCardValueChildOrderList(Page page, CardValueChildOrderVo cardValueChildOrderVo) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
if (cardValueChildOrderVo.getStoreId()==null){ if (cardValueChildOrderVo.getStoreId()==null){
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId()); cardValueChildOrderVo.setStoreId(nowAccountInfo.getStoreId());
} }
if (cardValueChildOrderVo.getUserId()==null){
cardValueChildOrderVo.setUserId(nowAccountInfo.getId());
}
return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo); return baseMapper.selectCardValueChildOrderList(page,cardValueChildOrderVo);
} }
@ -50,10 +54,15 @@ public class CardValueChildOrderServiceImpl extends ServiceImpl<CardValueChildOr
LJStore store = storeService.selectStoreByStoreId(cardValueChildOrder.getStoreId()); LJStore store = storeService.selectStoreByStoreId(cardValueChildOrder.getStoreId());
CardValudChildrens cardValudChildrens = cardValudChildrensService.selectCardValueChildrenByMobileAndStoreId(user.getMobile(), cardValueChildOrder.getStoreId()); CardValudChildrens cardValudChildrens = cardValudChildrensService.selectCardValueChildrenByMobileAndStoreId(user.getMobile(), cardValueChildOrder.getStoreId());
cardValueChildOrder.setCardValueId(cardValudChildrens.getCardValueId()); int row = 0;
cardValueChildOrder.setCardValueChildId(cardValudChildrens.getId());
cardValueChildOrder.setChainStoreId(store.getChainStoreId()); if (ObjectUtil.isNotEmpty(cardValudChildrens)){
return baseMapper.insert(cardValueChildOrder); cardValueChildOrder.setCardValueId(cardValudChildrens.getCardValueId());
cardValueChildOrder.setCardValueChildId(cardValudChildrens.getId());
cardValueChildOrder.setChainStoreId(store.getChainStoreId());
row =baseMapper.insert(cardValueChildOrder);
}
return row;
} }
@Override @Override

View File

@ -47,6 +47,7 @@ import com.fuint.business.userManager.service.LJUserService;
import com.fuint.business.userManager.service.UserBalanceService; import com.fuint.business.userManager.service.UserBalanceService;
import com.fuint.business.userManager.vo.LJUserVo; 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.TokenUtil; import com.fuint.common.util.TokenUtil;
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;
@ -978,7 +979,25 @@ public class OilOrderServiceImpl extends ServiceImpl<OilOrderMapper, OilOrder> i
LJStore store = storeService.selectStoreByStoreId(storeId); LJStore store = storeService.selectStoreByStoreId(storeId);
UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId()); UserBalance balance = userBalanceService.selectUserBalance(userid,store.getChainStoreId());
int growth = balance.getGrowthValue(); int growth = balance.getGrowthValue();
balance.setRefuelMoney(refuelMoney); if (refuelMoney==null){
String refuelMoney1 = balance.getRefuelMoney();
if (StringUtils.isNotEmpty(refuelMoney1)){
JSONArray objects = JSONArray.parseArray(refuelMoney1);
List<RefuelMoney> list = new ArrayList<>();
for (Object object : objects) {
if (((JSONObject)object).get("oilType").toString().equals(oilId)){
RefuelMoney refuelMoney2 = new RefuelMoney();
refuelMoney2.setType(((JSONObject) object).get("type").toString());
refuelMoney2.setOilType(((JSONObject) object).get("oilType").toString());
refuelMoney2.setRefuelMoney("0");
list.add(refuelMoney2);
}
}
balance.setRefuelMoney(JSONObject.toJSONString(list));
}
}else {
balance.setRefuelMoney(refuelMoney);
}
// 查询会员等级列表信息 // 查询会员等级列表信息
Page page = new Page(1,20); Page page = new Page(1,20);
LJUserGrade ljUserGrade1 = new LJUserGrade(); LJUserGrade ljUserGrade1 = new LJUserGrade();

View File

@ -68,7 +68,7 @@ public interface LJUserMapper extends BaseMapper<LJUser> {
* @param name * @param name
* @return * @return
*/ */
public List<LJUserVo> selectUserByName(@Param("name") String name); public List<LJUserVo> selectUserByName(@Param("name") String name,@Param("chainStoreId") Integer chainStoreId);
/** /**
* 统计信息 * 统计信息

View File

@ -67,9 +67,12 @@
</select> </select>
<select id="selectUserByName" resultType="com.fuint.business.userManager.vo.LJUserVo" <select id="selectUserByName" 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.name like concat('%', #{name}, '%') mu.name like concat('%', #{name}, '%')
<if test="chainStoreId != null and chainStoreId != ''">
and mub.chain_store_id = #{chainStoreId}
</if>
</where> </where>
</select> </select>

View File

@ -206,7 +206,9 @@ public class LJUserServiceImpl extends ServiceImpl<LJUserMapper, LJUser> impleme
*/ */
@Override @Override
public List<LJUserVo> queryUserByName(String name) { public List<LJUserVo> queryUserByName(String name) {
List<LJUserVo> list = baseMapper.selectUserByName(name); AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
LJStore store = storeService.selectStoreByStoreId(nowAccountInfo.getStoreId());
List<LJUserVo> list = baseMapper.selectUserByName(name,store.getChainStoreId());
return list; return list;
} }

View File

@ -15,7 +15,7 @@
background-color: rgb(67,119,204)"> background-color: rgb(67,119,204)">
<div> <div>
<template> <template>
<img v-if="member.avatar" class="list-avatar" :src="member.avatar"> <img v-if="member.avatar" class="list-avatar" :src="baseUrl + member.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png"> <img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template> </template>
</div> </div>
@ -135,7 +135,7 @@
</div> </div>
<div>- {{ consumeRefuelMoney }}L</div> <div>- {{ consumeRefuelMoney }}L</div>
</div> </div>
<div class="center-left-hj" v-show="isMember"> <div class="center-left-hj" v-show="isMember && balance>0">
<div> <div>
<el-checkbox style="color: black;font-size: 16px" <el-checkbox style="color: black;font-size: 16px"
v-model="checkAll4" @change="handleCheckAllChange4"> v-model="checkAll4" @change="handleCheckAllChange4">
@ -639,12 +639,12 @@
title="请选择会员" title="请选择会员"
:visible.sync="dialogVisibleMember" :visible.sync="dialogVisibleMember"
:close-on-click-modal="false"> :close-on-click-modal="false">
<div class="wrap-wrap"> <div class="wrap-wrap" style="height:700px;overflow-y: scroll;">
<el-table ref="tables" :data="memberList"> <el-table ref="tables" :data="memberList">
<el-table-column label="ID" align="center" prop="id" width="80" /> <el-table-column label="ID" align="center" prop="id" width="80" />
<el-table-column label="头像" align="center" width="70"> <el-table-column label="头像" align="center" width="70">
<template slot-scope="scope"> <template slot-scope="scope">
<img v-if="scope.row.avatar" class="list-avatar" :src="scope.row.avatar"> <img v-if="scope.row.avatar" class="list-avatar" :src="baseUrl + scope.row.avatar">
<img v-else class="list-avatar" src="@/assets/images/avatar.png"> <img v-else class="list-avatar" src="@/assets/images/avatar.png">
</template> </template>
</el-table-column> </el-table-column>
@ -804,6 +804,7 @@
name: "homeindex", name: "homeindex",
data(){ data(){
return{ return{
baseUrl:process.env.VUE_APP_BASE_API,
// //
checkAll1: false, checkAll1: false,
isIndeterminate1: true, isIndeterminate1: true,
@ -852,6 +853,7 @@
loading:false, loading:false,
// //
oilType:'', oilType:'',
oilNameID:'',
// //
type:"", type:"",
// //
@ -1032,7 +1034,7 @@
// //
oilNumberList:[], oilNumberList:[],
// //
isSure:false, isSure:true,
// //
couponAmount:0, couponAmount:0,
// //
@ -1939,6 +1941,7 @@
_this.couponDiscount =[]; _this.couponDiscount =[];
_this.couponIds = [], _this.couponIds = [],
selectCoupon(_this.preferentialData).then(response => { selectCoupon(_this.preferentialData).then(response => {
// console.log(response)
_this.couponAmount = 0; _this.couponAmount = 0;
_this.couponIds = response.data _this.couponIds = response.data
if (response.data.length>0){ if (response.data.length>0){
@ -2031,6 +2034,7 @@
this.oilActualPay = 0 this.oilActualPay = 0
this.consumeAmount = 0 this.consumeAmount = 0
} }
console.log("囤油卡",this.hoardAmount,this.balance,this.oilAmount,this.oilActualPay,this.consumeAmount)
}, },
// 使使 // 使使
countAmountFull(){ countAmountFull(){
@ -2190,7 +2194,7 @@
}, },
// //
handleChoose(data) { handleChoose(data) {
this.isSure = true; this.isSure = false;
this.member = data; this.member = data;
if (data.refuelMoney != null && data.refuelMoney != ""){ if (data.refuelMoney != null && data.refuelMoney != ""){
this.refuelMoney = JSON.parse(data.refuelMoney) this.refuelMoney = JSON.parse(data.refuelMoney)
@ -2306,7 +2310,7 @@
// //
getOilOrder(){ getOilOrder(){
this.dialogVisibleamount = false this.dialogVisibleamount = false
this.form.oilType = this.oilType; this.form.oilType = this.oilNameID;
this.form.type = this.type; this.form.type = this.type;
// //
if (this.select == "元"){ if (this.select == "元"){
@ -2424,6 +2428,7 @@
name = item.oilName; name = item.oilName;
oilType = item.oilType; oilType = item.oilType;
_this.oilType = item.oilName; _this.oilType = item.oilName;
_this.oilNameID = item.id;
_this.type = item.oilType; _this.type = item.oilType;
} }
}) })
@ -2442,6 +2447,7 @@
getUserInfoMobile({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
this.isSure = false
}else { }else {
this.$modal.msgError("会员信息不存在") this.$modal.msgError("会员信息不存在")
} }
@ -2568,7 +2574,6 @@
}) })
this.loading = true; this.loading = true;
_this.queryPayStatus(); _this.queryPayStatus();
// console.log(_this.isQuery)
let timer = setInterval(function () { let timer = setInterval(function () {
if (_this.isQuery == false) { if (_this.isQuery == false) {
_this.loading = false; _this.loading = false;
@ -2582,7 +2587,6 @@
_this.resetting1(); _this.resetting1();
}, },
resetting1(){ resetting1(){
// console.log(111)
let _this = this; let _this = this;
this.authCode = ""; this.authCode = "";
if (_this.isPaySuccess == true){ if (_this.isPaySuccess == true){

View File

@ -148,6 +148,7 @@
oilPrice: 0, oilPrice: 0,
// //
oilName: "", oilName: "",
oilNameId:"",
// //
oilType:"", oilType:"",
// id // id
@ -169,6 +170,7 @@
deductAmount:0, deductAmount:0,
// //
refuelMoney:[], refuelMoney:[],
refuelMoneyAfter:[],
// //
gradeDiscount:[], gradeDiscount:[],
// //
@ -200,7 +202,7 @@
}, },
onLoad(e) { onLoad(e) {
this.orderNo = e.orderNo this.orderNo = e.orderNo
// this.orderNo = "23452024011011251833f48e" // this.orderNo = "234520240111104725ec1fbe"
}, },
onShow() { onShow() {
this.getOilOrder(); this.getOilOrder();
@ -211,14 +213,12 @@
methods: { methods: {
// //
payment(){ payment(){
let refuel = this.refuelMoney
refuel.refuelMoney = this.refuelMoney.refuelMoney - this.oilCardRedece
let map = { let map = {
orderNo : this.orderNo, orderNo : this.orderNo,
payAmount : this.payAmount, payAmount : this.payAmount,
// payAmount : "0.01", // payAmount : "0.01",
discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece, discountAmount : this.fullRedece+this.gradeRedece+this.couponRedece,
oilCardAmount : JSON.stringify(refuel), oilCardAmount : JSON.stringify(this.refuelMoneyAfter),
oilCardLiters : this.oilCardRedece, oilCardLiters : this.oilCardRedece,
balanceAmount : this.balanceRedece, balanceAmount : this.balanceRedece,
isOilStorageCard : this.isOilStorageCard, isOilStorageCard : this.isOilStorageCard,
@ -308,19 +308,23 @@
// 使 // 使
chooseRefuelMoney(){ chooseRefuelMoney(){
let falg = false; let falg = false;
this.refuelMoney.forEach(item => { for(let i = 0;i<this.refuelMoney.length;i++){
if (item.oilType == this.oilName){ if (this.refuelMoney[i].oilType == this.oilNameId){
falg = true falg = true
this.refuelBalance = item.refuelMoney this.refuelBalance = this.refuelMoney[i].refuelMoney
this.isOilStorageCard = true if (this.refuelMoney[i].refuelMoney>0){
if (this.oilCardRedece >= this.oilOrder.oilNum){ this.isOilStorageCard = true
}
if (this.refuelMoney[i].refuelMoney >= this.oilOrder.oilNum){
this.oilCardRedece = this.oilOrder.oilNum this.oilCardRedece = this.oilOrder.oilNum
this.refuelMoneyAfter[i].refuelMoney = this.refuelMoney[i].refuelMoney - this.oilOrder.oilNum
}else{ }else{
this.oilCardRedece = item.refuelMoney this.oilCardRedece = this.refuelMoney[i].refuelMoney
this.refuelMoneyAfter[i].refuelMoney = 0
this.chooseCardBalance(1) this.chooseCardBalance(1)
} }
} }
}) }
if (falg == false) { if (falg == false) {
this.chooseCardBalance(0) this.chooseCardBalance(0)
this.chooseGrade(this.user.id,this.user.gradeId) this.chooseGrade(this.user.id,this.user.gradeId)
@ -342,12 +346,17 @@
}else{ }else{
// 使 // 使
// //
let residueAmount = (this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice let residueAmount = 0
if(this.oilCardRedece>0){
residueAmount = ((this.oilOrder.oilNum - this.oilCardRedece) * this.oilPrice).toFixed(2)
}else{
residueAmount = this.oilOrder.orderAmount
}
if (this.user.cardBalance >= residueAmount){ if (this.user.cardBalance >= residueAmount){
this.balanceRedece = residueAmount this.balanceRedece = residueAmount
} else { } else {
this.balanceRedece = this.user.cardBalance this.balanceRedece = this.user.cardBalance
this.payAmount = (this.oilOrder.orderAmount - residueAmount - this.balanceRedece).toFixed(2) this.payAmount = ((residueAmount*100).toFixed(0) - (this.balanceRedece*100).toFixed(0))/100
} }
} }
}else{ }else{
@ -691,9 +700,10 @@
} }
_this.user = res.data.userVo; _this.user = res.data.userVo;
_this.user = res.data.userVo; _this.user = res.data.userVo;
console.log(res.data.userVo.refuelMoney); // console.log(res.data.userVo.refuelMoney);
if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){ if (res.data.userVo.refuelMoney!=null && res.data.userVo.refuelMoney!=""){
_this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney) _this.refuelMoney = JSON.parse(res.data.userVo.refuelMoney)
_this.refuelMoneyAfter = JSON.parse(res.data.userVo.refuelMoney)
_this.chooseRefuelMoney() _this.chooseRefuelMoney()
}else{ }else{
_this.chooseCardBalance(0) _this.chooseCardBalance(0)
@ -752,9 +762,11 @@
method: 'get', method: 'get',
}).then((res) => { }).then((res) => {
res.data.forEach(item => { res.data.forEach(item => {
// console.log(item);
if (item.oilName == _this.oilOrder.oils) { if (item.oilName == _this.oilOrder.oils) {
_this.oilPrice = item.gbPrice; _this.oilPrice = item.gbPrice;
_this.oilName = item.oilNames; _this.oilName = item.oilNames;
_this.oilNameId = item.oilName;
_this.oilType = item.oilType; _this.oilType = item.oilType;
_this.oilId = item.oilId; _this.oilId = item.oilId;
} }