Browse Source

预归档流程设置

master
xuhuajiao 3 days ago
parent
commit
df169583f1
  1. 30
      src/api/system/category/process.js
  2. 99
      src/views/system/fileLibraryManage/processManage/index.vue
  3. 15
      src/views/system/fileLibraryManage/processManage/module/form.vue

30
src/api/system/category/process.js

@ -44,4 +44,32 @@ export function FetchgetCategoryFlow(params) {
params
})
}
export default { FetchInitCategoryFlowBase, FetchInitFlowByCategoryId, FetchChangeCategoryState, FetchFlowbinding, FetchgetCategoryFlow }
// 预归档库- 根据门类获取流程设置
export function FetchReDocumentInitFlowByCategoryId(params) {
return request({
url: 'api/re-document/initFlowByDocumentId',
method: 'get',
params
})
}
// 预归档库- 门类流程设计-工作流选择
export function FetchReDocumentFlowbinding(data) {
return request({
url: 'api/re-document/flowbinding',
method: 'post',
data
})
}
// 预归档库- 门类管理-更改流程管理状态
export function FetchReDocumentChangeCategoryState(data) {
return request({
url: 'api/re-document/changeCategoryState',
method: 'post',
data
})
}
export default { FetchInitCategoryFlowBase, FetchInitFlowByCategoryId, FetchChangeCategoryState, FetchFlowbinding, FetchgetCategoryFlow, FetchReDocumentInitFlowByCategoryId, FetchReDocumentFlowbinding, FetchReDocumentChangeCategoryState }

99
src/views/system/fileLibraryManage/processManage/index.vue

