Browse Source

2026-11-23

RoHS主信息增加PLM料号
master
fengyuan_yang 5 days ago
parent
commit
8db4b85b5f
  1. 2
      src/api/rohs/rohs.js
  2. 257
      src/views/modules/rohs/rohsRecord.vue

2
src/api/rohs/rohs.js

@ -12,6 +12,8 @@ export const getRohsDetail = (site, referenceNo, menuId) => createAPI(`/rohs/inf
// 查询物料(用于RoHs材料明细选择) // 查询物料(用于RoHs材料明细选择)
export const getRohsProjectMaterialList = params => createAPI(`/rohs/projectMaterialList`, 'get', params); export const getRohsProjectMaterialList = params => createAPI(`/rohs/projectMaterialList`, 'get', params);
export const getRohsPlmPartList = params => createAPI(`/rohs/plmPartList`, 'get', params);
// 新增 // 新增
export const saveRohs = data => createAPI(`/rohs/save`, 'post', data); export const saveRohs = data => createAPI(`/rohs/save`, 'post', data);

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

@ -82,10 +82,13 @@
<!-- 列表 --> <!-- 列表 -->
<el-table <el-table
ref="rohsTable" ref="rohsTable"
class="rohs-main-table"
:height="height" :height="height"
:data="dataList" :data="dataList"
border border
:row-style="rowStyle" :row-style="rowStyle"
:row-class-name="rowClassName"
:cell-style="opCellStyle"
@row-click="changeClickRow" @row-click="changeClickRow"
@current-change="currentChange" @current-change="currentChange"
@selection-change="dataListSelectionChange" @selection-change="dataListSelectionChange"
@ -124,7 +127,7 @@
</template> </template>
</el-table-column> </el-table-column>
<el-table-column prop="rohsStatus" header-align="center" align="center" label="RoHS状态" width="110"></el-table-column> <el-table-column prop="rohsStatus" header-align="center" align="center" label="RoHS状态" width="110"></el-table-column>
<el-table-column fixed="right" header-align="center" align="center" width="130" label="操作">
<el-table-column class-name="rohs-op-col" fixed="right" header-align="center" align="center" width="130" label="操作">
<template slot-scope="scope"> <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>
<el-link v-if="authSearch && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link> <el-link v-if="authSearch && scope.row.status === '已完成'" style="cursor: pointer" @click="addOrUpdateHandle(scope.row)">详情</el-link>
@ -301,7 +304,7 @@
<el-input v-model="modalData.buyerName" disabled style="width: 156px"></el-input> <el-input v-model="modalData.buyerName" disabled style="width: 156px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData">
<el-form :inline="true" label-position="top" :model="modalData" class="rohs-classify-row">
<el-form-item label="所需审批文件/Qualification Documents needed" > <el-form-item label="所需审批文件/Qualification Documents needed" >
<dict-data-select <dict-data-select
:key="'qualification-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')" :key="'qualification-default-' + (modalData.referenceNo || '') + '-' + (isEditMode ? 'edit' : 'add')"
@ -312,10 +315,26 @@
:use-type-multi-default-value="!isEditMode" :use-type-multi-default-value="!isEditMode"
:title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)" :title="getMultipleSelectTitle(modalData.qualificationDocumentsNeededList)"
:disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')" :disabled="isRohsFieldDisabled('qualificationDocumentsNeeded')"
style="width: 807px"
style="width: 532px"
dict-type="rohs_qualification_docs"> dict-type="rohs_qualification_docs">
</dict-data-select> </dict-data-select>
</el-form-item> </el-form-item>
<el-form-item>
<span style="cursor: pointer" v-if="!isEditMode && !showModalFlag" slot="label" @click="openPlmPartDialog"><a herf="#">PLM料号</a></span>
<span v-else slot="label">PLM料号</span>
<span class="rohs-plm-part-code" :class="{'is-link': (isEditMode || showModalFlag) && !!modalData.plmPartNo}">
<el-input
:value="modalData.plmPartNo"
readonly
:disabled="isEditMode || showModalFlag"
@click.native="onPlmPartNoClick"
style="width: 100px">
<i v-if="!isEditMode && !showModalFlag && modalData.plmPartNo" slot="suffix" class="el-icon-circle-close" style="cursor: pointer;" @click.stop="clearPlmPart"></i>
</el-input>
<span v-if="(isEditMode || showModalFlag) && modalData.plmPartNo" class="rohs-plm-part-mask" @click="toPlmPartMenu(modalData.plmPartNo)"></span>
</span>
<el-input :value="modalData.plmPartDesc" disabled style="width: 156px"></el-input>
</el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px"> <el-form :inline="true" label-position="top" :model="modalData" style="margin-top: 40px">
<el-form-item label="测试报告必测项/Test Report including items"> <el-form-item label="测试报告必测项/Test Report including items">
@ -721,6 +740,43 @@
</el-footer> </el-footer>
</el-dialog> </el-dialog>
<el-dialog title="选择物料" top="15vh" width="50%" :close-on-click-modal="false" v-drag :visible.sync="plmPartDialogFlag">
<el-form :inline="true" label-position="top" :model="plmPartSearchData">
<el-form-item label="编码">
<el-input v-model="plmPartSearchData.partNo" clearable style="width: 160px"></el-input>
</el-form-item>
<el-form-item label="描述">
<el-input v-model="plmPartSearchData.partDesc" clearable style="width: 260px"></el-input>
</el-form-item>
<el-form-item label=" ">
<el-button type="primary" @click="searchPlmPartList">查询</el-button>
</el-form-item>
</el-form>
<el-table
border
v-loading="plmPartLoading"
:data="plmPartList"
@row-click="selectPlmPart"
:height="320"
style="width: 100%">
<el-table-column prop="partNo" label="编码" min-width="160" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
<el-table-column prop="partDesc" label="描述" min-width="280" header-align="center" align="left" :show-overflow-tooltip="true"></el-table-column>
</el-table>
<el-pagination
style="margin-top: 10px"
@size-change="plmPartSizeChangeHandle"
@current-change="plmPartCurrentChangeHandle"
:current-page="plmPartPageIndex"
:page-sizes="[20, 50, 100]"
:page-size="plmPartPageSize"
:total="plmPartTotal"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<el-footer style="height:35px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="plmPartDialogFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<el-dialog <el-dialog
title="创建IFS料号" title="创建IFS料号"
top="7vh" top="7vh"
@ -1476,9 +1532,17 @@
<el-input :value="currentRow.buyerName || ''" disabled style="width: 156px"></el-input> <el-input :value="currentRow.buyerName || ''" disabled style="width: 156px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="currentRow">
<el-form :inline="true" label-position="top" :model="currentRow" class="rohs-classify-row">
<el-form-item label="所需审批文件/Qualification Documents needed"> <el-form-item label="所需审批文件/Qualification Documents needed">
<el-input type="textarea" :rows="2" resize="none" :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 807px"></el-input>
<el-input type="textarea" :rows="2" resize="none" :value="currentRow.qualificationDocumentsNeeded || ''" disabled style="width: 532px"></el-input>
</el-form-item>
<el-form-item>
<span slot="label">PLM料号</span>
<span class="rohs-plm-part-code" :class="{'is-link': !!currentRow.plmPartNo}">
<el-input :value="currentRow.plmPartNo || ''" disabled style="width: 100px"></el-input>
<span v-if="currentRow.plmPartNo" class="rohs-plm-part-mask" @click="toPlmPartMenu(currentRow.plmPartNo)"></span>
</span>
<el-input :value="currentRow.plmPartDesc || ''" disabled style="width: 156px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px"> <el-form :inline="true" label-position="top" :model="currentRow" style="margin-top: 30px">
@ -1941,6 +2005,7 @@ export default {
modalFlag: false, modalFlag: false,
chooseProjectListFlag: false, chooseProjectListFlag: false,
projectMaterialDialogFlag: false, projectMaterialDialogFlag: false,
plmPartDialogFlag: false,
rohsCreatePartDialogFlag: false, rohsCreatePartDialogFlag: false,
rohsCreatePartLoading: false, rohsCreatePartLoading: false,
rohsCreatePartTab: 'General', rohsCreatePartTab: 'General',
@ -2144,6 +2209,15 @@ export default {
projectMaterialPageSize: 20, projectMaterialPageSize: 20,
projectMaterialTotal: 0, projectMaterialTotal: 0,
projectMaterialLoading: false, projectMaterialLoading: false,
plmPartSearchData: {
partNo: '',
partDesc: ''
},
plmPartList: [],
plmPartPageIndex: 1,
plmPartPageSize: 20,
plmPartTotal: 0,
plmPartLoading: false,
nodeOptions: [], nodeOptions: [],
projectList: [], projectList: [],
hsfApproverOptionList: [], hsfApproverOptionList: [],
@ -2259,6 +2333,8 @@ export default {
npdRemark: '', npdRemark: '',
isSameMaterialDiffSize: '', isSameMaterialDiffSize: '',
ifsPartNo: '', ifsPartNo: '',
plmPartNo: '',
plmPartDesc: '',
materialList: [], materialList: [],
stepId: null, stepId: null,
rejectFlag: '', rejectFlag: '',
@ -3391,9 +3467,30 @@ export default {
}, },
// 列表行选中变色 // 列表行选中变色
rowStyle ({row}) { rowStyle ({row}) {
if (this.currentRow && this.currentRow.referenceNo === row.referenceNo) {
return { 'background-color': '#E8F7F6', cursor: 'pointer' }
if (this.isCurrentRohsRow(row)) {
return { backgroundColor: '#E8F7F6', cursor: 'pointer' }
}
return { backgroundColor: '#ffffff', cursor: 'pointer' }
},
rowClassName ({row}) {
return this.isCurrentRohsRow(row) ? 'rohs-current-row' : ''
},
opCellStyle ({row, column}) {
if (!column || column.fixed !== 'right') {
return { backgroundColor: this.isCurrentRohsRow(row) ? '#E8F7F6' : '#ffffff' }
} }
return { backgroundColor: this.isCurrentRohsRow(row) ? '#E8F7F6' : '#ffffff' }
},
isCurrentRohsRow (row) {
return !!(row && this.currentRow && this.currentRow.referenceNo === row.referenceNo && this.currentRow.site === row.site)
},
layoutRohsTable () {
this.$nextTick(() => {
const table = this.$refs.rohsTable
if (table && typeof table.doLayout === 'function') {
table.doLayout()
}
})
}, },
// 获取按钮的权限数据 // 获取按钮的权限数据
getButtonAuthData () { getButtonAuthData () {
@ -3439,6 +3536,7 @@ export default {
this.fillDisplayFields(this.currentRow, fallbackData || {}) this.fillDisplayFields(this.currentRow, fallbackData || {})
this.syncDataListRow(this.currentRow) this.syncDataListRow(this.currentRow)
this.refreshCurrentTabTable() this.refreshCurrentTabTable()
this.layoutRohsTable()
}, },
syncDataListRow (rowData) { syncDataListRow (rowData) {
if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) { if (!rowData || !rowData.site || !rowData.referenceNo || !Array.isArray(this.dataList)) {
@ -3521,7 +3619,7 @@ export default {
if (!target) { if (!target) {
return return
} }
const fields = ['nodeId', 'nodeName', 'currentApprover', 'applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc', 'hsfApproverName', 'relatedPeopleName']
const fields = ['nodeId', 'nodeName', 'currentApprover', 'applicantName', 'pmName', 'npdEngineerName', 'technicalPlanName', 'buyerName', 'endCustomerName', 'projectName', 'commGroup1Desc', 'commGroup2Desc', 'commGroup3Desc', 'hsfApproverName', 'relatedPeopleName', 'plmPartDesc']
fields.forEach(field => { fields.forEach(field => {
const value = target[field] || fallbackData[field] || '' const value = target[field] || fallbackData[field] || ''
this.$set(target, field, value) this.$set(target, field, value)
@ -3850,6 +3948,91 @@ export default {
}) })
return fields return fields
}, },
toPlmPartMenu (plmPartNo) {
const targetPartNo = String(plmPartNo || '').trim()
if (!targetPartNo) {
return
}
if (this.$router.resolve(`/part-partInformation`).resolved.name === '404') {
this.$alert('权限不足,访问失败', '警告', {confirmButtonText: '确定'})
} else {
this.modalFlag = false
this.chooseProjectListFlag = false
this.projectMaterialDialogFlag = false
this.plmPartDialogFlag = false
this.rohsCreatePartDialogFlag = false
this.rohsCharacteristicDialogFlag = false
this.hsfApproverFlag = false
this.relatedPeopleFlag = false
this.submitModalFlag = false
this.rohsRemarkFlag = false
this.rohsMaterialDescFlag = false
this.updateExpiryDialogFlag = false
this.$nextTick(() => {
this.$router.push({name: `part-partInformation`, params: {partNo: targetPartNo}})
})
}
},
onPlmPartNoClick () {
if (!this.isEditMode && !this.showModalFlag) {
this.openPlmPartDialog()
}
},
openPlmPartDialog () {
if (this.isEditMode || this.showModalFlag) {
return
}
this.plmPartDialogFlag = true
this.plmPartPageIndex = 1
this.searchPlmPartList()
},
clearPlmPart () {
this.$set(this.modalData, 'plmPartNo', '')
this.$set(this.modalData, 'plmPartDesc', '')
},
searchPlmPartList () {
this.plmPartLoading = true
const params = {
page: this.plmPartPageIndex,
limit: this.plmPartPageSize,
site: this.modalData.site || this.$store.state.user.site,
partNo: this.plmPartSearchData.partNo,
partDesc: this.plmPartSearchData.partDesc
}
api.getRohsPlmPartList(params).then(({data}) => {
if (data && data.code === 0 && data.page) {
this.plmPartList = data.page.list || []
this.plmPartTotal = data.page.totalCount || 0
} else {
this.plmPartList = []
this.plmPartTotal = 0
this.$message.error((data && data.msg) || '物料查询失败')
}
this.plmPartLoading = false
}).catch(() => {
this.plmPartList = []
this.plmPartTotal = 0
this.plmPartLoading = false
this.$message.error('物料查询失败')
})
},
plmPartSizeChangeHandle (val) {
this.plmPartPageSize = val
this.plmPartPageIndex = 1
this.searchPlmPartList()
},
plmPartCurrentChangeHandle (val) {
this.plmPartPageIndex = val
this.searchPlmPartList()
},
selectPlmPart (row) {
if (!row || this.isEditMode || this.showModalFlag) {
return
}
this.$set(this.modalData, 'plmPartNo', row.partNo || row.part_no || '')
this.$set(this.modalData, 'plmPartDesc', row.partDesc || row.part_desc || '')
this.plmPartDialogFlag = false
},
toPartMenu (ifsPartNo) { toPartMenu (ifsPartNo) {
const targetPartNo = String(ifsPartNo || '').trim() const targetPartNo = String(ifsPartNo || '').trim()
if (!targetPartNo) { if (!targetPartNo) {
@ -3863,6 +4046,7 @@ export default {
this.modalFlag = false this.modalFlag = false
this.chooseProjectListFlag = false this.chooseProjectListFlag = false
this.projectMaterialDialogFlag = false this.projectMaterialDialogFlag = false
this.plmPartDialogFlag = false
this.rohsCreatePartDialogFlag = false this.rohsCreatePartDialogFlag = false
this.rohsCharacteristicDialogFlag = false this.rohsCharacteristicDialogFlag = false
this.hsfApproverFlag = false this.hsfApproverFlag = false
@ -3918,6 +4102,7 @@ export default {
materialDesc: '' materialDesc: ''
} }
this.projectMaterialDialogFlag = false this.projectMaterialDialogFlag = false
this.plmPartDialogFlag = false
this.rohsCreatePartDialogFlag = false this.rohsCreatePartDialogFlag = false
this.rohsCreatePartLoading = false this.rohsCreatePartLoading = false
this.rohsCreatePartTab = 'General' this.rohsCreatePartTab = 'General'
@ -4067,6 +4252,8 @@ export default {
npdRemark: '', npdRemark: '',
isSameMaterialDiffSize: '', isSameMaterialDiffSize: '',
ifsPartNo: '', ifsPartNo: '',
plmPartNo: '',
plmPartDesc: '',
materialList: [], materialList: [],
stepId: 10, stepId: 10,
rejectFlag: 'N', rejectFlag: 'N',
@ -5504,6 +5691,28 @@ export default {
word-break: keep-all; word-break: keep-all;
} }
.rohs-plm-part-code {
position: relative;
display: inline-block;
vertical-align: top;
}
.rohs-plm-part-mask {
position: absolute;
left: 0;
top: 0;
right: 0;
bottom: 0;
cursor: pointer;
}
/deep/ .rohs-plm-part-code.is-link .el-input.is-disabled .el-input__inner {
color: #17B3A3 !important;
-webkit-text-fill-color: #17B3A3;
cursor: pointer;
}
/deep/ .rohs-multiple-two-rows.el-select .el-input__inner, /deep/ .rohs-multiple-two-rows.el-select .el-input__inner,
/deep/ .rohs-multiple-two-rows .el-select .el-input__inner { /deep/ .rohs-multiple-two-rows .el-select .el-input__inner {
min-height: 62px !important; min-height: 62px !important;
@ -5547,3 +5756,35 @@ export default {
word-break: break-all; word-break: break-all;
} }
</style> </style>
<style lang="scss">
.rohs-main-table.el-table .el-table__fixed-right {
z-index: 20;
background-color: #fff;
}
.rohs-main-table.el-table .el-table__fixed-right .el-table__fixed-header-wrapper,
.rohs-main-table.el-table .el-table__fixed-right .el-table__fixed-body-wrapper {
background-color: #fff;
z-index: 21;
}
.rohs-main-table.el-table td.rohs-op-col,
.rohs-main-table.el-table .el-table__fixed-right td.el-table__cell,
.rohs-main-table.el-table .el-table__body tr:hover > td.rohs-op-col,
.rohs-main-table.el-table .el-table__fixed-right .el-table__body tr.hover-row > td.el-table__cell,
.rohs-main-table.el-table .el-table__fixed-right .el-table__body tr:hover > td.el-table__cell {
background-color: #fff !important;
}
.rohs-main-table.el-table tr.rohs-current-row > td.el-table__cell,
.rohs-main-table.el-table .el-table__fixed-right tr.rohs-current-row > td.el-table__cell,
.rohs-main-table.el-table .el-table__fixed-right tr.rohs-current-row.hover-row > td.el-table__cell,
.rohs-main-table.el-table .el-table__fixed-right tr.rohs-current-row:hover > td.el-table__cell {
background-color: #E8F7F6 !important;
}
.rohs-main-table.el-table .el-table__body-wrapper .cell {
overflow: hidden;
}
</style>
Loading…
Cancel
Save