2 lines
4.9 KiB
JavaScript
2 lines
4.9 KiB
JavaScript
(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-09ecc94b"],{"9ba4":function(t,e,a){"use strict";a("f9fd")},a2f1:function(t,e,a){},bad3:function(t,e,a){"use strict";a("a2f1")},d719:function(t,e,a){"use strict";a.r(e);var s=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{visible:t.dialogVisible,width:"70%",center:""},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("div",{attrs:{slot:"title"},slot:"title"},[e("button",{staticClass:"el-dialog__headerbtn",attrs:{type:"button"},on:{click:function(e){t.dialogVisible=!1}}},[e("i",{staticClass:"el-dialog__close el-icon-close"})])]),e("el-row",{attrs:{gutter:20}},[e("el-col",{staticClass:"border-right",attrs:{span:12}},[e("div",{staticClass:"text-center"},[t._v(" "+t._s(t.$t("selectStaff.orgInfo"))+" ")]),e("div",{staticClass:"staff-content"},[e("org-tree-show",{ref:"orgTreeShow",on:{switchOrg:t.loadStaff}})],1)]),e("el-col",{attrs:{span:12}},[e("div",{staticClass:"text-center"},[t._v(" "+t._s(t.$t("selectStaff.staffInfo"))+" ")]),e("div",{staticClass:"staff-content"},t._l(t.selectStaffInfo.staffs,(function(a,s){return e("div",{key:s,staticClass:"staff-item",class:{selected:t.selectStaffInfo.curStaffId==a.staffId},on:{click:function(e){return t._changeStaff(a)}}},[e("div",[e("i",{staticClass:"el-icon-user margin-right-xs"}),t._v(" "+t._s(a.name)+" ")]),e("div",[t._v(t._s(a.tel))])])})),0)])],1)],1)},r=[],o=a("b775");function n(t){return new Promise((e,a)=>{Object(o["a"])({url:"/query.staff.infos",method:"get",params:t}).then(t=>{const a=t.data;e(a)}).catch(t=>{a(t)})})}var f=function(){var t=this,e=t._self._c;return e("div",{staticClass:"org-tree-container"},[e("el-tree",{ref:"orgTree",staticStyle:{width:"100%"},attrs:{data:t.orgTreeShowInfo.orgs,props:t.defaultProps,"node-key":"id","default-expand-all":"","highlight-current":""},on:{"node-click":t.handleNodeClick}})],1)},c=[],i=a("fcbe"),l=a("7323"),d={name:"OrgTreeShow",props:{callBackListener:{type:String,default:""}},data(){return{orgTreeShowInfo:{orgs:[],curOrg:{}},defaultProps:{children:"children",label:"text"},shopId:""}},created(){this.shopId=Object(l["f"])(),this._loadOrgsShow()},methods:{async _loadOrgsShow(){try{const t=await Object(i["c"])({communityId:this.shopId});this.orgTreeShowInfo.orgs=[t.data]}catch(t){console.error("请求失败:",t)}},handleNodeClick(t){this.orgTreeShowInfo.curOrg=t,this.orgTreeShowInfo.curOrg.orgId=t.id,this.$emit("switchOrg",{orgId:t.id,orgName:t.text})},refreshTree(){this._loadOrgsShow()}}},h=d,u=(a("9ba4"),a("2877")),g=Object(u["a"])(h,f,c,!1,null,"716c98d4",null),S=g.exports,b={name:"SelectStaff",components:{OrgTreeShow:S},data(){return{dialogVisible:!1,selectStaffInfo:{staffs:[],curStaffId:"",staff:{}}}},methods:{open(t){this.selectStaffInfo.staff=t,this.dialogVisible=!0,this.$refs.orgTreeShow.refreshTree()},async loadStaff(t){try{const e=await n({orgId:t.orgId,page:1,row:50});this.selectStaffInfo.staffs=e.data,this.selectStaffInfo.staffs.length>0&&(this.selectStaffInfo.curStaffId=this.selectStaffInfo.staffs[0].staffId)}catch(e){console.error("请求失败:",e)}},_changeStaff(t){this.selectStaffInfo.staff.staffId=t.userId,this.selectStaffInfo.staff.staffName=t.name,this.dialogVisible=!1,this.selectStaffInfo.staff.call&&(console.log(this.selectStaffInfo.staff),this.selectStaffInfo.staff.call(this.selectStaffInfo.staff))}}},I=b,m=(a("bad3"),Object(u["a"])(I,s,r,!1,null,"1d4fd2ff",null));e["default"]=m.exports},f9fd:function(t,e,a){},fcbe:function(t,e,a){"use strict";a.d(e,"c",(function(){return r})),a.d(e,"f",(function(){return o})),a.d(e,"d",(function(){return n})),a.d(e,"h",(function(){return f})),a.d(e,"a",(function(){return c})),a.d(e,"e",(function(){return i})),a.d(e,"g",(function(){return l})),a.d(e,"b",(function(){return d}));var s=a("b775");function r(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.listOrgTree",method:"get",params:t}).then(t=>{const a=t.data;e(a)}).catch(t=>{a(t)})})}function o(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.saveOrg",method:"post",data:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function n(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.listOrgs",method:"get",params:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function f(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.updateOrg",method:"post",data:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function c(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.deleteOrg",method:"post",data:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function i(t){return new Promise((e,a)=>{Object(s["a"])({url:"/user.listStaffsNoInOrg",method:"get",params:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function l(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.saveStaffOrgRel",method:"post",data:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}function d(t){return new Promise((e,a)=>{Object(s["a"])({url:"/org.deleteOrgRelStaff",method:"post",data:t}).then(t=>{e(t.data)}).catch(t=>{a(t)})})}}}]);
|
|
//# sourceMappingURL=chunk-09ecc94b.3ed603ec.js.map
|