Browse Source

工作流图像界面及相关逻辑完成

dev
超级管理员 3 years ago
parent
commit
4d2e8f8dad
  1. 6
      public/index.html
  2. 104
      src/api/preload.js
  3. 117
      src/api/workflowapi/workflowaip.js
  4. 78
      src/component_old/Breadcrumb/index.vue
  5. 44
      src/component_old/Hamburger/index.vue
  6. 62
      src/component_old/SvgIcon/index.vue
  7. 129
      src/component_old/dialog/employeesDialog.vue
  8. 146
      src/component_old/dialog/employeesRoleDialog.vue
  9. 72
      src/component_old/dialog/errorDialog.vue
  10. 92
      src/component_old/dialog/roleDialog.vue
  11. 151
      src/component_old/projectDialog/index.vue
  12. 88
      src/component_old/selectBox.vue
  13. 100
      src/component_old/selectResult copy.vue
  14. 1
      src/components/dialog/employeesDialog.vue
  15. 61
      src/components/drawer/appexecutorDrawer.vue
  16. 6
      src/components/drawer/approverDrawer.vue
  17. 25
      src/components/nodeWrap.vue
  18. 1
      src/components/selectBox.vue
  19. 16
      src/css/workflow.css
  20. 94
      src/customworkflow/addNode.vue
  21. 137
      src/customworkflow/dialog/employeesDialog.vue
  22. 171
      src/customworkflow/dialog/employeesRoleDialog.vue
  23. 75
      src/customworkflow/dialog/errorDialog.vue
  24. 32
      src/customworkflow/dialog/mixins.js
  25. 92
      src/customworkflow/dialog/positionDialog.vue
  26. 92
      src/customworkflow/dialog/roleDialog.vue
  27. 379
      src/customworkflow/drawer/approverDrawer.vue
  28. 756
      src/customworkflow/drawer/conditionDrawer.vue
  29. 347
      src/customworkflow/drawer/conditionDrawer_20230323.vue
  30. 703
      src/customworkflow/drawer/conditionDrawer_20230327.vue
  31. 45
      src/customworkflow/drawer/copyerDrawer.vue
  32. 43
      src/customworkflow/drawer/promoterDrawer.vue
  33. 223
      src/customworkflow/nodeWrap.vue
  34. 102
      src/customworkflow/selectBox.vue
  35. 26
      src/customworkflow/selectResult.vue
  36. 1
      src/layout/components/TagsView/index.vue
  37. 19
      src/main.js
  38. 18
      src/router/index.js
  39. 35
      src/store/index.js
  40. 4
      src/utils/request.js
  41. 2
      src/views/basicInfo/target.vue
  42. 397
      src/views/mete/dingliang.vue
  43. 220
      src/views/workflow/editflowcont.vue
  44. 11
      src/views/workflow/flow.vue
  45. 335
      src/views/workflow/flowcont.vue
  46. 150
      src/views/workflow/lookflowcont.vue
  47. 233
      src/views/workflow/myFlow.vue
  48. 274
      src/views/workflow/workflowlist.vue

6
public/index.html

@ -4,6 +4,12 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
<meta http-equiv="Expires" content="0">
<meta http-equiv="Pragma" content="no-cache">
<meta http-equiv="Cache-control" content="no-cache">
<meta http-equiv="Cache" content="no-cache">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= webpackConfig.name %></title>
<script src="//res.wx.qq.com/open/js/jweixin-1.2.0.js"></script>

104
src/api/preload.js

@ -59,24 +59,40 @@ All.prototype = {
arr.splice(includesIndex, 1);
},
setApproverStr(nodeConfig) {
console.log("设置节点框显示内容--》",nodeConfig);
// console.log("设置节点框显示内容--》",nodeConfig);
if (nodeConfig.settype == 1) {
if (nodeConfig.nodeUserList.length == 1) {
return nodeConfig.nodeUserList[0].name
} else if (nodeConfig.nodeUserList.length > 1) {
if (nodeConfig.examineMode == 1) {
return this.arrToStr(nodeConfig.nodeUserList)
return this.arrToStr(nodeConfig.nodeUserList) + "依次审批"
} else if (nodeConfig.examineMode == 2) {
return nodeConfig.nodeUserList.length + "人会签"
}else{
return nodeConfig.nodeUserList.length + "人非会签"
}
}
} else if (nodeConfig.settype == 2) {
let level = nodeConfig.directorLevel == 1 ? '直接主管' : '第' + nodeConfig.directorLevel + '级主管'
if (nodeConfig.examineMode == 1) {
return level
return level + "依次审批"
} else if (nodeConfig.examineMode == 2) {
return level + "会签"
}else{
return level + "非会签"
}
} else if (nodeConfig.settype == 3) {
let level = nodeConfig.nodeUserList.length > 0 ? this.arrToStr(nodeConfig.nodeUserList):"";
if (nodeConfig.examineMode == 1) {
return level + "依次审批"
} else if (nodeConfig.examineMode == 2) {
return level + "会签"
}else{
return level + "非会签"
}
} else if (nodeConfig.settype == 4) {
if (nodeConfig.selectRange == 1) {
return "发起人自选"
@ -113,7 +129,10 @@ All.prototype = {
return arr.join("或")
},
conditionStr(nodeConfig, index) {
var { conditionList, nodeUserList } = nodeConfig.conditionNodes[index];
var { conditionList, nodeUserList,databasecondition } = nodeConfig.conditionNodes[index];
// console.log("条件解析--->",nodeConfig.conditionNodes[index])
if (conditionList.length == 0) {
return (index == nodeConfig.conditionNodes.length - 1) && nodeConfig.conditionNodes[0].conditionList.length != 0 ? '其他条件进入此流程' : '请设置条件'
} else {
@ -139,6 +158,83 @@ All.prototype = {
str += `${zdy1} ${opt1} ${showName} ${opt2} ${zdy2} 并且 `
}
}
if(showType == "datatable"){
// console.log("条件解析--1->",databasecondition,databasecondition.len)
if(databasecondition.length != 0){
databasecondition.forEach(item => {
if(item.wordlist){
// console.log("条件解析--2->",item.wordlist)
if(item.wordlist.length > 0){
// console.log("条件解析--5->",item.wordlist)
item.wordlist.forEach(itemWord=>{
switch(itemWord.notation){
case "1":
case "2":
case "3":
case "4":
case "5":
var optTypesStr = ["", "<", ">", "≤", "=", "≥"][itemWord.notation]
str += itemWord.key +' '+ optTypesStr + ' ' + itemWord.equation.letfval + ' 并且 '
// console.log("条件解析--4->",itemWord.notation)
break;
case "6":
var optTypeLeftStr = ["", "<", "", "≤"][itemWord.equation.leftnotation]
var optTypeRightStr = ["", "<", "", "≤"][itemWord.equation.rightnotation]
str += itemWord.equation.letfval + ' ' + optTypeLeftStr + ' ' + itemWord.key + ' ' + optTypeRightStr + ' ' + itemWord.equation.rightval +' 并且 '
break;
case "in":
str += itemWord.key + '包含' + itemWord.equation.letfval + ' 并且 '
break;
case "notin":
str += itemWord.key + '不包含' + itemWord.equation.letfval + ' 并且 '
break;
default:
str += itemWord.key + itemWord.equation.letfval + ' 并且 '
break;
}
})
}
// console.log("条件解析--3->",str)
}
});
}
}
if(columnType == "custom"){
// console.log("条件解析--250->",conditionList[i],conditionList[i].condition)
if(conditionList[i].condition){
if(conditionList[i].condition.length > 0){
conditionList[i].condition.forEach(itemcon=>{
// console.log("条件解析-1-4->",itemcon.optType)
switch(itemcon.optType){
case "1":
case "2":
case "3":
case "4":
case "5":
var optTypesStr = ["", "<", ">", "≤", "=", "≥"][itemcon.factor.leftoptType]
str += itemcon.wordfield +' '+ optTypesStr + ' ' + itemcon.factor.leftval + ' 并且 '
// console.log("条件解析--4->",str)
break;
case "6":
var optTypeLeftStr = ["", "<", "", "≤"][itemcon.factor.leftoptType]
var optTypeRightStr = ["", "<", "", "≤"][itemcon.factor.rightoptType]
str += itemcon.factor.leftval + ' ' + optTypeLeftStr + ' ' + itemcon.wordfield + ' ' + optTypeRightStr + ' ' + itemcon.factor.rightval +' 并且 '
// console.log("条件解析--4-6------>",itemcon.factor.leftoptType,itemcon.factor.rightoptType,optTypeLeftStr,optTypeRightStr)
break;
case "7":
str += itemcon.wordfield + '包含' + itemcon.factor.leftval + ' 并且 '
break;
case "8":
str += itemcon.wordfield + '不包含' + itemcon.factor.leftval + ' 并且 '
break;
default:
str += itemcon.wordfield + itemcon.factor.leftval + ' 并且 '
break;
}
})
}
}
}
}
return str ? str.substring(0, str.length - 4) : '请设置条件'
}

117
src/api/workflowapi/workflowaip.js

@ -3,7 +3,7 @@ import request from '@/utils/requestFile'
//获取流程数值
export const getShiyanData = (data) => {
return request({
url: '/workflowapi/shiyan_data',
url: '/workflowapi/look_work_flow',
method: 'post',
data: data
})
@ -15,7 +15,7 @@ export const getShiyanData = (data) => {
*/
export const getRoles = (data) => {
return request({
url: '/workflowapi/shiyan_data',
url: '/powerpc/system_role_list_flow',
method: 'post',
data: data
})
@ -39,7 +39,7 @@ export const getShiyanData = (data) => {
*/
export const getEmployees = (data) => {
return request({
url: '/workflowapi/shiyan_data',
url: '/powerpc/search_people',
method: 'post',
data: data
})
@ -56,3 +56,114 @@ export const getShiyanData = (data) => {
data: data
})
}
/**
* 获取条件字段
* @param {*} data
* @returns
*/
export const getDataBaseTable = (data) => {
return request({
url: '/workflowapi/get_data_base_table',
method: 'post',
data: data
})
}
/**
* 获取条件字段
* @param {*} data
* @returns
*/
export const getDataBaseTableCont = (data) => {
return request({
url: '/workflowapi/get_data_base_tablecont',
method: 'post',
data: data
})
}
/**
* 获取条件字段
* @param {*} data
* @returns
*/
export const getWorkFlowList = (data) => {
return request({
url: '/workflowapi/get_work_flow_list',
method: 'post',
data: data
})
}
/**
* 发布流程
*/
export const publishWorkFlow = (data) => {
return request({
url: '/workflowapi/publish_work_flow',
method: 'post',
data: data
})
}
/**
* 编辑工作流主体状态
*/
export const editWorkFlowState = (data) => {
return request({
url: '/workflowapi/edit_work_flow_state',
method: 'post',
data: data
})
}
/**
* 初始化工作流
*/
export const initializeWorkFlow = (data) => {
return request({
url: '/workflowapi/init_work_flow',
method: 'post',
data: data
})
}
/**
* 获取工作流版本
*/
export const getWorkFlowVersionList = (data) => {
return request({
url: '/workflowapi/get_workflow_version_list',
method: 'post',
data: data
})
}
/**
* 获取统一岗位
*/
export const GetPositionUnify = (data) => {
return request({
url: '/powerpc/get_position_unify',
method: 'post',
data: data
})
}
/**
* 搜索统一岗位
*/
export const SearchPositionUnify = (data) => {
return request({
url: '/powerpc/search_position_unify',
method: 'post',
data: data
})
}
/**
* 启用流程版本
*/
export const StartUsingVersion = (data) => {
return request({
url: '/workflowapi/start_using_version',
method: 'post',
data: data
})
}

78
src/component_old/Breadcrumb/index.vue

@ -1,78 +0,0 @@
<template>
<el-breadcrumb class="app-breadcrumb" separator="/">
<transition-group name="breadcrumb">
<el-breadcrumb-item v-for="(item,index) in levelList" :key="item.path">
<span v-if="item.redirect==='noRedirect'||index==levelList.length-1" class="no-redirect">{{ item.meta.title }}</span>
<a v-else @click.prevent="handleLink(item)">{{ item.meta.title }}</a>
</el-breadcrumb-item>
</transition-group>
</el-breadcrumb>
</template>
<script>
import pathToRegexp from 'path-to-regexp'
export default {
data() {
return {
levelList: null
}
},
watch: {
$route() {
this.getBreadcrumb()
}
},
created() {
this.getBreadcrumb()
},
methods: {
getBreadcrumb() {
// only show routes with meta.title
let matched = this.$route.matched.filter(item => item.meta && item.meta.title)
const first = matched[0]
// if (!this.isDashboard(first)) {
// matched = [{ path: '/dashboard', meta: { title: 'Dashboard' }}].concat(matched)
// }
this.levelList = matched.filter(item => item.meta && item.meta.title && item.meta.breadcrumb !== false)
},
isDashboard(route) {
const name = route && route.name
if (!name) {
return false
}
return name.trim().toLocaleLowerCase() === 'Dashboard'.toLocaleLowerCase()
},
pathCompile(path) {
// To solve this problem https://github.com/PanJiaChen/vue-element-admin/issues/561
const { params } = this.$route
var toPath = pathToRegexp.compile(path)
return toPath(params)
},
handleLink(item) {
const { redirect, path } = item
if (redirect) {
this.$router.push(redirect)
return
}
this.$router.push(this.pathCompile(path))
}
}
}
</script>
<style lang="scss" scoped>
.app-breadcrumb.el-breadcrumb {
display: inline-block;
font-size: 14px;
line-height: 50px;
margin-left: 8px;
.no-redirect {
color: #97a8be;
cursor: text;
}
}
</style>

44
src/component_old/Hamburger/index.vue

@ -1,44 +0,0 @@
<template>
<div style="padding: 0 15px;" @click="toggleClick">
<svg
:class="{'is-active':isActive}"
class="hamburger"
viewBox="0 0 1024 1024"
xmlns="http://www.w3.org/2000/svg"
width="64"
height="64"
>
<path d="M408 442h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8zm-8 204c0 4.4 3.6 8 8 8h480c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8H408c-4.4 0-8 3.6-8 8v56zm504-486H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zm0 632H120c-4.4 0-8 3.6-8 8v56c0 4.4 3.6 8 8 8h784c4.4 0 8-3.6 8-8v-56c0-4.4-3.6-8-8-8zM142.4 642.1L298.7 519a8.84 8.84 0 0 0 0-13.9L142.4 381.9c-5.8-4.6-14.4-.5-14.4 6.9v246.3a8.9 8.9 0 0 0 14.4 7z" />
</svg>
</div>
</template>
<script>
export default {
name: 'Hamburger',
props: {
isActive: {
type: Boolean,
default: false
}
},
methods: {
toggleClick() {
this.$emit('toggleClick')
}
}
}
</script>
<style scoped>
.hamburger {
display: inline-block;
vertical-align: middle;
width: 20px;
height: 20px;
}
.hamburger.is-active {
transform: rotate(180deg);
}
</style>

62
src/component_old/SvgIcon/index.vue

@ -1,62 +0,0 @@
<template>
<div v-if="isExternal" :style="styleExternalIcon" class="svg-external-icon svg-icon" v-on="$listeners" />
<svg v-else :class="svgClass" aria-hidden="true" v-on="$listeners">
<use :xlink:href="iconName" />
</svg>
</template>
<script>
// doc: https://panjiachen.github.io/vue-element-admin-site/feature/component/svg-icon.html#usage
import { isExternal } from '@/utils/validate'
export default {
name: 'SvgIcon',
props: {
iconClass: {
type: String,
required: true
},
className: {
type: String,
default: ''
}
},
computed: {
isExternal() {
return isExternal(this.iconClass)
},
iconName() {
return `#icon-${this.iconClass}`
},
svgClass() {
if (this.className) {
return 'svg-icon ' + this.className
} else {
return 'svg-icon'
}
},
styleExternalIcon() {
return {
mask: `url(${this.iconClass}) no-repeat 50% 50%`,
'-webkit-mask': `url(${this.iconClass}) no-repeat 50% 50%`
}
}
}
}
</script>
<style scoped>
.svg-icon {
width: 1em;
height: 1em;
vertical-align: -0.15em;
fill: currentColor;
overflow: hidden;
}
.svg-external-icon {
background-color: currentColor;
mask-size: cover!important;
display: inline-block;
}
</style>

129
src/component_old/dialog/employeesDialog.vue

@ -1,129 +0,0 @@
<template>
<el-dialog title="选择成员" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<el-row>
<el-col :span="12">
<div class="person_tree l">
<input type="text" placeholder="搜索成员" v-model="searchVal" @input="getDebounceData($event)">
<p class="ellipsis tree_nav" v-if="!searchVal">
<span @click="getDepartmentList(309)" class="ellipsis">全部</span>
<span v-for="(item,index) in departments.titleDepartments" class="ellipsis"
:key="index+'a'" @click="getDepartmentList(item.id)">{{item.departmentName}}</span>
</p>
<selectBox :list="list"/>
</div>
</el-col>
<el-col :span="12">
<selectResult :total="total" @del="delList" :list="resList"/>
</el-col>
</el-row>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data', 'isDepartment'],
watch: {
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.getDepartmentList();
this.searchVal = "";
if(this.data !== null){
this.checkedEmployessList = this.data.filter(item => item.type === 1).map(({ name, targetId }) => ({
employeeName: name,
id: targetId
}));
this.checkedDepartmentList = this.data.filter(item => item.type === 3).map(({ name, targetId }) => ({
departmentName: name,
id: targetId
}));
}
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedDepartmentList.length + this.checkedEmployessList.length
},
list() {
return [{
isDepartment: this.isDepartment,
type: 'department',
data: this.departments.childDepartments,
isActive: (item) => this.$func.toggleClass(this.checkedDepartmentList, item),
change: (item) => this.$func.toChecked(this.checkedDepartmentList, item),
next: (item) => this.getDepartmentList(item.id)
}, {
type: 'employee',
data: this.departments.employees,
isActive: (item) => this.$func.toggleClass(this.checkedEmployessList, item),
change: (item) => this.$func.toChecked(this.checkedEmployessList, item),
}]
},
resList() {
let data = [{
type: 'employee',
data: this.checkedEmployessList,
cancel: (item) => this.$func.removeEle(this.checkedEmployessList, item)
}]
if (this.isDepartment) {
data.unshift({
type: 'department',
data: this.checkedDepartmentList,
cancel: (item) => this.$func.removeEle(this.checkedDepartmentList, item)
})
}
return data
}
},
data() {
return {
checkedDepartmentList: [],
checkedEmployessList: [],
}
},
methods: {
saveDialog() {
let checkedList = [...this.checkedDepartmentList, ...this.checkedEmployessList].map(item => ({
type: item.employeeName ? 1 : 3,
targetId: item.id,
name: item.employeeName || item.departmentName
}))
this.$emit('change', checkedList)
},
delList() {
this.checkedDepartmentList = [];
this.checkedEmployessList = []
}
}
}
</script>
<style>
@import "../../css/dialog.css";
</style>

146
src/component_old/dialog/employeesRoleDialog.vue

@ -1,146 +0,0 @@
<template>
<el-dialog title="选择成员" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索成员" v-model="searchVal" @input="getDebounceData($event,activeName)">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="组织架构" name="1"></el-tab-pane>
<el-tab-pane label="角色列表" name="2"></el-tab-pane>
</el-tabs>
<p class="ellipsis tree_nav" v-if="activeName==1&&!searchVal">
<span @click="getDepartmentList(0)" class="ellipsis">天下</span>
<span v-for="(item,index) in departments.titleDepartments" class="ellipsis"
:key="index+'a'" @click="getDepartmentList(item.id)">{{item.departmentName}}</span>
</p>
<selectBox :list="list" style="height: 360px;"/>
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data', 'isDepartment'],
watch: {
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.activeName = "1";
this.getDepartmentList();
this.searchVal = "";
if(this.data !== null) {
this.checkedEmployessList = this.data.filter(item => item.type === 1).map(({ name, targetId }) => ({
employeeName: name,
id: targetId
}));
this.checkedRoleList = this.data.filter(item => item.type === 2).map(({ name, targetId }) => ({
roleName: name,
roleId: targetId
}));
this.checkedDepartmentList = this.data.filter(item => item.type === 3).map(({ name, targetId }) => ({
departmentName: name,
id: targetId
}));
}
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedEmployessList.length + this.checkedRoleList.length + this.checkedDepartmentList.length
},
list() {
if (this.activeName === '2') {
return [{
type: 'role',
not: false,
data: this.roles,
isActiveItem: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'roleId'),
change: (item) => this.$func.toChecked(this.checkedRoleList, item, 'roleId')
}]
} else {
return [{
isDepartment: this.isDepartment,
type: 'department',
data: this.departments.childDepartments,
isActive: (item) => this.$func.toggleClass(this.checkedDepartmentList, item),
change: (item) => this.$func.toChecked(this.checkedDepartmentList, item),
next: (item) => this.getDepartmentList(item.id)
}, {
type: 'employee',
data: this.departments.employees,
isActive: (item) => this.$func.toggleClass(this.checkedEmployessList, item),
change: (item) => this.$func.toChecked(this.checkedEmployessList, item),
}]
}
},
resList() {
let data = [{
type: 'role',
data: this.checkedRoleList,
cancel: (item) => this.$func.removeEle(this.checkedRoleList, item, 'roleId')
}, {
type: 'employee',
data: this.checkedEmployessList,
cancel: (item) => this.$func.removeEle(this.checkedEmployessList, item)
}]
if (this.isDepartment) {
data.splice(1, 0, {
type: 'department',
data: this.checkedDepartmentList,
cancel: (item) => this.$func.removeEle(this.checkedDepartmentList, item)
})
}
return data
}
},
data() {
return {
checkedRoleList: [],
checkedEmployessList: [],
checkedDepartmentList: []
}
},
methods: {
handleClick() {
this.searchVal = "";
this.conditionRoleSearchName = "";
if (this.activeName == 1) {
this.getDepartmentList();
} else {
this.getRoleList();
}
},
saveDialog() {
let checkedList = [...this.checkedRoleList, ...this.checkedEmployessList, ...this.checkedDepartmentList].map(item => ({
type: item.employeeName ? 1 : (item.roleName ? 2 : 3),
targetId: item.id || item.roleId,
name: item.employeeName || item.roleName || item.departmentName
}))
this.$emit('change', checkedList)
},
delList() {
this.checkedEmployessList = [];
this.checkedRoleList = [];
this.checkedDepartmentList = []
}
}
}
</script>
<style>
@import "../../css/dialog.css";
</style>

72
src/component_old/dialog/errorDialog.vue

@ -1,72 +0,0 @@
<!--
* @Date: 2022-08-04 16:29:35
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:16:58
* @FilePath: /Workflow/src/components/dialog/errorDialog.vue
-->
<template>
<el-dialog title="提示" :visible.sync="visibleDialog">
<div class="ant-confirm-body">
<i class="anticon anticon-close-circle" style="color: #f00;"></i>
<span class="ant-confirm-title">当前无法发布</span>
<div class="ant-confirm-content">
<div>
<p class="error-modal-desc">以下内容不完善需进行修改</p>
<div class="error-modal-list">
<div class="error-modal-item" v-for="(item,index) in list" :key="index">
<div class="error-modal-item-label">流程设计</div>
<div class="error-modal-item-content">{{item.name}} 未选择{{item.type}}</div>
</div>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="visibleDialog = false">我知道了</el-button>
<el-button type="primary" @click="visibleDialog = false">前往修改</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: ["list", "visible"],
data() {
return {
visibleDialog: false,
}
},
watch: {
visible(val) {
this.visibleDialog = val
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
}
}
</script>
<style scoped>
.ant-confirm-body .ant-confirm-title {
color: rgba(0, 0, 0, .85);
font-weight: 500;
font-size: 16px;
line-height: 1.4;
display: block;
overflow: hidden
}
.ant-confirm-body .ant-confirm-content {
margin-left: 38px;
font-size: 14px;
color: rgba(0, 0, 0, .65);
margin-top: 8px
}
.ant-confirm-body>.anticon {
font-size: 22px;
margin-right: 16px;
float: left
}
</style>

92
src/component_old/dialog/roleDialog.vue

@ -1,92 +0,0 @@
<!--
* @Date: 2022-08-04 16:29:35
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:25:18
* @FilePath: /Workflow/src/components/dialog/roleDialog.vue
-->
<template>
<el-dialog title="选择角色" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索角色" v-model="searchVal" @input="getDebounceData($event,2)">
<selectBox :list="list" />
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data'],
watch: {
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.getRoleList();
this.searchVal = "";
this.checkedRoleList = this.data.map(({ name, targetId }) => ({
roleName: name,
roleId: targetId
}));
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedRoleList.length
},
list() {
return [{
type: 'role',
not: true,
data: this.roles,
isActive: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'roleId'),
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
change: (item) => this.checkedRoleList = [item]
}]
},
resList() {
return [{
type: 'role',
data: this.checkedRoleList,
cancel: (item) => this.$func.removeEle(this.checkedRoleList, item, 'roleId')
}]
}
},
data() {
return {
checkedRoleList: [],
}
},
methods: {
saveDialog() {
let checkedList = this.checkedRoleList.map(item => ({
type: 2,
targetId: item.roleId,
name: item.roleName
}))
this.$emit('change', checkedList)
},
delList() {
this.checkedRoleList = [];
}
}
}
</script>
<style>
@import "../../css/dialog.css";
</style>

