From a5a80af9017fdb8d378eb6f682e24dae99d19977 Mon Sep 17 00:00:00 2001 From: cuijian <cuijian@xalxzn.com> Date: 星期五, 15 八月 2025 10:12:09 +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