5318.e481cb28.js 9.1 KB

1
  1. "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[5318],{25318:function(e,t,a){a.r(t),a.d(t,{default:function(){return b}});var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-button",{attrs:{size:"mini",type:"primary"},on:{click:function(t){e.dialogFormVisible=!0}}},[e._v("授 权")]),a("el-dialog",{attrs:{"append-to-body":"",visible:e.dialogFormVisible,width:"500px"},on:{"update:visible":function(t){e.dialogFormVisible=t},close:function(t){e.dialogFormVisible=!1,e.$refs.form.resetFields()}}},[a("div",{staticStyle:{"font-size":"15px"},attrs:{slot:"title"},slot:"title"},[e._v(" 授权领域 ")]),a("el-row",{attrs:{gutter:20}},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"90px","label-position":"right",size:"mini"}},[a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"营销区域",prop:"label"}},[a("Tree",{ref:"tree",on:{onClick:e.onClick}},[a("el-input",{attrs:{slot:"input",type:"text",placeholder:"请选择营销区域"},on:{focus:function(t){e.$refs.tree.dialogFormVisible=!0}},slot:"input",model:{value:e.form.label,callback:function(t){e.$set(e.form,"label",t)},expression:"form.label"}})],1)],1)],1),a("el-col",{directives:[{name:"show",rawName:"v-show",value:e.form.label,expression:"form.label"}],attrs:{span:24}},[a("el-form-item",{attrs:{label:"业务员",prop:"name"}},[a("selectSaler",{ref:"saler",attrs:{customParam:e.salerParam},on:{selectRow:e.selectRow}},[a("el-input",{attrs:{slot:"input",type:"text",placeholder:"请选择业务员"},on:{focus:function(t){e.$refs.saler.visible=!0}},slot:"input",model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"领域",prop:"tradefield"}},[a("el-select",{attrs:{placeholder:"请选择领域"},on:{change:e.tradefieldChange},model:{value:e.form.tradefield,callback:function(t){e.$set(e.form,"tradefield",t)},expression:"form.tradefield"}},e._l(e.field,(function(e){return a("el-option",{key:e.rowindex,attrs:{value:e.value,label:e.value}})})),1)],1)],1),a("el-col",{attrs:{span:24}},[a("el-form-item",{attrs:{label:"领域明细",prop:"tradefieldmx"}},[a("el-select",{attrs:{disabled:e.field.fieldmx>0,placeholder:"请选择领域明细"},model:{value:e.form.tradefieldmx,callback:function(t){e.$set(e.form,"tradefieldmx",t)},expression:"form.tradefieldmx"}},e._l(e.fieldmx,(function(e){return a("el-option",{key:e,attrs:{value:e,label:e}})})),1)],1)],1)],1)],1),a("div",{staticClass:"dialog-footer"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.dialogFormVisible=!1,e.$refs.form.resetFields()}}},[e._v("取 消")]),a("el-button",{staticClass:"normal-btn-width btn-warning",attrs:{size:"small",type:"warning"},on:{click:e.onSubmit}},[e._v("确 定")])],1)],1)],1)},i=[],r=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tree-panel"},[a("el-dialog",{attrs:{"append-to-body":"",visible:e.dialogFormVisible,width:"500px"},on:{"update:visible":function(t){e.dialogFormVisible=t}}},[a("div",{staticStyle:{"font-size":"15px"},attrs:{slot:"title"},slot:"title"},[e._v(" 选择营销区域 ")]),a("el-tree",{ref:"treeRef",attrs:{data:e.arealist,"node-key":"sa_saleareaid","current-node-key":e.currentKey,"default-expand-all":"","highlight-current":"","expand-on-click-node":!1},on:{"node-click":e.handleClick},scopedSlots:e._u([{key:"default",fn:function(t){var l=t.node,i=t.data;return a("span",{staticClass:"custom-tree-node"},[a("span",[e._v(e._s(l.label))]),a("span",[e._t("operation",null,{data:i})],2)])}}],null,!0)})],1),e._t("input")],2)},s=[],n={props:["noDefaultData"],components:{},data(){return{arealist:[],currentKey:null,dialogFormVisible:!1}},methods:{onSubmit(){},async query_arealist(e){const t=await this.$api.requested({classname:"webmanage.sale.salearea.salearea",method:"query_area",content:{}});this.arealist=this.createMenu(t.data),e()},createMenu(e){let t=[];function a(e){var t={label:e["areaname"],remarks:e["remarks"],isused:e["isused"],sa_saleareaid:e["sa_saleareaid"],parentid:e["parentid"],children:[]};if(e.subarea&&e.subarea.length>0)for(var l=0;l<e.subarea.length;l++)t.children.push(a(e.subarea[l]));return t}return e.forEach((e=>{t.push(a(e))})),t},handleClick(e,t,a){this.$emit("onClick",t.data),this.dialogFormVisible=!1},setCurrentKey(e){this.currentKey=e,this.$nextTick((()=>{this.$refs["treeRef"].setCurrentKey(this.currentKey)}))}},mounted(){this.query_arealist((()=>{this.noDefaultData}))}},o=n,c=a(43736),d=(0,c.Z)(o,r,s,!1,null,"78c0ded5",null),u=d.exports,m=a(98647),f={name:"add",components:{Tree:u,selectSaler:m.Z},inject:["detailInfo"],data(){return{dialogFormVisible:!1,field:[],fieldmx:[],form:{sys_enterprise_tradefieldid:0,sys_enterpriseid:"",tradefield:"",sa_saleareaid:"",sa_agentsid:"",label:"",hrid:"",name:"",tradefieldmx:""},rules:{label:[{required:!0,message:"请选择营销区域",trigger:"change"}],name:[{required:!0,message:"请选择业务员",trigger:"change"}],tradefield:[{required:!0,message:"请选择领域",trigger:"change"}]},salerParam:{id:20221011144603,content:{sa_saleareaid:"",pageNumber:1,pageSize:20,where:{condition:""}}}}},created(){this.fieldList()},methods:{onClick(e){this.form.sa_saleareaid=e.sa_saleareaid,this.form.label=e.label,this.salerParam.content.sa_saleareaid=e.sa_saleareaid,console.log(e),this.$nextTick((()=>{this.$refs.saler.listData()}))},selectRow(e){this.form.name=e.name,this.form.hrid=e.hrid,this.$refs.saler.visible=!1,console.log(e)},async fieldList(){const e=await this.$store.dispatch("optiontypeselect","tradefield");this.field=e.data,console.log(this.field)},tradefieldChange(e){this.form.tradefieldmx="",this.fieldmx=this.field.filter((t=>t.value==e))[0].subvalues,console.log(this.fieldmx)},onSubmit(){this.$refs["form"].validate((async e=>{if(!e)return!1;this.form.sa_agentsid=this.$route.query.id,this.form.sys_enterpriseid=this.detailInfo().sys_enterpriseid;const t=await this.$api.requested({id:"20221223141602",version:1,content:this.form});this.tool.showMessage(t,(()=>{this.$emit("onSuccess"),this.$refs["form"].resetFields(),this.dialogFormVisible=!1}))}))}}},p=f,h=(0,c.Z)(p,l,i,!1,null,"1fb166c2",null),b=h.exports},98647:function(e,t,a){a.d(t,{Z:function(){return c}});var l=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[a("el-dialog",{attrs:{visible:e.visible,"append-to-body":"",width:"900px"},on:{"update:visible":function(t){e.visible=t}}},[a("div",{staticClass:"flex-align-center flex-between mt-10"},[a("el-input",{staticStyle:{width:"200px"},attrs:{size:"small","suffix-icon":"el-icon-search",placeholder:"搜索",clearable:""},on:{input:e.valueChange,clear:function(t){return e.listData(e.customParam?e.customParam.content.pageNumber=1:e.param.content.pageNumber=1)}},nativeOn:{keyup:function(t){return!t.type.indexOf("key")&&e._k(t.keyCode,"enter",13,t.key,"Enter")?null:e.listData(e.customParam?e.customParam.content.pageNumber=1:e.param.content.pageNumber=1)}},model:{value:e.condition,callback:function(t){e.condition=t},expression:"condition"}})],1),a("div",[a("el-table",{ref:"multipleTable",staticStyle:{width:"100%"},attrs:{data:e.tableData,size:"mini",height:"50vh",border:""}},[a("el-table-column",{attrs:{prop:"name",label:"姓名",width:"100"}}),a("el-table-column",{attrs:{prop:"position",label:"职位",width:"120"}}),a("el-table-column",{attrs:{prop:"areaname",label:"负责区域",width:"0"},scopedSlots:e._u([{key:"default",fn:function(t){return[t.row.salearea?a("span",e._l(t.row.salearea,(function(l,i){return a("span",{key:i},[e._v(" "+e._s(i===t.row.salearea.length-1?l.areafullname:l.areafullname+",")+" ")])})),0):a("span",[e._v(" "+e._s("--")+" ")])]}}])}),a("el-table-column",{attrs:{prop:"phonenumber",label:"手机号码",width:"150"}}),a("el-table-column",{attrs:{label:"操作",width:"80"},scopedSlots:e._u([{key:"default",fn:function(t){return[a("el-button",{attrs:{type:"text",size:"small"},on:{click:function(a){return e.selectRow(t.row)}}},[e._v("选 择")])]}}])})],1),a("div",{staticStyle:{"margin-top":"16px","text-align":"right"}},[a("el-pagination",{attrs:{background:"",small:"","current-page":e.customParam?e.customParam.content.pageNumber:e.param.content.pageNumber,"page-size":e.customParam?e.customParam.content.pageSize:e.param.content.pageSize,layout:"total, pager, next, jumper",total:e.total},on:{"current-change":e.handleCurrentChange}})],1)],1)]),e._t("input")],2)},i=[],r={props:["customParam"],data(){return{visible:!1,param:{id:20221122153902,content:{pageNumber:1,pageSize:20,where:{condition:""}}},tableData:[],total:0,currentPage:0,search:"",condition:""}},methods:{async listData(){const e=await this.$api.requested(this.customParam?this.customParam:this.param);this.tableData=e.data,this.total=e.total,this.currentPage=e.pageNumber},valueChange(e){console.log(e),this.customParam?this.customParam.content.where.condition=e:this.param.content.where.condition=e},handleCurrentChange(e){this.customParam?this.customParam.content.pageNumber=e:this.param.content.pageNumber=e,this.listData()},selectRow(e){this.$emit("selectRow",e)}},mounted(){this.listData()},created(){}},s=r,n=a(43736),o=(0,n.Z)(s,l,i,!1,null,null,null),c=o.exports}}]);