diff --git a/src/views/plugin/workflow/process/components/detail.vue b/src/views/plugin/workflow/process/components/detail.vue index cde8663..c169ce1 100644 --- a/src/views/plugin/workflow/process/components/detail.vue +++ b/src/views/plugin/workflow/process/components/detail.vue @@ -11,7 +11,7 @@ name="first">
- @@ -79,7 +79,7 @@ v-loading="submitLoading" @click="handleCompleteTask(false)">驳回 转办 @@ -89,7 +89,7 @@ v-loading="submitLoading" @click="handleUserSelect('delegate')">委托 打印 @@ -202,19 +202,46 @@ export default { option.menuBtn = false if (status != 'todo') option.detail = true else { - const arr = [] + const columnArr = [] + const groupArr = [] const vars = [] - taskForm.forEach(task => { - const column = option.column.find(c => c.prop == task.id) - if (task.readable && column) { - if (!task.writable) { - column.readonly = true - column.disabled = true - } else vars.push(column.prop) - } - arr.push(column) - }) - option.column = arr + const { column, group } = option + if (column && column.length > 0) { // 处理column + column.forEach(col => { + const c = taskForm.find(s => s.id == col.prop) + if (c && c.readable) { + if (!c.writable) { + col.readonly = true + col.disabled = true + delete col.rules + } else vars.push(col.prop) + columnArr.push(col) + } + }) + } + if (group && group.length > 0) { // 处理group + group.forEach(gro => { + if (gro.column && gro.column.length > 0) { + const groupColumnArr = [] + gro.column.forEach(col => { + const c = taskForm.find(s => s.id == col.prop) + if (c && c.readable) { + if (!c.writable) { + col.readonly = true + col.disabled = true + delete col.rules + } else vars.push(col.prop) + groupColumnArr.push(col) + } + }) + gro.column = groupColumnArr + } + if (gro.column.length > 0) groupArr.push(gro) + }) + } + + option.column = columnArr + option.group = groupArr this.vars = vars } @@ -271,6 +298,8 @@ export default { }).catch(() => { this.submitLoading = false }) + } else { + this.submitLoading = false } }) }, diff --git a/src/views/plugin/workflow/process/components/form.vue b/src/views/plugin/workflow/process/components/form.vue index 5efe9f4..6560478 100644 --- a/src/views/plugin/workflow/process/components/form.vue +++ b/src/views/plugin/workflow/process/components/form.vue @@ -3,7 +3,7 @@ - @@ -48,18 +48,45 @@ export default { const option = eval('(' + form + ')') // option.menuBtn = false - const arr = [] - startForm.forEach(s => { - const column = option.column.find(c => c.prop == s.id) - if (s.readable && column) { - if (!s.writable) { - column.readonly = true - column.disabled = true + const columnArr = [] + const groupArr = [] + const { column, group } = option + if (column && column.length > 0) { // 处理column + column.forEach(col => { + const c = startForm.find(s => s.id == col.prop) + if (c && c.readable) { + if (!c.writable) { + col.readonly = true + col.disabled = true + delete col.rules + } + columnArr.push(col) } - } - arr.push(column) - }) - option.column = arr + }) + } + if (group && group.length > 0) { // 处理group + group.forEach(gro => { + if (gro.column && gro.column.length > 0) { + const groupColumnArr = [] + gro.column.forEach(col => { + const c = startForm.find(s => s.id == col.prop) + if (c && c.readable) { + if (!c.writable) { + col.readonly = true + col.disabled = true + delete col.rules + } + groupColumnArr.push(col) + } + }) + gro.column = groupColumnArr + } + if (gro.column.length > 0) groupArr.push(gro) + }) + } + + option.column = columnArr + option.group = groupArr this.option = option }