151
src/component_old/projectDialog/index.vue

@ -1,151 +0,0 @@
<template>
<div>
<div>
<el-button size="small" @click="showDialog()">选择考核项目</el-button>
</div>
<el-dialog title="提示" :visible.sync="dialogVisible" width="60%" :append-to-body="true">
<div class="gva-search-box">
<el-form ref="searchForm" :inline="true" :model="projectSearchInfo">
<el-form-item label="考核项目名称">
<el-input
placeholder="请输入名称"
v-model="projectSearchInfo.title"
clearable>
</el-input>
</el-form-item>
<!-- <el-form-item label="考核项目状态">
<el-select v-model="projectSearchInfo.state" clearable placeholder="请选择状态">
<el-option :value=1 label="正常">正常</el-option>
<el-option :value=2 label="禁止">禁止</el-option>
</el-select>
</el-form-item> -->
<el-form-item label="所属考核类别">
<el-select v-model="projectSearchInfo.parentId" clearable placeholder="请选择状态">
<el-option
v-for="item in dutyclasslist"
:key="item.outId"
:label="item.title"
:value="item.outId">
</el-option>
</el-select>
</el-form-item>
<el-form-item>
<el-button size="mini" type="primary" icon="el-icon-search" @click="onSubmit">查询</el-button>
<!-- <el-button size="mini" icon="el-icon-refresh" @click="onReset">重置</el-button> -->
</el-form-item>
</el-form>
</div>
<div class="gva-table-box">
<el-table :data="assessList">
<!-- <el-table-column
type="selection"
width="55"
/> -->
<el-table-column align="left" label="所属考核类别" prop="parentTitle"/>
<el-table-column align="left" label="考核项目名称" prop="title"/>
<el-table-column align="left" label="考核项目说明" prop="content"/>
<el-table-column align="left" fixed="right" label="操作" width="200">
<template #default="scope">
<el-button type="primary" round @click="checked(scope.row)">选中</el-button>
</template>
</el-table-column>
</el-table>
<div class="gva-pagination">
<el-pagination
:current-page="projectSearchInfo.page"
:page-size="projectSearchInfo.pageSize"
:page-sizes="[10, 30, 50, 100]"
:total="total"
layout="total, sizes, prev, pager, next, jumper"
@current-change="handleCurrentChange"
@size-change="handleSizeChange"
/>
</div>
</div>
<!-- <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span> -->
</el-dialog>
</div>
</template>
<script>
import {
dutyclasslist
} from '@/api/duty/dimension'
import {
assessList,
} from '@/api/duty/project'
export default {
data() {
return {
projectTitle:'',
total:'',
searchList:{
page:1,
pagesize:10000,
},
dutyclasslist:{},
projectSearchInfo:{
page: 1,
pageSize: 10,
state:1,
},
dialogVisible: false,
assessList:null,
}
},
created () {
this.getProjectList();
this.getDutyclasslist();
},
methods: {
//
onSubmit() {
this.page = 1
this.pageSize = 10
this.getProjectList()
},
// pagesize
handleSizeChange(val) {
this.projectSearchInfo.pageSize=val
},
//
handleCurrentChange(val) {
this.projectSearchInfo.page=val
},
//
async getDutyclasslist(){
const res = await dutyclasslist(this.searchList)
this.dutyclasslist=res.data.list;
},
//
showDialog(){
this.dialogVisible=true;
},
//
async getProjectList(){
const res = await assessList(this.projectSearchInfo)
this.assessList=res.data.list;
this.projectSearchInfo.page=res.data.page;
this.projectSearchInfo.pageSize=res.data.pageSize;
this.total=res.data.total;
},
//
checked(row){
this.projectTitle=row.title;
this.$emit('checkedInfo',row)
this.dialogVisible=false
},
}
}
</script>
<style lang="scss" scoped>
</style>

88
src/component_old/selectBox.vue

@ -1,88 +0,0 @@
<!-- eslint-disable vue/no-template-key -->
<!--
* @Date: 2022-08-26 17:18:14
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:17:23
* @FilePath: /Workflow/src/components/selectBox.vue
-->
<template>
<ul class="select-box">
<template v-for="elem in list">
<template v-if="elem.type === 'role'">
<li v-for="item in elem.data" :key="item.roleId"
class="check_box"
:class="{active: elem.isActive && elem.isActive(item), not: elem.not}"
@click="elem.change(item)">
<a :title="item.description" :class="{active: elem.isActiveItem && elem.isActiveItem(item)}">
<img src="@/assets/images/icon_role.png">{{item.roleName}}
</a>
</li>
</template>
<template v-if="elem.type === 'department'">
<li v-for="item in elem.data" :key="item.id" class="check_box" :class="{not: !elem.isDepartment}">
<a v-if="elem.isDepartment"
:class="elem.isActive(item) && 'active'"
@click="elem.change(item)">
<img src="@/assets/images/icon_file.png">{{item.departmentName}}</a>
<a v-else><img src="@/assets/images/icon_file.png">{{item.departmentName}}</a>
<i @click="elem.next(item)">下级</i>
</li>
</template>
<template v-if="elem.type === 'employee'">
<li v-for="item in elem.data" :key="item.id" class="check_box">
<a :class="elem.isActive(item) && 'active'"
@click="elem.change(item)"
:title="item.departmentNames">
<img v-if="item.icon!=''" :src="item.icon">
<img v-else-if="(item.icon==''&&item.iconToBase64!='') " :src="item.iconToBase64">
<img v-else src="@/assets/images/icon_people.png">
{{item.employeeName}}
</a>
</li>
</template>
</template>
</ul>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => []
}
}
}
</script>
<style lang="less">
.select-box {
height: 420px;
overflow-y: auto;
li {
padding: 5px 0;
i {
float: right;
padding-left: 24px;
padding-right: 10px;
color: #3195f8;
font-size: 12px;
cursor: pointer;
background: url(~@/assets/images/next_level_active.png) no-repeat 10px center;
border-left: 1px solid rgb(238, 238, 238);
}
a.active+i {
color: rgb(197, 197, 197);
background-image: url(~@/assets/images/next_level.png);
pointer-events: none;
}
img {
width: 14px;
vertical-align: middle;
margin-right: 5px;
}
}
}
</style>

100
src/component_old/selectResult copy.vue

@ -1,100 +0,0 @@
<!-- eslint-disable vue/no-template-key -->
<!--
* @Date: 2022-08-26 16:29:24
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:17:24
* @FilePath: /Workflow/src/components/selectResult.vue
-->
<template>
<div class="select-result l">
<p class="clear">已选{{total}}
<a @click="$emit('del')">清空</a>
</p>
<ul>
<template v-for="({type, data, cancel}) in list">
<template v-if="type === 'role'">
<li v-for="item in data" :key="item.roleId">
<img src="@/assets/images/icon_role.png">
<span>{{item.roleName}}</span>
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
<template v-if="type === 'department'">
<li v-for="item in data" :key="item.id">
<img src="@/assets/images/icon_file.png">
<span>{{item.departmentName}}</span>
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
<template v-if="type === 'employee'">
<li v-for="item in data" :key="item.id">
<img src="@/assets/images/icon_people.png">
<span>{{item.employeeName}}</span>
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
</template>
</ul>
</div>
</template>
<script>
export default {
props: {
total: {
type: Number,
default: 0
},
list: {
type: Array,
default: () => [{ type: 'role', data: [], cancel: function () { } }]
}
}
}
</script>
<style lang="less">
.select-result {
width: 276px;
height: 100%;
font-size: 12px;
ul {
height: 460px;
overflow-y: auto;
li {
margin: 11px 26px 13px 19px;
line-height: 17px;
span {
vertical-align: middle;
}
img {
&:first-of-type {
width: 14px;
vertical-align: middle;
margin-right: 5px;
}
&:last-of-type {
float: right;
margin-top: 2px;
width: 14px;
}
}
}
}
p {
padding-left: 19px;
padding-right: 20px;
line-height: 37px;
border-bottom: 1px solid #f2f2f2;
a {
float: right;
}
}
}
</style>

1
src/components/dialog/employeesDialog.vue

