前端修改

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

@@ -72,7 +72,9 @@
<el-table-column label="操作类型" align="center" prop="actionType" width="160" >
<template slot-scope="scope">
<dict-tag :options='dict.type.action_type' :value="scope.row.actionType "></dict-tag>
<span v-if="scope.row.actionType===5">移库操作已在移动端完成</span>
<span v-else-if="scope.row.actionType===4">发货操作已在移动端完成</span>
<dict-tag v-else :options='dict.type.action_type' :value="scope.row.actionType "></dict-tag>
</template>
</el-table-column>

View File

@@ -339,8 +339,6 @@ export default {
// 不再需要watch直接用@change事件处理
},
async created() {
console.log('🚀 merge.vue created 钩子执行');
// 加载库区列表
await this.loadWarehouses();
@@ -402,25 +400,15 @@ export default {
methods: {
// 处理材料类型变化
handleMaterialTypeChange(value) {
console.log('🔥 merge.vue materialType变化:', value);
// 清空物品选择
this.$set(this.targetCoil, 'itemId', null);
// 根据材料类型设置物品类型
if (value === '成品') {
this.$set(this.targetCoil, 'itemType', 'product');
console.log('✅ 设置 itemType = product');
} else if (value === '原料' || value === '废品') {
this.$set(this.targetCoil, 'itemType', 'raw_material');
console.log('✅ 设置 itemType = raw_material');
}
console.log('📊 targetCoil更新后:', {
materialType: this.targetCoil.materialType,
itemType: this.targetCoil.itemType,
itemId: this.targetCoil.itemId
});
},
// 加载第一个钢卷(从待操作进入时)
@@ -484,43 +472,33 @@ export default {
async loadPendingMergeList() {
try {
this.pendingLoading = true;
console.log('=== 开始加载待合卷列表 ===');
// 分别查询待处理和处理中的记录
const responses = await Promise.all([
listPendingAction({
actionType: 1, // 1=合卷
actionStatus: 0, // 0=待处理
actionType: 1, // 合卷操作
actionStatus: 0, // 待处理
pageNum: 1,
pageSize: 50
pageSize: 1000
}),
listPendingAction({
actionType: 1, // 1=合卷
actionStatus: 1, // 1=处理中
actionType: 1, // 合卷操作
actionStatus: 1, // 处理中
pageNum: 1,
pageSize: 50
pageSize: 1000
})
]);
console.log('待处理响应:', responses[0]);
console.log('处理中响应:', responses[1]);
// 合并两个列表
const allPending = [
...(responses[0].rows || []),
...(responses[1].rows || [])
];
console.log('所有待合卷记录数量:', allPending.length);
console.log('所有待合卷记录:', allPending);
// 排除当前钢卷
const currentCoilId = this.sourceCoils[0] ? this.sourceCoils[0].coilId : null;
console.log('当前钢卷ID:', currentCoilId);
this.pendingMergeList = allPending.filter(item => item.coilId !== currentCoilId);
console.log('过滤后的待合卷列表数量:', this.pendingMergeList.length);
console.log('过滤后的待合卷列表:', this.pendingMergeList);
} catch (error) {
console.error('加载待合卷列表失败', error);
} finally {
@@ -620,7 +598,6 @@ export default {
// 页面加载时一次性加载所有原料和产品列表
async loadAllItems() {
console.log('🔥 merge.vue 开始加载所有物品列表');
try {
// 同时加载原料和产品
const [rawMaterialRes, productRes] = await Promise.all([
@@ -630,27 +607,22 @@ export default {
if (rawMaterialRes.code === 200) {
this.rawMaterialList = rawMaterialRes.rows || [];
console.log('✅ merge.vue 原材料列表加载成功,数量:', this.rawMaterialList.length);
}
if (productRes.code === 200) {
this.productList = productRes.rows || [];
console.log('✅ merge.vue 产品列表加载成功,数量:', this.productList.length);
}
} catch (error) {
console.error('❌ merge.vue 加载物品列表失败', error);
console.error('加载物品列表失败', error);
}
},
// 加载物品列表(根据类型)
async loadItemList(itemType) {
if (!itemType) {
console.log('merge.vue loadItemList: itemType 为空');
return;
}
console.log('merge.vue 开始加载物品列表,类型:', itemType);
try {
this.itemSearchLoading = true;
if (itemType === 'raw_material') {
@@ -659,10 +631,8 @@ export default {
pageSize: 100,
withBom: true
});
console.log('merge.vue 原材料列表响应:', response);
if (response.code === 200) {
this.rawMaterialList = response.rows || [];
console.log('merge.vue 原材料列表加载成功,数量:', this.rawMaterialList.length);
}
} else if (itemType === 'product') {
const response = await listProduct({
@@ -670,10 +640,8 @@ export default {
pageSize: 100,
withBom: true
});
console.log('merge.vue 产品列表响应:', response);
if (response.code === 200) {
this.productList = response.rows || [];
console.log('merge.vue 产品列表加载成功,数量:', this.productList.length);
}
}
} catch (error) {
@@ -844,7 +812,6 @@ export default {
}))
};
console.log('提交的合卷数据:', mergeData);
loadingInstance = this.$loading({
lock: true,
text: '正在合卷,请稍后...',
@@ -895,12 +862,8 @@ export default {
});
// 批量完成所有待操作
console.log('需要完成的待操作ID列表:', actionIds);
const promises = actionIds.map(id => completeAction(id));
await Promise.all(promises);
console.log('所有待操作已完成');
} catch (error) {
console.error('完成待操作失败:', error);
// 不影响主流程,只记录错误

View File

@@ -286,8 +286,6 @@ export default {
computed: {
},
async created() {
console.log('🚀 split.vue created 钩子执行');
// 先加载库区列表
await this.loadWarehouses();
@@ -316,25 +314,15 @@ export default {
methods: {
// 处理材料类型变化
handleMaterialTypeChange(item, index) {
console.log(`🔥 子卷${index+1} materialType变化:`, item.materialType);
// 清空物品选择
this.$set(item, 'itemId', null);
// 根据材料类型设置物品类型
if (item.materialType === '成品') {
this.$set(item, 'itemType', 'product');
console.log(`✅ 子卷${index+1} 设置 itemType = product`);
} else if (item.materialType === '原料' || item.materialType === '废品') {
this.$set(item, 'itemType', 'raw_material');
console.log(`✅ 子卷${index+1} 设置 itemType = raw_material`);
}
console.log(`📊 子卷${index+1} 更新后:`, {
materialType: item.materialType,
itemType: item.itemType,
itemId: item.itemId
});
},
// 动态获取标签
@@ -359,26 +347,17 @@ export default {
},
// 获取子卷的物品列表
getItemListForSplit(itemType) {
console.log(`📋 getItemListForSplit 被调用itemType:`, itemType);
console.log(`📋 rawMaterialList 长度:`, this.rawMaterialList?.length);
console.log(`📋 productList 长度:`, this.productList?.length);
if (itemType === 'raw_material') {
const list = this.rawMaterialList.map(item => ({
return this.rawMaterialList.map(item => ({
id: item.rawMaterialId,
name: this.formatItemName(item)
}));
console.log(`📋 返回原材料列表,数量:`, list.length);
return list;
} else if (itemType === 'product') {
const list = this.productList.map(item => ({
return this.productList.map(item => ({
id: item.productId,
name: this.formatItemName(item)
}));
console.log(`📋 返回产品列表,数量:`, list.length);
return list;
}
console.log(`📋 返回空列表`);
return [];
},
@@ -426,15 +405,9 @@ export default {
// 搜索子卷物品
async searchItemsForSplit(query, index) {
const item = this.splitList[index];
console.log(`🔍 searchItemsForSplit 调用,子卷${index}:`, {
materialType: item.materialType,
itemType: item.itemType,
query: query
});
const itemType = item.itemType;
if (!itemType) {
console.log(`❌ 子卷${index} itemType 为空!`);
this.$message.warning('请先选择材料类型');
return;
}
@@ -476,7 +449,6 @@ export default {
// 页面加载时一次性加载所有原料和产品列表
async loadAllItems() {
console.log('🔥 split.vue 开始加载所有物品列表');
try {
// 同时加载原料和产品
const [rawMaterialRes, productRes] = await Promise.all([
@@ -486,27 +458,22 @@ export default {
if (rawMaterialRes.code === 200) {
this.rawMaterialList = rawMaterialRes.rows || [];
console.log('✅ split.vue 原材料列表加载成功,数量:', this.rawMaterialList.length);
}
if (productRes.code === 200) {
this.productList = productRes.rows || [];
console.log('✅ split.vue 产品列表加载成功,数量:', this.productList.length);
}
} catch (error) {
console.error('❌ split.vue 加载物品列表失败', error);
console.error('加载物品列表失败', error);
}
},
// 加载子卷物品列表
async loadItemListForSplit(itemType) {
if (!itemType) {
console.log('loadItemListForSplit: itemType 为空');
return;
}
console.log('split.vue 开始加载物品列表,类型:', itemType);
try {
this.itemSearchLoading = true;
if (itemType === 'raw_material') {
@@ -515,10 +482,8 @@ export default {
pageSize: 100,
withBom: true
});
console.log('split.vue 原材料列表响应:', response);
if (response.code === 200) {
this.rawMaterialList = response.rows || [];
console.log('split.vue 原材料列表加载成功,数量:', this.rawMaterialList.length);
}
} else if (itemType === 'product') {
const response = await listProduct({
@@ -526,10 +491,8 @@ export default {
pageSize: 100,
withBom: true
});
console.log('split.vue 产品列表响应:', response);
if (response.code === 200) {
this.productList = response.rows || [];
console.log('split.vue 产品列表加载成功,数量:', this.productList.length);
}
}
} catch (error) {
@@ -601,7 +564,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);
@@ -709,8 +671,6 @@ export default {
}))
};
console.log('提交的分条数据:', splitData);
const response = await splitMaterialCoil(splitData);
if (response.code === 200) {
this.$message.success('分条保存成功');

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);