fix:用户登录和修改密码相关调整,处理了一些问题

dev_1.0.2
jiangpeng 2026-06-11 17:55:33 +08:00
parent c440cb0357
commit 348eb137a8
7 changed files with 79 additions and 70 deletions

View File

@ -274,8 +274,9 @@
<div class="stocking-product-summary__item">
<span class="stocking-product-summary__label">已备货:</span>
<span class="stocking-product-summary__value stocking-product-summary__value--green">{{ item.bhNum !== undefined && item.bhNum !== null ? item.bhNum : '-' }}</span>
<span v-if="(item.orderNum !== undefined && item.orderNum !== null ? item.orderNum-(item.bhNum||0) : 0) > 0" class="stocking-product-summary__value stocking-product-summary__value--red-bg" style="margin-left: 8px; font-size: 12px; font-weight: normal; padding: 2px 6px;">: {{ item.orderNum !== undefined && item.orderNum !== null ? item.orderNum-(item.bhNum||0): '-'}}</span>
<span v-if="item.bhNum !== undefined && item.bhNum !== null && item.orderNum !== undefined && item.orderNum !== null && item.bhNum === item.orderNum" class="stocking-product-summary__value" style="margin-left: 8px; font-size: 12px; font-weight: normal; padding: 2px 6px; background: #67c23a; color: #fff; border-radius: 3px;"></span>
<span v-if="item.orderNum !== undefined && item.orderNum !== null && Number(item.bhNum || 0) < Number(item.orderNum)" class="stocking-product-summary__value stocking-product-summary__value--red-bg" style="margin-left: 8px; font-size: 12px; font-weight: normal; padding: 2px 6px;">: {{ Number(item.orderNum) - Number(item.bhNum || 0) }}</span>
<span v-else-if="item.bhNum !== undefined && item.bhNum !== null && item.orderNum !== undefined && item.orderNum !== null && Number(item.bhNum) > Number(item.orderNum)" class="stocking-product-summary__value" style="margin-left: 8px; font-size: 12px; font-weight: normal; padding: 2px 6px; background: #e6a23c; color: #fff; border-radius: 3px;">超配: {{ Number(item.bhNum) - Number(item.orderNum) }}</span>
<span v-else-if="item.bhNum !== undefined && item.bhNum !== null && item.orderNum !== undefined && item.orderNum !== null && Number(item.bhNum) === Number(item.orderNum)" class="stocking-product-summary__value" style="margin-left: 8px; font-size: 12px; font-weight: normal; padding: 2px 6px; background: #67c23a; color: #fff; border-radius: 3px;">备货完成</span>
</div>
</div>
</div>
@ -755,21 +756,15 @@ export default {
this.stockingDetailLoading = true;
productMatchList(row.orderCode).then(response => {
const list = response.data || [];
return Promise.all(list.map(item => this.loadAllBindData(row.orderCode, item).then(allBindList => {
const bindPageNum = 1;
const bindPageSize = this.stockingBindPageSize;
const startIndex = (bindPageNum - 1) * bindPageSize;
const endIndex = startIndex + bindPageSize;
const bindList = allBindList.slice(startIndex, endIndex);
return Promise.all(list.map(item => this.loadBindData(row.orderCode, item, 1, this.stockingBindPageSize).then(bindData => {
return {
...item,
originalTotalPhNum: item.phNum,
allBindList: allBindList,
bindList: bindList,
bindTotal: allBindList.length,
bindPageNum: bindPageNum,
bindPageSize: bindPageSize
allBindList: bindData.rows,
bindList: bindData.rows,
bindTotal: bindData.total,
bindPageNum: 1,
bindPageSize: this.stockingBindPageSize
};
})));
}).then(list => {
@ -819,36 +814,46 @@ export default {
return Math.min(maxPhysical, maxAllowedByOrder);
},
loadAllBindData(orderCode, item) {
loadBindData(orderCode, item, pageNum, pageSize) {
return productMatchBindList(orderCode, item.productCode, {
pageNum: 1,
pageSize: 9999,
pageNum: pageNum,
pageSize: pageSize,
orderByColumn: 't5.bindNum desc,t6.createTime',
isAsc: 'desc'
}).then(bindResponse => {
return (bindResponse.rows || []).map(bindItem => ({
...bindItem,
phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum),
originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum,
originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum
}));
return {
rows: (bindResponse.rows || []).map(bindItem => ({
...bindItem,
phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum),
originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum,
originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum
})),
total: bindResponse.total || 0
};
}).catch(() => {
return [];
return { rows: [], total: 0 };
});
},
handleBindPageChange(item) {
const startIndex = (item.bindPageNum - 1) * item.bindPageSize;
const endIndex = startIndex + item.bindPageSize;
const bindList = (item.allBindList || []).slice(startIndex, endIndex);
this.stockingDetailList = this.stockingDetailList.map(currentItem => {
if (currentItem.productCode === item.productCode) {
return {
...currentItem,
bindList: bindList
};
}
return currentItem;
this.loadBindData(this.stockingDetailRow.orderCode, item, item.bindPageNum, item.bindPageSize).then(bindData => {
this.stockingDetailList = this.stockingDetailList.map(currentItem => {
if (currentItem.productCode === item.productCode) {
const loadedBindMap = {};
(currentItem.allBindList || []).forEach(bindItem => {
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
});
bindData.rows.forEach(bindItem => {
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
});
return {
...currentItem,
allBindList: Object.values(loadedBindMap),
bindList: bindData.rows,
bindTotal: bindData.total
};
}
return currentItem;
});
});
},
handleBindNumChange(row, item) {
@ -871,20 +876,20 @@ export default {
this.updateItemTotalPhNum(item);
},
calculateCurrentTotalPhNum(item) {
if (!item || !item.productCode || !item.allBindList) return 0;
if (!item || !item.productCode) return 0;
let total = 0;
item.allBindList.forEach(bindItem => {
const baseTotal = item.originalTotalPhNum === '' || item.originalTotalPhNum === null || item.originalTotalPhNum === undefined ? 0 : Number(item.originalTotalPhNum);
const changedDiff = (item.allBindList || []).reduce((total, bindItem) => {
const key = this.getBindDraftKey(item.productCode, bindItem.purchaseId);
if (this.stockingBindDraftMap && this.stockingBindDraftMap[key] !== undefined) {
total += Number(this.stockingBindDraftMap[key]);
} else {
const phNum = bindItem.phNum === '' || bindItem.phNum === null || bindItem.phNum === undefined ? 0 : Number(bindItem.phNum);
total += phNum;
if (!this.stockingBindDraftMap || this.stockingBindDraftMap[key] === undefined) {
return total;
}
});
const currentPhNum = Number(this.stockingBindDraftMap[key]);
const originalPhNum = bindItem.originalPhNum === '' || bindItem.originalPhNum === null || bindItem.originalPhNum === undefined ? 0 : Number(bindItem.originalPhNum);
return total + currentPhNum - originalPhNum;
}, 0);
return total;
return baseTotal + changedDiff;
},
findBindItemByPurchaseId(productCode, purchaseId) {
const product = this.stockingDetailList.find(item => item.productCode === productCode);
@ -1132,19 +1137,23 @@ export default {
if (!targetItem) {
return;
}
this.loadAllBindData(this.stockingDetailRow.orderCode, targetItem).then(allBindList => {
const bindPageNum = targetItem.bindPageNum || 1;
const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize;
const startIndex = (bindPageNum - 1) * bindPageSize;
const endIndex = startIndex + bindPageSize;
const bindList = allBindList.slice(startIndex, endIndex);
const bindPageNum = targetItem.bindPageNum || 1;
const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize;
this.loadBindData(this.stockingDetailRow.orderCode, targetItem, bindPageNum, bindPageSize).then(bindData => {
this.stockingDetailList = this.stockingDetailList.map(item => {
if (item.productCode === productCode) {
const loadedBindMap = {};
(item.allBindList || []).forEach(bindItem => {
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
});
bindData.rows.forEach(bindItem => {
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
});
return {
...item,
allBindList: allBindList,
bindList: bindList,
bindTotal: allBindList.length
allBindList: Object.values(loadedBindMap),
bindList: bindData.rows,
bindTotal: bindData.total
};
}
return item;

View File

@ -66,8 +66,8 @@
append-to-body
>
<el-form ref="resetPwdForm" :model="resetPwdForm" :rules="resetPwdRules" label-width="100px">
<el-form-item label="用户名" prop="username">
<el-input v-model="resetPwdForm.username" placeholder="请输入用户名" />
<el-form-item label="账号" prop="username">
<el-input v-model="resetPwdForm.username" placeholder="请输入账号" />
</el-form-item>
<el-form-item label="新密码" prop="newPassword">
<el-input v-model="resetPwdForm.newPassword" type="password" placeholder="请输入新密码" show-password />
@ -124,7 +124,7 @@ export default {
emailCodeTimer: null,
resetPwdRules: {
username: [
{ required: true, trigger: "blur", message: "请输入用户名" }
{ required: true, trigger: "blur", message: "请输入账号" }
],
newPassword: [
{ required: true, trigger: "blur", message: "请输入新密码" },

View File

@ -10,10 +10,10 @@
@keyup.enter.native="handleQuery"
/>
</el-form-item>
<el-form-item label="用户名称" prop="userName">
<el-form-item label="账号" prop="userName">
<el-input
v-model="queryParams.userName"
placeholder="请输入用户名称"
placeholder="请输入账号"
clearable
style="width: 240px;"
@keyup.enter.native="handleQuery"
@ -101,7 +101,7 @@
<el-table ref="tables" v-loading="loading" :data="list" @selection-change="handleSelectionChange" :default-sort="defaultSort" @sort-change="handleSortChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" />
<el-table-column label="用户名称" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="账号" align="center" prop="userName" :show-overflow-tooltip="true" sortable="custom" :sort-orders="['descending', 'ascending']" />
<el-table-column label="登录地址" align="center" prop="ipaddr" width="130" :show-overflow-tooltip="true" />
<el-table-column label="登录地点" align="center" prop="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
@ -145,7 +145,7 @@ export default {
single: true,
//
multiple: true,
//
//
selectName: "",
//
showSearch: true,

View File

@ -2,7 +2,7 @@
<el-dialog :title="title" :close-on-click-modal="false" :visible.sync="visible" width="80%" append-to-body @close="handleClose">
<div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px">
<el-form-item label="采购单号123" prop="purchaseNo">
<el-form-item label="采购单号" prop="purchaseNo">
<el-input
v-model="queryParams.purchaseNo"
placeholder="请输入采购单号"

View File

@ -103,7 +103,7 @@ public class SysLoginController extends BaseController
{
if (e instanceof UnknownAccountException || e instanceof IncorrectCredentialsException)
{
return error("用户名或密码错误");
return error("账号或密码错误");
}
String msg = "用户或密码错误";
if (StringUtils.isNotEmpty(e.getMessage()))
@ -120,7 +120,7 @@ public class SysLoginController extends BaseController
{
if (StringUtils.isEmpty(username))
{
return error("请输入用户名");
return error("请输入账号");
}
SysUser user = userService.selectUserByLoginName(username);
if (user == null)
@ -157,7 +157,7 @@ public class SysLoginController extends BaseController
{
if (StringUtils.isEmpty(username))
{
return error("请输入用户名");
return error("请输入账号");
}
if (StringUtils.isEmpty(emailCode))
{

View File

@ -1,8 +1,8 @@
#错误消息
not.null=* 必须填写
user.jcaptcha.error=验证码错误
user.not.exists=用户名或密码错误
user.password.not.match=用户名或密码错误
user.not.exists=账号或密码错误
user.password.not.match=账号或密码错误
user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次帐户锁定10分钟
user.password.delete=对不起,您的账号已被删除

View File

@ -59,7 +59,7 @@ public class SysLoginService
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException();
}
// 用户名或密码为空 错误
// 账号或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
{
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
@ -73,7 +73,7 @@ public class SysLoginService
throw new UserPasswordNotMatchException();
}
// 用户名不在指定范围内 错误
// 账号不在指定范围内 错误
if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|| username.length() > UserConstants.USERNAME_MAX_LENGTH)
{