fix:用户登录和修改密码相关调整,处理了一些问题
parent
c440cb0357
commit
348eb137a8
|
|
@ -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,36 +814,46 @@ 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 {
|
||||||
...bindItem,
|
rows: (bindResponse.rows || []).map(bindItem => ({
|
||||||
phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum),
|
...bindItem,
|
||||||
originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum,
|
phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum),
|
||||||
originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum
|
originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum,
|
||||||
}));
|
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;
|
this.stockingDetailList = this.stockingDetailList.map(currentItem => {
|
||||||
const bindList = (item.allBindList || []).slice(startIndex, endIndex);
|
if (currentItem.productCode === item.productCode) {
|
||||||
|
const loadedBindMap = {};
|
||||||
this.stockingDetailList = this.stockingDetailList.map(currentItem => {
|
(currentItem.allBindList || []).forEach(bindItem => {
|
||||||
if (currentItem.productCode === item.productCode) {
|
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
|
||||||
return {
|
});
|
||||||
...currentItem,
|
bindData.rows.forEach(bindItem => {
|
||||||
bindList: bindList
|
loadedBindMap[String(bindItem.purchaseId)] = bindItem;
|
||||||
};
|
});
|
||||||
}
|
return {
|
||||||
return currentItem;
|
...currentItem,
|
||||||
|
allBindList: Object.values(loadedBindMap),
|
||||||
|
bindList: bindData.rows,
|
||||||
|
bindTotal: bindData.total
|
||||||
|
};
|
||||||
|
}
|
||||||
|
return currentItem;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
handleBindNumChange(row, item) {
|
handleBindNumChange(row, item) {
|
||||||
|
|
@ -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]);
|
return total;
|
||||||
} else {
|
|
||||||
const phNum = bindItem.phNum === '' || bindItem.phNum === null || bindItem.phNum === undefined ? 0 : Number(bindItem.phNum);
|
|
||||||
total += phNum;
|
|
||||||
}
|
}
|
||||||
});
|
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) {
|
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;
|
this.loadBindData(this.stockingDetailRow.orderCode, targetItem, bindPageNum, bindPageSize).then(bindData => {
|
||||||
const startIndex = (bindPageNum - 1) * bindPageSize;
|
|
||||||
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;
|
||||||
|
|
|
||||||
|
|
@ -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: "请输入新密码" },
|
||||||
|
|
|
||||||
|
|
@ -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,
|
||||||
|
|
|
||||||
|
|
@ -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="请输入采购单号"
|
||||||
|
|
|
||||||
|
|
@ -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))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -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=对不起,您的账号已被删除
|
||||||
|
|
|
||||||
|
|
@ -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)
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue