1
0

chunk-7772af67.e10ba149.js 8.3 KB

1
  1. (window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["chunk-7772af67"],{"09fe":function(e,t,i){},"1e7e":function(e,t,i){"use strict";i.r(t);var s=function(){var e=this,t=e._self._c;return t("div",{ref:"contentData",staticClass:"addcustomer",class:e.isScroll?"disabledScroll":"scrollBox"},[t("addcrmmsg",{ref:"addcrmmsg",attrs:{cid:e.cid,customertype:e.customertype}}),t("button",{staticClass:"footbox fontfpr colorfff font28 relative zindex999",on:{click:e.sureditap}},[e._v("确定报备")]),t("xqloading",{directives:[{name:"show",rawName:"v-show",value:e.loadFlag,expression:"loadFlag"}]})],1)},r=[],a=(i("e17f"),i("2241")),o=(i("14d9"),i("51fe")),n=i("11fe"),d=i("5880"),c={name:"",data(){return{cid:"",customertype:0,crminfo:"",loadFlag:!0}},components:{addcrmmsg:o["a"],[a["a"].name]:a["a"]},computed:{...Object(d["mapState"])({isScroll:e=>e.isScroll})},created(){var e=this.utils.getQueryStringArgs(window.location.href);if("browser"==this.$store.state.platform){var t=CryptoJS.AES.decrypt(unescape(this.$route.query.cid),CryptoJS.enc.Utf8.parse(this.$store.state.PUBLIC_KEY),{mode:CryptoJS.mode.ECB,padding:CryptoJS.pad.Pkcs7}).toString(CryptoJS.enc.Utf8);this.cid=t.split("_")[0]}else e.cid&&(this.cid=e.cid);e.type&&(this.customertype=e.type)},methods:{checkParamsState(){let e=this,t=!0,i=this.$refs.addcrmmsg.crmvalarr,s=this.$refs.addcrmmsg.extarr;for(let r in i)for(let a=0;a<i[r].child.length;a++){if("name"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must&&!e.$refs.addcrmmsg.personame)return this.$toast(i[r].child[a].name+"必填!"),t=!1,!1;if("sex"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must&&!this.$refs.addcrmmsg.sex)return this.$toast(i[r].child[a].name+"必填!"),t=!1,!1;if("level"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must&&!e.$refs.addcrmmsg.level)return this.$toast(i[r].child[a].name+"必填!"),t=!1,!1;if("source_id"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must&&!e.$refs.addcrmmsg.source)return this.$toast(i[r].child[a].name+"必填!"),t=!1,!1;if("house_delivery_time"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must){let e="";if(Object.keys(s).forEach(t=>{"house_type"==s[t].keyname&&(e=s[t].keytext)}),"期房"==e&&!s[i[r].child[a].id].value)return this.$toast(i[r].child[a].name+"必填!"),!1}else if("live_broadcast_business"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must){let e="";if(Object.keys(s).forEach(t=>{"live_broadcast"==s[t].keyname&&(e=s[t].keytext.filter(e=>"1对1业务直播"==e))}),e.length&&!s[i[r].child[a].id].value)return this.$toast(i[r].child[a].name+"必填!"),!1}else if("live_broadcast_design"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must){let e="";if(Object.keys(s).forEach(t=>{"live_broadcast"==s[t].keyname&&(e=s[t].keytext.filter(e=>"1对1设计直播"==e))}),e.length&&!s[i[r].child[a].id].value)return this.$toast(i[r].child[a].name+"必填!"),!1}else if("live_broadcast_personnel"==i[r].child[a].keyname&&0==i[r].child[a].status&&0==i[r].child[a].is_must){let e="";if(Object.keys(s).forEach(t=>{"live_broadcast"==s[t].keyname&&(e=s[t].keytext.filter(e=>"一对多直播"==e))}),e.length&&!s[i[r].child[a].id].value)return this.$toast(i[r].child[a].name+"必填!"),!1}else if(0==i[r].child[a].status&&0==i[r].child[a].is_must&&s[i[r].child[a].id]&&(Array.isArray(s[i[r].child[a].id].value)&&!s[i[r].child[a].id].value.length||!s[i[r].child[a].id].value))return this.$toast(i[r].child[a].name+"必填!"),t=!1,!1}return t},sureditap(){const e=this;if(!e.$refs.addcrmmsg.phonenum)return e.$toast("客户手机号不能为空!"),!1;let t=this.checkParamsState();t&&a["a"].confirm({title:"客户报备确认",message:"您确定进行客户报备吗",confirmButtonColor:"#28A1FF",confirmButtonText:"确定",cancelButtonText:"再想想"}).then(()=>{e.loadFlag=!0,e.editcustomermsg()}).catch(()=>{})},extfun(){const e=this;let t,i=[],s=this.$refs.addcrmmsg.extarr;for(let r in s){let e;"1"==s[r].type||"2"==s[r].type||"5"==s[r].type||"3"==s[r].type?e="live_broadcast_personnel"==s[r].keyname?{id:r,keyname:s[r].keyname,type:s[r].type,value:Array.isArray(s[r].value)?s[r].value.join(","):s[r].value?s[r].value:""}:{id:r,keyname:s[r].keyname,value:s[r].value,type:s[r].type}:"4"==s[r].type?e={id:r,keyname:s[r].keyname,value:s[r].value?s[r].value.join(","):"",type:s[r].type}:"6"==s[r].type&&(e={id:r,keyname:s[r].keyname,type:s[r].type,value:s[r].value.length?s[r].value.map(e=>({serverId:e.serverId||"",img:e.url||""})):""}),i.push(e)}t={id:this.cid,ext:i.filter(e=>e.id)},Object(n["o"])(t).then(t=>{e.loadFlag=!1,0==t.data.code&&(e.$toast("保存成功!"),setTimeout(()=>{e.$router.go(-1)},1500))})},editcustomermsg:function(){const e=this;let t={clue_id:2==e.customertype?e.cid:"",id:2!=e.customertype?e.cid:"",name:e.$refs.addcrmmsg.personame,phone:e.$refs.addcrmmsg.phonenum,phone1:e.$refs.addcrmmsg.phonenum1,phone2:e.$refs.addcrmmsg.phonenum2,sex:"男"==this.$refs.addcrmmsg.sex?1:"女"==this.$refs.addcrmmsg.sex?2:"",level:e.$refs.addcrmmsg.level,source_id:e.$refs.addcrmmsg.source};Object(n["b"])(t).then(t=>{0==t.data.code?(this.cid=t.data.data,this.extfun()):(e.loadFlag=!1,3==t.data.code&&a["a"].confirm({title:"客户报备提示",message:"您报备的客户已经存在于公海池,是否直接获取该客户",confirmButtonText:"获取"}).then(()=>{this.transferfun(t.data.data)}).catch(()=>{}))})},transferfun(e){let t=this,i={customer_id:e};Object(n["z"])(i).then(e=>{0==e.data.code&&(t.$toast("获取成功!"),setTimeout(()=>{t.$router.go(-1)},1500))})}},mounted(){var e=this.utils.getQueryStringArgs(window.location.href);2==this.customertype?(this.$refs.addcrmmsg.clueDetailfun(),e.phone&&(this.$refs.addcrmmsg.phonenum=e.phone?e.phone:"")):1==this.customertype&&this.$refs.addcrmmsg.customerfun(),this.$refs.addcrmmsg.fieldfun(),setTimeout(()=>{this.loadFlag=!1},1500)}},l=c,h=(i("21ed"),i("2877")),m=Object(h["a"])(l,s,r,!1,null,"dfa0ef50",null);t["default"]=m.exports},"21ed":function(e,t,i){"use strict";i("7a9b")},"44bf":function(e,t,i){"use strict";var s=i("2638"),r=i.n(s),a=i("d282"),o=i("a142"),n=i("ea8e"),d=i("ad06"),c=Object(a["a"])("image"),l=c[0],h=c[1];t["a"]=l({props:{src:String,fit:String,alt:String,round:Boolean,width:[Number,String],height:[Number,String],radius:[Number,String],lazyLoad:Boolean,iconPrefix:String,showError:{type:Boolean,default:!0},showLoading:{type:Boolean,default:!0},errorIcon:{type:String,default:"photo-fail"},loadingIcon:{type:String,default:"photo"}},data:function(){return{loading:!0,error:!1}},watch:{src:function(){this.loading=!0,this.error=!1}},computed:{style:function(){var e={};return Object(o["c"])(this.width)&&(e.width=Object(n["a"])(this.width)),Object(o["c"])(this.height)&&(e.height=Object(n["a"])(this.height)),Object(o["c"])(this.radius)&&(e.overflow="hidden",e.borderRadius=Object(n["a"])(this.radius)),e}},created:function(){var e=this.$Lazyload;e&&o["b"]&&(e.$on("loaded",this.onLazyLoaded),e.$on("error",this.onLazyLoadError))},beforeDestroy:function(){var e=this.$Lazyload;e&&(e.$off("loaded",this.onLazyLoaded),e.$off("error",this.onLazyLoadError))},methods:{onLoad:function(e){this.loading=!1,this.$emit("load",e)},onLazyLoaded:function(e){var t=e.el;t===this.$refs.image&&this.loading&&this.onLoad()},onLazyLoadError:function(e){var t=e.el;t!==this.$refs.image||this.error||this.onError()},onError:function(e){this.error=!0,this.loading=!1,this.$emit("error",e)},onClick:function(e){this.$emit("click",e)},genPlaceholder:function(){var e=this.$createElement;return this.loading&&this.showLoading?e("div",{class:h("loading")},[this.slots("loading")||e(d["a"],{attrs:{name:this.loadingIcon,classPrefix:this.iconPrefix},class:h("loading-icon")})]):this.error&&this.showError?e("div",{class:h("error")},[this.slots("error")||e(d["a"],{attrs:{name:this.errorIcon,classPrefix:this.iconPrefix},class:h("error-icon")})]):void 0},genImage:function(){var e=this.$createElement,t={class:h("img"),attrs:{alt:this.alt},style:{objectFit:this.fit}};if(!this.error)return this.lazyLoad?e("img",r()([{ref:"image",directives:[{name:"lazy",value:this.src}]},t])):e("img",r()([{attrs:{src:this.src},on:{load:this.onLoad,error:this.onError}},t]))}},render:function(){var e=arguments[0];return e("div",{class:h({round:this.round}),style:this.style,on:{click:this.onClick}},[this.genImage(),this.genPlaceholder(),this.slots()])}})},"7a9b":function(e,t,i){}}]);