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"> <div class="stocking-product-summary__item">
<span class="stocking-product-summary__label">已备货:</span> <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 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.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-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-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> </div>
</div> </div>
@ -755,21 +756,15 @@ export default {
this.stockingDetailLoading = true; this.stockingDetailLoading = true;
productMatchList(row.orderCode).then(response => { productMatchList(row.orderCode).then(response => {
const list = response.data || []; const list = response.data || [];
return Promise.all(list.map(item => this.loadAllBindData(row.orderCode, item).then(allBindList => { return Promise.all(list.map(item => this.loadBindData(row.orderCode, item, 1, this.stockingBindPageSize).then(bindData => {
const bindPageNum = 1;
const bindPageSize = this.stockingBindPageSize;
const startIndex = (bindPageNum - 1) * bindPageSize;
const endIndex = startIndex + bindPageSize;
const bindList = allBindList.slice(startIndex, endIndex);
return { return {
...item, ...item,
originalTotalPhNum: item.phNum, originalTotalPhNum: item.phNum,
allBindList: allBindList, allBindList: bindData.rows,
bindList: bindList, bindList: bindData.rows,
bindTotal: allBindList.length, bindTotal: bindData.total,
bindPageNum: bindPageNum, bindPageNum: 1,
bindPageSize: bindPageSize bindPageSize: this.stockingBindPageSize
}; };
}))); })));
}).then(list => { }).then(list => {
@ -819,37 +814,47 @@ export default {
return Math.min(maxPhysical, maxAllowedByOrder); return Math.min(maxPhysical, maxAllowedByOrder);
}, },
loadAllBindData(orderCode, item) { loadBindData(orderCode, item, pageNum, pageSize) {
return productMatchBindList(orderCode, item.productCode, { return productMatchBindList(orderCode, item.productCode, {
pageNum: 1, pageNum: pageNum,
pageSize: 9999, pageSize: pageSize,
orderByColumn: 't5.bindNum desc,t6.createTime', orderByColumn: 't5.bindNum desc,t6.createTime',
isAsc: 'desc' isAsc: 'desc'
}).then(bindResponse => { }).then(bindResponse => {
return (bindResponse.rows || []).map(bindItem => ({ return {
rows: (bindResponse.rows || []).map(bindItem => ({
...bindItem, ...bindItem,
phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum), phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum),
originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum, originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum,
originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum
})); })),
total: bindResponse.total || 0
};
}).catch(() => { }).catch(() => {
return []; return { rows: [], total: 0 };
}); });
}, },
handleBindPageChange(item) { handleBindPageChange(item) {
const startIndex = (item.bindPageNum - 1) * item.bindPageSize; this.loadBindData(this.stockingDetailRow.orderCode, item, item.bindPageNum, item.bindPageSize).then(bindData => {
const endIndex = startIndex + item.bindPageSize;
const bindList = (item.allBindList || []).slice(startIndex, endIndex);
this.stockingDetailList = this.stockingDetailList.map(currentItem => { this.stockingDetailList = this.stockingDetailList.map(currentItem => {
if (currentItem.productCode === item.productCode) { 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 { return {
...currentItem, ...currentItem,
bindList: bindList allBindList: Object.values(loadedBindMap),
bindList: bindData.rows,
bindTotal: bindData.total
}; };
} }
return currentItem; return currentItem;
}); });
});
}, },
handleBindNumChange(row, item) { handleBindNumChange(row, item) {
const rawValue = row.phNum === '' || row.phNum === null || row.phNum === undefined ? 0 : Number(row.phNum); const rawValue = row.phNum === '' || row.phNum === null || row.phNum === undefined ? 0 : Number(row.phNum);
@ -871,20 +876,20 @@ export default {
this.updateItemTotalPhNum(item); this.updateItemTotalPhNum(item);
}, },
calculateCurrentTotalPhNum(item) { calculateCurrentTotalPhNum(item) {
if (!item || !item.productCode || !item.allBindList) return 0; if (!item || !item.productCode) return 0;
let total = 0; const baseTotal = item.originalTotalPhNum === '' || item.originalTotalPhNum === null || item.originalTotalPhNum === undefined ? 0 : Number(item.originalTotalPhNum);
item.allBindList.forEach(bindItem => { const changedDiff = (item.allBindList || []).reduce((total, bindItem) => {
const key = this.getBindDraftKey(item.productCode, bindItem.purchaseId); const key = this.getBindDraftKey(item.productCode, bindItem.purchaseId);
if (this.stockingBindDraftMap && this.stockingBindDraftMap[key] !== undefined) { 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;
}
});
return total; 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 baseTotal + changedDiff;
}, },
findBindItemByPurchaseId(productCode, purchaseId) { findBindItemByPurchaseId(productCode, purchaseId) {
const product = this.stockingDetailList.find(item => item.productCode === productCode); const product = this.stockingDetailList.find(item => item.productCode === productCode);
@ -1132,19 +1137,23 @@ export default {
if (!targetItem) { if (!targetItem) {
return; return;
} }
this.loadAllBindData(this.stockingDetailRow.orderCode, targetItem).then(allBindList => {
const bindPageNum = targetItem.bindPageNum || 1; const bindPageNum = targetItem.bindPageNum || 1;
const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize; const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize;
const startIndex = (bindPageNum - 1) * bindPageSize; this.loadBindData(this.stockingDetailRow.orderCode, targetItem, bindPageNum, bindPageSize).then(bindData => {
const endIndex = startIndex + bindPageSize;
const bindList = allBindList.slice(startIndex, endIndex);
this.stockingDetailList = this.stockingDetailList.map(item => { this.stockingDetailList = this.stockingDetailList.map(item => {
if (item.productCode === productCode) { 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 { return {
...item, ...item,
allBindList: allBindList, allBindList: Object.values(loadedBindMap),
bindList: bindList, bindList: bindData.rows,
bindTotal: allBindList.length bindTotal: bindData.total
}; };
} }
return item; return item;

View File

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

View File

@ -10,10 +10,10 @@
@keyup.enter.native="handleQuery" @keyup.enter.native="handleQuery"
/> />
</el-form-item> </el-form-item>
<el-form-item label="用户名称" prop="userName"> <el-form-item label="账号" prop="userName">
<el-input <el-input
v-model="queryParams.userName" v-model="queryParams.userName"
placeholder="请输入用户名称" placeholder="请输入账号"
clearable clearable
style="width: 240px;" style="width: 240px;"
@keyup.enter.native="handleQuery" @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 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 type="selection" width="55" align="center" />
<el-table-column label="访问编号" align="center" prop="infoId" /> <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="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="loginLocation" :show-overflow-tooltip="true" />
<el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" /> <el-table-column label="浏览器" align="center" prop="browser" :show-overflow-tooltip="true" />
@ -145,7 +145,7 @@ export default {
single: true, single: true,
// //
multiple: true, multiple: true,
// //
selectName: "", selectName: "",
// //
showSearch: true, 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"> <el-dialog :title="title" :close-on-click-modal="false" :visible.sync="visible" width="80%" append-to-body @close="handleClose">
<div class="app-container"> <div class="app-container">
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="120px"> <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 <el-input
v-model="queryParams.purchaseNo" v-model="queryParams.purchaseNo"
placeholder="请输入采购单号" placeholder="请输入采购单号"

View File

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

View File

@ -1,8 +1,8 @@
#错误消息 #错误消息
not.null=* 必须填写 not.null=* 必须填写
user.jcaptcha.error=验证码错误 user.jcaptcha.error=验证码错误
user.not.exists=用户名或密码错误 user.not.exists=账号或密码错误
user.password.not.match=用户名或密码错误 user.password.not.match=账号或密码错误
user.password.retry.limit.count=密码输入错误{0}次 user.password.retry.limit.count=密码输入错误{0}次
user.password.retry.limit.exceed=密码输入错误{0}次帐户锁定10分钟 user.password.retry.limit.exceed=密码输入错误{0}次帐户锁定10分钟
user.password.delete=对不起,您的账号已被删除 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"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
throw new CaptchaException(); throw new CaptchaException();
} }
// 用户名或密码为空 错误 // 账号或密码为空 错误
if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password)) if (StringUtils.isEmpty(username) || StringUtils.isEmpty(password))
{ {
AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null"))); AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("not.null")));
@ -73,7 +73,7 @@ public class SysLoginService
throw new UserPasswordNotMatchException(); throw new UserPasswordNotMatchException();
} }
// 用户名不在指定范围内 错误 // 账号不在指定范围内 错误
if (username.length() < UserConstants.USERNAME_MIN_LENGTH if (username.length() < UserConstants.USERNAME_MIN_LENGTH
|| username.length() > UserConstants.USERNAME_MAX_LENGTH) || username.length() > UserConstants.USERNAME_MAX_LENGTH)
{ {