Merge remote-tracking branch 'origin/master'

This commit is contained in:
XaoLi717 2025-02-10 08:43:21 +08:00
commit b7dbb947cc
4 changed files with 59 additions and 16 deletions

View File

@ -1477,6 +1477,20 @@
"isBody": true "isBody": true
} }
] ]
},
{
"name": "OpinionRequired",
"superClass": ["Element"],
"meta": {
"allowedIn": ["bpmn:UserTask"]
},
"properties": [
{
"name": "value",
"type": "Integer",
"isBody": true
}
]
} }
], ],
"emumerations": [] "emumerations": []

View File

@ -108,16 +108,16 @@
<el-form-item label="默认意见"> <el-form-item label="默认意见">
<el-input v-model="DefaultOpinion" type="textarea" placeholder="请输入默认意见" @input="updateOpinion" @blur="updateOpinion" /> <el-input v-model="DefaultOpinion" type="textarea" placeholder="请输入默认意见" @input="updateOpinion" @blur="updateOpinion" />
</el-form-item> </el-form-item>
<el-form-item label="意见"> <el-form-item label="必填">
<!-- <el-radio-group v-model="attachType" @change="updateElementAttachType">--> <el-radio-group v-model="OpinionRequired" @change="updateElementOpinionRequired">
<!-- <el-radio--> <el-radio
<!-- v-for="dict in getIntDictOptions(DICT_TYPE.BPM_TASK_FORM_APPROVE_REJECT_TYPE)"--> v-for="dict in getIntDictOptions(DICT_TYPE.BPM_TASK_OPINION_REQUIRED)"
<!-- :key="dict.value"--> :key="dict.value"
<!-- :value="dict.value"--> :value="dict.value"
<!-- >--> >
<!-- {{ dict.label }}--> {{ dict.label }}
<!-- </el-radio>--> </el-radio>
<!-- </el-radio-group>--> </el-radio-group>
</el-form-item> </el-form-item>
</el-collapse-item> </el-collapse-item>
<el-collapse-item title="操作按钮" name="sub1" > <el-collapse-item title="操作按钮" name="sub1" >
@ -176,6 +176,8 @@ const prefix = inject('prefix')
const width = inject('width') const width = inject('width')
const DefaultOpinion = ref('') const DefaultOpinion = ref('')
const DefaultOpinionEl = ref('') const DefaultOpinionEl = ref('')
const OpinionRequired = ref('')
const OpinionRequiredEl = ref('')
const formKey = ref('') const formKey = ref('')
const businessKey = ref('') const businessKey = ref('')
const itemType = ref(0) const itemType = ref(0)
@ -371,6 +373,14 @@ const resetFormList = () => { //
DefaultOpinion.value = DefaultOpinionEl.value.value DefaultOpinion.value = DefaultOpinionEl.value.value
//
OpinionRequiredEl.value =
elExtensionElements.value.values?.filter(
(ex) => ex.$type === `${prefix}:OpinionRequired`
)?.[0] || bpmnInstances().moddle.create(`${prefix}:OpinionRequired`, { value: 0 })
OpinionRequired.value = OpinionRequiredEl.value.value
// businessKey formData // businessKey formData
businessKey.value = formData.value.businessKey businessKey.value = formData.value.businessKey
@ -400,7 +410,8 @@ const resetFormList = () => { //
(ex) => (ex) =>
ex.$type !== `${prefix}:ButtonsSetting` && ex.$type !== `${prefix}:ButtonsSetting` &&
ex.$type !== `${prefix}:FormData` && ex.$type !== `${prefix}:FormData` &&
ex.$type !== `${prefix}:DefaultOpinion` ex.$type !== `${prefix}:DefaultOpinion` &&
ex.$type !== `${prefix}:OpinionRequired`
) ?? [] ) ?? []
// //
updateElementExtensions() updateElementExtensions()
@ -582,7 +593,10 @@ const updateOpinion = () => {
DefaultOpinionEl.value.value = DefaultOpinion.value DefaultOpinionEl.value.value = DefaultOpinion.value
updateElementExtensions() updateElementExtensions()
} }
const updateElementOpinionRequired = () => {
OpinionRequiredEl.value.value = OpinionRequired.value
updateElementExtensions()
}
const updateElementExtensions = () => { const updateElementExtensions = () => {
// //
const newElExtensionElements = bpmnInstances().moddle.create(`bpmn:ExtensionElements`, { const newElExtensionElements = bpmnInstances().moddle.create(`bpmn:ExtensionElements`, {
@ -594,6 +608,7 @@ const updateElementExtensions = () => {
values: [ values: [
...otherExtensions.value, ...otherExtensions.value,
DefaultOpinionEl.value, DefaultOpinionEl.value,
OpinionRequiredEl.value,
...buttonsSettingEl.value ...buttonsSettingEl.value
] ]
}) })

View File

@ -186,6 +186,7 @@ export enum DICT_TYPE {
BPM_TASK_FORM_ATTACH_TYPE = 'bpm_task_attach_type', BPM_TASK_FORM_ATTACH_TYPE = 'bpm_task_attach_type',
BPM_TASK_ATTACH_Upload = 'bpm_task_attach_upload', BPM_TASK_ATTACH_Upload = 'bpm_task_attach_upload',
BPM_TASK_FORM_APPROVE_REJECT_TYPE = 'bpm_task_approve_reject_type', BPM_TASK_FORM_APPROVE_REJECT_TYPE = 'bpm_task_approve_reject_type',
BPM_TASK_OPINION_REQUIRED = 'bpm_task_opinion_required',
BPM_TASK_APPROVE_NULL = 'bpm_task_approve_null', BPM_TASK_APPROVE_NULL = 'bpm_task_approve_null',
BPM_TASK_APPROVE_SAME = 'bpm_task_approve_same', BPM_TASK_APPROVE_SAME = 'bpm_task_approve_same',
// ========== PAY 模块 ========== // ========== PAY 模块 ==========

View File

@ -740,8 +740,9 @@ const approveFormRef = ref<FormInstance>()
const approveReasonForm = reactive({ const approveReasonForm = reactive({
reason: '' reason: ''
}) })
let approveReasonFlag = false
const approveReasonRule = reactive<FormRules<typeof approveReasonForm>>({ const approveReasonRule = reactive<FormRules<typeof approveReasonForm>>({
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }], reason: [{ required: approveReasonFlag, message: '审批意见不能为空', trigger: 'blur' }],
}) })
// //
const rejectFormRef = ref<FormInstance>() const rejectFormRef = ref<FormInstance>()
@ -1349,9 +1350,21 @@ const loadTodoTask = async(task: any) => {
} else { } else {
approveForm.value = {} // approveForm.value = {} //
if( task ) { if( task ) {
const defaultopinionpinion = await TaskApi.getTaskConfigFromBpmn( task.id ,"defaultOpinion") const defaultopinion = await TaskApi.getTaskConfigFromBpmn( task.id ,"defaultOpinion")
//console.log(defaultopinionpinion,"defaultopinionpinion") if ( defaultopinion != null ) {
approveReasonForm.reason =defaultopinionpinion approveReasonForm.reason =defaultopinion
}
const opinionrequired = await TaskApi.getTaskConfigFromBpmn( task.id ,"opinionRequired")
if ( opinionrequired != null ) {
if ( opinionrequired == "1" ) {
approveReasonFlag = true
// 便
approveReasonRule.reason[0].required = true
//
approveFormRef.value?.validate();
}
}
} }
} }
} }