@ -33,6 +33,7 @@ export default {
if (val) {
this.getDepartmentList();
this.searchVal = "";
console.log("visible----------->",this.data);
this.checkedEmployessList = this.data.filter(item => item.type === 1).map(({ name, targetId }) => ({
employeeName: name,
id: targetId

61
src/component_old/drawer/approverDrawer.vue → src/components/drawer/appexecutorDrawer.vue

@ -1,14 +1,15 @@
<template>
<el-drawer :append-to-body="true" title="审批人设置" :visible.sync="approverDrawer" direction="rtl" class="set_promoter" size="550px" :before-close="saveApprover">
<el-drawer :append-to-body="true" title="审批1人设置" :visible.sync="appcarryoutDrawer" direction="rtl" class="set_promoter" size="550px" :before-close="saveApprover">
<div class="demo-drawer__content">
<div class="drawer_content">
<div class="approver_content">
<el-radio-group v-model="approverConfig.settype" class="clear" @change="changeType">
<el-radio :label="1">指定成员</el-radio>
<el-radio :label="2">负责人</el-radio>
<el-radio :label="2">主管</el-radio>
<el-radio :label="4">发起人自选</el-radio>
<el-radio :label="5">发起人自己</el-radio>
<el-radio :label="7">连续多负责人</el-radio>
<el-radio :label="7">连续多级主管</el-radio>
<el-radio :label="8" v-if="nodeOptionalButton">指定审批节点自选</el-radio>
</el-radio-group>
<el-button type="primary" @click="addApprover" v-if="approverConfig.settype==1">添加/修改成员</el-button>
@ -23,10 +24,10 @@
<p>
<span>发起人的</span>
<select v-model="approverConfig.directorLevel">
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'直接':''+item+''}}负责人</option>
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'直接':''+item+''}}主管</option>
</select>
</p>
<p class="tip">找不到负责人时由上级负责人代审批</p>
<p class="tip">找不到主管时由上级主管代审批</p>
</div>
<div class="approver_self" v-if="approverConfig.settype==5">
<p>该审批节点设置发起人自己审批人默认为发起人</p>
@ -42,8 +43,8 @@
<el-radio :label="2">指定成员</el-radio>
<el-radio :label="3">指定角色</el-radio>
</el-radio-group>
<el-button type="primary" size="mini" @click="addApprover" v-if="approverConfig.selectRange==2">添加/修改成员</el-button>
<el-button type="primary" size="mini" @click="addRoleApprover" v-if="approverConfig.selectRange==3">添加/修改角色</el-button>
<el-button type="primary" @click="addApprover" v-if="approverConfig.selectRange==2">添加/修改成员</el-button>
<el-button type="primary" @click="addRoleApprover" v-if="approverConfig.selectRange==3">添加/修改角色</el-button>
<p class="selected_list" v-if="approverConfig.selectRange==2||approverConfig.selectRange==3">
<span v-for="(item,index) in approverConfig.nodeUserList" :key="index">{{item.name}}
<img src="@/assets/images/add-close1.png" @click="$func.removeEle(approverConfig.nodeUserList,item,'targetId')">
@ -56,7 +57,7 @@
<p style="padding-bottom:20px">
<span>发起人的</span>
<select v-model="approverConfig.examineEndDirectorLevel">
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'最高':''+item}}层级负责人</option>
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'最高':''+item}}层级主管</option>
</select>
</p>
</div>
@ -67,7 +68,7 @@
<br/>
<el-radio :label="2" v-if="approverConfig.settype!=2">会签(须所有审批人同意)</el-radio>
<br/>
<el-radio :label="3" v-if="approverConfig.settype!=2">非会签(有一审批人同意即可)</el-radio>
<el-radio :label="3" v-if="approverConfig.settype!=2">非会签(有一审批人同意即可)</el-radio>
</el-radio-group>
</div>
<div class="approver_some" v-if="approverConfig.settype==2||approverConfig.settype==7">
@ -78,6 +79,7 @@
<el-radio :label="2">转交给审核管理员</el-radio>
</el-radio-group>
</div>
<div class="approver_some" v-if="approverConfig.settype==8">
<p>可选节点列表</p>
<el-radio-group v-model="approverConfig.customNode" class="clear">
@ -85,6 +87,8 @@
</el-radio-group>
</div>
<div class="approver_some">
<p>退回设置</p>
<el-radio-group v-model="approverConfig.sendBackNode" class="clear">
@ -93,7 +97,15 @@
</el-radio-group>
</div>
</div>
<div class="demo-drawer__footer clear">
<el-button type="primary" @click="saveApprover"> </el-button>
<el-button @click="closeDrawer"> </el-button>
@ -127,39 +139,36 @@ export default {
approverEmplyessList: [],
checkedRoleList: [],
checkedList: [],
nodeOptionalButton:false,
nodeNumber:0,
nodeVerify:[],
nodeAllVerify:[],
nodeOptional:[],
nodeOptionalButton:false,
pickNodeKey:null,
pickCallBackKey:null
}
},
computed: {
...mapState(['approverConfig1', 'approverDrawer']),
...mapState(['appcarryoutConfig1', 'appcarryoutDrawer']),
},
watch: {
approverConfig1(val) {
appcarryoutConfig1(val) {
// console.log("111111-->",val.value)
this.approverConfig = val.value;
this.getAllFatchNode(val.value.fromNode,this.nodeAllVerify);
console.log("审批人设置------122------>",val,this.nodeAllVerify,this.nodeOptional)
// this.approverConfig.sendBackNode = "beginnode"
// this.$set(this.approverConfig,"sendBackNode","beginnode")
},
nodeConfig:{
handler(val){
console.log("节点变化---》",val)
// console.log("---",val)
this.nodeAllVerify=[]
this.getAllNodeCont(val)
console.log("节点变化--123-1》",this.nodeVerify,this.nodeAllVerify)
},
deep: true,
immediate: true
}
},
methods: {
...mapMutations(['setApproverConfig', 'setApprover']),
...mapMutations(['setAppCarryOutConfig', 'setAppCarryOut']),
changeRange() {
this.approverConfig.nodeUserList = [];
},
@ -194,27 +203,25 @@ export default {
},
saveApprover() {
this.approverConfig.error = !this.$func.setApproverStr(this.approverConfig)
this.setApproverConfig({
this.setAppCarryOutConfig({
value: this.approverConfig,
flag: true,
id: this.approverConfig1.id
id: this.appcarryoutConfig1.id
})
console.log("确定条件--------->",this.approverConfig);
this.$emit("update:nodeConfig", this.approverConfig);
this.closeDrawer()
},
closeDrawer() {
this.setApprover(false)
this.setAppCarryOut(false)
},
//
async getAllNodeCont(val){
const res = await judgeOptionalNode(val)
console.log("判断是否显示(指定审批节点自选)选项及可选节点",res)
// console.log("",res)
if(res.code == 0){
this.nodeAllVerify = res.data.allcont
}
},
//
async getAllFatchNode(key,listcont){
let sendData = {
@ -222,7 +229,7 @@ export default {
allcont:listcont
}
const res = await getAllParentNode(sendData);
console.log("获取所有父级审批节点",res)
// console.log("",res)
if(res.code == 0){
this.nodeOptional = res.data.allcont
if(res.data.total > 0){

6
src/components/drawer/approverDrawer.vue

@ -157,7 +157,7 @@ export default {
},
nodeConfig:{
handler(val){
console.log("节点变化---》",val)
// console.log("---",val)
this.nodeAllVerify=[]
this.getAllNodeCont(val)
},
@ -215,7 +215,7 @@ export default {
//
async getAllNodeCont(val){
const res = await judgeOptionalNode(val)
console.log("判断是否显示(指定审批节点自选)选项及可选节点",res)
// console.log("",res)
if(res.code == 0){
this.nodeAllVerify = res.data.allcont
}
@ -227,7 +227,7 @@ export default {
allcont:listcont
}
const res = await getAllParentNode(sendData);
console.log("获取所有父级审批节点",res)
// console.log("",res)
if(res.code == 0){
this.nodeOptional = res.data.allcont
if(res.data.total > 0){

25
src/components/nodeWrap.vue

@ -142,7 +142,7 @@ export default {
}
},
computed: {
...mapState(['isTried', 'flowPermission1', 'approverConfig1', 'copyerConfig1', 'conditionsConfig1']),
...mapState(['isTried', 'flowPermission1', 'approverConfig1', 'copyerConfig1', 'conditionsConfig1','appcarryoutConfig1']),
defaultText() {
return this.placeholderList[this.nodeConfig.type]
},
@ -167,6 +167,7 @@ export default {
}
},
copyerConfig1(data) {
console.log("监听审批节点---------->",date)
if (data.flag && data.id === this._uid) {
this.$emit('update:nodeConfig', data.value)
}
@ -176,6 +177,12 @@ export default {
this.$emit('update:nodeConfig', data.value)
}
},
appcarryoutConfig1(data){
console.log("监听执行节点---------->",data)
if (data.flag && data.id === this._uid) {
this.$emit('update:nodeConfig', data.value)
}
},
},
methods: {
...mapMutations([
@ -186,7 +193,9 @@ export default {
'setFlowPermission',
'setApproverConfig',
'setCopyerConfig',
'setConditionsConfig'
'setConditionsConfig',
`setAppCarryOut`,
`setAppCarryOutConfig`
]),
clickEvent(index) {
if (index || index === 0) {
@ -272,6 +281,17 @@ export default {
flag: false,
id: this._uid
})
} else if (type == 5) {
this.setAppCarryOut(true)
this.setAppCarryOutConfig({
value: {
...JSON.parse(JSON.stringify(this.nodeConfig)),
...{ settype: this.nodeConfig.settype ? this.nodeConfig.settype : 5 }
},
flag: false,
id: this._uid
})
console.log("节点类型--->",this.nodeConfig)
} else if (type == 2) {
this.setCopyer(true)
this.setCopyerConfig({
@ -280,6 +300,7 @@ export default {
id: this._uid
})
} else {
this.setCondition(true)
this.setConditionsConfig({
value: JSON.parse(JSON.stringify(this.nodeConfig)),

1
src/components/selectBox.vue

@ -26,6 +26,7 @@
<img src="@/assets/images/icon_file.png">{{item.departmentName}}</a>
<a v-else><img src="@/assets/images/icon_file.png">{{item.departmentName}}</a>
<i @click="elem.next(item)">下级</i>
{{ elem.isActive(item) }}
</li>
</template>
<template v-if="elem.type === 'employee'">

16
src/css/workflow.css

@ -1116,8 +1116,8 @@ html {
-ms-flex-pack: justify;
justify-content: space-between;
height: 40px;
width: 125px;
right: 40px;
width: 80px;
right: 25px;
margin-top: 30px;
z-index: 10
}
@ -1379,14 +1379,16 @@ html {
}
.dingflow-design {
width: 100%;
width: 98%;
background-color: #f5f5f7;
overflow: auto;
position: absolute;
bottom: 0;
left: 0;
right: 0;
top: 0
/* bottom: 10px; */
left: 10px;
right: 10px;
/* top: 60px */
top: 140px;
bottom: 60px;
}
.dingflow-design .box-scale {

94
src/component_old/addNode.vue → src/customworkflow/addNode.vue

@ -5,25 +5,31 @@
<div class="add-node-popover-body">
<a class="add-node-popover-item approver" @click="addType(1)">
<div class="item-wrapper">
<span class="iconfont"></span>
<span class="iconfont"><i class="el-icon-s-check"></i></span>
</div>
<p>审批人</p>
</a>
<a class="add-node-popover-item notifier" @click="addType(2)">
<div class="item-wrapper">
<span class="iconfont"></span>
<span class="iconfont"><i class="el-icon-s-promotion"></i></span>
</div>
<p>抄送人</p>
</a>
<a class="add-node-popover-item condition" @click="addType(4)">
<div class="item-wrapper">
<span class="iconfont"></span>
<span class="iconfont"><i class="fa fa-sitemap"></i></span>
</div>
<p>条件分支</p>
</a>
<a class="add-node-popover-item copenode" @click="addType(3)">
<div class="item-wrapper">
<span class="iconfont"><i class="el-icon-edit-outline"></i></span>
</div>
<p>处理</p>
</a>
</div>
<button class="btn" type="button" slot="reference">
<span class="iconfont"></span>
<span class="iconfont"><i class="el-icon-plus"></i></span>
</button>
</el-popover>
</div>
@ -32,23 +38,23 @@
<script>
import { v4 } from 'uuid'
export default {
props: ["nodeConfig","childNodeP","step"],
props: ["childNodeP","nodeConfig"],
data() {
return {
visible: false
visible: false, //
}
},
methods: {
addType(type) {
console.log("添加节点--2---》",type,this.childNodeP,this.nodeConfig)
const snowflake = v4().replaceAll('-','').toString();
const timeUnix = new Date().getTime()
let fromNodeNumber = "";
let gotoNodeNumber = "";
created(){
},
methods:{
//
addType(type){
console.log("添加操作数据处理---》",type,this.childNodeP,this.nodeConfig)
const snowflake = v4().replaceAll('-','').toString(); //
let fromNodeNumber = ""; //
let gotoNodeNumber = ""; //
//
if(this.nodeConfig != null && this.nodeConfig.nodeNumber != null && this.nodeConfig.nodeNumber != ""){
fromNodeNumber = this.nodeConfig.nodeNumber;
this.nodeConfig.gotoNode = [snowflake];
@ -99,23 +105,36 @@ export default {
"fromNode": fromNodeNumber,
"gotoNode":[gotoNodeNumber]
}
}else if (type == 3) {
data = {
"nodeNumber":snowflake,
"nodeName": "执行人",
"error": true,
"type": 3,
"settype": 1,
"selectMode": 0,
"selectRange": 0,
"directorLevel": 1,
"examineMode": 1,
"noHanderAction": 1,
"examineEndDirectorLevel": 0,
"childNode": this.childNodeP,
"nodeUserList": [],
"fromNode": fromNodeNumber,
"gotoNode":[gotoNodeNumber],
"sendBackNode":"beginnode",
"executionaddress":""
}
}
console.log("添加节点--1---》",data,this.childNodeP,this.nodeConfig)
this.$emit("update:childNodeP", data)
} else {
//
const snowflake1 = v4().replaceAll('-','').toString();
const snowflake2 = v4().replaceAll('-','').toString();
if(this.childNodeP){
console.log("添加节点--3--》",this.childNodeP)
// if(this.childNodeP.length > 0){
// this.childNodeP.forEach(item => {
// item.fromNode = snowflake1
// console.log("--4--",item)
// });
// }
this.childNodeP.fromNode =snowflake1
};
let selectNode = {
this.childNodeP.fromNode =snowflake1 //1
}
this.$emit("update:childNodeP", {
"nodeNumber":snowflake,
"nodeName": "路由",
"type": 4,
@ -126,30 +145,29 @@ export default {
"nodeNumber":snowflake1,
"nodeName": "条件1",
"error": true,
"type": 3,
"type": 5,
"priorityLevel": 1,
"conditionList": [],
"nodeUserList": [],
"databasecondition":[],
"fromNode": snowflake,
"gotoNode":gotoNodeNumber,
"childNode": this.childNodeP,
}, {
"nodeNumber":snowflake2,
"nodeName": "条件2",
"type": 3,
"type": 5,
"priorityLevel": 2,
"conditionList": [],
"nodeUserList": [],
"databasecondition":[],
"fromNode": snowflake,
"gotoNode":[],
"childNode": null
}]
};
console.log("添加节点--3---》",selectNode,this.childNodeP,this.nodeConfig)
this.$emit("update:childNodeP", selectNode)
}
})
}
},
}
}
</script>
@ -221,8 +239,7 @@ export default {
}
}
}
</style>
<style lang="less">
.add-node-popover-body {
display: flex;
@ -267,6 +284,11 @@ export default {
color: #15bc83
}
}
&.copenode {
.item-wrapper {
color: #FF6600
}
}
&:hover {
.item-wrapper {

137
src/customworkflow/dialog/employeesDialog.vue

@ -0,0 +1,137 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-20 15:41:47
@ 备注: 选择成员模组
-->
<template>
<el-dialog title="选择成员" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索成员" v-model="searchVal" @input="getDebounceData($event)">
<p class="ellipsis tree_nav" v-if="!searchVal">
<span @click="getDepartmentList(309)" class="ellipsis">所有</span>
<span v-for="(item,index) in departments.titleDepartments" class="ellipsis"
:key="index+'a'" @click="getDepartmentList(item.id)">{{item.departmentName}}</span>
</p>
<selectBox :list="list"/>
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox,selectResult },
mixins: [mixins],
props: ['visible', 'data', 'isDepartment'],
data() {
return {
checkedDepartmentList: [],
checkedEmployessList: [],
}
},
created(){
},
watch: {
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.getDepartmentList();
this.searchVal = "";
if(this.data){
this.checkedEmployessList = this.data.filter(item => item.type === 1).map(({ name, targetId ,icon ,iconToBase64}) => ({
employeeName: name,
id: targetId,
icon: icon,
iconToBase64: iconToBase64
}));
this.checkedDepartmentList = this.data.filter(item => item.type === 3).map(({ name, targetId }) => ({
departmentName: name,
id: targetId
}));
}
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedDepartmentList.length + this.checkedEmployessList.length
},
list() {
if (this.activeName === '2') {
return [{
type: 'role',
not: false,
data: this.roles,
isActiveItem: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'roleId'),
change: (item) => this.$func.toChecked(this.checkedRoleList, item, 'roleId')
}]
} else {
return [{
isDepartment: this.isDepartment,
type: 'department',
data: this.departments.childDepartments,
isActive: (item) => this.$func.toggleClass(this.checkedDepartmentList, item),
change: (item) => this.$func.toChecked(this.checkedDepartmentList, item),
next: (item) => this.getDepartmentList(item.id)
}, {
type: 'employee',
data: this.departments.employees,
isActive: (item) => this.$func.toggleClass(this.checkedEmployessList, item),
change: (item) => this.$func.toChecked(this.checkedEmployessList, item),
}]
}
},
//
resList() {
let data = [{
type: 'employee',
data: this.checkedEmployessList,
cancel: (item) => this.$func.removeEle(this.checkedEmployessList, item)
}]
if (this.isDepartment) {
data.unshift({
type: 'department',
data: this.checkedDepartmentList,
cancel: (item) => this.$func.removeEle(this.checkedDepartmentList, item)
})
}
// console.log("----",data)
return data
}
},
methods:{
saveDialog() {
let checkedList = [...this.checkedDepartmentList, ...this.checkedEmployessList].map(item => ({
type: item.employeeName ? "1" : "3",
targetId: item.id,
icon: item.icon,
iconToBase64: item.iconToBase64,
name: item.employeeName || item.departmentName
}))
// console.log("checkedList--->",checkedList);
this.$emit('change', checkedList)
},
//
delList() {
this.checkedDepartmentList = [];
this.checkedEmployessList = []
}
}
}
</script>
<style>
@import "../../css/dialog.css";
</style>

171
src/customworkflow/dialog/employeesRoleDialog.vue

@ -0,0 +1,171 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-22 08:38:45
@ 备注: 抄送人设置弹窗选择人员
-->
<template>
<el-dialog title="选择成员" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索成员" v-model="searchVal" @input="getDebounceData($event,activeName)">
<el-tabs v-model="activeName" @tab-click="handleClick">
<el-tab-pane label="组织架构" name="1"></el-tab-pane>
<el-tab-pane label="角色列表" name="2"></el-tab-pane>
</el-tabs>
<p class="ellipsis tree_nav" v-if="activeName==1&&!searchVal">
<span @click="getDepartmentList(309)" class="ellipsis">所有</span>
<span v-for="(item,index) in departments.titleDepartments" class="ellipsis"
:key="index+'a'" @click="getDepartmentList(item.id)">{{item.departmentName}}</span>
</p>
<selectBox :list="list" style="height: 360px;"/>
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data', 'isDepartment'],
data() {
return {
checkedDepartmentList: [], //
checkedEmployessList: [], //
checkedRoleList: [], //
}
},
created(){
},
watch: {
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.activeName = "1";
this.getDepartmentList();
this.searchVal = "";
if(this.data){
this.checkedEmployessList = this.data.filter(item => item.type === 1).map(({ name, targetId ,icon ,iconToBase64 }) => ({
employeeName: name,
id: targetId,
icon: icon,
iconToBase64: iconToBase64
}));
this.checkedRoleList = this.data.filter(item => item.type === 2).map(({ name, targetId }) => ({
roleName: name,
roleId: targetId
}));
this.checkedDepartmentList = this.data.filter(item => item.type === 3).map(({ name, targetId }) => ({
departmentName: name,
id: targetId
}));
}
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedEmployessList.length + this.checkedRoleList.length + this.checkedDepartmentList.length
},
//
list() {
if (this.activeName === '2') {
return [{
type: 'role',
not: false,
data: this.roles,
isActiveItem: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'roleId'),
change: (item) => this.$func.toChecked(this.checkedRoleList, item, 'roleId')
}]
} else {
return [{
isDepartment: this.isDepartment,
type: 'department',
data: this.departments.childDepartments,
isActive: (item) => this.$func.toggleClass(this.checkedDepartmentList, item),
change: (item) => this.$func.toChecked(this.checkedDepartmentList, item),
next: (item) => this.getDepartmentList(item.id)
}, {
type: 'employee',
data: this.departments.employees,
isActive: (item) => this.$func.toggleClass(this.checkedEmployessList, item),
change: (item) => this.$func.toChecked(this.checkedEmployessList, item),
}]
}
},
//
resList() {
let data = [{
type: 'role',
data: this.checkedRoleList,
cancel: (item) => this.$func.removeEle(this.checkedRoleList, item, 'roleId')
}, {
type: 'employee',
data: this.checkedEmployessList,
cancel: (item) => this.$func.removeEle(this.checkedEmployessList, item)
}]
if (this.isDepartment) {
data.splice(1, 0, {
type: 'department',
data: this.checkedDepartmentList,
cancel: (item) => this.$func.removeEle(this.checkedDepartmentList, item)
})
}
return data
},
},
methods:{
//
saveDialog() {
// let checkedList = [...this.checkedDepartmentList, ...this.checkedEmployessList].map(item => ({
// type: item.employeeName ? 1 : 3,
// targetId: item.id,
// icon: item.icon,
// iconToBase64: item.iconToBase64,
// name: item.employeeName || item.departmentName
// }))
let checkedList = [...this.checkedRoleList, ...this.checkedEmployessList, ...this.checkedDepartmentList].map(item => ({
type: item.employeeName ? 1 : (item.roleName ? 2 : 3),
targetId: item.id || item.roleId,
name: item.employeeName || item.roleName || item.departmentName,
icon: item.icon,
iconToBase64: item.iconToBase64,
}))
this.$emit('change', checkedList)
console.log("保存选择",checkedList)
},
//
delList() {
this.checkedEmployessList = [];
this.checkedRoleList = [];
this.checkedDepartmentList = []
},
//
handleClick() {
this.searchVal = "";
this.conditionRoleSearchName = "";
if (this.activeName == 1) {
this.getDepartmentList();
} else {
this.getRoleList();
}
},
}
}
</script>
<style lang='less'>
</style>

75
src/customworkflow/dialog/errorDialog.vue

@ -0,0 +1,75 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-25 09:36:59
@ 备注: 信息提示
-->
<template>
<el-dialog title="提示" :visible.sync="visibleDialog">
<div class="ant-confirm-body">
<i class="anticon anticon-close-circle" style="color: #f00;"></i>
<span class="ant-confirm-title">当前无法发布</span>
<div class="ant-confirm-content">
<div>
<p class="error-modal-desc">以下内容不完善需进行修改</p>
<div class="error-modal-list">
<div class="error-modal-item" v-for="(item,index) in list" :key="index">
<div class="error-modal-item-label">流程设计</div>
<div class="error-modal-item-content">{{item.name}} 未选择{{item.type}}</div>
</div>
</div>
</div>
</div>
</div>
<span slot="footer" class="dialog-footer">
<!-- <el-button @click="visibleDialog = false">我知道了</el-button> -->
<el-button type="primary" @click="visibleDialog = false">前往修改</el-button>
</span>
</el-dialog>
</template>
<script>
export default {
props: ["list", "visible"],
data() {
return {
visibleDialog: false,
}
},
created(){
},
watch: {
visible(val) {
this.visibleDialog = val
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
methods:{
}
}
</script>
<style scoped>
.ant-confirm-body .ant-confirm-title {
color: rgba(0, 0, 0, .85);
font-weight: 500;
font-size: 16px;
line-height: 1.4;
display: block;
overflow: hidden
}
.ant-confirm-body .ant-confirm-content {
margin-left: 38px;
font-size: 14px;
color: rgba(0, 0, 0, .65);
margin-top: 8px
}
.ant-confirm-body>.anticon {
font-size: 22px;
margin-right: 16px;
float: left
}
</style>

32
src/component_old/dialog/mixins.js → src/customworkflow/dialog/mixins.js

@ -1,4 +1,4 @@
import { getRoles, getDepartments, getEmployees } from "@/api/workflowapi/workflowaip"
import { getRoles, getDepartments, getEmployees,GetPositionUnify,SearchPositionUnify } from "@/api/workflowapi/workflowaip"
import { getOrgAndMan } from "@/api/workflowapi/workflowhraip"
export default {
data() {
@ -8,6 +8,7 @@ export default {
activeName: "1",
departments: {},
roles: [],
positionList:[],
}
},
methods: {
@ -15,31 +16,52 @@ export default {
let { data: { list } } = await getRoles()
this.roles = list;
},
//获取行政组织及人员列表
async getDepartmentList(parentId = 309) {
let sendForm = {
id:parentId.toString()
}
let { data } = await getOrgAndMan(sendForm)
console.log("获取人员信息------->",data)
// console.log("获取人员信息---125---->",data)
this.departments = data;
},
//获取岗位信息
async getPostList(){
let { data } = await GetPositionUnify();
this.positionList = data;
console.log("获取岗位信息---125---->",this.positionList)
},
//搜索岗位
async searchPostName(event){
let sendData ={
name:event.target.value
}
let { data } = await SearchPositionUnify(sendData);
this.positionList = data;
},
//搜索角色或成员
getDebounceData(event, type = 1) {
// console.log("搜索角色或成员---125---->",event, type)
this.$func.debounce(async function () {
if (event.target.value) {
let data = {
searchName: event.target.value,
pageNum: 1,
pageSize: 30
name: event.target.value,
page: 1,
pagesize: 30
}
// console.log("搜索角色或成员---1---->",data)
if (type == 1) {
this.departments.childDepartments = [];
let res = await getEmployees(data)
this.departments.employees = res.data.list
// console.log("搜索角色或成员---3---->",this.departments)
} else {
let res = await getRoles(data)
this.roles = res.data.list
}
} else {
// console.log("搜索角色或成员---2---->",event)
type == 1 ? await this.getDepartmentList() : await this.getRoleList();
}
}.bind(this))()

92
src/customworkflow/dialog/positionDialog.vue

@ -0,0 +1,92 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-28 13:42:18
@ 备注: 选择岗位
-->
<template>
<el-dialog title="选择岗位" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索岗位" v-model="searchVal" @input="searchPostName($event,2)">
<selectBox :list="list" />
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data'],
data() {
return {
checkedRoleList: [],
}
},
created(){
},
watch:{
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.getPostList();
this.searchVal = "";
this.checkedRoleList = this.data.map(({ name, targetId }) => ({
name: name,
id: targetId
}));
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedRoleList.length
},
list() {
return [{
type: 'position',
not: false,
data: this.positionList,
isActiveItem: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'id'),
change: (item) => this.$func.toChecked(this.checkedRoleList, item, 'id')
}]
},
resList() {
return [{
type: 'position',
data: this.checkedRoleList,
cancel: (item) => this.$func.removeEle(this.checkedRoleList, item, 'id')
}]
}
},
methods:{
saveDialog() {
let checkedList = this.checkedRoleList.map(item => ({
type: "position",
targetId: item.id,
name: item.name
}))
console.log("岗位保存--->",checkedList)
this.$emit('change', checkedList)
},
delList() {
this.checkedRoleList = [];
}
}
}
</script>
<style lang='less'>
</style>

92
src/customworkflow/dialog/roleDialog.vue

@ -0,0 +1,92 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-21 15:10:02
@ 备注: 角色弹窗
-->
<template>
<el-dialog title="选择角色" :visible.sync="visibleDialog" width="600px" append-to-body class="promoter_person">
<div class="person_body clear">
<div class="person_tree l">
<input type="text" placeholder="搜索角色" v-model="searchVal" @input="getDebounceData($event,2)">
<selectBox :list="list" />
</div>
<selectResult :total="total" @del="delList" :list="resList"/>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="$emit('update:visible',false)"> </el-button>
<el-button type="primary" @click="saveDialog"> </el-button>
</span>
</el-dialog>
</template>
<script>
import selectBox from '../selectBox.vue';
import selectResult from '../selectResult.vue';
import mixins from './mixins'
export default {
components: { selectBox, selectResult },
mixins: [mixins],
props: ['visible', 'data'],
data() {
return {
checkedRoleList: [],
}
},
created(){
},
watch:{
visible(val) {
this.visibleDialog = this.visible
if (val) {
this.getRoleList();
this.searchVal = "";
this.checkedRoleList = this.data.map(({ name, targetId }) => ({
roleName: name,
roleId: targetId
}));
}
},
visibleDialog(val) {
this.$emit('update:visible', val)
}
},
computed: {
total() {
return this.checkedRoleList.length
},
list() {
return [{
type: 'role',
not: true,
data: this.roles,
isActive: (item) => this.$func.toggleClass(this.checkedRoleList, item, 'roleId'),
// eslint-disable-next-line vue/no-side-effects-in-computed-properties
change: (item) => this.checkedRoleList = [item]
}]
},
resList() {
return [{
type: 'role',
data: this.checkedRoleList,
cancel: (item) => this.$func.removeEle(this.checkedRoleList, item, 'roleId')
}]
}
},
methods:{
saveDialog() {
let checkedList = this.checkedRoleList.map(item => ({
type: 2,
targetId: item.roleId,
name: item.roleName
}))
this.$emit('change', checkedList)
},
delList() {
this.checkedRoleList = [];
}
}
}
</script>
<style lang='less'>
</style>

379
src/customworkflow/drawer/approverDrawer.vue

@ -0,0 +1,379 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-21 13:04:13
@ 备注: 执行节点选择栏
-->
<template>
<el-drawer :append-to-body="true" :title="nodeTitle" :visible.sync="approverDrawer" direction="rtl" class="set_promoter" size="550px" :before-close="saveApprover">
<div class="demo-drawer__content">
<div class="drawer_content">
<!--选择处理界限-->
<div class="approver_content">
<el-radio-group v-model="approverConfig.settype" class="clear" @change="changeType">
<el-radio :label="1">指定成员</el-radio>
<el-radio :label="2">主管</el-radio>
<el-radio :label="3">行政岗位</el-radio>
<el-radio :label="4">发起人自选</el-radio>
<el-radio :label="5">发起人自己</el-radio>
<el-radio :label="7">连续多级主管</el-radio>
<el-radio :label="8" v-if="approverConfig.type == 3">指定审批节点自选</el-radio>
</el-radio-group>
<el-button type="primary" @click="addApprover" v-if="approverConfig.settype==1">添加/修改成员</el-button>
<p class="selected_list" v-if="approverConfig.settype==1">
<span v-for="(item,index) in approverConfig.nodeUserList" :key="index">{{item.name}}
<img src="@/assets/images/add-close1.png" @click="$func.removeEle(approverConfig.nodeUserList,item,'targetId')">
</span>
<a v-if="approverConfig.nodeUserList.length!=0" @click="approverConfig.nodeUserList=[]">清除</a>
</p>
</div>
<!--主管选项-->
<div class="approver_manager" v-if="approverConfig.settype==2">
<p>
<span>发起人的</span>
<select v-model="approverConfig.directorLevel">
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'直接':''+item+''}}主管</option>
</select>
</p>
<p class="tip">找不到主管时由上级主管代审批</p>
</div>
<div class="approver_manager" v-if="approverConfig.settype==3">
<el-button type="primary" @click="addApproverPost">添加/修改岗位</el-button>
<p class="selected_list" style="margin-top:30px">
<span v-for="(item,index) in approverConfig.nodeUserList" :key="index">{{item.name}}
<img src="@/assets/images/add-close1.png" @click="$func.removeEle(approverConfig.nodeUserList,item,'targetId')">
</span>
<a v-if="approverConfig.nodeUserList.length!=0&&approverConfig.selectRange!=1" @click="approverConfig.nodeUserList=[]">清除</a>
</p>
</div>
<!--发起人自选-->
<div class="approver_self_select" v-show="approverConfig.settype==4">
<el-radio-group v-model="approverConfig.selectMode" style="width: 100%;">
<el-radio :label="1">选一个人</el-radio>
<el-radio :label="2">选多个人</el-radio>
</el-radio-group>
<h3>选择范围</h3>
<el-radio-group v-model="approverConfig.selectRange" style="width: 100%;" @change="changeRange">
<el-radio :label="1">全公司</el-radio>
<el-radio :label="4">本部门</el-radio>
<el-radio :label="2">指定成员</el-radio>
<el-radio :label="3">指定角色</el-radio>
</el-radio-group>
<el-button type="primary" @click="addApprover" v-if="approverConfig.selectRange==2">添加/修改成员</el-button>
<el-button type="primary" @click="addRoleApprover" v-if="approverConfig.selectRange==3">添加/修改角色</el-button>
<p class="selected_list" v-if="approverConfig.selectRange==2||approverConfig.selectRange==3">
<span v-for="(item,index) in approverConfig.nodeUserList" :key="index">{{item.name}}
<img src="@/assets/images/add-close1.png" @click="$func.removeEle(approverConfig.nodeUserList,item,'targetId')">
</span>
<a v-if="approverConfig.nodeUserList.length!=0&&approverConfig.selectRange!=1" @click="approverConfig.nodeUserList=[]">清除</a>
</p>
</div>
<!--发起人自选-->
<div class="approver_self" v-if="approverConfig.settype==5">
<p>该审批节点设置发起人自己审批人默认为发起人</p>
</div>
<div class="approver_manager" v-if="approverConfig.settype==7">
<p>审批终点</p>
<p style="padding-bottom:20px">
<span>发起人的</span>
<select v-model="approverConfig.examineEndDirectorLevel">
<option v-for="item in directorMaxLevel" :value="item" :key="item">{{item==1?'最高':''+item}}层级主管</option>
</select>
</p>
</div>
<!--指定审批节点自选-->
<div class="approver_some" v-if="approverConfig.settype==8">
<p>可选节点列表</p>
<el-radio-group v-model="approverConfig.customNode" class="clear">
<el-radio v-for="item in nodeOptional" :label="item.nodeNumber" :key="item.nodeNumber" class="nodeGroupRadio">{{ item.nodeName }}编号{{ item.nodeNumber }}</el-radio>
</el-radio-group>
</div>
<div class="approver_some" v-if="(approverConfig.settype==1&&approverConfig.nodeUserList.length>1)||approverConfig.settype==2||approverConfig.settype==3||(approverConfig.settype==4&&approverConfig.selectMode==2)">
<p>多人审批时采用的审批方式</p>
<el-radio-group v-model="approverConfig.examineMode" class="clear">
<el-radio :label="1">依次审批</el-radio>
<br/>
<el-radio :label="2" v-if="approverConfig.settype!=2">会签(须所有审批人同意)</el-radio>
<br/>
<el-radio :label="3" v-if="approverConfig.settype!=2">非会签(有一位审批人同意即可)</el-radio>
</el-radio-group>
</div>
<div class="approver_some" v-if="approverConfig.settype==2||approverConfig.settype==7">
<p>审批人为空时</p>
<el-radio-group v-model="approverConfig.noHanderAction" class="clear">
<el-radio :label="1">自动审批通过/不允许发起</el-radio>
<br/>
<el-radio :label="2">转交给审核管理员</el-radio>
</el-radio-group>
</div>
<div class="approver_some" v-if="approverConfig.type == 3">
<div class="demo-input-suffix">
<p>任务执行页面</p>
<el-input
placeholder="请输入URL(例:execut/page?key={val}) {val}为地址参数值占位符"
suffix-icon="el-icon-s-promotion"
v-model="approverConfig.executionaddress"
clearable>
</el-input>
</div>
</div>
<div class="approver_some">
<p>退回设置</p>
<el-radio-group v-model="approverConfig.sendBackNode" class="clear">
<el-radio label="beginnode" class="nodeGroupRadio">发起人</el-radio>
<el-radio v-for="item in nodeOptional" :label="item.nodeNumber" :key="item.nodeNumber" class="nodeGroupRadio">{{ item.nodeName }}编号{{ item.nodeNumber }}</el-radio>
</el-radio-group>
</div>
</div>
<div class="demo-drawer__footer clear">
<el-button type="primary" @click="saveApprover"> </el-button>
<el-button @click="closeDrawer"> </el-button>
</div>
<employeesDialog
:visible.sync="approverVisible"
:data.sync="checkedList"
@change="sureApprover"
/>
<roleDialog
:visible.sync="approverRoleVisible"
:data.sync="checkedRoleList"
@change="sureRoleApprover"
/>
<positionDialog
:visible.sync="appPosistonVisible"
:data.sync="checkedPostList"
@change="surePostApprover"
/>
</div>
</el-drawer>
</template>
<script>
import { judgeOptionalNode,getAllParentNode } from "@/api/systemaccredit/systemapi";
import { mapState, mapMutations } from 'vuex'
import employeesDialog from '@/customworkflow/dialog/employeesDialog'
import roleDialog from '@/customworkflow/dialog/roleDialog'
import positionDialog from '@/customworkflow/dialog/positionDialog'
export default {
components: { employeesDialog,roleDialog,positionDialog },
props: ['directorMaxLevel','nodeConfig'],
data() {
return {
nodeTitle:'审批人设置',
approverConfig: {}, //
approverVisible: false, //
checkedList: [], //
approverRoleVisible: false, //
checkedRoleList: [], //
nodeOptional:[], //
appPosistonVisible: false, //
checkedPostList: [], //
}
},
created(){
// console.log("directorMaxLevel-->",this.directorMaxLevel)
// console.log("nodeConfig-->",this.nodeConfig)
},
computed: {
...mapState(['approverConfig1', 'approverDrawer']),
},
watch:{
//
approverConfig1(val) {
// console.log("-->",val.value)
this.approverConfig = val.value;
switch(this.approverConfig.type){
case 3:
this.nodeTitle='执行人设置';
break;
default:
this.nodeTitle='审批人设置';
break;
}
this.getAllFatchNode(val.value.fromNode,this.nodeAllVerify);
},
nodeConfig:{
handler(val){
// console.log("---",val)
this.nodeAllVerify=[]
this.getAllNodeCont(val)
},
deep: true,
immediate: true
}
},
methods:{
...mapMutations(['setApproverConfig', 'setApprover']),
//
saveApprover() {
this.approverConfig.error = !this.$func.setApproverStr(this.approverConfig)
this.setApproverConfig({
value: this.approverConfig,
flag: true,
id: this.approverConfig1.id
})
this.$emit("update:nodeConfig", this.approverConfig);
this.closeDrawer()
},
//
closeDrawer() {
this.setApprover(false)
},
//
async getAllNodeCont(val){
const res = await judgeOptionalNode(val)
// console.log("",res)
if(res.code == 0){
this.nodeAllVerify = res.data.allcont
}
},
//
async getAllFatchNode(key,listcont){
let sendData = {
id:key,
allcont:listcont
}
const res = await getAllParentNode(sendData);
// console.log("",res)
if(res.code == 0){
this.nodeOptional = res.data.allcont
if(res.data.total > 0){
this.nodeOptionalButton = true
}else{
this.nodeOptionalButton = false
}
}
},
//
changeType(val) {
this.approverConfig.nodeUserList = [];
this.approverConfig.examineMode = 1;
this.approverConfig.noHanderAction = 2;
if (val == 2) {
this.approverConfig.directorLevel = 1;
} else if (val == 4) {
this.approverConfig.selectMode = 1;
this.approverConfig.selectRange = 1;
} else if (val == 7) {
this.approverConfig.examineEndDirectorLevel = 1
}
},
///
addApprover() {
this.approverVisible = true;
this.checkedList = this.approverConfig.nodeUserList
// console.log("nodeUserList--------->",this.approverConfig.nodeUserList)
},
//
sureApprover(data) {
this.approverConfig.nodeUserList = data;
this.approverVisible = false;
},
//
changeRange() {
this.approverConfig.nodeUserList = [];
},
//
addRoleApprover() {
this.approverRoleVisible = true;
this.checkedRoleList = this.approverConfig.nodeUserList
},
//
sureRoleApprover(data) {
this.approverConfig.nodeUserList = data;
this.approverRoleVisible = false;
},
//
surePostApprover(data) {
this.approverConfig.nodeUserList = data;
this.appPosistonVisible = false;
// console.log("--------->",this.approverConfig.nodeUserList)
},
///
addApproverPost() {
this.appPosistonVisible = true;
this.checkedPostList = this.approverConfig.nodeUserList
// console.log("nodeUserList--------->",this.approverConfig.nodeUserList)
},
}
}
</script>
<style lang="less">
.nodeGroupRadio{
display: block;
width: 100%;
margin: 0px 0 0 10px;
}
.set_promoter {
.approver_content {
padding-bottom: 10px;
border-bottom: 1px solid #f2f2f2;
}
.approver_self_select .el-button,
.approver_content .el-button {
margin-bottom: 20px;
}
.approver_content .el-radio,
.approver_some .el-radio,
.approver_self_select .el-radio {
width: 27%;
margin-bottom: 20px;
}
.approver_manager p {
line-height: 32px;
}
.approver_manager select {
width: 420px;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
}
.approver_manager p.tip {
margin: 10px 0 22px 0;
font-size: 12px;
line-height: 16px;
color: #f8642d;
}
.approver_self {
padding: 28px 20px;
}
.approver_self_select,
.approver_manager,
.approver_content,
.approver_some {
padding: 20px 20px 0;
}
.approver_manager p:first-of-type,
.approver_some p {
line-height: 19px;
font-size: 14px;
margin-bottom: 14px;
}
.approver_self_select h3 {
margin: 5px 0 20px;
font-size: 14px;
font-weight: bold;
line-height: 19px;
}
}
</style>

756
src/customworkflow/drawer/conditionDrawer.vue

@ -0,0 +1,756 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-22 10:18:00
@ 备注: 条件设置
-->
<template>
<el-drawer :append-to-body="true" title="条件设置" :visible.sync="conditionDrawer" direction="rtl" class="condition_copyer" size="550px" :before-close="saveCondition">
<select v-model="conditionConfig.priorityLevel" class="priority_level">
<option v-for="item in conditionsConfig.conditionNodes.length" :value="item" :key="item">优先级{{item}}</option>
</select>
<div class="demo-drawer__content">
<div class="condition_content drawer_content">
<p class="tip">当审批单同时满足以下条件时进入此流程</p>
<ul>
<li v-for="(item,index) in conditionConfig.conditionList" :key="index">
<el-row>
<el-col :span="5"><span class="ellipsis">{{item.type==1?'发起人':item.showName}}</span></el-col>
<el-col :span="17">
<div v-if="item.type==1">
<p :class="conditionConfig.nodeUserList.length > 0?'selected_list':''" @click.self="addConditionRole" style="cursor:text">
<span v-for="(item1,index1) in conditionConfig.nodeUserList" :key="index1">
{{item1.name}}<img src="@/assets/images/add-close1.png" @click="$func.removeEle(conditionConfig.nodeUserList,item1,'targetId')">
</span>
<input type="text" placeholder="请选择具体人员/角色/部门" v-if="conditionConfig.nodeUserList.length == 0" @click="addConditionRole">
</p>
</div>
<div v-else-if="item.columnType == 'String' && item.showType == 'checkBox'">
<p class="check_box">
<a :class="$func.toggleStrClass(item,item1.key)&&'active'" @click="toStrChecked(item,item1.key)"
v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1">{{item1.value}}</a>
</p>
</div>
<div v-else-if="item.type==4" >
<el-row v-for="(item69,index69) in item.condition" :key="index69" :gutter="2">
<el-col :span="24" class="bottor_piayi">
<el-row>
<el-col :span="6">
<el-input v-model="item69.wordfield" placeholder="判断关键字"></el-input>
</el-col>
<el-col :span="item69.optType != 6?7:16">
<select v-model="item69.optType" style="width:100%" @change="myoptChhange($event,item69)">
<option value="1">小于</option>
<option value="2">大于</option>
<option value="3">小于等于</option>
<option value="4">等于</option>
<option value="5">大于等于</option>
<option value="6">介于两个数之间</option>
<option value="7">包含</option>
<option value="8">不包含</option>
</select>
</el-col>
<el-col v-if="item69.optType != 6" :span="9">
<el-input v-model="item69.factor.leftval" placeholder="请输入值"></el-input>
</el-col>
<el-col :span="2">
<el-button type="danger" icon="el-icon-delete" size="mini" circle style="margin-bottom:0px" @click="delmyCondition(index69,item.condition)"></el-button>
</el-col>
</el-row>
</el-col>
<el-col v-if="item69.optType == 6" :span="24" class="bottor_piayi">
<el-row>
<el-col :span="5">
<input type="text" style="width:75px;" class="mr_10" v-model="item69.factor.leftval" placeholder="请输入">
</el-col>
<el-col :span="5">
<select style="width:60px;" v-model="item69.factor.leftoptType">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
</el-col>
<el-col :span="4">
<span class="ellipsis" style="display:inline-block;width:60px;vertical-align: text-bottom;">{{item69.wordfield}}</span>
</el-col>
<el-col :span="5">
<select style="width:60px;" class="ml_10" v-model="item69.factor.rightoptType">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
</el-col>
<el-col :span="5">
<input type="text" style="width:75px;" class="mr_10" v-model="item69.factor.rightval" placeholder="请输入">
</el-col>
</el-row>
</el-col>
</el-row>
<el-button type="primary" size="mini" plain @click="addConditionEs(item.condition)">添加条件</el-button>
</div>
<div v-else-if="item.type==3">
<el-button v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1" type="text" style="padding: 6px 5px;" @click="openDataTable(item1,item)">{{item1.name}}</el-button>
</div>
</el-col>
<el-col :span="2" style="text-align: right;">
<!-- <a v-if="item.type==1" @click="conditionConfig.nodeUserList= [];$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==2" @click="$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==3" @click="conditionWordList=[];$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a> -->
<el-button v-if="item.type==1" type="danger" icon="el-icon-delete" size="mini" circle @click="conditionConfig.nodeUserList= [];$func.removeEle(conditionConfig.conditionList,item,'columnId')"></el-button>
<el-button v-if="item.type==2" type="danger" icon="el-icon-delete" size="mini" circle @click="$func.removeEle(conditionConfig.conditionList,item,'columnId')"></el-button>
<el-button v-if="item.type==3" type="danger" icon="el-icon-delete" size="mini" circle @click="conditionWordList=[];$func.removeEle(conditionConfig.conditionList,item,'columnId')"></el-button>
</el-col>
</el-row>
<div v-if="item.type==3" style="width:100%">
<el-row v-for="item4 in conditionWordList" :key="item4.tablekey" style="width:99%">
<el-col :span="4" style="word-wrap:break-word; word-break:break-all;">
数据表<br>{{ item4.tablekey }}
</el-col>
<el-col :span="20">
<el-row class="wordbody" v-for="item3 in item4.wordlist" :key="item3.tablekey" :gutter="5">
<el-col :span="6" style="word-wrap:break-word; word-break:break-all;">字段{{ item3.key }}</el-col>
<el-col :span="6">
<select v-model="item3.notation" style="width:100%" @change="equationChanage($event,item3)">
<option v-if="item3.type=='int'" value="1">小于</option>
<option v-if="item3.type=='int'" value="2">大于</option>
<option v-if="item3.type=='int'" value="3">小于等于</option>
<option v-if="item3.type=='int'" value="4">等于</option>
<option v-if="item3.type=='int'" value="5">大于等于</option>
<option v-if="item3.type=='int'" value="6">介于两个数之间</option>
<option v-if="item3.type=='string'" value="in">包含</option>
<option v-if="item3.type=='string'" value="notin">不包含</option>
</select>
</el-col>
<el-col :span="10">
<input v-if="item3.notation != 6" v-model="item3.equation.letfval" type="text" placeholder="请输入" style="width:100%">
</el-col>
<el-col :span="2">
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="$func.removeEle(item4.wordlist,item3,'key')"></el-button>
</el-col>
<el-col v-if="item3.notation == 6" :span="24" class="wordbody" >
<input type="text" style="width:75px;" class="mr_10" v-model="item3.equation.letfval">
<select style="width:60px;" v-model="item3.equation.leftnotation">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
<span class="ellipsis" style="display:inline-block;width:60px;vertical-align: text-bottom;">{{item3.key}}</span>
<select style="width:60px;" class="ml_10" v-model="item3.equation.rightnotation">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
<input type="text" style="width:75px;" v-model="item3.equation.rightval">
</el-col>
<el-col :span="24" class="wordbody" >
描述{{ item3.comment }}
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</li>
</ul>
<el-button type="primary" @click="addCondition">添加条件</el-button>
<el-dialog title="选择条件" :visible.sync="conditionVisible" width="480px" append-to-body class="condition_list">
<p>请选择用来区分审批流程的条件字段</p>
<p class="check_box">
<a :class="$func.toggleClass(conditionList,{columnId:0},'columnId')&&'active'" @click="$func.toChecked(conditionList,{columnId:0},'columnId')">发起人</a>
<a v-for="(item,index) in conditions" :key="index" :class="$func.toggleClass(conditionList,item,'columnId')&&'active'"
@click="$func.toChecked(conditionList,item,'columnId')">{{item.showName}}</a>
</p>
<span slot="footer" class="dialog-footer">
<el-button @click="conditionVisible = false"> </el-button>
<el-button type="primary" @click="sureCondition"> </el-button>
</span>
</el-dialog>
<!--选择数据表-->
<el-dialog title="选择表及条件字段" :visible.sync="tabelDialog" width="480px" append-to-body class="condition_list">
<template>
<el-select v-model="dataBaseTable" placeholder="请选择数据表!" style="width:100%" @change="tableChange">
<el-option
v-for="item in dataBaseTableList"
:key="item.key"
:label="item.name"
:value="item.key">
</el-option>
</el-select>
</template>
<template>
<el-table
:data="tableDataBaseWord"
border
ref="multipleTable"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
style="width: 100%" height="500">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="field"
label="表名"
>
</el-table-column>
<el-table-column
prop="type"
label="类型"
>
</el-table-column>
<el-table-column
prop="comment"
label="描述">
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="tabelDialog = false"> </el-button>
<el-button type="primary" @click="sureTabelWords"> </el-button>
</span>
</el-dialog>
</div>
<employeesRoleDialog
:visible.sync="conditionRoleVisible"
:data.sync="checkedList"
@change="sureConditionRole"
:isDepartment="true"
/>
<div class="demo-drawer__footer clear">
<el-button type="primary" @click="saveCondition"> </el-button>
<el-button @click="setCondition(false)"> </el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import employeesRoleDialog from '@/customworkflow/dialog/employeesRoleDialog'
import { getConditions,getDataBaseTable,getDataBaseTableCont } from "@/api/workflowapi/workflowaip"
export default {
components: {
employeesRoleDialog
},
data() {
return {
conditionsConfig: {
conditionNodes: [],
}, //
PriorityLevel: "", //
conditionConfig: {},
conditionRoleVisible: false, //
checkedList: [], //
conditionList:[], //
conditionVisible: false, //
conditions: [], //API
databaseradio:"", //
tabelDialog:false, //
dataBaseTable:"", //
dataBaseTableList:[], //
tableDataBaseWord:[], //
sureTableWords:[], //
conditionWordList:[], //
}
},
created(){
},
computed: {
...mapState(['tableId', 'conditionsConfig1', 'conditionDrawer']),
},
watch: {
conditionsConfig1(val) {
this.conditionsConfig = val.value;
this.PriorityLevel = val.priorityLevel
this.conditionConfig = val.priorityLevel
? this.conditionsConfig.conditionNodes[val.priorityLevel - 1]
: { nodeUserList: [], conditionList: [] }
},
},
methods:{
...mapMutations(['setCondition', 'setConditionsConfig']),
//
saveCondition(){
console.log("保存条件--->",this.conditionWordList)
console.log("保存条件--1->",this.conditionsConfig)
this.conditionConfig.databasecondition = this.conditionWordList
var a = this.conditionsConfig.conditionNodes.splice(this.PriorityLevel - 1, 1)//
this.conditionsConfig.conditionNodes.splice(this.conditionConfig.priorityLevel - 1, 0, a[0])//
this.conditionsConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
});
let isOk = true
for (var i = 0; i < this.conditionsConfig.conditionNodes.length; i++) {
this.conditionsConfig.conditionNodes[i].error = this.$func.conditionStr(this.conditionsConfig, i) == "请设置条件" && i != this.conditionsConfig.conditionNodes.length - 1
if(this.conditionsConfig.conditionNodes[i].conditionList.length > 0){
this.conditionsConfig.conditionNodes[i].conditionList.forEach(itan =>{
if(itan.columnType == "custom"){
if(itan.condition.length > 0){
itan.condition.forEach(itansun => {
if(itansun.wordfield=="" || itansun.wordfield==null){
isOk = false
}
})
}
}
})
}
}
if(!isOk){
this.$alert('自定义判断条件有未填写的内容!', '温馨提示', {
dangerouslyUseHTMLString: true
});
return false;
}
this.setConditionsConfig({
value: this.conditionsConfig,
flag: true,
id: this.conditionsConfig1.id
})
// this.setCondition(false)
this.setCondition(false); //
},
//
sureConditionRole(data) {
this.conditionConfig.nodeUserList = data;
this.conditionRoleVisible = false;
},
//
async addCondition() {
this.conditionList = [];
this.conditionVisible = true;
let { data } = await getConditions({ tableId: this.tableId })
this.conditions = data;
console.log("添加条件--->",this.conditionConfig.conditionList,this.conditions)
if (this.conditionConfig.conditionList) {
for (var i = 0; i < this.conditionConfig.conditionList.length; i++) {
var { columnId } = this.conditionConfig.conditionList[i]
if (columnId.toString() == "0") {
this.conditionList.push({ columnId: 0 })
} else {
// console.log("-1-->",this.conditionList)
// this.conditions.filter(item=>{
// console.log("-222-->",columnId,item.columnId)
// if(item.columnId == columnId.toString()){
// console.log("-2-->",columnId,item)
// this.conditionList.push(columnId)
// }
// })
// console.log("-1-->",this.conditionList)
this.conditionList.push(this.conditions.filter(item => item.columnId == columnId)[0])
// console.log("-3-->",this.conditionList)
}
}
}
},
//
sureCondition() {
//1.+
//2.
for (var i = 0; i < this.conditionList.length; i++) {
var { columnId, showName, columnName, showType, columnType, fixedDownBoxValue } = this.conditionList[i];
if (this.$func.toggleClass(this.conditionConfig.conditionList, this.conditionList[i], "columnId")) {
continue;
}
if (columnId == 0) {
this.conditionConfig.nodeUserList == [];
this.conditionConfig.conditionList.push({
"type": 1,
columnId,
"showName": '发起人'
});
} else {
if (columnType == "Double") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 2,
showName,
"optType": "1",
"zdy1": "2",
"opt1": "<",
"zdy2": "",
"opt2": "<",
"columnDbname": columnName,
columnType,
})
} else if (columnType == "String" && showType == "checkBox") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 2,
showName,
"zdy1": "",
"columnDbname": columnName,
columnType,
fixedDownBoxValue
})
} else if (showType == "datatable") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 3,
showName,
"columnDbname": columnName,
columnType,
fixedDownBoxValue,
databasecondition:[] //
})
}else if(columnType == "custom"){
this.conditionConfig.conditionList.push({
showType,
"type": 4,
columnId,
showName,
columnType,
condition:[
{
wordfield:"",
optType:"1",
factor:{
leftoptType:"1",
leftval:"",
rightoptType:"1",
rightval:""
}
}
]
});
}else{
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 5,
showName,
"zdy1": "",
"columnDbname": columnName,
columnType,
fixedDownBoxValue
})
}
}
}
//3.-
for (let i = this.conditionConfig.conditionList.length - 1; i >= 0; i--) {
if (!this.$func.toggleClass(this.conditionList, this.conditionConfig.conditionList[i], "columnId")) {
this.conditionConfig.conditionList.splice(i, 1);
}
}
this.conditionConfig.conditionList.sort(function (a, b) { return a.columnId - b.columnId; });
this.conditionVisible = false;
this.conditionWordList=[]
},
//
addConditionRole() {
this.conditionRoleVisible = true;
this.checkedList = this.conditionConfig.nodeUserList
},
//
toStrChecked(item, key) {
let a = item.zdy1 ? item.zdy1.split(",") : []
var isIncludes = this.$func.toggleStrClass(item, key);
if (!isIncludes) {
a.push(key)
item.zdy1 = a.toString()
} else {
this.removeStrEle(item, key);
}
},
//
async toCheckRadio(){
let { data } = await getDataBaseTable({ name: this.databaseradio })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
}
console.log("单选项目---->",this.databaseradio,data)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async openDataTable(val){
this.databaseradio = val.key
let { data } = await getDataBaseTable({ name: val.key })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
console.log("单选项目---1->",this.dataBaseTableList[0].key)
}
console.log("单选项目---->",val,this.dataBaseTable)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async getDataBaseTableWord(){
console.log("获取表字段---->",this.databaseradio,this.dataBaseTable)
var sendCont = {
databasename:this.databaseradio,
tablesname:this.dataBaseTable
}
console.log("获取表字段---->",sendCont)
let { data } = await getDataBaseTableCont(sendCont)
this.tableDataBaseWord = data
console.log("获取表字段---->",this.databaseradio,data)
},
//
handleSelectionChange(val) {
console.log("选中的字段---->",val)
this.sureTableWords = val
},
//
tableChange(){
this.getDataBaseTableWord();
},
//
sureTabelWords(){
console.log("确定选中得字段---->",this.sureTableWords)
// this.conditionWordList = []
let wordList = new Array
this.sureTableWords.forEach(item=>{
let equation = "4"
if(item.type != "int"){
equation = "in"
}
let wordCont = {
key:item.field,
type:item.type,
comment:item.comment,
notation:equation,
equation:{
leftnotation:equation,
letfval:"",
rightnotation:"1",
rightval:""
}
}
wordList.push(wordCont)
})
console.log("确定选中得字段--1->",wordList)
if(this.conditionWordList.length > 0 && this.judjeInAry(this.conditionWordList)){
this.conditionWordList.forEach(item1=>{
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
console.log("确定选中得字段--3->",wordList)
if(item1.wordlist.length > 0){
wordList.forEach(itmCont=>{
item1.wordlist.push(itmCont)
})
}else{
item1.wordlist = wordList
}
}
})
}else{
console.log("确定选中得字段--2->",wordList)
this.conditionWordList.push({
databasename:this.databaseradio,
tablekey: this.dataBaseTable,
wordlist: wordList
});
}
this.closeSureTableWords();
},
//
closeSureTableWords(){
this.tabelDialog = false;
},
//
judjeInAry(ary = new Array){
let isTrue = false;
console.log("判断是否再数组中存在--2->",ary)
ary.forEach(item1=>{
console.log("判断是否再数组中存在-1-->",item1.tablekey,item1.databasename,this.dataBaseTable,this.databaseradio)
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
isTrue = true;
}
})
console.log("判断是否再数组中存在--->",isTrue)
return isTrue
},
//
equationChanage(val,subent){
console.log("等式取值--->",val.target.value,subent)
if(val.target.value == "6"){
subent.equation.leftnotation = "1"
subent.equation.letfval = ""
subent.equation.rightnotation = "1"
subent.equation.rightval = ""
}
},
//
delwordkey(val,contList){
console.log("删除选中得表单字段--->",val,contList)
let guoDu = new Array
if(contList.length > 0){
contList.forEach(item=>{
if(item.key != val.key){
guoDu.push(item)
}
})
}
contList = guoDu
console.log("删除选中得表单字段--->",val,contList)
},
//
addConditionEs(val){
val.push({
wordfield:"",
optType:"1",
factor:{
leftoptType:"1",
leftval:"",
rightoptType:"1",
rightval:""
}
});
},
//
myoptChhange(val,objCont){
if(val.target.value != 6){
objCont.factor.leftoptType = val.target.value
}
},
//
delmyCondition(includesIndex,condAry){
condAry.splice(includesIndex, 1);
},
}
}
</script>
<style lang="less">
.condition_copyer {
.el-drawer__body {
.priority_level {
position: absolute;
top: 11px;
right: 30px;
width: 100px;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
}
}
.condition_content {
padding: 20px 20px 0;
p.tip {
margin: 20px 0;
width: 510px;
text-indent: 17px;
line-height: 45px;
background: rgba(241, 249, 255, 1);
border: 1px solid rgba(64, 163, 247, 1);
color: #46a6fe;
font-size: 14px;
}
ul {
max-height: 500px;
overflow-y: scroll;
margin-bottom: 20px;
li {
&>span {
float: left;
margin-right: 8px;
width: 100px;
line-height: 32px;
text-align: right;
}
&>div {
display: inline-block;
width: 100%;
&>p:not(:last-child) {
margin-bottom: 10px;
}
}
&:not(:last-child)>div>p {
margin-bottom: 20px;
}
&>a {
float: right;
margin-right: 10px;
margin-top: 7px;
}
.condition_content {
padding: 5px 0;
}
select,
input {
width: 100%;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
padding: 0;
}
select+input {
width: 260px;
}
select {
margin-right: 10px;
width: 100px;
}
p.selected_list {
padding-left: 10px;
border-radius: 4px;
min-height: 32px;
border: 1px solid rgba(217, 217, 217, 1);
word-break: break-word;
}
p.check_box {
line-height: 32px;
}
}
}
.el-button {
margin-bottom: 20px;
}
}
}
.condition_list {
.el-dialog__body {
padding: 16px 26px;
}
p {
color: #666666;
margin-bottom: 10px;
&>.check_box {
margin-bottom: 0;
line-height: 36px;
}
}
}
.wordbody{
padding: 5px 0;
}
.bottor_piayi{
margin-bottom: 10px;
}
</style>

