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 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> <template>
<div class="process-container"> <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> <p>{{ item.flowName }}<i class="iconfont icon-shezhi" @click="toProcessSelected(item)" /></p>
<el-switch v-model="item.status" class="isEnable-chapter" @change="changeCategoryState(item)" /> <el-switch v-model="item.status" class="isEnable-chapter" @change="changeCategoryState(item)" />
</div> </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> </div>
</template> </template>
<script> <script>
import { FetchInitCategoryFlowBase, FetchInitFlowByCategoryId, FetchChangeCategoryState, FetchgetCategoryFlow } from '@/api/system/category/process'
import { FetchReDocumentInitFlowByCategoryId, FetchReDocumentChangeCategoryState } from '@/api/system/category/process'
import eForm from './module/form' import eForm from './module/form'
export default { export default {
name: 'ProcessManage', name: 'ProcessManage',
@ -25,93 +25,50 @@ export default {
}, },
data() { data() {
return { return {
flowBaseList: [],
flowSetting: [], flowSetting: [],
editInfoFlow: null 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() { mounted() {
this.getInitCategoryFlowBase()
this.getReDocumentInitFlowByCategoryId()
}, },
methods: { 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 { return {
...item, ...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 => { }).catch(err => {
console.log(err) console.log(err)
}) })
}, },
toProcessSelected(item) { 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) { changeCategoryState(item) {
const filterItem = this.flowSetting.find(v => item.id === v.flowManageId)
const params = { const params = {
'categoryId': this.selectedCategory.id, 'categoryId': this.selectedCategory.id,
'id': filterItem.id,
'id': item.id,
'status': item.status ? 1 : 0 'status': item.status ? 1 : 0
} }
FetchChangeCategoryState(params).then((res) => {
FetchReDocumentChangeCategoryState(params).then((res) => {
if (res === 'SUCCESS') { if (res === 'SUCCESS') {
this.$message({ message: '操作成功', type: 'success', offset: 8 }) this.$message({ message: '操作成功', type: 'success', offset: 8 })
} else { } else {
@ -120,14 +77,6 @@ export default {
}).catch(err => { }).catch(err => {
console.log(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> <script>
import { FetchInitFlowAll, FetchFindFolwImgByModelId, FetchUserTaskAllByDeployId } from '@/api/system/flowable' import { FetchInitFlowAll, FetchFindFolwImgByModelId, FetchUserTaskAllByDeployId } from '@/api/system/flowable'
import { FetchPostAll, FetchFindUserByPost } from '@/api/system/job' import { FetchPostAll, FetchFindUserByPost } from '@/api/system/job'
import { FetchFlowbinding } from '@/api/system/category/process'
import { FetchReDocumentFlowbinding } from '@/api/system/category/process'
export default { export default {
props: { props: {
@ -175,7 +175,7 @@ export default {
}, },
selectModel(val, parentProcessVal) { selectModel(val, parentProcessVal) {
if (!parentProcessVal) { if (!parentProcessVal) {
this.getEditInfoFlow.categoryFlowDetails = []
this.getEditInfoFlow.documentFlowDetails = []
} }
this.selectFlowVal = val this.selectFlowVal = val
@ -197,7 +197,7 @@ export default {
} }
}) })
if (parentProcessVal) { if (parentProcessVal) {
parentProcessVal.categoryFlowDetails.forEach((item, index) => {
parentProcessVal.documentFlowDetails.forEach((item, index) => {
this.$set(this.form, `task${index + 1}`, item.postId) this.$set(this.form, `task${index + 1}`, item.postId)
this.selectJob(item.postId, index) this.selectJob(item.postId, index)
}) })
@ -237,24 +237,23 @@ export default {
if (valid) { if (valid) {
const detailsDTOs = this.taskList.map((item, index) => { const detailsDTOs = this.taskList.map((item, index) => {
const json = {} 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.postId = item.postId
json.taskId = item.nodeId json.taskId = item.nodeId
return json return json
}) })
const params = { 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, 'detailsDTOs': detailsDTOs,
'flowId': this.selectFlowVal.modelId, 'flowId': this.selectFlowVal.modelId,
'flowName': this.selectFlowVal.deployName, 'flowName': this.selectFlowVal.deployName,
'flowKey': this.selectFlowVal.modelKey, 'flowKey': this.selectFlowVal.modelKey,
'flowManageId': this.setPocessCurrent.id, 'flowManageId': this.setPocessCurrent.id,
'id': this.getEditInfoFlow && this.getEditInfoFlow.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) console.log('params', params)
FetchFlowbinding(params).then((res) => {
FetchReDocumentFlowbinding(params).then((res) => {
if (res === 'SUCCESS') { if (res === 'SUCCESS') {
this.$message({ message: '操作成功', type: 'success', offset: 8 }) this.$message({ message: '操作成功', type: 'success', offset: 8 })
} else { } else {

Loading…
Cancel
Save