| | |
| | | @closed="resetSubmitDialogState" |
| | | > |
| | | <template v-if="submitDialog.step === 1 && !isSubmitEdit"> |
| | | <p class="template-hint">请选择已启用的审批模板,系统将按模板配置引导填报。</p> |
| | | <p class="template-hint">请先选择模板类型,再选择该类型下已启用的审批模板。</p> |
| | | <div v-loading="submitTemplatesLoading" class="template-grid"> |
| | | <div |
| | | v-for="opt in submitBusinessTypeOptions" |
| | | :key="`biz-type-${opt.value}`" |
| | | class="template-card" |
| | | :class="{ 'is-disabled': !countTemplatesByBusinessType(opt.value) }" |
| | | @click="onBusinessTypePick(opt.value)" |
| | | > |
| | | <span class="template-card-type">{{ opt.label }}</span> |
| | | <span class="template-card-desc"> |
| | | {{ countTemplatesByBusinessType(opt.value) }} 个可用模板 |
| | | </span> |
| | | </div> |
| | | <el-empty |
| | | v-if="!submitTemplatesLoading && !submitBusinessTypeOptions.length" |
| | | description="暂无模板类型" |
| | | :image-size="80" |
| | | class="template-empty" |
| | | /> |
| | | </div> |
| | | </template> |
| | | |
| | | <template v-else-if="submitDialog.step === 2 && !isSubmitEdit"> |
| | | <p class="template-hint"> |
| | | 当前类型:{{ selectedBusinessTypeLabel || "—" }},请选择具体审批模板。 |
| | | <el-button type="primary" link class="ml8" @click="backToBusinessTypePick">更换类型</el-button> |
| | | </p> |
| | | <div v-loading="submitTemplatesLoading" class="template-grid"> |
| | | <div |
| | | v-for="card in submitTemplateCards" |
| | |
| | | </div> |
| | | <el-empty |
| | | v-if="!submitTemplatesLoading && !submitTemplateCards.length" |
| | | description="暂无可用审批模板" |
| | | description="该类型下暂无可用审批模板" |
| | | :image-size="80" |
| | | class="template-empty" |
| | | /> |
| | |
| | | |
| | | <template #footer> |
| | | <el-button |
| | | v-if="submitDialog.step === 2 || isSubmitEdit" |
| | | v-if="submitDialog.step === 3 || isSubmitEdit" |
| | | type="primary" |
| | | :loading="submitSaving" |
| | | @click="onSubmitInstance" |
| | | > |
| | | {{ isSubmitEdit ? "保 存" : "提 交" }} |
| | | </el-button> |
| | | <el-button |
| | | v-if="submitDialog.step === 2 && !isSubmitEdit" |
| | | @click="backToBusinessTypePick" |
| | | > |
| | | 上一步 |
| | | </el-button> |
| | | <el-button @click="submitDialog.visible = false"> |
| | | {{ submitDialog.step === 1 && !isSubmitEdit ? "取 消" : "关 闭" }} |
| | |
| | | const { |
| | | Search, |
| | | APPROVAL_TYPE_OPTIONS, |
| | | submitBusinessTypeOptions, |
| | | submitTemplateCards, |
| | | selectedBusinessTypeLabel, |
| | | countTemplatesByBusinessType, |
| | | submitTemplatesLoading, |
| | | onBusinessTypePick, |
| | | backToBusinessTypePick, |
| | | approvalTypeLabel, |
| | | approvalActionLabel, |
| | | searchForm, |
| | |
| | | border-color: var(--el-color-primary); |
| | | box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.06)); |
| | | } |
| | | .template-card.is-disabled { |
| | | opacity: 0.5; |
| | | cursor: not-allowed; |
| | | } |
| | | .template-card.is-disabled:hover { |
| | | border-color: var(--el-border-color-lighter); |
| | | box-shadow: none; |
| | | } |
| | | .ml8 { |
| | | margin-left: 8px; |
| | | } |
| | | .template-card-type { |
| | | display: inline-block; |
| | | padding: 2px 8px; |