| | |
| | | id = this.ids[0] |
| | | } |
| | | THuiminCard.openTHuiminCardDetail(id,'detail') |
| | | }, |
| | | addOrder() { |
| | | THuiminCard.addOrder() |
| | | } |
| | | }, |
| | | created() { |
| | | // 初始化逻辑 |
| | | this.handleSearch() |
| | | } |
| | | }); |
| | | }); |
| | | var THuiminCardInfo = { |
| | | goodsPicArray: [], |
| | | tCarInfoData : {}, |
| | | validateFields: { |
| | | } |
| | | }; |
| | | 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){ |
| | | $("#userList").empty() |
| | | Feng.error("操作失败,当前用户未注册") |
| | | return; |
| | | }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>"; |
| | | }); |
| | | $("#userList").empty().append(content); |
| | | $("#shopId").empty(); |
| | | $("#cards").empty(); |
| | | } |
| | | }); |
| | | 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>"; |
| | | }); |
| | | $("#shopId").empty().append(content); |
| | | $("#cards").empty() |
| | | } |
| | | }); |
| | | 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>"; |
| | | }); |
| | | $("#cards").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("storeId",operatorId); |
| | | ajax.start(); |
| | | } |
| | | THuiminCardInfo.addSubmit = function () { |
| | | let cardId = $("#cards").val() |
| | | if(cardId==""){ |
| | | Feng.info("请选择惠民卡") |
| | | return; |
| | | } |
| | | let user = $("#user").val() |
| | | 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>"; |
| | | }); |
| | | $("#cards").empty().append(content); |
| | | } |
| | | }); |
| | | ajax.set("studentId",user); |
| | | ajax.set("cardId",cardId); |
| | | ajax.start(); |
| | | } |