Browse Source

2026-07-23

MRB异常单
master
fengyuan_yang 6 days ago
parent
commit
45c81ccc1d
  1. 72
      src/views/modules/yieldReport/com_mrb_register.vue
  2. 2
      src/views/modules/yieldReport/com_produce_report_normal.vue

72
src/views/modules/yieldReport/com_mrb_register.vue

@ -12,8 +12,8 @@
<template v-if="isListMode">
<div class="table-toolbar">
<div>
<el-button type="primary" size="mini" icon="el-icon-plus" @click="addModal">新增</el-button>
<el-button size="mini" icon="el-icon-delete" @click="deleteModal">删除</el-button>
<el-button type="primary" size="mini" icon="el-icon-plus" :disabled="authAdd" @click="addModal">新增</el-button>
<el-button size="mini" icon="el-icon-delete" :disabled="authDelete" @click="deleteModal">删除</el-button>
</div>
<span class="toolbar-tip">卷号MRB制程异常单为必填项</span>
</div>
@ -34,7 +34,8 @@
<el-table-column prop="mrbRemark" label="备注" min-width="220" show-overflow-tooltip></el-table-column>
<el-table-column label="操作" width="90" align="center">
<template slot-scope="scope">
<el-link style="cursor: pointer" @click="editModal(scope.row)">编辑</el-link>
<el-link v-if="!authEdit" style="cursor: pointer" @click="editModal(scope.row)">编辑</el-link>
<span v-else class="action-disabled">编辑</span>
</template>
</el-table-column>
</el-table>
@ -124,11 +125,18 @@ export default {
mode: {
type: String,
default: 'list'
},
menuId: {
type: [String, Number],
default: ''
}
},
data () {
return {
loading: false,
authEdit: false,
authAdd: false,
authDelete: false,
scheduleData: {
site: '',
orderNo: '',
@ -167,7 +175,48 @@ export default {
return this.editDialogMode === 'edit' ? 'MRB异常单编辑' : 'MRB异常单登记'
}
},
watch: {
mode () {
this.refreshAuthFlags()
},
menuId () {
this.refreshAuthFlags()
}
},
created () {
this.refreshAuthFlags()
},
methods: {
resolvePermissionMenuId () {
if (this.menuId !== undefined && this.menuId !== null && this.menuId !== '') {
return String(this.menuId)
}
if (this.$route && this.$route.meta && this.$route.meta.menuId) {
return String(this.$route.meta.menuId)
}
return ''
},
refreshAuthFlags () {
if (!this.isListMode || typeof this.isAuth !== 'function') {
this.authEdit = false
this.authAdd = false
this.authDelete = false
return
}
const functionId = this.resolvePermissionMenuId()
if (!functionId) {
this.authEdit = false
this.authAdd = false
this.authDelete = false
return
}
const addFlag = this.isAuth(functionId + ':addMrb')
const updateFlag = this.isAuth(functionId + ':updateMrb')
const deleteFlag = this.isAuth(functionId + ':deleteMrb')
this.authEdit = !updateFlag
this.authAdd = !addFlag
this.authDelete = !deleteFlag
},
createEmptyForm () {
return {
id: null,
@ -202,6 +251,7 @@ export default {
}))
},
init (scheduleData) {
this.refreshAuthFlags()
this.scheduleData = {
site: scheduleData.site || '',
orderNo: scheduleData.orderNo || '',
@ -287,12 +337,20 @@ export default {
this.selectedRowKeys = (rows || []).map(item => item.rowKey)
},
addModal () {
if (this.authAdd) {
this.$message.warning('当前用户无新增权限')
return
}
this.editDialogMode = 'add'
this.editForm = this.createEmptyForm()
this.editDialogVisible = true
this.clearValidate()
},
editModal (row) {
if (this.authEdit) {
this.$message.warning('当前用户无编辑权限')
return
}
if (!row) {
return
}
@ -348,6 +406,10 @@ export default {
})
},
deleteModal () {
if (this.authDelete) {
this.$message.warning('当前用户无删除权限')
return
}
if (!this.selectedRowKeys || this.selectedRowKeys.length === 0) {
this.$message.warning('请先勾选要删除的记录')
return
@ -496,6 +558,10 @@ export default {
color: #909399;
}
.action-disabled {
color: #c0c4cc;
}
.dialog-footer {
text-align: center;
margin-top: 15px;

2
src/views/modules/yieldReport/com_produce_report_normal.vue

@ -825,7 +825,7 @@
<ComProcessInspection :visible.sync="showProcessInspectionFlag" :orderNo="scheduleData.orderNo" :resourceId="scheduleData.resourceId" :seqNo="scheduleData.seqNo" :site="scheduleData.site" :buNo="scheduleData.buNo" :rollNo="scheduleData.rollNo" @closed="refreshPageData"></ComProcessInspection>
<!-- MRB异常单登记组件 -->
<ComMrbRegister ref="comMrbRegister" :visible.sync="showMrbRegisterFlag" mode="list" @confirmed="onMrbConfirmed"></ComMrbRegister>
<ComMrbRegister ref="comMrbRegister" :visible.sync="showMrbRegisterFlag" mode="list" :menu-id="$route.meta.menuId" @confirmed="onMrbConfirmed"></ComMrbRegister>
<!-- SOP预览弹出框 -->
<el-dialog :visible.sync="showSopPreviewFlag" width="50%" top="5vh" :before-close="closeSopPreview">

Loading…
Cancel
Save