Browse Source

RFQ 优化

java8
han\hanst 2 months ago
parent
commit
44f99c5448
  1. 45
      src/views/modules/common/Chooselist_eam.vue
  2. 17
      src/views/modules/inquiry/inquiryTechnicalMaterialsNoBuilt.vue
  3. 79
      src/views/modules/part/quicklyCreateBom.vue

45
src/views/modules/common/Chooselist_eam.vue

@ -240,6 +240,51 @@ export default {
getChooselistDataEam({"sqlcode": sql}).then(({data}) => {
if (data.code == 0) {
this.dataList = data.baseListData;
// tagNo === 510
if (this.tagNo === 510 && Array.isArray(this.dataList) && this.dataList.length > 0) {
try {
//
const originalData = [...this.dataList];
const priorityList = [];
const otherList = [];
originalData.forEach(item => {
if (!item) return; //
//
const umid = String(item.UMID || item.umid || item.UmId || '');
const umName = String(item.UMName || item.umname || item.UMname || item.umName || '');
// (1002"")
const isQianZhang = umid === '1002' || umName.includes('千张');
// ("""")
const isMi = umName === '米' || (umName.includes('米') && umName.length <= 2 && !umName.includes('千'));
if (isMi || isQianZhang) {
priorityList.push({ item, isMi, isQianZhang });
} else {
otherList.push(item);
}
});
//
priorityList.sort((a, b) => {
if (a.isMi && !b.isMi) return -1; //
if (!a.isMi && b.isMi) return 1; //
return 0;
});
//
if (priorityList.length > 0) {
this.dataList = [...priorityList.map(p => p.item), ...otherList];
}
} catch (error) {
//
console.warn('计量单位排序失败,使用原始顺序:', error);
}
}
} else {
this.$message.error(data.msg)
}

17
src/views/modules/inquiry/inquiryTechnicalMaterialsNoBuilt.vue

@ -375,7 +375,7 @@
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top: -10px;padding-bottom:5px;text-align:center">
<el-button type="primary" @click="saveInquiryPartData()">保存</el-button>
<el-button type="primary" :loading="saveInquiryLoading" @click="saveInquiryPartData()">保存</el-button>
<el-button type="primary" @click="inquiryPartModalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -567,6 +567,7 @@ export default {
userBuList: [],
copyPriceCheckDetail:{},
loading:false,
saveInquiryLoading: false, // loading
attributeDialog:true,
noFlag:'Y',
priceCheckRule: {
@ -2302,6 +2303,7 @@ export default {
this.$alert('该计量单位不存在,请重新输入计量单位编码!', '错误', {
confirmButtonText: '确定'
})
return
}
if (this.inquiryPartModalData.codeNo === '' || this.inquiryPartModalData.codeNo == null) {
this.$message.warning('请选择属性模版!')
@ -2311,9 +2313,15 @@ export default {
this.$alert('该属性模版不存在,请重新输入属性模版编码!', '错误', {
confirmButtonText: '确定'
})
return
}
// loading
this.saveInquiryLoading = true
if (this.inquiryPartModalData.title === '询价产品新增') {
addInquiryDetailInfo(this.inquiryPartModalData).then(({data}) => {
this.saveInquiryLoading = false
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.inquiryPartModalFlag = false
@ -2331,9 +2339,13 @@ export default {
confirmButtonText: '确定'
})
}
}).catch(error => {
this.saveInquiryLoading = false
this.$message.error('保存异常')
})
} else {
updateInquiryDetailInfo(this.inquiryPartModalData).then(({data}) => {
this.saveInquiryLoading = false
if (data && data.code === 0) {
this.refreshCurrentTabTable()
this.inquiryPartModalFlag = false
@ -2351,6 +2363,9 @@ export default {
confirmButtonText: '确定'
})
}
}).catch(error => {
this.saveInquiryLoading = false
this.$message.error('保存异常')
})
}
},

79
src/views/modules/part/quicklyCreateBom.vue

@ -1723,6 +1723,8 @@ export default {
codeNo: '',
rfqDetailId: null
},
partNoGenerated: false, // ""
savedPartData: null, //
itemData: {
site: this.$store.state.user.site,
partNo: '',
@ -3254,6 +3256,34 @@ export default {
},
activated() {
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.partDesc = this.$route.query.data.testPartDesc
this.searchData.codeNo = this.$route.query.data.partCodeNo
@ -3569,11 +3599,30 @@ export default {
// Bom
async getInfoByBomTemplate (row) {
console.log('getInfoByBomTemplate 接收到的 row:', row)
this.searchData.site = row.site
this.searchData.buNo = row.buNo
this.searchData.partNo = row.partNo
this.searchData.partDesc = row.partDesc
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()
let tempData = {
site: this.$store.state.user.site,
@ -3585,6 +3634,10 @@ export default {
if (data && data.code === 0){
this.$set(this, 'partList1', data.rows)
this.searchData.codeNo = this.partList1[0].codeNo
//
if (this.savedPartData) {
this.savedPartData.codeNo = this.partList1[0].codeNo
}
}
})
this.getPartItem();
@ -5634,7 +5687,7 @@ export default {
/**
* 打开ProcessTimeMatrix选择对话框
* 先查询BU下所有商品组1再查询PTM数据
* 默认查询且只查询商品组编码为 G1701G1702G1703G1704 数据
*/
openPtmDialog() {
if (!this.attributeFlag1) {
@ -5650,14 +5703,9 @@ export default {
//
const firstPart = this.partList1[0]
if (!firstPart.productGroupId1) {
this.$message.warning('当前物料未设置商品组1,无法查询PTM参数!')
return
}
// BUID
// BU
this.ptmCurrentBuNo = firstPart.buNo
this.ptmSelectedProductGroupId = firstPart.productGroupId1
//
const loadingInstance = this.$loading({
@ -5667,9 +5715,7 @@ export default {
background: 'rgba(0, 0, 0, 0.3)'
})
// BU1
let buNo = firstPart.buNo || '';
let result = buNo.includes('-') ? buNo.split('-')[1] : buNo;
// BU1
const productGroupQuery = {
userName: this.$store.state.user.name,
type:'1',
@ -5679,14 +5725,23 @@ export default {
productGroupInformationSearch(productGroupQuery).then(({data}) => {
if (data && data.code === 0) {
this.ptmProductGroupList = data.page.list || []
const allProductGroups = data.page.list || []
// G1701G1702G1703G1704
const targetProductGroupIds = ['G1701', 'G1702', 'G1703', 'G1704']
this.ptmProductGroupList = allProductGroups.filter(item =>
targetProductGroupIds.includes(item.productGroupId)
)
if (this.ptmProductGroupList.length === 0) {
loadingInstance.close()
this.$message.warning('该BU下没有配置商品组1!')
this.$message.warning('未找到商品组编码为 G1701、G1702、G1703、G1704 的商品组!')
return
}
//
this.ptmSelectedProductGroupId = this.ptmProductGroupList[0].productGroupId
// PTM
this.loadPtmDataByProductGroup(this.ptmSelectedProductGroupId, loadingInstance)
} else {

Loading…
Cancel
Save