|
|
@@ -402,6 +402,30 @@
|
|
|
},
|
|
|
|
|
|
methods: {
|
|
|
+ // 获取“归档”的key
|
|
|
+ getArchiveKey() {
|
|
|
+ const list = (this.dictData && this.dictData['processStatus']) || []
|
|
|
+ if (!Array.isArray(list)) return ''
|
|
|
+ const item = list.find((it) => it && it.name === '归档')
|
|
|
+ return item ? item.key : ''
|
|
|
+ },
|
|
|
+ // 获取除“归档”外的全部预置流转操作key数组
|
|
|
+ getNonArchiveKeys() {
|
|
|
+ const list = (this.dictData && this.dictData['processStatus']) || []
|
|
|
+ if (!Array.isArray(list)) return []
|
|
|
+ return list
|
|
|
+ .filter((it) => it && it.name !== '归档')
|
|
|
+ .map((it) => it.key)
|
|
|
+ .filter((k) => k != null && k !== '')
|
|
|
+ },
|
|
|
+ // 获取所有预置流转操作的key数组(全选)
|
|
|
+ getAllStatusKeys() {
|
|
|
+ const list = (this.dictData && this.dictData['processStatus']) || []
|
|
|
+ if (!Array.isArray(list)) return []
|
|
|
+ return list
|
|
|
+ .map((it) => (it ? it.key : undefined))
|
|
|
+ .filter((k) => k != null && k !== '')
|
|
|
+ },
|
|
|
formatterUserList(userId) {
|
|
|
// 筛选出除主办人员之外的人员
|
|
|
return this.formatterMainUserList().filter(
|
|
|
@@ -486,12 +510,13 @@
|
|
|
userId: item.userId ? item.userId.split(',') : [],
|
|
|
status: item.status ? item.status.split(',') : [],
|
|
|
}
|
|
|
- // 默认预置流转操作:归档环节默认“归档”,其他默认“通过”
|
|
|
+ // 默认预置流转操作:归档环节默认“全部选中”,其他环节默认“除归档外全部选中”
|
|
|
if (!mapped.status || mapped.status.length === 0) {
|
|
|
- const defaultKey = this.isArchiveNode(mapped)
|
|
|
- ? this.getProcessStatusKeyByName('归档')
|
|
|
- : this.getProcessStatusKeyByName('通过')
|
|
|
- mapped.status = defaultKey ? [defaultKey] : []
|
|
|
+ if (this.isArchiveNode(mapped)) {
|
|
|
+ mapped.status = this.getAllStatusKeys()
|
|
|
+ } else {
|
|
|
+ mapped.status = this.getNonArchiveKeys()
|
|
|
+ }
|
|
|
}
|
|
|
return mapped
|
|
|
})
|
|
|
@@ -508,10 +533,11 @@
|
|
|
status: item.status ? item.status.split(',') : [],
|
|
|
}
|
|
|
if (!mapped.status || mapped.status.length === 0) {
|
|
|
- const defaultKey = this.isArchiveNode(mapped)
|
|
|
- ? this.getProcessStatusKeyByName('归档')
|
|
|
- : this.getProcessStatusKeyByName('通过')
|
|
|
- mapped.status = defaultKey ? [defaultKey] : []
|
|
|
+ if (this.isArchiveNode(mapped)) {
|
|
|
+ mapped.status = this.getAllStatusKeys()
|
|
|
+ } else {
|
|
|
+ mapped.status = this.getNonArchiveKeys()
|
|
|
+ }
|
|
|
}
|
|
|
return mapped
|
|
|
})
|
|
|
@@ -525,10 +551,9 @@
|
|
|
const statusArr = row.status ? row.status.split(',') : []
|
|
|
let finalStatus = statusArr
|
|
|
if (!finalStatus || finalStatus.length === 0) {
|
|
|
- const defaultKey = this.isArchiveNode(row)
|
|
|
- ? this.getProcessStatusKeyByName('归档')
|
|
|
- : this.getProcessStatusKeyByName('通过')
|
|
|
- finalStatus = defaultKey ? [defaultKey] : []
|
|
|
+ finalStatus = this.isArchiveNode(row)
|
|
|
+ ? this.getAllStatusKeys()
|
|
|
+ : this.getNonArchiveKeys()
|
|
|
}
|
|
|
this.formData.currentStep = {
|
|
|
...row,
|