From b30f2d8d7d4239e33109bde8f3ff1bd12fe487d0 Mon Sep 17 00:00:00 2001
From: pyt <626651354@qq.com>
Date: 星期三, 23 四月 2025 15:09:08 +0800
Subject: [PATCH] feat

---
 src/views/dataManagement/confirmation-sheet/components/add.vue |   46 +++++++++++++++++++++++++++++++++++++++++-----
 1 files changed, 41 insertions(+), 5 deletions(-)

diff --git a/src/views/dataManagement/confirmation-sheet/components/add.vue b/src/views/dataManagement/confirmation-sheet/components/add.vue
index 1bd5665..422059f 100644
--- a/src/views/dataManagement/confirmation-sheet/components/add.vue
+++ b/src/views/dataManagement/confirmation-sheet/components/add.vue
@@ -38,7 +38,7 @@
       </template>
     </Table>
     <div class="btn_box flex ">
-      <el-button type="primary" @click="onSubmit">提交确认单</el-button>
+      <el-button type="primary" @click="handleSubmit">提交确认单</el-button>
       <el-button @click="$router.go(-1)">存草稿</el-button>
     </div>
     <experimentalScheduling :show="showScheduling"/>
@@ -47,24 +47,33 @@
       @close="handleTestItemDialogClose"
       @confirm="handleTestItemConfirm"
     />
+    <confirm-dialog
+      :visible.sync="confirmDialogVisible"
+      :formData="confirmFormData"
+      :sampleData="testItems"
+      @confirm="handleConfirmSubmit"
+    />
   </Card>
 </template>
 
 <script>
 import experimentalScheduling from './experimental-scheduling.vue';
 import AddTestItem from './add-test-item.vue'
+import ConfirmDialog from './confirm-dialog.vue'
 
 export default {
   name: 'AddConfirmationSheet',
   components: {
     experimentalScheduling,
-    AddTestItem
+    AddTestItem,
+    ConfirmDialog
   },
   props: {},
   data() {
     return {
       showScheduling: false,
       tableData: [],
+      testItems: [], // 检测项列表
       total: 0,
       form: {
         roleName: "",
@@ -76,7 +85,14 @@
         ],
       },
       menu: [],
-      testItemDialogVisible: false
+      testItemDialogVisible: false,
+      confirmDialogVisible: false,
+      confirmFormData: {
+        planName: '', // 项目课题方案名称
+        testCode: '', // 实验编号
+        testName: '', // 实验名称
+        sampleCode: '' // 取样单编号
+      },
     };
   },
   computed: {
@@ -225,10 +241,30 @@
       this.testItemDialogVisible = false
     },
     handleTestItemConfirm(formData) {
-      console.log('新增检测项数据:', formData)
-      // TODO: 处理新增检测项的逻辑
+      // 将新增的检测项添加到列表中
+      this.testItems.push({
+        ...formData,
+        index: this.testItems.length + 1
+      })
       this.testItemDialogVisible = false
       this.$message.success('添加成功')
+    },
+    handleSubmit() {
+      // 这里可以添加表单验证逻辑
+      this.confirmFormData = {
+        planName: '项目名称示例',
+        testCode: '实验编号示例',
+        testName: '实验名称示例',
+        sampleCode: '取样单编号示例'
+      }
+      this.confirmDialogVisible = true
+    },
+    handleConfirmSubmit(signatureImage) {
+      // 处理最终提交逻辑
+      console.log('提交确认单,签名图片:', signatureImage)
+      // TODO: 调用提交API
+      this.$message.success('提交成功')
+      this.$router.push('/dataManagement/confirmation-sheet')
     }
   },
 };

--
Gitblit v1.7.1