Browse Source

2026-05-09

RoHs功能优化
master
fengyuan_yang 1 month ago
parent
commit
32cf5de813
  1. 5
      src/views/modules/common/uploadFileList.vue
  2. 268
      src/views/modules/rohs/rohsRecord.vue

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

268
src/views/modules/rohs/rohsRecord.vue

@ -27,41 +27,51 @@
@current-change="currentChange"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column prop="referenceNo" header-align="center" align="center" label="序列号/Reference No." width="165"></el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="单据状态/Status" width="120"></el-table-column>
<el-table-column prop="applicant" header-align="center" align="center" label="申请人/Applicant" width="120"></el-table-column>
<el-table-column prop="pm" header-align="center" align="center" label="PM人员/PM" width="120"></el-table-column>
<el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期/Application Date" width="165"></el-table-column>
<el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间/Planned Mass Production" width="210"></el-table-column>
<el-table-column prop="process" header-align="center" align="center" label="工艺/Process" width="120"></el-table-column>
<el-table-column prop="color" header-align="center" align="center" label="颜色/Color" width="120"></el-table-column>
<el-table-column prop="vendorCode" header-align="center" align="center" label="供应商代码/Vendor Code" width="160"></el-table-column>
<el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编号/Vendor Material Code" width="200" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类/Material Classify" width="200" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类/Other Material Classify" width="210" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途/Material Use For" width="180" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户/End Customer" width="150"></el-table-column>
<el-table-column prop="projectId" header-align="center" align="center" label="项目编码/Project ID" width="140"></el-table-column>
<el-table-column prop="commGroup1" header-align="center" align="center" label="商品组1/Comm Group 1" width="170"></el-table-column>
<el-table-column prop="commGroup2" header-align="center" align="center" label="商品组2/Comm Group 2" width="170"></el-table-column>
<el-table-column prop="commGroup3" header-align="center" align="center" label="商品组3/Comm Group 3" width="170"></el-table-column>
<el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号/Need Create No." width="200"></el-table-column>
<el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师/NPD Engineer" width="170"></el-table-column>
<el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期/Material Validity Time" width="200"></el-table-column>
<el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可/Need Deviation" width="190"></el-table-column>
<el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划/Technical Plan" width="170"></el-table-column>
<el-table-column prop="buyer" header-align="center" align="center" label="采购/Buyer" width="130"></el-table-column>
<el-table-column prop="expectReportTime" header-align="center" align="center" label="报告时间(月)/Expect Report Time" width="200"></el-table-column>
<el-table-column prop="sgsReportNumber" header-align="center" align="center" label="SGS报告编号/SGS Report Number" width="190" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="expiredDate" header-align="center" align="center" label="报告日期/Expired Date" width="165"></el-table-column>
<el-table-column prop="validUntil" header-align="center" align="center" label="有效期/Valid Until" width="160"></el-table-column>
<el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS/Meet RoHS Req" width="170"></el-table-column>
<el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性/AH Grade" width="140"></el-table-column>
<el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级/Supplier Class" width="220"></el-table-column>
<el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格/Same Material Diff Size" width="220"></el-table-column>
<el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号/IFS Part No." width="150"></el-table-column>
<el-table-column prop="remark" header-align="center" align="center" label="备注/Remark" width="220" :show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作/Operation">
<el-table-column prop="referenceNo" header-align="center" align="center" label="序列号" width="165"></el-table-column>
<el-table-column prop="status" header-align="center" align="center" label="单据状态" width="120"></el-table-column>
<el-table-column prop="applicant" header-align="center" align="center" label="申请人编码" width="130"></el-table-column>
<el-table-column prop="applicantName" header-align="center" align="center" label="申请人名称" width="150"></el-table-column>
<el-table-column prop="pm" header-align="center" align="center" label="PM编码" width="130"></el-table-column>
<el-table-column prop="pmName" header-align="center" align="center" label="PM名称" width="150"></el-table-column>
<el-table-column prop="applicationDate" header-align="center" align="center" label="申请日期" width="165"></el-table-column>
<el-table-column prop="plannedMassProductionDate" header-align="center" align="center" label="计划转量产时间" width="210"></el-table-column>
<el-table-column prop="process" header-align="center" align="center" label="工艺" width="120"></el-table-column>
<el-table-column prop="color" header-align="center" align="center" label="颜色" width="120"></el-table-column>
<el-table-column prop="vendorCode" header-align="center" align="center" label="供应商代码" width="160"></el-table-column>
<el-table-column prop="vendorMaterialCode" header-align="center" align="center" label="供应商材料编号" width="200" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="materialClassify" header-align="center" align="center" label="材料分类" width="200" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="otherMaterialClassify" header-align="center" align="center" label="其他材料分类" width="210" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="materialUseFor" header-align="center" align="center" label="辅材用途" width="180" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="endCustomer" header-align="center" align="center" label="最终客户编码" width="160"></el-table-column>
<el-table-column prop="endCustomerName" header-align="center" align="center" label="最终客户名称" width="180"></el-table-column>
<el-table-column prop="projectId" header-align="center" align="center" label="项目编码" width="140"></el-table-column>
<el-table-column prop="projectName" header-align="center" align="center" label="项目名称" width="180"></el-table-column>
<el-table-column prop="commGroup1" header-align="center" align="center" label="商品组1编码" width="170"></el-table-column>
<el-table-column prop="commGroup1Desc" header-align="center" align="center" label="商品组1名称" width="170"></el-table-column>
<el-table-column prop="commGroup2" header-align="center" align="center" label="商品组2编码" width="170"></el-table-column>
<el-table-column prop="commGroup2Desc" header-align="center" align="center" label="商品组2名称" width="170"></el-table-column>
<el-table-column prop="commGroup3" header-align="center" align="center" label="商品组3编码" width="170"></el-table-column>
<el-table-column prop="commGroup3Desc" header-align="center" align="center" label="商品组3名称" width="170"></el-table-column>
<el-table-column prop="needCreateNumber" header-align="center" align="center" label="需创建内部编号" width="200"></el-table-column>
<el-table-column prop="npdEngineer" header-align="center" align="center" label="NPD工程师编码" width="170"></el-table-column>
<el-table-column prop="npdEngineerName" header-align="center" align="center" label="NPD工程师名称" width="170"></el-table-column>
<el-table-column prop="materialValidityTime" header-align="center" align="center" label="材料有效期" width="200"></el-table-column>
<el-table-column prop="needDeviation" header-align="center" align="center" label="是否需偏差许可" width="190"></el-table-column>
<el-table-column prop="technicalPlan" header-align="center" align="center" label="技术计划编码" width="170"></el-table-column>
<el-table-column prop="technicalPlanName" header-align="center" align="center" label="技术计划名称" width="170"></el-table-column>
<el-table-column prop="buyer" header-align="center" align="center" label="采购编码" width="130"></el-table-column>
<el-table-column prop="buyerName" header-align="center" align="center" label="采购名称" width="130"></el-table-column>
<el-table-column prop="expectReportTime" header-align="center" align="center" label="报告时间(月)" width="200"></el-table-column>
<el-table-column prop="sgsReportNumber" header-align="center" align="center" label="SGS报告编号" width="190" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="expiredDate" header-align="center" align="center" label="报告日期" width="165"></el-table-column>
<el-table-column prop="validUntil" header-align="center" align="center" label="有效期" width="160"></el-table-column>
<el-table-column prop="isMeetRohsRequirement" header-align="center" align="center" label="符合RoHS" width="170"></el-table-column>
<el-table-column prop="isAhGrade" header-align="center" align="center" label="AH属性" width="140"></el-table-column>
<el-table-column prop="hsfSupplierClassification" header-align="center" align="center" label="HSF供应商等级" width="220"></el-table-column>
<el-table-column prop="isSameMaterialDiffSize" header-align="center" align="center" label="同材不同规格" width="220"></el-table-column>
<el-table-column prop="ifsPartNo" header-align="center" align="center" label="IFS编号" width="150"></el-table-column>
<el-table-column prop="remark" header-align="center" align="center" label="备注" width="220" :show-overflow-tooltip="true"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
<template slot-scope="scope">
<el-link v-if="authUpdate && scope.row.status !== '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">编辑</el-link>
<el-link v-if="authUpdate && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
@ -379,6 +389,7 @@
<upload-file-list
v-if="modalFlag"
folder="rohs"
order-ref3="rohsAttachment"
title="RoHs 附件上传"
:label="'序列号'"
:file-list.sync="fileList"
@ -714,7 +725,8 @@
style="margin-top: 2px"
:columns="fileColumnList"
:order-ref1="currentRow.site"
:order-ref2="currentRow.referenceNo">
:order-ref2="currentRow.referenceNo"
order-ref3="rohsAttachment">
</oss-components>
</el-tab-pane>
<el-tab-pane label="审批信息" name="approvalInformation">
@ -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()
}
})

Loading…
Cancel
Save