Browse Source

2026-06-04

RoHs优化
master
fengyuan_yang 2 weeks ago
parent
commit
eb368f0785
  1. 158
      src/views/modules/rohs/rohsRecord.vue

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

@ -420,6 +420,7 @@
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 50px">
<el-form-item label="TDS属性/TDS Property" style="display: block;">
<oss-components
ref="modalTdsOss"
:save-visible="authFileSave"
:download-visible="authFileDownLoad"
:remove-visible="authFileRemove"
@ -478,13 +479,29 @@
<el-button type="primary" icon="el-icon-upload" @click="uploadDialog = true">上传附件</el-button>
</el-form-item>
</el-form>
<oss-components
ref="modalAttachmentOss"
:save-visible="false"
:download-visible="false"
:remove-visible="false"
:preview-visible="false"
:row-click-select="true"
:disabled="true"
label="序列号"
:height="560"
style="margin-top: 2px"
:columns="fileColumnList"
:order-ref1="modalData.site || ''"
:order-ref2="modalData.referenceNo || ''"
order-ref3="rohsAttachment">
</oss-components>
</div>
</el-tab-pane>
</el-tabs>
<el-footer style="height:35px;margin-top: 15px;text-align:center">
<el-button type="primary" v-if="canSaveAction()" @click="dataFormSubmit()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
<el-button type="primary" @click="handleModalClose">关闭</el-button>
<el-button type="primary" v-if="canAgreeAction()" :loading="submitLoading" @click="agreeSubmit">同意</el-button>
<el-button type="primary" v-if="canRejectAction()" :loading="submitLoading" @click="openRejectModal">驳回</el-button>
</el-footer>
@ -844,6 +861,7 @@
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 50px">
<el-form-item label="TDS属性/TDS Property" style="display: block;">
<oss-components
ref="bottomTdsOss"
:save-visible="authFileSave"
:download-visible="authFileDownLoad"
:remove-visible="authFileRemove"
@ -880,6 +898,7 @@
<el-tab-pane label="附件信息" name="attachment">
<oss-components
ref="bottomAttachmentOss"
:save-visible="authFileSave"
:download-visible="authFileDownLoad"
:remove-visible="authFileRemove"
@ -1224,6 +1243,28 @@ export default {
this.secondHeight = window.innerHeight / 2 - 186
})
},
watch: {
activeName (val) {
if (val === 'attachmentInfo' || val === 'npdInfo') {
this.$nextTick(() => {
if (val === 'attachmentInfo') {
this.refreshOssRef('modalAttachmentOss')
}
if (val === 'npdInfo') {
this.refreshOssRef('modalTdsOss')
}
})
}
},
uploadDialog (val, oldVal) {
if (oldVal && !val) {
this.$nextTick(() => {
this.refreshAttachmentPanels()
this.refreshCurrentRowFromServer(this.modalData.site, this.modalData.referenceNo)
})
}
}
},
methods: {
fetchNodeOptions () {
if (!this.searchData.site || !this.menuId) {
@ -1797,39 +1838,94 @@ export default {
})
},
changeClickRow (row, column, event) {
//
api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
if (data && data.code === 0) {
this.currentRow = data.data || {}
} else {
this.currentRow = row || {}
}
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
this.fillDisplayFields(this.currentRow, row || {})
this.refreshCurrentTabTable()
}).catch(() => {
this.currentRow = row || {}
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
this.fillDisplayFields(this.currentRow)
this.refreshCurrentTabTable()
})
this.loadCurrentRowFromServer(row, row || {})
},
currentChange (val) {
this.currentRow = val || {}
if (val) {
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
this.fillDisplayFields(this.currentRow)
this.refreshCurrentTabTable()
this.loadCurrentRowFromServer(val, val || {})
} else {
this.currentRow = {}
this.approvalList = []
}
},
applyCurrentRowData (detailData, fallbackData = {}) {
this.currentRow = detailData || {}
if (!Array.isArray(this.currentRow.materialList)) {
this.$set(this.currentRow, 'materialList', [])
}
this.fillDisplayFields(this.currentRow, fallbackData || {})
this.syncDataListRow(this.currentRow)
this.refreshCurrentTabTable()
},
syncDataListRow (rowData) {
if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) {
return
}
const targetIndex = this.dataList.findIndex(item => item.site === rowData.site && item.referenceNo === rowData.referenceNo)
if (targetIndex < 0) {
return
}
const mergedRow = {
...this.dataList[targetIndex],
...rowData
}
this.fillDisplayFields(mergedRow, this.dataList[targetIndex] || {})
this.$set(this.dataList, targetIndex, mergedRow)
},
loadCurrentRowFromServer (row, fallbackData = {}) {
if (!row || !row.site || !row.referenceNo) {
this.applyCurrentRowData(row || {}, fallbackData || {})
return Promise.resolve()
}
return api.getRohsDetail(row.site, row.referenceNo).then(({data}) => {
if (data && data.code === 0 && data.data) {
this.applyCurrentRowData(data.data, fallbackData || row)
} else {
this.applyCurrentRowData(row || {}, fallbackData || {})
}
}).catch(() => {
this.applyCurrentRowData(row || {}, fallbackData || {})
})
},
refreshCurrentRowFromServer (site, referenceNo) {
const querySite = site || (this.currentRow && this.currentRow.site)
const queryReferenceNo = referenceNo || (this.currentRow && this.currentRow.referenceNo)
if (!querySite || !queryReferenceNo || String(queryReferenceNo).startsWith('TEMP-')) {
return Promise.resolve()
}
return this.loadCurrentRowFromServer({
site: querySite,
referenceNo: queryReferenceNo
}, this.currentRow || {})
},
refreshOssRef (refName) {
const ref = this.$refs[refName]
if (!ref) {
return
}
const refList = Array.isArray(ref) ? ref : [ref]
refList.forEach(item => {
if (item && typeof item.handleQuery === 'function') {
item.handleQuery()
}
})
},
refreshAttachmentPanels () {
this.refreshOssRef('modalAttachmentOss')
this.refreshOssRef('modalTdsOss')
this.refreshOssRef('bottomAttachmentOss')
this.refreshOssRef('bottomTdsOss')
},
handleModalClose () {
const site = this.modalData.site
const referenceNo = this.modalData.referenceNo
this.modalFlag = false
this.uploadDialog = false
this.$nextTick(() => {
this.refreshAttachmentPanels()
})
this.refreshCurrentRowFromServer(site, referenceNo)
},
fillDisplayFields (target, fallbackData = {}) {
if (!target) {
return
@ -1853,6 +1949,14 @@ export default {
refreshCurrentTabTable () {
if (this.activeTable === 'approvalInformation') {
this.getApprovalList()
return
}
if (this.activeTable === 'attachment') {
this.refreshOssRef('bottomAttachmentOss')
return
}
if (this.activeTable === 'npdInfo') {
this.refreshOssRef('bottomTdsOss')
}
},
getApprovalList () {

Loading…
Cancel
Save