Commit 867127bc by chenwq

嘀加上架-基础信息,流量方信息

1 parent 751a0a30
...@@ -684,7 +684,11 @@ export const businessNature = [ ...@@ -684,7 +684,11 @@ export const businessNature = [
// { confId: 3, confName: "合资收购" }, // { confId: 3, confName: "合资收购" },
{ confId: 4, confName: "投资收购-利丰" }, { confId: 4, confName: "投资收购-利丰" },
{ confId: 5, confName: "投资收购-内蒙古" }, { confId: 5, confName: "投资收购-内蒙古" },
{ confId: 6, confName: "服务商投资" } { confId: 7, confName: "投资收购-龙南" },
{ confId: 8, confName: "投资收购-湖北正旺" },
{ confId: 6, confName: "服务商投资" },
{ confId: 9, confName: "系统实施-新疆东捷" },
{ confId: 10, confName: "系统实施-捷通达" }
] ]
// 店面配置 业务性质 // 店面配置 业务性质
export const businessNatureShow = { export const businessNatureShow = {
......
!function(t,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(t="undefined"!=typeof globalThis?globalThis:t||self).GlMap=r()}(this,(function(){"use strict";function t(t,r){(null==r||r>t.length)&&(r=t.length);for(var e=0,n=Array(r);e<r;e++)n[e]=t[e];return n}function r(t,r,e,n,o,i,a){try{var c=t[i](a),u=c.value}catch(t){return void e(t)}c.done?r(u):Promise.resolve(u).then(n,o)}function e(t,r,e){return r&&function(t,r){for(var e=0;e<r.length;e++){var n=r[e];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,i(n.key),n)}}(t.prototype,r),Object.defineProperty(t,"prototype",{writable:!1}),t}function n(){n=function(){return r};var t,r={},e=Object.prototype,o=e.hasOwnProperty,i=Object.defineProperty||function(t,r,e){t[r]=e.value},a="function"==typeof Symbol?Symbol:{},c=a.iterator||"@@iterator",u=a.asyncIterator||"@@asyncIterator",f=a.toStringTag||"@@toStringTag";function l(t,r,e){return Object.defineProperty(t,r,{value:e,enumerable:!0,configurable:!0,writable:!0}),t[r]}try{l({},"")}catch(t){l=function(t,r,e){return t[r]=e}}function s(t,r,e,n){var o=r&&r.prototype instanceof g?r:g,a=Object.create(o.prototype),c=new P(n||[]);return i(a,"_invoke",{value:O(t,e,c)}),a}function h(t,r,e){try{return{type:"normal",arg:t.call(r,e)}}catch(t){return{type:"throw",arg:t}}}r.wrap=s;var p="suspendedStart",y="suspendedYield",v="executing",d="completed",m={};function g(){}function w(){}function b(){}var L={};l(L,c,(function(){return this}));var x=Object.getPrototypeOf,E=x&&x(x(T([])));E&&E!==e&&o.call(E,c)&&(L=E);var j=b.prototype=g.prototype=Object.create(L);function G(t){["next","throw","return"].forEach((function(r){l(t,r,(function(t){return this._invoke(r,t)}))}))}function S(t,r){function e(n,i,a,c){var u=h(t[n],t,i);if("throw"!==u.type){var f=u.arg,l=f.value;return l&&"object"==typeof l&&o.call(l,"__await")?r.resolve(l.__await).then((function(t){e("next",t,a,c)}),(function(t){e("throw",t,a,c)})):r.resolve(l).then((function(t){f.value=t,a(f)}),(function(t){return e("throw",t,a,c)}))}c(u.arg)}var n;i(this,"_invoke",{value:function(t,o){function i(){return new r((function(r,n){e(t,o,r,n)}))}return n=n?n.then(i,i):i()}})}function O(r,e,n){var o=p;return function(i,a){if(o===v)throw Error("Generator is already running");if(o===d){if("throw"===i)throw a;return{value:t,done:!0}}for(n.method=i,n.arg=a;;){var c=n.delegate;if(c){var u=_(c,n);if(u){if(u===m)continue;return u}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if(o===p)throw o=d,n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);o=v;var f=h(r,e,n);if("normal"===f.type){if(o=n.done?d:y,f.arg===m)continue;return{value:f.arg,done:n.done}}"throw"===f.type&&(o=d,n.method="throw",n.arg=f.arg)}}}function _(r,e){var n=e.method,o=r.iterator[n];if(o===t)return e.delegate=null,"throw"===n&&r.iterator.return&&(e.method="return",e.arg=t,_(r,e),"throw"===e.method)||"return"!==n&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+n+"' method")),m;var i=h(o,r.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,m;var a=i.arg;return a?a.done?(e[r.resultName]=a.value,e.next=r.nextLoc,"return"!==e.method&&(e.method="next",e.arg=t),e.delegate=null,m):a:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,m)}function k(t){var r={tryLoc:t[0]};1 in t&&(r.catchLoc=t[1]),2 in t&&(r.finallyLoc=t[2],r.afterLoc=t[3]),this.tryEntries.push(r)}function A(t){var r=t.completion||{};r.type="normal",delete r.arg,t.completion=r}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(k,this),this.reset(!0)}function T(r){if(r||""===r){var e=r[c];if(e)return e.call(r);if("function"==typeof r.next)return r;if(!isNaN(r.length)){var n=-1,i=function e(){for(;++n<r.length;)if(o.call(r,n))return e.value=r[n],e.done=!1,e;return e.value=t,e.done=!0,e};return i.next=i}}throw new TypeError(typeof r+" is not iterable")}return w.prototype=b,i(j,"constructor",{value:b,configurable:!0}),i(b,"constructor",{value:w,configurable:!0}),w.displayName=l(b,f,"GeneratorFunction"),r.isGeneratorFunction=function(t){var r="function"==typeof t&&t.constructor;return!!r&&(r===w||"GeneratorFunction"===(r.displayName||r.name))},r.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,b):(t.__proto__=b,l(t,f,"GeneratorFunction")),t.prototype=Object.create(j),t},r.awrap=function(t){return{__await:t}},G(S.prototype),l(S.prototype,u,(function(){return this})),r.AsyncIterator=S,r.async=function(t,e,n,o,i){void 0===i&&(i=Promise);var a=new S(s(t,e,n,o),i);return r.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},G(j),l(j,f,"Generator"),l(j,c,(function(){return this})),l(j,"toString",(function(){return"[object Generator]"})),r.keys=function(t){var r=Object(t),e=[];for(var n in r)e.push(n);return e.reverse(),function t(){for(;e.length;){var n=e.pop();if(n in r)return t.value=n,t.done=!1,t}return t.done=!0,t}},r.values=T,P.prototype={constructor:P,reset:function(r){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(A),!r)for(var e in this)"t"===e.charAt(0)&&o.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=t)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(r){if(this.done)throw r;var e=this;function n(n,o){return c.type="throw",c.arg=r,e.next=n,o&&(e.method="next",e.arg=t),!!o}for(var i=this.tryEntries.length-1;i>=0;--i){var a=this.tryEntries[i],c=a.completion;if("root"===a.tryLoc)return n("end");if(a.tryLoc<=this.prev){var u=o.call(a,"catchLoc"),f=o.call(a,"finallyLoc");if(u&&f){if(this.prev<a.catchLoc)return n(a.catchLoc,!0);if(this.prev<a.finallyLoc)return n(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return n(a.catchLoc,!0)}else{if(!f)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return n(a.finallyLoc)}}}},abrupt:function(t,r){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc<=this.prev&&o.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var i=n;break}}i&&("break"===t||"continue"===t)&&i.tryLoc<=r&&r<=i.finallyLoc&&(i=null);var a=i?i.completion:{};return a.type=t,a.arg=r,i?(this.method="next",this.next=i.finallyLoc,m):this.complete(a)},complete:function(t,r){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&&r&&(this.next=r),m},finish:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.finallyLoc===t)return this.complete(e.completion,e.afterLoc),A(e),m}},catch:function(t){for(var r=this.tryEntries.length-1;r>=0;--r){var e=this.tryEntries[r];if(e.tryLoc===t){var n=e.completion;if("throw"===n.type){var o=n.arg;A(e)}return o}}throw Error("illegal catch attempt")},delegateYield:function(r,e,n){return this.delegate={iterator:T(r),resultName:e,nextLoc:n},"next"===this.method&&(this.arg=t),m}},r}function o(r){return function(r){if(Array.isArray(r))return t(r)}(r)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(r)||function(r,e){if(r){if("string"==typeof r)return t(r,e);var n={}.toString.call(r).slice(8,-1);return"Object"===n&&r.constructor&&(n=r.constructor.name),"Map"===n||"Set"===n?Array.from(r):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?t(r,e):void 0}}(r)||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.")}()}function i(t){var r=function(t,r){if("object"!=typeof t||!t)return t;var e=t[Symbol.toPrimitive];if(void 0!==e){var n=e.call(t,r);if("object"!=typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(t)}(t,"string");return"symbol"==typeof r?r:r+""}function a(t){return a="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},a(t)}var c={1:"develop",2:"test",3:"production",4:"beta"},u=function(){return e((function t(){var e=this;!function(t,r){if(!(t instanceof r))throw new TypeError("Cannot call a class as a function")}(this,t);var o,i,u={env:3,version:3},f=arguments[0];if(arguments.length>1&&(u="object"==a(arguments[0])?arguments[0]:u,f=arguments[1],null!==(o=u)&&void 0!==o&&o.env||(u.env=3),null!==(i=u)&&void 0!==i&&i.version||(u.version=3)),"undefined"!=typeof window){var l=function(){var t,o=(t=n().mark((function t(){var r,o,i,a;return n().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,fetch("https://config-center-backend.glsx.com.cn/glsxAdmin/config?moduleUrl=map-api-js&env=".concat(c[u.env]));case 3:return r=t.sent,t.next=6,r.json();case 6:o=t.sent,i=Array.from(document.head.getElementsByTagName("script")).some((function(t){return t.src===o.apiUrl})),i?f&&"function"==typeof f&&(e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))):((a=document.createElement("script")).src=o.apiUrl,document.head.appendChild(a),a.onload=function(){e.GLMap=new window.$GlMapApi(u,(function(){f&&"function"==typeof f&&f(e)}))}),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),console.error("Failed to fetch configuration:",t.t0);case 14:case"end":return t.stop()}}),t,null,[[0,11]])})),function(){var e=this,n=arguments;return new Promise((function(o,i){var a=t.apply(e,n);function c(t){r(a,o,i,c,u,"next",t)}function u(t){r(a,o,i,c,u,"throw",t)}c(void 0)}))});return function(){return o.apply(this,arguments)}}();l()}}),[{key:"invoke",value:function(t){var r,e=Array.prototype.slice.call(arguments,1);return(r=this.GLMap)[t].apply(r,o(e))}},{key:"map",get:function(){return this.GLMap._BMAP}},{key:"mapGL",get:function(){return this.GLMap._BMapGL}}])}();return u}));
<!--
* @Author: your name
* @Date: 2022-03-07 14:32:50
* @LastEditTime: 2022-04-21 18:43:21
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\views\baseInfo\editInfo.vue
-->
<template>
<div v-loading="loading">
<div class="select-input-box" @click="switchBrand">
<div>
<template v-for="(item, idx) in getCheckedArr">
<el-tag effect="plain" type="info" :key="idx" closable :disable-transitions="false" @close="removeItem(item, idx)" v-if="idx < 3">
{{ item.label }}
</el-tag>
</template>
<el-popover placement="top" width="600" trigger="hover" class="select-popover">
<div class="select-popover-box">
<el-tag effect="plain" class="popover-item" v-for="(item, idx) in getCheckedArr" type="info" :key="idx" closable :disable-transitions="false" @close="removeItem(item, idx)">
{{ item.label }}
</el-tag>
</div>
<el-tag effect="plain" slot="reference" type="info" v-show="getCheckedArr.length > 3">+ {{ getCheckedArr.length - 3 }}</el-tag>
</el-popover>
</div>
<div>
<i v-show="!brandTree" class="el-icon-arrow-up" style="color:#909399"></i>
<i v-show="brandTree" class="el-icon-arrow-down" style="color:#909399"></i>
</div>
</div>
<div class="tree-box" v-show="brandTree">
<el-input class="tree-input" prefix-icon="el-icon-search" placeholder="输入关键字进行过滤" v-model="filterText"></el-input>
<el-tree class="filter-tree" @check="handleCheck" :data="brandListTree" :props="defaultProps" node-key="id" show-checkbox :filter-node-method="filterNode" ref="tree"></el-tree>
<div class="tree-footer">
<div class="tree-footer-checkbox">
<el-checkbox v-model="checkedAll" @change="selectAll">全部</el-checkbox>
</div>
<div class="tree-footer-reset" @click="selectClear">重置</div>
</div>
</div>
</div>
</template>
<script>
export default {
name: 'SelectBrand',
data() {
return {
loading: false,
checkedAll: false,
filterText: '',
treeArr: [],
getCheckedArr: [],
defaultProps: {
children: 'children',
label: 'label'
},
brandTree: false
}
},
props: {
brandListTree: {
type: Array
}
},
watch: {
filterText(val) {
this.$refs.tree.filter(val)
},
treeArr: {
handler() {
const getCheckedNodes = this.$refs.tree.getCheckedNodes()
this.getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (Object.keys(cur).includes('children') && cur.children && cur.children.length > 0) {
return prev
}
return prev.concat(cur)
}, [])
},
deep: true
}
},
methods: {
getMerchantBrandList() {
let getCheckedNodes = this.$refs.tree.getCheckedNodes()
const getCheckedKeys = this.$refs.tree.getCheckedKeys()
const getHalfCheckedNodes = this.$refs.tree.getHalfCheckedNodes()
let merchantBrandList = getHalfCheckedNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId
}
})
let checkNodes = getCheckedNodes.filter(item => item.children)
let noCheckNodes = getCheckedNodes
.filter(item => item.children === null)
.map(i => {
return {
cars: i.id
}
})
let merchantBrandList2 = checkNodes.map(car => {
let merchantBrandId = []
car.children.forEach(item => {
if (getCheckedKeys.includes(item.id)) {
merchantBrandId.push(item.id)
}
})
return {
cars: car.id,
merchantBrandId
}
})
return merchantBrandList.concat(merchantBrandList2).concat(noCheckNodes)
},
//勾选
handleCheck() {
this.treeArr = this.getTreeArray()
if (this.$refs.tree.getCheckedKeys().length == 0) {
this.checkedAll = false
}
if (this.$refs.tree.getCheckedKeys().length == this.treeArr.length) {
this.checkedAll = true
}
},
getCheckList(checkArr = []) {
checkArr.forEach(item => (item = parseInt(item)))
this.$refs.tree.setCheckedKeys(checkArr)
this.$nextTick(() => {
this.handleCheck()
})
},
//获取选择项
getTreeArray() {
let tree_arr = []
this.brandListTree.forEach(k => {
let child = k.children
if (child && child.length > 0) {
child.forEach(j => {
tree_arr.push(j.id)
})
} else {
tree_arr.push(k.id)
}
})
return tree_arr
},
//全选
selectAll() {
this.loading = true
this.treeArr = this.getTreeArray()
if (this.getCheckedArr.length == this.treeArr.length) {
this.checkedAll = false
this.$refs.tree.setCheckedKeys([])
} else {
this.checkedAll = true
this.$refs.tree.setCheckedKeys(this.treeArr)
}
setTimeout(() => {
this.loading = false
}, 1000)
},
//重置
selectClear() {
this.treeArr = []
this.checkedAll = false
this.$refs.tree.setCheckedKeys([])
},
//删除
removeItem(checkItem, index) {
this.loading = true
this.getCheckedArr.splice(index, 1)
const getCheckedNodes = this.$refs.tree.getCheckedNodes()
let getCheckedArr = getCheckedNodes.reduce((prev, cur) => {
if (Object.keys(cur).includes('children')) {
return prev
}
return prev.concat(cur)
}, [])
getCheckedArr = getCheckedArr.filter(item => {
return item.id != checkItem.id
})
this.$refs.tree.setCheckedNodes(getCheckedArr)
if (getCheckedArr.length == 0) {
this.checkedAll = false
}
this.$nextTick(() => {
this.loading = false
})
},
//过滤
filterNode(value, data) {
if (!value) return true
return data.label.indexOf(value) !== -1
},
// 显示隐藏
switchBrand() {
this.brandTree = !this.brandTree
this.$emit('clickBrand', this.brandTree)
}
}
}
</script>
<style lang="scss" scoped>
.select-input-box {
width: 100%;
height: 38px;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e5e5e5;
box-sizing: border-box;
padding: 8px;
display: flex;
justify-content: space-between;
align-items: center;
// /deep/ .el-tag {
// margin-right: 5px;
// height: 26px;
// line-height: 26px;
// box-sizing: border-box;
// }
}
.select-popover {
&-box {
display: flex;
flex-wrap: wrap;
max-height: 500px;
overflow-y: auto;
.popover-item {
margin-right: 5px;
margin-bottom: 5px;
height: 26px;
line-height: 26px;
box-sizing: border-box;
}
}
}
.tree-box {
margin-top: 10px;
padding: 15px 15px 0px;
background: #ffffff;
// box-shadow: 0px 6px 20px 0px rgba(122, 122, 122, 0.2);
border-radius: 4px;
.tree-input {
margin-bottom: 10px;
}
.filter-tree {
height: 300px;
overflow-y: auto;
}
.tree-footer {
border-top: 1px solid #e5e5e5;
height: 48px;
padding: 0px 15px;
display: flex;
justify-content: space-between;
align-items: center;
}
}
.tree-footer-reset {
cursor: pointer;
}
</style>
<template>
<div class="map-box" :style="{ height: mapHeight + 'px' }">
<div id="mapContainer" style="width: 100%; height: 100%;z-index: 999999"></div>
<div class="map-address">{{ address }}</div>
<div id="myPageTop" style="position: absolute; top: 10px; width: 50%; left: 25%">
<el-input id="input" placeholder="请输入关键字" v-model="input" @keyup.enter.native="searchAddress" class="input-with-select">
<el-button slot="append" icon="el-icon-search" @click="searchAddress"></el-button>
</el-input>
</div>
</div>
</template>
<script>
let map, marker, geocoder
export default {
name: 'map',
props: {
mapHeight: {
type: Number,
default: 300
}
},
data() {
return {
input: '',
address: '',
lnglat: [],
geocoderAddress: {},
mapapi: null
}
},
methods: {
async mapInit(lng, lat) {
const mapapi = this.$mapapi
console.log(lng, lat, '==========', this.$mapapi)
map = await mapapi.invoke('Map', 'mapContainer')
if (lng) {
this.init(mapapi, map, lng, lat)
return true
}
mapapi.invoke('LocalCity', res => {
console.log('IP', res)
let { lng, lat } = res.center
this.init(mapapi, map, lng, lat, false)
})
},
init(mapapi, map, lng, lat, isMark = true) {
console.log(lng, lat, 'lng, lat')
mapapi.invoke('centerAndZoom', mapapi.invoke('Point', lng, lat), 15)
map.enableScrollWheelZoom() // 启用滚轮放大缩小
map.enableAutoResize() // 启用自动适应容器尺寸变化
geocoder = mapapi.invoke('Geocoder')
if (isMark) {
this.addMarker([lng, lat], true)
}
// 右键菜单
mapapi.invoke('mapAddEventListener', 'click', (e) => {
console.log(e)
this.getAddress(e.point)
})
},
searchAddress() {
const mapapi = this.$mapapi
console.log(mapapi, 'mapapi')
mapapi.invoke('getPoint', this.input, res => {
console.log(this.input, res, 'getPoint')
// this.addMarker(res)
this.getAddress(res)
}, '全国')
// let _this = this
// placeSearch.search(this.input, function(status, result) {
// if (status === 'complete' && result.poiList.pois.length) {
// let lnglat = result.poiList.pois[0].location
// _this.getAddress(lnglat)
// }
// })
},
addMarker(lnglat, isInit = false) {
const mapapi = this.$mapapi
let lnglatXY
console.log(lnglat)
if (lnglat.lng) {
const { lng, lat } = lnglat
lnglatXY = mapapi.invoke('Point', lng, lat)
} else {
lnglatXY = mapapi.invoke('Point', lnglat[0], lnglat[1])
}
if (marker) {
mapapi.invoke('removeOverlay', marker)
}
marker = mapapi.invoke('Marker', lnglatXY, {
icon: mapapi.invoke('Icon', require('@/assets/address.png'), mapapi.invoke('Size', 20, 30))
})
// if (!isInit) {
// mapapi.invoke('getLocation', lnglatXY, res => {
// console.log(res, 'getLocation')
// if (res) this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
// })
// }
mapapi.invoke('panTo', lnglatXY)
mapapi.invoke('addOverlay', marker)
},
getAddress(e) {
console.log(e)
let self = this
const mapapi = this.$mapapi
let lnglat
if (e.lng) {
const { lng, lat } = e
lnglat = mapapi.invoke('Point', lng, lat)
} else {
lnglat = mapapi.invoke('Point', e[0], e[1])
}
self.addMarker(lnglat)
self.lnglat = lnglat
geocoder.getLocation(lnglat, res => {
console.log(res)
this.address = res.surroundingPois.length ? res.surroundingPois[0].address : res.address
this.geocoderAddress = res.content.address_detail
})
// AMap.plugin('AMap.Geocoder', () => {
// const geocoder = new AMap.Geocoder()
// geocoder.getAddress(lnglat, (status, result) => {
// self.lnglat = lnglat
// self.address = result.regeocode.formattedAddress
// geocoder.getLocation(self.address, (status, result) => {
// if (status === 'complete' && result.info === 'OK') {
// this.geocoderAddress = result.geocodes[0]
// }
// })
// })
// })
},
selectAddress(e) {
//这里获得点选地点的经纬度
this.getAddress()
}
},
created() {
// this.mapInit()
}
}
</script>
<style scoped lang="scss">
.map-box {
position: relative;
width: 100%;
}
#container {
position: absolute;
height: 100%;
}
#panel {
position: absolute;
max-height: 90%;
overflow-y: auto;
top: 80px;
right: 10px;
width: 280px;
}
.map-address {
position: absolute;
line-height: 20px;
bottom: -30px;
}
</style>
...@@ -20,8 +20,10 @@ import "default-passive-events" ...@@ -20,8 +20,10 @@ import "default-passive-events"
import notice from "@/common/notice" import notice from "@/common/notice"
import "element-ui/lib/theme-chalk/index.css" import "element-ui/lib/theme-chalk/index.css"
import { config } from "@/common/baseConfig" import { config } from "@/common/baseConfig"
import GLMapSdk from "@/common/glsk-mapapi-sdk"
// import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建) // import { GLCombiForm } from "glsx-components" // 权限按钮 (根据权限动态创建)
import VueLazyload from "vue-lazyload" import VueLazyload from "vue-lazyload"
Vue.prototype.$mapapi = new GLMapSdk()
Vue.use(VueLazyload, { Vue.use(VueLazyload, {
// 懒加载默认加载图片 // 懒加载默认加载图片
loading: loading:
...@@ -124,7 +126,7 @@ fetch( ...@@ -124,7 +126,7 @@ fetch(
.then((response) => { .then((response) => {
const { code, data } = response const { code, data } = response
// console.log("response", response) // console.log("response", response)
// response.axios.baseURL = 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router' // response.axios.baseURL = 'https://dj.test.glsx.com.cn/rop-dj-smartcarlife/router'
// response.axios.baseURL = 'http://192.168.1.104:8392/rop-dj-smartcarlife/router' // response.axios.baseURL = 'http://192.168.1.104:8392/rop-dj-smartcarlife/router'
if (code == "200") { if (code == "200") {
......
<template>
<el-drawer title="新增商户" :visible.sync="addMerVisible" size="50%" direction="rtl" :wrapperClosable="wrapperClosable" :before-close="handleClose">
<div class="">
<glsx-combi-form class="edit-form-container" ref="addFormRef" :isBlock="isBlock" label-width="150px" default-width="400px" :form-ref="editChildRef" :form-obj="editData" :form-data="editFormData" :form-rules="formRules">
<ProvinceCity slot="provinceCity" ref="provinceForm" :subdistrict="subdistrict" @selectProvince="selectProvince" @selectCity="selectCity" :detailAddressLabel="detailAddressLabel" @selectAddressByMap="selectAddressByMap"></ProvinceCity>
<select-brand slot="selectBrand" :brandListTree="brandListTree" @clickBrand="clickBrand" ref="brandListTree"></select-brand>
</glsx-combi-form>
</div>
</el-drawer>
</template>
<script>
import SelectBrand from '@/components/SelectBrand/index.vue'
import ProvinceCity from '@/components/province-city/index.vue'
export default {
name: 'AddMerchant',
components: {
ProvinceCity,
SelectBrand
},
props: {
addMerVisible: false
},
data() {
//这里存放数据
return {
wrapperClosable: false,
// 地址
subdistrict: 2,
detailAddressLabel: ' ',
// 品牌
brandListTree: [],
isFirstBrand: false,
// 表单
isBlock: true,
editChildRef: 'editChildRef',
formRules: {},
editData: {},
editFormData: [{
name: '',
label: '商户类型',
type: 'radio',
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'merchantList',
optionList: [],
// isDisabled: false,
// style: { width: '520px' },
handleRadioChange: () => { }
}, {
label: "账户等级",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: 'accountLevelList'
}, {
label: "上级商户",
name: 'parentMerchantId',
type: 'select',
optionList: [],
optionId: 'merchantId',
optionLabel: 'merchantName',
optionsName: 'parentMerchantList'
}, {
label: "渠道",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: ''
}, {
label: "选择开通模式",
name: '',
type: 'select',
optionList: [],
optionId: 'confId',
optionLabel: 'confLabel',
optionsName: ''
}, {
label: '商户名称',
name: '',
type: 'input',
maxlength: 50
}, {
label: '联系电话',
name: '',
type: 'input',
maxlength: 11
}, {
label: '',
name: '',
addHtml: 'provinceCity'
}, {
label: '主营品牌',
name: '',
addHtml: 'selectBrand'
}, {
label: '登录账号',
name: '',
type: 'input',
maxlength: 15
}, {
label: '登录密码',
name: '',
type: 'input',
maxlength: 20
}],
baseData: {
merchantList: [],
accountLevelList: [],
parentMerchantList: []
}
}
},
//方法集合
methods: {
handleClose() {
this.$emit('handleClose')
},
checkBrandList() {
// let merchantBrandMain = chant.filter(item => item)
// this.$set(this.editData, 'merchantBrandMain', merchantBrandMain)
if (!this.editData.merchantBrandMain) {
this.editData.merchantBrandMain = []
}
this.brandList()
// this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain)
},
async brandList() {
this.$refs.brandListTree.loading = true
const brandListTree = await this.$apis.baseInfo.brandList({})
brandListTree.forEach(item => {
let child = item.children
if (!child) return
child.forEach(k => {
delete k.children
})
})
this.brandListTree = brandListTree
this.$refs.brandListTree.getCheckList(this.editData.merchantBrandMain)
this.$nextTick(() => {
this.$refs.brandListTree.loading = false
})
},
// 点击主营品牌
clickBrand(val) {
if (!this.isFirstBrand) {
// this.brandList()
this.isFirstBrand = true
}
},
// 当直接点击选择地址时,获取省市ID
init(province, city) {
this.$refs.provinceForm.init(province, city)
},
// 获取省
selectProvince(val) {
console.log(val)
this.$set(this.editData, 'merchantAddress', '')
// 强制更新 merchantAddress
this.$forceUpdate()
this.editData.cityName = ''
this.editData.provinceName = val.name
this.editData.provinceCode = val.adcode
},
// 获取市
selectCity(val) {
console.log(val)
if (val.name) {
this.editData.cityName = val.name
this.editData.cityCode = val.adcode
} else {
this.editData.cityName = ''
this.editData.cityCode = ''
}
this.$set(this.editData, 'merchantAddress', '')
this.$forceUpdate()
},
// 通过地图选择省市和详细地址
selectAddressByMap(val) {
console.log(val)
const { provinceName, cityName, fullAddress, lat, lng } = val
this.editData.merchantAddress = fullAddress
this.editData.provinceName = provinceName
this.editData.cityName = cityName
this.editData.lat = lat
this.editData.lng = lng
},
}
};
</script>
<style scoped>
</style>
export const busiModeList = [
{
confId: "1",
confName: "直营渠道"
},
{
confId: "2",
confName: "经销商投资"
},
{
confId: "3",
confName: "服务商投资"
},
{
confId: "4",
confName: "服务商渠道"
}
]
export const operationModeList = [
{
confId: "0",
confName: "非直营"
},
{
confId: "1",
confName: "直营"
}
]
...@@ -4,7 +4,9 @@ ...@@ -4,7 +4,9 @@
<!-- 基础信息 --> <!-- 基础信息 -->
<base-info></base-info> <base-info></base-info>
<!-- 流量方信息 --> <!-- 流量方信息 -->
<shop-merchant-info></shop-merchant-info> <shop-merchant-info :edit-data="editData" @addMerchant="handleAddMerchant"></shop-merchant-info>
<!-- 流量方信息 - 新增 - 新增商户 -->
<add-merchant :addMerVisible="addMerVisible" @handleClose="handleAddMerchant"></add-merchant>
<!-- 上架商品及测算 --> <!-- 上架商品及测算 -->
<goods-info></goods-info> <goods-info></goods-info>
<!-- 分账配置 --> <!-- 分账配置 -->
...@@ -30,6 +32,7 @@ ...@@ -30,6 +32,7 @@
import { mapActions } from 'vuex' import { mapActions } from 'vuex'
import BaseInfo from './components/editCon/BaseInfo.vue' import BaseInfo from './components/editCon/BaseInfo.vue'
import ShopMerchantInfo from './components/editCon/ShopMerchantInfo' import ShopMerchantInfo from './components/editCon/ShopMerchantInfo'
import AddMerchant from './components/editCon/AddMerchant'
import GoodsInfo from './components/editCon/GoodsInfo.vue' import GoodsInfo from './components/editCon/GoodsInfo.vue'
import DivisionConfig from './components/editCon/DivisionConfig.vue' import DivisionConfig from './components/editCon/DivisionConfig.vue'
import FinanceConfig from './components/editCon/FinanceConfig.vue' import FinanceConfig from './components/editCon/FinanceConfig.vue'
...@@ -38,13 +41,17 @@ export default { ...@@ -38,13 +41,17 @@ export default {
data() { data() {
return { return {
isLoad: true, isLoad: true,
editData: {}, addMerVisible: false,
editData: {
merchantName: '',
},
}; };
}, },
components: { components: {
BaseInfo, BaseInfo,
ShopMerchantInfo, ShopMerchantInfo,
AddMerchant,
GoodsInfo, GoodsInfo,
DivisionConfig, DivisionConfig,
FinanceConfig FinanceConfig
...@@ -60,6 +67,10 @@ export default { ...@@ -60,6 +67,10 @@ export default {
getDetail() { getDetail() {
this.isLoad = false this.isLoad = false
}, },
handleAddMerchant() {
console.log('新建---')
this.addMerVisible = !this.addMerVisible
},
handleConfirm() {}, handleConfirm() {},
handleCancel() { handleCancel() {
this.close({ tagName: '/shelfManage' }) this.close({ tagName: '/shelfManage' })
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!