347
src/component_old/drawer/conditionDrawer.vue → src/customworkflow/drawer/conditionDrawer_20230323.vue

@ -1,3 +1,8 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-22 10:18:00
@ 备注: 条件设置
-->
<template>
<el-drawer :append-to-body="true" title="条件设置" :visible.sync="conditionDrawer" direction="rtl" class="condition_copyer" size="550px" :before-close="saveCondition">
<select v-model="conditionConfig.priorityLevel" class="priority_level">
@ -22,6 +27,16 @@
<a :class="$func.toggleStrClass(item,item1.key)&&'active'" @click="toStrChecked(item,item1.key)"
v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1">{{item1.value}}</a>
</p>
</div>
<div v-else-if="item.type==3">
<!-- <el-radio-group v-model="databaseradio" @input="toCheckRadio">
<el-radio v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1" :label="item1.key">{{item1.name}}</el-radio>
</el-radio-group> -->
<el-button v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1" type="text" style="padding: 6px 5px;" @click="openDataTable(item1)">{{item1.name}}</el-button>
</div>
<div v-else>
<p>
@ -32,6 +47,8 @@
<option value="4">等于</option>
<option value="5">大于等于</option>
<option value="6">介于两个数之间</option>
<option value="7">包含</option>
<option value="8">不包含</option>
</select>
<input v-if="item.optType!=6" type="text" :placeholder="'请输入'+item.showName" v-enter-number="2" v-model="item.zdy1">
</p>
@ -51,6 +68,42 @@
</div>
<a v-if="item.type==1" @click="conditionConfig.nodeUserList= [];$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==2" @click="$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==3" @click="$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<div v-if="item.type==3" style="width:100%">
<el-row v-for="item4 in conditionWordList" :key="item4.tablekey" style="width:99%">
<el-col :span="4" style="word-wrap:break-word; word-break:break-all;">
数据表<br>{{ item4.tablekey }}
</el-col>
<el-col :span="20">
<el-row class="wordbody" v-for="item3 in item4.wordlist" :key="item3.tablekey" :gutter="5">
<el-col :span="6" style="word-wrap:break-word; word-break:break-all;">字段{{ item3.field }}</el-col>
<el-col :span="6">
<select v-model="item3.equation" style="width:100%">
<option v-if="item3.type=='int'" value="1">小于</option>
<option v-if="item3.type=='int'" value="2">大于</option>
<option v-if="item3.type=='int'" value="3">小于等于</option>
<option v-if="item3.type=='int'" value="4">等于</option>
<option v-if="item3.type=='int'" value="5">大于等于</option>
<option v-if="item3.type=='int'" value="6">介于两个数之间</option>
<option v-if="item3.type=='string'" value="in">包含</option>
<option v-if="item3.type=='string'" value="notin">不包含</option>
</select>
</el-col>
<el-col :span="10">
<input v-model="item3.equationval" type="text" placeholder="请输入" style="width:100%">
</el-col>
<el-col :span="2">
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="delwordkey(item3,item4)"></el-button>
</el-col>
<el-col :span="24" class="wordbody" >
描述{{ item3.comment }}
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</li>
</ul>
<el-button type="primary" @click="addCondition">添加条件</el-button>
@ -66,8 +119,56 @@
<el-button type="primary" @click="sureCondition"> </el-button>
</span>
</el-dialog>
<!--选择数据表-->
<el-dialog title="选择表及条件字段" :visible.sync="tabelDialog" width="480px" append-to-body class="condition_list">
<template>
<el-select v-model="dataBaseTable" placeholder="请选择数据表!" style="width:100%" @change="tableChange">
<el-option
v-for="item in dataBaseTableList"
:key="item.key"
:label="item.name"
:value="item.key">
</el-option>
</el-select>
</template>
<template>
<el-table
:data="tableDataBaseWord"
border
ref="multipleTable"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
style="width: 100%" height="500">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="field"
label="表名"
>
</el-table-column>
<el-table-column
prop="type"
label="类型"
>
</el-table-column>
<el-table-column
prop="comment"
label="描述">
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="tabelDialog = false"> </el-button>
<el-button type="primary" @click="sureTabelWords"> </el-button>
</span>
</el-dialog>
</div>
<employees-role-dialog
<employeesRoleDialog
:visible.sync="conditionRoleVisible"
:data.sync="checkedList"
@change="sureConditionRole"
@ -78,31 +179,40 @@
<el-button @click="setCondition(false)"> </el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import employeesRoleDialog from '../dialog/employeesRoleDialog.vue'
// import { getConditions } from '@/plugins/api.js'
import { getConditions } from "@/api/workflowapi/workflowaip"
import employeesRoleDialog from '@/customworkflow/dialog/employeesRoleDialog'
import { getConditions,getDataBaseTable,getDataBaseTableCont } from "@/api/workflowapi/workflowaip"
export default {
components: {
employeesRoleDialog
},
data() {
return {
conditionVisible: false,
conditionsConfig: {
conditionNodes: [],
},
}, //
PriorityLevel: "", //
conditionConfig: {},
PriorityLevel: "",
conditions: [],
conditionList: [],
checkedList: [],
conditionRoleVisible: false,
conditionRoleVisible: false, //
checkedList: [], //
conditionList:[], //
conditionVisible: false, //
conditions: [], //API
databaseradio:"", //
tabelDialog:false, //
dataBaseTable:"", //
dataBaseTableList:[], //
tableDataBaseWord:[], //
sureTableWords:[], //
conditionWordList:[], //
}
},
created(){
},
computed: {
...mapState(['tableId', 'conditionsConfig1', 'conditionDrawer']),
@ -116,53 +226,54 @@ export default {
: { nodeUserList: [], conditionList: [] }
},
},
methods: {
methods:{
...mapMutations(['setCondition', 'setConditionsConfig']),
changeOptType(item) {
if (item.optType == 1) {
item.zdy1 = 2;
} else {
item.zdy1 = 1;
item.zdy2 = 2;
}
},
toStrChecked(item, key) {
let a = item.zdy1 ? item.zdy1.split(",") : []
var isIncludes = this.$func.toggleStrClass(item, key);
if (!isIncludes) {
a.push(key)
item.zdy1 = a.toString()
} else {
this.removeStrEle(item, key);
}
//
saveCondition(){
console.log("保存条件--->",this.conditionWordList)
console.log("保存条件--1->",this.conditionsConfig)
this.conditionConfig.databasecondition = this.conditionWordList
this.setConditionsConfig({
value: this.conditionsConfig,
flag: true,
id: this.conditionsConfig1.id
})
this.setCondition(false); //
},
removeStrEle(item, key) {
let a = item.zdy1 ? item.zdy1.split(",") : []
var includesIndex;
a.map((item, index) => {
if (item == key) {
includesIndex = index
}
});
a.splice(includesIndex, 1);
item.zdy1 = a.toString()
//
sureConditionRole(data) {
this.conditionConfig.nodeUserList = data;
this.conditionRoleVisible = false;
},
//
async addCondition() {
this.conditionList = [];
this.conditionVisible = true;
let { data } = await getConditions({ tableId: this.tableId })
this.conditions = data;
console.log("添加条件--->",this.conditionConfig.conditionList,this.conditions)
if (this.conditionConfig.conditionList) {
for (var i = 0; i < this.conditionConfig.conditionList.length; i++) {
var { columnId } = this.conditionConfig.conditionList[i]
if (columnId == 0) {
if (columnId.toString() == "0") {
this.conditionList.push({ columnId: 0 })
} else {
// console.log("-1-->",this.conditionList)
// this.conditions.filter(item=>{
// console.log("-222-->",columnId,item.columnId)
// if(item.columnId == columnId.toString()){
// console.log("-2-->",columnId,item)
// this.conditionList.push(columnId)
// }
// })
// console.log("-1-->",this.conditionList)
this.conditionList.push(this.conditions.filter(item => item.columnId == columnId)[0])
// console.log("-3-->",this.conditionList)
}
}
}
},
//
sureCondition() {
//1.+
//2.
@ -204,6 +315,17 @@ export default {
columnType,
fixedDownBoxValue
})
}else{
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 3,
showName,
"zdy1": "",
"columnDbname": columnName,
columnType,
fixedDownBoxValue
})
}
}
}
@ -216,34 +338,128 @@ export default {
this.conditionConfig.conditionList.sort(function (a, b) { return a.columnId - b.columnId; });
this.conditionVisible = false;
},
saveCondition() {
this.setCondition(false)
var a = this.conditionsConfig.conditionNodes.splice(this.PriorityLevel - 1, 1)//
this.conditionsConfig.conditionNodes.splice(this.conditionConfig.priorityLevel - 1, 0, a[0])//
this.conditionsConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
});
for (var i = 0; i < this.conditionsConfig.conditionNodes.length; i++) {
this.conditionsConfig.conditionNodes[i].error = this.$func.conditionStr(this.conditionsConfig, i) == "请设置条件" && i != this.conditionsConfig.conditionNodes.length - 1
}
this.setConditionsConfig({
value: this.conditionsConfig,
flag: true,
id: this.conditionsConfig1.id
})
},
//
addConditionRole() {
this.conditionRoleVisible = true;
this.checkedList = this.conditionConfig.nodeUserList
},
sureConditionRole(data) {
this.conditionConfig.nodeUserList = data;
this.conditionRoleVisible = false;
//
toStrChecked(item, key) {
let a = item.zdy1 ? item.zdy1.split(",") : []
var isIncludes = this.$func.toggleStrClass(item, key);
if (!isIncludes) {
a.push(key)
item.zdy1 = a.toString()
} else {
this.removeStrEle(item, key);
}
},
//
async toCheckRadio(){
let { data } = await getDataBaseTable({ name: this.databaseradio })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
}
console.log("单选项目---->",this.databaseradio,data)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async openDataTable(val){
this.databaseradio = val.key
let { data } = await getDataBaseTable({ name: val.key })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
console.log("单选项目---1->",this.dataBaseTableList[0].key)
}
console.log("单选项目---->",val,this.dataBaseTable)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async getDataBaseTableWord(){
let sendCont = {
databasename:this.databaseradio,
tablesname:this.dataBaseTable
};
let { data } = await getDataBaseTableCont(sendCont)
this.tableDataBaseWord = data
console.log("获取表字段---->",this.databaseradio,data)
},
//
handleSelectionChange(val) {
console.log("选中的字段---->",val)
this.sureTableWords = val
},
//
tableChange(){
this.getDataBaseTableWord();
},
//
sureTabelWords(){
console.log("确定选中得字段---->",this.sureTableWords)
// this.conditionWordList = []
let wordList = new Array
this.sureTableWords.forEach(item=>{
if(item.type == "int"){
item.equation = "4"
}else{
item.equation = "in"
}
item.equationval = ""
wordList.push(item)
})
console.log("确定选中得字段--1->",wordList)
if(this.conditionWordList.length > 0 && this.judjeInAry(this.conditionWordList)){
this.conditionWordList.forEach(item1=>{
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
console.log("确定选中得字段--3->",wordList)
if(item1.wordlist.length > 0){
wordList.forEach(itmCont=>{
item1.wordlist.push(itmCont)
})
}else{
item1.wordlist = wordList
}
}
})
}else{
console.log("确定选中得字段--2->",wordList)
this.conditionWordList.push({
databasename:this.databaseradio,
tablekey: this.dataBaseTable,
wordlist: wordList
});
}
this.closeSureTableWords();
},
//
closeSureTableWords(){
this.tabelDialog = false;
},
//
judjeInAry(ary = new Array){
let isTrue = false;
console.log("判断是否再数组中存在--2->",ary)
ary.forEach(item1=>{
console.log("判断是否再数组中存在-1-->",item1.tablekey,item1.databasename,this.dataBaseTable,this.databaseradio)
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
isTrue = true;
}
})
console.log("判断是否再数组中存在--->",isTrue)
return isTrue
},
//
delwordkey(){}
}
}
</script>
<style lang="less">
.condition_copyer {
.el-drawer__body {
@ -282,7 +498,7 @@ export default {
&>span {
float: left;
margin-right: 8px;
width: 70px;
width: 80px;
line-height: 32px;
text-align: right;
}
@ -305,7 +521,9 @@ export default {
margin-right: 10px;
margin-top: 7px;
}
.condition_content {
padding: 5px 0;
}
select,
input {
width: 100%;
@ -359,4 +577,7 @@ export default {
}
}
}
.wordbody{
padding: 5px 0;
}
</style>

703
src/customworkflow/drawer/conditionDrawer_20230327.vue

@ -0,0 +1,703 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-22 10:18:00
@ 备注: 条件设置
-->
<template>
<el-drawer :append-to-body="true" title="条件设置" :visible.sync="conditionDrawer" direction="rtl" class="condition_copyer" size="550px" :before-close="saveCondition">
<select v-model="conditionConfig.priorityLevel" class="priority_level">
<option v-for="item in conditionsConfig.conditionNodes.length" :value="item" :key="item">优先级{{item}}</option>
</select>
<div class="demo-drawer__content">
<div class="condition_content drawer_content">
<p class="tip">当审批单同时满足以下条件时进入此流程</p>
<ul>
<li v-for="(item,index) in conditionConfig.conditionList" :key="index">
<span class="ellipsis">{{item.type==1?'发起人':item.showName}}</span>
<div v-if="item.type==1">
<p :class="conditionConfig.nodeUserList.length > 0?'selected_list':''" @click.self="addConditionRole" style="cursor:text">
<span v-for="(item1,index1) in conditionConfig.nodeUserList" :key="index1">
{{item1.name}}<img src="@/assets/images/add-close1.png" @click="$func.removeEle(conditionConfig.nodeUserList,item1,'targetId')">
</span>
<input type="text" placeholder="请选择具体人员/角色/部门" v-if="conditionConfig.nodeUserList.length == 0" @click="addConditionRole">
</p>
</div>
<div v-else-if="item.columnType == 'String' && item.showType == 'checkBox'">
<p class="check_box">
<a :class="$func.toggleStrClass(item,item1.key)&&'active'" @click="toStrChecked(item,item1.key)"
v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1">{{item1.value}}</a>
</p>
</div>
<div v-else-if="item.type==3">
<!-- <el-radio-group v-model="databaseradio" @input="toCheckRadio">
<el-radio v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1" :label="item1.key">{{item1.name}}</el-radio>
</el-radio-group> -->
<el-button v-for="(item1,index1) in JSON.parse(item.fixedDownBoxValue)" :key="index1" type="text" style="padding: 6px 5px;" @click="openDataTable(item1,item)">{{item1.name}}</el-button>
</div>
<div v-else-if="item.type==4">
<div v-for="(item69,index69) in item.condition" :key="index69">
<el-row>
<el-col :span="6"><input v-if="item69.optType!=6" type="text" placeholder="条件关键字" v-enter-number="2" v-model="item.zdy1"></el-col>
<el-col :span="18">
<p>
<select v-model="item69.optType" :style="'width:'+(item69.optType==6?370:100)+'px'" @change="changeOptType(item69)">
<option value="1">小于</option>
<option value="2">大于</option>
<option value="3">小于等于</option>
<option value="4">等于</option>
<option value="5">大于等于</option>
<option value="6">介于两个数之间</option>
<option value="7">包含</option>
<option value="8">不包含</option>
</select>
<input v-if="item69.optType!=6" type="text" :placeholder="'请输入'+item.showName" v-enter-number="2" v-model="item.zdy1" style="width:70%">
</p>
</el-col>
</el-row>
</div>
<el-button type="primary" size="mini" plain>添加条件</el-button>
</div>
<div v-else>
<p>
<select v-model="item.optType" :style="'width:'+(item.optType==6?370:100)+'px'" @change="changeOptType(item)">
<option value="1">小于</option>
<option value="2">大于</option>
<option value="3">小于等于</option>
<option value="4">等于</option>
<option value="5">大于等于</option>
<option value="6">介于两个数之间</option>
</select>
<input v-if="item.optType!=6" type="text" :placeholder="'请输入'+item.showName" v-enter-number="2" v-model="item.zdy1">
</p>
<p v-if="item.optType==6">
<input type="text" style="width:75px;" class="mr_10" v-enter-number="2" v-model="item.zdy1">
<select style="width:60px;" v-model="item.opt1">
<option value="<">&lt;</option>
<option value="≤"></option>
</select>
<span class="ellipsis" style="display:inline-block;width:60px;vertical-align: text-bottom;">{{item.showName}}</span>
<select style="width:60px;" class="ml_10" v-model="item.opt2">
<option value="<">&lt;</option>
<option value="≤"></option>
</select>
<input type="text" style="width:75px;" v-enter-number="2" v-model="item.zdy2">
</p>
</div>
<a v-if="item.type==1" @click="conditionConfig.nodeUserList= [];$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==2" @click="$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<a v-if="item.type==3" @click="conditionWordList=[];$func.removeEle(conditionConfig.conditionList,item,'columnId')">删除</a>
<div v-if="item.type==3" style="width:100%">
<el-row v-for="item4 in conditionWordList" :key="item4.tablekey" style="width:99%">
<el-col :span="4" style="word-wrap:break-word; word-break:break-all;">
数据表<br>{{ item4.tablekey }}
</el-col>
<el-col :span="20">
<el-row class="wordbody" v-for="item3 in item4.wordlist" :key="item3.tablekey" :gutter="5">
<el-col :span="6" style="word-wrap:break-word; word-break:break-all;">字段{{ item3.key }}</el-col>
<el-col :span="6">
<select v-model="item3.notation" style="width:100%" @change="equationChanage($event,item3)">
<option v-if="item3.type=='int'" value="1">小于</option>
<option v-if="item3.type=='int'" value="2">大于</option>
<option v-if="item3.type=='int'" value="3">小于等于</option>
<option v-if="item3.type=='int'" value="4">等于</option>
<option v-if="item3.type=='int'" value="5">大于等于</option>
<option v-if="item3.type=='int'" value="6">介于两个数之间</option>
<option v-if="item3.type=='string'" value="in">包含</option>
<option v-if="item3.type=='string'" value="notin">不包含</option>
</select>
</el-col>
<el-col :span="10">
<input v-if="item3.notation != 6" v-model="item3.equation.letfval" type="text" placeholder="请输入" style="width:100%">
</el-col>
<el-col :span="2">
<el-button type="danger" icon="el-icon-delete" size="mini" circle @click="$func.removeEle(item4.wordlist,item3,'key')"></el-button>
</el-col>
<el-col v-if="item3.notation == 6" :span="24" class="wordbody" >
<input type="text" style="width:75px;" class="mr_10" v-model="item3.equation.letfval">
<select style="width:60px;" v-model="item3.equation.leftnotation">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
<span class="ellipsis" style="display:inline-block;width:60px;vertical-align: text-bottom;">{{item3.key}}</span>
<select style="width:60px;" class="ml_10" v-model="item3.equation.rightnotation">
<option value="1">&lt;</option>
<option value="3"></option>
</select>
<input type="text" style="width:75px;" v-model="item3.equation.rightval">
</el-col>
<el-col :span="24" class="wordbody" >
描述{{ item3.comment }}
</el-col>
</el-row>
</el-col>
</el-row>
</div>
</li>
</ul>
<el-button type="primary" @click="addCondition">添加条件</el-button>
<el-dialog title="选择条件" :visible.sync="conditionVisible" width="480px" append-to-body class="condition_list">
<p>请选择用来区分审批流程的条件字段</p>
<p class="check_box">
<a :class="$func.toggleClass(conditionList,{columnId:0},'columnId')&&'active'" @click="$func.toChecked(conditionList,{columnId:0},'columnId')">发起人</a>
<a v-for="(item,index) in conditions" :key="index" :class="$func.toggleClass(conditionList,item,'columnId')&&'active'"
@click="$func.toChecked(conditionList,item,'columnId')">{{item.showName}}</a>
</p>
<span slot="footer" class="dialog-footer">
<el-button @click="conditionVisible = false"> </el-button>
<el-button type="primary" @click="sureCondition"> </el-button>
</span>
</el-dialog>
<!--选择数据表-->
<el-dialog title="选择表及条件字段" :visible.sync="tabelDialog" width="480px" append-to-body class="condition_list">
<template>
<el-select v-model="dataBaseTable" placeholder="请选择数据表!" style="width:100%" @change="tableChange">
<el-option
v-for="item in dataBaseTableList"
:key="item.key"
:label="item.name"
:value="item.key">
</el-option>
</el-select>
</template>
<template>
<el-table
:data="tableDataBaseWord"
border
ref="multipleTable"
tooltip-effect="dark"
@selection-change="handleSelectionChange"
style="width: 100%" height="500">
<el-table-column
type="selection"
width="55">
</el-table-column>
<el-table-column
prop="field"
label="表名"
>
</el-table-column>
<el-table-column
prop="type"
label="类型"
>
</el-table-column>
<el-table-column
prop="comment"
label="描述">
</el-table-column>
</el-table>
</template>
<span slot="footer" class="dialog-footer">
<el-button @click="tabelDialog = false"> </el-button>
<el-button type="primary" @click="sureTabelWords"> </el-button>
</span>
</el-dialog>
</div>
<employeesRoleDialog
:visible.sync="conditionRoleVisible"
:data.sync="checkedList"
@change="sureConditionRole"
:isDepartment="true"
/>
<div class="demo-drawer__footer clear">
<el-button type="primary" @click="saveCondition"> </el-button>
<el-button @click="setCondition(false)"> </el-button>
</div>
</div>
</el-drawer>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
import employeesRoleDialog from '@/customworkflow/dialog/employeesRoleDialog'
import { getConditions,getDataBaseTable,getDataBaseTableCont } from "@/api/workflowapi/workflowaip"
export default {
components: {
employeesRoleDialog
},
data() {
return {
conditionsConfig: {
conditionNodes: [],
}, //
PriorityLevel: "", //
conditionConfig: {},
conditionRoleVisible: false, //
checkedList: [], //
conditionList:[], //
conditionVisible: false, //
conditions: [], //API
databaseradio:"", //
tabelDialog:false, //
dataBaseTable:"", //
dataBaseTableList:[], //
tableDataBaseWord:[], //
sureTableWords:[], //
conditionWordList:[], //
}
},
created(){
},
computed: {
...mapState(['tableId', 'conditionsConfig1', 'conditionDrawer']),
},
watch: {
conditionsConfig1(val) {
this.conditionsConfig = val.value;
this.PriorityLevel = val.priorityLevel
this.conditionConfig = val.priorityLevel
? this.conditionsConfig.conditionNodes[val.priorityLevel - 1]
: { nodeUserList: [], conditionList: [] }
},
},
methods:{
...mapMutations(['setCondition', 'setConditionsConfig']),
//
saveCondition(){
this.setCondition(false)
console.log("保存条件--->",this.conditionWordList)
console.log("保存条件--1->",this.conditionsConfig)
this.conditionConfig.databasecondition = this.conditionWordList
var a = this.conditionsConfig.conditionNodes.splice(this.PriorityLevel - 1, 1)//
this.conditionsConfig.conditionNodes.splice(this.conditionConfig.priorityLevel - 1, 0, a[0])//
this.conditionsConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
});
for (var i = 0; i < this.conditionsConfig.conditionNodes.length; i++) {
this.conditionsConfig.conditionNodes[i].error = this.$func.conditionStr(this.conditionsConfig, i) == "请设置条件" && i != this.conditionsConfig.conditionNodes.length - 1
}
this.setConditionsConfig({
value: this.conditionsConfig,
flag: true,
id: this.conditionsConfig1.id
})
this.setCondition(false); //
},
//
sureConditionRole(data) {
this.conditionConfig.nodeUserList = data;
this.conditionRoleVisible = false;
},
//
async addCondition() {
this.conditionList = [];
this.conditionVisible = true;
let { data } = await getConditions({ tableId: this.tableId })
this.conditions = data;
console.log("添加条件--->",this.conditionConfig.conditionList,this.conditions)
if (this.conditionConfig.conditionList) {
for (var i = 0; i < this.conditionConfig.conditionList.length; i++) {
var { columnId } = this.conditionConfig.conditionList[i]
if (columnId.toString() == "0") {
this.conditionList.push({ columnId: 0 })
} else {
// console.log("-1-->",this.conditionList)
// this.conditions.filter(item=>{
// console.log("-222-->",columnId,item.columnId)
// if(item.columnId == columnId.toString()){
// console.log("-2-->",columnId,item)
// this.conditionList.push(columnId)
// }
// })
// console.log("-1-->",this.conditionList)
this.conditionList.push(this.conditions.filter(item => item.columnId == columnId)[0])
// console.log("-3-->",this.conditionList)
}
}
}
},
//
sureCondition() {
//1.+
//2.
for (var i = 0; i < this.conditionList.length; i++) {
var { columnId, showName, columnName, showType, columnType, fixedDownBoxValue } = this.conditionList[i];
if (this.$func.toggleClass(this.conditionConfig.conditionList, this.conditionList[i], "columnId")) {
continue;
}
if (columnId == 0) {
this.conditionConfig.nodeUserList == [];
this.conditionConfig.conditionList.push({
"type": 1,
columnId,
"showName": '发起人'
});
} else {
if (columnType == "Double") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 2,
showName,
"optType": "1",
"zdy1": "2",
"opt1": "<",
"zdy2": "",
"opt2": "<",
"columnDbname": columnName,
columnType,
})
} else if (columnType == "String" && showType == "checkBox") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 2,
showName,
"zdy1": "",
"columnDbname": columnName,
columnType,
fixedDownBoxValue
})
} else if (showType == "datatable") {
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 3,
showName,
"columnDbname": columnName,
columnType,
fixedDownBoxValue,
databasecondition:[] //
})
}else if(columnType == "custom"){
this.conditionConfig.conditionList.push({
"type": 4,
columnId,
showName,
condition:[
{
wordfield:"",
optType:4,
factor:{
leftoptType:1,
leftval:"",
rightoptType:1,
rightval:""
}
}
]
});
}else{
this.conditionConfig.conditionList.push({
showType,
columnId,
"type": 5,
showName,
"zdy1": "",
"columnDbname": columnName,
columnType,
fixedDownBoxValue
})
}
}
}
//3.-
for (let i = this.conditionConfig.conditionList.length - 1; i >= 0; i--) {
if (!this.$func.toggleClass(this.conditionList, this.conditionConfig.conditionList[i], "columnId")) {
this.conditionConfig.conditionList.splice(i, 1);
}
}
this.conditionConfig.conditionList.sort(function (a, b) { return a.columnId - b.columnId; });
this.conditionVisible = false;
this.conditionWordList=[]
},
//
addConditionRole() {
this.conditionRoleVisible = true;
this.checkedList = this.conditionConfig.nodeUserList
},
//
toStrChecked(item, key) {
let a = item.zdy1 ? item.zdy1.split(",") : []
var isIncludes = this.$func.toggleStrClass(item, key);
if (!isIncludes) {
a.push(key)
item.zdy1 = a.toString()
} else {
this.removeStrEle(item, key);
}
},
//
async toCheckRadio(){
let { data } = await getDataBaseTable({ name: this.databaseradio })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
}
console.log("单选项目---->",this.databaseradio,data)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async openDataTable(val){
this.databaseradio = val.key
let { data } = await getDataBaseTable({ name: val.key })
this.dataBaseTableList = data
if(this.dataBaseTableList.length > 0){
this.dataBaseTable= this.dataBaseTableList[0].key
console.log("单选项目---1->",this.dataBaseTableList[0].key)
}
console.log("单选项目---->",val,this.dataBaseTable)
this.getDataBaseTableWord();
this.tabelDialog = true
},
//
async getDataBaseTableWord(){
console.log("获取表字段---->",this.databaseradio,this.dataBaseTable)
var sendCont = {
databasename:this.databaseradio,
tablesname:this.dataBaseTable
}
console.log("获取表字段---->",sendCont)
let { data } = await getDataBaseTableCont(sendCont)
this.tableDataBaseWord = data
console.log("获取表字段---->",this.databaseradio,data)
},
//
handleSelectionChange(val) {
console.log("选中的字段---->",val)
this.sureTableWords = val
},
//
tableChange(){
this.getDataBaseTableWord();
},
//
sureTabelWords(){
console.log("确定选中得字段---->",this.sureTableWords)
// this.conditionWordList = []
let wordList = new Array
this.sureTableWords.forEach(item=>{
let equation = "4"
if(item.type != "int"){
equation = "in"
}
let wordCont = {
key:item.field,
type:item.type,
comment:item.comment,
notation:equation,
equation:{
leftnotation:equation,
letfval:"",
rightnotation:"1",
rightval:""
}
}
wordList.push(wordCont)
})
console.log("确定选中得字段--1->",wordList)
if(this.conditionWordList.length > 0 && this.judjeInAry(this.conditionWordList)){
this.conditionWordList.forEach(item1=>{
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
console.log("确定选中得字段--3->",wordList)
if(item1.wordlist.length > 0){
wordList.forEach(itmCont=>{
item1.wordlist.push(itmCont)
})
}else{
item1.wordlist = wordList
}
}
})
}else{
console.log("确定选中得字段--2->",wordList)
this.conditionWordList.push({
databasename:this.databaseradio,
tablekey: this.dataBaseTable,
wordlist: wordList
});
}
this.closeSureTableWords();
},
//
closeSureTableWords(){
this.tabelDialog = false;
},
//
judjeInAry(ary = new Array){
let isTrue = false;
console.log("判断是否再数组中存在--2->",ary)
ary.forEach(item1=>{
console.log("判断是否再数组中存在-1-->",item1.tablekey,item1.databasename,this.dataBaseTable,this.databaseradio)
if(this.dataBaseTable == item1.tablekey && this.databaseradio == item1.databasename){
isTrue = true;
}
})
console.log("判断是否再数组中存在--->",isTrue)
return isTrue
},
//
equationChanage(val,subent){
console.log("等式取值--->",val.target.value,subent)
if(val.target.value == "6"){
subent.equation.leftnotation = "1"
subent.equation.letfval = ""
subent.equation.rightnotation = "1"
subent.equation.rightval = ""
}
},
//
delwordkey(val,contList){
console.log("删除选中得表单字段--->",val,contList)
let guoDu = new Array
if(contList.length > 0){
contList.forEach(item=>{
if(item.key != val.key){
guoDu.push(item)
}
})
}
contList = guoDu
console.log("删除选中得表单字段--->",val,contList)
},
}
}
</script>
<style lang="less">
.condition_copyer {
.el-drawer__body {
.priority_level {
position: absolute;
top: 11px;
right: 30px;
width: 100px;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
}
}
.condition_content {
padding: 20px 20px 0;
p.tip {
margin: 20px 0;
width: 510px;
text-indent: 17px;
line-height: 45px;
background: rgba(241, 249, 255, 1);
border: 1px solid rgba(64, 163, 247, 1);
color: #46a6fe;
font-size: 14px;
}
ul {
max-height: 500px;
overflow-y: scroll;
margin-bottom: 20px;
li {
&>span {
float: left;
margin-right: 8px;
width: 100px;
line-height: 32px;
text-align: right;
}
&>div {
display: inline-block;
width: 100%;
&>p:not(:last-child) {
margin-bottom: 10px;
}
}
&:not(:last-child)>div>p {
margin-bottom: 20px;
}
&>a {
float: right;
margin-right: 10px;
margin-top: 7px;
}
.condition_content {
padding: 5px 0;
}
select,
input {
width: 100%;
height: 32px;
background: rgba(255, 255, 255, 1);
border-radius: 4px;
border: 1px solid rgba(217, 217, 217, 1);
}
select+input {
width: 260px;
}
select {
margin-right: 10px;
width: 100px;
}
p.selected_list {
padding-left: 10px;
border-radius: 4px;
min-height: 32px;
border: 1px solid rgba(217, 217, 217, 1);
word-break: break-word;
}
p.check_box {
line-height: 32px;
}
}
}
.el-button {
margin-bottom: 20px;
}
}
}
.condition_list {
.el-dialog__body {
padding: 16px 26px;
}
p {
color: #666666;
margin-bottom: 10px;
&>.check_box {
margin-bottom: 0;
line-height: 36px;
}
}
}
.wordbody{
padding: 5px 0;
}
</style>

