Browse Source

完成矩阵选项

liwenxuan_v2
超级管理员 2 years ago
parent
commit
322197cbb9
  1. 9
      src/api/matrixapi/type.ts
  2. 20
      src/components/workflow/addNode.vue
  3. 160
      src/components/workflow/dialog/matrix.vue
  4. 45
      src/components/workflow/drwer/approverDrawer.vue
  5. 12
      src/utils/workflow/index.ts
  6. 8
      src/views/sysworkflow/flow/flowDrawingBoard.vue

9
src/api/matrixapi/type.ts

@ -109,3 +109,12 @@ export interface orgAndUserMatrixCont{
mhid:number; 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, "fromNode": fromNodeNumber,
"gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[], "gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[],
"sendBackNode":"beginnode", "sendBackNode":"beginnode",
"attribute":1 "attribute":1,
"matrix":{
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
} }
// console.log("p4",data) // console.log("p4",data)
} else if (type == 2) { } else if (type == 2) {
@ -100,7 +108,15 @@ const addType = (type:any)=> {
"fromNode": fromNodeNumber, "fromNode": fromNodeNumber,
"gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[], "gotoNode":gotoNodeNumber!=""?[gotoNodeNumber]:[],
"sendBackNode":"beginnode", "sendBackNode":"beginnode",
"attribute":1 "attribute":1,
"matrix":{
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
} }
// console.log("p6",data) // console.log("p6",data)
} }

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

