update 企标稽查计划-意见调整

This commit is contained in:
danshihao
2023-12-12 19:10:34 +08:00
parent f216fbf30d
commit cc8f2945bc
3 changed files with 38 additions and 4 deletions
@@ -427,6 +427,30 @@ export default {
*/
handleSubmit () {
if (this.loading) return
// 节点2,验证所有数据意见是否都已填写
if (this.currentNode === EsInspectionPlan.fillInComments.value) {
// 当前登录用户,查找意见为空的数据
const currentUserName = this.$store.getters.userInfo.username
const opinionHasEmpty = this.$refs.inspectionPlanTable.dataSource.find(item => {
// 自己的数据就不用填写意见
if (item.createBy === currentUserName) {
return false
}
// 如果意见字段为空,或者没有意见数据,就是没填的数据
if (!item.processEsInspectPlanOpinionList || !item.processEsInspectPlanOpinionList.length) {
return true
}
// 如果有意见信息,从中找自己的数据,没找到自己的数据,就是没填的数据
const selfOpinionData = item.processEsInspectPlanOpinionList.find(childItem => {
return childItem.createBy === currentUserName
})
return !selfOpinionData
})
if (opinionHasEmpty) {
this.$message.warning(this.$t('pleaseCompleteTableInfo'))
return
}
}
// 有taskId说明已经发起过,调审批接口,否则调发起接口
if (this.$route.query.taskId) {
this.handleAgree(true)
@@ -48,7 +48,7 @@
</template>
<!-- 意见 or 填写意见节点2非自己创建的就是意见和填写意见 -->
<template v-else-if="currentNode === EsInspectionPlan.fillInComments.value">
<a v-if="record.processEsInspectPlanOpinionList && record.processEsInspectPlanOpinionList.length" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-if="isShowOpinion(record)" @click="handleShowOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.opinion') }}</a>
<a v-else @click="handleWriteOpinion(record, index)" >{{ $t('workCenter.esInspectionPlan.writeOpinion') }}</a>
</template>
</template>
@@ -238,6 +238,10 @@ export default {
}
},
computed: {
// 当前登录用户名
currentUserName () {
return this.$store.getters.userInfo.username
},
// 是否显示表格操作按钮
hasTableOperator () {
const arr = [
@@ -267,6 +271,12 @@ export default {
this.filters.taskId = this.$route.query.taskId
},
methods: {
// 是否显示意见
isShowOpinion (record) {
const list = record.processEsInspectPlanOpinionList || []
// 意见列表是否有当前用户的意见
return !!(list.find(item => item.createBy === this.currentUserName))
},
getCheckboxProps (record) {
const obj = { props: { disabled: false } }
// 第二个节点,只有自己的才能勾选删除
@@ -18,6 +18,7 @@
rowKey="id"
ref="table"
size="middle"
:scroll="{x:'100%'}"
bordered>
<!-- 企标号企标名称 -->
@@ -115,9 +116,8 @@ export default {
show (record, disabled) {
// 是否禁用表单
this.disabled = disabled
if (disabled) {
this.formData.opinion = (record.processEsInspectPlanOpinionList.find(item => item.createBy === this.$store.getters.userInfo.username) || {}).opinion
}
const list = record.processEsInspectPlanOpinionList || []
this.formData.opinion = (list.find(item => item.createBy === this.$store.getters.userInfo.username) || {}).opinion
this.dataSource = [record]
this.model = Object.assign({}, record)
this.visible = true