23 changed files with 1558 additions and 53 deletions
@ -0,0 +1,389 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-03 13:39:16 |
|||
@ 备注: app专用列表内容展示 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { submitButton, afreshSubmitButton,editFormCont,draftSubmitButton,editLookFormCont } from "@/utils/workflow/const"; |
|||
import { json2string,objToStringify,string2json,stringToObj } from '@/utils/DesignForm/form' |
|||
import { gainTaskFormInfo,generateFlow,gainEditDataLog,draftsInitiateApproval,afreshRunWorkflow } from '@/api/taskapi/management' |
|||
import { Close } from '@element-plus/icons-vue' |
|||
import { judgeSubmitCancel,startRunFlow } from '@/api/DesignForm/requestapi' |
|||
import { submitButtonEs } from '@/api/DesignForm/tableButton' |
|||
|
|||
import RunFlowStep from '@/views/taskplatform/taskmanagement/runFlowStep.vue' |
|||
|
|||
|
|||
const props = defineProps({ |
|||
isShow:{ |
|||
type:Boolean, |
|||
default:false, |
|||
}, |
|||
drawerWith:{ |
|||
type:Number, |
|||
default:0 |
|||
}, |
|||
tablePageClass:{ |
|||
type:Number, |
|||
default:1 |
|||
}, |
|||
operState:{ |
|||
type:Number, |
|||
default:1 |
|||
}, |
|||
pageInfo:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}); |
|||
const formEl = ref<any>(); |
|||
const emits = defineEmits(["update:isShow","getPageData"]); |
|||
const formLoading = ref(false); |
|||
const flowAry = ref<any[]>(); //流程列表 |
|||
const currentProgress = ref<number>(1); //当前步进值 |
|||
const runstep = ref(null) |
|||
//表单ID |
|||
const openOfClose = computed({ |
|||
get() { |
|||
return props.isShow |
|||
}, |
|||
set(val: boolean) { |
|||
emits('update:isShow', val) |
|||
} |
|||
}); |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-03 14:09:24 |
|||
@ 功能: 监听状态变化处理数据 |
|||
*/ |
|||
watch(()=>props.isShow,(val:bool)=>{ |
|||
console.log("监听状态变化处理数据",props.pageInfo) |
|||
if(val){ |
|||
formLoading.value = true; |
|||
getCustomrrFormInfo(); |
|||
} |
|||
}) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-03 14:25:15 |
|||
@ 功能: 关闭抽屉 |
|||
*/ |
|||
const closeDrawer = () => { |
|||
emits('update:isShow', false) |
|||
} |
|||
|
|||
//表单相关内容 |
|||
const formState = reactive({ |
|||
formData: { |
|||
list: [], |
|||
form: {}, |
|||
config: {} |
|||
}, |
|||
dict: {}, |
|||
formId: props.pageInfo.idStr, |
|||
id: 1, |
|||
loading: true |
|||
}) |
|||
const pageLog = ref<any[]>([]) |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-03 14:33:15 |
|||
@ 功能: 获取自定义表单内容 |
|||
*/ |
|||
const getCustomrrFormInfo = () => { |
|||
gainTaskFormInfo({id:props.pageInfo.mastersKeyStr}) |
|||
.then(({data})=>{ |
|||
// console.log("获取自定义表单内容",data,data.structure) |
|||
formState.formData = stringToObj(data.structure.mastesform) |
|||
// console.log("获取自定义表单内容--->",formState) |
|||
formState.dict = string2json(data.structure.dict) |
|||
// formState.formData.list.push(editLookFormCont) |
|||
if(props.tablePageClass != 4){ |
|||
judgeSubmitCancel({"name":data.structure.mastesformjson}) |
|||
.then((data:any) =>{ |
|||
if(data.code == 0){ |
|||
if (data.data == 3 || data.data == 4){ |
|||
// formState.formData.list.push(submitButtonEs) |
|||
if(props.operState == 2){ |
|||
formState.formData.list.push(afreshSubmitButton) |
|||
}else if(props.operState == 3){ |
|||
formState.formData.list.push(editFormCont) |
|||
}else if(props.operState == 4){ |
|||
formState.formData.list.push(draftSubmitButton) |
|||
}else if(props.operState == 5){ |
|||
formState.formData.list.push(submitButtonEs) |
|||
} |
|||
} |
|||
} |
|||
}) |
|||
} |
|||
|
|||
|
|||
nextTick(()=>{ |
|||
// console.log("获取自定义表单内容-1111-->",data.tableData) |
|||
formEl.value.setValue(data.tableData) |
|||
}) |
|||
}) |
|||
.finally(()=>{ |
|||
formLoading.value = false; |
|||
gainEditDataLog({id:props.pageInfo.mastersKeyStr}) |
|||
.then(({data})=>{ |
|||
console.log("获取修改记录-1111-->",data) |
|||
pageLog.value = data.logAry |
|||
}); |
|||
}) |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-07 10:55:34 |
|||
@ 功能: 表单动作回调 |
|||
*/ |
|||
const afterSubmit = (type: string) => { |
|||
console.log("表单提交成功") |
|||
if (type === 'success') { |
|||
// router.go(-1) |
|||
// console.log("表单提交成功") |
|||
emits("getPageData"); |
|||
closeDrawer(); |
|||
|
|||
} |
|||
} |
|||
const closeAppSubmit = () => { |
|||
closeDrawer() |
|||
} |
|||
//流程执行 |
|||
const drawerBeforeClose = () => { |
|||
console.log("监听打开关闭",false) |
|||
// emits("getmytodolist") |
|||
// emits("update:isshow", false); |
|||
} |
|||
//提交审批 |
|||
const sendDraftSubmit = (type: string,val?:any) => { |
|||
console.log("提交审批",type,val) |
|||
// emits("getmytodolist") |
|||
if (type === 'success') { |
|||
if(props.pageInfo.types == 1){ |
|||
let sendInfo ={ |
|||
id:val.data.runFlowId, |
|||
flowList:flowAry.value, |
|||
state:3 |
|||
} |
|||
console.log("草稿提交审批--1-<",sendInfo) |
|||
draftsInitiateApproval(sendInfo) |
|||
.then((data:any) =>{ |
|||
console.log("草稿提交审批---<",sendInfo,data) |
|||
if(data.code == 0){ |
|||
ElMessage.success(data.msg || '提交成功!') |
|||
if(runstep.value){ |
|||
runstep.value.gainRunFlowTask() |
|||
} |
|||
emits("getPageData"); |
|||
closeDrawer() |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
} |
|||
//保存草稿箱(带流程) |
|||
const saveEditFormInfo = (type: string,val?:any) => { |
|||
console.log("草稿提交审批--1-<",type,val) |
|||
if(type == "success"){ |
|||
runstep.value.gainRunFlowTask() |
|||
emits("getPageData"); |
|||
closeDrawer() |
|||
} |
|||
} |
|||
|
|||
//重新提交审核 |
|||
const anewSubmit = (type: string,val?:any) => { |
|||
console.log("重新提交数据-22--<",type,val) |
|||
if(type == "success"){ |
|||
afreshRunWorkflow({id:val.data.runFlowId}) |
|||
.then((data:any) => { |
|||
console.log("重新提交数据---<",data,runstep.value) |
|||
runstep.value.gainRunFlowTask() |
|||
}) |
|||
.finally(() => { |
|||
emits("getPageData"); |
|||
closeDrawer() |
|||
}) |
|||
} |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-04-11 11:35:24 |
|||
@ 功能: 申请修改 |
|||
*/ |
|||
//修改完毕 |
|||
const submitEdit = (type: string,val?:any) => { |
|||
// console("修改完毕----->",type,val) |
|||
if(type == "success"){ |
|||
runstep.value.anewSubmit() |
|||
emits("getPageData"); |
|||
closeDrawer() |
|||
} |
|||
} |
|||
</script> |
|||
<template> |
|||
<el-drawer |
|||
v-model="openOfClose" |
|||
title="查看表单内容" |
|||
:size="drawerWith" |
|||
:with-header="false" |
|||
:close-on-click-modal="false" |
|||
:close-on-press-escape="false" |
|||
:destroy-on-close="true" |
|||
> |
|||
<div v-if="props.pageInfo.types==1" class="common-layout"> |
|||
|
|||
<el-container> |
|||
<el-main> |
|||
<ak-form |
|||
ref="formEl" |
|||
v-loading="formLoading" element-loading-text="Loading..." |
|||
:form-data="formState.formData" |
|||
:type="props.tablePageClass" |
|||
:dict="formState.dict" |
|||
request-url="getFormContent" |
|||
add-url="saveFormContent" |
|||
edit-url="editFormContent" |
|||
:before-submit="beforeSubmit" |
|||
:close-app-submit="closeDrawer" |
|||
:change-key-val="changeKeyVal" |
|||
:anew-submit = "anewSubmit" |
|||
:save-edit-form-info="saveEditFormInfo" |
|||
:send-draft-submit= "sendDraftSubmit" |
|||
:after-submit="afterSubmit" |
|||
:submit-edit="submitEdit" |
|||
/> |
|||
|
|||
<el-divider v-if="pageLog&&pageLog.length > 0" content-position="left">历史记录</el-divider> |
|||
<el-timeline style="width: 100%"> |
|||
<el-timeline-item v-for="(item,index) in pageLog" :key="index" :timestamp="item.time+' 操作人:'+item.creater" placement="top"> |
|||
<el-card> |
|||
<el-descriptions border> |
|||
<el-descriptions-item v-for="(mastItem,mastIndex) in item.masterdata" :key="mastIndex" :label="mastIndex"> |
|||
{{mastItem}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
<el-tabs v-if="item.sunList" type="border-card" style="margin-top:20px;"> |
|||
<el-tab-pane v-for="(sonItem,sonIndex) in item.sunList" :label="sonIndex" :key="sonIndex"> |
|||
<el-descriptions v-for="(sonVal,sonIndex) in sonItem" :key="sonIndex" border> |
|||
<el-descriptions-item v-for="(sonCentor,sonKey) in sonVal" :key="sonKey" :label="sonKey"> {{sonCentor}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
<table v-if="item.explicate!=''" style="margin-top:20px;"> |
|||
<tr> |
|||
<td class="biankuang" width="100">修改说明:</td> |
|||
<td class="biankuang">{{item.explicate}}</td> |
|||
</tr> |
|||
</table> |
|||
</el-card> |
|||
</el-timeline-item> |
|||
</el-timeline> |
|||
</el-main> |
|||
<el-aside width="350px" class="flowBox"> |
|||
<el-header height="30px"> |
|||
<div class="workFlowHead"> |
|||
<el-text>审批流程</el-text> |
|||
<el-icon @click="closeDrawer"><Close /></el-icon> |
|||
</div> |
|||
</el-header> |
|||
<el-scrollbar class="scorllbarBox"> |
|||
<RunFlowStep ref="runstep" v-model:flowary="flowAry" :flow-key="props.pageInfo.runFlowIdStr" :current-progress="currentProgress" @updatelist="drawerBeforeClose" /> |
|||
</el-scrollbar> |
|||
</el-aside> |
|||
|
|||
</el-container> |
|||
</div> |
|||
<div v-else class="common-layout"> |
|||
<el-header height="30px"> |
|||
<el-icon @click="closeDrawer"><Close /></el-icon> |
|||
</el-header> |
|||
<ak-form |
|||
ref="formEl" |
|||
v-loading="formLoading" element-loading-text="Loading..." |
|||
:form-data="formState.formData" |
|||
:type="props.tablePageClass" |
|||
:dict="formState.dict" |
|||
request-url="getFormContent" |
|||
add-url="saveFormContent" |
|||
edit-url="editFormContent" |
|||
:before-submit="beforeSubmit" |
|||
:close-app-submit="closeDrawer" |
|||
:change-key-val="changeKeyVal" |
|||
:anew-submit = "anewSubmit" |
|||
:after-submit="afterSubmit" |
|||
:save-edit-form-info="saveEditFormInfo" |
|||
:send-draft-submit= "sendDraftSubmit" |
|||
:submit-edit="submitEdit" |
|||
/> |
|||
<el-divider v-if="pageLog&&pageLog.length > 0" content-position="left">历史记录</el-divider> |
|||
<el-timeline style="width: 100%"> |
|||
<el-timeline-item v-for="(item,index) in pageLog" :key="index" :timestamp="item.time+' 操作人:'+item.creater" placement="top"> |
|||
<el-card> |
|||
<el-descriptions border> |
|||
<el-descriptions-item v-for="(mastItem,mastIndex) in item.masterdata" :key="mastIndex" :label="mastIndex"> |
|||
{{mastItem}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
<el-tabs v-if="item.sunList" type="border-card" style="margin-top:20px;"> |
|||
<el-tab-pane v-for="(sonItem,sonIndex) in item.sunList" :label="sonIndex" :key="sonIndex"> |
|||
<el-descriptions v-for="(sonVal,sonIndex) in sonItem" :key="sonIndex" border> |
|||
<el-descriptions-item v-for="(sonCentor,sonKey) in sonVal" :key="sonKey" :label="sonKey"> {{sonCentor}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
<table style="margin-top:20px;"> |
|||
<tr> |
|||
<td class="biankuang" width="100">修改说明:</td> |
|||
<td class="biankuang">{{item.explicate}}</td> |
|||
</tr> |
|||
</table> |
|||
</el-card> |
|||
</el-timeline-item> |
|||
</el-timeline> |
|||
</div> |
|||
</el-drawer> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.common-layout{ |
|||
height: 100vh; |
|||
padding: 0 15px; |
|||
.el-main{ |
|||
height: 100vh; |
|||
padding:0; |
|||
} |
|||
.flowBox{ |
|||
height: 100vh; |
|||
border-left: 1px solid #ccc; |
|||
.scorllbarBox{ |
|||
height: calc(100vh - 35px) |
|||
} |
|||
.workFlowHead{ |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
} |
|||
} |
|||
.el-header{ |
|||
padding:0 10px; |
|||
line-height:30px; |
|||
text-align:right; |
|||
font-size:20px; |
|||
i{ |
|||
cursor:pointer; |
|||
} |
|||
} |
|||
|
|||
} |
|||
.biankuang{ |
|||
border: 1px solid #D4D7DE; |
|||
padding:10px 10px; |
|||
} |
|||
</style> |
|||
File diff suppressed because one or more lines are too long
@ -0,0 +1,229 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-05-31 13:59:06 |
|||
@ 备注: 我创建的 |
|||
--> |
|||
<script lang='ts' setup> |
|||
|
|||
import { gainAppAllTaskList } from "@/api/DesignForm/requestapi" |
|||
|
|||
const props = defineProps({ |
|||
pickAppMenu:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
} |
|||
}); |
|||
|
|||
const selectInfo = reactive<taskflowquery>({ |
|||
page: 1, |
|||
pagesize: 20, |
|||
class:1, |
|||
id:props.pickAppMenu.appkey |
|||
}) |
|||
const loading = ref(false) |
|||
const searckFormRef = ref(ElForm); |
|||
const totals = ref<number>(0) //总共多少条记录 |
|||
const taskFlowAry = ref<any>([]) //记录数组 |
|||
//重置表单 |
|||
const resetQuery = () =>{ |
|||
searckFormRef.value.resetFields(); |
|||
initData(); |
|||
} |
|||
//初始化数据 |
|||
const initData = () =>{ |
|||
selectInfo.page = 1; |
|||
selectInfo.pagesize = 15; |
|||
selectInfo.title = "" |
|||
selectInfo.class = 3; |
|||
selectInfo.state = 0; |
|||
} |
|||
/** |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-06-07 09:28:35 |
|||
@ 功能: 加载数据 |
|||
*/ |
|||
const getToDoList = () =>{ |
|||
gainAppAllTaskList(selectInfo) |
|||
.then((data) =>{ |
|||
console.log("加载数据--->",data) |
|||
totals.value = data.data.total |
|||
taskFlowAry.value = data.data.list |
|||
}) |
|||
} |
|||
onMounted(() =>{ |
|||
getToDoList() |
|||
}) |
|||
</script> |
|||
<template> |
|||
<div ref="myappbox" class="app_box"> |
|||
<div class="app-container"> |
|||
<div class="search"> |
|||
<div class="titleBox"> |
|||
我创建的 |
|||
</div> |
|||
<el-form ref="searckFormRef" :model="selectInfo" :inline="true"> |
|||
<el-form-item label="任务标题" prop="name"> |
|||
<el-input |
|||
v-model="selectInfo.title" |
|||
placeholder="请输入任务标题" |
|||
clearable |
|||
@keyup.enter="searchQuery" |
|||
/> |
|||
</el-form-item> |
|||
<el-form-item> |
|||
<el-button type="primary" @click="getToDoList()"><i-ep-search />搜索</el-button> |
|||
<el-button @click="resetQuery()"><i-ep-refresh />重置</el-button> |
|||
</el-form-item> |
|||
</el-form> |
|||
</div> |
|||
<el-card shadow="never"> |
|||
<el-table |
|||
v-loading="loading" |
|||
element-loading-text="Loading..." |
|||
highlight-current-row |
|||
:data="taskFlowAry" |
|||
border |
|||
class="table_box" |
|||
> |
|||
<el-table-column fixed label="标题" prop="title" width="500" /> |
|||
<el-table-column label="创建人" prop="creater" width="200"> |
|||
<template #default="scope"> |
|||
{{ scope.row.createrInfo.name }}(<el-text type="info">{{ scope.row.createrInfo.number }}</el-text>) |
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column label="发起日期" prop="createrTimeStr" align="center" width="300" /> |
|||
<el-table-column label="状态" prop="status" align="center" width="220" > |
|||
|
|||
<template #default="scope"> |
|||
<el-tag |
|||
v-if="scope.row.status==1" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
草稿 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else-if="scope.row.status==2&&scope.row.types==1" |
|||
type="danger" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
驳回 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else-if="scope.row.status==2&&scope.row.types!=1" |
|||
type="danger" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
发表 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else-if="scope.row.status==3" |
|||
type="success" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
审批中 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else-if="scope.row.status==4" |
|||
type="info" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
归档 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else |
|||
type="info" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
删除 |
|||
</el-tag> |
|||
</template> |
|||
|
|||
</el-table-column> |
|||
<el-table-column label="任务性质" prop="currentStep" width="200" align="center"> |
|||
<template #default="scope"> |
|||
<el-tag |
|||
v-if="scope.row.types==1" |
|||
type="danger" |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
流程任务 |
|||
</el-tag> |
|||
<el-tag |
|||
v-else |
|||
class="mx-1" |
|||
effect="plain" |
|||
round |
|||
> |
|||
普通任务 |
|||
</el-tag> |
|||
|
|||
</template> |
|||
</el-table-column> |
|||
<el-table-column fixed="right" align="center" label="操作" width="100" > |
|||
<template #default="scope"> |
|||
<el-tooltip |
|||
class="box-item" |
|||
effect="dark" |
|||
content="查看详情" |
|||
placement="top-end" |
|||
> |
|||
<el-button type="primary" size="small" class="fa fa-eye" @click="lookFlowInfo(scope.row,3)" /> |
|||
</el-tooltip> |
|||
</template> |
|||
</el-table-column> |
|||
</el-table> |
|||
<pagination |
|||
v-model:total="totals" |
|||
v-model:page="selectInfo.page" |
|||
v-model:limit="selectInfo.pagesize" |
|||
@pagination="getToDoList" |
|||
/> |
|||
</el-card> |
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
</div> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.app_box{ |
|||
width:100%; |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
.search{ |
|||
display: flex; |
|||
align-items: center; |
|||
justify-content: space-between; |
|||
} |
|||
.titleBox{ |
|||
font-size: 20px; |
|||
margin-top: -20px; |
|||
} |
|||
} |
|||
.box-card { |
|||
width: 100%; |
|||
} |
|||
.table_box{ |
|||
width: 100%; |
|||
height: calc(100vh - 260px); |
|||
} |
|||
</style> |
|||
@ -0,0 +1,218 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-06-17 15:30:36 |
|||
@ 备注: App执行任务 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import { submitButton, afreshSubmitButton,editFormCont,draftSubmitButton,editLookFormCont } from "@/utils/workflow/const"; |
|||
import { |
|||
json2string, |
|||
objToStringify, |
|||
string2json, |
|||
stringToObj |
|||
} from '@/utils/DesignForm/form' |
|||
|
|||
import { haveCustomerFormVersion,generateFlow,gainTaskFormInfo,gainEditDataLog } from '@/api/taskapi/management' |
|||
|
|||
import RunFlowStepApp from '@/views/taskplatform/taskmanagement/runFlowStepApp.vue' |
|||
|
|||
import { judgeSubmitCancel,startRunFlow,afreshRunFlow,onlyPublishFlow,gainEditFormFlowInfo } from '@/api/DesignForm/requestapi' |
|||
|
|||
|
|||
import FlowStep from '@/views/taskplatform/taskmanagement/flowStep.vue' |
|||
|
|||
const props = defineProps({ |
|||
isshow:{ |
|||
type:Boolean, |
|||
default:true |
|||
}, |
|||
drawerWith:{ |
|||
type:Number, |
|||
default:0 |
|||
}, |
|||
flowLogInfo:{ |
|||
type:Object, |
|||
default(){ |
|||
return {} |
|||
} |
|||
}, |
|||
operState:{ |
|||
type:Number, |
|||
default:1 |
|||
} |
|||
}) |
|||
const flowAry = ref<any[]>(); |
|||
const emits = defineEmits(["update:isshow","getmytodolist"]); |
|||
const isOpen = computed({ |
|||
get: () => props.isshow, |
|||
set: (val) => { |
|||
emits("update:isshow", val); |
|||
}, |
|||
}); |
|||
const logistrue = ref(false) |
|||
const formLoading = ref(false) |
|||
const loadingData = ref(false) //加载表单数据 |
|||
const flowLoading = ref(false) //加载流程数据 |
|||
const versiontitle = ref<any>("") |
|||
const flowMap = ref<any>() |
|||
const nextStep = ref(0) |
|||
const nodeKey = ref<string>(''); |
|||
const currentProgress = ref<number>(1); |
|||
const newLogAry = ref<any>("") |
|||
const oldLogAry = ref<any>("") |
|||
const newDataLen = ref<number>(0); |
|||
//表单相关内容 |
|||
const formState = reactive({ |
|||
formData: { |
|||
list: [], |
|||
form: {}, |
|||
config: {} |
|||
}, |
|||
dict: {}, |
|||
formId: 25, |
|||
id: 1, |
|||
loading: true |
|||
}) |
|||
const formEl = ref<any>() |
|||
const drawerBeforeClose = () => { |
|||
console.log("监听打开关闭",false) |
|||
emits("getmytodolist") |
|||
emits("update:isshow", false); |
|||
} |
|||
|
|||
onMounted(()=>{ |
|||
versiontitle.value = props.flowLogInfo.title |
|||
flowMap.value = JSON.parse(props.flowLogInfo.flowcont) |
|||
console.log("监听打开关闭",props.flowLogInfo) |
|||
gainFormData() |
|||
}) |
|||
const pageLog = ref<any[]>([]) |
|||
//获取表单内容 |
|||
const gainFormData = () =>{ |
|||
formLoading.value = true; |
|||
console.log("获取表单内容--->",props.flowLogInfo) |
|||
nextStep.value = props.flowLogInfo.nextStep |
|||
nodeKey.value = props.flowLogInfo.nodeKey; |
|||
currentProgress.value = props.flowLogInfo.currentStep |
|||
console.log("props.flowLogInfo--5-------->",props.flowLogInfo.mastesform) |
|||
formState.formData = stringToObj(props.flowLogInfo.mastesform) |
|||
|
|||
gainTaskFormInfo({ id: props.flowLogInfo.mastersKeyStr}) |
|||
.then((data:any)=>{ |
|||
if(data.data.logistrue){ |
|||
formState.formData.list.push(editLookFormCont) |
|||
} |
|||
console.log("res----获得数据回显------->",data) |
|||
formEl.value.setValue(data.data.masterDataInfo) |
|||
newLogAry.value = data.data.newData |
|||
oldLogAry.value = data.data.oldData |
|||
logistrue.value = data.data.logistrue |
|||
newDataLen.value = data.data.newDataLen |
|||
formLoading.value = false; |
|||
nextTick(()=>{ |
|||
console.log("获取自定义表单内容-1111-->",data.data.tableData) |
|||
formEl.value.setValue(data.data.tableData) |
|||
}) |
|||
}) |
|||
.finally(()=>{ |
|||
formLoading.value = false; |
|||
gainEditDataLog({id:props.flowLogInfo.mastersKeyStr}) |
|||
.then(({data})=>{ |
|||
console.log("获取修改记录-1111-->",data) |
|||
pageLog.value = data.logAry |
|||
}); |
|||
}) |
|||
// haveCustomerFormVersion({id:props.flowLogInfo.version_id.toString()}) |
|||
// .then(({ data }) =>{ |
|||
|
|||
// formState.dict = string2json(data.dict) |
|||
// judgeSubmitCancel({"name":data.mastesformjson}) |
|||
// .then((dataBut:any) =>{ |
|||
// if(dataBut.code == 0){ |
|||
// formState.formData.list.push(afreshSubmitButton) |
|||
// // console.log("res----判断按钮------->",dataBut,props.operState) |
|||
// // if (dataBut.data == 3 || dataBut.data == 4){ |
|||
// // formInfo.formData.list.push(editFormCont) |
|||
// // } |
|||
// } |
|||
// }) |
|||
// }) |
|||
// .finally(() => { |
|||
// formLoading.value = false; |
|||
|
|||
// formEl |
|||
// }) |
|||
} |
|||
</script> |
|||
<template> |
|||
<el-drawer v-model="isOpen" v-loading="loadingData" element-loading-my-text="Loading..." :title="versiontitle" :close-on-click-modal="false" :close-on-press-escape="false" :destroy-on-close="true" :size="props.drawerWith" class="drawerClass" :before-close="drawerBeforeClose"> |
|||
<table border="0" class="tableFlowBox"> |
|||
<tr> |
|||
<td valign="top"> |
|||
<div class="drawerFormBox boxLeft"> |
|||
<ak-form |
|||
ref="formEl" |
|||
v-loading="formLoading" element-loading-text="Loading..." |
|||
:form-data="formState.formData" |
|||
:type="formType" |
|||
:dict="formState.dict" |
|||
request-url="getFormContent" |
|||
add-url="saveFormContent" |
|||
edit-url="editFormContent" |
|||
:before-submit="beforeSubmit" |
|||
:close-app-submit="closeAppSubmit" |
|||
:change-key-val="changeKeyVal" |
|||
:anew-submit = "anewSubmit" |
|||
:save-edit-form-info="saveEditFormInfo" |
|||
:send-draft-submit= "sendDraftSubmit" |
|||
/> |
|||
<el-divider v-if="pageLog&&pageLog.length > 0" content-position="left">历史记录</el-divider> |
|||
<el-timeline> |
|||
<el-timeline-item v-for="(item,index) in pageLog" :key="index" :timestamp="item.time+' 操作人:'+item.creater" placement="top"> |
|||
<el-card> |
|||
<el-descriptions border> |
|||
<el-descriptions-item v-for="(mastItem,mastIndex) in item.masterdata" :key="mastIndex" :label="mastIndex"> |
|||
{{mastItem}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
<el-tabs v-if="item.sunList" type="border-card" style="margin-top:20px;"> |
|||
<el-tab-pane v-for="(sonItem,sonIndex) in item.sunList" :label="sonIndex" :key="sonIndex"> |
|||
<el-descriptions v-for="(sonVal,sonIndex) in sonItem" :key="sonIndex" border> |
|||
<el-descriptions-item v-for="(sonCentor,sonKey) in sonVal" :key="sonKey" :label="sonKey"> {{sonCentor}} |
|||
</el-descriptions-item> |
|||
</el-descriptions> |
|||
</el-tab-pane> |
|||
</el-tabs> |
|||
<table style="margin-top:20px;"> |
|||
<tr> |
|||
<td class="biankuang" width="100">修改说明:</td> |
|||
<td class="biankuang">{{item.explicate}}</td> |
|||
</tr> |
|||
</table> |
|||
</el-card> |
|||
|
|||
|
|||
</el-timeline-item> |
|||
|
|||
|
|||
|
|||
</el-timeline> |
|||
|
|||
|
|||
</div> |
|||
|
|||
</td> |
|||
<td valign="top" width="350"> |
|||
<RunFlowStepApp ref="runstep" v-model:flowary="flowAry" :flow-key="props.flowLogInfo.idStr" :current-progress="currentProgress" @updatelist="drawerBeforeClose" /> |
|||
</td> |
|||
</tr> |
|||
</table> |
|||
|
|||
</el-drawer> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.biankuang{ |
|||
border: 1px solid #D4D7DE; |
|||
padding:10px 10px; |
|||
} |
|||
</style> |
|||
@ -0,0 +1,249 @@ |
|||
<!-- |
|||
@ 作者: 秦东 |
|||
@ 时间: 2024-06-17 15:39:17 |
|||
@ 备注: 审批设置 |
|||
--> |
|||
<script lang='ts' setup> |
|||
import SvgIcon from "@/components/SvgIcon/index.vue"; |
|||
import OrgUserPage from "@/views/public/orguser/orguser.vue" |
|||
import OrgAllUserPage from "@/views/public/orguser/orgalluser.vue" |
|||
import { authorizeWorkflow,runTaskFlow } from '@/api/taskapi/management' |
|||
|
|||
// import { nodeFlow,conditionInfo,nodelPeoples } from '@/api/taskapi/types' |
|||
import { gainRunTaskFlow,submitApprovalResults } from '@/api/DesignForm/requestapi' |
|||
//引入图标 |
|||
import squareUrlOne from "@/assets/images/1.png" |
|||
import squareUrlTwo from "@/assets/images/2.png" |
|||
|
|||
const state = reactive({ |
|||
circleUrl:squareUrlTwo, |
|||
squareUrl: squareUrlOne, |
|||
sizeList: ['small', '', 'large'] as const, |
|||
}) |
|||
const { circleUrl, squareUrl, sizeList } = toRefs(state) |
|||
|
|||
const props = defineProps({ |
|||
flowKey:{ |
|||
type:String, |
|||
default:"" |
|||
}, |
|||
currentProgress:{ |
|||
type:Number, |
|||
default:0 |
|||
} |
|||
}) |
|||
|
|||
const emits = defineEmits(["update:flowary","updatelist"]); |
|||
|
|||
const flowLoading = ref(false) |
|||
const openOrClose = ref(false) //开启指定人员选择 |
|||
const openclosebox = ref(false) //开启全部人员选择 |
|||
const presetPersonnel = ref<any>([]); //预设选择人 |
|||
const selectedPeople = ref<any>([]); //已选择人 |
|||
const flowOpinion = ref(false) //是否可以写评论 |
|||
const currentStep = ref<number>(props.currentProgress) |
|||
|
|||
const flowMaps = ref<any[]>(); |
|||
|
|||
//获取任务流程 |
|||
const gainRunFlowTask = () =>{ |
|||
flowLoading.value = true |
|||
let sendInfo = { |
|||
id:props.flowKey |
|||
} |
|||
gainRunTaskFlow(sendInfo) |
|||
.then((data:any) =>{ |
|||
console.log("获取流程--获取任务流程--->",data) |
|||
flowMaps.value = data.data.flowList |
|||
flowOpinion.value = data.data.operational |
|||
currentStep.value = data.data.current_step |
|||
emits("update:flowary", data.data.flowList); |
|||
}) |
|||
.finally(()=>{ |
|||
flowLoading.value = false |
|||
}) |
|||
} |
|||
//组件渲染之前 |
|||
onBeforeMount(()=>{ |
|||
gainRunFlowTask(); |
|||
}) |
|||
//组件渲染完毕 |
|||
onMounted(()=>{ |
|||
|
|||
}) |
|||
//判断是否可以添加人员 |
|||
const judgeAddUser = (val:any):boolean =>{ |
|||
console.log("获取流程----1111->",val.judgelist) |
|||
if(val.judgelist){ |
|||
return true |
|||
} |
|||
return false |
|||
} |
|||
let zhiXingStep = 1; |
|||
//添加操作人 |
|||
const addPeople = (val:any) =>{ |
|||
zhiXingStep = val.step |
|||
presetPersonnel.value = val.pendpers |
|||
selectedPeople.value = val.operator |
|||
if(val.runscope == 1){ |
|||
openclosebox.value = true |
|||
}else{ |
|||
openOrClose.value = true |
|||
} |
|||
} |
|||
//更新节点操作人 |
|||
const updateNode = (val:any) =>{ |
|||
|
|||
if(flowMaps.value&& flowMaps.value.length > 0){ |
|||
|
|||
flowMaps.value.forEach((item:any) =>{ |
|||
if(item.step == zhiXingStep){ |
|||
item.operator = val |
|||
} |
|||
}) |
|||
} |
|||
} |
|||
const sendFlowInfo = ref<string>() //审批意见 |
|||
//提交审批 |
|||
const yesOrNo = (val:string,agreeOrRefuse:number) =>{ |
|||
console.log("提交审批----1111->",val,agreeOrRefuse,sendFlowInfo.value) |
|||
let sendInfo = { |
|||
id:props.flowKey, |
|||
agreeOrRefuse:agreeOrRefuse, |
|||
suggest:sendFlowInfo.value, |
|||
flowlist:flowMaps.value |
|||
} |
|||
runTaskFlow(sendInfo) |
|||
.then((data:any)=>{ |
|||
|
|||
// console.log("提交审批----22222->",data) |
|||
ElMessage({ |
|||
message: '处理完成!', |
|||
type: 'success' |
|||
}) |
|||
|
|||
}) |
|||
.finally(()=>{ |
|||
gainRunFlowTask(); |
|||
emits("updatelist"); |
|||
}) |
|||
|
|||
} |
|||
defineExpose({gainRunFlowTask}) |
|||
</script> |
|||
<template> |
|||
<div class="drawerFormBox boxRight"> |
|||
<div class="flowBox"> |
|||
<!-- <el-affix :offset="20" style="width:100%"> |
|||
<el-text size="large">审批流程</el-text> |
|||
</el-affix> --> |
|||
|
|||
<el-steps v-loading="flowLoading" element-loading-text="Loading..." direction="vertical" :active="currentStep"> |
|||
<el-step v-for="item in flowMaps" :key="item.step"> |
|||
<template #title> |
|||
{{ item.nodeName }}<span v-if="item.examinemode==1"> ● 依次审批</span><span v-if="item.examinemode==2"> ● 会签</span><span v-if="item.examinemode==3"> ● 或签</span> |
|||
</template> |
|||
<template #description> |
|||
<table> |
|||
<tr v-for="items in item.operator" :key="items.id"> |
|||
<td valign="top" align="center" width="50"> |
|||
<el-avatar v-if="items.iconbase64==''&&items.icon!=''" shape="square" fit="cover" :src="items.icon" /> |
|||
<el-avatar v-else-if="items.iconbase64!=''" shape="square" fit="cover" :src="items.iconbase64" /> |
|||
<el-avatar v-else shape="square" fit="cover" :src="squareUrl" /> |
|||
</td> |
|||
<td valign="top" align="left"> |
|||
<el-row> |
|||
<el-col :span="24"> |
|||
<el-text>{{ items.departmentname }}</el-text> |
|||
<el-text><span v-if="items.departmentname"> - </span>{{ items.postname }}</el-text> |
|||
<el-text><span v-if="items.departmentname||items.postname"> - </span>{{ items.name }}</el-text> |
|||
</el-col> |
|||
<el-col :span="24"> |
|||
<ul> |
|||
<li v-for="(logItem,logIndex) in items.log" :key="logIndex" class="logLi"> |
|||
<el-text v-if="logItem.state==2" type="success"> |
|||
<span v-if="logItem.cause">{{logItem.cause}}</span><span v-else>已同意</span> |
|||
</el-text> |
|||
<el-text v-else-if="logItem.state==3" type="danger"> |
|||
<span v-if="logItem.cause">{{logItem.cause}}</span><span v-else>已驳回</span> |
|||
</el-text> |
|||
<el-text v-else-if="logItem.state==4" type="primary"> |
|||
<span v-if="logItem.cause">{{logItem.cause}}</span><span v-else>已查看</span> |
|||
</el-text> |
|||
<el-text v-else> |
|||
<span v-if="logItem.cause">{{logItem.cause}}</span><span v-else>未操作</span> |
|||
</el-text> · {{ logItem.time }} |
|||
</li> |
|||
</ul> |
|||
</el-col> |
|||
</el-row> |
|||
</td> |
|||
</tr> |
|||
<tr> |
|||
<td> |
|||
<div v-if="item.judgelist" class="addUser" @click="addPeople(item)"> |
|||
<svg-icon icon-class="addxuxian" size="50" /> |
|||
</div> |
|||
</td> |
|||
<td></td> |
|||
</tr> |
|||
</table> |
|||
</template> |
|||
</el-step> |
|||
</el-steps> |
|||
</div> |
|||
<el-affix v-if="flowOpinion" position="bottom" :offset="0"> |
|||
<div class="approvalBoard"> |
|||
<el-text size="large" class="appBoardTitle">审批意见</el-text> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="24"> |
|||
<el-input |
|||
v-model="sendFlowInfo" |
|||
:autosize="{ minRows: 2, maxRows: 6 }" |
|||
type="textarea" |
|||
placeholder="请输入审批意见" |
|||
/> |
|||
</el-col> |
|||
</el-row> |
|||
<el-row :gutter="20"> |
|||
<el-col :span="4"></el-col> |
|||
<el-col :span="8" class="juzhong"><el-button type="primary" style="width:100%" @click="yesOrNo(props.flowKey,1)">同意</el-button></el-col> |
|||
<el-col :span="8" class="juzhong"><el-button type="danger" style="width:100%" @click="yesOrNo(props.flowKey,2)">驳回</el-button></el-col> |
|||
<el-col :span="4"></el-col> |
|||
</el-row> |
|||
</div> |
|||
</el-affix> |
|||
|
|||
|
|||
<OrgUserPage v-if="openOrClose" v-model:openclose="openOrClose" :preset-personnel="presetPersonnel" :selected-people="selectedPeople" @update-node="updateNode" /> |
|||
<OrgAllUserPage v-if="openclosebox" v-model:openclosebox="openclosebox" :selected-people="selectedPeople" @update-node="updateNode" /> |
|||
</div> |
|||
</template> |
|||
<style lang='scss' scoped> |
|||
.drawerFormBox{ |
|||
width: 100%; |
|||
height: 100%; |
|||
} |
|||
.boxRight{ |
|||
overflow: hidden; |
|||
overflow-y: auto; |
|||
border-left: 1px solid #EEEEEE; |
|||
} |
|||
.flowBox{ |
|||
width: 100%; |
|||
padding: 0 5px 0 10px; |
|||
} |
|||
.approvalBoard{ |
|||
padding: 5px 10px; |
|||
background-color: #FFFFFF; |
|||
border-top: 1px solid #EEEEEE; |
|||
.juzhong{ |
|||
padding: 10px 0; |
|||
text-align: center; |
|||
} |
|||
.appBoardTitle{ |
|||
padding: 5px 0 10px 0; |
|||
display: block; |
|||
} |
|||
} |
|||
</style> |
|||
Loading…
Reference in new issue