chunk-ab1f41b4.f486f845.js 14 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-ab1f41b4"],{"09f4":function(e,t,r){"use strict";r.d(t,"a",(function(){return o})),Math.easeInOutQuad=function(e,t,r,a){return e/=a/2,e<1?r/2*e*e+t:(e--,-r/2*(e*(e-2)-1)+t)};var a=function(){return window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||function(e){window.setTimeout(e,1e3/60)}}();function n(e){document.documentElement.scrollTop=e,document.body.parentNode.scrollTop=e,document.body.scrollTop=e}function s(){return document.documentElement.scrollTop||document.body.parentNode.scrollTop||document.body.scrollTop}function o(e,t,r){var o=s(),i=e-o,c=20,l=0;t="undefined"===typeof t?500:t;var u=function e(){l+=c;var s=Math.easeInOutQuad(l,o,i,t);n(s),l<t?a(e):r&&"function"===typeof r&&r()};u()}},"8f5e":function(e,t,r){"use strict";r.r(t);var a=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("div",{staticClass:"m-container"},[e._m(0),e._v(" "),r("div",{staticClass:"m-core"},[r("save-form",{ref:"saveForm",attrs:{inline:!0,model:e.searchForm},on:{submit:e.search,reset:e.onReSet}},[r("el-form-item",{attrs:{prop:"search"}},[r("el-input",{attrs:{clearable:"",placeholder:"姓名/手机号"},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:function(t){t.target.blur(),e.$refs.saveForm.save(),e.search()}(t)}},model:{value:e.searchForm.search,callback:function(t){e.$set(e.searchForm,"search","string"===typeof t?t.trim():t)},expression:"searchForm.search"}})],1),e._v(" "),r("el-form-item",{attrs:{prop:"state"}},[r("el-select",{attrs:{placeholder:"状态",clearable:""},model:{value:e.searchForm.state,callback:function(t){e.$set(e.searchForm,"state",t)},expression:"searchForm.state"}},[r("el-option",{attrs:{label:"正常",value:"0"}}),e._v(" "),r("el-option",{attrs:{label:"冻结",value:"1"}})],1)],1),e._v(" "),r("el-form-item",[r("el-button",{attrs:{"native-type":"submit",type:"primary"}},[e._v("搜索")]),e._v(" "),r("el-button",{attrs:{"native-type":"reset",type:"danger"}},[e._v("重置")])],1)],1),e._v(" "),r("div",{staticClass:"btnList"},[r("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.addAgent}},[e._v("\n 新建代理商\n ")]),e._v(" "),r("el-button",{staticStyle:{"margin-bottom":"20px"},attrs:{type:"primary"},on:{click:e.lookH5}},[e._v("\n 代理商H5\n ")])],1),e._v(" "),r("div",{staticClass:"tableWrap"},[r("el-table",{ref:"table1",staticStyle:{width:"100%"},attrs:{"header-cell-style":{background:"#EDEEF0",color:"#444"},data:e.tableList,"row-key":"userId",type:"expand",lazy:"",load:e.getStaffList,"tree-props":{children:"children",hasChildren:"hasChildren"}},on:{"expand-change":e.hasExpandChange}},[r("el-table-column",{attrs:{align:"center",prop:"userId",label:"代理商编号"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"proxyName",label:"代理商名称"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"name",label:"姓名"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"phone",label:"手机号"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"role",label:"角色"}}),e._v(" "),r("el-table-column",{attrs:{align:"center",prop:"state",label:"状态"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._v("\n "+e._s("0"==t.row.state?"正常":"冻结")+"\n ")]}}])}),e._v(" "),r("el-table-column",{attrs:{align:"center",fixed:"right",label:"操作",width:"300"},scopedSlots:e._u([{key:"default",fn:function(t){return[r("div",[r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.onJoinQrCode(t.row)}}},[e._v("入驻二维码")]),e._v(" "),t.row.parentId?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.addAgentStaff(t.row)}}},[e._v("添加员工")]),e._v(" "),t.row.parentId?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.addAgent(t.row)}}},[e._v("修改")]),e._v(" "),t.row.parentId?r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.addAgentStaff(t.row)}}},[e._v("修改")]):e._e(),e._v(" "),"0"!=t.row.state||t.row.parentId?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.freezeProxy(t.row)}}},[e._v("冻结")]),e._v(" "),"0"==t.row.state||t.row.parentId?e._e():r("el-button",{attrs:{type:"text"},on:{click:function(r){return e.freezeProxy(t.row)}}},[e._v("启用")])],1)]}}])})],1),e._v(" "),r("pagination",{attrs:{sync:"",total:e.rules.total,page:e.rules.page,limit:e.rules.limit,"page-sizes":e.rules.page_size},on:{"update:total":function(t){return e.$set(e.rules,"total",t)},"update:page":function(t){return e.$set(e.rules,"page",t)},"update:limit":function(t){return e.$set(e.rules,"limit",t)},pagination:e.getList}})],1)],1),e._v(" "),r("eidtAgentMager",{ref:"eidtAgentMagerRef",on:{getList:e.getList}}),e._v(" "),r("eidthStaff",{ref:"eidthStaffRef",on:{getList:e.resetTreedata}}),e._v(" "),r("qr-code",{attrs:{isDown:!0,title:e.title,codeUrl:e.qrCodeUrl},model:{value:e.codeStatus,callback:function(t){e.codeStatus=t},expression:"codeStatus"}})],1)},n=[function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("h2",[r("div",{staticClass:"squrt"}),e._v("\n 代理商管理\n ")])}],s=(r("6762"),r("2fdb"),r("386d"),r("c7eb")),o=r("5530"),i=(r("96cf"),r("1da1")),c=(r("bc3a"),r("5f87"),r("333d")),l=(r("3908"),r("ec8a")),u=r("ab26"),p=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.agentForm.userId?"修改代理商":"新建代理商",width:"600px",visible:e.agentVisible},on:{"update:visible":function(t){e.agentVisible=t}}},[r("el-form",{ref:"adjustmentForm",attrs:{model:e.agentForm,"label-position":"right","label-width":"120px"}},[r("el-form-item",{attrs:{label:"代理商名称",prop:"proxyName",rules:[{required:!0,message:"请输入代理商名称",trigger:"blur"}]}},[r("el-input",{staticClass:"w100",model:{value:e.agentForm.proxyName,callback:function(t){e.$set(e.agentForm,"proxyName","string"===typeof t?t.trim():t)},expression:"agentForm.proxyName"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"负责人姓名",prop:"name",rules:[{required:!0,message:"请输入负责人姓名",trigger:"blur"}]}},[r("el-input",{staticClass:"w100",model:{value:e.agentForm.name,callback:function(t){e.$set(e.agentForm,"name","string"===typeof t?t.trim():t)},expression:"agentForm.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"手机号",prop:"phone",rules:[{required:!0,message:"手机号不能为空",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}]}},[r("el-input",{staticClass:"w100",model:{value:e.agentForm.phone,callback:function(t){e.$set(e.agentForm,"phone","string"===typeof t?t.trim():t)},expression:"agentForm.phone"}})],1)],1),e._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.agentVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.subEidtProxy}},[e._v("确 定")])],1)],1)},d=[],m={data:function(){return{agentVisible:!1,agentForm:{name:"",proxyName:"",phone:"",userId:""}}},mounted:function(){},methods:{openDialog:function(e){e&&e.userId?this.agentForm=Object(o["a"])({},e):this.agentForm={name:"",proxyName:"",phone:"",userId:""},this.agentVisible=!0},subEidtProxy:function(){var e=this;this.$refs.adjustmentForm.validate(function(){var t=Object(i["a"])(Object(s["a"])().mark((function t(r){return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=28;break}if(!e.agentForm.userId){t.next=16;break}return t.prev=2,t.next=5,Object(u["i"])(Object(o["a"])({},e.agentForm));case 5:t.sent,e.$message.success("修改成功"),e.$emit("getList"),e.agentVisible=!1,t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),console.log(t.t0);case 14:t.next=28;break;case 16:return t.prev=16,t.next=19,Object(u["a"])(Object(o["a"])({},e.agentForm));case 19:t.sent,e.$message.success("新增成功"),e.$emit("getList"),e.agentVisible=!1,t.next=28;break;case 25:t.prev=25,t.t1=t["catch"](16),console.log(t.t1);case 28:case"end":return t.stop()}}),t,null,[[2,11],[16,25]])})));return function(e){return t.apply(this,arguments)}}())}}},f=m,b=r("2877"),g=Object(b["a"])(f,p,d,!1,null,"749ce55a",null),h=g.exports,v=function(){var e=this,t=e.$createElement,r=e._self._c||t;return r("el-dialog",{attrs:{title:e.agentForm.userId?"修改员工":"新建员工",width:"600px",visible:e.agentVisible},on:{"update:visible":function(t){e.agentVisible=t}}},[r("el-form",{ref:"adjustmentForm",attrs:{model:e.agentForm,"label-position":"right","label-width":"120px"}},[r("el-form-item",{attrs:{label:"姓名",prop:"name",rules:[{required:!0,message:"请输入姓名",trigger:"blur"}]}},[r("el-input",{staticClass:"w100",model:{value:e.agentForm.name,callback:function(t){e.$set(e.agentForm,"name","string"===typeof t?t.trim():t)},expression:"agentForm.name"}})],1),e._v(" "),r("el-form-item",{attrs:{label:"手机号",prop:"phone",rules:[{required:!0,message:"手机号不能为空",trigger:"blur"},{pattern:/^1[3456789]\d{9}$/,message:"请输入正确的手机号",trigger:"blur"}]}},[r("el-input",{staticClass:"w100",model:{value:e.agentForm.phone,callback:function(t){e.$set(e.agentForm,"phone","string"===typeof t?t.trim():t)},expression:"agentForm.phone"}})],1)],1),e._v(" "),r("div",{staticClass:"dialog-footer",attrs:{slot:"footer"},slot:"footer"},[r("el-button",{on:{click:function(t){e.agentVisible=!1}}},[e._v("取 消")]),e._v(" "),r("el-button",{attrs:{type:"primary"},on:{click:e.subEidtProxy}},[e._v("确 定")])],1)],1)},x=[],y={data:function(){return{agentVisible:!1,agentForm:{name:"",phone:"",userId:"",parentId:""}}},mounted:function(){},methods:{openDialog:function(e){e&&e.parentId?this.agentForm=Object(o["a"])({},e):this.agentForm={name:"",phone:"",userId:"",parentId:e.userId},this.agentVisible=!0},subEidtProxy:function(){var e=this;this.$refs.adjustmentForm.validate(function(){var t=Object(i["a"])(Object(s["a"])().mark((function t(r){return Object(s["a"])().wrap((function(t){while(1)switch(t.prev=t.next){case 0:if(!r){t.next=28;break}if(!e.agentForm.userId){t.next=16;break}return t.prev=2,t.next=5,Object(u["i"])(Object(o["a"])({},e.agentForm));case 5:t.sent,e.$message.success("修改成功"),e.$emit("getList",e.agentForm.parentId),e.agentVisible=!1,t.next=14;break;case 11:t.prev=11,t.t0=t["catch"](2),console.log(t.t0);case 14:t.next=28;break;case 16:return t.prev=16,t.next=19,Object(u["b"])(Object(o["a"])({},e.agentForm));case 19:t.sent,e.$message.success("新增成功"),e.$emit("getList",e.agentForm.parentId),e.agentVisible=!1,t.next=28;break;case 25:t.prev=25,t.t1=t["catch"](16),console.log(t.t1);case 28:case"end":return t.stop()}}),t,null,[[2,11],[16,25]])})));return function(e){return t.apply(this,arguments)}}())}}},_=y,w=Object(b["a"])(_,v,x,!1,null,"128af9c2",null),k=w.exports,F=r("641c"),j=r("61f7"),O={components:{pagination:c["a"],eidtAgentMager:h,qrCode:F["a"],eidthStaff:k},data:function(){return{searchForm:{search:null,state:""},tableList:[],organList:[],rules:{limit:10,page:1,total:0,page_size:[10,20,40,50]},codeStatus:!1,qrCodeUrl:null,title:"入驻二维码",hasLoad:!1,currentLoadTreeData:null,resolveObj:null,treeIds:[]}},created:function(){},mounted:function(){this.init()},methods:{init:function(){this.getList()},getList:function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(){var t;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(u["f"])(Object(o["a"])(Object(o["a"])({},this.searchForm),{},{page:this.rules.page,rows:this.rules.limit}));case 3:t=e.sent,this.tableList=t.data.rows.map((function(e,t){return Object(o["a"])(Object(o["a"])({},e),{},{hasChildren:!0})})),this.refreshRow(),this.rules.total=t.data.total,e.next=11;break;case 9:e.prev=9,e.t0=e["catch"](0);case 11:case"end":return e.stop()}}),e,this,[[0,9]])})));function t(){return e.apply(this,arguments)}return t}(),search:function(){this.rules.page=1,this.getList()},onReSet:function(){var e=this;this.$nextTick((function(){e.search()}))},permission:function(e){return Object(l["a"])(e)},addAgent:function(e){this.$refs.eidtAgentMagerRef.openDialog(e)},addAgentStaff:function(e){this.$refs.eidthStaffRef.openDialog(e)},onJoinQrCode:function(e){this.qrCodeUrl=Object(j["e"])()+"/project/questionAsk/index.html?recommender="+e.userId,this.title="入驻二维码",this.codeStatus=!0},lookH5:function(){this.qrCodeUrl=Object(j["g"])()+"/#/saas-home",this.title="代理商H5",this.codeStatus=!0},freezeProxy:function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(t){var r,a;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return r="",a="",0==t.state?(a=1,r="冻结"):(a=0,r="启用"),e.prev=3,e.next=6,this.$confirm("是否".concat(r,'代理商"').concat(t.proxyName,'"?'),"提示",{type:"warning"});case 6:return e.next=8,Object(u["c"])({state:a,id:t.userId});case 8:this.$message.success("".concat(r,"成功")),this.getList(),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](3);case 14:case"end":return e.stop()}}),e,this,[[3,12]])})));function t(t){return e.apply(this,arguments)}return t}(),getStaffList:function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(t,r,a){var n;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return this.hasLoad=!0,this.currentLoadTreeData=t,this.resolveObj=a,this.treeIds.includes(t.userId)||this.treeIds.push(t.userId),e.prev=4,e.next=7,Object(u["g"])({id:t.userId});case 7:n=e.sent,console.log(n.data),a(n.data||[]),e.next=14;break;case 12:e.prev=12,e.t0=e["catch"](4);case 14:case"end":return e.stop()}}),e,this,[[4,12]])})));function t(t,r,a){return e.apply(this,arguments)}return t}(),hasExpandChange:function(e,t){t&&(this.hasLoad?this.hasLoad=!1:this.getStaffList(this.currentLoadTreeData,"",this.resolveObj))},refreshRow:function(){for(var e in this.treeIds)this.$refs.table1["store"].states.treeData[this.treeIds[e]].loaded=!1,this.$refs.table1["store"].states.treeData[this.treeIds[e]].expanded=!1},resetTreedata:function(){var e=Object(i["a"])(Object(s["a"])().mark((function e(t){var r;return Object(s["a"])().wrap((function(e){while(1)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Object(u["g"])({id:t});case 3:r=e.sent,this.$set(this.$refs.table1.store.states.lazyTreeNodeMap,t,r.data),e.next=9;break;case 7:e.prev=7,e.t0=e["catch"](0);case 9:case"end":return e.stop()}}),e,this,[[0,7]])})));function t(t){return e.apply(this,arguments)}return t}()}},$=O,I=Object(b["a"])($,a,n,!1,null,"2b9784f8",null);t["default"]=I.exports},"9d64":function(e,t,r){e.exports=r.p+"static/img/logo.ae7b11a3.png"}}]);