45
src/component_old/drawer/copyerDrawer.vue → src/customworkflow/drawer/copyerDrawer.vue

@ -1,8 +1,7 @@
<!--
* @Date: 2022-08-04 16:29:35
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 14:14:32
* @FilePath: /Workflow/src/components/drawer/copyerDrawer.vue
@ 作者: 秦东
@ 时间: 2023-03-22 08:07:27
@ 备注: 抄送人设置
-->
<template>
<el-drawer :append-to-body="true" title="抄送人设置" :visible.sync="copyerDrawer" direction="rtl" class="set_copyer" size="550px" :before-close="saveCopyer">
@ -23,7 +22,7 @@
<el-button type="primary" @click="saveCopyer"> </el-button>
<el-button @click="closeDrawer"> </el-button>
</div>
<employees-role-dialog
<employeesRoleDialog
:visible.sync="copyerVisible"
:data.sync="checkedList"
@change="sureCopyer"
@ -32,7 +31,7 @@
</el-drawer>
</template>
<script>
import employeesRoleDialog from '../dialog/employeesRoleDialog.vue'
import employeesRoleDialog from '@/customworkflow/dialog/employeesRoleDialog'
import { mapState, mapMutations } from 'vuex'
export default {
components: {
@ -40,11 +39,14 @@ export default {
},
data() {
return {
copyerConfig: {},
ccSelfSelectFlag: [],
copyerVisible: false,
checkedList: [],
copyerConfig: {}, //
ccSelfSelectFlag: [], //
copyerVisible: false, //
checkedList: [], //
}
},
created(){
},
computed: {
...mapState(['copyerDrawer', 'copyerConfig1']),
@ -53,18 +55,18 @@ export default {
copyerConfig1(val) {
this.copyerConfig = val.value;
this.ccSelfSelectFlag = this.copyerConfig.ccSelfSelectFlag == 0 ? [] : [this.copyerConfig.ccSelfSelectFlag]
}
console.log("copyerConfig1",this.copyerConfig);
},
methods: {
},
methods:{
...mapMutations(['setCopyerConfig', 'setCopyer']),
//
addCopyer() {
this.copyerVisible = true;
this.checkedList = this.copyerConfig.nodeUserList
},
sureCopyer(data) {
this.copyerConfig.nodeUserList = data;
this.copyerVisible = false;
},
//
saveCopyer() {
this.copyerConfig.ccSelfSelectFlag = this.ccSelfSelectFlag.length == 0 ? 0 : 1;
this.copyerConfig.error = !this.$func.copyerStr(this.copyerConfig);
@ -74,15 +76,22 @@ export default {
id: this.copyerConfig1.id
})
this.closeDrawer();
console.log("保存设置",this.copyerConfig);
},
//
closeDrawer() {
this.setCopyer(false)
},
//
sureCopyer(data) {
this.copyerConfig.nodeUserList = data;
this.copyerVisible = false;
console.log("选择人员回调",data);
},
}
}
</script>
<style lang="less">
<style lang='less'>
.set_copyer {
.copyer_content {
padding: 20px 20px 0;

43
src/component_old/drawer/promoterDrawer.vue → src/customworkflow/drawer/promoterDrawer.vue

@ -1,10 +1,9 @@
<!--
* @Date: 2022-08-04 16:29:35
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:17:15
* @FilePath: /Workflow/src/components/drawer/promoterDrawer.vue
@ 作者: 秦东
@ 时间: 2023-03-20 15:40:05
@ 备注: 发起人节点选择操作条件
-->
<template>
<template><!--发起人节点抽屉选项-->
<el-drawer :append-to-body="true" title="发起人" :visible.sync="promoterDrawer" direction="rtl" class="set_promoter" size="550px" :before-close="savePromoter">
<div class="demo-drawer__content">
<div class="promoter_content drawer_content">
@ -15,7 +14,7 @@
<el-button type="primary" @click="savePromoter"> </el-button>
<el-button @click="closeDrawer"> </el-button>
</div>
<employees-dialog
<employeesDialog
:isDepartment="true"
:visible.sync="promoterVisible"
:data.sync="checkedList"
@ -25,7 +24,7 @@
</el-drawer>
</template>
<script>
import employeesDialog from '../dialog/employeesDialog.vue'
import employeesDialog from '@/customworkflow/dialog/employeesDialog'
import { mapState, mapMutations } from 'vuex'
export default {
components: { employeesDialog },
@ -44,18 +43,13 @@ export default {
this.flowPermission = val.value
}
},
methods: {
...mapMutations(['setPromoter', 'setFlowPermission']),
addPromoter() {
created(){
this.checkedList = this.flowPermission
this.promoterVisible = true;
},
surePromoter(data) {
this.flowPermission = data;
this.promoterVisible = false;
},
savePromoter() {
methods:{
...mapMutations(['setPromoter', 'setFlowPermission']),
//
savePromoter(){
this.setFlowPermission({
value: this.flowPermission,
flag: true,
@ -63,13 +57,24 @@ export default {
})
this.closeDrawer()
},
//
addPromoter() {
console.log("this.flowPermission--->",this.flowPermission);
this.checkedList = this.flowPermission
this.promoterVisible = true;
},
//
closeDrawer() {
this.setPromoter(false)
}
},
surePromoter(data) {
this.flowPermission = data;
this.promoterVisible = false;
},
}
}
</script>
<style lang="less" >
<style lang="less">
.set_promoter {
.promoter_content {
padding: 0 20px;

223
src/component_old/nodeWrap.vue → src/customworkflow/nodeWrap.vue

@ -1,12 +1,20 @@
<template>
<div>
<div class="node-wrap" v-if="nodeConfig.type<3">
<!--执行框-->
<div class="node-wrap" v-if="nodeConfig.type<4">
<!--执行节点信息-->
<div class="node-wrap-box" :class="(nodeConfig.type==0?'start-node ':'')+(isTried&&nodeConfig.error?'active error':'')">
<div>
<!--执行框标题-->
<div class="title" :style="`background: rgb(${bgColor});`">
<span v-if="nodeConfig.type==0">{{nodeConfig.nodeName}}</span>
<template v-else>
<span class="iconfont">{{nodeConfig.type==1?'':''}}</span>
<span class="iconfont" v-if="nodeConfig.type==0"><i class="el-icon-video-play"></i></span> <!--开始图标-->
<span v-if="nodeConfig.type==0">{{nodeConfig.nodeName}}</span><!--开始名称-->
<template v-else><!--不是发起节点的话执行下面内容-->
<span class="iconfont"><!--节点图标-->
<i class="el-icon-s-check" v-if="nodeConfig.type==1"></i>
<i class="el-icon-s-promotion" v-if="nodeConfig.type!=1"></i>
</span>
<!--节点名称,单击可编辑-->
<input type="text"
v-if="isInput"
class="ant-input editable-title-input"
@ -20,37 +28,48 @@
<i class="anticon anticon-close close" @click="delNode"></i>
</template>
</div>
<!--节点内容说明-->
<div class="content" @click="setPerson">
<div class="text">
<span class="placeholder" v-if="!showText">请选择{{defaultText}}</span>
{{showText}}
</div>
<i class="anticon anticon-right arrow"></i>
</div>
<!--错误提示-->
<div class="error_tip" v-if="isTried&&nodeConfig.error">
<i class="anticon anticon-exclamation-circle"></i>
</div>
</div>
</div>
<addNode :childNodeP.sync="nodeConfig.childNode" :nodeConfig.sync="nodeConfig" :step="1"></addNode>
<div class="text" style="padding: 0 2px; overflow: hidden;">
NO:{{nodeConfig.nodeNumber}}
</div>
<!--添加按钮-->
<addNode :childNodeP.sync="nodeConfig.childNode" :nodeConfig.sync="nodeConfig"></addNode>
</div>
<!--条件节点-->
<div class="branch-wrap" v-if="nodeConfig.type==4">
<div class="branch-box-wrap">
<!--条件主体-->
<div class="branch-box">
<button class="add-branch" @click="addTerm">添加条件</button>
<div class="col-box" v-for="(item,index) in nodeConfig.conditionNodes" :key="index">
<button class="add-branch" @click="addTerm">添加条件</button> <!--添加条件按钮-->
<div class="col-box" v-for="(item,index) in nodeConfig.conditionNodes" :key="index"> <!--条件节点分支-->
<div class="condition-node">
<div class="condition-node-box">
<div class="auto-judge" :class="isTried&&item.error?'error active':''">
<div class="sort-left" v-if="index!=0" @click="arrTransfer(index,-1)">&lt;</div>
<div class="title-wrapper">
<div class="title-wrapper"><!--条件标题-->
<input
v-if="isInputList[index]"
type="text"
class="ant-input editable-title-input"
@blur="blurEvent(index)"
@focus="$event.currentTarget.select()"
v-focus v-model="item.nodeName"
v-focus
v-model="item.nodeName"
>
<span v-else class="editable-title" @click="clickEvent(index)">{{item.nodeName}}</span>
<span class="priority-title" @click="setPerson(item.priorityLevel)">优先级{{item.priorityLevel}}</span>
@ -61,11 +80,15 @@
<div class="error_tip" v-if="isTried&&item.error">
<i class="anticon anticon-exclamation-circle"></i>
</div>
</div>
<div class="text" style="padding: 0 2px; overflow: hidden;">
NO:{{nodeConfig.nodeNumber}}
</div>
<addNode :childNodeP.sync="item.childNode" :nodeConfig="item" :step="2"></addNode>
<addNode :childNodeP.sync="item.childNode" :nodeConfig="item"></addNode>
</div>
</div>
<nodeWrap v-if="item.childNode" :nodeConfig="item"></nodeWrap>
<nodeWrap v-if="item.childNode" :nodeConfig.sync="item.childNode"></nodeWrap>
<template v-if="index==0">
<div class="top-left-cover-line"></div>
<div class="bottom-left-cover-line"></div>
@ -76,10 +99,11 @@
</template>
</div>
</div>
<addNode :childNodeP.sync="nodeConfig.childNode" :nodeConfig.="nodeConfig" :step="3"></addNode>
<!--添加按钮-->
<addNode :childNodeP.sync="nodeConfig.childNode" :nodeConfig.="nodeConfig" ></addNode>
</div>
</div>
<nodeWrap v-if="nodeConfig.childNode" :nodeConfig="nodeConfig.childNode"></nodeWrap>
<nodeWrap v-if="nodeConfig.childNode" :nodeConfig.sync="nodeConfig.childNode"></nodeWrap>
</div>
</template>
<script>
@ -89,75 +113,95 @@ export default {
props: ["nodeConfig", "flowPermission"],
data() {
return {
placeholderList: ["发起人", "审核人", "抄送人"],
isInputList: [],
isInput: false,
placeholderList: ["发起人", "审核人", "抄送人", "执行人"],
isInputList: [], //
isInput: false, //
}
},
mounted() {
if (this.nodeConfig.type == 1) {
if (this.nodeConfig.type == 1 || this.nodeConfig.type == 3) {
this.nodeConfig.error = !this.$func.setApproverStr(this.nodeConfig)
} else if (this.nodeConfig.type == 2) {
this.nodeConfig.error = !this.$func.copyerStr(this.nodeConfig)
} else if (this.nodeConfig.type == 4) {
this.resetConditionNodesErr()
}
console.log("初始化节点数据--1---》",this.nodeConfig,this.nodeConfig.childNode)
},
directives: {
focus: {
inserted: function (el) {
el.focus()
}
}
},
computed: {
...mapState(['isTried', 'flowPermission1', 'approverConfig1', 'copyerConfig1', 'conditionsConfig1']),
defaultText() {
...mapState([
'isTried',
'flowPermission1', //
'approverConfig1', //
'copyerConfig1', //
'conditionsConfig1' //
]),
defaultText() { //
return this.placeholderList[this.nodeConfig.type]
},
showText() {
showText() { //
if (this.nodeConfig.type == 0) return this.$func.arrToStr(this.flowPermission) || '所有人'
if (this.nodeConfig.type == 1) return this.$func.setApproverStr(this.nodeConfig)
if (this.nodeConfig.type == 1 || this.nodeConfig.type == 3) return this.$func.setApproverStr(this.nodeConfig)
return this.$func.copyerStr(this.nodeConfig)
},
bgColor() {
return ['87, 106, 149', '255, 148, 62', '50, 150, 250'][this.nodeConfig.type]
bgColor() { //
return ['87, 106, 149', '255, 148, 62', '50, 150, 250','255,102,0','255,255,255'][this.nodeConfig.type]
}
},
watch: {
flowPermission1(data) {
//
flowPermission1(data){
// console.log("------data----------->",data,"-----_uid---->", this._uid)
if (data.flag && data.id === this._uid) {
this.$emit('update:flowPermission', data.value)
}
},
//
approverConfig1(data) {
if (data.flag && data.id === this._uid) {
this.$emit('update:nodeConfig', data.value)
}
},
copyerConfig1(data) {
// console.log("---------->",date)
if (data.flag && data.id === this._uid) {
this.$emit('update:nodeConfig', data.value)
}
},
conditionsConfig1(data) {
if (data.flag && data.id === this._uid) {
// console.log("---------->",date)
this.$emit('update:nodeConfig', data.value)
}
},
},
methods: {
...mapMutations([
'setPromoter',
'setApprover',
'setCopyer',
'setCondition',
'setFlowPermission',
'setApproverConfig',
'setCopyerConfig',
'setConditionsConfig'
'setPromoter', //
'setFlowPermission', //
'setApprover', //
'setApproverConfig', //
'setCopyer', //
'setCopyerConfig', //
'setCondition', //
'setConditionsConfig', //
]),
//
clickEvent(index) {
// console.log("",index)
if (index || index === 0) {
this.$set(this.isInputList, index, true)
} else {
this.isInput = true;
}
},
//
blurEvent(index) {
if (index || index === 0) {
this.$set(this.isInputList, index, false)
@ -167,58 +211,15 @@ export default {
this.nodeConfig.nodeName = this.nodeConfig.nodeName || this.defaultText
}
},
//
delNode() {
this.$emit("update:nodeConfig", this.nodeConfig.childNode);
},
addTerm() {
const snowflake = v4().replaceAll('-','').toString();
console.log("添加条件--->",this.nodeConfig)
let len = this.nodeConfig.conditionNodes.length + 1
this.nodeConfig.gotoNode.push(snowflake);
this.nodeConfig.conditionNodes.push({
"nodeNumber":snowflake,
"nodeName": "条件" + len,
"type": 3,
"priorityLevel": len,
"conditionList": [],
"nodeUserList": [],
"childNode": null,
"fromNode": this.nodeConfig.nodeNumber,
"gotoNode":[]
});
this.resetConditionNodesErr()
this.$emit("update:nodeConfig", this.nodeConfig);
},
delTerm(index) {
this.nodeConfig.conditionNodes.splice(index, 1)
this.nodeConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
item.nodeName = `条件${index + 1}`
});
this.resetConditionNodesErr()
this.$emit("update:nodeConfig", this.nodeConfig);
if (this.nodeConfig.conditionNodes.length == 1) {
if (this.nodeConfig.childNode) {
if (this.nodeConfig.conditionNodes[0].childNode) {
this.reData(this.nodeConfig.conditionNodes[0].childNode, this.nodeConfig.childNode)
} else {
this.nodeConfig.conditionNodes[0].childNode = this.nodeConfig.childNode
}
}
this.$emit("update:nodeConfig", this.nodeConfig.conditionNodes[0].childNode);
}
},
reData(data, addData) {
if (!data.childNode) {
data.childNode = addData
} else {
this.reData(data.childNode, addData)
}
},
//
setPerson(priorityLevel) {
console.log("请选择------------>",priorityLevel)
console.log("打开节点操作抽屉------------>",priorityLevel)
var { type } = this.nodeConfig;
console.log("请选择-----1------->",type,this.nodeConfig)
console.log("打开节点操作抽屉-----1------->",type,this.nodeConfig)
if (type == 0) {
this.setPromoter(true)
this.setFlowPermission({
@ -226,7 +227,7 @@ export default {
flag: false,
id: this._uid
})
} else if (type == 1) {
} else if (type == 1 || type == 3) { //
this.setApprover(true)
this.setApproverConfig({
value: {
@ -238,12 +239,14 @@ export default {
})
} else if (type == 2) {
this.setCopyer(true)
this.setCopyerConfig({
value: JSON.parse(JSON.stringify(this.nodeConfig)),
flag: false,
id: this._uid
})
} else {
//
this.setCondition(true)
this.setConditionsConfig({
value: JSON.parse(JSON.stringify(this.nodeConfig)),
@ -253,16 +256,66 @@ export default {
})
}
},
arrTransfer(index, type = 1) {//-1,1
//
addTerm() {
const snowflake = v4().replaceAll('-','').toString();
let len = this.nodeConfig.conditionNodes.length + 1
this.nodeConfig.gotoNode.push(snowflake);
this.nodeConfig.conditionNodes.push({
"nodeNumber":snowflake,
"nodeName": "条件" + len,
"type": 5,
"priorityLevel": len,
"conditionList": [],
"nodeUserList": [],
"databasecondition":[],
"childNode": null,
"fromNode": this.nodeConfig.nodeNumber,
"gotoNode":[]
});
this.resetConditionNodesErr()
this.$emit("update:nodeConfig", this.nodeConfig);
},
//
resetConditionNodesErr() {
for (var i = 0; i < this.nodeConfig.conditionNodes.length; i++) {
this.nodeConfig.conditionNodes[i].error = this.$func.conditionStr(this.nodeConfig, i) == "请设置条件" && i != this.nodeConfig.conditionNodes.length - 1
}
},
//
arrTransfer(index, type = 1) {//-1,+1
this.nodeConfig.conditionNodes[index] = this.nodeConfig.conditionNodes.splice(index + type, 1, this.nodeConfig.conditionNodes[index])[0];
this.nodeConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
})
this.$emit("update:nodeConfig", this.nodeConfig);
},
resetConditionNodesErr() {
for (var i = 0; i < this.nodeConfig.conditionNodes.length; i++) {
this.nodeConfig.conditionNodes[i].error = this.$func.conditionStr(this.nodeConfig, i) == "请设置条件" && i != this.nodeConfig.conditionNodes.length - 1
//
delTerm(index) {
this.nodeConfig.conditionNodes.splice(index, 1)
this.nodeConfig.conditionNodes.map((item, index) => {
item.priorityLevel = index + 1
item.nodeName = `条件${index + 1}`
});
this.resetConditionNodesErr()
this.$emit("update:nodeConfig", this.nodeConfig);
if (this.nodeConfig.conditionNodes.length == 1) {
if (this.nodeConfig.childNode) {
if (this.nodeConfig.conditionNodes[0].childNode) {
this.reData(this.nodeConfig.conditionNodes[0].childNode, this.nodeConfig.childNode)
} else {
this.nodeConfig.conditionNodes[0].childNode = this.nodeConfig.childNode
}
}
this.$emit("update:nodeConfig", this.nodeConfig.conditionNodes[0].childNode);
}
},
//()
reData(data, addData) {
if (!data.childNode) {
data.childNode = addData
} else {
this.reData(data.childNode, addData)
}
},
}

102
src/customworkflow/selectBox.vue

@ -0,0 +1,102 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-20 16:19:10
@ 备注: 行政组织与人员列表
-->
<template>
<ul class="select-box">
<template v-for="elem in list">
<template v-if="elem.type === 'role'">
<li v-for="item in elem.data" :key="item.roleId"
class="check_box"
:class="{active: elem.isActive && elem.isActive(item), not: elem.not}"
@click="elem.change(item)">
<a :title="item.description" :class="{active: elem.isActiveItem && elem.isActiveItem(item)}">
<img src="@/assets/images/icon_role.png">{{item.roleName}}
</a>
</li>
</template>
<template v-if="elem.type === 'position'">
<li v-for="item in elem.data" :key="item.id"
class="check_box"
:class="{active: elem.isActive && elem.isActive(item), not: elem.not}"
@click="elem.change(item)">
<a :title="item.name" :class="{active: elem.isActiveItem && elem.isActiveItem(item)}">
<img src="@/assets/images/icon_role.png">{{item.name}}
</a>
</li>
</template>
<template v-if="elem.type === 'department'">
<li v-for="item in elem.data" :key="item.id" class="check_box" :class="{not: !elem.isDepartment}">
<a v-if="elem.isDepartment"
:class="elem.isActive(item) && 'active'"
@click="elem.change(item)">
<img src="@/assets/images/icon_file.png">
{{ item.departmentName }}
</a>
<a v-else><img src="@/assets/images/icon_file.png">{{item.departmentName}}</a>
<i @click="elem.next(item)">下级</i>
</li>
</template>
<template v-if="elem.type === 'employee'">
<li v-for="item in elem.data" :key="item.id" class="check_box">
<a :class="elem.isActive(item) && 'active'"
@click="elem.change(item)"
:title="item.departmentNames">
<!-- <img src="@/assets/images/icon_people.png">{{item.employeeName}} -->
<img v-if="item.icon && item.icon != ''" :src="item.icon">
<img v-else-if="item.iconToBase64 && item.iconToBase64 != ''" :src="item.iconToBase64">
<img v-else src="@/assets/images/icon_people.png">
{{item.employeeName}}
</a>
</li>
</template>
</template>
</ul>
</template>
<script>
export default {
props: {
list: {
type: Array,
default: () => []
}
},
created(){
console.log("是定---->",this.list)
},
}
</script>
<style lang="less">
.select-box {
height: 420px;
overflow-y: auto;
li {
padding: 5px 0;
i {
float: right;
padding-left: 24px;
padding-right: 10px;
color: #3195f8;
font-size: 12px;
cursor: pointer;
background: url(~@/assets/images/next_level_active.png) no-repeat 10px center;
border-left: 1px solid rgb(238, 238, 238);
}
a.active+i {
color: rgb(197, 197, 197);
background-image: url(~@/assets/images/next_level.png);
pointer-events: none;
}
img {
width: 14px;
vertical-align: middle;
margin-right: 5px;
}
}
}
</style>

26
src/component_old/selectResult.vue → src/customworkflow/selectResult.vue

@ -1,9 +1,7 @@
<!-- eslint-disable vue/no-template-key -->
<!--
* @Date: 2022-08-26 16:29:24
* @LastEditors: StavinLi
* @LastEditTime: 2022-09-21 11:17:24
* @FilePath: /Workflow/src/components/selectResult.vue
@ 作者: 秦东
@ 时间: 2023-03-20 16:47:05
@ 备注:
-->
<template>
<div class="select-result l">
@ -19,6 +17,13 @@
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
<template v-if="type === 'position'">
<li v-for="item in data" :key="item.id">
<img src="@/assets/images/icon_role.png">
<span>{{item.name}}</span>
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
<template v-if="type === 'department'">
<li v-for="item in data" :key="item.id">
<img src="@/assets/images/icon_file.png">
@ -28,12 +33,15 @@
</template>
<template v-if="type === 'employee'">
<li v-for="item in data" :key="item.id">
<!-- <img src="@/assets/images/icon_people.png"> -->
<img v-if="item.icon!=''" :src="item.icon">
<img v-else-if="(item.icon==''&&item.iconToBase64!='') " :src="item.iconToBase64">
<!-- <img src="@/assets/images/icon_people.png">
<span>{{item.employeeName}}</span> -->
<img v-if="item.icon && item.icon != ''" :src="item.icon">
<img v-else-if="item.iconToBase64 && item.iconToBase64 != ''" :src="item.iconToBase64">
<img v-else src="@/assets/images/icon_people.png">
<span>{{item.employeeName}}</span>
{{item.employeeName}}
<img src="@/assets/images/cancel.png" @click="cancel(item)">
</li>
</template>
</template>

1
src/layout/components/TagsView/index.vue

@ -69,6 +69,7 @@ export default {
methods: {
generateTitle, // generateTitle by vue-i18n
isActive(route) {
return route.path === this.$route.path
},
isAffix(tag) {

19
src/main.js

@ -32,10 +32,19 @@ Vue.component('Node', Node)
*/
import func from '@/api/preload.js'
Vue.prototype.$func = func;
import nodeWrap from '@/components/nodeWrap'
Vue.component('nodeWrap', nodeWrap); //初始化组件
import addNode from '@/components/addNode'
Vue.component('addNode', addNode); //初始化组件
// import nodeWrap from '@/components/nodeWrap'
// Vue.component('nodeWrap', nodeWrap); //初始化组件
// import addNode from '@/components/addNode'
// Vue.component('addNode', addNode); //初始化组件
/**
* 自定义工作流
*/
import nodeWrap from '@/customworkflow/nodeWrap.vue'
Vue.component('nodeWrap', nodeWrap); //初始化执行框组件
import addNode from '@/customworkflow/addNode.vue'
Vue.component('addNode', addNode); //初始化添加按钮组件
/**
* If you don't want to use mock-server
* you want to use MockJs for mock api
@ -77,7 +86,7 @@ new Vue({
store,
components: {
nodeWrap,
addNode,
// addNode,
},
render: h => h(App)
})

18
src/router/index.js

@ -200,8 +200,8 @@ export const constantRoutes = [
},
{
path: 'mete',
component: () => import('@/views/mete/index'),
// component: () => import('@/views/mete/dingliang'),
// component: () => import('@/views/mete/index'),
component: () => import('@/views/mete/dingliang'),
meta: { title: '定量考核'}
},
],
@ -508,10 +508,22 @@ export const constantRoutes = [
children: [
{
path: 'flow',
// component: () => import('@/views/workflow/flow'),
// component: () => import('@/views/workflow/myFlow'),
component: () => import('@/views/workflow/flow'),
meta: { title: '设置工作时段'}
},
{
path: 'myflow',
component: () => import('@/views/workflow/myFlow'),
// component: () => import('@/views/workflow/flow'),
meta: { title: '设置工作时段'}
},
{
path: 'workflowlist',
component: () => import('@/views/workflow/workflowlist'),
// component: () => import('@/views/workflow/flow'),
meta: { title: '工作流管理'}
},
],
},

35
src/store/index.js

@ -16,46 +16,52 @@ const store = new Vuex.Store({
},
getters,
state: {
tableId: '',
tableId: '', //流程id
isTried: false,
promoterDrawer: false,
flowPermission1: {},
approverDrawer: false,
approverConfig1: {},
copyerDrawer: false,
copyerConfig1: {},
conditionDrawer: false,
conditionsConfig1: {
promoterDrawer: false, //开始节点抽屉默认值
flowPermission1: {}, //开始节点权限
approverDrawer: false, //执行节点抽屉默认值
approverConfig1: {}, //执行节点权限
copyerDrawer: false, //抄送人弹窗
copyerConfig1: {}, //抄送人数据
conditionDrawer: false, //条件设置弹窗
conditionsConfig1: { //条件数据
conditionNodes: [],
},
//执行人相关参数
appcarryoutDrawer:false,
appcarryoutConfig1: {},
},
mutations: {
setTableId(status, payload) {
console.log("验证store----------------->",status, payload)
//设置工作流唯一识别符
status.tableId = payload
},
setIsTried(status, payload) {
status.isTried = payload
},
//设置开始节点信息
setPromoter(status, payload) {
console.log("验证setPromoter----------------->",status, payload)
status.promoterDrawer = payload
},
setFlowPermission(status, payload) {
status.flowPermission1 = payload
},
//执行节点
setApprover(status, payload) {
status.approverDrawer = payload
},
setApproverConfig(status, payload) {
status.approverConfig1 = payload
},
//抄送人节点
setCopyer(status, payload) {
status.copyerDrawer = payload
},
setCopyerConfig(status, payload) {
status.copyerConfig1 = payload
},
//条件节点
setCondition(status, payload) {
console.log("Vuex.Store----------->setCondition",status, payload)
status.conditionDrawer = payload
@ -63,6 +69,13 @@ const store = new Vuex.Store({
setConditionsConfig(status, payload) {
status.conditionsConfig1 = payload
},
//元新增节点
setAppCarryOut(status, payload) {
status.appcarryoutDrawer = payload
},
setAppCarryOutConfig(status, payload) {
status.appcarryoutConfig1 = payload
},
},
})

4
src/utils/request.js

@ -58,7 +58,7 @@ service.interceptors.response.use(
*/
response => {
const res = response.data
console.log("res.code---------->")
// console.log("res.code---------->")
console.log(res.code)
// if the custom code is not 20000, it is judged as an error.
if (res.code !== 0) {
@ -90,7 +90,7 @@ service.interceptors.response.use(
// return Promise.reject(Error).catch(Error=>{console.log(Error)})
// return Promise.reject(new Error(res.msg || 'Error'))
} else {
console.log("成功---->",res)
// console.log("成功---->",res)
return res
}
},

2
src/views/basicInfo/target.vue

@ -4,7 +4,7 @@
<div class="gva-search-box">
<el-form ref="searchForm" :inline="true" :model="searchInfo">
<el-form-item label="部门">
<el-cascader filterable clearable v-model.string="searchInfo.departmentid" :options="chuBuMenList" :show-all-levels="false" :props="props1"></el-cascader>
<el-cascader filterable clearable v-model="searchInfo.departmentid" :options="chuBuMenList" :show-all-levels="false" :props="props1"></el-cascader>
<!-- <el-select filterable v-model.string="searchInfo.departmentid" clearable placeholder="请选择">
<el-option
v-for="item in buMenList"

397
src/views/mete/dingliang.vue

@ -28,9 +28,9 @@
</div>
<!--数据列表-->
<div class="gva-table-box">
<el-table :data="tableData" border :span-method="objectSpanMethod">
<el-table-column align="left" label="部门" prop="parentname"/>
<el-table-column align="left" label="考核指标" prop="targetname"/>
<el-table :data="tableData" border :span-method="objectSpanMethodes">
<el-table-column fixed align="left" label="部门" prop="parentname"/>
<el-table-column fixed align="left" label="考核指标" prop="targetname"/>
<el-table-column align="left" label="全奖值" prop="unit" width="65">
<template slot-scope="scope">
{{scope.row.allprize}}
@ -55,8 +55,8 @@
</el-table-column>
<el-table-column align="left" label="得分" prop="actual">
<template slot-scope="scope">
<el-input v-if="scope.row.scoringmethod==2" v-model="scope.row.scoringscore" autocomplete="off"/>
<div v-if="scope.row.scoringmethod==1">{{scope.row.scoringscore}}</div>
<el-input v-if="scope.row.scoringmethod==2" v-model="scope.row.reachscore" autocomplete="off"/>
<div v-if="scope.row.scoringmethod==1">{{scope.row.reachscore}}</div>
</template>
</el-table-column>
<el-table-column align="left" label="达成率" prop="reach"/>
@ -75,38 +75,96 @@
>查看流程</el-button>
</template>
</el-table-column>
<el-table-column align="left" label="考核周期" width="135">
<template>
<el-table-column align="left" fixed="right" label="考核周期" width="145">
<template slot-scope="scope">
<el-date-picker
style="width:110px"
@change="searchYearAndMonth"
style="width:120px"
@change="searchYearAndMonth(scope)"
v-model="searchMonth"
type="month"
value-format="yyyy-MM"
placeholder="请选择">
</el-date-picker>
</template>
</el-table-column>
<el-table-column align="left" fixed="right" label="操作" width="70">
<el-table-column align="left" fixed="right" label="操作" width="115">
<template #default="scope">
<el-button
v-if="scope.row.referto == false"
icon="el-icon-circle-plus-outline"
size="small"
type="text"
@click="tijiao(scope.row)"
>提交</el-button>
<el-tag type="danger" v-if="scope.row.referto">此数据已提交</el-tag>
</template>
</el-table-column>
<el-table-column align="left" fixed="right" label="批量提交" width="115" prop="setupedit">
<template #default="scope">
<el-button
style="color:#F56C6C"
icon="el-icon-circle-plus-outline"
size="small"
type="text"
@click="batchSubmission(scope.row)"
>批量提交</el-button>
</template>
</el-table-column>
</el-table>
</div>
<!-- 新增弹框 -->
<el-dialog :close-on-click-modal="false" :visible.sync="dialogFormVisible" title="流程详情" width="20%">
<el-card class="box-card">
<el-steps direction="vertical" :active="buzhou">
<el-step v-for="(item,index) in processData" :key="index" :title="item.nodename" icon="el-icon-circle-check" >
<template slot="description">
<div style="color: rgb(153,153,153);" v-for="(a,userlistIndex) in item.userlist" :key="userlistIndex">
<el-row>
<el-col :span="4" v-if="a.log!=null">
<el-badge is-dot type="primary ">
<el-avatar style="margin-right: 5px;" shape="square" size="small" :src="a.icon"></el-avatar>
</el-badge>
</el-col>
<el-col :span="4" v-else>
<el-avatar style="margin-right: 5px;" shape="square" size="small" :src="a.icon"></el-avatar>
</el-col>
<el-col :span="20" style="margin-top: -5px;">
{{a.workshopname}}-{{a.postname}}-{{a.name}}
<el-row>
<div v-for="(i,logIndex) in a.log" :key="logIndex">
<div class="left" v-if="i.state==2">已同意&nbsp;·&nbsp;</div>
<div class="left" v-if="i.state==1" type="info">未操作&nbsp;·&nbsp;</div>
<div class="left" v-if="i.state==3" type="danger">驳回&nbsp;·&nbsp;</div>
<div class="left">{{i.time}}</div>
</div>
</el-row>
</el-col>
</el-row>
</div>
</template>
</el-step>
</el-steps>
</el-card>
</el-dialog>
</div>
</template>
<script>
import { tableMergeTrade } from "@/api/people/peopledata";
import { getQuantitativeTasks } from "@/api/systemaccredit/systemapi"
import { departmentlist } from '@/api/api/dutys'
import { departmentlist,quanOperation,examineflow } from '@/api/api/dutys'
export default {
data() {
return {
mergeArr: ['parentname','setupedit'],//
buzhou:0,
//
searchMonth:"", //
searchInfo: {
@ -125,6 +183,8 @@ export default {
},
tableData:[],//
spanArr:[], //
processData:[],
dialogFormVisible:false,
}
},
created(){
@ -142,6 +202,15 @@ export default {
this.getSpanArr(this.tableData);
});
},
searchMonth(){
// console.log("",this.searchMonth)
if(this.searchMonth == null || this.searchMonth == ""){
this.searchInfo.month= "";
this.tableData.forEach(item=>{
item.month = ""
})
}
},
},
methods:{
//
@ -154,6 +223,7 @@ export default {
},
//
searchYearAndMonth(){
// console.log("",this.searchMonth)
if(this.searchMonth && this.searchMonth != null){
let yearVal = this.searchMonth.getFullYear();
let monthVal = this.searchMonth.getMonth()+1;
@ -161,22 +231,254 @@ export default {
monthVal = "0"+monthVal
}
this.searchInfo.month= yearVal + "-" + monthVal
this.onSubmitSearch();
}
},
//
async onSubmitSearch(){
let _this = this;
let sendData = {
orgid:this.searchInfo.departmentid.toString(),
title:this.searchInfo.title,
time:this.searchInfo.month
}
const res = await getQuantitativeTasks(sendData);
console.log("获取个人定量考核提交数据表---->", res);
// console.log("---->", res);
if(res.code == 0){
this.tableData = res.data;
this.tableData.forEach(item=>{
item.month = _this.searchInfo.month
})
this.mergeObj = tableMergeTrade(this.tableData,this.mergeArr,"setupedit")
}
// console.log("---->", this.tableData);
},
//
// ()/-*100+%
inputActual(val,index){
// console.log("---->", val,index);
var jieguo = this.jisuanDaChengLvScore(val.actual,val.referencescore,val.zeroprize,val.allprize,val.cappingcal)
val.reach = jieguo.reach
val.reachscore = jieguo.reachscore
if(val.actual == "" || val.actual == null || val.actual == 0){
val.reachscore = 0
}
},
//
async tijiao(val){
console.log("提交单一数据---->", val);
// this.$confirm(', ?', '', {
// confirmButtonText: '',
// cancelButtonText: '',
// type: 'warning'
// }).then(async() => {
// this.fromData=[],
// this.tableData.forEach(ele=>{
// if (ele.parentid==row.parentid) {
// this.fromData.push(ele)
// }
// })
// })
if(val.referto){
this.$message({
showClose: true,
type: 'error',
message: '该数据已经提交过!不可重复提交!'
})
return false;
}
if(val.actual == 0){
this.$message({
showClose: true,
type: 'error',
message: '指标实际值未填写!不可提交!'
});
return false;
}
if(val.scoringmethod != 1 ){
if(val.reachscore*1 == 0){
this.$message({
showClose: true,
type: 'error',
message: '指标得分未填写!不可提交!'
});
return false;
}
if(val.reachscore*1 > val.referencescore){
this.$message({
showClose: true,
type: 'error',
message: '得分大约指标分值!不可提交!'
});
return false;
}
}
if(!val.month){
this.$message({
showClose: true,
type: 'error',
message: '未选择考核时间!不可提交!'
});
return false;
}else{
if(val.month == "" || val.month == null){
this.$message({
showClose: true,
type: 'error',
message: '未选择考核时间!不可提交!'
});
return false;
}
}
val.reachscore = val.reachscore.toString();
const from ={
groupid: '309',
departmentid: val.parentid.toString(),
planversionnumber:val.planversionnumber,
time:val.month,
// list:this.fromData
list:[val]
}
console.log("提交------------->",val,from)
const res = await quanOperation(from)
console.log("提交-------1------>",res)
if (res.code === 0) {
this.$message({
type: 'success',
message: res.msg
})
val.referto = true
}
},
//
async showProcess(row){
this.buzhou=0
const processFrom ={
id:row.id
}
const res = await examineflow(processFrom)
this.processData=res.data
this.processData.forEach(element => {
if (element.state==2) {
this.buzhou=this.buzhou+1
}
});
this.dialogFormVisible=true
},
//
async batchSubmission(val){
console.log("批量提交数据---->", val);
this.$confirm('您的数据是否已准确无误?确定要执行批量上报《'+val.parentname+'》数据? 是否继续?', '《'+val.parentname+'》温馨提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(async() => {
let fromData=[];
let isTreu = 1;
let msgStr = "";
let msgStrAry = new Array();
const h = this.$createElement;
this.tableData.forEach(ele=>{
if (ele.parentid==val.parentid) {
ele.reachscore = ele.reachscore.toString();
isTreu = 1;
if(ele.referto){
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '该数据已经提交过!不可重复提交!'));
isTreu = 1;
}
if(ele.actual == 0){
isTreu = 2;
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '指标实际值未填写!不可提交!'));
}
if(ele.scoringmethod != 1 ){
if(ele.reachscore*1 == 0){
isTreu = 2;
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '指标得分未填写!不可提交!'));
}
if(ele.reachscore*1 > ele.referencescore){
isTreu = 2;
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '指标得分大约指标分值!不可提交!'));
}
}
if(!ele.month){
isTreu = 2;
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '指标未选择考核时间!不可提交!'));
}else{
if(ele.month == "" || ele.month == null){
isTreu = 2;
msgStrAry.push(h('p', null, '《'+val.parentname+'》' + ele.targetname + '指标未选择考核时间!不可提交!'));
}
}
if(isTreu == 1 && !ele.referto){
fromData.push(ele)
}
}
});
if(isTreu != 1){
this.$msgbox({
title: '《'+val.parentname+'》温馨提示',
message: h('div', { style: 'color: #FF0000' }, msgStrAry),
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
done();
}else {
done();
}
},
}).then(action => {
});
return false;
}else{
if(fromData.length < 1){
this.$msgbox({
title: '温馨提示',
message: h('div', { style: 'color: #FF0000' }, [
h('span', null, '没有要提交得内容! '),
]),
beforeClose: (action, instance, done) => {
if (action === 'confirm') {
done();
}else {
done();
}
},
}).then(action => {
});
return false;
}else{
const from ={
groupid: '309',
departmentid: val.parentid.toString(),
planversionnumber:val.planversionnumber,
time:val.month,
list:fromData
}
console.log("提交------------->",val,from)
const res = await quanOperation(from)
console.log("提交-------1------>",res)
if (res.code === 0) {
this.$message({
type: 'success',
message: res.msg
})
fromData.forEach(itemForm=>{
this.tableData.forEach(itemTable=>{
if(itemForm.id == itemTable.id){
itemTable.referto = true
}
})
})
}
}
}
})
},
@ -219,6 +521,75 @@ export default {
};
}
},
// { , , , }
objectSpanMethodes({ row, column, rowIndex, columnIndex }) {
// console.log(" { , , , }",row, column, rowIndex, columnIndex)
//
if(this.mergeArr.indexOf(column.property) !== -1) {
// 0
if(this.mergeObj[column.property][rowIndex]) {
return [this.mergeObj[column.property][rowIndex], 1]
} else {
// 0
return [0, 0];
}
}
},
//
jisuanDaChengLvScore(score, weight, zeroprize, allprize, cappingval){
var sendData = {
reach:"未设置目标值",
reachscore:weight
}
if(zeroprize == 0 && allprize == 0){
sendData.reach = "未设置目标值"
}else{
if(allprize > zeroprize){//
if (score <= zeroprize) { //
sendData.reach = "0%"
sendData.reachscore = 0
}else{
var chuShu = score*1 - zeroprize*1
var beiChushu = allprize*1 - zeroprize*1
if (beiChushu != 0 ){ //
var daChengLv = chuShu / beiChushu
sendData.reach = (daChengLv*100).toFixed(2)+"%"
if(daChengLv*100 >= cappingval){
sendData.reachscore = (weight * (cappingval/100)).toFixed(2)
}else{
sendData.reachscore = (weight * daChengLv).toFixed(2)
}
console.log("公式换算--11-->", weight,daChengLv,cappingval);
}else{
sendData.reach = "0%"
sendData.reachscore = 0
}
}
}else{ //
if(score >= zeroprize){ // 0
sendData.reach = "0%"
sendData.reachscore = 0
}else{
var chuShu = score*1 - zeroprize*1
var beiChushu = allprize*1 - zeroprize*1
if (beiChushu != 0 ){ //
var daChengLv = chuShu / beiChushu
sendData.reach = (daChengLv*100).toFixed(2)+"%"
if(daChengLv*100 >= cappingval){
sendData.reachscore = (weight * (cappingval/100)).toFixed(2)
}else{
sendData.reachscore = (weight * daChengLv).toFixed(2)
}
}else{
sendData.reach = "0%"
sendData.reachscore = 0
}
}
}
}
return sendData
},
}
}
</script>

220
src/views/workflow/editflowcont.vue

@ -0,0 +1,220 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-27 13:27:28
@ 备注: 编辑工作流
-->
<template>
<el-dialog title="编辑流程" :visible.sync="editWorkFlowIsShow" top="10px" width="90%" :before-close="closeDialogLook" class="dialogClass">
<el-row :gutter="15">
<el-col :span="2">
名称
</el-col>
<el-col :span="5">
<el-input
placeholder="请输入内容"
v-model="flowConfig.name"
clearable>
</el-input>
</el-col>
<el-col :span="2">
描述
</el-col>
<el-col :span="5">
<el-input
placeholder="请输入内容"
v-model="flowConfig.describe"
clearable>
</el-input>
</el-col>
<el-col :span="24" style="margin-top:5px">
版本<el-button v-for="item in versionList" :key="item.id" type="primary" :plain="item.version==varsionCode?false:true" size="mini" class="versionclick active" @click="varyClick(item)">{{ item.version }}</el-button>
</el-col>
</el-row>
<div class="kuangjiangao">
<div class="dashboard-container">
<div class="gva-table-box">
<section class="dingflow-design">
<!-- <div class="zoom">
<el-button type="button" @click="saveSet"> </el-button>
</div> -->
<!--流程画布-->
<div class="box-scale" id="box-scale" :style="'transform: scale('+nowVal/100+'); transform-origin: 50% 0px 0px;'">
<nodeWrap :nodeConfig.sync="nodeConfig" :flowPermission.sync="flowPermission"></nodeWrap>
<div class="end-node">
<div class="end-node-circle"></div>
<div class="end-node-text">流程结束</div>
</div>
</div>
</section>
</div>
<promoterDrawer />
<approverDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<copyerDrawer />
<conditionDrawer />
<errorDialog
:visible.sync="tipVisible"
:list="tipList"
/>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialogLook"> </el-button>
<el-button type="primary" @click="saveWorkFlow">确定</el-button>
</span>
</el-dialog>
</template>
<script>
import { getWorkFlowVersionList } from "@/api/workflowapi/workflowaip"
import promoterDrawer from "@/customworkflow/drawer/promoterDrawer" //
import approverDrawer from "@/customworkflow/drawer/approverDrawer" //
import copyerDrawer from "@/customworkflow/drawer/copyerDrawer" //
import conditionDrawer from '@/customworkflow/drawer/conditionDrawer' //
import errorDialog from '@/customworkflow/dialog/errorDialog'
import { mapMutations } from 'vuex'
export default {
components: {
promoterDrawer,
approverDrawer,
copyerDrawer,
conditionDrawer,
errorDialog
},
props: ['editWorkFlowIsShow','editWorkFlowInfo','closeEditWorkFlow'],
data() {
return {
varsionCode:this.editWorkFlowInfo.version,
nowVal:100,
nodeConfig: {}, //
flowPermission: [], //()
directorMaxLevel: 0, //
workFlowDef: {}, //
tipVisible: false, //
tipList: [], //
versionList:[], //
processConfig: {}, //
flowConfig:{
flowid:"",
name:"",
describe:""
}, //
versionId:0,
}
},
created(){
// this.nodeConfig = JSON.parse(this.editWorkFlowInfo.content)
},
watch:{
editWorkFlowIsShow(){
console.log("插卡机",this.editWorkFlowInfo)
this.nodeConfig = JSON.parse(this.editWorkFlowInfo.content)
console.log("插卡机===>",this.nodeConfig)
this.varsionCode = this.editWorkFlowInfo.version
this.processConfig = JSON.parse(this.editWorkFlowInfo.content);
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = this.processConfig; //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
this.flowConfig.flowid = tableId
this.flowConfig.name = this.editWorkFlowInfo.name
this.flowConfig.describe = this.editWorkFlowInfo.describe
this.versionId = this.editWorkFlowInfo.vid
this.getWorkFlowVersionList();
}
},
methods:{
...mapMutations(['setTableId', 'setIsTried','setPromoter']),
reErr({ childNode }) {
if (childNode) {
let { type, error, nodeName, conditionNodes } = childNode
if (type == 1 || type == 2 || type == 3) {
if (error) {
this.tipList.push({ name: nodeName, type: ["", "审核人", "抄送人", "执行人"][type] })
}
this.reErr(childNode)
} else if (type == 5) {
this.reErr(childNode)
} else if (type == 4) {
this.reErr(childNode)
for (var i = 0; i < conditionNodes.length; i++) {
if (conditionNodes[i].error) {
this.tipList.push({ name: conditionNodes[i].nodeName, type: "条件" })
}
this.reErr(conditionNodes[i])
}
}
} else {
childNode = null
}
},
//
closeDialogLook(){
this.$emit('closeEditWorkFlow');
},
//
async getWorkFlowVersionList(){
let sendData = {
id:this.editWorkFlowInfo.key.toString()
}
const res = await getWorkFlowVersionList(sendData);
console.log("获取到得版本列表--->",res);
if(res.code == 0){
this.versionList=res.data
}
},
//
varyClick(val){
console.log("切换版本--->",val);
this.varsionCode = val.version
this.processConfig = JSON.parse(val.content);
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = this.processConfig; //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
this.versionId=val.id;
},
//
async saveWorkFlow(){
this.setIsTried(true);
this.tipList = [];
this.reErr(this.nodeConfig);
if (this.tipList.length != 0) {
this.tipVisible = true;
return;
}
this.processConfig.flowPermission = this.flowPermission
this.processConfig.workFlowDef.name = this.flowConfig.name
console.log("saveSet---发布--->",JSON.stringify(this.processConfig))
console.log("saveSet---发布--2->",this.processConfig)
let sendData = {
flowid:this.flowConfig.flowid.toString(),
name:this.flowConfig.name,
describe:this.flowConfig.describe,
versionid:this.versionId.toString(),
flowcont:this.processConfig
}
console.log("saveSet---发布--4->",sendData)
this.closeDialogLook()
},
}
}
</script>
<style lang='less'>
.miaoshu{
padding-left: 25px;
}
.versionclick{
.active{
background-color: #F00;
}
}
.dialogClass {
.el-dialog__body {
padding: 10px 26px 30px 26px;
}
}
</style>

11
src/views/workflow/flow.vue

@ -21,6 +21,7 @@
<promoterDrawer />
<approverDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<appexecutorDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<copyerDrawer />
<conditionDrawer />
</div>
@ -28,9 +29,10 @@
<script>
//
import { getShiyanData } from "@/api/workflowapi/workflowaip"
import { initializeWorkFlow } from "@/api/workflowapi/workflowaip"
import promoterDrawer from "@/components/drawer/promoterDrawer"
import approverDrawer from '@/components/drawer/approverDrawer'
import appexecutorDrawer from '@/components/drawer/appexecutorDrawer'
import copyerDrawer from '@/components/drawer/copyerDrawer'
import conditionDrawer from '@/components/drawer/conditionDrawer'
import { mapMutations } from 'vuex'
@ -40,7 +42,8 @@ export default {
promoterDrawer,
approverDrawer,
copyerDrawer,
conditionDrawer
conditionDrawer,
appexecutorDrawer
},
data() {
return {
@ -82,8 +85,8 @@ export default {
},
//
async getInitData(){
const res = await getShiyanData()
console.log("获取初始化数据---->",res)
const res = await initializeWorkFlow()
// console.log("---->",res)
this.processConfig = res.data;
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = res.data;
this.nodeConfig = nodeConfig;

335
src/views/workflow/flowcont.vue

@ -0,0 +1,335 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-24 16:11:50
@ 备注: 添加流程
-->
<template>
<el-dialog title="添加流程" :visible.sync="addWorkFlowBox" :top="flowActive==1?'10%':'0px'" :width="flowActive==1?'40%':'90%'" :before-close="closeDialog" class="dialogClass">
<el-steps :active="flowActive" align-center>
<el-step title="基本信息">2</el-step>
<el-step title="设置流程"></el-step>
</el-steps>
<el-form ref="form" v-show="flowActive==1" :model="flowConfig" label-width="90px" style="margin-top:50px">
<el-form-item label="工作流名称">
<el-input v-model="flowConfig.name"></el-input>
</el-form-item>
<el-form-item label="工作流描述">
<el-input type="textarea" v-model="flowConfig.describe"></el-input>
</el-form-item>
</el-form>
<div class="kuangjiangao" v-show="flowActive==2">
<div class="dashboard-container">
<div class="gva-table-box">
<section class="dingflow-design">
<!-- <div class="zoom">
<el-button type="button" @click="saveSet"> </el-button>
</div> -->
<!--流程画布-->
<div class="box-scale" id="box-scale" :style="'transform: scale('+nowVal/100+'); transform-origin: 50% 0px 0px;'">
<nodeWrap :nodeConfig.sync="nodeConfig" :flowPermission.sync="flowPermission"></nodeWrap>
<div class="end-node">
<div class="end-node-circle"></div>
<div class="end-node-text">流程结束</div>
</div>
</div>
</section>
</div>
<promoterDrawer />
<approverDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<copyerDrawer />
<conditionDrawer />
<errorDialog
:visible.sync="tipVisible"
:list="tipList"
/>
</div>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="closeDialog"> </el-button>
<el-button v-if="flowActive>1" type="warning" @click="printnext">上一步</el-button>
<el-button type="primary" @click="next">{{ flowButtonName }}</el-button>
</span>
</el-dialog>
</template>
<script>
import { initializeWorkFlow,publishWorkFlow } from "@/api/workflowapi/workflowaip"
import promoterDrawer from "@/customworkflow/drawer/promoterDrawer" //
import approverDrawer from "@/customworkflow/drawer/approverDrawer" //
import copyerDrawer from "@/customworkflow/drawer/copyerDrawer" //
import conditionDrawer from '@/customworkflow/drawer/conditionDrawer' //
import errorDialog from '@/customworkflow/dialog/errorDialog'
import { mapMutations } from 'vuex'
export default {
components: {
promoterDrawer,
approverDrawer,
copyerDrawer,
conditionDrawer,
errorDialog
},
props: ['addWorkFlowBox','closeAddWorkFlow'],
data() {
return {
flowActive:1,
flowButtonName:"下一步",
nowVal:100,
nodeConfig: {}, //
flowPermission: [], //()
processConfig: {}, //
directorMaxLevel: 0, //
workFlowDef: {}, //
tipVisible: false, //
tipList: [], //
flowConfig:{
flowid:"",
name:"",
describe:""
}, //
}
},
created(){
this.getInitData(); //
},
watch:{
addWorkFlowBox(){
this.getInitData()
}
},
methods:{
...mapMutations(['setTableId', 'setIsTried','setPromoter']),
reErr({ childNode }) {
if (childNode) {
let { type, error, nodeName, conditionNodes } = childNode
if (type == 1 || type == 2 || type == 3) {
if (error) {
this.tipList.push({ name: nodeName, type: ["", "审核人", "抄送人", "执行人"][type] })
}
this.reErr(childNode)
} else if (type == 5) {
this.reErr(childNode)
} else if (type == 4) {
this.reErr(childNode)
for (var i = 0; i < conditionNodes.length; i++) {
if (conditionNodes[i].error) {
this.tipList.push({ name: conditionNodes[i].nodeName, type: "条件" })
}
this.reErr(conditionNodes[i])
}
}
} else {
childNode = null
}
},
//
async saveWorkFlow(){
this.setIsTried(true);
this.tipList = [];
this.reErr(this.nodeConfig);
if (this.tipList.length != 0) {
this.tipVisible = true;
return;
}
this.processConfig.flowPermission = this.flowPermission
this.processConfig.workFlowDef.name = this.flowConfig.name
// console.log("saveSet------>",JSON.stringify(this.processConfig))
// console.log("saveSet-----2->",this.processConfig)
let sendData = {
flowid:this.flowConfig.flowid.toString(),
name:this.flowConfig.name,
describe:this.flowConfig.describe,
flowcont:this.processConfig
}
// console.log("saveSet-----4->",sendData)
const res = await publishWorkFlow(sendData);
// console.log("saveSet-----3->",res)
if(res.code == 0){
this.closeDialog();
}
},
next() {
if (this.flowActive++ > 0){
this.flowButtonName="发布"
}
if( this.flowActive == 3){
this.flowActive = 2;
this.saveWorkFlow();
}
},
//
printnext(){
this.flowActive--;
this.flowButtonName="下一步"
if(this.flowActive < 1){
this.flowActive = 1
}
},
//
closeDialog(){
this.$emit('closeAddWorkFlow');
this.flowActive = 1;
this.flowButtonName="下一步";
this.initConfig()
},
//
saveSet(){
},
//
async getInitData(){
const res = await initializeWorkFlow()
// console.log("---->",res)
this.processConfig = res.data;
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = res.data; //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
this.flowConfig.flowid=tableId.toString()
this.setTableId(tableId)
},
//
initConfig(){
this.flowConfig.name = "";
this.flowConfig.describe = "";
this.nodeConfig={};
this.flowPermission=[];
this.directorMaxLevel = 0
this.workFlowDef = {}
},
}
}
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #333333;
}
.clear:before,
.clear:after {
content: " ";
display: table;
}
.clear:after {
clear: both;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.l {
float: left;
}
input {
text-indent: 10px;
}
select {
text-indent: 8px;
}
.ml_10 {
margin-left: 10px;
}
.mr_10 {
margin-right: 10px;
}
.radio_box a,
.check_box a {
font-size: 12px;
position: relative;
padding-left: 20px;
margin-right: 30px;
cursor: pointer;
color: #333;
}
.check_box.not a:hover {
color: #333;
}
.check_box.not a::before,
.check_box.not a:hover::before {
border: none;
}
.check_box.not.active {
background: #f3f3f3;
}
.radio_box a:hover::before,
.check_box a:hover::before {
border: 1px solid #46a6fe;
}
.radio_box a::before,
.check_box a::before {
position: absolute;
width: 14px;
height: 14px;
border: 1px solid #dcdfe6;
border-radius: 2px;
left: 0;
top: 1px;
content: "";
}
.radio_box a::before {
border-radius: 50%;
}
.check-dot.active::after,
.radio_box a.active::after,
.check_box a.active::after {
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
top: 3px;
left: 3px;
content: "";
}
.radio_box a.active::after {
background: #46a6fe;
}
.check_box a.active::after {
background: url(~@/assets/images/check_box.png) no-repeat center;
}
.error-modal-list {
width: 455px;
}
.dialogClass{
height:100%;
}
.dashboard-container{
height: 100%;
}
.el-dialog {
/*height: 100%;*/
}
.el-dialog__body{
/*height: calc(100% - 110px);*/
}
.kuangjiangao{
height: 810px;
}
</style>

150
src/views/workflow/lookflowcont.vue

@ -0,0 +1,150 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-27 13:27:28
@ 备注: 查看工作流
-->
<template>
<el-dialog title="查看流程" :visible.sync="lookboxIsShow" top="10px" width="90%" :before-close="closeDialogLook" class="dialogClass">
<el-row>
<el-col :span="24">名称{{ lookWorkFlowCont.name }}<span class="miaoshu">描述{{ lookWorkFlowCont.describe }}</span></el-col>
<el-col :span="20">版本<el-button v-for="item in versionList" :key="item.id" type="primary" :plain="item.version==varsionCode?false:true" size="mini" class="versionclick active" @click="varyClick(item)">{{ item.version }}</el-button>
</el-col>
<el-col :span="4" style="text-align: right;">
<el-button type="warning" @click="qiyongFlow" v-if="isState != 1">启用{{ isState }}</el-button>
</el-col>
</el-row>
<div class="kuangjiangao">
<div class="dashboard-container">
<div class="gva-table-box">
<section class="dingflow-design">
<!-- <div class="zoom">
<el-button type="button" @click="saveSet"> </el-button>
</div> -->
<!--流程画布-->
<div class="box-scale" id="box-scale" :style="'transform: scale('+nowVal/100+'); transform-origin: 50% 0px 0px;'">
<nodeWrap :nodeConfig.sync="nodeConfig" :flowPermission.sync="flowPermission"></nodeWrap>
<div class="end-node">
<div class="end-node-circle"></div>
<div class="end-node-text">流程结束</div>
</div>
</div>
</section>
</div>
<promoterDrawer />
<approverDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<copyerDrawer />
<conditionDrawer />
<errorDialog
:visible.sync="tipVisible"
:list="tipList"
/>
</div>
</div>
</el-dialog>
</template>
<script>
import { getWorkFlowVersionList,StartUsingVersion } from "@/api/workflowapi/workflowaip"
import promoterDrawer from "@/customworkflow/drawer/promoterDrawer" //
import approverDrawer from "@/customworkflow/drawer/approverDrawer" //
import copyerDrawer from "@/customworkflow/drawer/copyerDrawer" //
import conditionDrawer from '@/customworkflow/drawer/conditionDrawer' //
import errorDialog from '@/customworkflow/dialog/errorDialog'
import { mapMutations } from 'vuex'
export default {
components: {
promoterDrawer,
approverDrawer,
copyerDrawer,
conditionDrawer,
errorDialog
},
props: ['lookboxIsShow','lookWorkFlowCont','closeLookWorkFlow'],
data() {
return {
varsionCode:this.lookWorkFlowCont.version,
nowVal:100,
nodeConfig: {}, //
flowPermission: [], //()
directorMaxLevel: 0, //
workFlowDef: {}, //
tipVisible: false, //
tipList: [], //
versionList:[], //
isState:1,
versionId:0,
}
},
created(){
// this.nodeConfig = JSON.parse(this.lookWorkFlowCont.content)
},
watch:{
lookboxIsShow(){
// console.log("",this.lookWorkFlowCont)
// this.nodeConfig = JSON.parse(this.lookWorkFlowCont.content)
// console.log("===>",this.nodeConfig)
this.varsionCode = this.lookWorkFlowCont.version
this.isState = this.lookWorkFlowCont.vstate
this.versionId = this.lookWorkFlowCont.vid
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = JSON.parse(this.lookWorkFlowCont.content); //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
this.getWorkFlowVersionList();
}
},
methods:{
//
closeDialogLook(){
this.$emit('closeLookWorkFlow');
},
//
async getWorkFlowVersionList(){
let sendData = {
id:this.lookWorkFlowCont.key.toString()
}
const res = await getWorkFlowVersionList(sendData);
// console.log("--->",res);
if(res.code == 0){
this.versionList=res.data
}
},
//
varyClick(val){
// console.log("--->",val);
this.varsionCode = val.version
this.isState = val.state
this.versionId = val.id
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = JSON.parse(val.content); //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
},
//
async qiyongFlow(){
let sendCont = {
id: this.versionId.toString()
}
const res = await StartUsingVersion(sendCont);
// console.log("",res)
if(res.code == 0){
this.isState = 1
}
},
}
}
</script>
<style lang='less'>
.miaoshu{
padding-left: 25px;
}
.versionclick{
.active{
background-color: #F00;
}
}
</style>

233
src/views/workflow/myFlow.vue

@ -0,0 +1,233 @@
<template>
<div class="dashboard-container">
<div class="gva-table-box">
<section class="dingflow-design">
<div class="zoom">
<el-button type="button" @click="saveSet"> </el-button>
</div>
<!--流程画布-->
<div class="box-scale" id="box-scale" :style="'transform: scale('+nowVal/100+'); transform-origin: 50% 0px 0px;'">
<nodeWrap :nodeConfig.sync="nodeConfig" :flowPermission.sync="flowPermission"></nodeWrap>
<div class="end-node">
<div class="end-node-circle"></div>
<div class="end-node-text">流程结束</div>
</div>
</div>
</section>
</div>
<promoterDrawer />
<approverDrawer :directorMaxLevel="directorMaxLevel" :nodeConfig="nodeConfig"/>
<copyerDrawer />
<conditionDrawer />
<errorDialog
:visible.sync="tipVisible"
:list="tipList"
/>
</div>
</template>
<script>
import { initializeWorkFlow } from "@/api/workflowapi/workflowaip"
import promoterDrawer from "@/customworkflow/drawer/promoterDrawer" //
import approverDrawer from "@/customworkflow/drawer/approverDrawer" //
import copyerDrawer from "@/customworkflow/drawer/copyerDrawer" //
import conditionDrawer from '@/customworkflow/drawer/conditionDrawer' //
import errorDialog from '@/customworkflow/dialog/errorDialog'
import { mapMutations } from 'vuex'
export default {
components: {
promoterDrawer,
approverDrawer,
copyerDrawer,
conditionDrawer,
errorDialog
},
data() {
return {
nowVal:100,
nodeConfig: {}, //
flowPermission: [], //()
processConfig: {}, //
directorMaxLevel: 0, //
workFlowDef: {}, //
tipVisible: false, //
tipList: [], //
}
},
created(){
this.getInitData(); //
},
methods:{
...mapMutations(['setTableId', 'setIsTried','setPromoter']),
reErr({ childNode }) {
if (childNode) {
let { type, error, nodeName, conditionNodes } = childNode
if (type == 1 || type == 2 || type == 3) {
if (error) {
this.tipList.push({ name: nodeName, type: ["", "审核人", "抄送人", "执行人"][type] })
}
this.reErr(childNode)
} else if (type == 5) {
this.reErr(childNode)
} else if (type == 4) {
this.reErr(childNode)
for (var i = 0; i < conditionNodes.length; i++) {
if (conditionNodes[i].error) {
this.tipList.push({ name: conditionNodes[i].nodeName, type: "条件" })
}
this.reErr(conditionNodes[i])
}
}
} else {
childNode = null
}
},
//
saveSet(){
this.setIsTried(true);
this.tipList = [];
this.reErr(this.nodeConfig);
if (this.tipList.length != 0) {
this.tipVisible = true;
return;
}
this.processConfig.flowPermission = this.flowPermission
console.log("saveSet---发布--->",JSON.stringify(this.processConfig))
console.log("saveSet---发布--2->",this.processConfig)
},
//
async getInitData(){
let sendData = {
id:"100194967330234368",
version:"1"
}
const res = await initializeWorkFlow(sendData)
// console.log("---->",res)
this.processConfig = res.data;
let { nodeConfig, flowPermission, directorMaxLevel, workFlowDef, tableId } = res.data; //{ ()id}
this.nodeConfig = nodeConfig;
this.flowPermission = flowPermission;
this.directorMaxLevel = directorMaxLevel;
this.workFlowDef = workFlowDef;
this.setTableId(tableId)
},
}
}
</script>
<style>
#app {
font-family: "Avenir", Helvetica, Arial, sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
color: #333333;
}
.clear:before,
.clear:after {
content: " ";
display: table;
}
.clear:after {
clear: both;
}
.ellipsis {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
.l {
float: left;
}
input {
text-indent: 10px;
}
select {
text-indent: 8px;
}
.ml_10 {
margin-left: 10px;
}
.mr_10 {
margin-right: 10px;
}
.radio_box a,
.check_box a {
font-size: 12px;
position: relative;
padding-left: 20px;
margin-right: 30px;
cursor: pointer;
color: #333;
}
.check_box.not a:hover {
color: #333;
}
.check_box.not a::before,
.check_box.not a:hover::before {
border: none;
}
.check_box.not.active {
background: #f3f3f3;
}
.radio_box a:hover::before,
.check_box a:hover::before {
border: 1px solid #46a6fe;
}
.radio_box a::before,
.check_box a::before {
position: absolute;
width: 14px;
height: 14px;
border: 1px solid #dcdfe6;
border-radius: 2px;
left: 0;
top: 1px;
content: "";
}
.radio_box a::before {
border-radius: 50%;
}
.check-dot.active::after,
.radio_box a.active::after,
.check_box a.active::after {
position: absolute;
width: 10px;
height: 10px;
border-radius: 50%;
top: 3px;
left: 3px;
content: "";
}
.radio_box a.active::after {
background: #46a6fe;
}
.check_box a.active::after {
background: url(~@/assets/images/check_box.png) no-repeat center;
}
.error-modal-list {
width: 455px;
}
</style>

274
src/views/workflow/workflowlist.vue

@ -0,0 +1,274 @@
<!--
@ 作者: 秦东
@ 时间: 2023-03-24 11:55:01
@ 备注: 工作流列表
-->
<template>
<el-container>
<el-header>
<el-form ref="searchForm" :inline="true" :model="searchInfo" class="demo-form-inline">
<el-form-item>
<el-input v-model="searchInfo.name" placeholder="标题"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="searchSubmit">查询</el-button>
</el-form-item>
<el-form-item>
<el-button type="warning" icon="el-icon-plus" @click="addWorkFlow">新增流程</el-button>
</el-form-item>
</el-form>
</el-header>
<el-main>
<el-row>
<el-col :span="24">
<template>
<el-table
:data="workflowdata"
style="width: 100%"
>
<el-table-column
fixed
prop="name"
label="名称"
width="150"
>
</el-table-column>
<el-table-column
fixed
prop="describe"
label="描述"
>
</el-table-column>
<el-table-column
fixed
prop="version"
label="启用版本"
width="150"
align="center"
>
</el-table-column>
<el-table-column
fixed
label="状态"
width="150"
align="center"
>
<template #default="scope">
<el-switch
inline-prompt
active-text="正常"
inactive-text="禁止"
v-model="scope.row.state"
active-color="#13ce66"
inactive-color="#ff4949"
:active-value=1
:inactive-value=2
@change="changeVal($event,scope.row.key)"
/>
</template>
</el-table-column>
<el-table-column
fixed
label="操作"
width="200"
align="center"
>
<template #default="scope">
<el-button
icon="el-icon-view"
size="small"
type="text"
@click="lookWorkFlow(scope.row)"
>查看</el-button>
<el-button
icon="el-icon-edit"
size="small"
type="text"
@click="editWorkFlowCont(scope.row)"
>编辑</el-button>
<el-button
icon="el-icon-delete"
size="small"
type="text"
@click="delWorkFlowCont(scope.row)"
>删除</el-button>
</template>
</el-table-column>
</el-table>
</template>
<addflowcont :addWorkFlowBox="addWorkFlowBox" @closeAddWorkFlow="closeAddWorkFlow"></addflowcont>
<lookflowcont :lookboxIsShow="lookboxIsShow" :lookWorkFlowCont="lookWorkFlowCont" @closeLookWorkFlow="closeLookWorkFlow"></lookflowcont>
<editflowcont :editWorkFlowIsShow="editWorkFlowIsShow" :editWorkFlowInfo="editWorkFlowInfo" @closeEditWorkFlow="closeEditWorkFlow"></editflowcont>
</el-col>
<el-col :span="24">
<el-pagination class="page_body"
background
@current-change="clickPageTurning"
layout="total,prev, pager, next"
:total="total"
:page-size="searchInfo.pagesize"
>
</el-pagination>
</el-col>
</el-row>
</el-main>
</el-container>
</template>
<script>
import { getWorkFlowList,editWorkFlowState } from "@/api/workflowapi/workflowaip"
import addflowcont from "@/views/workflow/flowcont" //
import lookflowcont from "@/views/workflow/lookflowcont" //
import editflowcont from "@/views/workflow/editflowcont" //
export default {
components:{
addflowcont,
lookflowcont,
editflowcont
},
data() {
return {
searchInfo:{
name:"",
page:1,
pagesize:20
}, //
total:0, //
workflowdata:[], //
addWorkFlowBox:false,
lookboxIsShow:false,
lookWorkFlowCont:{}, //
editWorkFlowIsShow:false, //
editWorkFlowInfo:{}, //
}
},
created(){
this.getWorkFlowList();
},
methods:{
//
async getWorkFlowList(){
let sendData = {
name:this.searchInfo.name,
page:this.searchInfo.page,
pagesize:this.searchInfo.pagesize
}
const res = await getWorkFlowList(sendData);
// console.log('',res)
if(res.code == 0){
this.workflowdata = res.data.list
this.total = res.data.total
}
},
//
searchSubmit(){},
//
clickPageTurning(val){
this.searchInfo.page=val
},
//
addWorkFlow(){
this.addWorkFlowBox=true;
},
//
closeAddWorkFlow(){
this.addWorkFlowBox=false;
this.getWorkFlowList();
},
//
async changeVal(val,id){
// console.log(":",val,id)
let sendData = {
id:id,
state:val,
istrue:2
}
const res = await editWorkFlowState(sendData)
// console.log("1:",res,sendData)
if(res.code == 0){
this.getWorkFlowList();
}
},
//
async lookWorkFlow(val){
// console.log(":",val)
this.lookboxIsShow=true;
this.lookWorkFlowCont = val
},
//
closeLookWorkFlow(){
this.lookboxIsShow=false;
},
//
editWorkFlowCont(val){
// console.log(":",val)
this.editWorkFlowInfo = val;
this.editWorkFlowIsShow=true;
},
//
closeEditWorkFlow(){
this.editWorkFlowIsShow=false;
},
//
async delWorkFlowCont(val){
let sendData = {
id:val.key,
state:3,
istrue:2
}
const res = await editWorkFlowState(sendData)
// console.log(":",val,sendData,res,sendData)
if(res.code == 0){
this.getWorkFlowList();
}
},
}
}
</script>
<style lang='less'>
.gaodu{
height:calc(100% - 50px);
}
.el-container {
height:calc(100% - 50px);
overflow: hidden;
}
.el-header, .el-footer {
border-bottom: 1px solid rgb(220, 223, 230);
text-align: left;
line-height: 60px;
padding: 10px 0 0 10px;
}
.el-scrollbar {
height: 101%;
width: 100%;
}
.el-scrollbar__wrap {
overflow: auto;
overflow: scroll;
}
.el-tree-node.is-current>.el-tree-node__content {
color:#2E89DE!important
}
.el-tree-node_black {
background-color:red !important;
color:#2E89DE!important
}
div::-webkit-scrollbar {
width: 5px;
height: 5px;
}
div::-webkit-scrollbar-thumb {
border-radius: 10px;
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
opacity: 0.2;
}
div::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
border-radius: 0;
}
</style>
Loading…
Cancel
Save