Merge pull request 'feat : 抄送和if判断' (#644) from master into prod
Reviewed-on: http://git.feashow.cn/clay/mosr-web/pulls/644
This commit is contained in:
@@ -59,7 +59,7 @@ export const useProcessStore = defineStore('process', () => {
|
|||||||
const getFormMap = () => {
|
const getFormMap = () => {
|
||||||
//表单映射对象
|
//表单映射对象
|
||||||
const map = new Map();
|
const map = new Map();
|
||||||
processData.value.formItems.forEach(item => itemToMap(map, item))
|
processData.value.formItems?.forEach(item => itemToMap(map, item))
|
||||||
return map
|
return map
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -73,6 +73,7 @@ export const CONDITION_PROPS = {
|
|||||||
|
|
||||||
//抄送节点默认属性
|
//抄送节点默认属性
|
||||||
export const CC_PROPS = {
|
export const CC_PROPS = {
|
||||||
|
assignedType: "ASSIGN_USER", //审批类型
|
||||||
shouldAdd: false,
|
shouldAdd: false,
|
||||||
assignedUser: [],
|
assignedUser: [],
|
||||||
formPerms: []
|
formPerms: []
|
||||||
|
|||||||
@@ -254,11 +254,8 @@
|
|||||||
import {useProcessStore} from '@/stores/processStore.js'
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
import UserPicker from '../common/UserPicker.vue'
|
import UserPicker from '../common/UserPicker.vue'
|
||||||
import RolePicker from '../common/RolePicker.vue'
|
import RolePicker from '../common/RolePicker.vue'
|
||||||
import Ellipsis from '../common/Ellipsis.vue'
|
|
||||||
import RoleItems from "../common/RoleItems.vue";
|
import RoleItems from "../common/RoleItems.vue";
|
||||||
import {computed, defineProps} from 'vue'
|
import {computed, defineProps} from 'vue'
|
||||||
import {checkMatrix} from "../../../../api/user/user";
|
|
||||||
import {ElNotification} from "element-plus";
|
|
||||||
|
|
||||||
const processStore = useProcessStore()
|
const processStore = useProcessStore()
|
||||||
|
|
||||||
|
|||||||
@@ -1,19 +1,31 @@
|
|||||||
<template>
|
<template>
|
||||||
<el-button size="mini" icon="Plus" type="primary" @click="selectUser" round style="margin-bottom: 10px">选择抄送人
|
|
||||||
</el-button>
|
<el-form-item label="⚙ 选择审批对象" prop="text" class="user-type">
|
||||||
|
<el-radio-group v-model="nodeProps.assignedType">
|
||||||
|
<el-radio v-for="item in approvalTypes" :label="item.type" :key="item.type">{{ item.name }}</el-radio>
|
||||||
|
</el-radio-group>
|
||||||
|
|
||||||
|
<!-- <div v-else>-->
|
||||||
|
<!-- <span class="item-desc">发起人自己作为审批人进行审批</span>-->
|
||||||
|
<!-- </div>-->
|
||||||
|
</el-form-item>
|
||||||
|
<div v-if="nodeProps.assignedType === 'ASSIGN_USER'">
|
||||||
|
<el-button size="mini" icon="Plus" type="primary" @click="selectUser" round>选择抄送人</el-button>
|
||||||
|
<avatar-ellipsis :row="3" :user-info="assignedUser"/>
|
||||||
|
<user-picker title="请选择抄送人" multiple ref="userPicker" :v-model="assignedUser" @ok="selectedUser"/>
|
||||||
|
</div>
|
||||||
<!-- <div class="option">-->
|
<!-- <div class="option">-->
|
||||||
<!-- <el-checkbox label="允许发起人添加抄送人" v-model="shouldAdd"></el-checkbox>-->
|
<!-- <el-checkbox label="允许发起人添加抄送人" v-model="shouldAdd"></el-checkbox>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- <org-items v-model="select"/>-->
|
<!-- <org-items v-model="select"/>-->
|
||||||
<avatar-ellipsis :row="3" :user-info="assignedUser" :showArrow="false" />
|
|
||||||
<user-picker title="请选择抄送人" multiple ref="userPicker" v-model:value="assignedUser" @ok="selectedUser"/>
|
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
|
import {useProcessStore} from '@/stores/processStore.js'
|
||||||
import {computed, defineProps} from 'vue'
|
import {computed, defineProps} from 'vue'
|
||||||
import UserPicker from "../common/UserPicker.vue";
|
import UserPicker from "../common/UserPicker.vue";
|
||||||
import AvatarEllipsis from "../common/AvatarEllipsis.vue";
|
import AvatarEllipsis from "../common/AvatarEllipsis.vue";
|
||||||
|
const processStore = useProcessStore()
|
||||||
const userPicker=ref()
|
const userPicker=ref()
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
config: {
|
config: {
|
||||||
@@ -23,6 +35,10 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
const approvalTypes = reactive([
|
||||||
|
{name: "指定人员", type: "ASSIGN_USER"},
|
||||||
|
{name: "财务部门研发投入核算对接人", type: "FINANCIAL_ASSOCIATE"},
|
||||||
|
])
|
||||||
const shouldAdd = computed({
|
const shouldAdd = computed({
|
||||||
get() {
|
get() {
|
||||||
return props.config.shouldAdd || false
|
return props.config.shouldAdd || false
|
||||||
@@ -31,6 +47,10 @@ const shouldAdd = computed({
|
|||||||
props.config.shouldAdd = val
|
props.config.shouldAdd = val
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
const nodeProps = computed(() => {
|
||||||
|
return processStore.getSelectedNode().props;
|
||||||
|
})
|
||||||
const assignedUser = computed({
|
const assignedUser = computed({
|
||||||
get() {
|
get() {
|
||||||
return props.config.assignedUser || []
|
return props.config.assignedUser || []
|
||||||
@@ -43,16 +63,16 @@ const selectUser = () => {
|
|||||||
userPicker.value.showUserPicker()
|
userPicker.value.showUserPicker()
|
||||||
}
|
}
|
||||||
const selectedUser = (select) => {
|
const selectedUser = (select) => {
|
||||||
// let userInfoList = []
|
let userInfoList = []
|
||||||
// for (let val of select) {
|
for (let val of select) {
|
||||||
// let userInfo = {
|
let userInfo = {
|
||||||
// id: val.id,
|
id: val.id,
|
||||||
// name: val.name,
|
name: val.name,
|
||||||
// avatar: val.avatar,
|
avatar: val.avatar,
|
||||||
// }
|
}
|
||||||
// userInfoList.push(userInfo)
|
userInfoList.push(userInfo)
|
||||||
// }
|
}
|
||||||
assignedUser.value = select
|
assignedUser.value = userInfoList
|
||||||
}
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,13 +1,17 @@
|
|||||||
<template>
|
<template>
|
||||||
|
<!-- <div>-->
|
||||||
|
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div>-->
|
||||||
<div v-for="(group, index) in selectedNode.props.groups" :key="index + '_g'" class="group">
|
<div v-for="(group, index) in selectedNode.props.groups" :key="index + '_g'" class="group">
|
||||||
<div class="group-header">
|
<div class="group-header">
|
||||||
<!-- <span class="group-name">条件组 {{ groupNames[index] }}</span>-->
|
<!-- <span class="group-name">条件组 {{ groupNames[index] }}</span>-->
|
||||||
<span class="group-name">条件</span>
|
<span class="group-name">条件</span>
|
||||||
<div class="group-cp">
|
<div class="group-cp">
|
||||||
<!-- <span>组内条件关系:</span>-->
|
<span>组内条件关系:</span>
|
||||||
<!-- <el-switch v-model="group.groupType" active-color="#409EFF"-->
|
<el-switch v-model="group.groupType" active-color="#409EFF"
|
||||||
<!-- inactive-color="#c1c1c1" active-value="AND" inactive-value="OR"-->
|
inactive-color="#c1c1c1" active-value="AND" inactive-value="OR"
|
||||||
<!-- active-text="且" inactive-text="或"/>-->
|
active-text="且" inactive-text="或"/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="group-operation">
|
<div class="group-operation">
|
||||||
@@ -41,6 +45,7 @@
|
|||||||
<el-select placeholder="判断符" style="width: 120px;" v-model="condition.compare"
|
<el-select placeholder="判断符" style="width: 120px;" v-model="condition.compare"
|
||||||
@change="condition.value = []" filterable clearable>
|
@change="condition.value = []" filterable clearable>
|
||||||
<el-option label="等于" value="="></el-option>
|
<el-option label="等于" value="="></el-option>
|
||||||
|
<el-option label="不等于" value="!="></el-option>
|
||||||
<el-option label="包含在" value="IN"></el-option>
|
<el-option label="包含在" value="IN"></el-option>
|
||||||
</el-select>
|
</el-select>
|
||||||
<span v-if="isSelect(condition.id)" style="margin-left: 10px">
|
<span v-if="isSelect(condition.id)" style="margin-left: 10px">
|
||||||
@@ -56,7 +61,8 @@
|
|||||||
</el-select>
|
</el-select>
|
||||||
</span>
|
</span>
|
||||||
<span v-else style="margin-left: 10px">
|
<span v-else style="margin-left: 10px">
|
||||||
<el-input v-if="condition.compare === '='" style="width: 280px;" placeholder="输入比较值"
|
<el-input v-if="condition.compare === '=' ||condition.compare === '!='" style="width: 280px;"
|
||||||
|
placeholder="输入比较值"
|
||||||
v-model="condition.value[0]"/>
|
v-model="condition.value[0]"/>
|
||||||
<el-select v-else style="width: 280px;" multiple clearable filterable allow-create size="small"
|
<el-select v-else style="width: 280px;" multiple clearable filterable allow-create size="small"
|
||||||
v-model="condition.value" placeholder="输入可能包含的值"></el-select>
|
v-model="condition.value" placeholder="输入可能包含的值"></el-select>
|
||||||
@@ -107,6 +113,10 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- </div>-->
|
||||||
|
<!-- <div>-->
|
||||||
|
<!-- <el-input placeholder="请输入表达式"></el-input>-->
|
||||||
|
<!-- </div>-->
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup>
|
<script setup>
|
||||||
@@ -190,7 +200,6 @@ const conditionValType = (type) => {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filterConditionMosr = (list) => {
|
const filterConditionMosr = (list) => {
|
||||||
console.log(processFromPerms.value)
|
|
||||||
processFromPerms.value.forEach((item) => {
|
processFromPerms.value.forEach((item) => {
|
||||||
// console.log(item)
|
// console.log(item)
|
||||||
if (item.required && supportTypes.value.indexOf(item.valueType) > -1) {
|
if (item.required && supportTypes.value.indexOf(item.valueType) > -1) {
|
||||||
@@ -237,8 +246,8 @@ const delSubCondition = (group, index) => {
|
|||||||
const conditionChange = (index, group) => {
|
const conditionChange = (index, group) => {
|
||||||
//条件组进行发生了改变
|
//条件组进行发生了改变
|
||||||
//判断新增的
|
//判断新增的
|
||||||
group.cids.forEach(cid => {
|
group.cids?.forEach(cid => {
|
||||||
if (0 > group.conditions.findIndex(cd => cd.id === cid)) {
|
if (0 > group.conditions?.findIndex(cd => cd.id === cid)) {
|
||||||
//新增条件
|
//新增条件
|
||||||
let condition = {...conditionList.value[index]}
|
let condition = {...conditionList.value[index]}
|
||||||
condition.compare = '';
|
condition.compare = '';
|
||||||
|
|||||||
@@ -1,6 +1,8 @@
|
|||||||
<template>
|
<template>
|
||||||
<node :title="config.name" :show-error="showError" :select-user="selectUser" :mode="mode" :content="content" :node-id="config.id"
|
<node :title="config.name" :show-error="showError" :select-user="selectUser" :mode="mode" :content="content"
|
||||||
:error-info="errorInfo" :show-avatar="true" :user-info="config.props.assignedUser" nodeType="carbonCopyRecipient"
|
:node-id="config.id"
|
||||||
|
:error-info="errorInfo"
|
||||||
|
:show-avatar="config.props.assignedType === 'ASSIGN_USER'" :user-info="config.props.assignedUser"
|
||||||
@selected="emit('selected')" @delNode="emit('delNode')" @insertNode="type => emit('insertNode', type)"
|
@selected="emit('selected')" @delNode="emit('delNode')" @insertNode="type => emit('insertNode', type)"
|
||||||
placeholder="请设置抄送人" :header-bgc="headerBgc" :header-icon="Promotion"/>
|
placeholder="请设置抄送人" :header-bgc="headerBgc" :header-icon="Promotion"/>
|
||||||
</template>
|
</template>
|
||||||
@@ -8,6 +10,7 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import Node from './Node.vue'
|
import Node from './Node.vue'
|
||||||
import {defineProps, defineEmits, computed, defineExpose} from "vue";
|
import {defineProps, defineEmits, computed, defineExpose} from "vue";
|
||||||
|
|
||||||
const emit = defineEmits(['insertNode', 'selected', 'delNode'])
|
const emit = defineEmits(['insertNode', 'selected', 'delNode'])
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
config: {
|
config: {
|
||||||
@@ -41,6 +44,7 @@ const selectUser = computed(() => {
|
|||||||
})
|
})
|
||||||
|
|
||||||
const content = computed(() => {
|
const content = computed(() => {
|
||||||
|
if (props.assignedType === 'ASSIGN_USER') {
|
||||||
if (props.config.props.shouldAdd) {
|
if (props.config.props.shouldAdd) {
|
||||||
return '由发起人指定'
|
return '由发起人指定'
|
||||||
} else if (props.config.props.assignedUser.length > 0) {
|
} else if (props.config.props.assignedUser.length > 0) {
|
||||||
@@ -50,9 +54,14 @@ const content = computed(() => {
|
|||||||
} else {
|
} else {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
return "财务部门研发投入核算对接人"
|
||||||
|
}
|
||||||
})
|
})
|
||||||
//校验数据配置的合法性
|
//校验数据配置的合法性
|
||||||
const validate = (err) => {
|
const validate = (err) => {
|
||||||
|
|
||||||
|
if (props.assignedType === 'ASSIGN_USER') {
|
||||||
showError.value = false
|
showError.value = false
|
||||||
if (props.config.props.shouldAdd) {
|
if (props.config.props.shouldAdd) {
|
||||||
showError.value = false
|
showError.value = false
|
||||||
@@ -63,6 +72,9 @@ const validate = (err) => {
|
|||||||
if (showError.value) {
|
if (showError.value) {
|
||||||
err.push(`抄送节点 ${props.config.name} 未设置抄送人`)
|
err.push(`抄送节点 ${props.config.name} 未设置抄送人`)
|
||||||
}
|
}
|
||||||
|
} else {
|
||||||
|
errorInfo.value = false
|
||||||
|
}
|
||||||
return !showError.value
|
return !showError.value
|
||||||
}
|
}
|
||||||
defineExpose({
|
defineExpose({
|
||||||
|
|||||||
Reference in New Issue
Block a user