From 32cf5de81353c41bad4ffaf66195a9b184f07ae7 Mon Sep 17 00:00:00 2001
From: fengyuan_yang <1976974459@qq.com>
Date: Sat, 9 May 2026 13:18:32 +0800
Subject: [PATCH] =?UTF-8?q?2026-05-09=20RoHs=E5=8A=9F=E8=83=BD=E4=BC=98?=
=?UTF-8?q?=E5=8C=96?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/views/modules/common/uploadFileList.vue | 5 +
src/views/modules/rohs/rohsRecord.vue | 268 ++++++--------------
2 files changed, 81 insertions(+), 192 deletions(-)
diff --git a/src/views/modules/common/uploadFileList.vue b/src/views/modules/common/uploadFileList.vue
index ce6d06e..5628cd3 100644
--- a/src/views/modules/common/uploadFileList.vue
+++ b/src/views/modules/common/uploadFileList.vue
@@ -35,6 +35,10 @@ export default {
folder:{
type:String,
default:''
+ },
+ orderRef3: {
+ type: String,
+ default: ''
}
},
data(){
@@ -74,6 +78,7 @@ export default {
}
data.append("orderRef1",this.$store.state.user.site)
data.append("orderRef2",this.no)
+ data.append("orderRef3",this.orderRef3)
data.append("createBy",this.$store.state.user.name)
data.append("fileRemark",this.fileRemark)
data.append("folder", this.folder)
diff --git a/src/views/modules/rohs/rohsRecord.vue b/src/views/modules/rohs/rohsRecord.vue
index 4cdb5a9..bdf5a3a 100644
--- a/src/views/modules/rohs/rohsRecord.vue
+++ b/src/views/modules/rohs/rohsRecord.vue
@@ -27,41 +27,51 @@
@current-change="currentChange"
v-loading="dataListLoading"
style="width: 100%;">
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
编辑
详情
@@ -379,6 +389,7 @@
+ :order-ref2="currentRow.referenceNo"
+ order-ref3="rohsAttachment">
@@ -776,7 +788,6 @@ export default {
height: 400,
secondHeight: 200,
currentRow: {},
- currentRowNameSeq: 0,
fileColumnList: [
{
columnProp: 'fileName',
@@ -1030,14 +1041,14 @@ export default {
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
- this.loadCurrentRowNames()
+ this.fillDisplayFields(this.currentRow, row || {})
this.refreshCurrentTabTable()
}).catch(() => {
this.currentRow = row || {}
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
- this.loadCurrentRowNames()
+ this.fillDisplayFields(this.currentRow)
this.refreshCurrentTabTable()
})
},
@@ -1047,143 +1058,23 @@ export default {
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
- this.loadCurrentRowNames()
+ this.fillDisplayFields(this.currentRow)
this.refreshCurrentTabTable()
} else {
this.approvalList = []
}
},
- loadCurrentRowNames () {
- if (!this.currentRow) {
+ fillDisplayFields (target, fallbackData = {}) {
+ if (!target) {
return
}
- const site = this.currentRow.site || this.$store.state.user.site
- const requestSeq = ++this.currentRowNameSeq
- const setName = (field, value) => {
- if (requestSeq !== this.currentRowNameSeq || !this.currentRow) {
- return
- }
- this.$set(this.currentRow, field, value || '')
- }
- const tasks = []
- if (this.currentRow.applicant) {
- tasks.push(this.queryUserDisplayName(this.currentRow.applicant, site, 103).then(name => setName('applicantName', name)))
- } else {
- setName('applicantName', '')
- }
- if (this.currentRow.pm) {
- tasks.push(this.queryUserDisplayName(this.currentRow.pm, site, 103).then(name => setName('pmName', name)))
- } else {
- setName('pmName', '')
- }
- if (this.currentRow.npdEngineer) {
- tasks.push(this.queryUserDisplayName(this.currentRow.npdEngineer, site, 103).then(name => setName('npdEngineerName', name)))
- } else {
- setName('npdEngineerName', '')
- }
- if (this.currentRow.technicalPlan) {
- tasks.push(this.queryUserDisplayName(this.currentRow.technicalPlan, site, 103).then(name => setName('technicalPlanName', name)))
- } else {
- setName('technicalPlanName', '')
- }
- if (this.currentRow.buyer) {
- tasks.push(this.queryUserDisplayName(this.currentRow.buyer, site, 2000).then(name => setName('buyerName', name)))
- } else {
- setName('buyerName', '')
- }
- if (this.currentRow.endCustomer) {
- tasks.push(this.queryCustomerDisplayName(site, this.currentRow.endCustomer).then(name => setName('endCustomerName', name)))
- } else {
- setName('endCustomerName', '')
- }
- if (this.currentRow.projectId) {
- tasks.push(this.queryProjectDisplayName(site, this.currentRow.endCustomer, this.currentRow.projectId).then(name => setName('projectName', name)))
- } else {
- setName('projectName', '')
- }
- if (this.currentRow.commGroup1) {
- tasks.push(this.queryCommGroupDisplayName(site, this.currentRow.commGroup1, 110).then(name => setName('commGroup1Desc', name)))
- } else {
- setName('commGroup1Desc', '')
- }
- if (this.currentRow.commGroup2) {
- tasks.push(this.queryCommGroupDisplayName(site, this.currentRow.commGroup2, 111).then(name => setName('commGroup2Desc', name)))
- } else {
- setName('commGroup2Desc', '')
- }
- if (this.currentRow.commGroup3) {
- tasks.push(this.queryCommGroupDisplayName(site, this.currentRow.commGroup3, 130).then(name => setName('commGroup3Desc', name)))
- } else {
- setName('commGroup3Desc', '')
- }
- if (tasks.length > 0) {
- Promise.all(tasks).catch(() => {})
- }
- },
- queryUserDisplayName (username, site, tagno) {
- if (!username) {
- return Promise.resolve('')
- }
- let tempData = {
- tagno: tagno,
- conditionSql: " and a.username = '" + username + "'" + " and b.site = '" + site + "'"
- }
- return verifyData(tempData).then(({data}) => {
- if (data && data.code === 0 && data.baseListData && data.baseListData.length > 0) {
- return data.baseListData[0].user_display || ''
- }
- return ''
- }).catch(() => {
- return ''
- })
- },
- queryCustomerDisplayName (site, customerNo) {
- if (!customerNo) {
- return Promise.resolve('')
- }
- return queryCustomer({ site, customerNo }).then(({data}) => {
- if (data && data.code === 0 && data.rows && data.rows.length > 0) {
- const customer = data.rows[0]
- return customer.customerDesc || customer.Customer_desc || customer.customerName || ''
- }
- return ''
- }).catch(() => {
- return ''
- })
- },
- queryProjectDisplayName (site, customerId, projectId) {
- if (!projectId) {
- return Promise.resolve('')
- }
- let params = { site, projectId }
- if (customerId) {
- params.customerId = customerId
- }
- return queryProjectByCustomer(params).then(({data}) => {
- if (data && data.code === 0 && data.rows && data.rows.length > 0) {
- return data.rows[0].projectName || data.rows[0].Project_name || ''
- }
- return ''
- }).catch(() => {
- return ''
- })
- },
- queryCommGroupDisplayName (site, commGroup, tagno) {
- if (!commGroup) {
- return Promise.resolve('')
- }
- let tempData = {
- tagno: tagno,
- conditionSql: " and product_group_id = '" + commGroup + "'" + " and site = '" + site + "'"
- }
- return verifyData(tempData).then(({data}) => {
- if (data && data.code === 0 && data.baseListData && data.baseListData.length > 0) {
- return data.baseListData[0].product_group_name || ''
- }
- return ''
- }).catch(() => {
- return ''
+ const fields = ['applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc']
+ fields.forEach(field => {
+ const value = target[field] || fallbackData[field] || ''
+ this.$set(target, field, value)
})
+ this.$set(target, 'endCustomerFlag', !!target.endCustomerFlag)
+ this.$set(target, 'projectIdFlag', !!target.projectIdFlag)
},
refreshCurrentTabTable () {
if (this.activeTable === 'approvalInformation') {
@@ -1230,7 +1121,22 @@ export default {
}
api.getRohsList(params).then(({data}) => {
if (data && data.code === 0) {
- this.dataList = data.page.list
+ const list = data.page.list || []
+ this.dataList = list.map(item => {
+ return {
+ applicantName: '',
+ pmName: '',
+ npdEngineerName: '',
+ technicalPlanName: '',
+ buyerName: '',
+ endCustomerName: '',
+ projectName: '',
+ commGroup1Desc: '',
+ commGroup2Desc: '',
+ commGroup3Desc: '',
+ ...item
+ }
+ })
this.totalPage = data.page.totalCount
this.$nextTick(() => {
if (this.$refs.rohsTable && this.dataList.length > 0) {
@@ -1324,17 +1230,7 @@ export default {
this.$set(this.modalData, 'testReportIncludingItemsList', this.modalData.testReportIncludingItems ? this.modalData.testReportIncludingItems.split(';').filter(item => item) : [])
this.$set(this.modalData, 'materialClassifyList', this.modalData.materialClassify ? this.modalData.materialClassify.split(';').filter(item => item) : [])
this.$set(this.modalData, 'materialList', Array.isArray(this.modalData.materialList) ? this.modalData.materialList : [])
- // Initialize names for display if needed
- this.$set(this.modalData, 'applicantName', '')
- this.$set(this.modalData, 'pmName', '')
- this.$set(this.modalData, 'buyerName', '')
- this.$set(this.modalData, 'npdEngineerName', '')
- this.$set(this.modalData, 'technicalPlanName', '')
- this.$set(this.modalData, 'endCustomerName', '')
- this.$set(this.modalData, 'projectName', '')
- this.$set(this.modalData, 'commGroup1Desc', '')
- this.$set(this.modalData, 'commGroup2Desc', '')
- this.$set(this.modalData, 'commGroup3Desc', '')
+ this.fillDisplayFields(this.modalData, row || {})
// 编辑时不允许修改最终客户和项目编码
this.$set(this.modalData, 'endCustomerFlag', true)
this.$set(this.modalData, 'projectIdFlag', true)
@@ -1342,18 +1238,6 @@ export default {
this.$set(this.modalData, 'isReject', 'Y')
this.$set(this.modalData, 'tpProcessControl', 'N')
this.$set(this.modalData, 'csProcessControl', 'N')
-
- // Try to trigger verify data on open to fetch names
- this.applicantBlur(103)
- this.pmBlur(103)
- this.buyerBlur(2000)
- this.npdEngineerBlur(103)
- this.technicalPlanBlur(103)
- this.commGroup1Blur(110)
- this.commGroup2Blur(111)
- this.commGroup3Blur(130)
- this.handleQueryCustomer()
- this.handleQueryProjectByCustomer()
this.loadModalButtonCondition()
}
})