| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[782],{782:function(e,t,a){a.r(t),a.d(t,{default:function(){return m}});var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{attrs:{type:"primary",size:"small"},on:{click:function(t){return e.onShow(e.dialogVisible=!0)}}},[e._v("新 建")]),a("el-drawer",{attrs:{title:"创建业务员",visible:e.dialogVisible,size:"30%",direction:"rtl","append-to-body":"","show-close":!1},on:{"update:visible":function(t){e.dialogVisible=t},close:function(t){e.dialogVisible=!1}}},[a("div",{staticClass:"drawer__panel"},[a("el-row",[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-position":"right","label-width":"75px",size:"small"}},[a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"业务员:",prop:"hrid"}},[a("selectMenber",{ref:"selectMenber",on:{selectMenber:e.selectMenber}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"手机号:",prop:"phonenumber"}},[a("el-input",{attrs:{placeholder:"手机号",disabled:""},model:{value:e.form.phonenumber,callback:function(t){e.$set(e.form,"phonenumber",t)},expression:"form.phonenumber"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"汇报对象:",prop:"reporthrname"}},[a("el-input",{attrs:{placeholder:"汇报对象",disabled:""},model:{value:e.form.reporthrname,callback:function(t){e.$set(e.form,"reporthrname",t)},expression:"form.reporthrname"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"编号:",prop:"hrcode"}},[a("el-input",{attrs:{placeholder:"编号",disabled:""},model:{value:e.form.hrcode,callback:function(t){e.$set(e.form,"hrcode",t)},expression:"form.hrcode"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"邮箱:",prop:"email"}},[a("el-input",{attrs:{placeholder:"邮箱",disabled:""},model:{value:e.form.email,callback:function(t){e.$set(e.form,"email",t)},expression:"form.email"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"部门:",prop:"depname"}},[a("el-input",{attrs:{placeholder:"部门",disabled:""},model:{value:e.form.depname,callback:function(t){e.$set(e.form,"depname",t)},expression:"form.depname"}})],1)],1),a("el-col",{attrs:{span:12}},[a("el-form-item",{attrs:{label:"区域:",prop:"areaname"}},[a("el-input",{attrs:{placeholder:"区域",disabled:""},model:{value:e.form.areaname,callback:function(t){e.$set(e.form,"areaname",t)},expression:"form.areaname"}})],1)],1),a("el-col",{attrs:{span:15}},[a("el-form-item",{attrs:{label:"最低授权折扣(%):",prop:"discountrate","label-width":"132px"}},[a("el-input",{attrs:{placeholder:"请输入最低授权折扣"},on:{change:function(t){return e.discountrateChange(e.form.discountrate)}},model:{value:e.form.discountrate,callback:function(t){e.$set(e.form,"discountrate",t)},expression:"form.discountrate"}})],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{prop:"discountrate","label-width":"132px"}},[a("el-checkbox",{attrs:{"true-label":1,"false-label":0},model:{value:e.form.iseditprice,callback:function(t){e.$set(e.form,"iseditprice",t)},expression:"form.iseditprice"}},[e._v("是否可编辑订单价格")])],1)],1)],1)],1)],1),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:e.onSubmit}},[e._v("确 定")])],1)])],1)},r=[],i=a(48534),l=a(95082),s=(a(35666),a(56977),a(68309),a(95399)),o=a(20629),c={components:{selectMenber:s.Z},data:function(){return{dialogVisible:!1,form:{sa_saleareaid:"",hrid:"",discountrate:""},rules:{hrid:[{required:!0,message:"请选择业务员",trigger:"blur"},{required:!0,message:"请选择业务员",trigger:"change"}],discountrate:[{required:!0,message:"请输入最低授权折扣",trigger:"blur"}]}}},computed:(0,l.Z)({},(0,o.Se)({dataToForm:"dataToForm"})),methods:{onShow:function(){this.form.areaname=this.dataToForm.label},onSubmit:function(){var e=this;console.log(this.dataToForm),console.log(this.form),this.$refs["form"].validate((function(t){if(!t)return!1;e.$confirm("确定将此人设置为业务员吗?","提示",{confirmButtonText:"确定",cancelButtonText:"取消",type:"warning"}).then((0,i.Z)(regeneratorRuntime.mark((function t(){var a;return regeneratorRuntime.wrap((function(t){while(1)switch(t.prev=t.next){case 0:return e.form.sa_saleareaid=e.dataToForm.sa_saleareaid,e.form.discountrate=(e.form.discountrate/100).toFixed(4),t.next=4,e.$api.requested({id:20221011144703,content:e.form});case 4:a=t.sent,e.tool.showMessage(a,(function(){e.dialogVisible=!1,e.$refs.selectMenber.value.name="",e.$refs.selectMenber.value.hrid="",e.$emit("onSuccess"),e.form={sa_saleareaid:"",hrid:"",discountrate:""}}));case 6:case"end":return t.stop()}}),t)})))).catch((function(t){console.log(t),e.$message({type:"info",message:"已取消"})}))}))},selectMenber:function(e){console.log(e),this.form=Object.assign({},this.form,e)},onClose:function(){this.dialogVisible=!1,this.form={sa_saleareaid:"",hrid:"",discountrate:""}},discountrateChange:function(e){this.form.discountrate=e<0?1:e>100?100:Math.round(100*e)/100}},created:function(){this.form.areaname=this.$route.query.name}},d=c,u=a(43736),p=(0,u.Z)(d,n,r,!1,null,null,null),m=p.exports},95399:function(e,t,a){a.d(t,{Z:function(){return $}});var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-input",{attrs:{readonly:"",placeholder:"选择对象人员","suffix-icon":"el-icon-arrow-down",autocomplete:"off"},on:{focus:function(t){e.dialogTableVisible=!0}},model:{value:e.value.name,callback:function(t){e.$set(e.value,"name",t)},expression:"value.name"}}),a("el-dialog",{attrs:{title:"选择人员","append-to-body":"",visible:e.dialogTableVisible,width:"80%"},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[a("div",{staticClass:"flex"},[a("dep-list",{ref:"list",staticStyle:{width:"200px"},on:{onClick:e.onClick}}),a("div",{staticStyle:{width:"600px",flex:"1 0 auto"}},[a("staffList",{ref:"staff",attrs:{depInfo:e.depInfo},scopedSlots:e._u([{key:"detail",fn:function(t){return[a("div",{staticClass:"inline-16"},[a("el-button",{attrs:{type:"text",size:"mini"},on:{click:function(a){return e.selectMenber(t.data)}}},[e._v("选 择")])],1)]}}])})],1)],1)])],1)},r=[],i=(a(38862),a(68309),function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tree-panel"},[a("el-tree",{ref:"cusTreeRef",attrs:{data:e.deplist,"node-key":"departmentid","current-node-key":e.currentKey,"default-expand-all":"","highlight-current":"","expand-on-click-node":!1},on:{"node-click":e.checkChange},scopedSlots:e._u([{key:"default",fn:function(t){var n=t.node,r=t.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[e._v(e._s(n.label))]),a("span",[e._t("operation",null,{data:r})],2)])}}],null,!0)})],1)}),l=[],s=a(45957),o=a(48534),c=a(95082),d=(a(41539),a(54747),a(26699),a(32023),a(35666),a(20629)),u={props:["checked","dep_default"],components:{},computed:(0,c.Z)({},(0,d.Se)({pageOnlyRead:"pageOnlyRead"})),data:function(){return{deplist:[],cusChecked:[],responseData:[],currentKey:0}},methods:{department:function(e){var t=this;return(0,o.Z)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return a.next=2,t.$api.requested({classname:"webmanage.department.department",method:"querydepartment",content:{}});case 2:n=a.sent,t.responseData=n.data,t.deplist=t.createMenu(n.data),t.$emit("onClick",{data:t.deplist[0],parent:[]}),e&&e();case 7:case"end":return a.stop()}}),a)})))()},createMenu:function(e){var t=this,a=[];function n(e){var a={label:e["depname"],parentid:e["parentid"],departmentid:e["departmentid"],value:e["departmentid"],remarks:e["remarks"],isused:e["isused"],changedate:e["changedate"],changeby:e["changeby"],createdate:e["createdate"],createby:e["createby"],depno:e["depno"],disabled:t.pageOnlyRead,children:[]};if(e.subdep&&e.subdep.length>0)for(var r=0;r<e.subdep.length;r++)a.children.push(n(e.subdep[r]));return a}return e.forEach((function(e){a.push(n(e))})),a},handleCheck:function(e,t){var a=this,n=function e(t,n){if(a.$refs.cusTreeRef.setChecked(t.departmentid,n),t.children)for(var r=0;r<t.children.length;r++)e(t.children[r],n)},r=function e(t){var n=a.$refs.cusTreeRef.getNode(t);n.parent.key&&(a.$refs.cusTreeRef.setChecked(n.parent,!0),e(n.parent))};t.checkedKeys.includes(e.departmentid)?(r(e),n(e,!0)):e.children&&n(e,!1),this.cusChecked=(0,s.Z)(this.$refs.cusTreeRef.getCheckedKeys()),this.$emit("onChecked",this.cusChecked),this.cusChecked=this.cusChecked},checkChange:function(e,t,a){this.$emit("onClick",{data:e})},setCurrentKey:function(e){var t=this;this.currentKey=e,this.$nextTick((function(){t.$refs["cusTreeRef"].setCurrentKey(t.currentKey)}))}},mounted:function(){var e=this;this.department((function(){e.setCurrentKey(e.deplist[0].departmentid)}))},watch:{pageOnlyRead:function(){var e=this;this.department((function(){e.setCurrentKey(e.deplist[0].departmentid)}))},dep_default:function(e){this.$emit("onChecked",this.dep_default)}}},p=u,m=a(43736),f=(0,m.Z)(p,i,l,!1,null,"1357fd5e",null),h=f.exports,b=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container normal-panel"},[a("div",{staticClass:"flex-align-center flex-between"},[a("p",{staticClass:"normal-title normal-margin"},[e._v("员工信息")]),e._t("staff")],2),a("el-input",{staticClass:"input-with-select normal-margin",staticStyle:{width:"270px"},attrs:{placeholder:"请输入内容",size:"small",clearable:""},on:{clear:e.search},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.search.apply(null,arguments)}},model:{value:e.param.content.where.condition,callback:function(t){e.$set(e.param.content.where,"condition",t)},expression:"param.content.where.condition"}}),a("el-table",{staticStyle:{width:"100%"},attrs:{data:e.list,size:"mini",border:""}},[a("el-table-column",{attrs:{prop:"hrcode",label:"编号"}}),a("el-table-column",{attrs:{prop:"name",label:"姓名"}}),a("el-table-column",{attrs:{prop:"phonenumber",label:"手机号"}}),a("el-table-column",{attrs:{prop:"depname",label:"部门"}}),a("el-table-column",{attrs:{prop:"position",label:"职位"}}),a("el-table-column",{attrs:{label:"操作"},scopedSlots:e._u([{key:"default",fn:function(t){return[e._t("detail",null,{data:t.row})]}}],null,!0)})],1),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","current-page":e.currentPage,"page-size":e.param.content.pageSize,layout:"total, prev, pager, next, jumper",total:e.total},on:{"size-change":e.handleSizeChange,"current-change":e.handleCurrentChange}})],1)],1)},g=[],v={data:function(){return{param:{id:"20221102090303",content:{nocahe:!0,pageNumber:1,pageSize:20,departmentids:null,containssub:1,where:{condition:""}}},tablecols:[],list:[],total:0,currentPage:0}},methods:{search:function(){this.param.content.pageNumber=1,this.listData(this.param.content.departmentids[0])},listData:function(e){var t=this;return(0,o.Z)(regeneratorRuntime.mark((function a(){var n;return regeneratorRuntime.wrap((function(a){while(1)switch(a.prev=a.next){case 0:return t.param.content.departmentids=[e],a.next=3,t.$api.requested(t.param);case 3:n=a.sent,t.list=n.data,t.total=n.total,t.currentPage=n.pageNumber;case 7:case"end":return a.stop()}}),a)})))()},handleSizeChange:function(e){this.param.content.pageSize=e,this.listData(this.param.content.departmentids[0])},handleCurrentChange:function(e){this.param.content.pageNumber=e,this.listData(this.param.content.departmentids[0])}},mounted:function(){}},k=v,y=(0,m.Z)(k,b,g,!1,null,null,null),C=y.exports,x={props:["reporthrname"],components:{depList:h,staffList:C},data:function(){return{dialogTableVisible:!1,depInfo:{data:null,parent:{data:{}}},value:{name:"",hrid:""}}},methods:{onClick:function(e){this.depInfo=e,console.log(this.depInfo.data,"----"),this.$refs.staff.listData(this.depInfo.data.departmentid)},selectMenber:function(e){this.value=JSON.parse(JSON.stringify(e)),this.$emit("selectMenber",e),this.dialogTableVisible=!1},onStaffSuccess:function(){this.$refs.staff.listData(this.depInfo.data.departmentid)}},watch:{reporthrname:function(e){this.value.name=e}}},w=x,_=(0,m.Z)(w,n,r,!1,null,"1f164079",null),$=_.exports}}]);
|