|
129 | 129 | />
|
130 | 130 | </el-select>
|
131 | 131 | </el-form-item>
|
| 132 | + <el-form-item |
| 133 | + v-if="userTaskForm.candidateStrategy === CandidateStrategy.FORM_DEPT_LEADER" |
| 134 | + label="表单内部门字段" |
| 135 | + prop="formDept" |
| 136 | + > |
| 137 | + <el-select |
| 138 | + v-model="userTaskForm.candidateParam" |
| 139 | + clearable |
| 140 | + style="width: 100%" |
| 141 | + @change="updateElementTask" |
| 142 | + > |
| 143 | + <el-option |
| 144 | + v-for="(item, idx) in deptFieldOnFormOptions" |
| 145 | + :key="idx" |
| 146 | + :label="item.title" |
| 147 | + :value="item.field" |
| 148 | + :disabled="!item.required" |
| 149 | + /> |
| 150 | + </el-select> |
| 151 | + </el-form-item> |
132 | 152 | <el-form-item
|
133 | 153 | v-if="
|
134 | 154 | userTaskForm.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER ||
|
@@ -206,12 +226,15 @@ const postOptions = ref<PostApi.PostVO[]>([]) // 岗位列表
|
206 | 226 | const userOptions = ref<UserApi.UserVO[]>([]) // 用户列表
|
207 | 227 | const userGroupOptions = ref<UserGroupApi.UserGroupVO[]>([]) // 用户组列表
|
208 | 228 |
|
209 |
| -// 表单内用户字段 |
210 | 229 | const { formFieldOptions } = useFormFieldsPermission(FieldPermissionType.READ)
|
211 | 230 | // 表单内用户字段选项, 必须是必填和用户选择器
|
212 | 231 | const userFieldOnFormOptions = computed(() => {
|
213 | 232 | return formFieldOptions.filter((item) => item.type === 'UserSelect')
|
214 | 233 | })
|
| 234 | +// 表单内部门字段选项, 必须是必填和部门选择器 |
| 235 | +const deptFieldOnFormOptions = computed(() => { |
| 236 | + return formFieldOptions.filter((item) => item.type === 'DeptSelect') |
| 237 | +}) |
215 | 238 |
|
216 | 239 | const deptLevel = ref(1)
|
217 | 240 | const deptLevelLabel = computed(() => {
|
@@ -264,6 +287,9 @@ const resetTaskForm = () => {
|
264 | 287 | ) {
|
265 | 288 | userTaskForm.value.candidateParam = +candidateParamStr
|
266 | 289 | deptLevel.value = +candidateParamStr
|
| 290 | + } else if (userTaskForm.value.candidateStrategy == CandidateStrategy.FORM_DEPT_LEADER) { |
| 291 | + userTaskForm.value.candidateParam = candidateParamStr.split('|')[0] |
| 292 | + deptLevel.value = +candidateParamStr.split('|')[1] |
267 | 293 | } else {
|
268 | 294 | userTaskForm.value.candidateParam = candidateParamStr.split(',').map((item) => {
|
269 | 295 | // 如果数字超出了最大安全整数范围,则将其作为字符串处理
|
@@ -322,7 +348,10 @@ const updateElementTask = () => {
|
322 | 348 | : userTaskForm.value.candidateParam
|
323 | 349 |
|
324 | 350 | // 特殊处理多级部门情况
|
325 |
| - if (userTaskForm.value.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER) { |
| 351 | + if ( |
| 352 | + userTaskForm.value.candidateStrategy == CandidateStrategy.MULTI_LEVEL_DEPT_LEADER || |
| 353 | + userTaskForm.value.candidateStrategy == CandidateStrategy.FORM_DEPT_LEADER |
| 354 | + ) { |
326 | 355 | candidateParam += '|' + deptLevel.value
|
327 | 356 | }
|
328 | 357 | // 特殊处理发起人部门负责人、发起人连续部门负责人
|
|
0 commit comments