webpackJsonp([93],{UXYB:function(t,a){},tPY2:function(t,a,e){"use strict";Object.defineProperty(a,"__esModule",{value:!0});var i=e("mvHQ"),l=e.n(i),n=e("woOf"),s=e.n(n),c=e("P9l9"),o=e("Ch4/"),d={name:"GuideSetting",data:function(){return{loading:!1,settingData:{editClerkFlag:0,addClerkFlag:0,delClerkFlag:0,checked:[]},allApps:[]}},created:function(){this.getSetting()},methods:{getSetting:function(){var t=this;Object(c.a)("/haoban-manage3-web/application-open-close-list",{}).then(function(a){var e=a.data||{},i=e.errorCode,l=e.result;if(1!=i)return o.a.errorMsg(a.data);var n=l||{},c=n.allList,d=n.open,r=n.clerkEditInfo;d=Array.isArray(d)?d:[],t.allApps=c,t.settingData.checked=d.map(function(t){return t.applicationId}),s()(t.settingData,r)})},onSave:function(){var t=this;this.loading=!0;var a=this.settingData,e=a.editClerkFlag,i=a.addClerkFlag,n=a.delClerkFlag,s=a.checked,d={editClerkFlag:e,addClerkFlag:i,delClerkFlag:n,dataJson:""};d.dataJson=this.allApps.map(function(t){return{applicationId:t.applicationId,openFlag:s.includes(t.applicationId)?1:0}}),d.dataJson=l()(d.dataJson),Object(c.f)("/haoban-manage3-web/open-or-close",d).then(function(a){if(1!=(a.data||{}).errorCode)return o.a.errorMsg(a.data);t.$message.success("保存成功")}).finally(function(){setTimeout(function(){return t.loading=!1},100)})}}},r={render:function(){var t=this,a=t.$createElement,e=t._self._c||a;return e("div",{staticClass:"guide-setting"},[e("dm-sub-title",{staticClass:"guide-setting-title"},[t._v("导购操作权限设置")]),t._v(" "),e("div",{staticClass:"guide-auth-list"},[e("div",{staticClass:"guide-auth-item"},[e("span",{staticClass:"auth-item-label"},[t._v("允许编辑导购信息")]),t._v(" "),e("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.editClerkFlag,callback:function(a){t.$set(t.settingData,"editClerkFlag",a)},expression:"settingData.editClerkFlag"}})],1),t._v(" "),e("div",{staticClass:"guide-auth-item"},[e("span",{staticClass:"auth-item-label"},[t._v("允许店长添加导购")]),t._v(" "),e("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.addClerkFlag,callback:function(a){t.$set(t.settingData,"addClerkFlag",a)},expression:"settingData.addClerkFlag"}})],1),t._v(" "),e("div",{staticClass:"guide-auth-item"},[e("span",{staticClass:"auth-item-label"},[t._v("允许店长删除导购")]),t._v(" "),e("el-switch",{attrs:{"active-value":1,"inactive-value":0},model:{value:t.settingData.delClerkFlag,callback:function(a){t.$set(t.settingData,"delClerkFlag",a)},expression:"settingData.delClerkFlag"}})],1)]),t._v(" "),e("dm-sub-title",{staticClass:"guide-setting-title"},[t._v("应用可见权限设置")]),t._v(" "),e("p",{staticClass:"app-auth-tip"},[t._v("设置导购可见应用")]),t._v(" "),e("el-row",[e("el-checkbox-group",{model:{value:t.settingData.checked,callback:function(a){t.$set(t.settingData,"checked",a)},expression:"settingData.checked"}},t._l(t.allApps,function(a){return e("el-col",{key:a.applicationId,staticStyle:{"margin-bottom":"12px"},attrs:{span:3}},[e("el-checkbox",{attrs:{label:a.applicationId}},[t._v(t._s(a.applicationName))])],1)}),1)],1),t._v(" "),t.$getButtonLimit(t.$buttonCode.saveGuideSetting)?e("hb-form-bottom",[e("el-button",{attrs:{"limit-code":t.$buttonCode.saveGuideSetting,loading:t.loading,type:"primary"},on:{click:t.onSave}},[t._v("保存")])],1):t._e()],1)},staticRenderFns:[]};var u=e("VU/8")(d,r,!1,function(t){e("UXYB")},"data-v-15331292",null);a.default=u.exports}});