Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
b7dbb947cc
@ -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": []
|
||||||
|
@ -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
|
||||||
]
|
]
|
||||||
})
|
})
|
||||||
|
@ -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 模块 ==========
|
||||||
|
@ -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();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user