fix: 修复登录跳转路径和版本号更新
refactor: 移除调试日志和冗余代码 style: 格式化代码和修复条件判断逻辑 feat: 重新启用401错误处理并优化表单重置逻辑
This commit is contained in:
@@ -762,7 +762,7 @@ export default {
|
|||||||
itemType: this.itemType || this.scannedCoils[0].itemType, // 优先使用选择的itemType
|
itemType: this.itemType || this.scannedCoils[0].itemType, // 优先使用选择的itemType
|
||||||
itemId: this.itemId || this.scannedCoils[0].itemId, // 优先使用选择的itemId
|
itemId: this.itemId || this.scannedCoils[0].itemId, // 优先使用选择的itemId
|
||||||
warehouseId: this.warehouseId || this.scannedCoils[0].warehouseId, // 使用选择的库区或第一个钢卷的库区
|
warehouseId: this.warehouseId || this.scannedCoils[0].warehouseId, // 使用选择的库区或第一个钢卷的库区
|
||||||
actualWarehouseId: this.actualWarehouseId || this.scannedCoils[0].actualWarehouseId
|
actualWarehouseId: this.actualWarehouseId || this.scannedCoils[0].actualWarehouseId,
|
||||||
grossWeight: this.grossWeight ? Number(this.grossWeight) : null,
|
grossWeight: this.grossWeight ? Number(this.grossWeight) : null,
|
||||||
netWeight: this.netWeight ? Number(this.netWeight) : null,
|
netWeight: this.netWeight ? Number(this.netWeight) : null,
|
||||||
newCoils: this.scannedCoils.map(coil => ({
|
newCoils: this.scannedCoils.map(coil => ({
|
||||||
|
|||||||
@@ -76,11 +76,11 @@
|
|||||||
<klp-warehouse-picker v-model="form.warehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区"
|
<klp-warehouse-picker v-model="form.warehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区"
|
||||||
@change="handleWarehouseChange" />
|
@change="handleWarehouseChange" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<view class="form-item form-item-optional">
|
<view class="form-item form-item-optional">
|
||||||
<text class="form-label-optional">真实库区</text>
|
<text class="form-label-optional">真实库区</text>
|
||||||
<klp-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区"
|
<klp-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0"
|
||||||
ware-type="actual" />
|
placeholder="请选择目标库区" ware-type="actual" />
|
||||||
</view>
|
</view>
|
||||||
|
|
||||||
<!-- 物品类型选择 -->
|
<!-- 物品类型选择 -->
|
||||||
@@ -612,41 +612,43 @@
|
|||||||
closeWarehouseList() {
|
closeWarehouseList() {
|
||||||
this.showWarehouseList = false;
|
this.showWarehouseList = false;
|
||||||
},
|
},
|
||||||
|
|
||||||
handleReScan() {
|
handleReScan() {
|
||||||
uni.showModal({
|
uni.showModal({
|
||||||
title: '确认重新扫码',
|
title: '确认重新扫码',
|
||||||
content: '是否要清空当前数据并重新扫码?',
|
content: '是否要清空当前数据并重新扫码?',
|
||||||
success: (res) => {
|
success: (res) => {
|
||||||
this.handleReset()
|
if (res.confirm) {
|
||||||
|
this.handleReset()
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
|
||||||
// 重新扫码
|
// 重新扫码
|
||||||
handleReset() {
|
handleReset() {
|
||||||
if (res.confirm) {
|
|
||||||
this.form = {
|
this.form = {
|
||||||
coilId: undefined,
|
coilId: undefined,
|
||||||
itemType: '',
|
itemType: '',
|
||||||
itemId: undefined,
|
itemId: undefined,
|
||||||
team: '',
|
team: '',
|
||||||
currentCoilNo: '',
|
currentCoilNo: '',
|
||||||
warehouseId: undefined,
|
warehouseId: undefined,
|
||||||
actualWarehouseId: undefined,
|
actualWarehouseId: undefined,
|
||||||
warehouseName: '',
|
warehouseName: '',
|
||||||
grossWeight: '',
|
grossWeight: '',
|
||||||
netWeight: ''
|
netWeight: ''
|
||||||
};
|
};
|
||||||
this.coilDetail = {};
|
this.coilDetail = {};
|
||||||
this.materialDetail = null;
|
this.materialDetail = null;
|
||||||
this.bomItemList = [];
|
this.bomItemList = [];
|
||||||
this.warehouseKeyword = '';
|
this.warehouseKeyword = '';
|
||||||
this.currentWarehouseName = '';
|
this.currentWarehouseName = '';
|
||||||
this.selectedProductName = '';
|
this.selectedProductName = '';
|
||||||
this.filteredWarehouses = this.warehouses;
|
this.filteredWarehouses = this.warehouses;
|
||||||
this.qrcodeStatus = 1; // 重置二维码状态
|
this.qrcodeStatus = 1; // 重置二维码状态
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
// 提交
|
// 提交
|
||||||
@@ -693,16 +695,13 @@
|
|||||||
|
|
||||||
updateMaterialCoil(submitData).then(res => {
|
updateMaterialCoil(submitData).then(res => {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
// uni.showToast({
|
uni.showToast({
|
||||||
// title: '保存成功',
|
title: '保存成功',
|
||||||
// icon: 'success'
|
icon: 'success'
|
||||||
// });
|
});
|
||||||
// setTimeout(() => {
|
setTimeout(() => {
|
||||||
this.handleReset();
|
this.handleReset();
|
||||||
// }, 1500);
|
}, 1500);
|
||||||
uni.navigateTo({
|
|
||||||
url: '/pages/scansuccess/scansuccess'
|
|
||||||
})
|
|
||||||
} else {
|
} else {
|
||||||
uni.showToast({
|
uni.showToast({
|
||||||
title: res.msg || '保存失败',
|
title: res.msg || '保存失败',
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name" : "科伦普",
|
"name" : "科伦普",
|
||||||
"appid" : "__UNI__E781B49",
|
"appid" : "__UNI__E781B49",
|
||||||
"description" : "",
|
"description" : "",
|
||||||
"versionName" : "3.5",
|
"versionName" : "1.3.7",
|
||||||
"versionCode" : 1,
|
"versionCode" : 1,
|
||||||
"transformPx" : false,
|
"transformPx" : false,
|
||||||
"app-plus" : {
|
"app-plus" : {
|
||||||
|
|||||||
@@ -14,17 +14,14 @@ export default {
|
|||||||
if (this.hasJumped) return;
|
if (this.hasJumped) return;
|
||||||
|
|
||||||
// 显示加载状态,提升用户感知
|
// 显示加载状态,提升用户感知
|
||||||
uni.showLoading({
|
// uni.showLoading({
|
||||||
title: '验证身份中...',
|
// title: '验证身份中...',
|
||||||
mask: true // 防止用户重复操作
|
// mask: true // 防止用户重复操作
|
||||||
});
|
// });
|
||||||
|
|
||||||
// 检查用户角色
|
// 检查用户角色
|
||||||
this.$store.dispatch('GetInfo')
|
this.$store.dispatch('GetInfo')
|
||||||
.then(res => {
|
.then(res => {
|
||||||
uni.hideLoading(); // 关闭加载提示
|
|
||||||
|
|
||||||
console.log('获取身份信息内容', res.data, )
|
|
||||||
// 验证返回数据格式
|
// 验证返回数据格式
|
||||||
if (!res || !res.data || !Array.isArray(res.data.roles)) {
|
if (!res || !res.data || !Array.isArray(res.data.roles)) {
|
||||||
throw new Error('用户角色信息格式错误');
|
throw new Error('用户角色信息格式错误');
|
||||||
@@ -97,31 +94,6 @@ export default {
|
|||||||
uni.reLaunch({
|
uni.reLaunch({
|
||||||
url: '/pages/login'
|
url: '/pages/login'
|
||||||
})
|
})
|
||||||
// uni.hideLoading(); // 关闭加载提示
|
|
||||||
// console.error('用户信息获取失败:', err);
|
|
||||||
|
|
||||||
// // 区分错误类型,给出更精准提示
|
|
||||||
// const errorMsg = err.message || '网络异常,请检查网络后重试';
|
|
||||||
// uni.showToast({
|
|
||||||
// title: errorMsg,
|
|
||||||
// icon: 'none',
|
|
||||||
// duration: 3000
|
|
||||||
// });
|
|
||||||
|
|
||||||
// // 提供重试入口
|
|
||||||
// setTimeout(() => {
|
|
||||||
// uni.showModal({
|
|
||||||
// title: '加载失败',
|
|
||||||
// content: '是否重新登录?',
|
|
||||||
// success: (res) => {
|
|
||||||
// if (res.confirm) {
|
|
||||||
// uni.reLaunch({
|
|
||||||
// url: '/pages/login'
|
|
||||||
// })
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// });
|
|
||||||
// }, 3000);
|
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -122,7 +122,7 @@
|
|||||||
loginSuccess(result) {
|
loginSuccess(result) {
|
||||||
// 设置用户信息
|
// 设置用户信息
|
||||||
this.$store.dispatch('GetInfo').then(res => {
|
this.$store.dispatch('GetInfo').then(res => {
|
||||||
this.$tab.reLaunch('/pages/easycode/easycode')
|
this.$tab.reLaunch('/pages/index')
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,7 +83,6 @@ const user = {
|
|||||||
}) {
|
}) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
getInfo().then(res => {
|
getInfo().then(res => {
|
||||||
console.log('个人信息', res)
|
|
||||||
const user = res.data.user
|
const user = res.data.user
|
||||||
let avatar = user.avatar || ""
|
let avatar = user.avatar || ""
|
||||||
if (!isHttp(avatar)) {
|
if (!isHttp(avatar)) {
|
||||||
|
|||||||
@@ -41,13 +41,13 @@ const request = config => {
|
|||||||
const code = res.data.code || 200
|
const code = res.data.code || 200
|
||||||
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
const msg = errorCode[code] || res.data.msg || errorCode['default']
|
||||||
if (code === 401) {
|
if (code === 401) {
|
||||||
// showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
showConfirm('登录状态已过期,您可以继续留在该页面,或者重新登录?').then(res => {
|
||||||
// if (res.confirm) {
|
if (res.confirm) {
|
||||||
// store.dispatch('LogOut').then(res => {
|
store.dispatch('LogOut').then(res => {
|
||||||
// uni.reLaunch({ url: '/pages/login' })
|
uni.reLaunch({ url: '/pages/login' })
|
||||||
// })
|
})
|
||||||
// }
|
}
|
||||||
// })
|
})
|
||||||
reject('无效的会话,或者会话已过期,请重新登录。')
|
reject('无效的会话,或者会话已过期,请重新登录。')
|
||||||
} else if (code === 500) {
|
} else if (code === 500) {
|
||||||
toast(msg)
|
toast(msg)
|
||||||
|
|||||||
Reference in New Issue
Block a user