From d83860d6839daaf7dccda5cbd68e865ba7e679ab Mon Sep 17 00:00:00 2001 From: maven <2163098428@qq.com> Date: 星期二, 08 七月 2025 17:48:56 +0800 Subject: [PATCH] Merge remote-tracking branch 'origin/dev' into dev --- src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 59 insertions(+), 0 deletions(-) diff --git a/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue b/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue new file mode 100644 index 0000000..2ac2c10 --- /dev/null +++ b/src/views/procurementManagement/procurementInvoiceLedger/Modal/EditModal.vue @@ -0,0 +1,59 @@ +<template> + <el-dialog :title="modalOptions.title" v-model="visible" @close="close"> + <EditForm ref="editFormRef" /> + <template #footer> + <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button> + <el-button type="primary" :loading="loading" @click="sendForm"> + {{ modalOptions.confirmText }} + </el-button> + </template> + </el-dialog> +</template> + +<script setup> +import { useModal } from "@/hooks/useModal"; +import EditForm from "../Form/EditForm.vue"; +import { updateRegistration } from "@/api/procurementManagement/procurementInvoiceLedger"; +import { ElMessage } from "element-plus"; + +defineOptions({ + name: "鏉ョエ鍙拌处缂栬緫", +}); +const emits = defineEmits(["success"]); + +const editFormRef = ref(); +const { + id, + visible, + loading, + openModal, + modalOptions, + handleConfirm, + closeModal, +} = useModal({ title: "鏉ョエ鍙拌处" }); + +const open = async (id) => { + openModal(id); + await nextTick(); + editFormRef.value.load(id); +}; + +const close = () => { + editFormRef.value.resetForm(); + closeModal(); +}; + +const sendForm = async () => { + const form = editFormRef.value.form; + const { code } = await updateRegistration(form); + if (code === 200) { + emits("success"); + ElMessage({ message: "鎿嶄綔鎴愬姛", type: "success" }); + close(); + } +}; + +defineExpose({ + open, +}); +</script> -- Gitblit v1.9.3