Browse Source

2026-05-15

RoHs功能优化
master
fengyuan_yang 4 weeks ago
parent
commit
4cff0c8fee
  1. 3
      src/api/rohs/rohs.js
  2. 91
      src/views/modules/rohs/rohsRecord.vue

3
src/api/rohs/rohs.js

@ -15,6 +15,9 @@ export const saveRohs = data => createAPI(`/rohs/save`, 'post', data);
// 修改
export const updateRohs = data => createAPI(`/rohs/update`, 'post', data);
// 仅更新RoHs备注(不受流程节点和状态限制)
export const updateRohsRemark = data => createAPI(`/rohs/updateRemark`, 'post', data);
// 仅保存材料明细(编辑时即时保存)
export const updateRohsMaterials = data => createAPI(`/rohs/updateMaterials`, 'post', data);

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

@ -240,6 +240,7 @@
</el-form-item>
<el-form-item label=" " style="margin-top: -2px;margin-left: 2px">
<el-button type="primary" icon="el-icon-upload" @click="uploadDialog = true">上传附件</el-button>
<el-button type="primary" icon="el-icon-edit-outline" v-if="authDataEntry" @click="openRohsRemarkDialog" style="margin-left: 6px">RoHs备注</el-button>
</el-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData">
@ -554,6 +555,26 @@
</el-footer>
</el-dialog>
<el-dialog width="700px" title="RoHs备注" :close-on-click-modal="false" :visible.sync="rohsRemarkFlag" v-drag>
<el-form label-position="top">
<el-form-item label="RoHs备注">
<el-input
type="textarea"
v-model="rohsRemarkForm.rohsRemark"
:rows="6"
maxlength="255"
show-word-limit
resize="none">
</el-input>
</el-form-item>
</el-form>
<el-footer style="height:35px;margin-top:110px;text-align:center">
<el-button type="primary" @click="refreshRohsRemark">刷新</el-button>
<el-button type="primary" @click="saveRohsRemark">保存</el-button>
<el-button type="primary" @click="rohsRemarkFlag = false">取消</el-button>
</el-footer>
</el-dialog>
<!-- 底部附件页签 -->
<el-tabs v-model="activeTable" style="width: 100%; height: 100%;" type="border-card" @tab-click="refreshCurrentTabTable" class="customer-tab">
<el-tab-pane label="基本信息" name="basicInfo">
@ -848,6 +869,7 @@ export default {
authFileDownLoad: false,
authFileRemove: false,
authFilePreview: false,
authDataEntry: false,
authDelete: false,
superAdmin: false,
createBy2: this.$store.state.user.name,
@ -1025,8 +1047,12 @@ export default {
activeName: 'basicInfo',
showModalFlag: false,
submitModalFlag: false,
rohsRemarkFlag: false,
rejectOpinion: '',
submitLoading: false,
rohsRemarkForm: {
rohsRemark: ''
},
modalData: {
site: 'DEFAULT',
referenceNo: '',
@ -1066,6 +1092,7 @@ export default {
testReportIncludingItems: '',
testReportIncludingItemsList: [],
remark: '',
rohsRemark: '',
status: '',
sgsReportNumber: '',
expiredDate: '',
@ -1328,6 +1355,60 @@ export default {
canRejectAction () {
return this.authReject && this.isCurrentApprover() && this.modalData.status === '审批中' && this.modalData.isReject === 'Y'
},
hasPersistedRohsRecord () {
return !!(this.modalData && this.modalData.site && this.modalData.referenceNo && !String(this.modalData.referenceNo).startsWith('TEMP-'))
},
openRohsRemarkDialog () {
this.$set(this.rohsRemarkForm, 'rohsRemark', this.modalData.rohsRemark || '')
this.rohsRemarkFlag = true
},
refreshRohsRemark () {
if (!this.hasPersistedRohsRecord()) {
this.$set(this.rohsRemarkForm, 'rohsRemark', this.modalData.rohsRemark || '')
return
}
api.getRohsDetail(this.modalData.site, this.modalData.referenceNo).then(({data}) => {
if (data && data.code === 0 && data.data) {
this.$set(this.rohsRemarkForm, 'rohsRemark', data.data.rohsRemark || '')
} else {
this.$message.error((data && data.msg) || '刷新失败')
}
}).catch(() => {
this.$message.error('刷新失败')
})
},
saveRohsRemark () {
const rohsRemark = this.rohsRemarkForm.rohsRemark || ''
if (!this.hasPersistedRohsRecord()) {
this.$set(this.modalData, 'rohsRemark', rohsRemark)
this.rohsRemarkFlag = false
this.$message.success('暂存成功,保存单据后写入数据库')
return
}
const params = {
site: this.modalData.site,
referenceNo: this.modalData.referenceNo,
rohsRemark: rohsRemark
}
api.updateRohsRemark(params).then(({data}) => {
if (data && data.code === 0) {
this.$set(this.modalData, 'rohsRemark', rohsRemark)
if (this.currentRow && this.currentRow.site === this.modalData.site && this.currentRow.referenceNo === this.modalData.referenceNo) {
this.$set(this.currentRow, 'rohsRemark', rohsRemark)
}
const target = (this.dataList || []).find(item => item.site === this.modalData.site && item.referenceNo === this.modalData.referenceNo)
if (target) {
this.$set(target, 'rohsRemark', rohsRemark)
}
this.rohsRemarkFlag = false
this.$message.success('操作成功')
} else {
this.$message.error((data && data.msg) || '保存失败')
}
}).catch(() => {
this.$message.error('保存失败')
})
},
loadModalButtonCondition () {
if (!this.modalData.site || !this.modalData.referenceNo || this.modalData.status !== '审批中') {
this.$set(this.modalData, 'createBy2', '')
@ -1376,6 +1457,7 @@ export default {
this.authFileDownLoad = this.isAuth(this.menuId+":fileDownLoad")
this.authFileRemove = this.isAuth(this.menuId+":fileRemove")
this.authFilePreview = this.isAuth(this.menuId+":filePreview")
this.authDataEntry = this.isAuth(this.menuId+":dataEntry")
this.authDelete = this.isAuth(this.menuId+":delete")
},
//
@ -1555,7 +1637,7 @@ export default {
this.$message.warning('没有新增权限')
return
}
if (row && !this.authUpdate) {
if (row && !this.authUpdate && !this.authDataEntry) {
this.$message.warning('没有编辑权限')
return
}
@ -1564,7 +1646,11 @@ export default {
this.fileList = []
this.uploadDialog = false
this.submitModalFlag = false
this.rohsRemarkFlag = false
this.rejectOpinion = ''
this.rohsRemarkForm = {
rohsRemark: ''
}
this.projectMaterialDialogFlag = false
this.projectMaterialSelections = []
this.materialSelections = []
@ -1581,7 +1667,7 @@ export default {
finalPartNo: '',
customerPartNo: ''
}
this.showModalFlag = !!(row && row.status === '已完成')
this.showModalFlag = !!(row && (row.status === '已完成' || !this.authUpdate))
if (row) {
this.modalTitle = 'RoHs 编辑'
@ -1662,6 +1748,7 @@ export default {
testReportIncludingItems: '',
testReportIncludingItemsList: [],
remark: '',
rohsRemark: '',
status: '草稿',
sgsReportNumber: '',
expiredDate: '',

Loading…
Cancel
Save