前端修改

This commit is contained in:
2025-11-11 14:52:41 +08:00
parent 613f509466
commit b0a9fae314
4 changed files with 15 additions and 112 deletions

View File

@@ -333,8 +333,6 @@ export default {
// 不再需要watch直接用@change事件处理
},
async created() {
console.log('🚀 typing.vue created 钩子执行');
// 先加载库区列表
await this.loadWarehouses();
@@ -386,8 +384,6 @@ export default {
remark: data.remark || ''
};
console.log('当前信息加载完成:', this.currentInfo);
// 重新获取库区名称确保warehouseList已加载
if (data.warehouseId) {
this.currentInfo.nextWarehouseName = this.getWarehouseName(data.warehouseId);
@@ -403,7 +399,6 @@ export default {
}
} catch (error) {
this.$message.error('加载钢卷信息失败');
console.error(error);
} finally {
this.loading = false;
}
@@ -482,7 +477,6 @@ export default {
const response = await listWarehouse({ pageNum: 1, pageSize: 1000 });
if (response.code === 200) {
this.warehouseList = response.rows || response.data || [];
console.log('库区列表加载成功,数量:', this.warehouseList.length);
}
} catch (error) {
console.error('加载库区列表失败', error);
@@ -491,7 +485,6 @@ export default {
// 页面加载时一次性加载所有原料和产品列表
async loadAllItems() {
console.log('🔥 开始加载所有物品列表');
try {
// 同时加载原料和产品
const [rawMaterialRes, productRes] = await Promise.all([
@@ -501,27 +494,22 @@ export default {
if (rawMaterialRes.code === 200) {
this.rawMaterialList = rawMaterialRes.rows || [];
console.log('✅ 原材料列表加载成功,数量:', this.rawMaterialList.length);
}
if (productRes.code === 200) {
this.productList = productRes.rows || [];
console.log('✅ 产品列表加载成功,数量:', this.productList.length);
}
} catch (error) {
console.error('加载物品列表失败', error);
console.error('加载物品列表失败', error);
}
},
// 加载物品列表(根据类型)
async loadItemList(itemType) {
if (!itemType) {
console.log('loadItemList: itemType 为空');
return;
}
console.log('开始加载物品列表,类型:', itemType);
try {
this.itemSearchLoading = true;
if (itemType === 'raw_material') {
@@ -531,10 +519,8 @@ export default {
pageSize: 100,
withBom: true // 请求包含BOM信息
});
console.log('原材料列表响应:', response);
if (response.code === 200) {
this.rawMaterialList = response.rows || [];
console.log('原材料列表加载成功,数量:', this.rawMaterialList.length);
}
} else if (itemType === 'product') {
// 使用带BOM的接口
@@ -543,10 +529,8 @@ export default {
pageSize: 100,
withBom: true // 请求包含BOM信息
});
console.log('产品列表响应:', response);
if (response.code === 200) {
this.productList = response.rows || [];
console.log('产品列表加载成功,数量:', this.productList.length);
}
}
} catch (error) {
@@ -601,7 +585,7 @@ export default {
// 物品选择变化
handleItemChange(itemId) {
console.log('选择的物品ID:', itemId);
// 物品选择变化处理
},
// 加载变更历史
@@ -642,8 +626,6 @@ export default {
remark: this.currentInfo.remark
};
console.log('复制的表单数据:', this.updateForm);
// materialType 会触发 watch自动设置 itemType 并加载物品列表
this.$message.success('已复制当前信息');
},
@@ -681,10 +663,6 @@ export default {
remark: this.updateForm.remark
// 注意不要传newCoils否则会走批量更新逻辑
};
console.log('=== 正常更新操作 ===');
console.log('提交的更新数据:', updateData);
console.log('是否有newCoils:', updateData.newCoils);
const response = await updateMaterialCoil(updateData);