From 7bbab0e74d1d0208fa24ec67e3201427078980cd Mon Sep 17 00:00:00 2001
From: chenhj <1263187585@qq.com>
Date: 星期日, 04 一月 2026 17:01:59 +0800
Subject: [PATCH] 器具校准,校准记录

---
 src/views/maintenance/Modal/MaintenanceModal.vue |   60 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 60 insertions(+), 0 deletions(-)

diff --git a/src/views/maintenance/Modal/MaintenanceModal.vue b/src/views/maintenance/Modal/MaintenanceModal.vue
new file mode 100644
index 0000000..f41fb54
--- /dev/null
+++ b/src/views/maintenance/Modal/MaintenanceModal.vue
@@ -0,0 +1,60 @@
+<template>
+  <el-dialog v-model="visible" :title="modalOptions.title" direction="ltr">
+    <MaintenanceForm ref="maintenanceFormRef" />
+    <template #footer>
+			<el-button type="primary" @click="sendForm" :loading="loading">
+				{{ modalOptions.confirmText }}
+			</el-button>
+      <el-button @click="closeModal">{{ modalOptions.cancelText }}</el-button>
+    </template>
+  </el-dialog>
+</template>
+
+<script setup>
+import MaintenanceForm from "../Form/MaintenanceForm.vue";
+import { useModal } from "../../../hooks/useModal";
+import { addMaintenance } from "../../../api/equipmentManagement/upkeep";
+
+defineOptions({
+  name: "淇濆吇妯℃�佹",
+});
+
+const maintenanceFormRef = ref();
+const emits = defineEmits(["ok"]);
+
+const {
+  id,
+  visible,
+  loading,
+  openModal,
+  modalOptions,
+  handleConfirm,
+  closeModal,
+} = useModal({ title: "璁惧淇濆吇" });
+
+/**
+ * @desc 淇濆瓨淇濆吇
+ */
+const sendForm = async () => {
+  loading.value = true;
+  const form = await maintenanceFormRef.value.getForm();
+  const { code } = await addMaintenance({ id: id.value, ...form });
+  if (code == 200) {
+    emits("ok");
+    maintenanceFormRef.value.resetForm();
+    closeModal();
+  }
+  loading.value = false;
+};
+
+const open = async (id, row) => {
+  openModal(id);
+  await nextTick();
+  maintenanceFormRef.value.setForm(row);
+};
+defineExpose({
+  open,
+});
+</script>
+
+<style lang="scss" scoped></style>

--
Gitblit v1.9.3