记得上下班打卡 | git大法好,push需谨慎

Commit 5607a75d authored by 胡佳晨's avatar 胡佳晨

Merge remote-tracking branch 'origin/dev_221101ZGB01' into dev_221101ZGB01

parents 1808a6f3 87a45718
...@@ -88,44 +88,15 @@ ...@@ -88,44 +88,15 @@
height: 30px; height: 30px;
width: 200px; width: 200px;
} }
.search_ipt ul,.search_ipt li{ .search_ipt, .search_ipt2 {
padding: 0; width: 200px !important;
margin: 0; display: inline-block;
font-style: normal;
list-style: none;
} }
.search_ipt ul { .scope_application {
display: none; display: flex;
position: absolute; }
left: 0; .scope_application .input-group-btn {
top: 26px; top: 33px;
padding: 5px 0;
z-index: 899;
min-width: 200px;
border: 1px solid #eee;
max-height: 300px;
overflow-y: auto;
background-color: #fff;
border-radius: 2px;
box-sizing: border-box;
box-shadow: 1px 1px 4px rgb(0 0 0 / 8%);
}
.search_ipt li {
background-color: #fff;
cursor: pointer;
padding-left: 10px!important;
color: #999;
padding: 0 10px;
line-height: 36px;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.search_ipt li:hover {
background: #F6F6F6;
}
.search_ipt .layui-input {
width: 200px;
} }
#test1 { #test1 {
display: none; display: none;
...@@ -171,9 +142,23 @@ ...@@ -171,9 +142,23 @@
</div> </div>
<div class="scope_application" id="scope_application"> <div class="scope_application" id="scope_application">
<span class="labelName">适用范围:</span> <span class="labelName">适用范围:</span>
<div class="search_ipt" style="position: relative;display: inline;"> <!-- <div class="search_ipt" style="position: relative;display: inline;">
<input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部"> <input type="text" id="searchIpt" autocomplete="off" class="layui-input" placeholder="全部">
<ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul> <ul id="dataList" style="position: absolute;" onclick="selectGoods()"></ul>
</div> -->
<div class="input-group search_ipt" style="margin-right: 12px;">
<input id="searchIpt" data-id="" type="text" class="form-control" placeholder="全部">
<div class="input-group-btn">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div>
<div class="input-group search_ipt2" style="margin-right: 12px;">
<input id="searchIpt2" data-id="" type="text" class="form-control" placeholder="全部商品">
<div class="input-group-btn">
<ul class="dropdown-menu dropdown-menu-right" role="menu">
</ul>
</div>
</div> </div>
<select name="bindType" id="selectTwo"> <select name="bindType" id="selectTwo">
<option value="">所有</option> <option value="">所有</option>
...@@ -267,6 +252,68 @@ ...@@ -267,6 +252,68 @@
let selectThreeName = ''; // 选中演出三级的名称 let selectThreeName = ''; // 选中演出三级的名称
let sendTimeType = ''; let sendTimeType = '';
let playMethod = '1'; // 叠加/限制 let playMethod = '1'; // 叠加/限制
let goodsId = '';
$("#scope_application").hide();
function common (num) {
let url = '';
let idField = '';
let keyField = '';
let effectiveFields = '';
let domData = '';
if (!num) {
url = ctx+'compilations/goodsList?name=';
idField = 'spuId';
keyField = 'name';
effectiveFields = ['name'];
domData = $("#searchIpt2");
} else {
url = ctx+'kylin/base/performance/status?status=(3,6,8,9)&title=';
idField = 'performancesId';
keyField = 'title';
effectiveFields = ['title'];
domData = $("#searchIpt");
}
domData.bsSuggest('init', {
idField, // data.value 的第几个数据,作为input输入框的内容
keyField, // data.value 的第几个数据,作为input输入框的内容
allowNoKeyword: false, //是否允许无关键字时请求数据
showBtn:false,
multiWord: true, //以分隔符号分割的多关键字支持
hideOnSelect: true,
getDataMethod: "url", //获取数据的方式,总是从 URL 获取
effectiveFields,
url,
/*如果从 url 获取数据,并且需要跨域,则该参数必须设置*/
processData: function (json) { // url 获取数据时,对数据的处理,作为 getData 的回调函数
let data = {
value: []
};
if (num) {
searchData = [...json.value];
let obj = {};
searchData.reduce((cur,next) => {
if (!obj[next.performancesId]) {
obj[next.performancesId] = true
data.value.push(next)
}
},[]) //设置cur默认类型为数组,并且初始值为空的数组
return data
} else {
data.value = json.data;
return data;
}
}
}).on('onDataRequestSuccess', function (e, result) {
}).on('onSetSelectValue', function (e, selectedData,selectedRawData ) { // 当前行的所有值都能拿到
if (num) {
selectOne(selectedData.id, selectedData.key)
} else {
goodsId = selectedData.id
}
}).on('onUnsetSelectValue', function (e) {
});;
}
function search() { function search() {
let data = { let data = {
status: '(3,6,8,9)', status: '(3,6,8,9)',
...@@ -337,31 +384,6 @@ ...@@ -337,31 +384,6 @@
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
$('#selectThree').empty(); $('#selectThree').empty();
}; };
$("#searchIpt").blur(function(){
if (typeOne == 2) {
getMallList()
} else {
search()
}
$('#dataList').show()
});
// $("#searchIpt").blur(function(){
// setTimeout(() => {
// $('#dataList').hide()
// }, 500);
// });
function selectGoods(){
$('#dataList').hide()
}
$("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val()
// search()
if (typeOne == 2) {
getMallList()
} else {
search()
}
});
$('#selectTwo').change(function(e){ $('#selectTwo').change(function(e){
selectTwoId = $(this).val(); selectTwoId = $(this).val();
...@@ -382,45 +404,33 @@ ...@@ -382,45 +404,33 @@
$("input[name=typeOne]").change(function(e){ $("input[name=typeOne]").change(function(e){
typeOne = e.target.value; typeOne = e.target.value;
if (typeOne == 1) { if (typeOne == 1) {
$('#scope_application').show();
$(".search_ipt").show();
$(".search_ipt2").hide();
$("#searchIpt").val(''); $("#searchIpt").val('');
$("#searchIpt").attr('placeholder', '全部'); $('#selectTwo').show().val('').empty();
} $('#selectThree').show().val('').empty();
if (typeOne != 0) { common (1)
showId = ''; // 选中演出id } else if (typeOne == 2) {
showId = '';
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#scope_application').show(); $('#scope_application').show();
$(".search_ipt").hide();
$(".search_ipt2").show();
$("#searchIpt2").val('');
$('#selectTwo').hide();
$('#selectThree').hide();
common (0)
} else { } else {
$('#searchIpt').val('');
$('#selectTwo').empty();
$('#selectThree').empty('');
$('#scope_application').hide(); $('#scope_application').hide();
}
if (typeOne == 2 || typeOne == 3) {
showId = ''; showId = '';
$('#selectTwo').val(''); selectTwoId = ''; // 选中演出下级的ID
$('#selectThree').val(''); selectThreeId = ''; // 选中演出三级的ID
$(".search_ipt").hide();
$(".search_ipt2").hide();
$('#selectTwo').hide(); $('#selectTwo').hide();
$('#selectThree').hide(); $('#selectThree').hide();
$('#searchIpt').val('');
$('#selectTwo').empty();
$('#selectThree').empty();
$('#dataList').empty();
if (typeOne == 2) {
$("#searchIpt").val('');
$("#searchIpt").attr('placeholder', '全部商品');
}
} else {
$('#selectTwo').show();
$('#selectThree').show();
$('#selectTwo').empty();
$('#selectThree').empty();
$('#dataList').empty();
}
if (typeOne == 3) {
$('.playMethod').show()
} else {
$('.playMethod').hide()
} }
}); });
$("input[name=typeTwo]").change(function(e){ $("input[name=typeTwo]").change(function(e){
...@@ -522,14 +532,12 @@ ...@@ -522,14 +532,12 @@
// busiName = selectThreeName; // busiName = selectThreeName;
} }
if (typeOne == 2) { if (typeOne == 2) {
if (showId) {
useScope = 80; useScope = 80;
busiId = showId; busiId = goodsId;
} busiName = $("#searchIpt2").val() || '全部商品';
busiName = $("#searchIpt").val() || '全部商品';
} }
if (typeOne == 0) { if (typeOne == 0) {
busiName = $("#searchIpt").val() || '全场适用'; busiName = '全场适用';
} }
if (typeOne == 3) { if (typeOne == 3) {
if (showId) { if (showId) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment