| | |
| | | pageSize: 10, |
| | | total: 800, |
| | | ids: [], |
| | | tableData: [ |
| | | ] |
| | | tableData: [] |
| | | } |
| | | }, |
| | | methods: { |
| | |
| | | (data) => { // 改用箭头函数 |
| | | console.log('原始数据:', data); |
| | | this.loading = false; |
| | | if(data.rows && Array.isArray(data.rows)){ |
| | | if (data.rows && Array.isArray(data.rows)) { |
| | | vm.tableData = data.rows; |
| | | vm.total = data.total; |
| | | }else{ |
| | | } else { |
| | | vm.tableData = []; |
| | | vm.total = 0; |
| | | } |
| | |
| | | ajax.set({ |
| | | current: this.currentPage, |
| | | size: this.pageSize, |
| | | startTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[0] : null, |
| | | endTime: this.query.dateRange !=null && this.query.dateRange.length > 0 ? this.query.dateRange[1] : null, |
| | | startTime: this.query.dateRange != null && this.query.dateRange.length > 0 ? this.query.dateRange[0] : null, |
| | | endTime: this.query.dateRange != null && this.query.dateRange.length > 0 ? this.query.dateRange[1] : null, |
| | | ...this.query |
| | | }); |
| | | ajax.start(); |
| | |
| | | THuiminCard.openAddTHuiminCard(); |
| | | }, |
| | | handleEdit(id) { |
| | | if (this.ids.length === 0){ |
| | | if (this.ids.length === 0) { |
| | | Feng.info('请选择要操作的数据') |
| | | return |
| | | } |
| | | if (this.ids.length > 1){ |
| | | if (this.ids.length > 1) { |
| | | Feng.info('请选择一条数据') |
| | | return |
| | | } |
| | |
| | | handleDelete() { |
| | | // 删除逻辑 |
| | | console.log(this.ids) |
| | | if (this.ids.length === 0){ |
| | | if (this.ids.length === 0) { |
| | | Feng.info('请选择要操作的数据') |
| | | return |
| | | } |
| | | const mv = this |
| | | Feng.confirm("确定要删除该玩湃惠民卡吗?", function () { |
| | | this.ids.forEach(id => { |
| | | |
| | | const ajax = new $ax(Feng.ctxPath + "/tHuiminCard/delete", function (data) { |
| | | Feng.success("操作成功!"); |
| | | mv.handleSearch(); |
| | | }, function (data) { |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("ids",mv.ids.join(",")); |
| | | ajax.start(); |
| | | }) |
| | | Feng.confirm("确定要删除该玩湃惠民卡吗?", () => { |
| | | this.ids.forEach(id => { |
| | | const ajax = new $ax(Feng.ctxPath + "/tHuiminCard/delete", function (data) { |
| | | Feng.success("操作成功!"); |
| | | mv.handleSearch(); |
| | | }, function (data) { |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("ids",mv.ids.join(",")); |
| | | ajax.start(); |
| | | }) |
| | | }); |
| | | }, |
| | | handleShelves(status) { |
| | | // 上架逻辑 |
| | | console.log(this.ids) |
| | | if (this.ids.length === 0){ |
| | | if (this.ids.length === 0) { |
| | | Feng.info('请选择要操作的数据') |
| | | return |
| | | } |
| | |
| | | }, function (data) { |
| | | Feng.error("操作失败!" + data.responseJSON.message + "!"); |
| | | }); |
| | | ajax.set("id",id); |
| | | ajax.set("status",status); |
| | | ajax.set("id", id); |
| | | ajax.set("status", status); |
| | | ajax.start(); |
| | | |
| | | |
| | |
| | | this.ids = selection.map(item => item.id) |
| | | }, |
| | | handleViewDetail(row) { |
| | | if (this.ids.length === 0 && !row){ |
| | | if (this.ids.length === 0 && !row) { |
| | | Feng.info('请选择要操作的数据') |
| | | return |
| | | } |
| | | if (this.ids.length > 1 && !row){ |
| | | if (this.ids.length > 1 && !row) { |
| | | Feng.info('请选择一条数据') |
| | | return |
| | | } |
| | | // 查看详情 |
| | | let id; |
| | | if (row){ |
| | | if (row) { |
| | | id = row.id |
| | | }else { |
| | | } else { |
| | | id = this.ids[0] |
| | | } |
| | | THuiminCard.openTHuiminCardDetail(id,'detail') |
| | | THuiminCard.openTHuiminCardDetail(id, 'detail') |
| | | }, |
| | | addOrder() { |
| | | THuiminCard.addOrder() |
| | |
| | | }); |
| | | var THuiminCardInfo = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | tCarInfoData: {}, |
| | | validateFields: {} |
| | | }; |
| | | THuiminCardInfo.close = function() { |
| | | THuiminCardInfo.close = function () { |
| | | parent.layer.close(window.parent.THuiminCard.layerIndex); |
| | | } |
| | | THuiminCardInfo.checkUser = function (e) { |
| | | console.log("用户手机号") |
| | | console.log(e) |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/checkUser", function(data){ |
| | | if(data==500){ |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/checkUser", function (data) { |
| | | if (data == 500) { |
| | | $("#userList").empty() |
| | | Feng.error("操作失败,当前用户未注册") |
| | | return; |
| | | }else if (data==501){ |
| | | } else if (data == 501) { |
| | | $("#userList").empty() |
| | | Feng.error("操作失败,当前用户未添加人员信息") |
| | | return; |
| | | } |
| | | |
| | | else{ |
| | | var content='<option value="">选择人员</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | } else { |
| | | var content = '<option value="">选择人员</option>'; |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#userList").empty().append(content); |
| | | $("#shopId").empty(); |
| | | $("#cards").empty(); |
| | | } |
| | | }); |
| | | ajax.set("phone",phone); |
| | | ajax.set("phone", phone); |
| | | ajax.start(); |
| | | } |
| | | THuiminCardInfo.getStores = function (e) { |
| | | var operatorId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/getStores", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择门店</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | var operatorId = $(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/getStores", function (data) { |
| | | if (data != null) { |
| | | var content = '<option value="">选择门店</option>'; |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#shopId").empty().append(content); |
| | | $("#cards").empty() |
| | | } |
| | | }); |
| | | ajax.set("operatorId",operatorId); |
| | | ajax.set("operatorId", operatorId); |
| | | ajax.start(); |
| | | } |
| | | THuiminCardInfo.getCards = function (e) { |
| | | var operatorId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/getCards", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择玩湃惠民卡</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | var operatorId = $(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/getCards", function (data) { |
| | | if (data != null) { |
| | | var content = '<option value="">选择玩湃惠民卡</option>'; |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#cards").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("storeId",operatorId); |
| | | ajax.set("storeId", operatorId); |
| | | ajax.start(); |
| | | } |
| | | THuiminCardInfo.addSubmit = function () { |
| | | let cardId = $("#cards").val() |
| | | if(cardId==""){ |
| | | if (cardId == "") { |
| | | Feng.info("请选择惠民卡") |
| | | return; |
| | | } |
| | | let user = $("#user").val() |
| | | if(user==""){ |
| | | if (user == "") { |
| | | Feng.info("请选择绑定人员信息") |
| | | return; |
| | | } |
| | | var operatorId=$(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/addPayHuiMing", function(data){ |
| | | if(data!=null){ |
| | | var content='<option value="">选择玩湃惠民卡</option>'; |
| | | $.each(data, function(k,v) { |
| | | content += "<option value='"+v.id+"'>"+v.name+"</option>"; |
| | | var operatorId = $(e).val(); |
| | | var ajax = new $ax(Feng.ctxPath + "/tHuiminCard/addPayHuiMing", function (data) { |
| | | if (data != null) { |
| | | var content = '<option value="">选择玩湃惠民卡</option>'; |
| | | $.each(data, function (k, v) { |
| | | content += "<option value='" + v.id + "'>" + v.name + "</option>"; |
| | | }); |
| | | $("#cards").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("studentId",user); |
| | | ajax.set("cardId",cardId); |
| | | ajax.set("studentId", user); |
| | | ajax.set("cardId", cardId); |
| | | ajax.start(); |
| | | } |