Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b7dbb947cc
@ -1477,6 +1477,20 @@
|
||||
"isBody": true
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "OpinionRequired",
|
||||
"superClass": ["Element"],
|
||||
"meta": {
|
||||
"allowedIn": ["bpmn:UserTask"]
|
||||
},
|
||||
"properties": [
|
||||
{
|
||||
"name": "value",
|
||||
"type": "Integer",
|
||||
"isBody": true
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"emumerations": []
|
||||
|
@ -108,16 +108,16 @@
|
||||
<el-form-item label="默认意见">
|
||||
<el-input v-model="DefaultOpinion" type="textarea" placeholder="请输入默认意见" @input="updateOpinion" @blur="updateOpinion" />
|
||||
</el-form-item>
|
||||
<el-form-item label="意见">
|
||||
<!-- <el-radio-group v-model="attachType" @change="updateElementAttachType">-->
|
||||
<!-- <el-radio-->
|
||||
<!-- v-for="dict in getIntDictOptions(DICT_TYPE.BPM_TASK_FORM_APPROVE_REJECT_TYPE)"-->
|
||||
<!-- :key="dict.value"-->
|
||||
<!-- :value="dict.value"-->
|
||||
<!-- >-->
|
||||
<!-- {{ dict.label }}-->
|
||||
<!-- </el-radio>-->
|
||||
<!-- </el-radio-group>-->
|
||||
<el-form-item label="必填">
|
||||
<el-radio-group v-model="OpinionRequired" @change="updateElementOpinionRequired">
|
||||
<el-radio
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.BPM_TASK_OPINION_REQUIRED)"
|
||||
:key="dict.value"
|
||||
:value="dict.value"
|
||||
>
|
||||
{{ dict.label }}
|
||||
</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-collapse-item>
|
||||
<el-collapse-item title="操作按钮" name="sub1" >
|
||||
@ -176,6 +176,8 @@ const prefix = inject('prefix')
|
||||
const width = inject('width')
|
||||
const DefaultOpinion = ref('')
|
||||
const DefaultOpinionEl = ref('')
|
||||
const OpinionRequired = ref('')
|
||||
const OpinionRequiredEl = ref('')
|
||||
const formKey = ref('')
|
||||
const businessKey = ref('')
|
||||
const itemType = ref(0)
|
||||
@ -371,6 +373,14 @@ const resetFormList = () => { //
|
||||
|
||||
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.value = formData.value.businessKey
|
||||
|
||||
@ -400,7 +410,8 @@ const resetFormList = () => { //
|
||||
(ex) =>
|
||||
ex.$type !== `${prefix}:ButtonsSetting` &&
|
||||
ex.$type !== `${prefix}:FormData` &&
|
||||
ex.$type !== `${prefix}:DefaultOpinion`
|
||||
ex.$type !== `${prefix}:DefaultOpinion` &&
|
||||
ex.$type !== `${prefix}:OpinionRequired`
|
||||
) ?? []
|
||||
// 更新元素扩展属性,避免后续报错
|
||||
updateElementExtensions()
|
||||
@ -582,7 +593,10 @@ const updateOpinion = () => {
|
||||
DefaultOpinionEl.value.value = DefaultOpinion.value
|
||||
updateElementExtensions()
|
||||
}
|
||||
|
||||
const updateElementOpinionRequired = () => {
|
||||
OpinionRequiredEl.value.value = OpinionRequired.value
|
||||
updateElementExtensions()
|
||||
}
|
||||
const updateElementExtensions = () => {
|
||||
// 更新回扩展元素
|
||||
const newElExtensionElements = bpmnInstances().moddle.create(`bpmn:ExtensionElements`, {
|
||||
@ -594,6 +608,7 @@ const updateElementExtensions = () => {
|
||||
values: [
|
||||
...otherExtensions.value,
|
||||
DefaultOpinionEl.value,
|
||||
OpinionRequiredEl.value,
|
||||
...buttonsSettingEl.value
|
||||
]
|
||||
})
|
||||
|
@ -186,6 +186,7 @@ export enum DICT_TYPE {
|
||||
BPM_TASK_FORM_ATTACH_TYPE = 'bpm_task_attach_type',
|
||||
BPM_TASK_ATTACH_Upload = 'bpm_task_attach_upload',
|
||||
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_SAME = 'bpm_task_approve_same',
|
||||
// ========== PAY 模块 ==========
|
||||
|
@ -740,8 +740,9 @@ const approveFormRef = ref<FormInstance>()
|
||||
const approveReasonForm = reactive({
|
||||
reason: ''
|
||||
})
|
||||
let approveReasonFlag = false
|
||||
const approveReasonRule = reactive<FormRules<typeof approveReasonForm>>({
|
||||
reason: [{ required: true, message: '审批意见不能为空', trigger: 'blur' }],
|
||||
reason: [{ required: approveReasonFlag, message: '审批意见不能为空', trigger: 'blur' }],
|
||||
})
|
||||
// 拒绝表单
|
||||
const rejectFormRef = ref<FormInstance>()
|
||||
@ -1349,9 +1350,21 @@ const loadTodoTask = async(task: any) => {
|
||||
} else {
|
||||
approveForm.value = {} // 占位,避免为空
|
||||
if( task ) {
|
||||
const defaultopinionpinion = await TaskApi.getTaskConfigFromBpmn( task.id ,"defaultOpinion")
|
||||
//console.log(defaultopinionpinion,"defaultopinionpinion")
|
||||
approveReasonForm.reason =defaultopinionpinion
|
||||
const defaultopinion = await TaskApi.getTaskConfigFromBpmn( task.id ,"defaultOpinion")
|
||||
if ( defaultopinion != null ) {
|
||||
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();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user