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

Commit 71359808 authored by dongchun's avatar dongchun

修改创建券时的bug

parent 90e7e870
...@@ -171,10 +171,10 @@ ...@@ -171,10 +171,10 @@
<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;"></ul> <ul id="dataList" style="position: absolute;"></ul>
</div> </div>
<select name="bindType" id="selectTwo"> <select name="bindType" id="selectTwo" placeholder="请选择场次">
<option value="">所有</option> <option value="">所有111</option>
</select> </select>
<select name="bindType" id="selectThree"> <select name="bindType" id="selectThree" placeholder="请选择票种">
<option value="">所有</option> <option value="">所有</option>
</select> </select>
</div> </div>
...@@ -271,10 +271,15 @@ ...@@ -271,10 +271,15 @@
let str = ''; let str = '';
promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{ promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{
if (res.value.length>0) { if (res.value.length>0) {
let filterData = [];
searchData = res.value; searchData = res.value;
searchData.forEach((item,index)=>{ let obj = {};
str+= `<li class="selectData" onclick="selectOne('${item.performancesId}','${item.title}')">${item.title}</li>` searchData.reduce((cur,next) => {
}) if (!obj[next.performancesId]) {
obj[next.performancesId] = true
str+= `<li class="selectData" onclick="selectOne('${next.performancesId}','${next.title}')">${next.title}</li>`
}
},[]) //设置cur默认类型为数组,并且初始值为空的数组
$('#dataList').html(str); $('#dataList').html(str);
} else { } else {
$('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'); $('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>');
...@@ -313,11 +318,19 @@ ...@@ -313,11 +318,19 @@
return return
} }
let str = `<option value="0" label="">所有</option>`; let str = `<option value="0" label="">所有</option>`;
let obj = {};
let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.performancesId == id) { if (item.performancesId == id) {
str+= `<option value='${item.timeId}' label=${item.timeTitle}>${item.timeTitle}</option>` filterData.push(item)
} }
}) })
filterData.reduce((cur, next) => {
if (!obj[next.timeId]) {
obj[next.timeId] = true
str+= `<option value='${next.timeId}' label=${next.timeTitle}>${next.timeTitle}</option>`
}
}, [])
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
......
...@@ -275,9 +275,13 @@ ...@@ -275,9 +275,13 @@
promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{ promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{
if (res.value.length>0) { if (res.value.length>0) {
searchData = res.value; searchData = res.value;
searchData.forEach((item,index)=>{ let obj = {};
str+= `<li class="selectData" onclick="selectOne('${item.performancesId}','${item.title}')">${item.title}</li>` searchData.reduce((cur,next) => {
}) if (!obj[next.performancesId]) {
obj[next.performancesId] = true
str+= `<li class="selectData" onclick="selectOne('${next.performancesId}','${next.title}')">${next.title}</li>`
}
},[]) //设置cur默认类型为数组,并且初始值为空的数组
$('#dataList').html(str); $('#dataList').html(str);
} else { } else {
$('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'); $('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>');
...@@ -315,11 +319,19 @@ ...@@ -315,11 +319,19 @@
return return
} }
let str = `<option value="0" label="">所有</option>`; let str = `<option value="0" label="">所有</option>`;
let obj = {};
let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.performancesId == id) { if (item.performancesId == id) {
str+= `<option value='${item.timeId}' label=${item.timeTitle}>${item.timeTitle}</option>` filterData.push(item)
} }
}) })
filterData.reduce((cur, next) => {
if (!obj[next.timeId]) {
obj[next.timeId] = true
str+= `<option value='${next.timeId}' label=${next.timeTitle}>${next.timeTitle}</option>`
}
}, [])
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
......
...@@ -162,10 +162,10 @@ ...@@ -162,10 +162,10 @@
<select name="bindType" id="selectThree"> <select name="bindType" id="selectThree">
<option value="">所有</option> <option value="">所有</option>
</select> </select>
<span style="margin-left: 12px;color: #ccc;" id="showNum"> <!-- <span style="margin-left: 12px;color: #ccc;" id="showNum">
演出库存:<span id="totalGeneral"></span> 演出库存:<span id="totalGeneral"></span>
兑换库存:<span id="totalExchange"></span> 兑换库存:<span id="totalExchange"></span>
</span> </span> -->
</div> </div>
<div class="changeData"> <div class="changeData">
<div id="modalOne"> <div id="modalOne">
...@@ -219,9 +219,13 @@ ...@@ -219,9 +219,13 @@
promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{ promiseMethods(ctx+'kylin/base/performance/status','get',data,'application/x-www-form-urlencoded').then(res=>{
if (res.value.length>0) { if (res.value.length>0) {
searchData = res.value; searchData = res.value;
searchData.forEach((item,index)=>{ let obj = {};
str+= `<li class="selectData" onclick="selectOne('${item.performancesId}','${item.title}')">${item.title}</li>` searchData.reduce((cur,next) => {
}) if (!obj[next.performancesId]) {
obj[next.performancesId] = true
str+= `<li class="selectData" onclick="selectOne('${next.performancesId}','${next.title}')">${next.title}</li>`
}
},[]) //设置cur默认类型为数组,并且初始值为空的数组
$('#dataList').html(str); $('#dataList').html(str);
} else { } else {
$('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>'); $('#dataList').html('<li style="width:100%;text-align:center;color:#ccc;">--- 暂无数据 ---</li>');
...@@ -232,14 +236,19 @@ ...@@ -232,14 +236,19 @@
$("#searchIpt").val(name); $("#searchIpt").val(name);
showId = id; showId = id;
let str = `<option value="0" label="">所有</option>`; let str = `<option value="0" label="">所有</option>`;
let obj = {};
let filterData = [];
searchData.forEach(item=>{ searchData.forEach(item=>{
if (item.performancesId == id) { if (item.performancesId == id) {
$('#showNum').show(); filterData.push(item)
$('#totalExchange').text(item.totalExchange);
$('#totalGeneral').text(item.totalGeneral);
str+= `<option value='${item.timeId}' label=${item.timeTitle}>${item.timeTitle}</option>`;
} }
}) })
filterData.reduce((cur, next) => {
if (!obj[next.timeId]) {
obj[next.timeId] = true
str+= `<option value='${next.timeId}' label=${next.timeTitle}>${next.timeTitle}</option>`
}
}, [])
selectTwoId = ''; // 选中演出下级的ID selectTwoId = ''; // 选中演出下级的ID
selectThreeId = ''; // 选中演出三级的ID selectThreeId = ''; // 选中演出三级的ID
$('#selectTwo').empty().append(str); $('#selectTwo').empty().append(str);
...@@ -325,6 +334,14 @@ ...@@ -325,6 +334,14 @@
} }
promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{ promiseMethods('/candy/coupon/mgt/add','post',JSON.stringify(data),'application/json').then(res=>{
layer.msg('创建成功!'); layer.msg('创建成功!');
let data = {
pageSize: 10,
pageNum: 1,
orderByColumn: 'createdAt',
isAsc: 'desc',
couType: 3
}
$.operate.save(prefix + "/list", data);
closeItem(); closeItem();
}) })
} }
......
...@@ -236,7 +236,7 @@ ...@@ -236,7 +236,7 @@
let sendTimeType = ''; let sendTimeType = '';
function getMallList() { function getMallList() {
let data = { let data = {
title: '' title: $('#searchIpt').val()
} }
let str = ''; let str = '';
promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{ promiseMethods(phpMallUrl + '/admin/goodListForQuick','get',data,'application/x-www-form-urlencoded').then(res=>{
...@@ -285,7 +285,7 @@ ...@@ -285,7 +285,7 @@
}); });
$("#searchIpt").keyup(function(){ $("#searchIpt").keyup(function(){
searchVal = $("#searchIpt").val() searchVal = $("#searchIpt").val()
search() getMallList()
}); });
$("input[name=sendType]").change(function(e){ $("input[name=sendType]").change(function(e){
sendType = e.target.value; sendType = e.target.value;
......
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