Browse Source

Merge branch 'v3'

liwenxuan_v2
超级管理员 2 years ago
parent
commit
4a0f01deb8
  1. 9
      src/api/matrixapi/type.ts
  2. 20
      src/components/workflow/addNode.vue
  3. 215
      src/components/workflow/dialog/matrix.vue
  4. 51
      src/components/workflow/drwer/approverDrawer.vue
  5. 12
      src/utils/workflow/index.ts
  6. 2
      src/views/sysworkflow/codepage/index.vue
  7. 34
      src/views/sysworkflow/flow/flowDrawingBoard.vue

9
src/api/matrixapi/type.ts

@ -109,3 +109,12 @@ export interface orgAndUserMatrixCont{
mhid:number;
}
//权限矩阵组合
export interface matrixInfo{
matrixid:number;
matrixName:string;
factorid:number;
factorName:string;
outcomeid:number;
outcomeName:string;
}

20
src/components/workflow/addNode.vue

@ -67,7 +67,15 @@ const addType = (type:any)=> {
"fromNode": fromNodeNumber,
"gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[],
"sendBackNode":"beginnode",
"attribute":1
"attribute":1,
"matrix":{
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
}
// console.log("p4",data)
} else if (type == 2) {
@ -100,7 +108,15 @@ const addType = (type:any)=> {
"fromNode": fromNodeNumber,
"gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[],
"sendBackNode":"beginnode",
"attribute":1
"attribute":1,
"matrix":{
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
}
// console.log("p6",data)
}

215
src/components/workflow/dialog/matrix.vue

@ -0,0 +1,215 @@
<!--
@ 作者: 秦东
@ 时间: 2023-10-28 13:56:34
@ 备注: 矩阵选项
-->
<script lang='ts' setup>
import { searchMatrix,matrixCont,martixFieldStruct,matrixInfo } from '@/api/matrixapi/type'
import { getMatrixList,getMatrixField } from '@/api/matrixapi/index'
const props = defineProps({
isshow:{
type:Boolean,
default:false
},
data: {
type: Object,
default: () => {
return {
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
}
},
})
const emits = defineEmits(["update:isshow","change"]); //
const isShow = computed({
get: () => props.isshow,
set: (val) => {
emits("update:isshow", val);
},
});
const loading = ref(true);
const loadingVal = ref(true);
const matrixContList = ref<matrixCont[]>();
const matrixIsClick = reactive<matrixInfo>({
matrixid:0,
factorid:0,
outcomeid:0,
matrixName:"",
factorName:"",
outcomeName:"",
});
//
watch(() => props.isshow,(val:any) => {
if(val){
// console.log("")
searchMatrixList();
matrixIsClick.matrixid = props.data.matrixid;
matrixIsClick.matrixName = props.data.matrixName;
matrixIsClick.factorid = props.data.factorid;
matrixIsClick.factorName = props.data.factorName;
matrixIsClick.outcomeid = props.data.outcomeid;
matrixIsClick.outcomeName = props.data.outcomeName;
}
})
//
const searchArchiveQuery = reactive<searchMatrix>({
page:1,
pagesize:10
})
const total = ref(0); //
const farstId = ref<number>(0)
/**
* 获取矩阵列表
*/
function searchMatrixList(){
loading.value = true
// console.log("---->",matrixIsClick)
getMatrixList(searchArchiveQuery)
.then(({ data })=>{
// console.log("->",data)
matrixContList.value = data.list
total.value = data.total
if(data.list.length > 0){
farstId.val = data.list[0].id*1
// matrixIsClick.matrixid = data.list[0].id*1
// matrixIsClick.matrixName = data.list[0].name
}
}).finally(()=>{
loading.value = false
gainMatrixNeed(farstId.val);
})
}
const factorList = ref<martixFieldStruct[]>()
const outcomeList = ref<martixFieldStruct[]>()
//
const gainMatrixNeed = (val:any) =>{
loadingVal.value = true
getMatrixField({id:val*1})
.then(({data})=>{
console.log("监听数据---->",data)
factorList.value = data.factor
outcomeList.value = data.outcome
if(data.factor.length>0){
// matrixIsClick.factorid = data.factor[0].id*1
// matrixIsClick.factorName = data.factor[0].name
}
if(data.outcome.length>0){
// matrixIsClick.outcomeid = data.outcome[0].id*1
// matrixIsClick.outcomeName = data.outcome[0].name
}
})
.finally(()=>{
loadingVal.value = false
})
}
//
const pickmatirval = (val:matrixCont) =>{
matrixIsClick.matrixid = val.id*1
matrixIsClick.matrixName = val.name
gainMatrixNeed(val.id*1);
}
//
const pickval = (val:martixFieldStruct) =>{
matrixIsClick.outcomeid = val.id*1
matrixIsClick.outcomeName = val.name
}
//
const pickSelect = (val:any) =>{
factorList.value.forEach(item=>{
if(item.id==val){
matrixIsClick.factorid = item.id*1
matrixIsClick.factorName = item.name
}
})
}
watch(matrixIsClick,(val:any) => {
// console.log("---->",val)
emits("change", val);
})
onMounted(()=>{
matrixIsClick.matrixid = props.data.matrixid;
matrixIsClick.matrixName = props.data.matrixName;
matrixIsClick.factorid = props.data.factorid;
matrixIsClick.factorName = props.data.factorName;
matrixIsClick.outcomeid = props.data.outcomeid;
matrixIsClick.outcomeName = props.data.outcomeName;
searchMatrixList();
})
</script>
<template>
<el-descriptions
v-if="isShow"
title="权限矩阵"
direction="vertical"
:column="2"
:size="size"
border
>
<el-descriptions-item label="可用矩阵" width="50%">
<el-row v-loading="loading">
<el-col :span="24" class="materBody">
<ul>
<li v-for="item in matrixContList" :key="item.id" :class="matrixIsClick.matrixid==item.id?'active':''" @click="pickmatirval(item)">
<el-text class="mx-1">{{item.name}}</el-text> <el-text class="mx-1">{{item.orgname}}</el-text>
</li>
</ul>
</el-col>
<el-col :span="24">
<el-pagination v-model:total="total" v-model:current-page="searchArchiveQuery.page" small layout="prev, pager, next" :page-size="searchArchiveQuery.pagesize" :pager-count="5" />
</el-col>
</el-row>
</el-descriptions-item>
<el-descriptions-item label="矩阵选项" width="50%">
<el-row v-loading="loadingVal">
<el-col :span="24">
<el-select v-model="matrixIsClick.factorid" filterable placeholder="Select" style="width:100%" @change="pickSelect">
<el-option
:key="0"
label="请选择"
:value="0"
/>
<el-option
v-for="item in factorList"
:key="item.id"
:label="item.name"
:value="item.id"
/>
</el-select>
</el-col>
<el-col :span="24" class="materBody">
<ul>
<li v-for="item in outcomeList" :key="item.id" :class="matrixIsClick.outcomeid==item.id?'active':''" @click="pickval(item)">
<el-text class="mx-1">{{item.name}}</el-text> <el-text class="mx-1">{{}}{{item.pinyin}}</el-text>
</li>
</ul>
</el-col>
</el-row>
</el-descriptions-item>
</el-descriptions>
</template>
<style lang='scss' scoped>
.materBody{
padding:5px 0 5px 0;
li{
display: flex;
justify-content: space-between;
align-items: center;
cursor:pointer;
}
li.active span {
color:#409EFF;
}
}
</style>

51
src/components/workflow/drwer/approverDrawer.vue

@ -11,6 +11,10 @@ import { getAllParentNode,judgeOptionalNode } from '@/api/workflowapi/index'
import PositionDialog from '@/components/workflow/dialog/positionDialog.vue'
import FormWord from '@/components/workflow/dialog/formWord.vue'
import MatrixPage from '@/components/workflow/dialog/matrix.vue'
import { matrixInfo } from '@/api/matrixapi/type'
let props = defineProps({
nodeConfig:{
@ -55,13 +59,15 @@ let visible = computed({
closeDrawer()
}
})
const matrixIsShow = ref(false)
watch(visible,(val:any)=>{
// if(val)
})
watch(approverConfig1, (val:any)=>{
// console.log("directormaxlevel",visible.value)
// console.log("directormaxlevel",visible.value)\
matrixIsShow.value = false
approverConfig.value = val.value
if(val.type == 3){
nodeTitle.value = "执行人设置"
@ -95,14 +101,22 @@ watch(approverConfig1, (val:any)=>{
}
})
}
if(val.value.settype == 9){
matrixIsShow.value = true
matrixFieldList.value = approverConfig.value.matrix;
}
})
let changeRange = ()=> {
approverConfig.value.nodeUserList = [];
}
//
const matrixList = ref<any[]>()
const matrixCont = ref<any>()
const matrixFieldList = ref<matrixInfo>()
const changeType = (val:any)=> {
matrixIsShow.value = false
approverConfig.value.nodeUserList = [];
approverConfig.value.examineMode = 1;
approverConfig.value.noHanderAction = 2;
@ -113,7 +127,11 @@ const changeType = (val:any)=> {
approverConfig.value.selectRange = 1;
} else if (val == 7) {
approverConfig.value.examineEndDirectorLevel = 1
}
}else if (val == 9){
matrixIsShow.value = true
matrixFieldList.value = approverConfig.value.matrix;
}
}
const addApprover = ()=> {
approverVisible.value = true;
@ -170,6 +188,12 @@ const sureFormTableApprover = (data:any)=> {
approverConfig.value.nodeUserList = data;
appFormTableVisible.value = false;
}
//
const updateMatrix = (val:any) =>{
approverConfig.value.matrix = val;
}
</script>
<template>
@ -181,7 +205,7 @@ const sureFormTableApprover = (data:any)=> {
<div class="approver_content">
<el-radio-group v-model="approverConfig.settype" class="clear" @change="changeType">
<template v-for="({value, label}) in setTypes" :key="value">
<el-radio v-if="isShowRatify(value)" :label="value" style="width:auto">{{label}}=>{{value}}</el-radio>
<el-radio v-if="isShowRatify(value)" :label="value" style="width:auto">{{label}}</el-radio>
</template>
</el-radio-group>
</div>
@ -283,6 +307,7 @@ const sureFormTableApprover = (data:any)=> {
</el-radio-group>
</div>
<!--根据关联表单设置指定审批字段-->
<div v-if="approverConfig.settype==8" class="approver_manager">
<p>指定审批字段</p>
<el-button type="primary" @click="formTableField">添加/修改审批字段</el-button>
@ -291,8 +316,18 @@ const sureFormTableApprover = (data:any)=> {
<el-tag v-if="approverConfig.nodeUserList.length!=0" type="danger" effect="dark" @click="approverConfig.nodeUserList=[]">清除</el-tag>
</p>
</div>
<!--权限矩阵-->
<div v-if="approverConfig.settype==9" class="approver_manager">
<MatrixPage
v-model:isshow="matrixIsShow"
:data="matrixFieldList"
@change="updateMatrix"
/>
</div>
<!--补充审批信息-->
<div v-if="(approverConfig.settype==1&&approverConfig.nodeUserList.length>1)||approverConfig.settype==2||approverConfig.settype==6||(approverConfig.settype==4&&approverConfig.selectMode==2)||approverConfig.settype==8" class="approver_some">
<div v-if="(approverConfig.settype==1&&approverConfig.nodeUserList.length>1)||approverConfig.settype==2||approverConfig.settype==6||(approverConfig.settype==4&&approverConfig.selectMode==2)||approverConfig.settype==8||approverConfig.settype==9" class="approver_some">
<p>多人审批时采用的审批方式</p>
<el-radio-group v-model="approverConfig.examineMode" class="clear">
<el-radio :label="1">依次审批</el-radio>
@ -300,7 +335,7 @@ const sureFormTableApprover = (data:any)=> {
<el-radio v-if="approverConfig.settype!=2" :label="3">非会签(有一位审批人同意即可)</el-radio>
</el-radio-group>
</div>
<div v-if="approverConfig.settype==2||approverConfig.settype==6" class="approver_some">
<div v-if="approverConfig.settype==2||approverConfig.settype==6||approverConfig.settype==9" class="approver_some">
<p>审批人为空时</p>
<el-radio-group v-model="approverConfig.noHanderAction" class="clear">
<el-radio :label="1">自动审批通过/不允许发起</el-radio>

12
src/utils/workflow/index.ts

@ -125,6 +125,18 @@ All.prototype = {
}
}
}else if (nodeConfig.settype == 9){
if(nodeConfig.matrix && nodeConfig.matrix.outcomeName){
let strVal = nodeConfig.matrix.outcomeName
if (nodeConfig.examineMode == 1) {
return strVal + "依次审批"
} else if (nodeConfig.examineMode == 2) {
return strVal + "会签"
}else if (nodeConfig.examineMode == 3) {
return strVal + "非会签"
}
}
}
},
dealStr(str:any, obj:any) {

2
src/views/sysworkflow/codepage/index.vue

@ -288,7 +288,7 @@ const setupWorkFlow = (cont:customerFormCont) => {
</el-drawer>
<SetupConfig v-model:show="show" :editid="editid" @handle_query="handleQuery" />
<DataTableStructure v-model:isshow="dataTableIsShow" :formcont="formCont" />
<FlowDrawingBoard v-model:open-drawer="drawer" :drawer-widht="drawerWidht" :is-form-flow="isFormFlow" :customer-form-name="customerFormName" :customer-form-key="customerFormKey" :flow-key="flowKey" />
<FlowDrawingBoard v-model:open-drawer="drawer" :drawer-widht="drawerWidht" :is-form-flow="isFormFlow" :customer-form-name="customerFormName" :customer-form-key="customerFormKey" :flow-key="flowKey" @chanerequest="handleQuery" />
</template>
<style lang='scss' scoped>
.drawerClass{

34
src/views/sysworkflow/flow/flowDrawingBoard.vue

@ -45,7 +45,7 @@ const props = defineProps({
default:""
}
})
const emits = defineEmits(["update:openDrawer"]);
const emits = defineEmits(["update:openDrawer","chanerequest"]);
const isShow = computed({
get: () => props.openDrawer,
set: (val) => {
@ -90,9 +90,9 @@ const getFlowVerList = ()=>{
}
}
console.log("获取工作流版本列表---1-->",activeTabs.value);
console.log("获取工作流版本列表---2-->",enableFlow.value);
console.log("获取工作流版本列表---3-->",enableVersion.value);
// console.log("---1-->",activeTabs.value);
// console.log("---2-->",enableFlow.value);
// console.log("---3-->",enableVersion.value);
})
.finally(()=>{
if(isRead.value == true){
@ -116,15 +116,15 @@ const initWorkFlowData = async() => {
processConfig.value = data;
let {
nodeConfig:nodes,
flowPermission,
directorMaxLevel,
flowPermission:flowPermissiones,
directorMaxLevel:levels,
workFlowDef:workName,
tableId,
} = data;
processConfig.value.workFlowDef.formKey = props.customerFormKey
nodeConfig.value = nodes;
flowPermission.value = flowPermission;
directorMaxLeveling.value = directorMaxLevel;
flowPermission.value = flowPermissiones;
directorMaxLeveling = levels;
workFlowDef.value = workName;
setTableId(tableId);
// console.log("max--1->",data)
@ -185,7 +185,7 @@ const saveSet = async () => {
}
})
.finally(()=>{
emits("chanerequest");
})
// let res = await setWorkFlowData(processConfig.value);
@ -212,7 +212,7 @@ const zoomSize = (type:number) => {
}
};
//
const clearCanvas = (isOk?:number) =>{
const clearCanvas = (isOk?:any) =>{
if(isOk==1){
initWorkFlowData()
setIsTried(false);
@ -249,7 +249,7 @@ watch(()=>props.openDrawer,(val)=>{
//
const clickFormTable = (val:any) =>{
console.log("切换表单",val,activeTabs.value)
// console.log("",val,activeTabs.value)
enableVersion.value = val
gainFlowCont();
clickOpenOrClose();
@ -283,7 +283,7 @@ const saveEdit =()=>{
}
})
.finally(()=>{
emits("chanerequest");
})
}
@ -314,6 +314,10 @@ const saveNew = () => {
clearCanvas(1);
}
})
.finally(()=>{
emits("chanerequest");
})
}
//
const gainFlowCont = () =>{
@ -363,7 +367,7 @@ const setupState = (val:number) =>{
.finally(()=>{
clickOpenOrClose();
})
console.log("enableFlow.version==activeTabs",enableFlow.version,activeTabs)
// console.log("enableFlow.version==activeTabs",enableFlow.version,activeTabs)
}
const openOfClise = ref(false)
const clickOpenOrClose = () => {
@ -372,8 +376,8 @@ const clickOpenOrClose = () => {
}else{
openOfClise.value = false
}
console.log("openOfClise",openOfClise.value)
console.log("enableFlow.version=1=activeTabs",enableFlow.value,activeTabs.value)
// console.log("openOfClise",openOfClise.value)
// console.log("enableFlow.version=1=activeTabs",enableFlow.value,activeTabs.value)
}
</script>
<template>

Loading…
Cancel
Save