This commit is contained in:
lcw
2025-12-27 11:10:31 +08:00
parent 596c9f99e4
commit 3fb06e3847
34 changed files with 1747 additions and 429 deletions

View File

@ -8,22 +8,22 @@
:key="index">{{ item.nodeName }}</el-checkbox>
</el-checkbox-group>
</div>
<div> <el-button type="success" :icon="Plus" @click="newAdditions" v-if="optional"/></div>
<div> <el-button type="success" :icon="Plus" @click="newAdditions" v-if="optional" /></div>
</div>
<div v-if="optional" class="container-box">
<div v-if="optional" class="container-box">
<!-- <div v-if="flwsNode.flwsUserNode?.role.length == 0"> -->
<div class="row" v-for="(item, index) in nodeData" :key="index">
<MOSTY.Department filterable v-model="item.deptId" width="100%"
@getDepValue="(obj) => changePostList(index, obj)" clearable placeholder="请选择所属部门" />
<el-select class="select-user" v-model="item.userId" filterable placeholder="选择审批人"
@change="changeUser(index)">
<el-option v-for="item in item.listData" :key="item.id" :label="item.userName" :value="item.id" />
</el-select>
<div>
<el-button type="danger" @click="newDelitions(index)">删除</el-button>
</div>
</div>
<!-- </div> -->
<div class="row" v-for="(item, index) in nodeData" :key="index">
<MOSTY.Department filterable v-model="item.deptId" width="100%"
@getDepValue="(obj) => changePostList(index, obj)" clearable placeholder="请选择所属部门" />
<el-select class="select-user" v-model="item.userId" filterable placeholder="选择审批人"
@change="changeUser(index)">
<el-option v-for="item in item.listData" :key="item.id" :label="item.userName" :value="item.id" />
</el-select>
<div>
<el-button type="danger" @click="newDelitions(index)">删除</el-button>
</div>
</div>
<!-- </div> -->
</div>
<div class="container-box" v-else>
<div v-for="(item, index) in userList" :key="item.id">
@ -59,7 +59,7 @@
<div v-if="showNode && showModel">
</div>
</div>
<template #footer>
<div class="dialog-footer">
<el-button @click="close">取消</el-button>
@ -246,7 +246,7 @@ const qcckPostList = async () => {
const item = checkListData.value[i].userList[j]
if (item.checkList && item.checkList.length > 0) {
data[checkListData.value[i].nodeId] = {
users: transformData(checkListData.value[i])
users: transformData(checkListData.value[i])
}
} else {
listError.push(checkListData.value[i].nodeName)
@ -341,7 +341,7 @@ const queryModel = async () => {
)
const orgId = getItem('deptId')[0].fzOrgId
if (!orgId) {
proxy.$message({ type: "error", message: "查询模型失败,请重试" })
proxy.$message({ type: "error", message: "查询模型失败,请重试" })
return
}
if (eventNode) {
@ -358,7 +358,7 @@ const queryModel = async () => {
loading.value = false
}
}
const optional=ref(false)
const optional = ref(false)
// 处理事件节点
const handleEventNode = async (eventNode, orgId) => {
const nodeExtension = JSON.parse(eventNode.nodeExtension)
@ -376,13 +376,13 @@ const handleEventNode = async (eventNode, orgId) => {
orgData = await queryListByEntity({ id: orgId })
} else if (nodeExtension.flwsUserNode.orgType == 'parent') {
console.log(2);
console.log(2);
orgData = await querysingleByEntity({ id: orgId })
} else if (nodeExtension.flwsUserNode.orgType == 'parents') {
console.log(3);
console.log(3);
orgData = await queryUporgsByEntity({ id: orgId })
} else if (nodeExtension.flwsUserNode.orgType == 'appoint') {
console.log(4);
console.log(4);
// orgData = await queryUporgsByEntity({ orgcode: orgId })
console.log(orgData);
@ -405,7 +405,7 @@ const handleEventNode = async (eventNode, orgId) => {
userList: userRes.rows[0]
}]
} else if (nodeExtension.flwsUserNode.orgType == 'optional') {
optional.value=true
optional.value = true
} else {
const parentids = orgData.rows.map(item => item.parentid)
@ -514,37 +514,37 @@ const handleNormalNodes = async (resData, sequenceNode, orgId) => {
})
}
function filterUsersWithOrgInfo(orgsData, checkList) {
const result = [];
// 如果没有数据或检查列表为空,返回空数组
if (!orgsData || !Array.isArray(orgsData) || !checkList || checkList.length === 0) {
return result;
}
// 将checkList转换为Set以提高查找效率
const checkSet = new Set(checkList);
// 遍历所有组织
for (const org of orgsData) {
// 检查组织是否有用户数据
if (org.users && Array.isArray(org.users)) {
// 筛选匹配的用户
for (const user of org.users) {
if (checkSet.has(user.userid)) {
// 创建带组织信息的用户对象
const userWithOrgInfo = {
...user, // 保留所有原始用户属性
orgCode: org.code, // 添加组织code
orgName: org.name, // 添加组织name
orgId: org.id // 添加组织id
};
result.push(userWithOrgInfo);
}
}
}
}
const result = [];
// 如果没有数据或检查列表为空,返回空数组
if (!orgsData || !Array.isArray(orgsData) || !checkList || checkList.length === 0) {
return result;
}
// 将checkList转换为Set以提高查找效率
const checkSet = new Set(checkList);
// 遍历所有组织
for (const org of orgsData) {
// 检查组织是否有用户数据
if (org.users && Array.isArray(org.users)) {
// 筛选匹配的用户
for (const user of org.users) {
if (checkSet.has(user.userid)) {
// 创建带组织信息的用户对象
const userWithOrgInfo = {
...user, // 保留所有原始用户属性
orgCode: org.code, // 添加组织code
orgName: org.name, // 添加组织name
orgId: org.id // 添加组织id
};
result.push(userWithOrgInfo);
}
}
}
}
return result;
}
//发消息
const sendMessage = (gzlid) => {
@ -552,11 +552,11 @@ const sendMessage = (gzlid) => {
let userList = []
for (let i = 0; i < checkListData.value.length; i++) {
letDataCheck = [...letDataCheck, ...checkListData.value[i].checkList]
userList.push(checkListData.value[i].userList)
userList.push(checkListData.value[i].userList)
}
const bkshrSfzh = filterUsersWithOrgInfo(userList, letDataCheck).map(item => {
return {
return {
bkshrXm: item.username,
bkshrSfzh: item.userid,
bkshrSsbmmc: item.orgName,
@ -586,6 +586,11 @@ const sendMessage = (gzlid) => {
console.log(res);
})
break;
case 'YPSH':
qcckPost(promes, '/mosty-gsxt/ypbg/sjzl/updateBkgzl').then(res => {
console.log(res);
})
break;
}
}
@ -603,7 +608,7 @@ const close = () => {
orgData: {},
}
]
optional.value=false
optional.value = false
emit('update:modelValue', false)
}
</script>

View File

@ -91,7 +91,6 @@ const qcckGetCount = () => {
} else {
setCookie('JSRSSIONID', res.substring(10, res.length))
}
qcckGetList()
})
} else { qcckGetList() }