fix: 修复登录跳转路径和版本号更新

refactor: 移除调试日志和冗余代码
style: 格式化代码和修复条件判断逻辑
feat: 重新启用401错误处理并优化表单重置逻辑
This commit is contained in:
砂糖
2025-11-04 14:27:20 +08:00
parent 196f55961a
commit 9fcbad1f8e
7 changed files with 50 additions and 80 deletions

View File

@@ -762,7 +762,7 @@ export default {
itemType: this.itemType || this.scannedCoils[0].itemType, // 优先使用选择的itemType
itemId: this.itemId || this.scannedCoils[0].itemId, // 优先使用选择的itemId
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,
netWeight: this.netWeight ? Number(this.netWeight) : null,
newCoils: this.scannedCoils.map(coil => ({

View File

@@ -76,11 +76,11 @@
<klp-warehouse-picker v-model="form.warehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区"
@change="handleWarehouseChange" />
</view>
<view class="form-item form-item-optional">
<text class="form-label-optional">真实库区</text>
<klp-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0" placeholder="请选择目标库区"
ware-type="actual" />
<klp-warehouse-picker v-model="form.actualWarehouseId" :disabled="coilDetail.dataType === 0"
placeholder="请选择目标库区" ware-type="actual" />
</view>
<!-- 物品类型选择 -->
@@ -612,41 +612,43 @@
closeWarehouseList() {
this.showWarehouseList = false;
},
handleReScan() {
uni.showModal({
title: '确认重新扫码',
content: '是否要清空当前数据并重新扫码?',
success: (res) => {
this.handleReset()
if (res.confirm) {
this.handleReset()
}
}
});
},
// 重新扫码
handleReset() {
if (res.confirm) {
this.form = {
coilId: undefined,
itemType: '',
itemId: undefined,
team: '',
currentCoilNo: '',
warehouseId: undefined,
actualWarehouseId: undefined,
warehouseName: '',
grossWeight: '',
netWeight: ''
};
this.coilDetail = {};
this.materialDetail = null;
this.bomItemList = [];
this.warehouseKeyword = '';
this.currentWarehouseName = '';
this.selectedProductName = '';
this.filteredWarehouses = this.warehouses;
this.qrcodeStatus = 1; // 重置二维码状态
}
this.form = {
coilId: undefined,
itemType: '',
itemId: undefined,
team: '',
currentCoilNo: '',
warehouseId: undefined,
actualWarehouseId: undefined,
warehouseName: '',
grossWeight: '',
netWeight: ''
};
this.coilDetail = {};
this.materialDetail = null;
this.bomItemList = [];
this.warehouseKeyword = '';
this.currentWarehouseName = '';
this.selectedProductName = '';
this.filteredWarehouses = this.warehouses;
this.qrcodeStatus = 1; // 重置二维码状态
},
// 提交
@@ -693,16 +695,13 @@
updateMaterialCoil(submitData).then(res => {
if (res.code === 200) {
// uni.showToast({
// title: '保存成功',
// icon: 'success'
// });
// setTimeout(() => {
this.handleReset();
// }, 1500);
uni.navigateTo({
url: '/pages/scansuccess/scansuccess'
})
uni.showToast({
title: '保存成功',
icon: 'success'
});
setTimeout(() => {
this.handleReset();
}, 1500);
} else {
uni.showToast({
title: res.msg || '保存失败',