| | |
| | | <el-button @click="resetSearch">重置</el-button> |
| | | </div> |
| | | <div> |
| | | <el-button type="primary" @click="openFormDialog('add')">新增转正申请</el-button> |
| | | <el-button type="primary" @click="openAddWithTemplate">新增转正申请</el-button> |
| | | </div> |
| | | </div> |
| | | <div class="table_list"> |
| | |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="12"> |
| | | <el-col v-if="!form.hasTemplateBinding" :span="12"> |
| | | <el-form-item label="审批方式" prop="approvalMode"> |
| | | <el-radio-group v-model="form.approvalMode"> |
| | | <el-radio value="parallel">与签</el-radio> |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <template v-if="form.hasTemplateBinding"> |
| | | <ApprovalTemplateFormSection |
| | | :active-template="form.templateSnapshot" |
| | | :fields="form.formFieldDefs" |
| | | :form-payload="form.formPayload" |
| | | v-model:flow-nodes="form.flowNodes" |
| | | v-model:attachments="form.storageBlobDTOs" |
| | | :template-attachments="form.templateAttachments" |
| | | :user-options="flowUserOptions" |
| | | :allow-change-template="formDialog.mode === 'add'" |
| | | @change-template="reopenTemplateBind" |
| | | /> |
| | | </template> |
| | | <el-row v-else :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="审批人" prop="approverIds"> |
| | | <el-tree-select |
| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="24"> |
| | | <el-row v-if="!form.hasTemplateBinding" :gutter="24"> |
| | | <el-col :span="24"> |
| | | <el-form-item label="附件"> |
| | | <div class="upload-block"> |
| | |
| | | </div> |
| | | </template> |
| | | </el-dialog> |
| | | |
| | | <ApprovalTemplateBindDialog |
| | | v-model:visible="templateBindVisible" |
| | | :module-key="APPROVAL_MODULE_KEYS.REGULAR" |
| | | @confirm="onTemplateBound" |
| | | /> |
| | | |
| | | <!-- 详情(只读) --> |
| | | <el-dialog v-model="detailDialog.visible" title="转正申请详情" width="640px" append-to-body> |
| | |
| | | import FileUpload from "@/components/AttachmentUpload/file/index.vue"; |
| | | import { deptTreeSelect, userListNoPageByTenantId } from "@/api/system/user.js"; |
| | | import { computed, getCurrentInstance, nextTick, onMounted, reactive, ref, watch } from "vue"; |
| | | import ApprovalTemplateBindDialog from "../../ApproveManage/approve-shared/components/ApprovalTemplateBindDialog.vue"; |
| | | import ApprovalTemplateFormSection from "../../ApproveManage/approve-shared/components/ApprovalTemplateFormSection.vue"; |
| | | import { APPROVAL_MODULE_KEYS } from "../../ApproveManage/approve-shared/approvalModuleRegistry.js"; |
| | | import { |
| | | applyBindingToForm, |
| | | buildFormPayloadRules, |
| | | } from "../../ApproveManage/approve-shared/approvalTemplateBindingUtils.js"; |
| | | import { useFlowUserOptions } from "../../ApproveManage/approve-shared/useFlowUserOptions.js"; |
| | | |
| | | /** 与后端约定字段(占位) */ |
| | | const createEmptyForm = () => ({ |
| | |
| | | approverIds: [], |
| | | approverNames: "", |
| | | attachmentList: [], |
| | | hasTemplateBinding: false, |
| | | templateId: "", |
| | | templateName: "", |
| | | templateSnapshot: null, |
| | | formFieldDefs: [], |
| | | formPayload: {}, |
| | | flowNodes: [], |
| | | templateAttachments: [], |
| | | storageBlobDTOs: [], |
| | | }); |
| | | |
| | | const { proxy } = getCurrentInstance(); |
| | |
| | | }); |
| | | const formRef = ref(); |
| | | const form = reactive(createEmptyForm()); |
| | | const templateBindVisible = ref(false); |
| | | const { flowUserOptions, loadFlowUsers } = useFlowUserOptions(); |
| | | |
| | | const formRules = { |
| | | applicantName: [{ required: true, message: "请输入申请人", trigger: "blur" }], |
| | | applyDate: [{ required: true, message: "请选择申请日期", trigger: "change" }], |
| | | regularizationDate: [{ required: true, message: "请选择转正日期", trigger: "change" }], |
| | | probationSummary: [{ required: true, message: "请填写试用期工作总结", trigger: "blur" }], |
| | | approvalMode: [{ required: true, message: "请选择审批方式", trigger: "change" }], |
| | | approverIds: [ |
| | | { |
| | | type: "array", |
| | | required: true, |
| | | message: "请选择审批人", |
| | | trigger: "change", |
| | | }, |
| | | ], |
| | | }; |
| | | const formRules = computed(() => { |
| | | const base = { |
| | | applicantName: [{ required: true, message: "请输入申请人", trigger: "blur" }], |
| | | applyDate: [{ required: true, message: "请选择申请日期", trigger: "change" }], |
| | | regularizationDate: [{ required: true, message: "请选择转正日期", trigger: "change" }], |
| | | probationSummary: [{ required: true, message: "请填写试用期工作总结", trigger: "blur" }], |
| | | }; |
| | | if (form.hasTemplateBinding) { |
| | | return { ...base, ...buildFormPayloadRules(form.formFieldDefs) }; |
| | | } |
| | | return { |
| | | ...base, |
| | | approvalMode: [{ required: true, message: "请选择审批方式", trigger: "change" }], |
| | | approverIds: [ |
| | | { type: "array", required: true, message: "请选择审批人", trigger: "change" }, |
| | | ], |
| | | }; |
| | | }); |
| | | |
| | | const detailDialog = reactive({ visible: false }); |
| | | const detailRow = ref({}); |
| | |
| | | return; |
| | | } |
| | | proxy?.$modal?.msgSuccess?.(`已模拟下载:${row.name}`); |
| | | } |
| | | |
| | | function openAddWithTemplate() { |
| | | templateBindVisible.value = true; |
| | | } |
| | | |
| | | function onTemplateBound(binding) { |
| | | Object.assign(form, createEmptyForm()); |
| | | applyBindingToForm(form, binding); |
| | | form.hasTemplateBinding = true; |
| | | formDialog.mode = "add"; |
| | | formDialog.title = "新增转正申请"; |
| | | loadApproverTree(); |
| | | loadFlowUsers(); |
| | | formDialog.visible = true; |
| | | nextTick(() => formRef.value?.clearValidate?.()); |
| | | } |
| | | |
| | | function reopenTemplateBind() { |
| | | formDialog.visible = false; |
| | | templateBindVisible.value = true; |
| | | } |
| | | |
| | | function openFormDialog(mode, row) { |
| | |
| | | |
| | | onMounted(() => { |
| | | loadApproverTree(); |
| | | loadFlowUsers(); |
| | | }); |
| | | </script> |
| | | |