----------------------------------------------------------后台------------------------------------------------------------------------
List<DeliveryStore> deliveryStoreList = deliveryStoreService.getAll(getCurrentUser().getTenantId()); model.addAttribute("deliveryStoreList", deliveryStoreList);
----------------------------------------------------------页面------------------------------------------------------------------------
<link rel="stylesheet" href="${base}/static/css/select2.min.css" />
<select id="shopId" name="shopId" class="shopName_selected" data-placeholder="请选择所属门店" style="width: 80%;height:35px;" multiple = "multiple">
<#list deliveryStoreList as list>
<option <#if priceStocks.shopId?contains("${list.storeSn}")> selected="selected"</#if> value="${(list.storeSn)!}">${(list.name)!}</option>
</#list>
</select>
<script src="${base}/static/js/select2.min.js"></script>
$(function(){
//初始化下拉多选搜索框
$("#shopId").select2({
allowClear:true
})
})
var shopId = $("#shopId").val();
if(shopId == null || shopId == ''){
layer.alert("请选择参与的门店",{icon:0});
}