1 |
- (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-214b04fa"],{"0dc0":function(t,e,o){"use strict";o.r(e);var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"account"},[o("div",{staticClass:"header"},[o("div",[o("span",[t._v("当前子账户数 "+t._s(t.currentNum)+"/"+t._s(t.maxNum))])]),t._v(" "),o("img",{staticClass:"add",attrs:{src:t.add,alt:"add"},on:{click:t.addAccount}})]),t._v(" "),o("div",{staticClass:"content-list"},[0==t.paginationConfig.total?o("div",{staticClass:"tips"},[t._v("暂无数据")]):t._e(),t._v(" "),t._l(t.listData,(function(e,n){return o("div",{key:n,class:["list",0==e.userstate?"invalid":""]},[o("div",{staticClass:"desc"},[o("p",[t._v(t._s(e.name))]),t._v(" "),o("span",[t._v("创建时间:"+t._s(t.formatTime(e.createTime)))])]),t._v(" "),o("div",{staticClass:"operation"},[1==e.userstate?o("span",{class:[0==e.userstate?"":"able"],on:{click:function(e){return t.Reset(n)}}},[t._v("重置密码")]):t._e(),t._v(" "),o("span",{class:[0==e.userstate?"":"able"],on:{click:function(e){return t.Ivalid(n)}}},[t._v(t._s(0==e.userstate?"已失效":"失效"))])])])}))],2),t._v(" "),o("div",{staticClass:"pagination"},[o("Pagination",{attrs:{"pagination-config":t.paginationConfig},on:{putPagination:t.getPagination}}),t._v(" "),o("el-button",{attrs:{type:"danger",size:"mini",plain:"",round:""},nativeOn:{click:function(e){return e.preventDefault(),t.addLimit(e)}}},[t._v("增加子账户上限")])],1),t._v(" "),o("Toast",{attrs:{"toast-config":t.toastConfig},on:{putToast:t.getToast}}),t._v(" "),o("Add",{attrs:{"add-config":t.addConfig},on:{putAdd:t.getAdd}}),t._v(" "),o("Limit",{attrs:{"limit-config":t.limitConfig},on:{putLimit:t.getLimit}})],1)},i=[],a=(o("7f7f"),o("333d")),s=o("7e2d"),r=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("transition",{attrs:{name:"marsk-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.addConfig.isShow,expression:"addConfig.isShow"}],staticClass:"marsk"})]),t._v(" "),o("transition",{attrs:{name:"slide-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.addConfig.isShow,expression:"addConfig.isShow"}],staticClass:"action-add"},[o("div",{staticClass:"operation"},[o("i",{staticClass:"el-icon-circle-close",on:{click:t.close}})]),t._v(" "),o("p",{staticClass:"title"},[t._v("新增子账户")]),t._v(" "),o("el-form",{ref:"addForm",staticClass:"add-form",attrs:{model:t.addForm,rules:t.addRules,"label-position":"left"}},[o("el-form-item",{attrs:{prop:"name"}},[o("el-input",{ref:"name",attrs:{type:"text",size:"small",name:"name",placeholder:"请设置用户名"},model:{value:t.addForm.name,callback:function(e){t.$set(t.addForm,"name",e)},expression:"addForm.name"}},[o("span",{staticClass:"solt",attrs:{slot:"prefix"},slot:"prefix"},[t._v("用户名")]),t._v(" "),o("span",{staticClass:"solt",attrs:{slot:"suffix"},slot:"suffix"},[t._v("@"+t._s(t.account))])])],1),t._v(" "),o("el-form-item",{attrs:{prop:"pwd"}},[o("el-input",{ref:"pwd",attrs:{type:t.addForm.pwdType,size:"small",name:"pwd",placeholder:"请输入密码"},model:{value:t.addForm.pwd,callback:function(e){t.$set(t.addForm,"pwd",e)},expression:"addForm.pwd"}},[o("span",{staticClass:"solt",attrs:{slot:"prefix"},slot:"prefix"},[t._v("密码")]),t._v(" "),o("svg-icon",{attrs:{slot:"suffix","icon-class":"password"===t.addForm.pwdType?"eye":"eye-open"},on:{click:t.showPwd},slot:"suffix"})],1)],1),t._v(" "),o("el-form-item",{attrs:{prop:"spwd"}},[o("el-input",{ref:"spwd",attrs:{type:t.addForm.spwdType,size:"small",name:"spwd",placeholder:"请确认密码"},model:{value:t.addForm.spwd,callback:function(e){t.$set(t.addForm,"spwd",e)},expression:"addForm.spwd"}},[o("span",{staticClass:"solt",attrs:{slot:"prefix"},slot:"prefix"},[t._v("确认密码")]),t._v(" "),o("svg-icon",{attrs:{slot:"suffix","icon-class":"password"===t.addForm.spwdType?"eye":"eye-open"},on:{click:t.showSpwd},slot:"suffix"})],1)],1),t._v(" "),o("el-form-item",{attrs:{prop:"userName"}},[o("el-input",{ref:"userName",attrs:{type:"text",size:"small",name:"userName",placeholder:"请输入姓名"},model:{value:t.addForm.userName,callback:function(e){t.$set(t.addForm,"userName",e)},expression:"addForm.userName"}},[o("span",{staticClass:"solt",attrs:{slot:"prefix"},slot:"prefix"},[t._v("姓名")])])],1),t._v(" "),o("el-form-item",{attrs:{prop:"mobile"}},[o("el-input",{ref:"mobile",attrs:{type:"text",size:"small",name:"mobile",placeholder:"请输入手机号码"},model:{value:t.addForm.mobile,callback:function(e){t.$set(t.addForm,"mobile",e)},expression:"addForm.mobile"}},[o("span",{staticClass:"solt",attrs:{slot:"prefix"},slot:"prefix"},[t._v("手机号码")])])],1),t._v(" "),o("el-button",{staticClass:"next-btn",attrs:{type:"danger",size:"small"},nativeOn:{click:function(e){return e.preventDefault(),t.sure(e)}}},[t._v("确认")])],1)],1)])],1)},c=[],l=o("61f7"),d=o("b775"),f={name:"Add",props:{addConfig:{isShow:{type:Boolean,default:function(){return!1}}}},data:function(){var t=this,e=function(t,e,o){e?Object(l["e"])(e)?o():o(new Error("用户名不允许输入‘@’和‘空格’")):o(new Error("请设置用户名"))},o=function(t,e,o){e?Object(l["d"])(e)?o():o(new Error("请输入正确的手机号码’")):o(new Error("请输入手机号码"))},n=function(e,o,n){o?o!==t.addForm.pwd?n(new Error("两次密码不一致")):n():n(new Error("请再次输入密码"))};return{account:this.$store.getters.name,addForm:{name:"",pwd:"",spwd:"",mobile:"",userName:"",pwdType:"password",spwdType:"password"},addRules:{name:[{required:!0,trigger:"blur",validator:e}],mobile:[{required:!0,trigger:"blur",validator:o}],userName:[{required:!0,message:"请输入姓名",trigger:"blur"}],pwd:[{required:!0,message:"请输入密码",trigger:"blur"},{min:6,max:8,message:"密码长度为6到8位",trigger:"blur"}],spwd:[{required:!0,trigger:"blur",validator:n}]}}},methods:{close:function(){this.addForm={name:"",pwd:"",spwd:"",pwdType:"password",spwdType:"password",mobile:"",userName:""},this.$emit("putAdd",!1)},showPwd:function(){var t=this;this.addForm.pwdType="password"===this.addForm.pwdType?"":"password",this.$nextTick((function(){t.$refs.pwd.focus()}))},showSpwd:function(){var t=this;this.addForm.spwdType="password"===this.addForm.spwdType?"":"password",this.$nextTick((function(){t.$refs.spwd.focus()}))},sure:function(){var t=this;this.$refs.addForm.validate((function(e){if(!e)return!1;var o={transCode:"C00017",userName:t.addForm.name,password:Object(d["b"])(t.addForm.pwd),adminName:t.addForm.userName,mobnub:t.addForm.mobile};Object(d["e"])(o).then((function(e){t.addForm={name:"",pwd:"",spwd:"",mobile:"",userName:"",pwdType:"password",spwdType:"password"},t.$message.success("恭喜你,成功新增子账户‘ ".concat(e.loginName," '!")),t.$emit("putAdd",!0)})).catch((function(t){}))}))}}},u=f,p=(o("16e1"),o("fb19"),o("2877")),m=Object(p["a"])(u,r,c,!1,null,"6ce45802",null),g=m.exports,_=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("transition",{attrs:{name:"marsk-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.limitConfig.isShow,expression:"limitConfig.isShow"}],staticClass:"marsk"})]),t._v(" "),o("transition",{attrs:{name:"slide-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.limitConfig.isShow,expression:"limitConfig.isShow"}],staticClass:"action-limit"},[o("div",{staticClass:"title"},[o("p",[t._v("增加子账户上限")]),t._v(" "),o("div",{staticClass:"operation"},[o("i",{staticClass:"el-icon-circle-close",on:{click:t.close}})])]),t._v(" "),o("p",{staticClass:"tips"},[t._v("\n 剩余积分:"),o("span",[t._v(t._s(t.limitConfig.point))])]),t._v(" "),o("div",{staticClass:"num-list"},t._l(t.limitConfig.numList,(function(e,n){return o("div",{key:n},[0==e.saleUnit?o("el-radio",{attrs:{label:e.returnGoods},on:{change:t.select},model:{value:t.limitConfig.num,callback:function(e){t.$set(t.limitConfig,"num",e)},expression:"limitConfig.num"}},[o("p",[t._v(t._s(e.returnGoods)+"个上限")]),t._v(" "),o("span",[t._v(t._s(e.salePrice)+"积分")])]):t._e()],1)})),0),t._v(" "),o("div",{staticClass:"btn-group"},[o("el-button",{staticClass:"next-btn",attrs:{type:"danger",size:"small"},nativeOn:{click:function(e){return e.preventDefault(),t.sure(e)}}},[t._v("确认")])],1)])])],1)},h=[],v=(o("c5f6"),{name:"Limit",props:{limitConfig:{isShow:{type:Boolean,default:function(){return!1}},num:{type:Number,default:function(){return 10}},intergal:{type:Number,default:function(){return 100}},numList:{type:Array,default:function(){return[]}},selectGoodsCode:{type:String,default:function(){return""}},point:{type:String,default:function(){return"0"}}}},data:function(){return{}},methods:{close:function(){this.$emit("putLimit",!1)},select:function(){var t=this;this.limitConfig.numList.map((function(e){t.limitConfig.num==e.returnGoods&&(t.limitConfig.intergal=e.salePrice,t.limitConfig.selectGoodsCode=e.goodsCode)}))},sure:function(){var t=this,e={transCode:"C00018",count:this.limitConfig.num,goodsCode:this.limitConfig.selectGoodsCode};Object(d["e"])(e).then((function(e){t.$message.success("恭喜你,成功新增 ".concat(t.limitConfig.num," 个子账户上限")),t.$emit("putLimit",t.limitConfig)})).catch((function(t){}))}}}),C=v,w=(o("cbb9"),o("76f9"),Object(p["a"])(C,_,h,!1,null,"921bf47e",null)),b=w.exports,x=o("1d89"),y=o.n(x),A=o("ed08"),F={name:"Account",components:{Pagination:a["a"],Toast:s["a"],Add:g,Limit:b},data:function(){return{add:y.a,paginationConfig:{hideSinglePage:!1,page:1,size:15,sizeList:[10,15,30,50],layout:"total, sizes, prev, pager, next, jumper",total:0},toastConfig:{isShow:!1,showCancel:!1,center:!1,message:""},addConfig:{isShow:!1},limitConfig:{isShow:!1,num:"",intergal:"",selectGoodsCode:"",numList:[],point:"0"},currentIndex:"",currentNum:"0",maxNum:"0",point:"0",loading:!1,listData:[]}},created:function(){this.getData(),this.getAccount()},inject:["getCount"],methods:{getAccount:function(){var t=this,e={transCode:"C00001"};Object(d["e"])(e).then((function(e){t.currentNum=e.subAccount,t.maxNum=e.maxSubAccount,t.point=e.point})).catch((function(t){}))},getData:function(){var t=this,e=this.$loading({lock:!0,text:"Loading",spinner:"el-icon-loading",background:"rgba(0, 0, 0, 0.7)"});setTimeout((function(){var o={transCode:"C00002",page:t.paginationConfig.page,count:t.paginationConfig.size};Object(d["e"])(o).then((function(o){e.close(),t.listData=o.rows,t.paginationConfig.total=o.total})).catch((function(t){e.close()}))}),1500)},addAccount:function(){if(this.currentNum===this.maxNum)return this.$message.warning("子账户数已达上限,请先增加子账户上限!");this.addConfig.isShow=!0},addLimit:function(){var t=this,e={transCode:"C00022",type:"2"};Object(d["e"])(e).then((function(e){t.limitConfig={isShow:!0,intergal:e.rows.filter((function(t){return 0==t.saleUnit}))[0].salePrice,num:e.rows.filter((function(t){return 0==t.saleUnit}))[0].returnGoods,numList:e.rows.filter((function(t){return 0==t.saleUnit})),selectGoodsCode:e.rows.filter((function(t){return 0==t.saleUnit}))[0].goodsCode,point:t.point}})).catch((function(t){}))},Reset:function(t){this.currentIndex=t;var e=this.listData[t].name;this.toastConfig={isShow:!0,showCancel:!0,center:!1,message:"重置密码后密码将改为'12345678',您确定要重置子账户:".concat(e," 的密码吗?")}},Ivalid:function(t){this.currentIndex=t;var e=this.listData[t].name;this.toastConfig={isShow:!0,showCancel:!0,center:!1,message:"该操作不可恢复,失效子账户将不占用子账户数,您确定要让子账户:".concat(e," 的失效吗?")}},getOperation:function(t,e,o){var n=this,i={transCode:"C00019",id:t,type:e};Object(d["e"])(i).then((function(t){"1"===e&&(n.getCount(),n.getAccount(),n.getData()),n.$message.success("1"===e?"子账户:".concat(o," 已失效!"):"成功重置子账户:".concat(o," 的密码!")),n.toastConfig={isShow:!0,showCancel:!1,center:"1"===e,message:"1"===e?"子账户:".concat(o," 已失效!"):"成功重置子账户:".concat(o," 的密码!")}})).catch((function(t){}))},getPagination:function(t){this.paginationConfig=t,this.getData()},getToast:function(t){var e=this.currentIndex,o=this.listData[e].name;this.toastConfig.isShow=!1,t&&this.toastConfig.message==="重置密码后密码将改为'12345678',您确定要重置子账户:".concat(o," 的密码吗?")?this.getOperation(this.listData[e].userId,"0",o):t&&this.toastConfig.message==="该操作不可恢复,失效子账户将不占用子账户数,您确定要让子账户:".concat(o," 的失效吗?")&&this.getOperation(this.listData[e].userId,"1",o)},getAdd:function(t){this.addConfig.isShow=!1,t&&(this.getCount(),this.getAccount(),this.getData())},getLimit:function(t){this.limitConfig.isShow=!1,t&&this.getAccount()},formatTime:function(t){return Object(A["e"])(t)}}},S=F,N=(o("8281"),Object(p["a"])(S,n,i,!1,null,"4c0f3666",null));e["default"]=N.exports},"16e1":function(t,e,o){"use strict";o("5606")},"1acf":function(t,e,o){"use strict";o("a1cd")},"1d89":function(t,e){t.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAANCAYAAACgu+4kAAABa0lEQVQ4T42SP0vDUBTFz31NUsEoDgXFCsZRKE/y4qCDuw6CKAg6+RFcujr6LURENwdBRHAXETRpICDooFVwLdWClNbmSooppammb3z3nt/9dwgpz7btSSLaFEKMMfMLgFPXdb9iGf2nLxQK49ls9g2A0ZUXAFiIIR2AlHI4k8msl0ql4zhZKXVJRCu9RZh52fO8q+i/GzCl6/q967oTscBxnAYAvRfQarV2fN8/igGaZVmaaZp5wzBuKpXKdBQol8sNpdQ1ES326WDV87yLNkAptQtg77ebUQAf7QDRRhiGj0KIVwDaIDtIjBCJbNueI6IiEeWZ+S4Mw33f96uJK0gpOwAp5YymaQdENN9TPdZ9Ajir1+vFzhItyxrK5XJLtVrt1jTNdwAjaR5h5sOED5RSs0T0kCaO4sxcTQCi9nVdfx4EAOCpnxOF4zgnALZSIN8Atv+yslBKrQFQRNR9wjaTmWvNZvM8CILgB7pSfbR/vnBTAAAAAElFTkSuQmCC"},"333d":function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",{staticClass:"page-content"},[o("el-pagination",{attrs:{background:"","hide-on-single-page":t.paginationConfig.hideSinglePage,"current-page":t.paginationConfig.page,"page-size":t.paginationConfig.size,"page-sizes":t.paginationConfig.sizeList,layout:t.paginationConfig.layout,"pager-count":5,total:t.paginationConfig.total},on:{"current-change":t.handleCurrentChange,"size-change":t.handleSizeChange}}),t._v(" "),o("el-button",{attrs:{size:"mini",icon:"el-icon-refresh"},nativeOn:{click:function(e){return e.preventDefault(),t.refresh(e)}}},[t._v("刷新")])],1)},i=[],a=(o("c5f6"),{name:"Pagination",props:{paginationConfig:{hideSinglePage:{type:Boolean,default:function(){return!1}},page:{type:Number,default:function(){return 1}},size:{type:Number,default:function(){return 15}},sizeList:{type:Array,default:function(){return[10,15,30,50]}},layout:{type:String,default:function(){return"total, sizes, prev, pager, next, jumper"}},total:{type:Number,default:function(){return 0}}}},data:function(){return{}},created:function(){},methods:{handleCurrentChange:function(t){this.paginationConfig.page=t,this.$emit("putPagination",this.paginationConfig)},handleSizeChange:function(t){this.paginationConfig.size=t,this.$emit("putPagination",this.paginationConfig)},refresh:function(){this.$emit("putPagination",this.paginationConfig)}}}),s=a,r=(o("5f6c"),o("2877")),c=Object(r["a"])(s,n,i,!1,null,null,null);e["a"]=c.exports},"518e":function(t,e,o){t.exports={color_0:"#000",color_1:"#111",color_2:"#222",color_3:"#333",color_4:"#444",color_5:"#555",color_6:"#666",color_7:"#777",color_8:"#888",color_9:"#999",color_a:"#aaa",color_b:"#bbb",color_c:"#ccc",color_d:"#ddd",color_e:"#eee",color_f2:"#f2f2f2",color_f5:"#f5f5f5",color_fa:"#fafafa",color_fc:"#fcfcfc",color_f:"#fff",color_on:"#F66420",pad:"20px"}},5606:function(t,e,o){},"5f6c":function(t,e,o){"use strict";o("ed77")},"76f9":function(t,e,o){"use strict";o("518e")},"7ac1":function(t,e,o){},"7e2d":function(t,e,o){"use strict";var n=function(){var t=this,e=t.$createElement,o=t._self._c||e;return o("div",[o("transition",{attrs:{name:"marsk-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.toastConfig.isShow,expression:"toastConfig.isShow"}],staticClass:"marsk"})]),t._v(" "),o("transition",{attrs:{name:"slide-fade"}},[o("div",{directives:[{name:"show",rawName:"v-show",value:t.toastConfig.isShow,expression:"toastConfig.isShow"}],class:["action-toast",t.toastConfig.center?"center":""]},[o("p",[t._v(t._s(t.toastConfig.message))]),t._v(" "),o("div",{staticClass:"button-group"},[o("el-button",{attrs:{type:"danger",size:"mini",round:""},nativeOn:{click:function(e){return e.preventDefault(),t.sure(e)}}},[t._v("确定")]),t._v(" "),t.toastConfig.showCancel?o("el-button",{attrs:{type:"info",size:"mini",round:""},nativeOn:{click:function(e){return e.preventDefault(),t.cancel(e)}}},[t._v("取消")]):t._e()],1)])])],1)},i=[],a={name:"Toast",props:{toastConfig:{isShow:{type:Boolean,default:function(){return!1}},showCancel:{type:Boolean,default:function(){return!1}},center:{type:Boolean,default:function(){return!1}},message:{type:String,default:function(){return""}}}},methods:{sure:function(){this.$emit("putToast",!0)},cancel:function(){this.$emit("putToast",!1)}}},s=a,r=(o("1acf"),o("bbf7"),o("2877")),c=Object(r["a"])(s,n,i,!1,null,"6632f172",null);e["a"]=c.exports},8281:function(t,e,o){"use strict";o("7ac1")},"950e":function(t,e,o){t.exports={color_0:"#000",color_1:"#111",color_2:"#222",color_3:"#333",color_4:"#444",color_5:"#555",color_6:"#666",color_7:"#777",color_8:"#888",color_9:"#999",color_a:"#aaa",color_b:"#bbb",color_c:"#ccc",color_d:"#ddd",color_e:"#eee",color_f2:"#f2f2f2",color_f5:"#f5f5f5",color_fa:"#fafafa",color_fc:"#fcfcfc",color_f:"#fff",color_on:"#F66420",pad:"20px"}},"95a9":function(t,e,o){},a1cd:function(t,e,o){},ba41:function(t,e,o){t.exports={color_0:"#000",color_1:"#111",color_2:"#222",color_3:"#333",color_4:"#444",color_5:"#555",color_6:"#666",color_7:"#777",color_8:"#888",color_9:"#999",color_a:"#aaa",color_b:"#bbb",color_c:"#ccc",color_d:"#ddd",color_e:"#eee",color_f2:"#f2f2f2",color_f5:"#f5f5f5",color_fa:"#fafafa",color_fc:"#fcfcfc",color_f:"#fff",color_on:"#F66420",pad:"20px"}},bbf7:function(t,e,o){"use strict";o("950e")},cbb9:function(t,e,o){"use strict";o("95a9")},ed77:function(t,e,o){t.exports={color_0:"#000",color_1:"#111",color_2:"#222",color_3:"#333",color_4:"#444",color_5:"#555",color_6:"#666",color_7:"#777",color_8:"#888",color_9:"#999",color_a:"#aaa",color_b:"#bbb",color_c:"#ccc",color_d:"#ddd",color_e:"#eee",color_f2:"#f2f2f2",color_f5:"#f5f5f5",color_fa:"#fafafa",color_fc:"#fcfcfc",color_f:"#fff",color_on:"#F66420",pad:"20px"}},fb19:function(t,e,o){"use strict";o("ba41")}}]);
|