require('../common/vendor.js');(global["webpackJsonp"]=global["webpackJsonp"]||[]).push([["pagesA/signin/busSign"],{"208d":function(t,e,n){"use strict";n.r(e);var o=n("eaf0"),i=n.n(o);for(var r in o)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return o[t]}))}(r);e["default"]=i.a},6173:function(t,e,n){"use strict";(function(t,e){var o=n("4ea4");n("8886");o(n("66fd"));var i=o(n("acf5"));t.__webpack_require_UNI_MP_PLUGIN__=n,e(i.default)}).call(this,n("bc2e")["default"],n("543d")["createPage"])},"70bc":function(t,e,n){"use strict";n.d(e,"b",(function(){return o})),n.d(e,"c",(function(){return i})),n.d(e,"a",(function(){}));var o=function(){var t=this.$createElement;this._self._c},i=[]},8286:function(t,e,n){"use strict";var o=n("9265"),i=n.n(o);i.a},"847e":function(t,e,n){"use strict";var o=n("aa7f"),i=n.n(o);i.a},9265:function(t,e,n){},aa7f:function(t,e,n){},acf5:function(t,e,n){"use strict";n.r(e);var o=n("70bc"),i=n("208d");for(var r in i)["default"].indexOf(r)<0&&function(t){n.d(e,t,(function(){return i[t]}))}(r);n("8286"),n("847e");var u=n("f0c5"),c=Object(u["a"])(i["default"],o["b"],o["c"],!1,null,"116cc51a",null,!1,o["a"],void 0);e["default"]=c.exports},eaf0:function(t,e,n){"use strict";(function(t){var o=n("4ea4");Object.defineProperty(e,"__esModule",{value:!0}),e.default=void 0;var i,r,u=o(n("9523")),c=n("f785"),a=n("dc92"),s=n("76dd"),l=n("0c59");function d(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),n.push.apply(n,o)}return n}var f={components:{formItem:function(){Promise.all([n.e("common/vendor"),n.e("components/form/formitem")]).then(function(){return resolve(n("d7bf"))}.bind(null,n)).catch(n.oe)},selectCustomer:function(){Promise.all([n.e("common/vendor"),n.e("components/selectCustomer")]).then(function(){return resolve(n("5bcd"))}.bind(null,n)).catch(n.oe)}},data:function(){return{noClick:!0,longitude:null,latitude:null,markers:[],address:"",kehuList:[],kehuIndex:null,kehuName:"",BASE_IMG_URL:l.BASE_IMG_URL,location:"",lng:"",lat:"",files:"",customer_id:"",defaultCustomer:!1,listForm:[],customerObj:{},mapKey:""}},onLoad:function(t){this.getKey(),t.customerid&&(this.customer_id=t.customerid,this.defaultCustomer=!0,this.getKehulist()),this.getForm()},methods:{getForm:function(){var t=this;(0,a.netSetForm)({type:"signin"}).then((function(e){e=e.data.data,e.forEach((function(t){t.value=""})),t.listForm=e}))},changeOtherData:function(t,e,n){var o=this,i=this.listForm;i.forEach((function(t,i){t.id==n.id&&(t.value=e,o.$set(o.listForm,i,t))}))},getKey:function(){var e=this;(0,c.netMapKey)().then((function(o){o.data.map_key?(e.mapKey=o.data.map_key,i=n("cb23"),r=new i({key:o.data.map_key}),e.getAddressinfo()):t.showToast({title:"请在后台配置地图key",icon:"none"})}))},handleCustomer:function(){var t=this,e=this.customer_id,n=this.kehuList;n.forEach((function(n,o){n.id==e&&(t.customerObj=n)}))},getKehulist:function(){var t=this;(0,s.netPrevCustomer)({name:this.kehuName}).then((function(e){t.kehuList=e.data,t.defaultCustomer&&t.handleCustomer()}))},toSelectCustomer:function(){this.$refs.customerChild.init()},getCustomerinfo:function(t){this.customerObj=t},getAddressinfo:function(){var e=this;t.getLocation({type:"gcj02",success:function(t){e.longitude=t.longitude,e.latitude=t.latitude,e.markers=[{id:1,latitude:t.latitude,longitude:t.longitude,iconPath:l.BASE_IMG_URL+"weizhi.png",width:30,height:30}],r.reverseGeocoder({location:{longitude:t.longitude,latitude:t.latitude},success:function(t){e.address=t.result.address}})},fail:function(t){console.log(t,"错误")}})},toAdd:function(){var e=this.longitude,n=this.latitude,o=this.address;if(this.customerObj.id){var i=this.checkCommonForm(this.listForm);if(i){var r=function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?d(Object(n),!0).forEach((function(e){(0,u.default)(t,e,n[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):d(Object(n)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))}))}return t}({location:o,lng:e,lat:n,customer_id:this.customerObj.id},i);(0,a.netAddSignin)(r).then((function(e){t.showToast({title:e.msg,icon:"none"}),setTimeout((function(){t.navigateBack({delta:1})}),2e3)}))}}else t.showToast({title:"请选择拜访客户",icon:"none"})}}};e.default=f}).call(this,n("543d")["default"])}},[["6173","common/runtime","common/vendor"]]]);