@@ -2,17 +2,14 @@
< div v-loading = "loading||detailLoading" >
< div class = "drawer-head" >
< div class = "cell-title" >
< div v-if = "pListData && pListData.procInstId" >
< p class = "title" > 审核工具 < / p >
< / div >
< div v-else > 新增工具 < / div >
< p class = "title" > 工具发布 < / p >
< / div >
< div class = "cell-btn" >
< el-button type = "primary" v-if = "pListData && pListData.procInstId" @click="handleMonitor" > 流程监控 < / el -button >
< el-button v-if = "editStatus && pListData.procInstId " type="danger " @click="deleteForm " > 删除 < / el -button >
< el-button v-if = "( editStatus || workflowStatus) " type="primary" @click="submitForm " > 提交 < / el -button >
< el-button v-if = "editStatus" type="primary " @click="sav eForm" > 保存 < / el -button >
< el-button @click ="close" > 关闭 < / el -button >
< el-button type = "primary" v-if = "pListData && pListData.procInstId" @click="handleMonitor" icon="el-icon-data-line" > 流程监控 < / el -button >
< el-button v-if = "( editStatus || workflowStatus) " type="primary " @click="submitForm" icon="el-icon-finished " > 提交 < / el -button >
< el-button v-if = "editStatus && !pListData.procInstId " type="primary" @click="saveForm" icon="el-icon-check " > 暂存 < / el -button >
< el-button v-if = "editStatus && pListData.procInstId " type="danger " @click="delet eForm" icon="el-icon-close" > 撤销 < / el -button >
< el-button @click ="close" icon = "el-icon-close" > 关闭 < / el-button>
< / div >
< / div >
< template v-if = "attributeModelBool('approve') && workflowStatus" >
@@ -306,7 +303,7 @@ import {
import WorkflowLogs from '@/views/workflowList/workflowLogs/index.vue'
import AddDoc from '@/views/tool/AddDoc.vue'
import Treeselect from '@riophae/vue-treeselect'
import { deptTreeSelect } from " @/api/system/user" ;
import { addUser , deptTreeSelect, updateUser } from ' @/api/system/user'
import { addTool , checkToolExist , getInfoByBpmcId , updateTool } from '@/api/tool/tool'
import blUserSelector from '@/components/user-selector/src/user-selector.vue'
import ToolSelector from '@/components/tool-selector/index.vue'
@@ -576,67 +573,71 @@ export default {
//不需要验证必填的保存
saveForm ( ) {
let _this = this
if ( ! _this . procDefKey ) {
_this . $message . warning ( "尚未进行流程设置,将无法发起流程!" ) ;
return ;
}
_this . loading = true
let formData = JSON . parse ( JSON . stringify ( _this . form ) )
formData . recordStatus = "draft" ;
formData . editStatus = _this . editStatus
formData . association = JSON . stringify ( _this . form . association )
if ( formData . toolId ) {
this . $set ( formData , 'documentList' , _this . docList )
updateTool ( formData ) .then ( ( res ) => {
if ( res . code === 200 ) {
_this . $message ( {
message : '保存成功' , //提示的信息
type : 'success' , //类型是成功
duration : 1200 , //显示时间, 毫秒。设为 0 则不会自动关闭, 建议1200
_this . $refs [ "eForm" ] . validate ( valid => {
if ( valid ) {
if ( ! _this . procDefKey ) {
_this . $message . warning ( "尚未进行流程设置,将无法发起流程!" ) ;
return ;
}
_this . loading = true
let formData = JSON . parse ( JSON . stringify ( _this . form ) )
formData . recordStatus = "draft" ;
formData . editStatus = _this . editStatus
formData . association = JSON . stringify ( _this . form . association )
if ( formData . toolId ) {
this . $set ( formData , 'documentList' , _this . docList )
updateTool ( formData ) . then ( ( res ) => {
if ( res . code === 200 ) {
_this . $message ( {
message : '保存成功' , //提示的信息
type : 'success' , //类型是成功
duration : 1200 , //显示时间, 毫秒。设为 0 则不会自动关闭, 建议1200
} ) ;
}
} ) . finally ( ( ) => {
_this . loading = false
} ) ;
} else {
let wf _receivers = [ ] ;
wf _receivers . push ( {
receiveUserId : _this . userInfo . userName ,
receiveUserOrgId : _this . userInfo . deptId
} ) ;
let wf _procTitle = "【工具发布】" + ( formData . toolName ? formData . toolName : "" )
formData . bpmClientInputModel = {
model : {
wf _procDefId : _this . pListData . procDefId ,
wf _procDefKey : _this . procDefKey ,
wf _procTitle : wf _procTitle ,
wf _sendUserId : _this . userInfo . userName ,
wf _sendUserOrgId : _this . userInfo . deptId ,
wf _receivers : wf _receivers ,
wf _curActDefName : _this . pListData . actDefName ,
wf _curActDefId : _this . pListData . actDefId ,
wf _nextActDefName : _this . pListData . actDefName ,
wf _nextActDefId : _this . pListData . actDefId ,
} ,
type : formData . type ,
review : _this . attributeModelBool ( 'approve' ) ,
} ;
formData . editStatus = _this . editStatus
this . $set ( formData , 'documentList' , _this . docList )
addTool ( formData ) . then ( ( res ) => {
if ( res . code === 200 ) {
_this . form . toolId = res . data . businessKey ;
_this . procInstInfoAndStatus ( res . data . procInstId )
_this . $message ( {
message : '保存成功' , //提示的信息
type : 'success' , //类型是成功
duration : 1200 , //显示时间, 毫秒。设为 0 则不会自动关闭, 建议1200
} ) ;
}
} ) . finally ( ( ) => {
_this . loading = false
} ) ;
}
} ) . finally ( ( ) => {
_this . loading = false
} ) ;
} else {
let wf _receivers = [ ] ;
wf _receivers . push ( {
receiveUserId : _this . userInfo . userName ,
receiveUserOrgId : _this . userInfo . deptId
} ) ;
let wf _procTitle = "【工具发布】" + ( formData . toolName ? formData . toolName : "" )
formData . bpmClientInputModel = {
model : {
wf _procDefId : _this . pListData . procDefId ,
wf _procDefKey : _this . procDefKey ,
wf _procTitle : wf _procTitle ,
wf _sendUserId : _this . userInfo . userName ,
wf _sendUserOrgId : _this . userInfo . deptId ,
wf _receivers : wf _receivers ,
wf _curActDefName : _this . pListData . actDefName ,
wf _curActDefId : _this . pListData . actDefId ,
wf _nextActDefName : _this . pListData . actDefName ,
wf _nextActDefId : _this . pListData . actDefId ,
} ,
type : formData . type ,
review : _this . attributeModelBool ( 'approve' ) ,
} ;
formData . editStatus = _this . editStatus
this . $set ( formData , 'documentList' , _this . docList )
addTool ( formData ) . then ( ( res ) => {
if ( res . code === 200 ) {
_this . form . toolId = res . data . businessKey ;
_this . procInstInfoAndStatus ( res . data . procInstId )
_this . $message ( {
message : '保存成功' , //提示的信息
type : 'success' , //类型是成功
duration : 1200 , //显示时间, 毫秒。设为 0 则不会自动关闭, 建议1200
} ) ;
}
} ) . finally ( ( ) => {
_this . loading = false
} ) ;
}
}
} ) ;
} ,
deleteForm ( ) {
let _this = this