@ -1,16 +1,16 @@
<template>
<div class="process-container">
<div v-for="item in filteredFlowList" :key="item.id" class="process-item">
<span>{{ item.name }}</span>
<div v-for="item in flowSetting" :key="item.id" class="process-item">
<span>{{ item.flowName.split('-')[1] }}</span>
<p>{{ item.flowName }}<i class="iconfont icon-shezhi" @click="toProcessSelected(item)" /></p>
<el-switch v-model="item.status" class="isEnable-chapter" @change="changeCategoryState(item)" />
</div>
<eForm ref="cuform" :selected-category="selectedCategory" :edit-info-flow="editInfoFlow" @refresh="getInitCategoryFlowBase" />
<eForm ref="cuform" :selected-category="selectedCategory" :edit-info-flow="editInfoFlow" @refresh="getReDocumentInitFlowByCategoryId" />
</div>
</template>
<script>
import { FetchInitCategoryFlowBase, FetchInitFlowByCategoryId, FetchChangeCategoryState, FetchgetCategoryFlow } from '@/api/system/category/process'
import { FetchReDocumentInitFlowByCategoryId, FetchReDocumentChangeCategoryState } from '@/api/system/category/process'
import eForm from './module/form'
export default {
name: 'ProcessManage',
@ -25,93 +25,50 @@ export default {
},
data() {
return {
flowBaseList: [],
flowSetting: [],
editInfoFlow: null
}
},
computed: {
filteredFlowList() {
if (this.selectedCategory.pid === '0' && this.selectedCategory.isType === 1) {
return this.flowBaseList.filter(item => item.id === '5')
} else {
return this.flowBaseList.filter(item => item.id !== '5')
}
}
},
watch: {
},
mounted() {
this.getInitCategoryFlowBase()
this.getReDocumentInitFlowByCategoryId()
},
methods: {
getInitCategoryFlowBase() {
FetchInitCategoryFlowBase().then((res) => {
this.flowBaseList = res.map(item => {
getReDocumentInitFlowByCategoryId() {
FetchReDocumentInitFlowByCategoryId({ 'documentId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null }).then((res) => {
this.flowSetting = res.map(item => {
return {
...item,
status: false
status: !!item.status
}
})
this.getInitFlowByCategoryId()
}).catch(err => {
console.log(err)
})
},
getInitFlowByCategoryId() {
console.log(this.selectedCategory)
FetchInitFlowByCategoryId({ 'categoryId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null }).then((res) => {
this.flowSetting = res
this.flowBaseList.forEach(item => {
this.flowSetting.forEach(v => {
if (item.id === v.flowManageId) {
item.status = !!v.status
item.flowName = v.flowName
}
//
if (this.flowSetting.length > 0) {
this.editInfoFlow = this.flowSetting[0]
this.$nextTick(() => {
this.$refs.cuform.getEditInfoFlow = this.editInfoFlow
this.$refs.cuform.handleEditInfoFlow(this.editInfoFlow)
})
})
}
}).catch(err => {
console.log(err)
})
},
toProcessSelected(item) {
const params = {
'categoryId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null,
'manageId': item.id
}
FetchgetCategoryFlow(params).then((res) => {
if (res) {
// null
if (this.allValuesNull(res)) {
// console.log(' null')
this.editInfoFlow = null
} else {
// console.log(' null')
this.editInfoFlow = res
}
} else {
this.editInfoFlow = null
this.$message({ message: '数据请求失败', type: 'error', offset: 8 })
}
console.log('this.editInfoFlow', this.editInfoFlow)
this.$nextTick(() => {
this.$refs.cuform.cuDialogVisible = true
this.$refs.cuform.setPocessCurrent = item
this.$refs.cuform.getEditInfoFlow = this.editInfoFlow ? this.editInfoFlow : {}
this.$refs.cuform.handleEditInfoFlow(this.editInfoFlow)
})
}).catch(err => {
console.log(err)
this.editInfoFlow = item
this.$nextTick(() => {
this.$refs.cuform.cuDialogVisible = true
this.$refs.cuform.setPocessCurrent = item
this.$refs.cuform.getEditInfoFlow = this.editInfoFlow ? this.editInfoFlow : {}
this.$refs.cuform.handleEditInfoFlow(this.editInfoFlow)
})
},
changeCategoryState(item) {
const filterItem = this.flowSetting.find(v => item.id === v.flowManageId)
const params = {
'categoryId': this.selectedCategory.id,
'id': filterItem.id,
'id': item.id,
'status': item.status ? 1 : 0
}
FetchChangeCategoryState(params).then((res) => {
FetchReDocumentChangeCategoryState(params).then((res) => {
if (res === 'SUCCESS') {
this.$message({ message: '操作成功', type: 'success', offset: 8 })
} else {
@ -120,14 +77,6 @@ export default {
}).catch(err => {
console.log(err)
})
},
allValuesNull(jsonObject) {
for (const key in jsonObject) {
if (jsonObject[key] !== null) {
return false
}
}
return true
}
}
}

15
src/views/system/fileLibraryManage/processManage/module/form.vue

@ -56,7 +56,7 @@
<script>
import { FetchInitFlowAll, FetchFindFolwImgByModelId, FetchUserTaskAllByDeployId } from '@/api/system/flowable'
import { FetchPostAll, FetchFindUserByPost } from '@/api/system/job'
import { FetchFlowbinding } from '@/api/system/category/process'
import { FetchReDocumentFlowbinding } from '@/api/system/category/process'
export default {
props: {
@ -175,7 +175,7 @@ export default {
},
selectModel(val, parentProcessVal) {
if (!parentProcessVal) {
this.getEditInfoFlow.categoryFlowDetails = []
this.getEditInfoFlow.documentFlowDetails = []
}
this.selectFlowVal = val
@ -197,7 +197,7 @@ export default {
}
})
if (parentProcessVal) {
parentProcessVal.categoryFlowDetails.forEach((item, index) => {
parentProcessVal.documentFlowDetails.forEach((item, index) => {
this.$set(this.form, `task${index + 1}`, item.postId)
this.selectJob(item.postId, index)
})
@ -237,24 +237,23 @@ export default {
if (valid) {
const detailsDTOs = this.taskList.map((item, index) => {
const json = {}
json.id = this.getEditInfoFlow && this.getEditInfoFlow.categoryFlowDetails.length !== 0 ? this.getEditInfoFlow.categoryFlowDetails[index].id : null
json.id = this.getEditInfoFlow && this.getEditInfoFlow.documentFlowDetails && this.getEditInfoFlow.documentFlowDetails.length !== 0 ? this.getEditInfoFlow.documentFlowDetails[index].id : null
json.postId = item.postId
json.taskId = item.nodeId
return json
})
const params = {
// 'categoryId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null,
'categoryId': this.selectedCategory.id,
'documentId': this.selectedCategory.pid !== '0' ? this.selectedCategory.id : null,
'detailsDTOs': detailsDTOs,
'flowId': this.selectFlowVal.modelId,
'flowName': this.selectFlowVal.deployName,
'flowKey': this.selectFlowVal.modelKey,
'flowManageId': this.setPocessCurrent.id,
'id': this.getEditInfoFlow && this.getEditInfoFlow.id,
'status': this.getEditInfoFlow && this.getEditInfoFlow.status
'status': this.getEditInfoFlow && this.getEditInfoFlow.status ? 1 : 0
}
console.log('params', params)
FetchFlowbinding(params).then((res) => {
FetchReDocumentFlowbinding(params).then((res) => {
if (res === 'SUCCESS') {
this.$message({ message: '操作成功', type: 'success', offset: 8 })
} else {

Loading…
Cancel
Save