diff --git a/src/common/lang/zh-cn.js b/src/common/lang/zh-cn.js index 6b1b97b9..fc14ab5e 100644 --- a/src/common/lang/zh-cn.js +++ b/src/common/lang/zh-cn.js @@ -176,6 +176,9 @@ module.exports = { attach: '附件', checkedAll: '全选', pleaseCompleteTableInfo: '请完善表格信息', + node: '节点', + atLeastSelect: '至少选择', + personnal: '人', // 树右键 treeRight: { addFolder: '新增文件夹', diff --git a/src/components/PersonnelInfo.vue b/src/components/PersonnelInfo.vue index c62aa3d8..a2cf6923 100644 --- a/src/components/PersonnelInfo.vue +++ b/src/components/PersonnelInfo.vue @@ -156,17 +156,24 @@ export default { let personnelObj = {} console.log(this.stepsData) for (let i = 0; i < this.stepsData.length; i++) { - // 该属性还没有人就给他赋值 + // 该属性还没有人就给他赋值,并且如果minLength有值的话,需要判断选的人数过了这个限制 if ((this.stepsData[i].canChoose || i === 0) && !personnelObj[this.stepsData[i].variableName]) { - personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + if (this.stepsData[i].minLength) { + // 有设置至少选几人 + if (this.stepsData[i].linkUserIds && this.stepsData[i].linkUserIds.split(',').length >= this.stepsData[i].minLength) { + // 说明人数通过了限制 + personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + } else { + // 提示XX节点至少选择XX人 + this.$message.warning(this.stepsData[i].nodeName + this.$t('node') + this.$t('atLeastSelect') + this.stepsData[i].minLength + this.$t('personnal')) + personnelObj[this.stepsData[i].variableName] = '' + return + } + } else { + personnelObj[this.stepsData[i].variableName] = this.stepsData[i].linkUserIds + } } } - // for (const item of this.stepsData) { - // // 该属性还没有人就给他赋值 - // if ((item.canChoose || item.sort === 1) && !personnelObj[item.variableName]) { - // personnelObj[item.variableName] = item.linkUserIds - // } - // } console.log(personnelObj) for (const item in personnelObj) { if (!this.notPermissField.includes(item) && !personnelObj[item]) { diff --git a/src/components/selection/UserSelectByWorkGroupModal.vue b/src/components/selection/UserSelectByWorkGroupModal.vue index 5e35add0..e48076a0 100644 --- a/src/components/selection/UserSelectByWorkGroupModal.vue +++ b/src/components/selection/UserSelectByWorkGroupModal.vue @@ -81,7 +81,7 @@