|
|
@ -1723,6 +1723,8 @@ export default { |
|
|
codeNo: '', |
|
|
codeNo: '', |
|
|
rfqDetailId: null |
|
|
rfqDetailId: null |
|
|
}, |
|
|
}, |
|
|
|
|
|
partNoGenerated: false, // 标记产品编码是否已通过"维护"生成 |
|
|
|
|
|
savedPartData: null, // 保存已生成的产品数据,防止被路由参数覆盖 |
|
|
itemData: { |
|
|
itemData: { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
partNo: '', |
|
|
partNo: '', |
|
|
@ -3254,6 +3256,34 @@ export default { |
|
|
}, |
|
|
}, |
|
|
activated() { |
|
|
activated() { |
|
|
if (this.$route.query.data) { |
|
|
if (this.$route.query.data) { |
|
|
|
|
|
console.log('activated 触发 - partNoGenerated 标记:', this.partNoGenerated) |
|
|
|
|
|
console.log('activated 触发 - 当前 partNo:', this.searchData.partNo) |
|
|
|
|
|
console.log('activated 触发 - 路由参数 partNo:', this.$route.query.data.partNo) |
|
|
|
|
|
console.log('activated 触发 - savedPartData:', this.savedPartData) |
|
|
|
|
|
|
|
|
|
|
|
// 如果产品编码已通过"维护"生成,从保存的副本恢复数据 |
|
|
|
|
|
if (this.partNoGenerated && this.savedPartData) { |
|
|
|
|
|
console.log('产品编码已生成,从 savedPartData 恢复数据:', this.savedPartData.partNo) |
|
|
|
|
|
|
|
|
|
|
|
// 从保存的副本恢复数据 |
|
|
|
|
|
this.searchData.site = this.savedPartData.site |
|
|
|
|
|
this.searchData.buNo = this.savedPartData.buNo |
|
|
|
|
|
this.searchData.partNo = this.savedPartData.partNo |
|
|
|
|
|
this.searchData.partDesc = this.savedPartData.partDesc |
|
|
|
|
|
this.searchData.testPartId = this.savedPartData.testPartId |
|
|
|
|
|
this.searchData.codeNo = this.savedPartData.codeNo || this.$route.query.data.partCodeNo |
|
|
|
|
|
this.searchData.rfqDetailId = this.savedPartData.rfqDetailId || this.$route.query.data.id |
|
|
|
|
|
|
|
|
|
|
|
console.log('恢复后的 searchData.partNo:', this.searchData.partNo) |
|
|
|
|
|
|
|
|
|
|
|
// 刷新相关数据 |
|
|
|
|
|
this.getNodeTree(); |
|
|
|
|
|
this.getPartItem(); |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 产品编码未生成时,正常从路由参数加载数据 |
|
|
|
|
|
console.log('从路由参数加载初始数据') |
|
|
this.searchData = this.$route.query.data |
|
|
this.searchData = this.$route.query.data |
|
|
this.searchData.partDesc = this.$route.query.data.testPartDesc |
|
|
this.searchData.partDesc = this.$route.query.data.testPartDesc |
|
|
this.searchData.codeNo = this.$route.query.data.partCodeNo |
|
|
this.searchData.codeNo = this.$route.query.data.partCodeNo |
|
|
@ -3569,11 +3599,30 @@ export default { |
|
|
|
|
|
|
|
|
// 获取物料的Bom模板详情 |
|
|
// 获取物料的Bom模板详情 |
|
|
async getInfoByBomTemplate (row) { |
|
|
async getInfoByBomTemplate (row) { |
|
|
|
|
|
console.log('getInfoByBomTemplate 接收到的 row:', row) |
|
|
this.searchData.site = row.site |
|
|
this.searchData.site = row.site |
|
|
this.searchData.buNo = row.buNo |
|
|
this.searchData.buNo = row.buNo |
|
|
this.searchData.partNo = row.partNo |
|
|
this.searchData.partNo = row.partNo |
|
|
this.searchData.partDesc = row.partDesc |
|
|
this.searchData.partDesc = row.partDesc |
|
|
this.searchData.testPartId = row.id |
|
|
this.searchData.testPartId = row.id |
|
|
|
|
|
|
|
|
|
|
|
// 标记产品编码已生成(从 * 变成实际编码)并保存数据副本 |
|
|
|
|
|
if (row.partNo && row.partNo !== '*') { |
|
|
|
|
|
this.partNoGenerated = true |
|
|
|
|
|
// 保存完整的产品数据副本,用于页签切换时恢复 |
|
|
|
|
|
this.savedPartData = { |
|
|
|
|
|
site: row.site, |
|
|
|
|
|
buNo: row.buNo, |
|
|
|
|
|
partNo: row.partNo, |
|
|
|
|
|
partDesc: row.partDesc, |
|
|
|
|
|
testPartId: row.id, |
|
|
|
|
|
rfqDetailId: this.searchData.rfqDetailId |
|
|
|
|
|
} |
|
|
|
|
|
console.log('设置 partNoGenerated = true,保存的数据:', this.savedPartData) |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
console.log('更新后的 searchData.partNo:', this.searchData.partNo) |
|
|
|
|
|
|
|
|
await this.getNodeTree() |
|
|
await this.getNodeTree() |
|
|
let tempData = { |
|
|
let tempData = { |
|
|
site: this.$store.state.user.site, |
|
|
site: this.$store.state.user.site, |
|
|
@ -3585,6 +3634,10 @@ export default { |
|
|
if (data && data.code === 0){ |
|
|
if (data && data.code === 0){ |
|
|
this.$set(this, 'partList1', data.rows) |
|
|
this.$set(this, 'partList1', data.rows) |
|
|
this.searchData.codeNo = this.partList1[0].codeNo |
|
|
this.searchData.codeNo = this.partList1[0].codeNo |
|
|
|
|
|
// 同步更新保存的数据 |
|
|
|
|
|
if (this.savedPartData) { |
|
|
|
|
|
this.savedPartData.codeNo = this.partList1[0].codeNo |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
|
this.getPartItem(); |
|
|
this.getPartItem(); |
|
|
@ -5634,7 +5687,7 @@ export default { |
|
|
|
|
|
|
|
|
/** |
|
|
/** |
|
|
* 打开ProcessTimeMatrix选择对话框 |
|
|
* 打开ProcessTimeMatrix选择对话框 |
|
|
* 先查询BU下所有商品组1,再查询PTM数据 |
|
|
|
|
|
|
|
|
* 默认查询且只查询商品组编码为 G1701、G1702、G1703、G1704 的数据 |
|
|
*/ |
|
|
*/ |
|
|
openPtmDialog() { |
|
|
openPtmDialog() { |
|
|
if (!this.attributeFlag1) { |
|
|
if (!this.attributeFlag1) { |
|
|
@ -5650,14 +5703,9 @@ export default { |
|
|
|
|
|
|
|
|
// 获取第一个物料的信息 |
|
|
// 获取第一个物料的信息 |
|
|
const firstPart = this.partList1[0] |
|
|
const firstPart = this.partList1[0] |
|
|
if (!firstPart.productGroupId1) { |
|
|
|
|
|
this.$message.warning('当前物料未设置商品组1,无法查询PTM参数!') |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 保存当前BU编号和默认商品组ID |
|
|
|
|
|
|
|
|
// 保存当前BU编号 |
|
|
this.ptmCurrentBuNo = firstPart.buNo |
|
|
this.ptmCurrentBuNo = firstPart.buNo |
|
|
this.ptmSelectedProductGroupId = firstPart.productGroupId1 |
|
|
|
|
|
|
|
|
|
|
|
// 显示加载提示 |
|
|
// 显示加载提示 |
|
|
const loadingInstance = this.$loading({ |
|
|
const loadingInstance = this.$loading({ |
|
|
@ -5667,9 +5715,7 @@ export default { |
|
|
background: 'rgba(0, 0, 0, 0.3)' |
|
|
background: 'rgba(0, 0, 0, 0.3)' |
|
|
}) |
|
|
}) |
|
|
|
|
|
|
|
|
// 先查询该BU下所有商品组1 |
|
|
|
|
|
let buNo = firstPart.buNo || ''; |
|
|
|
|
|
let result = buNo.includes('-') ? buNo.split('-')[1] : buNo; |
|
|
|
|
|
|
|
|
// 查询该BU下所有商品组1 |
|
|
const productGroupQuery = { |
|
|
const productGroupQuery = { |
|
|
userName: this.$store.state.user.name, |
|
|
userName: this.$store.state.user.name, |
|
|
type:'1', |
|
|
type:'1', |
|
|
@ -5679,14 +5725,23 @@ export default { |
|
|
|
|
|
|
|
|
productGroupInformationSearch(productGroupQuery).then(({data}) => { |
|
|
productGroupInformationSearch(productGroupQuery).then(({data}) => { |
|
|
if (data && data.code === 0) { |
|
|
if (data && data.code === 0) { |
|
|
this.ptmProductGroupList = data.page.list || [] |
|
|
|
|
|
|
|
|
const allProductGroups = data.page.list || [] |
|
|
|
|
|
|
|
|
|
|
|
// 筛选出商品组编码为 G1701、G1702、G1703、G1704 的商品组 |
|
|
|
|
|
const targetProductGroupIds = ['G1701', 'G1702', 'G1703', 'G1704'] |
|
|
|
|
|
this.ptmProductGroupList = allProductGroups.filter(item => |
|
|
|
|
|
targetProductGroupIds.includes(item.productGroupId) |
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
if (this.ptmProductGroupList.length === 0) { |
|
|
if (this.ptmProductGroupList.length === 0) { |
|
|
loadingInstance.close() |
|
|
loadingInstance.close() |
|
|
this.$message.warning('该BU下没有配置商品组1!') |
|
|
|
|
|
|
|
|
this.$message.warning('未找到商品组编码为 G1701、G1702、G1703、G1704 的商品组!') |
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 默认选中第一个筛选出的商品组 |
|
|
|
|
|
this.ptmSelectedProductGroupId = this.ptmProductGroupList[0].productGroupId |
|
|
|
|
|
|
|
|
// 加载默认选中商品组的PTM数据 |
|
|
// 加载默认选中商品组的PTM数据 |
|
|
this.loadPtmDataByProductGroup(this.ptmSelectedProductGroupId, loadingInstance) |
|
|
this.loadPtmDataByProductGroup(this.ptmSelectedProductGroupId, loadingInstance) |
|
|
} else { |
|
|
} else { |
|
|
|