webpackJsonp([83],{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"),r=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 r.a.errorMsg(a.data);var n=l||{},c=n.open,d=n.close,o=n.clerkEditInfo;c=Array.isArray(c)?c:[],d=Array.isArray(d)?d:[],t.allApps=c.concat(d),t.settingData.checked=c.map(function(t){return t.applicationId}),s()(t.settingData,o)})},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 r.a.errorMsg(a.data);t.$message.success("保存成功")}).finally(function(){setTimeout(function(){return t.loading=!1},100)})}}},o={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,o,!1,function(t){e("wOEZ")},"data-v-2d6add6e",null);a.default=u.exports},wOEZ:function(t,a){}});