From a65fcac55e7a57bb9d7f4ec864008cb3a0e0e78c Mon Sep 17 00:00:00 2001 From: lisy <linlangsur163@163.com> Date: 星期一, 07 八月 2023 22:18:29 +0800 Subject: [PATCH] 管理后台的门店列表 --- cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html | 3 + cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TStoreList.html | 23 ++++++----- cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js | 32 ++++++++++++++++ cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js | 25 ++++++++++-- 4 files changed, 67 insertions(+), 16 deletions(-) diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html index 6c0b44d..5cd9c43 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TCouponAdd.html @@ -330,7 +330,7 @@ <td>操作</td> </tr> </thead> - <tbody id></tbody> + <tbody id="coun"></tbody> </table> </div> </div> @@ -358,6 +358,7 @@ <script src="${ctxPath}/js/elementui/index.js"></script> <link rel="stylesheet" href="${ctxPath}/js/elementui/index.css"> <script src="${ctxPath}/modular/system/tCoupon/TCouponInfo.js"></script> +<script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script> <script type="text/javascript"> laydate.render({ elem: '#periodOfValidity', diff --git a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TStoreList.html b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TStoreList.html index f437316..a7f46c1 100644 --- a/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TStoreList.html +++ b/cloud-server-management/src/main/webapp/WEB-INF/view/system/tCoupon/TStoreList.html @@ -10,15 +10,15 @@ <div class="col-sm-12"> <div class="row"> <div class="col-sm-3"> - <#SelectCon id="province" name="所在省" > - <option value="">全部</option> - </#SelectCon> - </div> - <div class="col-sm-3"> - <#SelectCon id="city" name="所在市" > - <option value="">全部</option> - </#SelectCon> - </div> + <select class="form-control" id="province"> + <option value="">全部</option> + </select> + </div> + <div class="col-sm-3"> + <select class="form-control" id="city"> + <option value="">全部</option> + </select> + </div> <div class="col-sm-3"> <#SelectCon id="userPopulation" name="所属账号" > <option value="">全部</option> @@ -36,12 +36,12 @@ </div> <#table id="TStoreProvinceTable"/> <div style="margin-left: 30%"> - <button type="button" class="btn btn-info button-margin" onclick="storeOfClosePage()" + <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.storeOfClosePage()" id="closePage" style="width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> <i class="fa fa-check"></i> 关闭 </button> - <button type="button" class="btn btn-info button-margin" onclick="saveSelectStores()" + <button type="button" class="btn btn-info button-margin" onclick="TStoreProvince.saveSelectStores()" id="submit" style="margin-left: 5%;width: 30%;height: 40px;background: #0d8ddb;color: white;border: none;"> <i class="fa fa-check"></i> 保存 </button> @@ -54,4 +54,5 @@ </div> </div> <script src="${ctxPath}/modular/system/tCoupon/TStoreInfo.js"></script> +<script src="${ctxPath}/modular/system/tCoupon/TCouponInfo.js"></script> @} diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js index 02d3589..8ca29c6 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TCouponInfo.js @@ -233,6 +233,38 @@ } +couponInfoDlg.selecUserOpt = function (arrays){ + //获取所有的值 + var subArr= this.storeIds; + $(".timeClass").each(function () { + subArr.push({ + id:$(this).find("input[name*='id']").val(), + }) + }); + console.log(subArr); + var str = ''; + for(var i in arrays){ + var b = true; + for(var j in subArr){ + if(arr[i].id == subArr[j]){ + b = false; + break + } + } + if(b){ + str += '<tr class="timeClass">' + + '<td><input type="hidden" id="id" name="id" value="'+arrays[i].id+'"><input type="hidden" id="provinceCity" name="provinceCity" value="'+arrays[i].provinceCity+'">' + arrays[i].provinceCity + '</td>' + + '<td><input type="hidden" id="accountName" name="accountName" value="'+arrays[i].accountName+'">' + arrays[i].accountName + '</td>' + + '<td><input type="hidden" id="name" name="name" value="'+arrays[i].name+'">' + arrays[i].name + '</td><td><button onclick="deleteSub(this)">移除</button></td></tr>'; + } + } + $("#coun").append(str); +} + +function deleteSub(e) { + $(e).parent().parent().remove(); +} + couponInfoDlg.delete = function (o) { $(o).parent("div").remove() diff --git a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js index 6ecfd31..3699aca 100644 --- a/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js +++ b/cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js @@ -38,13 +38,30 @@ }; -function storeOfClosePage(){ +TStoreProvince.storeOfClosePage = function (){ parent.layer.close(window.parent.couponInfoDlg.layerIndex); } -function saveSelectStores(){ - - +TStoreProvince.saveSelectStores = function (){ + var selected = $('#' + this.id).bootstrapTable('getSelections'); + if (selected.length == 0) { + Feng.info("请先选中表格中的某一记录!"); + return false; + } + var arr = []; + console.log('selected--->',selected) + for(var i in selected){ + if(typeof selected[i].id != "undefined"){ + arr.push({ + id: selected[i].id, + companyName: typeof selected[i].companyName != "undefined" ? selected[i].companyName : "", + nickName: typeof selected[i].nickName != "undefined" ? selected[i].nickName : "", + phone: typeof selected[i].phone != "undefined" ? selected[i].phone : "" + }) + } + } + window.parent.couponInfoDlg.selecUserOpt(arr); + TStoreProvince.storeOfClosePage(); } -- Gitblit v1.7.1