@ -4,15 +4,28 @@
@ 备注: 矩阵选项 @ 备注: 矩阵选项
--> -->
<script lang='ts' setup> <script lang='ts' setup>
import { searchMatrix,matrixCont } from '@/api/matrixapi/type' import { searchMatrix,matrixCont,martixFieldStruct,matrixInfo } from '@/api/matrixapi/type'
import { getMatrixList } from '@/api/matrixapi/index' import { getMatrixList,getMatrixField } from '@/api/matrixapi/index'
const props = defineProps({ const props = defineProps({
isshow:{ isshow:{
type:Boolean, type:Boolean,
default:false default:false
} },
data: {
type: Object,
default: () => {
return {
"matrixid":0,
"matrixName":"",
"factorid":0,
"factorName":"",
"outcomeid":0,
"outcomeName":"",
}
}
},
}) })
const emits = defineEmits(["update:isshow","change"]); // const emits = defineEmits(["update:isshow","change"]); //
const isShow = computed({ const isShow = computed({
@ -22,12 +35,28 @@ const isShow = computed({
}, },
}); });
const loading = ref(true); const loading = ref(true);
const loadingVal = ref(true);
const matrixContList = ref<matrixCont[]>(); const matrixContList = ref<matrixCont[]>();
const matrixIsClick = reactive<matrixInfo>({
matrixid:0,
factorid:0,
outcomeid:0,
matrixName:"",
factorName:"",
outcomeName:"",
});
// //
watch(() => props.isshow,(val:any) => { watch(() => props.isshow,(val:any) => {
if(val){ if(val){
console.log("执行监听") // console.log("")
searchMatrixList(); 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;
} }
}) })
// //
@ -36,18 +65,85 @@ const searchArchiveQuery = reactive<searchMatrix>({
pagesize:10 pagesize:10
}) })
const total = ref(0); // const total = ref(0); //
const farstId = ref<number>(0)
/** /**
* 获取矩阵列表 * 获取矩阵列表
*/ */
function searchMatrixList(){ function searchMatrixList(){
loading.value = true loading.value = true
// console.log("---->",matrixIsClick)
getMatrixList(searchArchiveQuery) getMatrixList(searchArchiveQuery)
.then(({ data })=>{ .then(({ data })=>{
console.log("获取矩阵列表->",data) // console.log("->",data)
matrixContList.value = data.list matrixContList.value = data.list
total.value = data.total total.value = data.total
}).finally(()=>{loading.value = false}) 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> </script>
<template> <template>
<el-descriptions <el-descriptions
@ -59,9 +155,13 @@ function searchMatrixList(){
border border
> >
<el-descriptions-item label="可用矩阵" width="50%"> <el-descriptions-item label="可用矩阵" width="50%">
<el-row v-loading="loading" :gutter="20"> <el-row v-loading="loading">
<el-col v-for="item in matrixContList" :key="item.id" :span="24" class="materBody"> <el-col :span="24" class="materBody">
<el-text class="mx-1">{{item.name}}</el-text> <el-text class="mx-1">{{item.orgname}}</el-text> <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>
<el-col :span="24"> <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-pagination v-model:total="total" v-model:current-page="searchArchiveQuery.page" small layout="prev, pager, next" :page-size="searchArchiveQuery.pagesize" :pager-count="5" />
@ -69,17 +169,47 @@ function searchMatrixList(){
</el-row> </el-row>
</el-descriptions-item> </el-descriptions-item>
<el-descriptions-item label="矩阵选项" width="50%"> <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-item>
</el-descriptions> </el-descriptions>
</template> </template>
<style lang='scss' scoped> <style lang='scss' scoped>
.materBody{ .materBody{
padding:5px 0 5px 0; padding:5px 0 5px 0;
display: flex;
justify-content: space-between; li{
align-items: center; display: flex;
cursor:pointer; justify-content: space-between;
align-items: center;
cursor:pointer;
}
li.active span {
color:#409EFF;
}
} }
</style> </style>

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

@ -13,6 +13,9 @@ import PositionDialog from '@/components/workflow/dialog/positionDialog.vue'
import FormWord from '@/components/workflow/dialog/formWord.vue' import FormWord from '@/components/workflow/dialog/formWord.vue'
import MatrixPage from '@/components/workflow/dialog/matrix.vue' import MatrixPage from '@/components/workflow/dialog/matrix.vue'
import { matrixInfo } from '@/api/matrixapi/type'
let props = defineProps({ let props = defineProps({
nodeConfig:{ nodeConfig:{
type: Object, type: Object,
@ -100,6 +103,7 @@ watch(approverConfig1, (val:any)=>{
} }
if(val.value.settype == 9){ if(val.value.settype == 9){
matrixIsShow.value = true matrixIsShow.value = true
matrixFieldList.value = approverConfig.value.matrix;
} }
}) })
let changeRange = ()=> { let changeRange = ()=> {
@ -109,7 +113,7 @@ let changeRange = ()=> {
// //
const matrixList = ref<any[]>() const matrixList = ref<any[]>()
const matrixCont = ref<any>() const matrixCont = ref<any>()
const matrixFieldList = ref<any[]>() const matrixFieldList = ref<matrixInfo>()
const changeType = (val:any)=> { const changeType = (val:any)=> {
matrixIsShow.value = false matrixIsShow.value = false
@ -125,6 +129,7 @@ const changeType = (val:any)=> {
approverConfig.value.examineEndDirectorLevel = 1 approverConfig.value.examineEndDirectorLevel = 1
}else if (val == 9){ }else if (val == 9){
matrixIsShow.value = true matrixIsShow.value = true
matrixFieldList.value = approverConfig.value.matrix;
} }
} }
@ -183,8 +188,12 @@ const sureFormTableApprover = (data:any)=> {
approverConfig.value.nodeUserList = data; approverConfig.value.nodeUserList = data;
appFormTableVisible.value = false; appFormTableVisible.value = false;
} }
// //
const updateMatrix = (val:any) =>{} const updateMatrix = (val:any) =>{
approverConfig.value.matrix = val;
}
</script> </script>
<template> <template>
@ -196,7 +205,7 @@ const updateMatrix = (val:any) =>{}
<div class="approver_content"> <div class="approver_content">
<el-radio-group v-model="approverConfig.settype" class="clear" @change="changeType"> <el-radio-group v-model="approverConfig.settype" class="clear" @change="changeType">
<template v-for="({value, label}) in setTypes" :key="value"> <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> </template>
</el-radio-group> </el-radio-group>
</div> </div>
@ -312,38 +321,10 @@ const updateMatrix = (val:any) =>{}
<MatrixPage <MatrixPage
v-model:isshow="matrixIsShow" v-model:isshow="matrixIsShow"
:data="matrixFieldList"
@change="updateMatrix" @change="updateMatrix"
/> />
<el-row :gutter="10">
<el-col :span="12"><el-text class="mx-1" size="large">可用矩阵</el-text></el-col>
<el-col :span="12"><el-text class="mx-1" size="large">矩阵选项</el-text></el-col>
</el-row>
<el-row :gutter="10">
<el-col :span="12">
<el-select v-model="matrixCont" filterable placeholder="Select" style="width:100%">
<el-option
v-for="item in matrixList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
<el-pagination small layout="prev, pager, next" :total="50" />
</el-col>
<el-col :span="12">
<el-select v-model="matrixCont" filterable placeholder="Select" style="width:100%">
<el-option
v-for="item in matrixFieldList"
:key="item.value"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-col>
</el-row>
</div> </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||approverConfig.settype==9" 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">

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) { dealStr(str:any, obj:any) {

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

@ -113,15 +113,15 @@ const initWorkFlowData = async() => {
processConfig.value = data; processConfig.value = data;
let { let {
nodeConfig:nodes, nodeConfig:nodes,
flowPermission, flowPermission:flowPermissiones,
directorMaxLevel, directorMaxLevel:levels,
workFlowDef:workName, workFlowDef:workName,
tableId, tableId,
} = data; } = data;
processConfig.value.workFlowDef.formKey = props.customerFormKey processConfig.value.workFlowDef.formKey = props.customerFormKey
nodeConfig.value = nodes; nodeConfig.value = nodes;
flowPermission.value = flowPermission; flowPermission.value = flowPermissiones;
directorMaxLeveling.value = directorMaxLevel; directorMaxLeveling = levels;
workFlowDef.value = workName; workFlowDef.value = workName;
setTableId(tableId); setTableId(tableId);
// console.log("max--1->",data) // console.log("max--1->",data)

Loading…
Cancel
Save