优化项

This commit is contained in:
cun-nan 2024-01-06 13:37:21 +08:00
parent 14f1b6fdd4
commit 683b41e456
5 changed files with 56 additions and 19 deletions

View File

@ -181,6 +181,7 @@
<el-form-item label="商品条码" prop="goodsNo">
<el-input v-model="form.goodsNo"
@keydown.enter.native="getGoods(form)"
:disabled="title == '编辑商品'"
v-focus
clearable
placeholder="商品的条码信息">
@ -283,7 +284,7 @@
style="width: 94%"
v-model="supplier"
:fetch-suggestions="querySearch"
placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即自动添加"
placeholder="供应商名称,如果是未添加的供应商,输完名称点回车即自动添加"
@change="addSupplier"
@select="selectSupplier">
<template slot-scope="{ item }">

View File

@ -1235,28 +1235,42 @@ export default {
this.form1.attestationData = JSON.stringify(this.imageUrl)
if (this.form1.id) {
updateCertifiedMember(this.form1).then(response => {
this.$modal.msgSuccess("用户认证信息更新成功");
this.openMember = false;
this.isEdit = false;
this.reset1();
this.getListMember();
if (response.data==1){
this.$modal.msgSuccess("用户认证信息更新成功");
this.openMember = false;
this.isEdit = false;
this.reset1();
this.getListMember();
}else {
this.$modal.msgError("手机号已存在")
}
});
} else {
getUserMobile({mobile:this.form1.mobile}).then( response => {
if (response.data==null){
if (!response.data){
this.$modal.msgError("用户信息不存在,请检查当前用户是否已注册")
}else {
this.form1.userId = response.data.id
getCertifiedMemberByUserId(this.form1.userId).then( res => {
if(res.data!=null){
if(res.data){
this.$modal.msgError("当前用户已存在认证记录,请检索后编辑对应用户资料处理")
}
if(res.data==null){
addCertifiedMember(this.form1).then(response => {
this.$modal.msgSuccess("新增用户认证信息成功");
this.openMember = false;
this.reset1();
this.getListMember();
}else {
addCertifiedMember(this.form1).then(resp => {
// console.log(resp)
if (resp.data==1){
this.$modal.msgSuccess("新增用户认证信息成功");
this.openMember = false;
this.reset1();
this.getListMember();
}else if (resp.data==2){
this.$modal.msgError("认证手机号不可为空")
}else if (resp.data==3){
this.$modal.msgError("用户信息不存在,请检查当前用户是否已注册")
}else{
this.$modal.msgError("认证失败,每位会员只可认证一条信息")
}
});
}
})

View File

@ -128,6 +128,8 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
*/
@Override
public int insertCertifiedMember(CertifiedMember certifiedMember) {
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
if (certifiedMember.getMobile()==null || certifiedMember.getMobile().equals("")){
return 2;
}
@ -137,6 +139,7 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
}
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mobile",certifiedMember.getMobile());
queryWrapper.eq("store_id",storeId);
CertifiedMember member = baseMapper.selectOne(queryWrapper);
if (member!=null){
return 4;
@ -146,8 +149,6 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
certifiedMember.setName(ljUser.getName());
certifiedMember.setUserId(ljUser.getId());
}
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
Integer storeId = nowAccountInfo.getStoreId();
certifiedMember.setStoreId(storeId);
int row = baseMapper.insert(certifiedMember);
return row;
@ -160,7 +161,17 @@ public class CertifiedMemberServiceImpl extends ServiceImpl<CertifiedMemberMappe
*/
@Override
public int updateCertifiedMember(CertifiedMember certifiedMember) {
int row = baseMapper.updateById(certifiedMember);
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
int row = 0;
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("mobile",certifiedMember.getMobile());
queryWrapper.eq("store_id",nowAccountInfo.getStoreId());
CertifiedMember member = baseMapper.selectOne(queryWrapper);
if (ObjectUtil.isNotEmpty(member)){
row = 0;
return row;
}
row = baseMapper.updateById(certifiedMember);
return row;
}

View File

@ -2543,12 +2543,14 @@
if (response.data.oilOrder.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.seekZero = 0
_this.amount = 0
}
}
if (response.data.goodsOrder!=null){
if (response.data.goodsOrder.status == "paid"){
_this.isPaySuccess = true;
_this.seekZero = 0
_this.amount = 0
}
}
if (response.data.error==1){
@ -2560,7 +2562,7 @@
if (response.data.error=="请先配置支付通道"){
this.$modal.msgError(response.data.error)
this.loading = false;
this.dialogVisiblej = false;
// this.dialogVisiblej = false;
return;
}
})
@ -2580,6 +2582,7 @@
_this.resetting1();
},
resetting1(){
console.log(111)
let _this = this;
this.authCode = "";
if (_this.isPaySuccess == true){
@ -2594,6 +2597,9 @@
_this.oilTotal = 0;
_this.goodsTotal = 0;
_this.isMember = false;
_this.oilOrder = []
_this.goodsOrder = []
_this.amount = 0
};
this.map = {
allAmount:0,
@ -2665,12 +2671,14 @@
if (response.data.orderStatus == "paid"){
_this.isPaySuccess = true;
_this.isQuery = false;
_this.amount = 0
}
if (response.data.orderStatus == "payFail"){
_this.isPaySuccess = false;
_this.isQuery = false;
}
}
_this.resetting1();
})
goodsOrder({orderNo:_this.orderNo}).then( response => {
if (response.data!=null){
@ -2680,12 +2688,14 @@
if (response.data.status == "paid"){
_this.isPaySuccess = true;
_this.isQuery = false;
_this.amount = 0
}
if (response.data.status == "payFail"){
_this.isPaySuccess = false;
_this.isQuery = false;
}
}
_this.resetting1();
})
},500)
},

View File

@ -280,6 +280,7 @@
//
getMyOrder() {
let _this = this;
_this.map.storeId = uni.getStorageSync("storeId")
request({
url: "business/oilOrder/userOrders",
method: 'get',