1 line
6.8 KiB
JavaScript
1 line
6.8 KiB
JavaScript
require('../../../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/crm/customerManagement/newFllow/newFllow"],{"33c9":function(e,t,i){"use strict";i.r(t);var n=i("ee38"),o=i.n(n);for(var a in n)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return n[e]}))}(a);t["default"]=o.a},a396:function(e,t,i){"use strict";var n=i("fac2"),o=i.n(n);o.a},a5be:function(e,t,i){"use strict";(function(e,t){var n=i("4ea4");i("8886");n(i("66fd"));var o=n(i("d2a8"));e.__webpack_require_UNI_MP_PLUGIN__=i,t(o.default)}).call(this,i("bc2e")["default"],i("543d")["createPage"])},be21:function(e,t,i){"use strict";i.d(t,"b",(function(){return o})),i.d(t,"c",(function(){return a})),i.d(t,"a",(function(){return n}));var n={uActionSheet:function(){return i.e("uview-ui/components/u-action-sheet/u-action-sheet").then(i.bind(null,"b13b"))}},o=function(){var e=this.$createElement,t=(this._self._c,this.imgList.length),i=this.fileList.length;this.$mp.data=Object.assign({},{$root:{g0:t,g1:i}})},a=[]},d2a8:function(e,t,i){"use strict";i.r(t);var n=i("be21"),o=i("33c9");for(var a in o)["default"].indexOf(a)<0&&function(e){i.d(t,e,(function(){return o[e]}))}(a);i("a396");var l=i("f0c5"),s=Object(l["a"])(o["default"],n["b"],n["c"],!1,null,null,null,!1,n["a"],void 0);t["default"]=s.exports},ee38:function(e,t,i){"use strict";(function(e,n){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var o=i("6924"),a=i("dc92"),l=i("76dd"),s=i("0c59"),c=i("c7eb"),u=i("8683"),r={mixins:[o.pageJumps,u.commonF],components:{selectCustomer:function(){Promise.all([i.e("common/vendor"),i.e("components/selectCustomer")]).then(function(){return resolve(i("5bcd"))}.bind(null,i)).catch(i.oe)}},data:function(){return{BASE_IMG_URL:s.BASE_IMG_URL,noClick:!0,checked:!0,uploadShow:!1,uploadActions:[{id:1,text:"拍照",color:"#03aa96"},{id:2,text:"从相册中选择",color:"#03aa96"},{id:3,text:"上传文件",color:"#03aa96"}],followList:[123,465],followIndex:null,kehuList:[],kehu:[],kehuIndex:null,contactList:[],concatIndex:null,statusList:[],statusIndex:null,remindList:["准时提醒","5分钟前","15分钟前","30分钟前","一个小时前","两个小时前","一天前","两天前","一周前"],remindIndex:null,imgList:[],fileList:[],follow_type:"",dateTime:null,dateTimeArray:null,dateArr:null,follow_time:"",next_time:"",content:"",relation_id:"",relationName:"",relation_type:"",follow:"",DefaultRemind:[],remindPeople:[],remindType:"record",is_event:!1,start_time:"",title:"",isRequired:!1}},onLoad:function(e){this.relation_id=e.id,this.relation_type=e.type,this.getKehulist(),this.initTime(),this.getSelectList()},methods:{changeRequired:function(e){this.isRequired=e.detail.value},sureSelect:function(e){this.relation_id=e.id,this.relationName=e.name},getSelectList:function(){var e=this;(0,l.netSelect)().then((function(t){e.followList=t.data["跟进类型"],e.statusList=t.data["客户状态"]}))},initTime:function(){var e=(0,c.dateTimePicker)();e.dateTimeArray.pop(),e.dateTime.pop(),e.dateArray.pop();this.dateTimeArray=e.dateTimeArray,this.dateTime=e.dateTime,this.dateArr=e.dateArray},getKehulist:function(){var e=this;(0,l.netPrevCustomer)().then((function(t){e.kehu=t.data,e.handleKehu(t.data)}))},handleKehu:function(e){var t=[];e.forEach((function(e){t.push(e.name)})),this.kehuList=t,this.setDefaultKehu()},setDefaultKehu:function(){var e=this,t=this.relation_id;this.kehu.forEach((function(i,n){i.id==t&&(e.relationName=i.name,e.kehuIndex=n)}))},changeFollow:function(e){this.followIndex=e.detail.value,this.follow_type=this.followList[e.detail.value]},changeTime:function(e){var t=e.detail.value,i=this.handleTime(t);this.next_time=i},changeAlipayTime:function(e){this.next_time=e.detail.value},handleTime:function(e){var t=this.dateArr[0][e[0]],i=this.dateArr[1][e[1]],n=this.dateArr[2][e[2]],o=this.dateArr[3][e[3]],a=this.dateArr[4][e[4]],l=t+"-"+i+"-"+n+" "+o+":"+a;return l},change:function(){this.checked=!this.checked},uploadClick:function(){this.uploadShow=!0},onCancel:function(){this.uploadShow=!1},changeContent:function(e){this.content=e.detail.value},uploadType:function(t){var i=this;0==t?e.chooseImage({sourceType:["camera"],sizeType:["compressed"],success:function(e){var t=e.tempFilePaths;t.forEach((function(e){i.uploadFile(e,1)}))}}):1==t?e.chooseImage({sourceType:["album"],sizeType:["compressed"],success:function(e){var t=e.tempFilePaths;t.forEach((function(e){i.uploadFile(e,1)}))}}):n.chooseMessageFile({count:1,type:"file",success:function(e){var t=e.tempFiles[0];i.uploadFile(t,2)},fail:function(e){console.log(e)}})},uploadFile:function(t,i){var n=this;console.log(t,"和王菲那英"),e.uploadFile({url:a.uploadUrl,name:"file",header:{token:e.getStorageSync("token")},filePath:1==i?t:t.path,formData:{name:2==i?t.name:""},success:function(o){var a=JSON.parse(o.data);if(n.uploadShow=!1,1==a.code)if(1==i){var l={id:a.data.id,file_path:a.data.url};n.imgList.push(l)}else{var s={id:a.data.id,file_path:a.data.url};t=Object.assign({},t,s),n.fileList.push(t)}else e.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)},changeKehu:function(){this.$refs.customerChild.init()},changeStatus:function(e){this.statusIndex=e.detail.value,this.follow=this.statusList[e.detail.value]},changeEvent:function(){this.is_event=!this.is_event},changeFollowTime:function(e){this.start_time=e.detail.value[0]+"/"+e.detail.value[1]+"/"+e.detail.value[2]},saveFollow:function(){console.log("保存");var t=this.imgList,i=this.fileList,n=this.follow_type,o=this.next_time,a=this.content,s=this.relation_id,c=(this.relationName,this.relation_type),u=this.follow,r=this.remindPeople;if(n)if(o)if(a)if(s)if(1!=c||u){var d,h=[];t.forEach((function(e){h.push(e.id)})),i.forEach((function(e){h.push(e.id)})),console.log(t,i,"文件"),d=h.join(",");var f,m=[];r.forEach((function(e){m.push(e.id)})),f=m.join(",");var p={};console.log(c,"类型"),p=1==c||3==c?{files:d,follow_type:n,next_time:o,content:a,relation_id:s,relation_type:c,follow:u,reminds_id:f}:{files:d,follow_type:n,next_time:o,content:a,relation_id:s,relation_type:c,reminds_id:f},(0,l.netAddFollowRecords)(p).then((function(t){e.showToast({title:t.msg,icon:"none",duration:2e3}),setTimeout((function(){e.navigateBack({delta:1})}),2e3)}))}else e.showToast({title:"请选择客户状态",icon:"none",duration:2e3});else e.showToast({title:"请选择客户名称",icon:"none",duration:2e3});else e.showToast({title:"请填写跟进内容",icon:"none",duration:2e3});else e.showToast({title:"请选择跟进时间",icon:"none",duration:2e3});else e.showToast({title:"请选择跟进类型",icon:"none",duration:2e3})}}};t.default=r}).call(this,i("543d")["default"],i("bc2e")["default"])},fac2:function(e,t,i){}},[["a5be","common/runtime","common/vendor","pagesA/common/vendor"]]]); |