Files
PropertyDeployment/resources/Web/MicroCommunityMallWeb/html/js/chunk-d126a2e8.9944c781.js
Anfioo adfd019d2d 江门
1
2026-02-01 15:37:55 +08:00

2 lines
14 KiB
JavaScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-d126a2e8"],{"16aa":function(t,e,a){},"580d":function(t,e,a){"use strict";a("16aa")},"5d60":function(t,e,a){"use strict";a("b742")},6928:function(t,e,a){"use strict";a("70f4")},"70f4":function(t,e,a){},"790b":function(t,e,a){},"7d22":function(t,e,a){"use strict";a.r(e);var o=function(){var t=this,e=t._self._c;return e("div",[e("div",{staticClass:"java110_step"},[e("el-steps",{attrs:{active:t.addStaffStepInfo.index,"finish-status":"success"}},[e("el-step",{attrs:{title:"选择分公司"}}),e("el-step",{attrs:{title:"选择部门"}}),e("el-step",{attrs:{title:"员工信息"}})],1)],1),0==t.addStaffStepInfo.index||1==t.addStaffStepInfo.index?e("div",[e("view-org-info",{ref:"viewOrgInfo",attrs:{callBackListener:"addStaffStep",callBackFunction:"notify"}})],1):t._e(),e("div",{directives:[{name:"show",rawName:"v-show",value:2==t.addStaffStepInfo.index,expression:"addStaffStepInfo.index == 2"}]},[e("add-staff-view",{ref:"addStaffView",attrs:{callBackListener:"addStaffStep",callBackFunction:"notify"}})],1),e("el-row",[e("el-col",{attrs:{span:22,offset:2}},[e("div",{staticClass:"action-buttons"},[e("el-button",{attrs:{type:"info"},on:{click:function(e){return t._prevStep()}}},[t._v("上一步")]),2!=t.addStaffStepInfo.index?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t._nextStep()}}},[t._v("下一步")]):t._e(),2==t.addStaffStepInfo.index?e("el-button",{attrs:{type:"primary"},on:{click:function(e){return t._finishStep()}}},[t._v("完成")]):t._e()],1)])],1)],1)},n=[],s=a("a8e5"),i=function(){var t=this,e=t._self._c;return e("el-row",[e("el-col",{attrs:{span:24}},[e("el-card",[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v("添加员工")])]),e("div",{staticClass:"content"},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:12}},[e("div",{staticClass:"photo-section"},[e("video",{staticStyle:{width:"100%"},attrs:{id:"staffPhoto"}}),e("canvas",{staticStyle:{display:"none"},attrs:{id:"canvas"}}),e("div",{staticClass:"photo-actions"},[e("el-button",{attrs:{type:"primary",icon:"el-icon-camera"},on:{click:function(e){return t._takePhoto()}}},[t._v("拍照")]),e("el-upload",{attrs:{action:"","auto-upload":!1,"show-file-list":!1,"on-change":t._choosePhoto}},[e("el-button",{attrs:{type:"default"}},[t._v("上传照片")])],1)],1)])]),e("el-col",{attrs:{span:12}},[e("el-form",{attrs:{"label-width":"120px"}},[e("el-form-item",{attrs:{label:"员工名称(2-10位)"}},[e("el-input",{attrs:{placeholder:"必填请填写员工名称2-10位"},model:{value:t.addStaffViewInfo.username,callback:function(e){t.$set(t.addStaffViewInfo,"username",e)},expression:"addStaffViewInfo.username"}})],1),e("el-form-item",{attrs:{label:"员工性别"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择员工性别"},model:{value:t.addStaffViewInfo.sex,callback:function(e){t.$set(t.addStaffViewInfo,"sex",e)},expression:"addStaffViewInfo.sex"}},[e("el-option",{attrs:{label:"请选择员工性别",value:"",disabled:""}}),e("el-option",{attrs:{label:"男",value:"0"}}),e("el-option",{attrs:{label:"女",value:"1"}})],1)],1),e("el-form-item",{attrs:{label:"员工岗位"}},[e("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"必填,请选择岗位"},model:{value:t.addStaffViewInfo.relCd,callback:function(e){t.$set(t.addStaffViewInfo,"relCd",e)},expression:"addStaffViewInfo.relCd"}},[e("el-option",{attrs:{label:"请选择岗位",value:"",disabled:""}}),t._l(t.addStaffViewInfo.relCds,(function(t,a){return e("el-option",{key:a,attrs:{label:t.name,value:t.statusCd}})}))],2)],1),e("el-form-item",{attrs:{label:"员工邮箱"}},[e("el-input",{attrs:{placeholder:"可选,请填写员工邮箱"},model:{value:t.addStaffViewInfo.email,callback:function(e){t.$set(t.addStaffViewInfo,"email",e)},expression:"addStaffViewInfo.email"}})],1),e("el-form-item",{attrs:{label:"手机"}},[e("el-input",{attrs:{placeholder:"必填,请填写手机",maxlength:"11"},model:{value:t.addStaffViewInfo.tel,callback:function(e){t.$set(t.addStaffViewInfo,"tel",e)},expression:"addStaffViewInfo.tel"}})],1),e("el-form-item",{attrs:{label:"家庭住址"}},[e("el-input",{attrs:{placeholder:"必填,请填写家庭住址"},model:{value:t.addStaffViewInfo.address,callback:function(e){t.$set(t.addStaffViewInfo,"address",e)},expression:"addStaffViewInfo.address"}})],1),e("el-form-item",{attrs:{label:"照片"}},[e("img",{attrs:{width:"150",height:"150",src:t.addStaffViewInfo.photo,alt:"员工照片"}})])],1)],1)],1)],1)])],1)],1)},r=[],f=a("7323"),d={name:"AddStaffView",props:{callBackListener:String,callBackFunction:String},data(){return{addStaffViewInfo:{flowComponent:"addStaffView",username:"",sex:"",email:"",tel:"",address:"",relCd:"",relCds:[],videoPlaying:!1,photo:"/img/defaultAvatar.png"},mediaStream:null}},watch:{addStaffViewInfo:{deep:!0,handler(){this.saveAddStaffInfo()}}},created(){this.getDictData()},methods:{async getDictData(){try{const{data:t}=await Object(f["e"])("u_org_staff_rel","rel_cd");this.addStaffViewInfo.relCds=t}catch(t){console.error("获取字典数据失败:",t)}},updateIndex(t){console.log(t),this.addStaffViewInfo.index=t,2===t?this.$nextTick(()=>{this._initAddStaffMedia()}):this.mediaStream&&this._stopMediaStream()},saveAddStaffInfo(){this.addStaffValidate()&&this.$emit(this.callBackFunction,this.addStaffViewInfo)},addStaffValidate(){return!0},_addUserMedia(){return navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia||null},_initAddStaffMedia(){if(this._addUserMedia()){this.addStaffViewInfo.videoPlaying=!1;const t={video:!0,audio:!1},e=document.getElementById("staffPhoto");navigator.mediaDevices.getUserMedia(t).then(t=>{this.mediaStream=t;try{e.srcObject=t,e.play(),this.addStaffViewInfo.videoPlaying=!0}catch(a){console.error("初始化视频失败:",a)}}).catch(t=>{console.error("获取媒体设备失败:",t)})}},_takePhoto(){if(this.addStaffViewInfo.videoPlaying){const t=document.getElementById("canvas"),e=document.getElementById("staffPhoto");t.width=e.videoWidth,t.height=e.videoHeight,t.getContext("2d").drawImage(e,0,0);const a=t.toDataURL("image/jpeg",1);this.addStaffViewInfo.photo=a}},_choosePhoto(t){if(t.size>2097152)return this.$message.error("图片大小不能超过 2MB!"),!1;const e=new FileReader;e.readAsDataURL(t.raw),e.onloadend=t=>{console.log(t),this.addStaffViewInfo.photo=e.result}},_stopMediaStream(){if(this.mediaStream){this.mediaStream.getTracks().forEach(t=>t.stop()),this.mediaStream=null;const t=document.getElementById("staffPhoto");t.srcObject=null,this.addStaffViewInfo.videoPlaying=!1}}},beforeDestroy(){this._stopMediaStream()}},l=d,c=(a("5d60"),a("2877")),h=Object(c["a"])(l,i,r,!1,null,"3c9e48d6",null),p=h.exports,g=a("b775");function m(t){return new Promise((e,a)=>{Object(g["a"])({url:"/addStaffStepBinding/binding",method:"post",data:t,headers:{"Content-Type":"application/json"}}).then(t=>{const a=t.data;e(a)}).catch(t=>{a(t)})})}var u={name:"AddStaffStep",components:{ViewOrgInfo:s["a"],AddStaffView:p},data(){return{addStaffStepInfo:{index:0,infos:[],branchOrgInfo:{orgId:"",componentName:"分公司信息",buttonName:"选择分公司",orgName:"",orgLevel:"2",parentOrgId:"",description:""},departmemtOrgInfo:{orgId:"",componentName:"部门信息",buttonName:"选择部门",orgName:"",orgLevel:"3",parentOrgId:"",description:""},staffInfo:{orgId:"",username:"",sex:"",email:"",tel:"",address:"",relCd:"",photo:""}}}},created(){this.shopId=Object(f["f"])(),console.log(this.shopId)},methods:{_prevStep(){this.addStaffStepInfo.index>0&&(this.addStaffStepInfo.index--,this.$refs.viewOrgInfo.updateIndex(this.addStaffStepInfo.index),this.$refs.addStaffView.updateIndex(this.addStaffStepInfo.index),this._notifyViewOrgInfoComponentData())},_nextStep(){const t=this.addStaffStepInfo.infos[this.addStaffStepInfo.index];t?this.addStaffStepInfo.index<2&&(this.addStaffStepInfo.index++,this.$refs.viewOrgInfo.updateIndex(this.addStaffStepInfo.index),this.$refs.addStaffView.updateIndex(this.addStaffStepInfo.index),this._notifyViewOrgInfoComponentData()):this.$message.warning("请选择或填写必选信息")},async _finishStep(){const t=this.addStaffStepInfo.infos[this.addStaffStepInfo.index];if(t)try{const t=await m(this.addStaffStepInfo.staffInfo);0===t.code?(this.$message.success("处理成功"),this.$router.go(-1)):this.$message.error(t.msg)}catch(e){console.error("请求失败:",e),this.$message.error(e.message||"处理失败")}else this.$message.warning("请选择或填写必选信息")},_notifyViewOrgInfoComponentData(){0===this.addStaffStepInfo.index?this.$refs.viewOrgInfo.initInfo(this.addStaffStepInfo.branchOrgInfo):1===this.addStaffStepInfo.index&&(this.addStaffStepInfo.departmemtOrgInfo.parentOrgId=this.addStaffStepInfo.branchOrgInfo.orgId,this.$refs.viewOrgInfo.initInfo(this.addStaffStepInfo.departmemtOrgInfo))}},mounted(){this.$on("addStaffStep","notify",t=>{0===this.addStaffStepInfo.index?(Object.assign(this.addStaffStepInfo.branchOrgInfo,t),this.addStaffStepInfo.infos[0]=this.addStaffStepInfo.branchOrgInfo):1===this.addStaffStepInfo.index?(Object.assign(this.addStaffStepInfo.departmemtOrgInfo,t),this.addStaffStepInfo.staffInfo.orgId=t.orgId,this.addStaffStepInfo.infos[1]=this.addStaffStepInfo.departmemtOrgInfo):(Object.assign(this.addStaffStepInfo.staffInfo,t),this.addStaffStepInfo.infos[2]=this.addStaffStepInfo.staffInfo)})}},I=u,S=(a("6928"),Object(c["a"])(I,o,n,!1,null,"5f3250e8",null));e["default"]=S.exports},a8e5:function(t,e,a){"use strict";var o=function(){var t=this,e=t._self._c;return e("el-row",[e("el-col",{attrs:{span:24}},[e("el-card",{staticClass:"box-card"},[e("div",{staticClass:"flex justify-between",attrs:{slot:"header"},slot:"header"},[e("span",[t._v(t._s(t.viewOrgInfo.componentName))]),e("div",{staticStyle:{float:"right"}},[2!=t.viewOrgInfo.index?e("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(e){return t._openSelectOrgInfoModel()}}},[e("i",{staticClass:"el-icon-search"}),t._v(" "+t._s(t.viewOrgInfo.buttonName)+" ")]):t._e()],1)]),e("div",{staticClass:"text item"},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:8}},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"el-form-item__label"},[t._v("组织名称:")]),e("label",[t._v(t._s(t.viewOrgInfo.orgName))])])]),e("el-col",{attrs:{span:8}},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"el-form-item__label"},[t._v("组织级别:")]),e("label",[t._v(t._s(t.viewOrgInfo.orgLevelName))])])]),e("el-col",{attrs:{span:8}},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"el-form-item__label"},[t._v("上级组织:")]),e("label",[t._v(t._s(t.viewOrgInfo.parentOrgName))])])])],1),e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:8}},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"el-form-item__label"},[t._v("组织ID")]),e("label",[t._v(t._s(t.viewOrgInfo.orgId))])])]),e("el-col",{attrs:{span:8}},[e("div",{staticClass:"form-group"},[e("label",{staticClass:"el-form-item__label"},[t._v("描述:")]),e("label",[t._v(t._s(t.viewOrgInfo.description))])])])],1)],1)])],1),e("choose-org",{ref:"chooseOrg",attrs:{emitChooseOrg:"viewOrgInfo",emitLoadData:"viewOrgInfo"}})],1)},n=[],s=function(){var t=this,e=t._self._c;return e("el-dialog",{attrs:{title:"选择组织",visible:t.dialogVisible,width:"80%"},on:{"update:visible":function(e){t.dialogVisible=e}}},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:24}},[e("el-card",{attrs:{header:"flex justify-between"}},[e("el-row",{attrs:{gutter:20}},[e("el-col",{attrs:{span:18}}),e("el-col",{attrs:{span:6}},[e("el-input",{staticClass:"input-with-button",attrs:{placeholder:"输入组织名称"},model:{value:t.chooseOrgInfo._currentOrgName,callback:function(e){t.$set(t.chooseOrgInfo,"_currentOrgName",e)},expression:"chooseOrgInfo._currentOrgName"}},[e("el-button",{attrs:{slot:"append",icon:"el-icon-search"},on:{click:function(e){return t.queryOrgs()}},slot:"append"},[t._v("查询")])],1)],1)],1),e("el-table",{staticStyle:{width:"100%"},attrs:{data:t.chooseOrgInfo.orgs,border:""}},[e("el-table-column",{attrs:{prop:"orgId",label:"组织ID",align:"center"}}),e("el-table-column",{attrs:{prop:"orgName",label:"组织名称",align:"center"}}),e("el-table-column",{attrs:{prop:"orgLevelName",label:"组织级别",align:"center"}}),e("el-table-column",{attrs:{prop:"parentOrgName",label:"上级ID",align:"center"}}),e("el-table-column",{attrs:{label:"操作",align:"center"},scopedSlots:t._u([{key:"default",fn:function(a){return[e("el-button",{attrs:{type:"primary",size:"mini"},on:{click:function(e){return t.chooseOrg(a.row)}}},[t._v("选择")])]}}])})],1)],1)],1)],1)],1)},i=[],r=a("b775");function f(t){return new Promise((e,a)=>{Object(r["a"])({url:"/chooseOrg/list",method:"get",params:t}).then(t=>{const a=t.data;e(a)}).catch(t=>{a(t)})})}var d=a("7323"),l={name:"ChooseOrg",props:{emitChooseOrg:String,emitLoadData:String},data(){return{dialogVisible:!1,chooseOrgInfo:{orgs:[],_currentOrgName:"",orgLevel:"",parentOrgId:""}}},methods:{open(t){Object.assign(this.chooseOrgInfo,t),this.dialogVisible=!0,this._refreshChooseOrgInfo(),this._loadAllOrgInfo(1,10,"")},async _loadAllOrgInfo(t,e,a){try{const o={page:t,row:e,shopId:Object(d["f"])(),orgName:a,orgLevel:this.chooseOrgInfo.orgLevel,parentOrgId:this.chooseOrgInfo.parentOrgId},n=await f(o);this.chooseOrgInfo.orgs=n.data.orgs}catch(o){console.error("请求失败:",o)}},chooseOrg(t){Object.prototype.hasOwnProperty.call(t,"name")&&(t.orgName=t.name),this.$emit(this.emitChooseOrg,"chooseOrg",t),this.$emit(this.emitLoadData,"listOrgData",{orgId:t.orgId}),this.dialogVisible=!1},queryOrgs(){this._loadAllOrgInfo(1,10,this.chooseOrgInfo._currentOrgName)},_refreshChooseOrgInfo(){this.chooseOrgInfo._currentOrgName=""}}},c=l,h=(a("580d"),a("2877")),p=Object(h["a"])(c,s,i,!1,null,"78699914",null),g=p.exports,m={name:"ViewOrgInfo",components:{ChooseOrg:g},props:{callBackListener:String,callBackFunction:String},data(){return{viewOrgInfo:{componentName:"组织管理信息",buttonName:"选择组织",index:0,flowComponent:"viewOrgInfo",orgId:"",orgName:"",orgLevel:"",orgLevelName:"",parentOrgId:"",parentOrgName:"",description:"",branchOrgId:""}}},methods:{_openSelectOrgInfoModel(){this.$refs.chooseOrg.open({orgLevel:this.viewOrgInfo.orgLevel,parentOrgId:this.viewOrgInfo.parentOrgId})},updateIndex(t){this.viewOrgInfo.index=t},initInfo(t){Object.assign(this.viewOrgInfo,t)}},created(){this.$on("viewOrgInfo","chooseOrg",t=>{Object.assign(this.viewOrgInfo,t),this.$emit(this.callBackFunction,this.viewOrgInfo)})}},u=m,I=(a("ed00"),Object(h["a"])(u,o,n,!1,null,"17e93828",null));e["a"]=I.exports},b742:function(t,e,a){},ed00:function(t,e,a){"use strict";a("790b")}}]);
//# sourceMappingURL=chunk-d126a2e8.9944c781.js.map