| 1 |
- "use strict";(self["webpackChunkyos_manage"]=self["webpackChunkyos_manage"]||[]).push([[9490],{69490:function(e,t,a){a.r(t),a.d(t,{default:function(){return c}});var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",["新建"==e.status()?a("el-button",{attrs:{size:"mini",type:e.data.disabled?"primary":"",disabled:!e.data.disabled},on:{click:function(t){return e.onShow()}}},[e._v("编 辑")]):e._e(),a("el-drawer",{attrs:{title:"编辑活动",visible:e.drawer,size:"800px",direction:"rtl","append-to-body":"","show-close":!1},on:{"update:visible":function(t){e.drawer=t}}},[a("div",{staticClass:"drawer__panel"},[a("el-form",{ref:"form",attrs:{model:e.form,rules:e.rules,"label-width":"100px",size:"small"}},[a("el-form-item",{attrs:{label:"活动名称",prop:"name"}},[a("el-input",{attrs:{placeholder:"请输入活动名称",clearable:""},model:{value:e.form.name,callback:function(t){e.$set(e.form,"name",t)},expression:"form.name"}})],1),a("el-form-item",{attrs:{label:"活动类型",prop:"type"}},[a("el-select",{staticStyle:{width:"100%"},attrs:{placeholder:"请选择类型",clearable:""},model:{value:e.form.type,callback:function(t){e.$set(e.form,"type",t)},expression:"form.type"}},e._l(e.campaigntypeList(),(function(e){return a("el-option",{key:e.index,attrs:{label:e.value,value:e.value}})})),1)],1),a("el-form-item",{attrs:{label:"负责人"}},[a("selectLeader",{ref:"leader",on:{selectLeader:e.selectLeader}},[a("el-input",{attrs:{slot:"input",type:"text",size:"small",placeholder:"请选择活动负责人"},on:{focus:function(t){e.$refs.leader.dialogTableVisible=!0}},slot:"input",model:{value:e.form.director,callback:function(t){e.$set(e.form,"director",t)},expression:"form.director"}})],1)],1),a("el-form-item",{attrs:{label:"地址"}},[a("el-input",{attrs:{placeholder:"请输入地址"},model:{value:e.form.address,callback:function(t){e.$set(e.form,"address",t)},expression:"form.address"}})],1),a("el-form-item",{attrs:{label:"开始日期",prop:"begdate"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期"},model:{value:e.form.begdate,callback:function(t){e.$set(e.form,"begdate",t)},expression:"form.begdate"}})],1),a("el-form-item",{attrs:{label:"结束日期",prop:"enddate"}},[a("el-date-picker",{staticStyle:{width:"100%"},attrs:{type:"date","value-format":"yyyy-MM-dd",placeholder:"选择日期"},model:{value:e.form.enddate,callback:function(t){e.$set(e.form,"enddate",t)},expression:"form.enddate"}})],1)],1)],1),a("div",{staticClass:"fixed__btn__panel"},[a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small"},on:{click:function(t){e.drawer=!1}}},[e._v("取 消")]),a("el-button",{staticClass:"normal-btn-width",attrs:{size:"small",type:"primary"},on:{click:function(t){return e.submit()}}},[e._v("确 定")])],1)])],1)},r=[],s=(a(21703),a(98592)),i={props:["data"],inject:["campaigntypeList","status"],components:{selectLeader:s.Z},data(){return{drawer:!1,form:{sat_campaignid:0,name:"",director:"",address:"",type:"",begdate:"",enddate:""},rules:{name:[{required:!0,message:"请输入活动名称",trigger:"blur"}],type:[{required:!0,message:"请选择活动类型",trigger:"change"}],begdate:[{required:!0,message:"请选择开始日期",trigger:"change"}],enddate:[{validator:this.validateEndDate,trigger:"change"}]},options:[]}},methods:{onShow(){this.drawer=!0,this.form=Object.assign({},this.form,this.data)},selectLeader(e){console.log(e),this.form.director=e.name},validateEndDate(e,t,a){let n=new Date(this.form.begdate).getTime(),r=new Date(this.form.enddate).getTime();""!==t&&t?r<n?a(new Error("结束日期不能小于开始日期")):a():(this.form.enddate="",a())},restForm(){this.form={sat_campaignid:0,name:"",director:"",address:"",type:"",begdate:"",enddate:""}},submit(){this.$refs["form"].validate((async e=>{if(!e)return!1;const t=await this.$api.requested({classname:"webmanage.saletool.orderclue.ordercluecampaign",method:"insertormodify_campaign",content:this.form});this.tool.showMessage(t,(()=>{this.dialogFormVisible=!1,this.$refs.form.resetFields(),this.$emit("onSuccess"),this.restForm()}))}))}}},l=i,o=a(43736),d=(0,o.Z)(l,n,r,!1,null,"78b9990b",null),c=d.exports},98592:function(e,t,a){a.d(t,{Z:function(){return k}});var n=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",[e._t("input"),a("el-dialog",{attrs:{title:e.titleData,"append-to-body":"",visible:e.dialogTableVisible,width:"1200px"},on:{"update:visible":function(t){e.dialogTableVisible=t}}},[a("div",{staticClass:"flex"},[a("areaTree",{ref:"arealist",staticStyle:{width:"200px"},on:{onClick:e.onClick}}),a("div",[a("agent",{ref:"agent",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.selectAgent(t.data)}}},[e._v("选 择")])],1)]}}])})],1)],1)])],2)},r=[],s=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"tree-panel"},[a("el-tree",{ref:"treeRef",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.handleClick},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)},i=[],l={components:{},data(){return{deplist:[],departmentid:0,currentKey:null}},methods:{async department(e){const t=await this.$api.requested({classname:"webmanage.department.department",method:"querydepartment",content:{}});this.deplist=this.createMenu(t.data),this.$store.dispatch("setDeplistData",this.deplist),e&&e()},createMenu(e){let t=[];function a(e){var t={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"],sequence:e["sequence"],children:[]};if(e.subdep&&e.subdep.length>0)for(var n=0;n<e.subdep.length;n++)t.children.push(a(e.subdep[n]));return t}return e.forEach((e=>{t.push(a(e))})),t},handleClick(e,t,a){console.log(e),this.$emit("onClick",e)},setCurrentKey(e){this.currentKey=e,this.$nextTick((()=>{this.$refs["treeRef"].setCurrentKey(this.currentKey)}))}},watch:{},mounted(){this.department((()=>{this.$emit("onClick",{departmentid:this.deplist[0].departmentid}),this.setCurrentKey(this.deplist[0].departmentid)}))}},o=l,d=a(43736),c=(0,d.Z)(o,s,i,!1,null,"b1b7a7fe",null),u=c.exports,m=function(){var e=this,t=e.$createElement,a=e._self._c||t;return a("div",{staticClass:"container normal-panel"},[a("p",{staticClass:"normal-title normal-margin"},[e._v("人员信息")]),a("div",{staticClass:"flex-align-center flex-between normal-margin"},[a("el-input",{staticClass:"input-with-select",staticStyle:{width:"270px"},attrs:{clearable:"",placeholder:"请输入内容",size:"small",clearable:""},on:{clear:function(t){return e.query_agent(e.param.content.departmentids[0],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.query_agent(e.param.content.departmentids[0],e.param.content.pageNumber=1)}},model:{value:e.param.content.where.condition,callback:function(t){e.$set(e.param.content.where,"condition",t)},expression:"param.content.where.condition"}}),e._t("add")],2),a("tableLayout",{attrs:{layout:e.tablecols,data:e.list,custom:!0,height:"300px",fixedName:"operation"},scopedSlots:e._u([{key:"customcol",fn:function(t){return["status"===t.column.columnname?a("p",[a("span",{style:"启用"===t.column.data.status?"color:#52C41A":"color:#FF3B30"},[e._v(e._s(t.column.data.status))])]):"province"===t.column.columnname?a("p",[a("span",[e._v(e._s(t.column.data.province)+" - "+e._s(t.column.data.city)+" - "+e._s(t.column.data.county))])]):a("p",[e._v(e._s(t.column.data[t.column.columnname]))])]}},{key:"opreation",fn:function(t){return[e._t("detail",null,{data:t.data})]}}],null,!0)}),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)},p=[],h={props:["data"],data(){return{tablecols:[],list:[],total:0,currentPage:1,param:{id:"20221102090303",content:{pageSize:20,pageNumber:1,departmentids:[],containssub:1,where:{condition:""}}}}},methods:{async query_agent(e){this.param.content.departmentids=[e];const t=await this.$api.requested(this.param);this.list=t.data,this.total=t.total,this.currentPage=t.pageNumber},handleSizeChange(e){this.param.content.pageSize=e,this.query_agent(this.param.content.departmentids[0])},handleCurrentChange(e){this.param.content.pageNumber=e,this.query_agent(this.param.content.departmentids[0])}},mounted(){},created(){this.tablecols=this.tool.tabelCol(this.$route.name)["peopleTable"].tablecols}},f=h,g=(0,d.Z)(f,m,p,!1,null,"e3d6ba02",null),b=g.exports,y={props:["title"],components:{areaTree:u,agent:b},data(){return{dialogTableVisible:!1,placeholder:"选择经销商",areaInfo:{},titleData:"选择人员",value:{enterprisename:"",parentid:""}}},methods:{onShow(){""!==this.title&&(this.titleData=this.title)},onClick(e){this.areaInfo=e,this.$refs.agent.query_agent(this.areaInfo.departmentid)},onSuccess(){this.$refs.arealist.query_arealist()},selectAgent(e){console.log(e),this.value=e,this.$emit("selectLeader",e),this.dialogTableVisible=!1},onSalerSuccess(){this.$refs.saler.query_saler(this.areaInfo.sa_saleareaid)}},mounted(){""!==this.title&&(this.placeholder=this.title)}},v=y,_=(0,d.Z)(v,n,r,!1,null,"702afb33",null),k=_.exports}}]);
|