From e8a3fe2cb3d3198852787362618ab0524b0ec417 Mon Sep 17 00:00:00 2001 From: gongfuxiang Date: Thu, 25 Aug 2022 18:16:40 +0800 Subject: [PATCH] =?UTF-8?q?=E5=95=86=E5=93=81=E8=A7=84=E6=A0=BC=E6=A8=A1?= =?UTF-8?q?=E6=9D=BF=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- public/static/admin/default/js/goods.js | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/public/static/admin/default/js/goods.js b/public/static/admin/default/js/goods.js index ffb7a30a0..5c48be49a 100755 --- a/public/static/admin/default/js/goods.js +++ b/public/static/admin/default/js/goods.js @@ -735,6 +735,15 @@ $(function() data: {"category_ids": value}, success: function(result) { + // 移除现有模板 + $spec_quick.find('select option').each(function(k, v) + { + if(k > 0) + { + $(this).remove(); + } + }); + // 循环处理得到的最新模板 if((result.data || null) != null && result.data.length > 0) { var html = ''; @@ -743,15 +752,8 @@ $(function() html += ''; } $spec_quick.find('select').append(html); - } else { - $spec_quick.find('select option').each(function(k, v) - { - if(k > 0) - { - $(this).remove(); - } - }); } + // 更新select组件 $spec_quick.find('select').trigger('chosen:updated'); }, error: function(xhr, type)