From 4a364d65d24020dcacab6c1ee86f854d8de8cd36 Mon Sep 17 00:00:00 2001
From: pyt <626651354@qq.com>
Date: 星期一, 19 五月 2025 09:05:19 +0800
Subject: [PATCH] feat

---
 culture/src/views/strain-library/strain-library-manage/record.vue |   56 ++++++++++++++++++++++++++------------------------------
 1 files changed, 26 insertions(+), 30 deletions(-)

diff --git a/culture/src/views/strain-library/strain-library-manage/record.vue b/culture/src/views/strain-library/strain-library-manage/record.vue
index 3c145dc..0db0f96 100644
--- a/culture/src/views/strain-library/strain-library-manage/record.vue
+++ b/culture/src/views/strain-library/strain-library-manage/record.vue
@@ -7,15 +7,15 @@
                 <div class="info-row">
                     <div class="info-item left-column">
                         <span class="label">菌种编号:</span>
-                        <span class="value">{{ detail.strainNo }}</span>
+                        <span class="value">{{ detail.strainCode }}</span>
                     </div>
                     <div class="info-item flex-column">
                         <span class="label">鉴定方法:</span>
-                        <span class="value">{{ detail.method }}</span>
+                        <span class="value">{{ detail.appraisalMethod }}</span>
                     </div>
                     <div class="info-item flex-column">
                         <span class="label">保藏位置:</span>
-                        <span class="value">{{ detail.amount }}</span>
+                        <span class="value">{{ detail.saveLocation }}</span>
                     </div>
                 </div>
                 
@@ -27,7 +27,7 @@
                     </div>
                     <div class="info-item flex-column full-width">
                         <span class="label">特性描述:</span>
-                        <span class="value">{{ detail.certificate }}</span>
+                        <span class="value">{{ detail.features }}</span>
                     </div>
                 </div>
                 
@@ -35,11 +35,11 @@
                 <div class="info-row">
                     <div class="info-item left-column">
                         <span class="label">菌种来源:</span>
-                        <span class="value">{{ detail.source }}</span>
+                        <span class="value">{{ detail.strainSource }}</span>
                     </div>
                     <div class="info-item flex-column">
                         <span class="label">菌种保存方法:</span>
-                        <span class="value">{{ detail.storage }}</span>
+                        <span class="value">{{ detail.saveMethod }}</span>
                     </div>
                 </div>
             </div>
@@ -85,7 +85,6 @@
             </template> 
             <template #tableCustom v-if="currentType === 'timeline'">
                 <record-timeline :list="timelineList" />
-
             </template>
         </TableCustom>
 
@@ -108,6 +107,7 @@
 import RecordDetailDialog from './components/RecordDetailDialog.vue'
 import AddRecordDialog from './components/AddRecordDialog.vue'
 import RecordTimeline from './components/RecordTimeline.vue'
+import { timeList,getDetail,addWarehousing } from './service' 
 
 export default {
     name: 'StrainRecord',
@@ -164,23 +164,25 @@
                     status: '已确认'
                 }
             ],
+            timelineList: [],
             dialogVisible: false,
             currentRecord: {},
             addDialogVisible: false
         }
     },
     computed: {
-        timelineList() {
-            // 可根据需要处理数据格式,这里直接用 recordList
-            return this.recordList.map(item => ({
-                ...item,
-                confirmTime: item.confirmTime || item.operateTime // 若无确认时间则用操作时间
-            }))
-        }
+        // timelineList() {
+        //     // 可根据需要处理数据格式,这里直接用 recordList
+        //     return this.recordList.map(item => ({
+        //         ...item,
+        //         confirmTime: item.confirmTime || item.operateTime // 若无确认时间则用操作时间
+        //     }))
+        // }
     },
     created() {
         // 获取路由参数中的菌种信息
         const strainId = this.$route.query.id
+        this.queryForm.id = strainId
         if (strainId) {
             this.getStrainDetail(strainId)
             this.getRecordList()
@@ -189,21 +191,15 @@
     methods: {
         getStrainDetail(id) {
             // 这里应该调用接口获取菌种详情
-            // 暂时使用模拟数据
-            this.detail = {
-                strainNo: '3418732431',
-                strainName: '名称名称名称',
-                source: '来源11111111111',
-                method: '1231231',
-                certificate: '特性描述',
-                storage: '方法方法',
-                amount: '位置位置位置位置位置位置位置位置',
-                operator: '入库'
-            }
+            getDetail({id}).then(res => {
+                this.detail = res
+            })
         },
         getRecordList() {
             // 这里应该调用接口获取出入库记录
-            // 暂时使用已有模拟数据
+            timeList(this.queryForm).then(res => {
+               this.timelineList = res.data
+            })
             this.total = this.recordList.length
         },
         handleView(row) {
@@ -262,10 +258,10 @@
             this.getRecordList()
         },
         handleAddRecordConfirm(record) {
-            // 这里可以将新记录添加到 recordList 或调用后端API
-            this.$message.success('新增出入库记录成功')
-            // 例如:this.recordList.push(record)
-            this.getRecordList() // 或刷新列表
+            addWarehousing({...record,trainLibraryId: this.$route.query.id}).then(res => {
+                this.$message.success('操作成功')
+                this.getRecordList() 
+            })
         },
         goBack() {
             this.$router.go(-1)

--
Gitblit v1.7.1