diff --git a/src/components/workflow/dialog/matrixIng.vue b/src/components/workflow/dialog/matrixIng.vue index 6375648..7b47833 100644 --- a/src/components/workflow/dialog/matrixIng.vue +++ b/src/components/workflow/dialog/matrixIng.vue @@ -130,6 +130,9 @@ const judgeIsTrue = (val: number) => { //选择矩阵值 const pickval = (val: martixFieldStruct) => { + if (infor.value.matrix.list == null) { + infor.value.matrix.list = []; + } infor.value.matrix.outcomeid = val.id * 1; infor.value.matrix.outcomeName = val.name; let isAdd = true; diff --git a/src/components/workflow/drwer/copyerSend.vue b/src/components/workflow/drwer/copyerSend.vue index 0105b8e..33133b6 100644 --- a/src/components/workflow/drwer/copyerSend.vue +++ b/src/components/workflow/drwer/copyerSend.vue @@ -8,8 +8,24 @@ import $func from "@/utils/workflow/index"; import { setTypes, selectModes, selectRanges } from "@/utils/workflow/const"; import { useStore } from "@/store/workflow/index"; import { matrixInfo } from "@/api/matrixapi/type"; +import { govthree } from "@/api/opk/opk/api"; +import { + getAllParentNode, + judgeOptionalNode, + analysisForm, + setFlowFormKeyPower, +} from "@/api/workflowapi/index"; +import { formTableField } from "@/api/DesignForm/type"; +import PositionDialog from "@/components/workflow/dialog/positionDialog.vue"; +import FormWord from "@/components/workflow/dialog/formWord.vue"; +import MatrixPage from "@/components/workflow/dialog/matrix.vue"; +import MatrixPageIng from "@/components/workflow/dialog/matrixIng.vue"; let props = defineProps({ + nodeConfig: { + type: Object, + default: () => ({}), + }, isFormFlow: { type: Boolean, default: true, @@ -18,15 +34,45 @@ let props = defineProps({ type: Number, default: 4, }, + customerFormKey: { + type: String, + default: "", + }, + formVersion: { + type: String, + default: "", + }, + formData: { + type: Object, + default() { + return {}; + }, + }, +}); +const formData = computed({ + get() { + return props.formData; + }, + set(val: formStruct) { + emits("update:formData", val); + }, }); + +const nodeOptional = ref(); //审批线已经存在得节点 const isExecutor = ref(false); -let ccSelfSelectFlag = ref([]); -let copyerConfig = ref({}); +const ccSelfSelectFlag = ref([]); +const copyerConfig = ref({}); let store = useStore(); let { setCopyerConfig, setCopyer } = store; let copyerDrawer = computed(() => store.copyerDrawer); let copyerConfig1 = computed(() => store.copyerConfig1); let checkedList = ref([]); //选中得指定成员过度用 +const orgListCopy = ref(); //行政组织 +const orgProps = { + value: "id", + label: "name", + children: "child", +}; let visible = computed({ get() { return copyerDrawer.value; @@ -37,14 +83,72 @@ let visible = computed({ }); const matrixFieldList = ref(); const nodeSendSetUp = ref("first"); -watch(copyerConfig1, (val) => { - if (val.settype == 0) { - copyerConfig.value.settype = 1; +const matrixIsShow = ref(false); +const nodeTitle = ref("审批人设置"); +watch( + copyerConfig1, + (val: any) => { + val.value.attribute = val.value.attribute * 1; + console.log("directormaxlevel", val.value, val.value.type); + matrixIsShow.value = false; + copyerConfig.value = val.value; + + if (val.settype == 0) { + copyerConfig.value.settype = 1; + } + copyerConfig.value = val.value; + ccSelfSelectFlag.value = + copyerConfig.value.ccSelfSelectFlag == 0 + ? [] + : [copyerConfig.value.ccSelfSelectFlag]; + + if (val.value.type == 3) { + if (val.value.nodeName != "") { + nodeTitle.value = val.value.nodeName + "设置"; + } else { + nodeTitle.value = "执行人设置"; + } + } else { + if (val.value.nodeName != "") { + nodeTitle.value = val.value.nodeName + "设置"; + } else { + nodeTitle.value = "审批人设置"; + } + } + isExecutor.value = false; + // copyerConfig.attribute = copyerConfig.attribute*1 + if (visible.value) { + judgeOptionalNode(props.nodeConfig).then((data: any) => { + if (data.code == 0) { + let sendData = { + id: val.value.fromNode, + allcont: data.data.allcont, + }; + getAllParentNode(sendData).then((data: any) => { + if (data.code == 0) { + nodeOptional.value = data.data.allcont; + if (data.data.allcont && data.data.allcont.length > 0) { + data.data.allcont.forEach((item: any) => { + if (item.type == 3) { + isExecutor.value = true; + return; + } + }); + } + } + }); + } + }); + } + if (val.value.settype == 9) { + matrixIsShow.value = true; + matrixFieldList.value = copyerConfig.value.matrix; + } + }, + { + deep: true, } - copyerConfig.value = val.value; - ccSelfSelectFlag.value = - copyerConfig.value.ccSelfSelectFlag == 0 ? [] : [copyerConfig.value.ccSelfSelectFlag]; -}); +); onMounted(() => { console.log("预加载数据建军节--------》", copyerConfig1.value); if (copyerConfig1.settype == 0) { @@ -66,7 +170,7 @@ watch( }; govthree(sendOrg).then(({ data }) => { // console.log("监听审批人设置选项",data) - orgList.value = data; + orgListCopy.value = data; nextTick(() => { setOrgTree(copyerConfig.value.orgList); }); @@ -83,15 +187,71 @@ watch( deep: true, } ); +const powerUnitAry = ref({ + nodeKey: "", + recUnitAry: { + masterUnitList: [], + sunUnitList: [], + unitAllKey: [], + unitAllState: [], + }, +}); +const apiSetup = reactive({ + title: [], + library: [], +}); /** @ 作者: 秦东 @ 时间: 2025-05-26 15:23:01 @ 功能: 写入数据 */ -const saveCopyer = () => {}; +const saveCopyer = () => { + copyerConfig.value.error = !$func.setApproverStr(copyerConfig.value); + setCopyerConfig({ + value: copyerConfig.value, + flag: true, + id: copyerConfig1.value.id, + }); + let powerAry = []; + if ( + powerUnitAry.value.recUnitAry.masterUnitList && + powerUnitAry.value.recUnitAry.masterUnitList.length > 0 + ) { + powerUnitAry.value.recUnitAry.masterUnitList.forEach((item: any) => { + powerAry.push(item); + }); + } + if ( + powerUnitAry.value.recUnitAry.sunUnitList && + powerUnitAry.value.recUnitAry.sunUnitList.length > 0 + ) { + powerUnitAry.value.recUnitAry.sunUnitList.forEach((item: any) => { + if (item.masterUnitList && item.masterUnitList.length > 0) { + item.masterUnitList.forEach((itemSun: any) => { + // powerAry.push(item) + if (!powerAry.includes(itemSun)) { + powerAry.push(itemSun); + } + }); + } + }); + } + // console.log("正确",formData.value) + + let sendInfo: any = { + formKey: props.customerFormKey.toString(), + formVersion: props.formVersion.toString(), + formData: JSON.stringify(formData.value), + formPower: JSON.stringify(formData.value.purview), + }; + // console.log("sendInfo",sendInfo) + setFlowFormKeyPower(sendInfo); + closeDrawer(); +}; //关闭抽屉 const closeDrawer = () => { setCopyer(false); + isExecutor.value = false; }; /** @ 作者: 秦东 @@ -122,6 +282,8 @@ const isShowRatify = (id: number) => { return props.isFormFlow; } else if (id == 4) { return false; + } else if (id == 7) { + return false; } else { return true; } @@ -131,9 +293,9 @@ const isShowRatify = (id: number) => { @ 时间: 2025-05-27 14:19:31 @ 功能: 添加指定成员 */ -let approverVisible = ref(false); -const addApprover = () => { - approverVisible.value = true; +let approverVisibleCopy = ref(false); +const addApproverCopy = () => { + approverVisibleCopy.value = true; checkedList.value = copyerConfig.value.nodeUserList; }; /** @@ -141,9 +303,142 @@ const addApprover = () => { @ 时间: 2025-05-27 15:25:07 @ 功能: 更新指定成员数据 */ -const sureApprover = (data: any) => { +const sureApproverCopy = (data: any) => { + copyerConfig.value.nodeUserList = data; + approverVisibleCopy.value = false; +}; +/** +@ 作者: 秦东 +@ 时间: 2025-05-28 08:18:58 +@ 功能: 选择行政组织 +*/ +const appPosistonVisibleCopy = ref(false); +const checkedPostListCopy = ref([]); //岗位列表 +const addApproverCopyPost = () => { + appPosistonVisibleCopy.value = true; + checkedPostListCopy.value = copyerConfig.value.nodeUserList; +}; +/** +@ 作者: 秦东 +@ 时间: 2025-05-28 08:21:24 +@ 功能: 回填已选择的行政组织 +*/ +const surePostApproverCopy = (data: any) => { + appPosistonVisibleCopy.value = false; copyerConfig.value.nodeUserList = data; - approverVisible.value = false; +}; +/** +@ 作者: 秦东 +@ 时间: 2024-08-08 16:07:49 +@ 功能: 设置选项 +*/ +const flowOrgTree = ref(); +const setOrgTree = (val: any) => { + console.log("设置选项", val); + if (Array.isArray(val)) { + flowOrgTree.value!.setCheckedKeys(val, true); + } else { + flowOrgTree.value!.setCheckedKeys([val], true); + } +}; +/** +@ 作者: 秦东 +@ 时间: 2025-05-28 11:19:02 +@ 功能: 表单字段 +*/ +const appFormTableVisibleCopy = ref(false); +const checkedFormListCpoy = ref([]); //字段列表 +const formTableField = () => { + appFormTableVisibleCopy.value = true; + checkedFormListCpoy.value = copyerConfig.value.nodeUserList; +}; +const sureFormTableApproverCopy = (data: any) => { + copyerConfig.value.nodeUserList = data; + appFormTableVisibleCopy.value = false; +}; +/** +@ 作者: 秦东 +@ 时间: 2024-08-08 15:54:07 +@ 功能: 选中的哪个行政组织 +*/ +const handleNodeClickOrg = (data: any, threePickAry: any) => { + console.log("选中的哪个行政组织----data------->", data); + console.log("选中的哪个行政组织----checked------->", threePickAry); + console.log( + "选中的哪个行政组织----halfCheckedKeys------->", + threePickAry.halfCheckedKeys + ); + console.log("选中的哪个行政组织----checkedKeys------->", threePickAry.checkedKeys); + if ( + threePickAry.halfCheckedKeys && + Array.isArray(threePickAry.halfCheckedKeys) && + threePickAry.halfCheckedKeys.length > 0 + ) { + if ( + threePickAry.checkedKeys && + Array.isArray(threePickAry.checkedKeys) && + threePickAry.checkedKeys.length > 0 + ) { + copyerConfig.value.orgList = threePickAry.checkedKeys; + console.log("选中的哪个行政组织----1------->", copyerConfig.value.orgList); + } else { + copyerConfig.value.orgList = []; + console.log("选中的哪个行政组织----2------->", copyerConfig.value.orgList); + } + } else { + if ( + threePickAry.checkedKeys && + Array.isArray(threePickAry.checkedKeys) && + threePickAry.checkedKeys.length > 0 + ) { + if (data.level <= 3) { + threePickAry.checkedKeys = threePickAry.checkedKeys.filter( + (item) => item !== data.id + ); + } + copyerConfig.value.orgList = threePickAry.checkedKeys; + console.log("选中的哪个行政组织----3------->", copyerConfig.value.orgList); + } else { + copyerConfig.value.orgList = []; + console.log("选中的哪个行政组织----4------->", copyerConfig.value.orgList); + } + } + // if(copyerConfig.value.orgList && Array.isArray(copyerConfig.value.orgList)){ + + // if(threePickAry.halfCheckedKeys && Array.isArray(threePickAry.halfCheckedKeys) && threePickAry.halfCheckedKeys.length > 0){ + + // }else{ + + // if(threePickAry.checkedKeys && Array.isArray(threePickAry.checkedKeys) && threePickAry.checkedKeys.length > 0){ + // threePickAry.checkedKeys = threePickAry.checkedKeys.filter(item => item !== data.id); + // copyerConfig.value.orgList=threePickAry.checkedKeys + // } + // } + + // if(checked){ + // if(!copyerConfig.value.orgList.includes(data.id)){ + // copyerConfig.value.orgList.push(data.id) + // } + // }else{ + // console.log("选中的哪个行政组织----1------->",Array.isArray(copyerConfig.value.orgList),copyerConfig.value.orgList.length > 0) + // if(Array.isArray(copyerConfig.value.orgList) && copyerConfig.value.orgList.length > 0){ + // copyerConfig.value.orgList = copyerConfig.value.orgList.filter(item => item !== data.id); + // } + // } + // }else{ + // if(threePickAry.halfCheckedKeys && Array.isArray(threePickAry.halfCheckedKeys) && threePickAry.halfCheckedKeys.length > 0){ + // copyerConfig.value.orgList=threePickAry.checkedKeys + // }else{ + // if(threePickAry.checkedKeys && Array.isArray(threePickAry.checkedKeys) && threePickAry.checkedKeys.length > 0){ + // threePickAry.checkedKeys = threePickAry.checkedKeys.filter(item => item !== data.id); + // copyerConfig.value.orgList=threePickAry.checkedKeys + // } + // } + // } + console.log( + "选中的哪个行政组织----copyerConfig.value.orgList------->", + copyerConfig.value.orgList + ); }; diff --git a/src/utils/workflow/index.ts b/src/utils/workflow/index.ts index 548bd1f..cbd8b0b 100644 --- a/src/utils/workflow/index.ts +++ b/src/utils/workflow/index.ts @@ -293,13 +293,121 @@ All.prototype = { } }, copyerStr(nodeConfig:any) { - if (nodeConfig.nodeUserList.length != 0) { - return this.arrToStr(nodeConfig.nodeUserList) - } else { - if (nodeConfig.ccSelfSelectFlag == 1) { + console.log("抄送模块解析---->",nodeConfig) + // if (nodeConfig.nodeUserList.length != 0) { + // return this.arrToStr(nodeConfig.nodeUserList) + // } else { + // if (nodeConfig.ccSelfSelectFlag == 1) { + // return "发起人自选" + // } + // } + if (nodeConfig.settype == 1) { + if (nodeConfig.nodeUserList.length == 1) { + return nodeConfig.nodeUserList[0].name + } else if (nodeConfig.nodeUserList.length > 1) { + return this.arrToStr(nodeConfig.nodeUserList) + // if (nodeConfig.examineMode == 1) { + // return this.arrToStr(nodeConfig.nodeUserList) + // } else if (nodeConfig.examineMode == 2) { + // return nodeConfig.nodeUserList.length + "人会签" + // }else if (nodeConfig.examineMode == 3) { + // return nodeConfig.nodeUserList.length + "人或签" + // } + }else{ + // return "指定成员" + } + } else if (nodeConfig.settype == 2) { + + let level = nodeConfig.directorLevel == 1 ? '直接主管' : '第' + nodeConfig.directorLevel + '级主管' + return level + // if (nodeConfig.examineMode == 1) { + // return level + // } else if (nodeConfig.examineMode == 2) { + // return level + "会签" + // }else if (nodeConfig.examineMode == 3) { + // return level + + "或签" + // } + } else if (nodeConfig.settype == 3) { + // console.log("nodeConfig==会签==>",nodeConfig) + if (nodeConfig.nodeUserList.length == 1) { + return nodeConfig.nodeUserList[0].name + }else{ + return "指定行政岗位" + } + } else if (nodeConfig.settype == 4) { + // console.log("nodeConfig.selectRange",nodeConfig.selectRange,nodeConfig.nodeUserList); + if (nodeConfig.selectRange == 1) { return "发起人自选" + } else { + if (nodeConfig.nodeUserList.length > 0) { + if (nodeConfig.selectRange == 2) { + return "发起人从指定成员中自选" + } else { + return '发起人从' + nodeConfig.nodeUserList[0].name + '中自选' + } + } else { + return ""; + } } - } + } else if (nodeConfig.settype == 5) { + return "发起人自己" + } else if (nodeConfig.settype == 6) { + // console.log("nodeConfig==直接主管==>",nodeConfig) + return '从直接主管到通讯录中级别最高的第' + nodeConfig.examineEndDirectorLevel + '个层级主管' + }else if (nodeConfig.settype == 7){ + return "指定前置审批为本节点设置抄送人" + }else if (nodeConfig.settype == 8){ + return nodeConfig.nodeUserList[0].name + // console.log("checkedFormList--1111->",nodeConfig) + // if(nodeConfig.nodeUserList.length > 0){ + // if (nodeConfig.examineMode == 1) { + // return nodeConfig.nodeUserList[0].name + "依次审批" + // } else if (nodeConfig.examineMode == 2) { + // return nodeConfig.nodeUserList[0].name + "会签" + // }else if (nodeConfig.examineMode == 3) { + // return nodeConfig.nodeUserList[0].name + "或签" + // } + // } + + }else if (nodeConfig.settype == 9){ + console.log("setApproverStr---签字解析--9->",nodeConfig.matrix.list); + if(nodeConfig.matrix && nodeConfig.matrix.list){ + let strVal = "" + + if(nodeConfig.matrix.list.length > 0){ + nodeConfig.matrix.list.forEach((item:any,inx:number)=>{ + if (inx > 0) { + strVal += '/'; + } + strVal += item.outcomeName; + }) + } + return strVal + // if (nodeConfig.examineMode == 1) { + // return strVal + "依次审批" + // } else if (nodeConfig.examineMode == 2) { + // return strVal + "会签" + // }else if (nodeConfig.examineMode == 3) { + // return strVal + "或签" + // } + }else{ + return nodeConfig.matrix.outcomeName + // if(nodeConfig.matrix && nodeConfig.matrix.outcomeName){ + // let strVal = nodeConfig.matrix.outcomeName + // if (nodeConfig.examineMode == 1) { + // return strVal + "依次审批" + // } else if (nodeConfig.examineMode == 2) { + // return strVal + "会签" + // }else if (nodeConfig.examineMode == 3) { + // return strVal + "或签" + // } + // } + } + + + }else if (nodeConfig.settype == 10){ + return "指定部门负责人" + } }, toggleStrClass(item: { zdy1: string; }, key: any) { let a = item.zdy1 ? item.zdy1.split(",") : [] diff --git a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue index 7e5d163..1cd3b2e 100644 --- a/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue +++ b/src/views/sysworkflow/lowcodepage/appPage/appPageForm/pageFlow.vue @@ -649,7 +649,14 @@ const simulateFlow = () => { v-model:form-data="state.formData" :form-version="formVersion" /> - +