webpackJsonp([36],{IMwM:function(e,t){},JsWW:function(e,t,a){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var s=a("3Xzz"),n=a("P9l9"),r=a("MJLE"),i=a.n(r),o={name:"shareCode",components:{navCrumb:s.a},data:function(){return{navpath:[{name:"首页",path:"/index"},{name:"通讯录",path:"/administrativeFrame"},{name:"共享通讯录",path:""}],regenerate:!1,qrCodeContent:{},shares:[],qrcodeCase:"",myEnterprise:"",dialogVisible:!1}},methods:{getCode:function(){var e=this,t={regenerate:arguments.length>0&&void 0!==arguments[0]&&arguments[0]};Object(n.a)("/haoban-manage-web/shared-contact/get-shared-qrcode",t).then(function(t){1==t.data.errorCode?e.qrcode(t.data.result.qrCodeContent):e.$message.error({message:t.data.message})}).catch(function(t){e.$message.error({message:t.message})})},reFresh:function(){document.getElementById("qrcode").innerHTML="",this.qrcodeCase.clear(),this.getCode(!0)},qrcode:function(e){this.qrcodeCase=new i.a("qrcode",{width:245,height:245,text:e})},downloadCode:function(){var e=document.getElementById("qrcode").getElementsByTagName("img")[0].getAttribute("src"),t=document.createElement("a"),a=new MouseEvent("click");t.download="scan code",t.href=e,t.dispatchEvent(a)},getShareRelation:function(){var e=this;Object(n.a)("/haoban-manage-web/shared-contact/find-shared-contact-relation",{enterpriseIdCondition:1}).then(function(t){1==t.data.errorCode?(e.shares=t.data.result||[],e.shares.length>0&&(e.myEnterprise=t.data.result[0].exportEnterpriseName)):e.$message.error({message:t.data.message})}).catch(function(t){e.$message.error({message:t.message})})},cancelShare:function(e){var t=this;t.$confirm("是否要取消与该企业的共享？","提示",{type:"warning"}).then(function(){Object(n.a)("/haoban-manage-web/shared-contact/del-shared-enterprise",{importEnterpriseId:e.importEnterpriseId}).then(function(a){if(1==a.data.errorCode){var s=t.shares.indexOf(e);t.shares.splice(s,1)}else t.$message.error({message:a.data.message})}).catch(function(e){t.$message.error({message:e.message})})}).catch({})}},beforeMount:function(){this.getShareRelation(),this.getCode()}},c={render:function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"common-set-wrap"},[a("nav-crumb",{attrs:{navpath:e.navpath}}),e._v(" "),a("div",{staticClass:"right-content"},[a("div",{staticClass:"right-box"},[a("div",{staticClass:"share-code-div"},[a("p",{staticClass:"company-name"},[e._v(e._s(e.myEnterprise)+"的共享企业")]),e._v(" "),a("p",{staticClass:"word"},[e._v("双方共享的通讯录，选人时可以选到，同时邀请企业建立共享关系")]),e._v(" "),a("p",{staticClass:"time-tip"},[e._v("一个二维码只能和一个企业建立共享关系，24小时有效")]),e._v(" "),a("div",{staticClass:"m-t-20",attrs:{id:"qrcode"}}),e._v(" "),a("div",{staticClass:"btn-area"},[a("el-button",{attrs:{type:"primary"},on:{click:e.downloadCode}},[e._v("下载"),a("i",{staticClass:"iconfont icon-icon_yunxiazai"})]),e._v(" "),a("el-button",{on:{click:function(t){e.reFresh()}}},[e._v("重新生成")])],1),e._v(" "),a("p",{staticClass:"company-name"},[e._v("已建立的共享企业")]),e._v(" "),e.shares.length>0?a("div",{staticClass:"share-table"},[a("div",{staticClass:"company"},[e._v(e._s(e.myEnterprise))]),e._v(" "),a("ul",{staticClass:"list"},e._l(e.shares,function(t){return a("li",{key:t.importEnterpriseId,staticClass:"li"},[a("div",{staticClass:"name"},[e._v(e._s(t.importEnterpriseName))]),e._v(" "),a("div",{staticClass:"cancel-btn"},[a("a",{staticClass:"a-href",on:{click:function(a){e.cancelShare(t)}}},[e._v("取消共享")])])])}))]):e._e(),e._v(" "),a("div",{staticClass:"no-share-tip"},[e._v("暂无共享企业")]),e._v(" "),a("el-dialog",{attrs:{title:"验证管理员身份",width:"356px",visible:e.dialogVisible},on:{"update:visible":function(t){e.dialogVisible=t}}},[a("div",{staticClass:"cancel-code"},[a("p",[e._v("请使用管理员的好办扫一扫确认")])])])],1)])]),e._v(" "),a("vue-gic-footer")],1)},staticRenderFns:[]};var d=a("VU/8")(o,c,!1,function(e){a("IMwM")},null,null);t.default=d.exports}});