From 982c97ab82f3beb1b4febcf014562eda34b9fc05 Mon Sep 17 00:00:00 2001
From: liu <2021943741@qq.com>
Date: 星期二, 29 九月 2026 17:59:41 +0800
Subject: [PATCH] feat(ui): 江苏商贸品牌视觉与首页/登录页改版

---
 src/views/archive/borrow/modules/return-form.vue |   82 +++++++++++++++++++++++++++++++++++++++++
 1 files changed, 82 insertions(+), 0 deletions(-)

diff --git a/src/views/archive/borrow/modules/return-form.vue b/src/views/archive/borrow/modules/return-form.vue
new file mode 100644
index 0000000..54d3688
--- /dev/null
+++ b/src/views/archive/borrow/modules/return-form.vue
@@ -0,0 +1,82 @@
+<script lang="ts" setup>
+import type { ArchiveBorrowApi } from '#/api/archive/borrow';
+
+import { ref } from 'vue';
+
+import { useVbenModal } from '@vben/common-ui';
+
+import { message } from 'ant-design-vue';
+
+import { useVbenForm } from '#/adapter/form';
+import { returnBorrow } from '#/api/archive/borrow';
+
+defineOptions({ name: 'ArchiveBorrowReturnForm' });
+
+const emit = defineEmits(['success']);
+
+/** 褰撳墠褰掕繕鐨勫�熼槄鍗� */
+const current = ref<ArchiveBorrowApi.Borrow>();
+
+const [Form, formApi] = useVbenForm({
+  commonConfig: {
+    componentProps: {
+      class: 'w-full',
+    },
+  },
+  wrapperClass: 'grid-cols-1',
+  layout: 'vertical',
+  schema: [
+    {
+      fieldName: 'returnRemark',
+      label: '褰掕繕澶囨敞',
+      component: 'Textarea',
+      componentProps: {
+        rows: 3,
+        placeholder: '濡傚綊杩樻椂妗f瀹屽ソ銆佹槸鍚︽湁缂洪〉绛�',
+      },
+    },
+  ],
+  showDefaultActions: false,
+});
+
+const [Modal, modalApi] = useVbenModal({
+  async onConfirm() {
+    const values = (await formApi.getValues()) as { returnRemark?: string };
+    modalApi.lock();
+    try {
+      await returnBorrow({
+        id: current.value!.id!,
+        returnRemark: values.returnRemark,
+      });
+      await modalApi.close();
+      emit('success');
+      message.success('褰掕繕鐧昏鎴愬姛');
+    } finally {
+      modalApi.unlock();
+    }
+  },
+  async onOpenChange(isOpen: boolean) {
+    if (!isOpen) {
+      current.value = undefined;
+      return;
+    }
+    current.value = modalApi.getData<ArchiveBorrowApi.Borrow>();
+    await formApi.resetForm();
+  },
+});
+</script>
+
+<template>
+  <Modal title="褰掕繕鐧昏" class="w-1/2">
+    <div class="mx-3 mb-3 text-sm text-gray-600">
+      <p>
+        鍊熼槄鍗曞彿锛歿{ current?.no }}銆�妗f锛歿{ current?.documentNo }}
+        {{ current?.documentTitle }}
+      </p>
+      <p>
+        鍊熼槄浜猴細{{ current?.borrowerName }}銆�褰掕繕鏈熼檺锛歿{ current?.returnDeadline }}
+      </p>
+    </div>
+    <Form class="mx-3" />
+  </Modal>
+</template>

--
Gitblit v1.9.3