From 1aa309700fb7e12d85f98bed22a45bdac448ec1c Mon Sep 17 00:00:00 2001 From: liujie <liujie> Date: 星期六, 16 九月 2023 11:18:46 +0800 Subject: [PATCH] app 2.0 --- cloud-server-management/src/main/webapp/static/modular/system/tCoupon/TStoreInfo.js | 76 ++++++++++++++++++++++++------------- 1 files changed, 49 insertions(+), 27 deletions(-) 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 806f77f..9757e79 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 @@ -5,7 +5,8 @@ id: "TStoreProvinceTable", //表格id seItem: null, //选中的条目 table: null, - layerIndex: -1 + layerIndex: -1, + storeList: [] }; /** @@ -13,19 +14,12 @@ */ TStoreProvince.initColumn = function () { return [ - {field: 'selectItem', radio: true}, + {field: 'selectItem', checkbox: true}, {title: '选择', field: '', visible: true, align: 'center', valign: 'middle'}, {title: 'id', field: 'id', visible: false, align: 'center', valign: 'middle'}, - {title: '所属账号', field: 'name', visible: true, align: 'center', valign: 'middle'}, - {title: '所在省市', field: 'useScope', visible: true, align: 'center', valign: 'middle', - formatter: function (value, row, index) { - return {1: "全国", 2: "指定城市", 3: "指定门店"}[value] - } - }, - {title: '门店名称', field: 'type', visible: true, align: 'center', valign: 'middle', - formatter: function (value, row, index) { - return {1: "满减券", 2: "代金券", 3: "体验券"}[value] - }}, + {title: '所属账号', field: 'accountName', visible: true, align: 'center', valign: 'middle'}, + {title: '所在省市', field: 'provinceCity', visible: true, align: 'center', valign: 'middle'}, + {title: '门店名称', field: 'name', visible: true, align: 'center', valign: 'middle'}, ]; }; @@ -44,11 +38,30 @@ }; -function storeOfClosePage(){ - parent.layer.close(window.parent.couponInfoDlg.layerIndex); +TStoreProvince.storeOfClosePage = function (){ + parent.layer.close(parent.layer.getFrameIndex(window.frameElement.id)); } -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, + provinceCity: typeof selected[i].provinceCity != "undefined" ? selected[i].provinceCity : "", + accountName: typeof selected[i].accountName != "undefined" ? selected[i].accountName : "", + name: typeof selected[i].name != "undefined" ? selected[i].name : "" + }) + } + } + window.parent.couponInfoDlg.selecUserOpt(arr); + TStoreProvince.storeOfClosePage(); } @@ -59,12 +72,17 @@ */ TStoreProvince.search = function () { var queryData = {}; - queryData['name'] = $("#name").val(); - queryData['type'] = $("#type").val(); - queryData['distributionMethod'] = $("#distributionMethod").val(); - queryData['userPopulation'] = $("#userPopulation").val(); - queryData['status'] = $("#status").val(); - queryData['state'] = $("#state").val(); + + var provinceElement = document.getElementById("province"); + var provinceId = provinceElement.value; + + var cityElement = document.getElementById("city"); + var cityElementId = cityElement.value; + + queryData['provinceId'] = provinceId; + queryData['cityId'] = cityElementId; + queryData['cityManagerId'] = $("#userPopulation").val(); + queryData['storeName'] = $("#storeName").val(); TStoreProvince.table.refresh({query: queryData}); }; @@ -73,12 +91,16 @@ * 重置搜索 */ TStoreProvince.resetSearch = function () { - $("#name").val(''); - $("#type").val(''); - $("#distributionMethod").val(''); + var provinceSelect = document.getElementById("province"); + provinceSelect.innerHTML = '<option value="">全部</option>'; + + var citySelect = document.getElementById("city"); + citySelect.innerHTML = '<option value="">全部</option>'; + + queryProvince(); + $("#userPopulation").val(''); - $("#status").val(''); - $("#state").val(''); + $("#storeName").val(''); TStoreProvince.search(); }; @@ -127,7 +149,7 @@ $(function () { var defaultColunms = TStoreProvince.initColumn(); - var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeList", defaultColunms); + var table = new BSTable(TStoreProvince.id, "/tCouponManage/storeDetailsOfSearch", defaultColunms); table.setPaginationType("client"); TStoreProvince.table = table.init(); -- Gitblit v1.7.1