Browse Source

feat: 处理 审批流程 根据 需要人工审批的 做额外处理1

lanceJiang 1 year ago
parent
commit
45adb0fb5d

+ 13 - 1
src/components/scWorkflow/nodes/config.ts

@@ -13,7 +13,10 @@ export const approveTypeOptions = [
 		value: '3'
 		value: '3'
 	}
 	}
 ]
 ]
-
+export const approveTypeOptions_config = approveTypeOptions.reduce((res: { [key: string]: any }, { label, value }) => {
+	res[value] = label
+	return res
+}, {})
 export const approveType_1_options = [
 export const approveType_1_options = [
 	{
 	{
 		label: '设置审批人',
 		label: '设置审批人',
@@ -55,6 +58,10 @@ export const setTypeOptions = [
 		value: 6
 		value: 6
 	}
 	}
 ]
 ]
+export const setTypeOptions_config = setTypeOptions.reduce((res: { [key: string]: any }, { label, value }) => {
+	res[value] = label
+	return res
+}, {})
 // 发起人自选 (人工审批 & setType: 4)
 // 发起人自选 (人工审批 & setType: 4)
 export const selectModeOptions = [
 export const selectModeOptions = [
 	{
 	{
@@ -66,3 +73,8 @@ export const selectModeOptions = [
 		value: 2
 		value: 2
 	}
 	}
 ]
 ]
+
+export const selectModeOptions_config = selectModeOptions.reduce((res: { [key: string]: any }, { label, value }) => {
+	res[value] = label
+	return res
+}, {})

+ 42 - 2
src/views/approve/launch/ItemDrawer.vue

@@ -66,6 +66,7 @@ import { ref, shallowRef, computed, reactive } from 'vue'
 import { ElMessage } from 'element-plus'
 import { ElMessage } from 'element-plus'
 import UseSelect from '@/components/scWorkflow/select.vue'
 import UseSelect from '@/components/scWorkflow/select.vue'
 import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
 import FlowNodeAvatar from '@/components/Flow/FlowNodeAvatar.vue'
+import { approveTypeOptions_config, selectModeOptions_config, setTypeOptions_config } from '@/components/scWorkflow/nodes/config'
 type Props = {
 type Props = {
 	modelValue: boolean
 	modelValue: boolean
 	record: { processId: string; processName: string; [key: string]: any }
 	record: { processId: string; processName: string; [key: string]: any }
@@ -122,7 +123,7 @@ const onSubmit = async () => {
 
 
 // 当前form 表单数据字符串
 // 当前form 表单数据字符串
 let cur_processForm_str = '[]'
 let cur_processForm_str = '[]'
-const processChecked = reactive({
+const processChecked = reactive<{ [key: string]: any }>({
 	/*'local_条件分支_期限': '短期'*/
 	/*'local_条件分支_期限': '短期'*/
 })
 })
 const localProcessData = ref<any[]>([])
 const localProcessData = ref<any[]>([])
@@ -130,7 +131,45 @@ let c_idx = 0
 const packageProcess = (data, list = []) => {
 const packageProcess = (data, list = []) => {
 	return data.reduce((_list, config) => {
 	return data.reduce((_list, config) => {
 		if (config.conditionNode === 0) {
 		if (config.conditionNode === 0) {
-			// console.log(config.name, 'name 普通节点名称', config)
+			console.log(config.name, 'name 普通节点名称', config, data)
+			// 需要人工审批的 做额外处理
+			if (+config.type === 1) {
+				/**
+				 * 设置审批类型 不同情况控制
+				 *
+				 * 1,指定人员
+				 *      模型设计的时候需要判断必须选择人员。  发起的时候不允许重新选择
+				 *
+				 * 2,主管
+				 *      发起的时候不需要选择
+				 *
+				 * 3,角色
+				 *      发起人允许重新选择
+				 *
+				 * 4,发起人自选
+				 *     发起控制:  选择一个人,  选择多个人
+				 *
+				 * 5,发起人自己
+				 *     发起人不能选择,后台控制发起人自己处理
+				 *
+				 * 6,连续多级主管
+				 *     发起人不能选择,后台控制找到对应主管
+				 */
+				const handleName = setTypeOptions_config[config.setType]
+				console.log(handleName, 'handleName')
+				/*switch (handleName) {
+          switch: ''
+                break;
+          switch: ''
+                break;
+          switch: ''
+                break;
+          switch: ''
+                break;
+          switch: ''
+                break;
+        }*/
+			}
 			// 默认用户
 			// 默认用户
 			let type = 1
 			let type = 1
 			let assignees = config.nodeUserList
 			let assignees = config.nodeUserList
@@ -174,6 +213,7 @@ const packageProcess = (data, list = []) => {
 const processTimelineList = computed(() => {
 const processTimelineList = computed(() => {
 	return packageProcess(localProcessData.value)
 	return packageProcess(localProcessData.value)
 })
 })
+window.processTimelineList = processTimelineList
 validateForm.value.loading = true
 validateForm.value.loading = true
 Promise.all([
 Promise.all([
 	model.processListNodeMapApi(props.record.processId).then((res: any) => {
 	model.processListNodeMapApi(props.record.processId).then((res: any) => {