(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["admin/staff/add"],{"14cf":function(t,e,n){"use strict";n.r(e);var o=n("b010"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},"3bd0":function(t,e,n){"use strict";(function(t){n("6cdc");o(n("e3ac"));var e=o(n("b7f1"));function o(t){return t&&t.__esModule?t:{default:t}}t(e.default)}).call(this,n("1480")["createPage"])},"4eab":function(t,e,n){},"68a6":function(t,e,n){"use strict";var o;n.d(e,"b",(function(){return i})),n.d(e,"c",(function(){return r})),n.d(e,"a",(function(){return o}));var i=function(){var t=this,e=t.$createElement;t._self._c},r=[]},"8ef7":function(t,e,n){"use strict";var o=n("4eab"),i=n.n(o);i.a},b010:function(t,e,n){"use strict";(function(t){Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var o=u(n("644f")),i=n("2301"),r=n("5315"),a=n("06c0");function u(t){return t&&t.__esModule?t:{default:t}}function f(t,e,n,o,i,r,a){try{var u=t[r](a),f=u.value}catch(s){return void n(s)}u.done?e(f):Promise.resolve(f).then(o,i)}function s(t){return function(){var e=this,n=arguments;return new Promise((function(o,i){var r=t.apply(e,n);function a(t){f(r,o,i,a,u,"next",t)}function u(t){f(r,o,i,a,u,"throw",t)}a(void 0)}))}}var l=function(){n.e("components/plugin/list-cell").then(function(){return resolve(n("1861"))}.bind(null,n)).catch(n.oe)},c=function(){Promise.all([n.e("common/vendor"),n.e("components/module/app-avatar")]).then(function(){return resolve(n("d84d"))}.bind(null,n)).catch(n.oe)},d=n("90f4"),m={name:"staff-add",components:{TuiListCell:l,AppAvatarModule:c},data:function(){return{form:{roleId:"",remind:1,password:"",status:1,remark:""},roleList:[],roleSelData:{},showStaffArea:!0,showMiniCodeArea:!1,miniCodeSrc:"",memberData:{}}},onLoad:function(){},onShow:function(){this.option.id?t.setNavigationBarTitle({title:"修改员工"}):t.setNavigationBarTitle({title:"添加员工"})},methods:{init:function(){var e=this,n=t.getStorageSync("addStaffData");n&&(t.removeStorageSync("addStaffData"),this.form=n.form,this.roleList=n.roleList,this.roleSelData=n.roleSelData);var o=t.getStorageSync("addSelMember");if(o&&(t.removeStorageSync("addSelMember"),this.memberData=o,this.form.userId=o.id),n)return!1;this._getRoleList().then((function(t){e.option.id&&e._getDet()}))},_getRoleList:function(){var t=s(o.default.mark((function t(){var e=this;return o.default.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return t.next=2,(0,i.getRoleList)().then((function(t){if(e.$util.isEmpty(t.data))return!1;e.roleList=t.data.list}));case 2:case"end":return t.stop()}}),t)})));function e(){return t.apply(this,arguments)}return e}(),_getDet:function(){var t=this;(0,i.getStaffDet)({id:this.option.id}).then((function(e){t.$util.isEmpty(e.data)||(Object.keys(t.form).forEach((function(n,o){t.form[n]=e.data[n]})),t.roleSelData=t.roleList.filter((function(e){return t.form.roleId==e.id}))[0],t.form.userId&&"0"!=t.form.userId&&t._getMemberDet())}))},_getMemberDet:function(){var t=this;(0,r.getDet)({userId:this.form.userId}).then((function(e){t.$util.isEmpty(e.data)||(t.memberData=e.data)}))},selMemberFn:function(){var e={form:this.form,roleList:this.roleList,roleSelData:this.roleSelData};t.setStorageSync("addStaffData",e),this.$util.pageTo(1)},changeRoleFn:function(t){this.roleSelData=this.roleList[t.detail.value],this.form.roleId=this.roleSelData.id},remindChangeFn:function(t){this.form.remind=t.detail.value?1:0},statusChangeFn:function(t){this.form.status=t.detail.value?1:0},confirmFn:function(){var t=this,e=this.option.id?i.updateStaff:a.prepareBind;this.option.id&&(this.form.id=this.option.id),e(this.form).then((function(e){if(console.log("23rh23r23"),console.log(e),console.log(t.option.id),"undefined"==typeof t.option.id)t.showMiniCodeArea=!0,t.miniCodeSrc=e.data.miniCode,t.showStaffArea=!1,console.log(t.miniCodeSrc),console.log("--oo0oooo---");else{var n=t.option.id?"修改成功！":"添加成功！";t.$msg(n),setTimeout((function(){t.$util.pageTo(1)}),1e3)}}))},complete:function(){this.$util.pageTo(1)},formSubmit:function(t){var e=[{name:"roleId",rule:["required"],msg:["请选择角色"]}],n=t.detail.value,o=d.validation(n,e);o?this.$msg(o):this.confirmFn()}}};e.default=m}).call(this,n("1480")["default"])},b7f1:function(t,e,n){"use strict";n.r(e);var o=n("68a6"),i=n("14cf");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("8ef7");var a,u=n("41a2"),f=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,"5cdb1602",null,!1,o["a"],a);e["default"]=f.exports}},[["3bd0","common/runtime","common/vendor"]]]);