(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ef9e9492"],{"32ce":function(e,t){e.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADoAAAA6CAYAAADhu0ooAAAABHNCSVQICAgIfAhkiAAAApZJREFUaEPtWGtLQkEQneAKCgX5QfBGBgUZFBYZFT2IiH52REQPClJKMijQyMjAwEBJQaE6gRGRua9pu7UDFz84c2fOnN3Zs7evXn96pn9gfQ7oH2PZMfrHCCXHqGM0oB1wSzegxHUt2zHqGA1oB9zSDShx9odRuXxHDw8VqtVq5HkhikTCFI8PUSwW+5Gesi/dRqNBudwZ1eu1LwENDkYplZqmUCjECpgVaKvVomw20xVkB1l//wDNzqZZwbICzWZPqFqtCjE1PJygZHJCyFfFiQ3o42OVMpkTqZqWllZe925EKkbUmQ1oLndKlUpFtI43v3jcp8nJKakYUWc2oNvbW6I1vPuFw2FaXl6VjhMJYAGqsmw7xW5sbIrULe3z64Cm03OEI8e0/TqgCwuLhOPGtLEAhUg4PNyXrtXzPFpbW5eOEwlgAYrEx8dHPYXC5wIDOXWhbS8u8iLNfvfh2p9IwMYoXn5wsEfNZlMIbDQafZWBc0K+Kk6sQCEYIBx6Gfbm/PwimypiZxQJRPTu+HiSEomRXv3Q+p+VUVTWawJzqqGPnWEHimTfyUFcvFOpGS22RILZgZZKN3R1ddm1FjCKIcR1a+kkZgGKC/ftbYlwxIhOXd8fIt/3WeSf8WGE/Xh9XXwDqGpgGIMJ4sHk5xUjjOK2UigUCL8mDfsXoE2IfC2gWKL48GUa4OdmmfiApgW0WCwQnp+w0dExwqNqWkBlJJ5qgZ04XN1whVM1LaC7uzvUbrdVc0vF6QoLLaD5/Dnd35elClZ11r3CaQHFMIIYwDASPS9lgYJJDCPoYZ3jRguobNE2/R1Qm93nyO0Y5eiqzXc6Rm12nyO3Y5Sjqzbf6Ri12X2O3I5Rjq7afKdj1Gb3OXK/APEToFy42/JCAAAAAElFTkSuQmCC"},3693:function(e,t,a){"use strict";a.r(t);a("e9f5"),a("ab43");var i=function(){var e=this,t=e._self._c;return t("div",{staticClass:"vip"},[t("div",{staticClass:"vip-toptitle"},[e._m(0),t("div",{staticClass:"add-vip"},[t("div",{staticClass:"block"},[t("el-date-picker",{attrs:{type:"daterange","start-placeholder":"开始日期","end-placeholder":"结束日期","default-time":["00:00:00","23:59:59"],"value-format":"yyyy-MM-dd"},model:{value:e.vipinput.value1,callback:function(t){e.$set(e.vipinput,"value1",t)},expression:"vipinput.value1"}},[e._v(" > ")])],1),t("div",{staticClass:"add-vip-text",on:{click:e.openpop}},[e._v("新增会员")])])]),t("div",{staticClass:"vip-search"},[t("div",{staticClass:"search-box"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.vipinput.username,expression:"vipinput.username"}],attrs:{type:"text",placeholder:"请输入用户名称"},domProps:{value:e.vipinput.username},on:{input:function(t){t.target.composing||e.$set(e.vipinput,"username",t.target.value)}}})]),t("div",{staticClass:"search-box"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.vipinput.phone,expression:"vipinput.phone"}],attrs:{type:"text",placeholder:"请输入电话"},domProps:{value:e.vipinput.phone},on:{input:function(t){t.target.composing||e.$set(e.vipinput,"phone",t.target.value)}}})]),t("div",{staticClass:"search-box"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.vipinput.user_remark,expression:"vipinput.user_remark"}],attrs:{type:"text",placeholder:"请输入用户备注"},domProps:{value:e.vipinput.user_remark},on:{input:function(t){t.target.composing||e.$set(e.vipinput,"user_remark",t.target.value)}}})]),t("div",{staticClass:"ser-icon",on:{click:e.searchuser}},[t("i",{staticClass:"iconfont icon-sousuo"})])]),t("div",{staticClass:"vip-lists"},[t("el-table",{directives:[{name:"loadmore",rawName:"v-loadmore",value:e.tableLoadmore,expression:"tableLoadmore"}],staticStyle:{width:"100%","min-width":"1300px"},attrs:{data:e.tableData,height:"100%",fit:!0},on:{"sort-change":e.handleSortChange}},[t("el-table-column",{attrs:{prop:"img",label:"用户信息",width:"300"},scopedSlots:e._u([{key:"default",fn:function(i){return[i.row.avatar_url?t("img",{attrs:{src:i.row.avatar_url}}):t("img",{attrs:{src:a("32ce"),alt:""}}),t("div",{staticClass:"username"},[t("p",[e._v(e._s(i.row.nickname))]),t("span",[e._v(e._s(i.row.l_name))])])]}}])}),t("el-table-column",{attrs:{prop:"sss",label:"用户标签"},scopedSlots:e._u([{key:"default",fn:function(a,i){return[t("span",{staticClass:"orderNum1"},[e._v(" "+e._s(a.row.user_label_name?a.row.user_label_name:"暂无标签")+" ")])]}}])}),t("el-table-column",{attrs:{prop:"binding",label:"手机号"}}),t("el-table-column",{attrs:{prop:"orderCount",sortable:"custom",label:"成交订单"},scopedSlots:e._u([{key:"default",fn:function(a,i){return[t("span",{staticClass:"orderNum",on:{click:function(t){return e.goOrderList(a)}}},[e._v(" "+e._s(a.row.orderCount)+" ")])]}}])}),t("el-table-column",{attrs:{prop:"priceTotal",sortable:"custom",label:"成交金额"}}),t("el-table-column",{attrs:{prop:"integral",label:"积分"}}),t("el-table-column",{attrs:{prop:"money",label:"余额"}}),t("el-table-column",{attrs:{prop:"create_at_text",label:"注册时间",width:"250"}}),t("el-table-column",{attrs:{prop:"user_remark",label:"用户备注",width:"150"}}),t("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(a){return[t("el-button",{attrs:{type:"text"},on:{click:function(t){return e.openLevelPop(a)}}},[e._v("编辑")])]}}])})],1)],1),e.showaddvip?t("div",{staticClass:"vip-addpop"},[t("div",{staticClass:"pop-info"},[t("div",{staticClass:"info-title"},[t("h5",[e._v(e._s(e.popinput.id?"编辑会员":"新增会员"))]),t("i",{staticClass:"iconfont icon-cuohao",on:{click:e.closepop}})]),t("div",{staticClass:"info-input"},[t("div",{staticClass:"vip-user"},[t("h5",[e._v("会员昵称")]),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.popinput.username,expression:"popinput.username"}],attrs:{type:"text",placeholder:"输入会员昵称"},domProps:{value:e.popinput.username},on:{input:function(t){t.target.composing||e.$set(e.popinput,"username",t.target.value)}}})])]),t("div",{staticClass:"vip-phone"},[t("h5",[e._v("会员手机号")]),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.popinput.phone,expression:"popinput.phone"}],attrs:{type:"text",placeholder:"输入手机号",maxlength:"11"},domProps:{value:e.popinput.phone},on:{input:function(t){t.target.composing||e.$set(e.popinput,"phone",t.target.value)}}})])])]),t("div",{staticClass:"info-input"},[t("div",{staticClass:"vip-user"},[t("h5",[e._v("会员备注")]),t("div",[t("input",{directives:[{name:"model",rawName:"v-model",value:e.popinput.user_remark,expression:"popinput.user_remark"}],attrs:{type:"text",placeholder:"输入会员备注"},domProps:{value:e.popinput.user_remark},on:{input:function(t){t.target.composing||e.$set(e.popinput,"user_remark",t.target.value)}}})])]),t("div",{staticClass:"vip-phone"},[t("h5",[e._v("会员等级")]),t("div",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.popinput.level,expression:"popinput.level"}],staticClass:"selectVip",attrs:{placeholder:"请选择"},on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.popinput,"level",t.target.multiple?a:a[0])}}},e._l(e.levelList,(function(a){return t("option",{key:a.level,domProps:{value:a.level}},[e._v(" "+e._s(a.name)+" ")])})),0)])])]),t("div",{staticClass:"info-input"},[t("div",{staticClass:"vip-phone"},[t("h5",[e._v("标签")]),t("div",[t("select",{directives:[{name:"model",rawName:"v-model",value:e.popinput.user_label_id,expression:"popinput.user_label_id"}],staticClass:"selectVip",attrs:{placeholder:"请选择"},on:{change:function(t){var a=Array.prototype.filter.call(t.target.options,(function(e){return e.selected})).map((function(e){var t="_value"in e?e._value:e.value;return t}));e.$set(e.popinput,"user_label_id",t.target.multiple?a:a[0])}}},e._l(e.levelList1,(function(a){return t("option",{key:a.id,domProps:{value:a.id}},[e._v(" "+e._s(a.label_name)+" ")])})),0)])])]),t("div",{staticClass:"info-btn"},[t("p",{on:{click:e.sureaddvip}},[e._v("确认")])])])]):e._e()])},s=[function(){var e=this,t=e._self._c;return t("div",{staticClass:"title-text"},[t("p",[e._v("用户列表")])])}],l=(a("14d9"),a("28de"));const n=e=>Object(l["a"])({url:"/cashier/cashier-index/user-add",method:"post",data:e}),o=e=>Object(l["a"])({url:"/user/list",method:"get",data:e}),p=e=>Object(l["a"])({url:"/user-label/get-user-label",method:"get",data:e});var r={name:"Vip",data(){return{sortParams:{order:"",prop:""},levelList:[],levelList1:[],tableData:[],showaddvip:!1,popinput:{username:"",phone:"",user_remark:"",level:-1,user_label_id:""},vipinput:{value1:"",username:"",phone:"",user_remark:""},res:{},pickerOptions:{shortcuts:[{text:"最近一周",onClick(e){const t=new Date,a=new Date;a.setTime(a.getTime()-6048e5),e.$emit("pick",[a,t])}},{text:"最近一个月",onClick(e){const t=new Date,a=new Date;a.setTime(a.getTime()-2592e6),e.$emit("pick",[a,t])}},{text:"最近三个月",onClick(e){const t=new Date,a=new Date;a.setTime(a.getTime()-7776e6),e.$emit("pick",[a,t])}}]},page:1,loadmore:"loadmore"}},watch:{"vipinput.value1":{handler(e,t){this.getviplist(!0)},deep:!0,immediate:!0}},mounted(){},methods:{handleSortChange({column:e,prop:t,order:a}){this.tableData.sort((e,i)=>{const s=e[t],l=i[t];return"ascending"===a?s-l:l-s})},tableLoadmore(){this.page++,this.getviplist()},searchuser(){this.getviplist(!0)},openpop(){this.showaddvip=!0,this.popinput={username:"",phone:"",user_remark:"",level:"",user_label_id:""}},closepop(){this.showaddvip=!1},sureaddvip(){let e=/^[1][2,3,4,5,6,7,8,9][0-9]{9}$/;""==this.popinput.username?this.$message.warning("请输入昵称"):""==this.popinput.phone?this.$message.warning("请输入手机号"):e.test(this.popinput.phone)?this.vipadd():(this.popinput.phone="",this.$message.warning("手机号格式不正确"))},vipadd(){let{popinput:e}=this,t={mobile:e.phone,nickname:e.username,user_remark:e.user_remark,level:e.level,user_label_id:e.user_label_id};e.id&&(t.id=e.id),n(t).then(t=>{if(!t.code)return this.getviplist(!0),this.showaddvip=!1,this.popinput={username:"",phone:"",user_remark:"",level:-1,user_label_id:""},this.$message.success("添加成功"),void delete e.id;this.$message.error(t.msg)})},getviplist(e){if(e){let{loadmore:e,page:t,tableData:a}=this.$options.data();this.loadmore=e,this.page=t,this.tableData=a}if(!this.loadmore)return this.$message.warning("已经到底了。。。");null==this.vipinput.value1&&(this.vipinput.value1="");var t="",a="";this.vipinput.value1.length?(t=this.vipinput.value1[0],a=this.vipinput.value1[1]):(t="",a="");var i={pageNo:this.page,pageSize:10,name:this.vipinput.username,phone:this.vipinput.phone,user_remark:this.vipinput.user_remark,dateStart:t,dateEnd:a};o(i).then(e=>{this.tableData.push(...e.data.data),this.loadmore=this.tableData.length{this.levelList1=e.data})},openLevelPop({row:e}){let{id:t,nickname:a,binding:i,user_remark:s,level:l,user_label_id:n}=e;this.showaddvip=!0,this.popinput={id:t,username:a,phone:i,user_remark:s,level:parseInt(l),user_label_id:parseInt(n)}},goOrderList(e){window.open("/#/profit/orderList?user_id="+e.row.id,"_blank")}},created(){},directives:{loadmore:{bind(e,t){const a=e.querySelector(".el-table__body-wrapper");a.addEventListener("scroll",(function(){const e=this.scrollHeight-this.scrollTop-this.clientHeight;e<=.5&&t.value()}))}}}},u=r,d=(a("cc7b"),a("2877")),v=Object(d["a"])(u,i,s,!1,null,null,null);t["default"]=v.exports},"60d0":function(e,t,a){},cc7b:function(e,t,a){"use strict";a("60d0")}}]);