commit
						d4432acec3
					
				| 
						 | 
					@ -120,6 +120,8 @@ export interface SimpleFlowNode {
 | 
				
			||||||
  defaultFlowId?: string
 | 
					  defaultFlowId?: string
 | 
				
			||||||
  // 签名
 | 
					  // 签名
 | 
				
			||||||
  signEnable?: boolean
 | 
					  signEnable?: boolean
 | 
				
			||||||
 | 
					  // 审批意见
 | 
				
			||||||
 | 
					  reasonRequire?: boolean
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
// 候选人策略枚举 ( 用于审批节点。抄送节点 )
 | 
					// 候选人策略枚举 ( 用于审批节点。抄送节点 )
 | 
				
			||||||
export enum CandidateStrategy {
 | 
					export enum CandidateStrategy {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -149,6 +149,7 @@ export type UserTaskFormType = {
 | 
				
			||||||
  taskCompleteListenerHeader?: ListenerParam[]
 | 
					  taskCompleteListenerHeader?: ListenerParam[]
 | 
				
			||||||
  taskCompleteListenerBody?: ListenerParam[]
 | 
					  taskCompleteListenerBody?: ListenerParam[]
 | 
				
			||||||
  signEnable: boolean
 | 
					  signEnable: boolean
 | 
				
			||||||
 | 
					  reasonRequire: boolean
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
export type CopyTaskFormType = {
 | 
					export type CopyTaskFormType = {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -361,6 +361,11 @@
 | 
				
			||||||
            <el-form-item prop="signEnable">
 | 
					            <el-form-item prop="signEnable">
 | 
				
			||||||
              <el-switch v-model="configForm.signEnable" active-text="是" inactive-text="否" />
 | 
					              <el-switch v-model="configForm.signEnable" active-text="是" inactive-text="否" />
 | 
				
			||||||
            </el-form-item>
 | 
					            </el-form-item>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					            <el-divider content-position="left">审批意见</el-divider>
 | 
				
			||||||
 | 
					            <el-form-item prop="reasonRequire">
 | 
				
			||||||
 | 
					              <el-switch v-model="configForm.reasonRequire" active-text="必填" inactive-text="非必填" />
 | 
				
			||||||
 | 
					            </el-form-item>
 | 
				
			||||||
          </el-form>
 | 
					          </el-form>
 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
      </el-tab-pane>
 | 
					      </el-tab-pane>
 | 
				
			||||||
| 
						 | 
					@ -698,6 +703,8 @@ const saveConfig = async () => {
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
  // 签名
 | 
					  // 签名
 | 
				
			||||||
  currentNode.value.signEnable = configForm.value.signEnable
 | 
					  currentNode.value.signEnable = configForm.value.signEnable
 | 
				
			||||||
 | 
					  // 审批意见
 | 
				
			||||||
 | 
					  currentNode.value.reasonRequire = configForm.value.reasonRequire
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  currentNode.value.showText = showText
 | 
					  currentNode.value.showText = showText
 | 
				
			||||||
  settingVisible.value = false
 | 
					  settingVisible.value = false
 | 
				
			||||||
| 
						 | 
					@ -767,6 +774,8 @@ const showUserTaskNodeConfig = (node: SimpleFlowNode) => {
 | 
				
			||||||
  configForm.value.taskCompleteListenerBody = node.taskCompleteListener?.body ?? []
 | 
					  configForm.value.taskCompleteListenerBody = node.taskCompleteListener?.body ?? []
 | 
				
			||||||
  // 6. 签名
 | 
					  // 6. 签名
 | 
				
			||||||
  configForm.value.signEnable = node?.signEnable ?? false
 | 
					  configForm.value.signEnable = node?.signEnable ?? false
 | 
				
			||||||
 | 
					  // 7. 审批意见
 | 
				
			||||||
 | 
					  configForm.value.reasonRequire = node?.reasonRequire ?? false
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
defineExpose({ openDrawer, showUserTaskNodeConfig }) // 暴露方法给父组件
 | 
					defineExpose({ openDrawer, showUserTaskNodeConfig }) // 暴露方法给父组件
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -1463,6 +1463,20 @@
 | 
				
			||||||
          "type": "String"
 | 
					          "type": "String"
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
      ]
 | 
					      ]
 | 
				
			||||||
 | 
					    },
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					      "name": "ReasonRequire",
 | 
				
			||||||
 | 
					      "superClass": ["Element"],
 | 
				
			||||||
 | 
					      "meta": {
 | 
				
			||||||
 | 
					        "allowedIn": ["bpmn:UserTask"]
 | 
				
			||||||
 | 
					      },
 | 
				
			||||||
 | 
					      "properties": [
 | 
				
			||||||
 | 
					        {
 | 
				
			||||||
 | 
					          "name": "value",
 | 
				
			||||||
 | 
					          "type": "Boolean",
 | 
				
			||||||
 | 
					          "isBody": true
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					      ]
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
  ],
 | 
					  ],
 | 
				
			||||||
  "emumerations": []
 | 
					  "emumerations": []
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -167,6 +167,11 @@
 | 
				
			||||||
    <el-form-item prop="signEnable">
 | 
					    <el-form-item prop="signEnable">
 | 
				
			||||||
      <el-switch v-model="signEnable.value" active-text="是" inactive-text="否" />
 | 
					      <el-switch v-model="signEnable.value" active-text="是" inactive-text="否" />
 | 
				
			||||||
    </el-form-item>
 | 
					    </el-form-item>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    <el-divider content-position="left">审批意见</el-divider>
 | 
				
			||||||
 | 
					    <el-form-item prop="reasonRequire">
 | 
				
			||||||
 | 
					      <el-switch v-model="reasonRequire.value" active-text="必填" inactive-text="非必填" />
 | 
				
			||||||
 | 
					    </el-form-item>
 | 
				
			||||||
  </div>
 | 
					  </div>
 | 
				
			||||||
</template>
 | 
					</template>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -227,6 +232,9 @@ const approveType = ref({ value: ApproveType.USER })
 | 
				
			||||||
// 是否需要签名
 | 
					// 是否需要签名
 | 
				
			||||||
const signEnable = ref({ value: false })
 | 
					const signEnable = ref({ value: false })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					// 审批意见
 | 
				
			||||||
 | 
					const reasonRequire = ref({ value: false })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
const elExtensionElements = ref()
 | 
					const elExtensionElements = ref()
 | 
				
			||||||
const otherExtensions = ref()
 | 
					const otherExtensions = ref()
 | 
				
			||||||
const bpmnElement = ref()
 | 
					const bpmnElement = ref()
 | 
				
			||||||
| 
						 | 
					@ -320,6 +328,16 @@ const resetCustomConfigList = () => {
 | 
				
			||||||
    })
 | 
					    })
 | 
				
			||||||
  }
 | 
					  }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 是否需要签名
 | 
				
			||||||
 | 
					  signEnable.value =
 | 
				
			||||||
 | 
					    elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:SignEnable`)?.[0] ||
 | 
				
			||||||
 | 
					    bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  // 审批意见
 | 
				
			||||||
 | 
					  reasonRequire.value =
 | 
				
			||||||
 | 
					    elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:ReasonRequire`)?.[0] ||
 | 
				
			||||||
 | 
					    bpmnInstances().moddle.create(`${prefix}:ReasonRequire`, { value: false })
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // 保留剩余扩展元素,便于后面更新该元素对应属性
 | 
					  // 保留剩余扩展元素,便于后面更新该元素对应属性
 | 
				
			||||||
  otherExtensions.value =
 | 
					  otherExtensions.value =
 | 
				
			||||||
    elExtensionElements.value.values?.filter(
 | 
					    elExtensionElements.value.values?.filter(
 | 
				
			||||||
| 
						 | 
					@ -331,14 +349,11 @@ const resetCustomConfigList = () => {
 | 
				
			||||||
        ex.$type !== `${prefix}:AssignEmptyUserIds` &&
 | 
					        ex.$type !== `${prefix}:AssignEmptyUserIds` &&
 | 
				
			||||||
        ex.$type !== `${prefix}:ButtonsSetting` &&
 | 
					        ex.$type !== `${prefix}:ButtonsSetting` &&
 | 
				
			||||||
        ex.$type !== `${prefix}:FieldsPermission` &&
 | 
					        ex.$type !== `${prefix}:FieldsPermission` &&
 | 
				
			||||||
        ex.$type !== `${prefix}:ApproveType`
 | 
					        ex.$type !== `${prefix}:ApproveType` &&
 | 
				
			||||||
 | 
					        ex.$type !== `${prefix}:SignEnable` &&
 | 
				
			||||||
 | 
					        ex.$type !== `${prefix}:ReasonRequire`
 | 
				
			||||||
    ) ?? []
 | 
					    ) ?? []
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  // 是否需要签名
 | 
					 | 
				
			||||||
  signEnable.value =
 | 
					 | 
				
			||||||
    elExtensionElements.value.values?.filter((ex) => ex.$type === `${prefix}:SignEnable`)?.[0] ||
 | 
					 | 
				
			||||||
    bpmnInstances().moddle.create(`${prefix}:SignEnable`, { value: false })
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
  // 更新元素扩展属性,避免后续报错
 | 
					  // 更新元素扩展属性,避免后续报错
 | 
				
			||||||
  updateElementExtensions()
 | 
					  updateElementExtensions()
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					@ -388,7 +403,8 @@ const updateElementExtensions = () => {
 | 
				
			||||||
      approveType.value,
 | 
					      approveType.value,
 | 
				
			||||||
      ...buttonsSettingEl.value,
 | 
					      ...buttonsSettingEl.value,
 | 
				
			||||||
      ...fieldsPermissionEl.value,
 | 
					      ...fieldsPermissionEl.value,
 | 
				
			||||||
      signEnable.value
 | 
					      signEnable.value,
 | 
				
			||||||
 | 
					      reasonRequire.value
 | 
				
			||||||
    ]
 | 
					    ]
 | 
				
			||||||
  })
 | 
					  })
 | 
				
			||||||
  bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), {
 | 
					  bpmnInstances().modeling.updateProperties(toRaw(bpmnElement.value), {
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -548,6 +548,7 @@ const approveForm = ref<any>({}) // 审批通过时,额外的补充信息
 | 
				
			||||||
const approveFormFApi = ref<any>({}) // approveForms 的 fAPi
 | 
					const approveFormFApi = ref<any>({}) // approveForms 的 fAPi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 审批通过意见表单
 | 
					// 审批通过意见表单
 | 
				
			||||||
 | 
					const reasonRequire = ref()
 | 
				
			||||||
const approveFormRef = ref<FormInstance>()
 | 
					const approveFormRef = ref<FormInstance>()
 | 
				
			||||||
const signRef = ref()
 | 
					const signRef = ref()
 | 
				
			||||||
const approveSignFormRef = ref()
 | 
					const approveSignFormRef = ref()
 | 
				
			||||||
| 
						 | 
					@ -555,17 +556,21 @@ const approveReasonForm = reactive({
 | 
				
			||||||
  reason: '',
 | 
					  reason: '',
 | 
				
			||||||
  signPicUrl: ''
 | 
					  signPicUrl: ''
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
const approveReasonRule = reactive<FormRules<typeof approveReasonForm>>({
 | 
					const approveReasonRule = computed(() => {
 | 
				
			||||||
  reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
 | 
					  return {
 | 
				
			||||||
  signPicUrl: [{ required: true, message: '签名不能为空', trigger: 'change' }]
 | 
					    reason: [{ required: reasonRequire.value, message: '审批意见不能为空', trigger: 'blur' }],
 | 
				
			||||||
 | 
					    signPicUrl: [{ required: true, message: '签名不能为空', trigger: 'change' }]
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
// 拒绝表单
 | 
					// 拒绝表单
 | 
				
			||||||
const rejectFormRef = ref<FormInstance>()
 | 
					const rejectFormRef = ref<FormInstance>()
 | 
				
			||||||
const rejectReasonForm = reactive({
 | 
					const rejectReasonForm = reactive({
 | 
				
			||||||
  reason: ''
 | 
					  reason: ''
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
const rejectReasonRule = reactive<FormRules<typeof rejectReasonForm>>({
 | 
					const rejectReasonRule = computed(() => {
 | 
				
			||||||
  reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }]
 | 
					  return {
 | 
				
			||||||
 | 
					    reason: [{ required: reasonRequire.value, message: '审批意见不能为空', trigger: 'blur' }]
 | 
				
			||||||
 | 
					  }
 | 
				
			||||||
})
 | 
					})
 | 
				
			||||||
 | 
					
 | 
				
			||||||
// 抄送表单
 | 
					// 抄送表单
 | 
				
			||||||
| 
						 | 
					@ -966,6 +971,7 @@ const loadTodoTask = (task: any) => {
 | 
				
			||||||
  approveForm.value = {}
 | 
					  approveForm.value = {}
 | 
				
			||||||
  approveFormFApi.value = {}
 | 
					  approveFormFApi.value = {}
 | 
				
			||||||
  runningTask.value = task
 | 
					  runningTask.value = task
 | 
				
			||||||
 | 
					  reasonRequire.value = task?.reasonRequire ?? false
 | 
				
			||||||
  // 处理 approve 表单.
 | 
					  // 处理 approve 表单.
 | 
				
			||||||
  if (task && task.formId && task.formConf) {
 | 
					  if (task && task.formId && task.formConf) {
 | 
				
			||||||
    const tempApproveForm = {}
 | 
					    const tempApproveForm = {}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue