let objParam = JSON.parse(decodeURIComponent(getUrlParam('obj'))); let layer, element; layui.use(["layer", 'element'], function () { layer = layui.layer; element = layui.element; // tab 切换事件 element.on('tab(demo-filter-tab)', function (data) { let value = $(this).attr('value'); $('#indexIframe').attr('src', 'contract_supplier_list.html?supId=' + value + '&contractId=' + objParam.id + '&type=' + objParam.type); }); let supList = objParam.supList; getSupplierList(supList); }); // 厂家列表 function getSupplierList(list) { let dataList = []; let html = ''; $.each(list, function (index, item) { dataList.push({ name: item.supName, id: item.supId }) }); $.each(dataList, function (index, item) { html += '
  • ' + item.name + '
  • '; }) $('.layui-tab-title').empty().append(html); $('.layui-tab-title li').eq(0).addClass('layui-this'); var scrollableElement = document.getElementById('layui-tab-brief'); // 添加事件监听器来处理滚轮事件 scrollableElement.addEventListener('wheel', function (event) { // 阻止默认的滚动行为 event.preventDefault(); // 检查滚动的方向 var delta = event.deltaY > 0 ? -20 : 20; // 根据需要调整滚动的步长 // 设置新的滚动位置 scrollableElement.scrollLeft += delta; }); $('#indexIframe').attr('src', 'contract_supplier_list.html?supId=' + list[0].supId + '&contractId=' + objParam.id + '&type=' + objParam.type); }