From d9aab92fa25860c6682debe50e10770dc7db42a0 Mon Sep 17 00:00:00 2001
From: cuikaidong <ckd2942379034@163.com>
Date: 星期四, 14 八月 2025 12:44:33 +0800
Subject: [PATCH] 组合刀模块增加

---
 src/views/tms/WarehouseList.vue |   15 ++++++++++++++-
 1 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/src/views/tms/WarehouseList.vue b/src/views/tms/WarehouseList.vue
index 9be0090..9466732 100644
--- a/src/views/tms/WarehouseList.vue
+++ b/src/views/tms/WarehouseList.vue
@@ -268,7 +268,20 @@
     },
     methods: {
       handleAdd: function () {
-        const nextSeq = Number(this.dataSource[this.dataSource.length - 1].seq) + 1
+        let nextSeq = 0;
+        // 瀹夊叏鐨勫啓娉�
+        if (this.dataSource && this.dataSource.length > 0) {
+          const lastItem = this.dataSource[this.dataSource.length - 1];
+          if (lastItem && lastItem.seq !== undefined) {
+            nextSeq = Number(lastItem.seq) + 1;
+          } else {
+            // 澶勭悊鏈�鍚庝竴涓厓绱犱笉瀛樺湪seq鐨勬儏鍐�
+            nextSeq = 0; // 鎴栧叾浠栭粯璁ゅ��
+          }
+        } else {
+          // 澶勭悊鏁扮粍涓虹┖鐨勬儏鍐�
+          nextSeq = 0; // 鎴栧叾浠栭粯璁ゅ��
+        }
         this.$refs.modalForm.add(nextSeq);
         this.$refs.modalForm.title = "鏂板";
         this.$refs.modalForm.disableSubmit = false;

--
Gitblit v1.9.3