(window["webpackJsonp"]=window["webpackJsonp"]||[]).push([["pages-index-groupCompany-subsidiary-newSubsidiary-newSubsidiary"],{"0446":function(e,t,n){var i=n("5c6a");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=n("967d").default;a("57a030ba",i,!0,{sourceMap:!1,shadowMode:!1})},"046f":function(e,t,n){var i=n("a309");i.__esModule&&(i=i.default),"string"===typeof i&&(i=[[e.i,i,""]]),i.locals&&(e.exports=i.locals);var a=n("967d").default;a("7116c6dc",i,!0,{sourceMap:!1,shadowMode:!1})},"30f7":function(e,t,n){"use strict";n("6a54"),Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},n("7a76"),n("c9b5")},3221:function(e,t,n){"use strict";var i=n("0446"),a=n.n(i);a.a},3370:function(e,t,n){"use strict";n("6a54");var i=n("f5bd").default;Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var a=i(n("39d8")),o=i(n("b7c7"));n("bf0f"),n("2797"),n("c223"),n("dd2b"),n("aa9c"),n("4626"),n("5ac7");var r,s=n("2632"),c=n("af8c"),l=i(n("9c8b")),u=n("f426"),d=n("efcd"),f=n("391e"),m=n("3a07"),v={mixins:[d.pageJumps],components:{formItem:l.default},data:function(){return{BASE_IMG_URL:m.BASE_IMG_URL,noClick:!0,name:"",subname:"",industry:"",level:"",source:"",follow:"",address_dingwei:"",address_detail:"",lng:"",lat:"",parent_id:"",parentList:[],plist:[],parentIndex:null,parentName:"",is_event:!0,event_start_time:"",event_title:"",remindtype:"",remindList:["准时提醒","5分钟前","15分钟前","30分钟前","一个小时前","两个小时前","一天前","两天前","一周前"],remindIndex:null,location:"",is_contacts:!0,is_record:1,followList:[],follow_type:null,followIndex:null,next_time:"",uploadShow:!1,uploadActions:[{id:1,text:"拍照",color:"#008EFF"},{id:2,text:"从相册中选择",color:"#008EFF"}],imgList:[],fileList:[],content:"",DefaultRemind:[],remindPeople:[],sourceList:[],sourceIndex:null,listForm:[],firstContactForm:[],dateTimeArray:[],dateArr:[],dateTime:[],countryType:1}},onLoad:function(e){this.parent_id=e.id,this.getSelectlist(),this.getPrevCoustomer(),this.listForm=[],this.firstContactForm=[],this.getForm(),this.getFirstContactform(),this.initTime()},onShow:function(){this.remindPeople=[],this.getDefaultRemind()},onUnload:function(){uni.removeStorageSync("remindlist")},methods:(r={moreClick:function(){uni.navigateTo({url:"/pagesA/crm/selectMember/selectMember"})},getDefaultRemind:function(){var e=this;(0,c.netStaffDefaultReviewer)({type:"record"}).then((function(t){t=t.data,t.forEach((function(e,t){e.isDel=!1})),e.DefaultRemind=t,e.remindPeople=e.$deWeight([].concat((0,o.default)(t),(0,o.default)(uni.getStorageSync("remindlist"))))}))},delRemind:function(e){this.remindPeople.splice(e,1),uni.setStorageSync("remindlist",this.remindPeople)},getForm:function(){var e=this;(0,c.netSetForm)({type:"customer"}).then((function(t){t=t.data.data,t.forEach((function(e,n){"name"==e.id&&t.splice(n,1),e.value=e.value?e.value:""})),e.listForm=t}))},changeData:function(e,t,n){var i=this,a=this.listForm;a.forEach((function(e,a){e.id==n.id&&(e.value=t,i.$set(i.listForm,a,e))}))},getFirstContactform:function(){var e=this;(0,c.netSetForm)({type:"contacts"}).then((function(t){t=t.data.data,t.forEach((function(e){e.value=e.value?e.value:""})),e.firstContactForm=t,e.changeCountry(e.countryType)}))},changeCountry:function(e){this.countryType=e;var t=this.firstContactForm;1==e?t.forEach((function(e,t){"mobile"==e.id&&(e.config.required=!0),"email"==e.id&&(e.config.required=!1)})):t.forEach((function(e,t){"mobile"==e.id&&(e.config.required=!0),"email"==e.id&&(e.config.required=!0)})),this.firstContactForm=t},changeContactData:function(e,t,n){var i=this,a=this.firstContactForm;a.forEach((function(e,a){e.id==n.id&&(e.value=t,i.$set(i.firstContactForm,a,e))}))},getPrevCoustomer:function(){var e=this;(0,f.netPrevCustomer)().then((function(t){e.parentList=t.data,e.handleData(t.data),e.parent_id?(e.handleParent(),e.parentDisabled=!0):e.parentDisabled=!1}))},handleData:function(e){var t=[];e.forEach((function(e){t.push(e.name)})),this.plist=t},handleParent:function(){var e=this,t=this.parent_id;this.parentList.forEach((function(n,i){n.id==t&&(e.parentIndex=i,e.parentName=n.name)}))},getSelectlist:function(){var e=this;(0,f.netSelect)().then((function(t){e.followList=t.data["跟进类型"],e.sourceList=t.data["客户来源"]}))},changeFollow:function(e){this.followIndex=e.detail.value,this.follow_type=this.followList[e.detail.value]},changeTime:function(e){var t=e.detail.value,n=this.handleTime(t);this.next_time=n},changeAlipayTime:function(e){this.next_time=e.detail.value},handleTime:function(e){var t=this.dateArr[0][e[0]],n=this.dateArr[1][e[1]],i=this.dateArr[2][e[2]],a=this.dateArr[3][e[3]],o=this.dateArr[4][e[4]],r=t+"-"+n+"-"+i+" "+a+":"+o;return r},uploadClick:function(){this.uploadShow=!0},onCancel:function(){this.uploadShow=!1},uploadType:function(e){var t=this;0==e?uni.chooseImage({sourceType:["camera"],sizeType:["compressed"],success:function(e){var n=e.tempFilePaths;n.forEach((function(e){t.uploadFile(e,1)}))}}):1==e?uni.chooseImage({sourceType:["album"],sizeType:["compressed"],success:function(e){var n=e.tempFilePaths;n.forEach((function(e){t.uploadFile(e,1)}))}}):wx.chooseMessageFile({count:1,type:"file",success:function(e){console.log(e);var n=e.tempFiles[0];t.uploadFile(n,2)},fail:function(e){console.log(e)}})},uploadFile:function(e,t){var n=this;uni.uploadFile({url:c.uploadUrl,name:"file",header:{token:uni.getStorageSync("token")},filePath:1==t?e:e.path,success:function(i){var a=JSON.parse(i.data);if(n.uploadShow=!1,1==a.code)if(1==t){var o={id:a.data.id,file_path:a.data.url};n.imgList.push(o)}else{var r={id:a.data.id,file_path:a.data.url};e=Object.assign({},e,r),n.fileList.push(e)}else uni.showToast({title:"上传失败",icon:"none"})},fail:function(e){console.log(e)}})},delImg:function(e){this.imgList.splice(e,1)},delFile:function(e){this.fileList.splice(e,1)},changeContent:function(e){this.content=e.detail.value},checkName:function(){var e=this.name;e?(0,f.netCheckName)({name:e}).then((function(e){uni.showToast({title:e.msg,icon:"none",duration:2e3})})):uni.showToast({title:"请填写客户姓名",icon:"none",duration:2e3})},changeParent:function(e){this.parentIndex=e.detail.value,this.parentName=this.parentList[e.detail.value].name,this.parent_id=this.parentList[e.detail.value].id},changeSwitch:function(){this.is_event=!this.is_event},initTime:function(){var e=new Date,t=e.getFullYear(),n=(0,s.dateTimePicker)(this.startYear,t);n.dateTimeArray.pop(),n.dateTime.pop(),n.dateArray.pop();this.dateTimeArray=n.dateTimeArray,this.dateArr=n.dateArray,this.dateTime=n.dateTime},changeFollowTime:function(e){var t=e.detail.value;if(t.includes(-1))uni.showToast({title:"请选择正确的时间",icon:"none"});else{var n=this.handleTime(t);this.event_start_time=n}}},(0,a.default)(r,"handleTime",(function(e){var t=this.dateArr[0][e[0]],n=this.dateArr[1][e[1]],i=this.dateArr[2][e[2]],a=this.dateArr[3][e[3]],o=this.dateArr[4][e[4]],r=t+"-"+n+"-"+i+" "+a+":"+o;return r})),(0,a.default)(r,"changeRemind",(function(e){this.remindIndex=e.detail.value,this.remindtype=this.remindList[e.detail.value]})),(0,a.default)(r,"detailAddClick",(function(){var e=this;uni.chooseLocation({success:function(t){e.lat=t.latitude,e.lng=t.longitude,e.address_detail=t.name,e.address_dingwei=t.address},fail:function(e){"chooseLocation:fail auth deny"==e.errMsg&&uni.showToast({title:"请允许使用位置信息",icon:"none"})}})})),(0,a.default)(r,"subSave",(function(){var e=this.name,t=(this.location,this.address_dingwei),n=this.address_detail,i=this.lng,a=this.lat,o=this.parent_id,r=(this.is_event,this.event_start_time,this.event_title,this.remindtype,this.is_contacts),s=this.is_record,c=this.follow_type,l=this.next_time,d=this.imgList,m=this.fileList,v=this.content,h=this.remindPeople;if(e)if(i&&a){var p={is_contacts:r?1:0,is_record:s},g=[],_={};this.listForm.forEach((function(e){g.push({name:e.id,required:e.config.required,msg:e.config.placeholder,value:e.value})}));for(var b=0;b