Commit e491df8529d9545c3de9a1b8811cff915c4dc54f
1 parent
07820b21
业务线 小程序不用写死,从后端接口获取
Showing
1 changed file
with
17 additions
and
3 deletions
components/unified-task-actions/unified-task-actions.vue
| @@ -43,10 +43,10 @@ | @@ -43,10 +43,10 @@ | ||
| 43 | </view> | 43 | </view> |
| 44 | 44 | ||
| 45 | <view class="form-item"> | 45 | <view class="form-item"> |
| 46 | - <view class="form-label">{{ reasonRequired ? '原因/备注(必填)' : '原因/备注' }}</view> | 46 | + <view class="form-label">{{ reasonLabel }}</view> |
| 47 | <up-textarea | 47 | <up-textarea |
| 48 | v-model.trim="form.reason" | 48 | v-model.trim="form.reason" |
| 49 | - :placeholder="reasonRequired ? '请输入原因/备注(必填)' : '请输入原因/备注(选填)'" | 49 | + :placeholder="reasonPlaceholder" |
| 50 | :count="200" | 50 | :count="200" |
| 51 | maxlength="200" | 51 | maxlength="200" |
| 52 | height="120" | 52 | height="120" |
| @@ -117,10 +117,24 @@ const isReasonRequired = (action) => { | @@ -117,10 +117,24 @@ const isReasonRequired = (action) => { | ||
| 117 | 117 | ||
| 118 | const reasonRequired = computed(() => isReasonRequired(current.value)) | 118 | const reasonRequired = computed(() => isReasonRequired(current.value)) |
| 119 | 119 | ||
| 120 | +/** 处理类动作填的是实施/处理结果,其余动作填原因或备注 */ | ||
| 121 | +const reasonLabel = computed(() => { | ||
| 122 | + const base = current.value?.code === 'HANDLE' ? '处理结果' : '原因/备注' | ||
| 123 | + return reasonRequired.value ? base + '(必填)' : base | ||
| 124 | +}) | ||
| 125 | + | ||
| 126 | +const reasonPlaceholder = computed(() => { | ||
| 127 | + const base = current.value?.code === 'HANDLE' ? '请输入处理结果' : '请输入原因/备注' | ||
| 128 | + return reasonRequired.value ? base + '(必填)' : base + '(选填)' | ||
| 129 | +}) | ||
| 130 | + | ||
| 120 | /** 动作是否需要用户补充信息(处理人/必填原因/附件),都不需要时直接提交 */ | 131 | /** 动作是否需要用户补充信息(处理人/必填原因/附件),都不需要时直接提交 */ |
| 121 | const needsInput = (action) => { | 132 | const needsInput = (action) => { |
| 122 | if (!action) return false | 133 | if (!action) return false |
| 123 | - return action.requireAssignee === true | 134 | + // 处理类动作(HANDLE)必须让用户确认:统一动作没有业务表单, |
| 135 | + // 静默提交会让实施结果、实施照片、实施人全部缺失 | ||
| 136 | + return action.code === 'HANDLE' | ||
| 137 | + || action.requireAssignee === true | ||
| 124 | || action.requireAttachment === true | 138 | || action.requireAttachment === true |
| 125 | || isReasonRequired(action) | 139 | || isReasonRequired(action) |
| 126 | } | 140 | } |