You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
1 lines
41 KiB
1 lines
41 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([["chunk-0fa6d8e8"],{"0fc4":function(t,e,r){"use strict";r.d(e,"a",(function(){return n})),r.d(e,"c",(function(){return a})),r.d(e,"b",(function(){return i}));var o=r("b6bd");function n(){return Object(o.a)({url:"erp/config",method:"get"})}function a(t){return Object(o.a)({url:"store/erp/shop",method:"get",params:t})}function i(t){return Object(o.a)({url:"product/import_erp_product",method:"post",data:t})}},"1d5b":function(t,e,r){"use strict";r.r(e);var o=r("c276"),n=r("d708"),a=r("c4ad"),i=r("73f5"),s=r("0fc4"),c=r("2f62"),l=r("b0e7");function u(t){return(u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function d(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function m(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?d(Object(r),!0).forEach((function(e){f(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):d(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function f(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=u(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=u(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==u(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var p={name:"erpList",data:function(){var t=this;return{loading:!1,currentid:0,columns1:[{width:60,align:"center",render:function(e,r){var o=r.row.shop_id,n=!1;n=t.currentid===o;var a=t;return e("div",[e("Radio",{props:{value:n,disabled:!o},on:{"on-change":function(){a.currentid=o,t.$emit("getProductId",o)}}})])}},{title:"ID",key:"shop_id",width:120},{title:"店铺名称",key:"shop_name",minWidth:100}],erpFrom:{page:1,limit:1},list:[],disabledB:!0,disabledF:!1}},computed:m(m({},Object(c.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:96},labelPosition:function(){return this.isMobile?"top":"right"}}),created:function(){this.getList()},methods:{back:function(){this.erpFrom.page=this.erpFrom.page-1,this.getList()},forward:function(){this.erpFrom.page=this.erpFrom.page+1,this.getList()},getList:function(){var t=this;this.loading=!0,Object(s.c)(this.erpFrom).then((function(e){var r=e.data;t.list=r,t.erpFrom.page>1?t.disabledB=!1:t.disabledB=!0,r.length<t.erpFrom.limit?t.disabledF=!0:t.disabledF=!1,t.loading=!1})).catch((function(e){t.loading=!1,t.$Message.error(e.msg)}))},pageChange:function(t){this.specsFrom.page=t,this.getList()}}},h=r("2877"),g=Object(h.a)(p,(function(){var t=this._self._c;return t("div",[t("Table",{ref:"table",staticClass:"mt25",attrs:{columns:this.columns1,data:this.list,loading:this.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"}}),t("div",{staticClass:"acea-row row-right page"},[t("Button",{attrs:{icon:"ios-arrow-back",disabled:this.disabledB},on:{click:this.back}}),t("Button",{staticClass:"ml10",attrs:{icon:"ios-arrow-forward",disabled:this.disabledF},on:{click:this.forward}})],1)],1)}),[],!1,null,null,null).exports,b=r("c7fc");function v(t){return(v="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function _(){/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */_=function(){return e};var t,e={},r=Object.prototype,o=r.hasOwnProperty,n=Object.defineProperty||function(t,e,r){t[e]=r.value},a="function"==typeof Symbol?Symbol:{},i=a.iterator||"@@iterator",s=a.asyncIterator||"@@asyncIterator",c=a.toStringTag||"@@toStringTag";function l(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{l({},"")}catch(t){l=function(t,e,r){return t[e]=r}}function u(t,e,r,o){var a=e&&e.prototype instanceof b?e:b,i=Object.create(a.prototype),s=new E(o||[]);return n(i,"_invoke",{value:L(t,r,s)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(t){return{type:"throw",arg:t}}}e.wrap=u;var m="suspendedStart",f="suspendedYield",p="executing",h="completed",g={};function b(){}function y(){}function w(){}var I={};l(I,i,(function(){return this}));var C=Object.getPrototypeOf,O=C&&C(C($([])));O&&O!==r&&o.call(O,i)&&(I=O);var j=w.prototype=b.prototype=Object.create(I);function x(t){["next","throw","return"].forEach((function(e){l(t,e,(function(t){return this._invoke(e,t)}))}))}function k(t,e){function r(n,a,i,s){var c=d(t[n],t,a);if("throw"!==c.type){var l=c.arg,u=l.value;return u&&"object"==v(u)&&o.call(u,"__await")?e.resolve(u.__await).then((function(t){r("next",t,i,s)}),(function(t){r("throw",t,i,s)})):e.resolve(u).then((function(t){l.value=t,i(l)}),(function(t){return r("throw",t,i,s)}))}s(c.arg)}var a;n(this,"_invoke",{value:function(t,o){function n(){return new e((function(e,n){r(t,o,e,n)}))}return a=a?a.then(n,n):n()}})}function L(e,r,o){var n=m;return function(a,i){if(n===p)throw Error("Generator is already running");if(n===h){if("throw"===a)throw i;return{value:t,done:!0}}for(o.method=a,o.arg=i;;){var s=o.delegate;if(s){var c=P(s,o);if(c){if(c===g)continue;return c}}if("next"===o.method)o.sent=o._sent=o.arg;else if("throw"===o.method){if(n===m)throw n=h,o.arg;o.dispatchException(o.arg)}else"return"===o.method&&o.abrupt("return",o.arg);n=p;var l=d(e,r,o);if("normal"===l.type){if(n=o.done?h:f,l.arg===g)continue;return{value:l.arg,done:o.done}}"throw"===l.type&&(n=h,o.method="throw",o.arg=l.arg)}}}function P(e,r){var o=r.method,n=e.iterator[o];if(n===t)return r.delegate=null,"throw"===o&&e.iterator.return&&(r.method="return",r.arg=t,P(e,r),"throw"===r.method)||"return"!==o&&(r.method="throw",r.arg=new TypeError("The iterator does not provide a '"+o+"' method")),g;var a=d(n,e.iterator,r.arg);if("throw"===a.type)return r.method="throw",r.arg=a.arg,r.delegate=null,g;var i=a.arg;return i?i.done?(r[e.resultName]=i.value,r.next=e.nextLoc,"return"!==r.method&&(r.method="next",r.arg=t),r.delegate=null,g):i:(r.method="throw",r.arg=new TypeError("iterator result is not an object"),r.delegate=null,g)}function S(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function F(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function E(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(S,this),this.reset(!0)}function $(e){if(e||""===e){var r=e[i];if(r)return r.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,a=function r(){for(;++n<e.length;)if(o.call(e,n))return r.value=e[n],r.done=!1,r;return r.value=t,r.done=!0,r};return a.next=a}}throw new TypeError(v(e)+" is not iterable")}return y.prototype=w,n(j,"constructor",{value:w,configurable:!0}),n(w,"constructor",{value:y,configurable:!0}),y.displayName=l(w,c,"GeneratorFunction"),e.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===y||"GeneratorFunction"===(e.displayName||e.name))},e.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,w):(t.__proto__=w,l(t,c,"GeneratorFunction")),t.prototype=Object.create(j),t},e.awrap=function(t){return{__await:t}},x(k.prototype),l(k.prototype,s,(function(){return this})),e.AsyncIterator=k,e.async=function(t,r,o,n,a){void 0===a&&(a=Promise);var i=new k(u(t,r,o,n),a);return e.isGeneratorFunction(r)?i:i.next().then((function(t){return t.done?t.value:i.next()}))},x(j),l(j,c,"Generator"),l(j,i,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),e.keys=function(t){var e=Object(t),r=[];for(var o in e)r.push(o);return r.reverse(),function t(){for(;r.length;){var o=r.pop();if(o in e)return t.value=o,t.done=!1,t}return t.done=!0,t}},e.values=$,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=t,this.done=!1,this.delegate=null,this.method="next",this.arg=t,this.tryEntries.forEach(F),!e)for(var r in this)"t"===r.charAt(0)&&o.call(this,r)&&!isNaN(+r.slice(1))&&(this[r]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var r=this;function n(o,n){return s.type="throw",s.arg=e,r.next=o,n&&(r.method="next",r.arg=t),!!n}for(var a=this.tryEntries.length-1;a>=0;--a){var i=this.tryEntries[a],s=i.completion;if("root"===i.tryLoc)return n("end");if(i.tryLoc<=this.prev){var c=o.call(i,"catchLoc"),l=o.call(i,"finallyLoc");if(c&&l){if(this.prev<i.catchLoc)return n(i.catchLoc,!0);if(this.prev<i.finallyLoc)return n(i.finallyLoc)}else if(c){if(this.prev<i.catchLoc)return n(i.catchLoc,!0)}else{if(!l)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return n(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var a=n;break}}a&&("break"===t||"continue"===t)&&a.tryLoc<=e&&e<=a.finallyLoc&&(a=null);var i=a?a.completion:{};return i.type=t,i.arg=e,a?(this.method="next",this.next=a.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),F(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var o=r.completion;if("throw"===o.type){var n=o.arg;F(r)}return n}}throw Error("illegal catch attempt")},delegateYield:function(e,r,o){return this.delegate={iterator:$(e),resultName:r,nextLoc:o},"next"===this.method&&(this.arg=t),g}},e}function y(t,e,r,o,n,a,i){try{var s=t[a](i),c=s.value}catch(t){return void r(t)}s.done?e(c):Promise.resolve(c).then(o,n)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);e&&(o=o.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,o)}return r}function I(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach((function(e){C(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function C(t,e,r){return(e=function(t){var e=function(t,e){if("object"!=v(t)||!t)return t;var r=t[Symbol.toPrimitive];if(void 0!==r){var o=r.call(t,e||"default");if("object"!=v(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===e?String:Number)(t)}(t,"string");return"symbol"==v(e)?e:e+""}(e))in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var O={name:"systemStore",components:{uploadPictures:l.a,Maps:b.a,erpList:g,goodsList:a.default},props:{},data:function(){var t=this,e=function(e,r,o){t.formItem.image?o():o(new Error("请上传门店照片"))};return{goodsList:[],modals:!1,treeSelect:[],modalErp:!1,openErp:!1,isTemplate:!1,title:"",formItem:{product_id:[],cate_id:[],id:0,erp_shop_id:0,store_account:"",store_password:"",image:"",name:"",introduction:"",phone:"",is_show:1,day_time:[],is_store:0,address:"",detailed_address:"",latitude:"",longitude:"",province:0,city:0,area:0,street:0,addressSelect:[],valid_range:0,product_verify_status:0,product_status:1,type:1,applicable_type:1,background_image:""},spinShow:!1,addresData:[],ruleValidate:{name:[{required:!0,message:"请输入门店名称",trigger:"blur"}],erp_shop_id:[{required:!0,validator:function(e,r,o){0==t.formItem.erp_shop_id?o(new Error("请选择erp门店")):o()},trigger:"change"}],store_account:[{required:!0,message:"请输入管理员账号",trigger:"blur"}],store_password:[{required:!0,message:"请输入管理员密码",trigger:"blur"}],address:[{required:!0,message:"请选择门店地址",trigger:"change"}],day_time:[{required:!0,type:"array",message:"请选择营业时间",trigger:"change"},{validator:function(t,e,r,o,n){""===e[0]&&r("时间不能为空"),r()}}],phone:[{required:!0,validator:function(t,e,r){if(!e)return r(new Error("请填写手机号"));/^1[3456789]\d{9}$/.test(e)?r():r(new Error("手机号格式不正确!"))},trigger:"blur"}],detailed_address:[{required:!0,message:"请输入详细地址",trigger:"blur"}],image:[{required:!0,validator:e,trigger:"change"}],background_image:[{required:!0,validator:e,trigger:"change"}]},mapKey:"",grid:{xl:20,lg:20,md:20,sm:24,xs:24},gridPic:{xl:6,lg:8,md:12,sm:12,xs:12},gridBtn:{xl:4,lg:8,md:8,sm:8,xs:8},modalPic:!1,isChoice:"单选",pid:0,isApi:0,add:0,storeAddress:""}},created:function(){this.goodsCategory(),this.getErpConfig(),this.getKey(),this.cityInfo({pid:0})},computed:I(I({},Object(c.e)("admin/layout",["isMobile"])),{},{labelWidth:function(){return this.isMobile?void 0:120},labelPosition:function(){return this.isMobile?"top":"right"}}),mounted:function(){},methods:{unique:function(t){var e=new Map;return t.filter((function(t){return!e.has(t.product_id)&&e.set(t.product_id,1)}))},getGoodsId:function(t){var e=this,r=this.goodsList.concat(t),o=this.unique(r);this.goodsList=o,this.$nextTick((function(t){setTimeout((function(){e.modals=!1}),300)}))},bindDelete:function(t){this.goodsList.splice(t,1)},goodsCategory:function(){var t=this;Object(i.a)(1).then((function(e){t.treeSelect=e.data})).catch((function(e){t.$Message.error(e.msg)}))},getProductId:function(t){this.formItem.erp_shop_id=t,this.modalErp=!1,this.$refs.formItem.validateField("erp_shop_id")},tapErp:function(){this.$refs.refErp.currentid=this.formItem.erp_shop_id,this.modalErp=!0,this.$refs.formItem.validateField("erp_shop_id")},getErpConfig:function(){var t=this;Object(s.a)().then((function(e){t.openErp=e.data.open_erp})).catch((function(e){t.$Message.error(e.msg)}))},clearFrom:function(){this.goodsList=[],this.formItem={cate_id:[],id:0,store_account:"",store_password:"",image:"",erp_shop_id:0,name:"",introduction:"",phone:"",is_show:1,day_time:[],is_store:0,address:"",detailed_address:"",latitude:"",longitude:"",province:0,city:0,area:0,street:0,addressSelect:[],valid_range:0,product_verify_status:0,product_status:1,type:1,applicable_type:1},this.add=0,this.isApi=0,this.storeAddress=""},cancel:function(){this.isTemplate=!1,this.$refs.formItem.resetFields()},addchack:function(t,e){var r=this;t.forEach((function(t,e){0==e?r.formItem.province=t:1==e?r.formItem.city=t:2==e?r.formItem.area=t:r.formItem.street=t})),this.formItem.address=e.map((function(t){return t.label})).join("/"),this.storeAddress=e.map((function(t){return t.label})).join("")},cityInfo:function(t){var e=this;Object(i.e)(t).then((function(t){e.addresData=t.data}))},loadData:function(t,e){t.loading=!0,Object(i.e)({pid:t.value}).then((function(r){t.children=r.data,t.loading=!1,e()}))},getCoordinates:function(t){if(this.formItem.latitude=t.location.lat||34.34127,this.formItem.longitude=t.location.lng||108.93984,this.isApi){var e=t.addressComponents;-1==this.formItem.detailed_address.indexOf(e.street)&&(this.formItem.detailed_address=t.address+(e.town?e.town:""))}},onSearch:function(){this.$refs.mapChild&&this.$refs.mapChild.searchKeyword(this.storeAddress+this.formItem.detailed_address)},getKey:function(){var t=this;Object(i.o)().then((function(e){t.mapKey=e.data.key})).catch((function(e){t.$Message.error(e.msg)}))},getInfo:function(t){var e=this,r=this;r.clearFrom(),r.formItem.id=t,r.spinShow=!0,Object(i.N)(t).then((function(t){e.isApi=1;var o=[];t.data.info.province&&o.push(t.data.info.province),t.data.info.city&&o.push(t.data.info.city),t.data.info.area&&o.push(t.data.info.area),t.data.info.street&&o.push(t.data.info.street),t.data.info.addressSelect=o,e.formItem=t.data.info,e.storeAddress=t.data.info.address,e.formItem.erp_shop_id=t.data.info.erp_shop_id||0,e.formItem.day_time=t.data.info.timeVal,e.$set(e.formItem,"valid_range",e.formItem.valid_range/1e3),e.onSearch(),r.spinShow=!1})).catch((function(t){r.spinShow=!1,r.$Message.error(t.msg)}))},modalPicTap:function(t,e){this.modalPic=!0,this.picTit=e||"",this.$refs.formItem.validateField(e)},getPic:function(t){this.formItem[this.picTit]=t.att_dir,this.modalPic=!1,this.$refs.formItem.validateField(this.picTit)},onchangeTime:function(t){this.formItem.day_time=t},handleSubmit:function(t){var e=this;this.$refs[t].validate((function(t){if(!t)return!1;if(""==e.formItem.day_time[0]&&(e.formItem.day_time=["00:00:00","23:59:59"]),""==e.formItem.valid_range||e.formItem.valid_range<0)return e.$Message.error("请输入有效的门店范围");var r=[];e.goodsList.forEach((function(t){r.push(t.product_id)})),e.formItem.product_id=r,Object(i.S)(e.formItem.id,e.formItem).then(function(){var t,r=(t=_().mark((function t(r){return _().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e.$Message.success(r.msg),e.isTemplate=!1,e.$parent.getList(),e.clearFrom();case 4:case"end":return t.stop()}}),t)})),function(){var e=this,r=arguments;return new Promise((function(o,n){var a=t.apply(e,r);function i(t){y(a,o,n,i,s,"next",t)}function s(t){y(a,o,n,i,s,"throw",t)}i(void 0)}))});return function(t){return r.apply(this,arguments)}}()).catch((function(t){e.$Message.error(t.msg)}))}))}}},j=(r("5897"),{name:"storeList",components:{addStore:Object(h.a)(O,(function(){var t=this,e=t._self._c;return e("div",[e("Modal",{attrs:{scrollable:"","footer-hide":"",closable:"",title:t.title,"z-index":1,width:"700"},on:{"on-cancel":t.cancel},model:{value:t.isTemplate,callback:function(e){t.isTemplate=e},expression:"isTemplate"}},[e("div",{staticClass:"article-manager"},[e("Card",{attrs:{bordered:!1,"dis-hover":""}},[e("Form",{ref:"formItem",attrs:{model:t.formItem,"label-width":t.labelWidth,"label-position":t.labelPosition,rules:t.ruleValidate},nativeOn:{submit:function(t){t.preventDefault()}}},[e("Row",{attrs:{type:"flex",gutter:24}},[t.openErp?e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"erp门店:",prop:"erp_shop_id"}},[e("Button",{on:{click:t.tapErp}},[t._v(t._s(t.formItem.erp_shop_id?t.formItem.erp_shop_id:"请选择erp门店"))])],1)],1)],1):t._e(),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店照片:",prop:"image"}},[e("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("单选","image")}}},[t.formItem.image?e("div",{staticClass:"pictrue"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formItem.image,expression:"formItem.image"}]})]):e("div",{staticClass:"upLoad"},[e("div",{staticClass:"iconfont"},[t._v("+")])])]),e("div",{staticClass:"tips"},[t._v(" 建议尺寸:70 * 70px")])])],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门头照片:",prop:"image"}},[e("div",{staticClass:"picBox",on:{click:function(e){return t.modalPicTap("单选","background_image")}}},[t.formItem.background_image?e("div",{staticClass:"pictrue"},[e("img",{directives:[{name:"lazy",rawName:"v-lazy",value:t.formItem.background_image,expression:"formItem.background_image"}]})]):e("div",{staticClass:"upLoad"},[e("div",{staticClass:"iconfont"},[t._v("+")])])]),e("div",{staticClass:"tips"},[t._v(" 建议尺寸:375 * 192px")])])],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店分类:",prop:"cate_id","label-for":"cate_id"}},[e("Cascader",{staticClass:"inputW",attrs:{data:t.treeSelect,placeholder:"请选择门店分类","change-on-select":"",filterable:""},model:{value:t.formItem.cate_id,callback:function(e){t.$set(t.formItem,"cate_id",e)},expression:"formItem.cate_id"}})],1)],1)],1),0==t.formItem.id?e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"管理员账号:",prop:"store_account","label-for":"store_account"}},[e("Input",{staticClass:"inputW",attrs:{placeholder:"请输入管理员账号"},model:{value:t.formItem.store_account,callback:function(e){t.$set(t.formItem,"store_account",e)},expression:"formItem.store_account"}})],1)],1)],1):t._e(),0==t.formItem.id?e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"管理员密码:",prop:"store_password","label-for":"store_password"}},[e("Input",{staticClass:"inputW",attrs:{type:"password",placeholder:"请输入管理员密码"},model:{value:t.formItem.store_password,callback:function(e){t.$set(t.formItem,"store_password",e)},expression:"formItem.store_password"}})],1)],1)],1):t._e(),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店名称:",prop:"name","label-for":"name"}},[e("Input",{staticClass:"inputW",attrs:{maxlength:"20","show-word-limit":"",placeholder:"请输入门店名称"},model:{value:t.formItem.name,callback:function(e){t.$set(t.formItem,"name",e)},expression:"formItem.name"}})],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店简介:","label-for":"introduction"}},[e("Input",{staticClass:"inputW",attrs:{maxlength:"100","show-word-limit":"",rows:4,autosize:{maxRows:4,minRows:4},type:"textarea",placeholder:"请输入门店简介"},model:{value:t.formItem.introduction,callback:function(e){t.$set(t.formItem,"introduction",e)},expression:"formItem.introduction"}})],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店手机号:","label-for":"phone",prop:"phone"}},[e("Input",{staticClass:"inputW",attrs:{placeholder:"请输入门店手机号"},model:{value:t.formItem.phone,callback:function(e){t.$set(t.formItem,"phone",e)},expression:"formItem.phone"}})],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"营业状态:","label-for":"is_show",prop:"is_show"}},[e("i-switch",{attrs:{size:"large","false-value":0,"true-value":1},model:{value:t.formItem.is_show,callback:function(e){t.$set(t.formItem,"is_show",e)},expression:"formItem.is_show"}},[e("span",{attrs:{slot:"open","true-value":1},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close","false-value":0},slot:"close"},[t._v("关闭")])])],1)],1)],1),e("Col",{attrs:{span:"24"}},[1==t.formItem.is_show?e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"营业时间:","label-for":"day_time",prop:"day_time"}},[e("TimePicker",{staticClass:"inputW",attrs:{type:"timerange",format:"HH:mm:ss",value:t.formItem.day_time,placement:"bottom-end",placeholder:"请选择营业时间"},on:{"on-change":t.onchangeTime},model:{value:t.formItem.day_time,callback:function(e){t.$set(t.formItem,"day_time",e)},expression:"formItem.day_time"}})],1)],1):t._e()],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店类型:"}},[e("RadioGroup",{model:{value:t.formItem.type,callback:function(e){t.$set(t.formItem,"type",e)},expression:"formItem.type"}},[e("Radio",{attrs:{label:1}},[e("Icon",{attrs:{type:"social-apple"}}),e("span",[t._v("自营")])],1),e("Radio",{attrs:{label:2}},[e("Icon",{attrs:{type:"social-android"}}),e("span",[t._v("加盟")])],1)],1),e("div",{staticClass:"tips"},[t._v("自营店不支持自主上传商品,加盟店有自主上传商品的权限")])],1)],1)],1),2==t.formItem.type?e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"商品免审:","label-for":"product_verify_status",prop:"product_verify_status"}},[e("i-switch",{attrs:{size:"large","false-value":0,"true-value":1},model:{value:t.formItem.product_verify_status,callback:function(e){t.$set(t.formItem,"product_verify_status",e)},expression:"formItem.product_verify_status"}},[e("span",{attrs:{slot:"open","true-value":1},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close","false-value":0},slot:"close"},[t._v("关闭")])])],1)],1)],1):t._e(),2==t.formItem.type?e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"自主添加商品:","label-for":"product_status",prop:"product_status"}},[e("i-switch",{attrs:{size:"large","false-value":0,"true-value":1},model:{value:t.formItem.product_status,callback:function(e){t.$set(t.formItem,"product_status",e)},expression:"formItem.product_status"}},[e("span",{attrs:{slot:"open","true-value":1},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close","false-value":0},slot:"close"},[t._v("关闭")])])],1)],1)],1):t._e(),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"到店自提:","label-for":"mention",prop:"mention"}},[e("i-switch",{attrs:{size:"large","false-value":0,"true-value":1},model:{value:t.formItem.is_store,callback:function(e){t.$set(t.formItem,"is_store",e)},expression:"formItem.is_store"}},[e("span",{attrs:{slot:"open","true-value":1},slot:"open"},[t._v("开启")]),e("span",{attrs:{slot:"close","false-value":0},slot:"close"},[t._v("关闭")])])],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店地址:","label-for":"address",prop:"address"}},[e("Cascader",{staticClass:"inputW",attrs:{data:t.addresData,"load-data":t.loadData},on:{"on-change":t.addchack},model:{value:t.formItem.addressSelect,callback:function(e){t.$set(t.formItem,"addressSelect",e)},expression:"formItem.addressSelect"}})],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{required:"",label:"配送范围(半径):","label-for":"valid_range",prop:"valid_range"}},[e("InputNumber",{staticStyle:{width:"90px"},attrs:{min:.01,max:1e5,formatter:function(e){return"".concat(t.formItem.valid_range)},parser:function(t){return t.replace("%","")}},model:{value:t.formItem.valid_range,callback:function(e){t.$set(t.formItem,"valid_range",e)},expression:"formItem.valid_range"}}),e("span",{staticClass:"ml10"},[t._v("km")])],1)],1)],1),e("Col",{attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"门店详细地址:","label-for":"detailed_address",prop:"detailed_address"}},[e("div",{staticClass:"acea-row row-middle"},[t.storeAddress?e("Input",{staticClass:"w-240",attrs:{disabled:""},model:{value:t.storeAddress,callback:function(e){t.storeAddress=e},expression:"storeAddress"}}):t._e(),e("Input",{staticClass:"w-300 ml-6",attrs:{search:"","enter-button":"查找位置",placeholder:"输入详细地址"},on:{"on-search":t.onSearch},model:{value:t.formItem.detailed_address,callback:function(e){t.$set(t.formItem,"detailed_address",e)},expression:"formItem.detailed_address"}})],1)])],1)],1),t.isApi||t.add?e("Col",{attrs:{span:"24"}},[t.mapKey?e("Maps",{ref:"mapChild",staticClass:"map-sty",attrs:{mapKey:t.mapKey,lat:Number(t.formItem.latitude||34.34127),lon:Number(t.formItem.longitude||108.93984),address:t.storeAddress+t.formItem.detailed_address},on:{getCoordinates:t.getCoordinates}}):t._e()],1):t._e(),t.formItem.id?t._e():e("Col",{staticClass:"mt20",attrs:{span:"24"}},[e("Col",t._b({},"Col",t.grid,!1),[e("FormItem",{attrs:{label:"同步商品:"}},[e("RadioGroup",{model:{value:t.formItem.applicable_type,callback:function(e){t.$set(t.formItem,"applicable_type",e)},expression:"formItem.applicable_type"}},[e("Radio",{attrs:{label:1}},[e("Icon",{attrs:{type:"social-apple"}}),e("span",[t._v("全部商品")])],1),e("Radio",{attrs:{label:2}},[e("Icon",{attrs:{type:"social-android"}}),e("span",[t._v("部分商品")])],1)],1)],1)],1)],1),t.formItem.id||2!=t.formItem.applicable_type?t._e():e("Col",{attrs:{span:"24"}},[e("FormItem",{attrs:{label:"选择商品:","label-for":"product_id",prop:""}},[e("div",{staticClass:"box"},[t._l(t.goodsList,(function(r,o){return e("div",{key:o,staticClass:"box-item"},[e("img",{attrs:{src:r.image,alt:""}}),e("Icon",{staticClass:"icon",attrs:{type:"ios-close-circle",size:"20"},on:{click:function(e){return t.bindDelete(o)}}})],1)})),e("div",{staticClass:"upload-box",on:{click:function(e){t.modals=!0}}},[e("Icon",{attrs:{type:"ios-camera-outline",size:"36"}})],1)],2)])],1)],1),e("Row",{staticStyle:{"justify-content":"space-around"}},[e("Col",[e("Button",{staticClass:"btn",attrs:{type:"primary"},on:{click:function(e){return t.handleSubmit("formItem")}}},[t._v(t._s(0!=t.formItem.id?"修改":"提交"))])],1)],1),t.spinShow?e("Spin",{attrs:{size:"large",fix:""}}):t._e()],1)],1),e("Modal",{attrs:{width:"960px",scrollable:"","footer-hide":"",closable:"",title:"上传提货点logo","mask-closable":!1,"z-index":1},model:{value:t.modalPic,callback:function(e){t.modalPic=e},expression:"modalPic"}},[t.modalPic?e("uploadPictures",{attrs:{isChoice:t.isChoice,gridBtn:t.gridBtn,gridPic:t.gridPic},on:{getPic:t.getPic}}):t._e()],1),e("Modal",{attrs:{width:"700px",scrollable:"","footer-hide":"",closable:"",title:"erp门店","mask-closable":!1,"z-index":1},model:{value:t.modalErp,callback:function(e){t.modalErp=e},expression:"modalErp"}},[e("erpList",{ref:"refErp",on:{getProductId:t.getProductId}})],1)],1)]),e("Modal",{staticClass:"paymentFooter",attrs:{title:"商品列表",scrollable:"",width:"900","footer-hide":!0},model:{value:t.modals,callback:function(e){t.modals=e},expression:"modals"}},[t.modals?e("goods-list",{ref:"goodslist",attrs:{ischeckbox:!0,isLive:!0,storeType:1},on:{getProductId:t.getGoodsId}}):t._e()],1)],1)}),[],!1,null,"665fb26b",null).exports},data:function(){return{BaseURL:"",total:0,loading:!1,formValidate:{type:"all",page:1,limit:15},columns:[{title:"ID",key:"id",width:60},{title:"门店图片",slot:"image",minWidth:80},{title:"门店名称",key:"name",minWidth:80},{title:"门店分类",key:"cate_name",minWidth:80},{title:"联系电话",key:"phone",minWidth:90},{title:"门店地址",key:"address",ellipsis:!0,minWidth:150},{title:"营业时间",key:"day_time",minWidth:120},{title:"营业状态",key:"status_name",minWidth:80},{title:"操作",slot:"action",fixed:"right",minWidth:240,align:"center"}],orderList:[{id:"1",order_id:"12",pay_price:"12",status:1,phone:"13000000000",address:"陕西省西安市莲湖区大兴西路啊餐厨"}]}},mounted:function(){this.getList()},methods:{getList:function(){var t=this;this.loading=!0,Object(i.O)(this.formValidate).then((function(e){t.orderList=e.data.list,t.total=e.data.count,t.loading=!1}))},reset:function(t){var e=this;this.$modalForm(Object(i.C)(t.id)).then((function(){return e.getList()}))},add:function(){this.$refs.template.clearFrom(),this.$refs.template.title="添加门店",this.$refs.template.add=1,this.$refs.template.isTemplate=!0,this.$refs.template.cityInfo({pid:0})},edit:function(t){this.$refs.template.title="编辑门店",this.$refs.template.isTemplate=!0,this.$refs.template.getInfo(t.id)},getExpiresTime:function(t){var e=Math.round(new Date/1e3);return parseFloat(parseFloat(parseFloat((t-e)/60)/60)/24)},gostore:function(t){var e=this;Object(i.P)(t.id).then((function(r){var a=r.data,i=a.expires_time;o.a.cookies.setStore("token",a.token,{expires:i}),o.a.cookies.setStore("uuid",a.user_info.id,{expires:i}),o.a.cookies.setStore("expires_time",i,{expires:i}),o.a.makeMenu("/".concat(a.prefix),a.menus);var s=window.localStorage;s.setItem("menuListStore",JSON.stringify(a.menus)),s.setItem("uniqueAuthStore",JSON.stringify(a.unique_auth));var c={account:a.user_info.account,head_pic:a.user_info.avatar,logo:a.logo,logoSmall:a.logo_square,version:a.version};s.setItem("userInfoStore",JSON.stringify(c)),e.BaseURL=n.a.apiBaseURL.replace(/adminapi/,"".concat(t.prefix,"/home/")),window.open(e.BaseURL)})).catch((function(t){e.$Message.error(t.msg)}))},delte:function(t,e,r){var o=this,n={title:e,num:r,url:"store/store/del/".concat(t.id),method:"DELETE",ids:""};this.$modalSure(n).then((function(t){o.$Message.success(t.msg),o.orderList.splice(r,1),o.orderList.length||(o.formValidate.page=1==o.formValidate.page?1:o.formValidate.page-1),o.getList()})).catch((function(t){o.$Message.error(t.msg)}))},operation:function(t){var e=this,r=0;0==t.is_show&&(r=1),1==t.is_show&&(r=0),Object(i.Q)(t.id,r).then((function(t){e.getList(),e.$Message.success(t.msg)})).catch((function(t){e.$Message.error(res.msg)}))},searchs:function(){},onClickTab:function(t){this.formValidate.page=1,this.formValidate.type=t,this.getList()},pageChange:function(t){this.formValidate.page=t,this.getList()}}}),x=(r("73aa"),Object(h.a)(j,(function(){var t=this,e=t._self._c;return e("div",[e("Card",{staticClass:"ivu-mt tablebox",attrs:{bordered:!1,"dis-hover":"",padding:16}},[e("div",{staticClass:"new_tab"},[e("Tabs",{on:{"on-click":t.onClickTab}},[e("TabPane",{attrs:{label:"全部",name:"all"}}),e("TabPane",{attrs:{label:"营业中",name:"1"}}),e("TabPane",{attrs:{label:"已停业",name:"-1"}})],1)],1),e("Button",{attrs:{type:"primary"},on:{click:t.add}},[t._v("添加门店")]),e("div",{staticClass:"table"},[e("Table",{ref:"table",staticClass:"ivu-mt",attrs:{columns:t.columns,data:t.orderList,loading:t.loading,"highlight-row":"","no-userFrom-text":"暂无数据","no-filtered-userFrom-text":"暂无筛选结果"},scopedSlots:t._u([{key:"image",fn:function(t){var r=t.row;return[e("img",{attrs:{src:r.image}})]}},{key:"action",fn:function(r){var o=r.row,n=r.index;return[e("a",{on:{click:function(e){return t.gostore(o)}}},[t._v("进入门店")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.reset(o)}}},[t._v("重置")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.operation(o)}}},[t._v(t._s(0==o.is_show?"开业":"停业"))]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.edit(o)}}},[t._v("编辑")]),e("Divider",{attrs:{type:"vertical"}}),e("a",{on:{click:function(e){return t.delte(o,"删除门店(同步删除商品)",n)}}},[t._v("删除")])]}}])}),e("div",{staticClass:"acea-row row-right page"},[e("Page",{attrs:{total:t.total,current:t.formValidate.page,"show-elevator":"","show-total":"","page-size":t.formValidate.limit},on:{"on-change":t.pageChange}})],1)],1)],1),e("add-store",{ref:"template"})],1)}),[],!1,null,"0b069120",null));e.default=x.exports},"539a":function(t,e,r){},5897:function(t,e,r){"use strict";r("539a")},"73aa":function(t,e,r){"use strict";r("7bd0")},"73f5":function(t,e,r){"use strict";r.d(e,"D",(function(){return n})),r.d(e,"u",(function(){return a})),r.d(e,"q",(function(){return i})),r.d(e,"t",(function(){return s})),r.d(e,"v",(function(){return c})),r.d(e,"x",(function(){return l})),r.d(e,"j",(function(){return u})),r.d(e,"i",(function(){return d})),r.d(e,"U",(function(){return m})),r.d(e,"h",(function(){return f})),r.d(e,"z",(function(){return p})),r.d(e,"y",(function(){return h})),r.d(e,"A",(function(){return g})),r.d(e,"w",(function(){return b})),r.d(e,"m",(function(){return v})),r.d(e,"B",(function(){return _})),r.d(e,"s",(function(){return y})),r.d(e,"L",(function(){return w})),r.d(e,"M",(function(){return I})),r.d(e,"J",(function(){return C})),r.d(e,"K",(function(){return O})),r.d(e,"g",(function(){return j})),r.d(e,"G",(function(){return x})),r.d(e,"H",(function(){return k})),r.d(e,"I",(function(){return L})),r.d(e,"T",(function(){return P})),r.d(e,"O",(function(){return S})),r.d(e,"N",(function(){return F})),r.d(e,"e",(function(){return E})),r.d(e,"S",(function(){return $})),r.d(e,"o",(function(){return T})),r.d(e,"P",(function(){return M})),r.d(e,"Q",(function(){return D})),r.d(e,"R",(function(){return q})),r.d(e,"n",(function(){return N})),r.d(e,"r",(function(){return B})),r.d(e,"E",(function(){return W})),r.d(e,"p",(function(){return A})),r.d(e,"C",(function(){return z})),r.d(e,"f",(function(){return R})),r.d(e,"F",(function(){return G})),r.d(e,"b",(function(){return K})),r.d(e,"d",(function(){return V})),r.d(e,"c",(function(){return J})),r.d(e,"a",(function(){return U})),r.d(e,"k",(function(){return H})),r.d(e,"l",(function(){return Q}));var o=r("b6bd");function n(t){return Object(o.a)({url:"merchant/store_list",method:"get",params:t})}function a(t){return Object(o.a)({url:"store/order/list",method:"get",params:t})}function i(t){return Object(o.a)({url:"store/order/chart",method:"get",params:t})}function s(t){return Object(o.a)({url:"store/order/header",method:"get"})}function c(t){return Object(o.a)({url:"store/recharge",method:"get",params:t})}function l(t){return Object(o.a)({url:"store/vip_order",method:"get",params:t})}function u(t){return Object(o.a)({url:"store/order/edit/".concat(t),method:"get"})}function d(t){return Object(o.a)({url:"store/order/distribution/".concat(t),method:"get"})}function m(t){return Object(o.a)({url:"store/order/write_update/".concat(t),method:"put"})}function f(t){return Object(o.a)({url:"store/order/info/".concat(t),method:"get"})}function p(t){return Object(o.a)({url:"order/remark/".concat(t.id),method:"put",data:t.remark})}function h(t){return Object(o.a)({url:"store/recharge/remark/".concat(t.id),method:"put",data:t.remark})}function g(t){return Object(o.a)({url:"store/vip/remark/".concat(t.id),method:"put",data:t.remark})}function b(t){return Object(o.a)({url:"store/refund/list",method:"get",params:t})}function v(t){return Object(o.a)({url:"/order/no_refund/".concat(t),method:"get"})}function _(t){return Object(o.a)({url:"/order/refund_integral/".concat(t),method:"get"})}function y(t,e){return Object(o.a)({url:"store/order/export/".concat(e),method:"post",data:t})}function w(t){return Object(o.a)({url:"store/finance_flow/list",method:"get",params:t})}function I(t,e){return Object(o.a)({url:"store/finance_flow/mark/".concat(t),method:"put",params:e})}function C(t){return Object(o.a)({url:"store/finance_flow/fund_record",method:"get",params:t})}function O(t){return Object(o.a)({url:"store/finance_flow/fund_record_info",method:"get",params:t})}function j(t){return Object(o.a)({url:"/export/storeFinanceRecord",method:"get",params:t})}function x(t){return Object(o.a)({url:"/store/extract/list",method:"get",params:t})}function k(t,e){return Object(o.a)({url:"store/extract/mark/".concat(t),method:"post",data:e})}function L(t,e){return Object(o.a)({url:"store/extract/verify/".concat(t),method:"post",data:e})}function P(t){return Object(o.a)({url:"store/extract/transfer/".concat(t),method:"get"})}function S(t){return Object(o.a)({url:"store/store",method:"get",params:t})}function F(t){return Object(o.a)({url:"store/store/get_info/".concat(t),method:"get"})}function E(t){return Object(o.a)({url:"city",method:"get",params:t})}function $(t,e){return Object(o.a)({url:"store/store/".concat(t),method:"post",data:e})}function T(){return Object(o.a)({url:"store/store/address",method:"get"})}function M(t){return Object(o.a)({url:"store/store/login/".concat(t),method:"get"})}function D(t,e){return Object(o.a)({url:"store/store/set_show/".concat(t,"/").concat(e),method:"put"})}function q(t){return Object(o.a)({url:"store/share/order",method:"post",params:t})}function N(t){return Object(o.a)({url:"store/home/header",method:"get",params:t})}function B(t){return Object(o.a)({url:"store/home/orderChart",method:"get",params:t})}function W(t){return Object(o.a)({url:"store/home/store",method:"get",params:t})}function A(t){return Object(o.a)({url:"store/home/operate",method:"get",params:t})}function z(t){return Object(o.a)({url:"store/store/reset_admin/".concat(t),method:"get"})}function R(t,e,r){return Object(o.a)({url:"export/storeFlowExport?store_id=".concat(t,"&keyword=").concat(e,"&data=").concat(r),method:"get"})}function G(t){return Object(o.a)({url:"/store/category",params:t,method:"get"})}function K(t){return Object(o.a)({url:"/store/category/create/".concat(t),method:"get"})}function V(t){return Object(o.a)({url:"/store/category/tree/".concat(t),method:"get"})}function J(t){return Object(o.a)({url:"/store/category/set_show/".concat(t.id,"/").concat(t.is_show),method:"PUT"})}function U(t){return Object(o.a)({url:"store/category/cascader_list/".concat(t),method:"get"})}function H(t){return Object(o.a)({url:"/store/refund/detail/".concat(t),method:"get"})}function Q(t){return Object(o.a)({url:"/store/refund/refund/".concat(t),method:"get"})}},"7bd0":function(t,e,r){},c7fc:function(t,e,r){"use strict";var o={props:{lat:{type:Number,default:34.34127},lon:{type:Number,default:108.93984},mapKey:{tyep:String},address:{tyep:String}},data:function(){return{geocoder:void 0,marker:null,resultDatail:{}}},created:function(){this.getLocation(this.address||"陕西省西安市")},methods:{searchKeyword:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"西安";this.getLocation(t)},getLocation:function(t){var e=this,r=this;r.$jsonp("https://apis.map.qq.com/ws/geocoder/v1?",{address:"".concat(t),key:r.mapKey,output:"jsonp"}).then((function(t){var o;0===t.status?((o=r.mapKey,new Promise((function(t,e){window.init=function(){t(window.qq)};var r=document.createElement("script");r.type="text/javascript",r.src="https://map.qq.com/api/js?v=2.exp&callback=init&key=".concat(o),r.onerror=e,document.head.appendChild(r)}))).then((function(e){var r=new e.maps.LatLng(t.result.location.lat,t.result.location.lng);new e.maps.Map(document.getElementById("container"),{center:r,zoom:15})})),e.$emit("getCoordinates",t.result)):r.$Message.error(t.message)})).catch((function(t){r.$Message.error("获取城市编码失败")}))}}},n=r("2877"),a=Object(n.a)(o,(function(){return this._self._c,this._m(0)}),[function(){var t=this._self._c;return t("div",[t("div",{staticStyle:{width:"100%",height:"450px"},attrs:{id:"container"}})])}],!1,null,"48ce3c82",null);e.a=a.exports}}]); |