Commit 0204cb19 by 前端

Merge branch 'kuangyq_dev_2.1.0' into 'v2.1.0'

Kuangyq dev 2.1.0

See merge request !27
2 parents fd516f40 1746214c
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5", "element-ui": "^2.4.5",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.3.6", "glsx-components": "^1.3.9",
"lodash": "^4.17.21", "lodash": "^4.17.21",
"qrcodejs2": "^0.0.2", "qrcodejs2": "^0.0.2",
"vue": "^2.6.10", "vue": "^2.6.10",
...@@ -43,4 +43,4 @@ ...@@ -43,4 +43,4 @@
"> 1%", "> 1%",
"last 2 versions" "last 2 versions"
] ]
}
\ No newline at end of file \ No newline at end of file
}
@import './demo.scss';
img { img {
width: 100%; width: 100%;
height: 100%; height: 100%;
...@@ -134,11 +136,12 @@ img { ...@@ -134,11 +136,12 @@ img {
height: 4px; height: 4px;
} }
::-webkit-scrollbar-thumb { ::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/ /*滚动条里面小方块*/
border-radius: 4px; border-radius: 4px;
background-color: rgba(144, 147, 153, .3); background-color: rgba(144, 147, 153, .3);
} }
.el-message--info { .el-message--info {
height: 40px; height: 40px;
background: #e6e9ff; background: #e6e9ff;
...@@ -147,14 +150,16 @@ img { ...@@ -147,14 +150,16 @@ img {
font-size: 14px; font-size: 14px;
color: rgba(0, 0, 0, 0.65); color: rgba(0, 0, 0, 0.65);
} }
.el-message .el-icon-info { .el-message .el-icon-info {
color: #5850ff; color: #5850ff;
font-size: 16px; font-size: 16px;
} }
.el-cascader-menu { .el-cascader-menu {
max-height:500px; max-height: 500px;
} }
.footer-panel { .footer-panel {
display: flex; display: flex;
align-items: center; align-items: center;
...@@ -166,4 +171,4 @@ img { ...@@ -166,4 +171,4 @@ img {
background: #ffffff; background: #ffffff;
z-index: 999; z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
\ No newline at end of file \ No newline at end of file
}
\ No newline at end of file \ No newline at end of file
...@@ -9,3 +9,29 @@ ...@@ -9,3 +9,29 @@
.align-right { .align-right {
text-align: right; text-align: right;
} }
.table-header {
display: flex;
align-items: center;
justify-content: space-between;
margin-bottom: 10px;
}
.header-text {
font-size: 16px;
color: #333333;
font-weight: 500;
}
.el-button--primary.is-plain {
color: #5850FF;
border-color: #5850FF;
}
.emptyBg {
width: 100%;
img {
width: 64px;
}
}
\ No newline at end of file \ No newline at end of file
import GLCombiForm from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLCombiForm.install = function(Vue) {
Vue.component(GLCombiForm.name, GLCombiForm)
}
// 默认导出组件
export default GLCombiForm
\ No newline at end of file \ No newline at end of file
/**
* 时间控件-限制月份
*/
export const beforeRangePickerOptions = {
disabledDate(date) {
if (date > new Date()) {
return true
}
return false
}
}
export const afterRangePickerOptions = {
disabledDate(date) {
const yesterday = new Date(new Date().setDate(new Date().getDate() - 1))
if (date < yesterday) {
return true
}
return false
}
}
import GLSearch from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearch.install = function(Vue) {
Vue.component(GLSearch.name, GLSearch)
}
// 默认导出组件
export default GLSearch
\ No newline at end of file \ No newline at end of file
<!-- <content> -->
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
<el-button type="warning" @click="toggleShow(1)">显示代码</el-button>
```js {mixin:true}
{
data() {
return {
demo1: true,
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods:{
toggleShow(num){
// console.log(123)
this['demo' + num] = !this['demo' + num]
},
//gl-search 方法
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
```
# 用来作为 markdown 代码的示例部分
<div v-if="demo1">
```vue
<template>
<GLSearch @onOk="handleOkFn" @onRest="handleRestFn">
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-select v-model="value" size="small" placeholder="请选择">
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</GLSearchItem>
<GLSearchItem>
<div slot="name">我是文本输入框</div>
<el-date-picker size="small" v-model="value1" type="datetimerange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
</GLSearchItem>
<GLSearchItem>
<el-select v-model="selvalue" placeholder="请选择" size="small" slot="name">
<el-option v-for="item in seloptions" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
<el-input size="small" v-model="input" placeholder="请输入内容"></el-input>
</GLSearchItem>
</GLSearch>
</template>
<script>
import {GLSearch, GLSearchItem} from 'glsx-components'
// 全局引入一次css即可
import 'glsx-components/dist/glsx-components.css'
export default {
data() {
return {
//gl-search数据
input: '',
options: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎'
},
{
value: '选项4',
label: '龙须面'
},
{
value: '选项5',
label: '北京烤鸭'
}
],
value: '',
value1: [new Date(2000, 10, 10, 10, 10), new Date(2000, 10, 11, 10, 10)],
seloptions: [
{
value: '选项1',
label: '黄金糕'
},
{
value: '选项2',
label: '双皮奶'
},
{
value: '选项3',
label: '蚵仔煎北京烤鸭'
},
{
value: '选项4',
label: '龙须面北京烤鸭'
},
{
value: '选项5',
label: '北京烤鸭北京烤鸭'
}
],
selvalue: ''
}
},
methods: {
handleOkFn() {
console.log('您点击了确定')
},
handleRestFn() {
console.log('您点击了取消')
}
}
}
</script>
```
</div>
<!-- </content> -->
<template>
<div class="gl-search" id="gl-search" :class="{ transTo: !expand }">
<div class="search-list">
<!-- 默认插槽 -->
<slot></slot>
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
<!-- <div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div>
<div class="search-item">
<div class="name">我是文本输入框</div>
<div class="input">
<el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input>
</div>
</div> -->
</div>
<div class="gl-operate">
<div class="operate">
<el-button size="small" type="primary" @click="handleOk">查询</el-button>
<el-button size="small" @click="handleRest">重置</el-button>
<el-button type="text" size="small" @click="expandFn" v-if="hasExpand">
<span>{{ !expand ? '展开' : '收起' }}</span>
<i class="expand" :class="classIcon"></i>
</el-button>
<!-- <i class="el-icon-arrow-down expand"></i> -->
<!-- <i class="el-icon-arrow-up"></i> -->
</div>
</div>
</div>
</template>
<script>
export default {
name: 'GLSearch',
props: {},
data() {
return {
// input: '',
expand: false,
itemNum: 0,
time: null,
hasExpand: false
}
},
created() {},
mounted() {
this.getItemNum()
// 判断宽度按,是否显示展开收起
this.getClientWith()
window.addEventListener('resize', this.getClientWith, false)
},
computed: {
classIcon() {
return !this.expand ? 'el-icon-arrow-down' : 'el-icon-arrow-up'
}
},
methods: {
// 展开收起
expandFn() {
this.expand = !this.expand
},
// 获取item 输入框 的个数
getItemNum() {
const items = document.getElementById('gl-search').getElementsByClassName('search-item').length
this.itemNum = items
},
// 判断是否有展开收起标志
ifHasExpand(nowCol) {
if (this.itemNum > nowCol) {
return true
}
return false
},
// 监听函数
getClientWith() {
if (this.time) clearTimeout(this.time)
this.time = setTimeout(() => {
const clientWidth = document.documentElement.clientWidth
// console.log('clientWidth: ', clientWidth)
if (clientWidth <= 800) {
// 1列
this.hasExpand = this.ifHasExpand(1)
} else if (clientWidth <= 1440 && clientWidth > 800) {
// 2列
this.hasExpand = this.ifHasExpand(2)
} else if (clientWidth <= 1720 && clientWidth > 1440) {
// 3列
this.hasExpand = this.ifHasExpand(3)
} else {
// 4列
this.hasExpand = this.ifHasExpand(4)
}
}, 300)
},
handleOk() {
// 点击确定的回调
this.$emit('onOk')
},
handleRest() {
// 点击重置的回调
this.$emit('onRest')
}
},
components: {},
watch: {},
beforeDestroy() {
window.removeEventListener('resize', this.getClientWith, false)
this.time = null
}
}
</script>
<style lang="scss">
.gl-search {
&.transTo {
height: 52px;
}
display: flex;
justify-content: space-between;
overflow: hidden;
// @media screen and (max-width: 1062px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1062px) and (max-width: 1440px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1440px) and (max-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
// @media screen and (min-width: 1720px) {
// .search-list {
// .search-item {
// width: 100%;
// }
// }
// }
.search-list {
.search-item {
width: 100%;
}
}
.search-list {
flex: 1;
display: flex;
flex-wrap: wrap;
.search-item {
// flex: 1;
// padding-right: 12px;
margin-bottom: 20px;
min-width: 276px;
display: flex;
align-items: center;
box-sizing: border-box;
.name {
width: 112px;
text-align: right;
font-size: 14px;
font-weight: 400;
color: #666;
}
.input {
flex: 1;
// width:100%;
}
.el-input {
width: 100%;
}
.el-select {
width: 100%;
}
.el-date-editor {
width: 100%;
}
}
}
.gl-operate {
display: flex;
align-items: flex-end;
.operate {
text-align: left;
width: 190px;
margin-bottom: 20px;
.expand {
font-size: 14px;
}
.el-button + .el-button {
margin-left: 8px;
}
}
}
}
</style>
import GLSearchItem from './src/index.vue'
// 为组件提供 install 安装方法,供按需引入
GLSearchItem.install = function(Vue) {
Vue.component(GLSearchItem.name, GLSearchItem)
}
// 默认导出组件
export default GLSearchItem
\ No newline at end of file \ No newline at end of file
<template>
<div :style="{ 'padding-right': spacer + 'px' }" class="search-item">
<div class="name">
<!-- {{ label }} -->
<!-- name 插槽 -->
<slot name="name"></slot>
</div>
<div class="input">
<!-- 默认插槽 -->
<slot></slot>
<!-- <el-input
size="small"
v-model="input"
placeholder="请输入内容"
></el-input> -->
</div>
</div>
</template>
<script>
export default {
name: 'GLSearchItem',
props: {
// 每个项间隙
spacer: {
type: Number,
default: 12
}
},
data () {
return {}
},
created () {},
mounted () {},
computed: {},
methods: {},
components: {},
watch: {}
}
</script>
...@@ -25,7 +25,8 @@ export default { ...@@ -25,7 +25,8 @@ export default {
return { return {
input: '', input: '',
address: '', address: '',
lnglat: [] lnglat: [],
geocoderAddress: {}
} }
}, },
...@@ -56,7 +57,7 @@ export default { ...@@ -56,7 +57,7 @@ export default {
if (status === 'complete' && result.poiList.pois.length) { if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat) _this.getAddress(lnglat)
} }
}) })
}, },
addMarker(lnglat) { addMarker(lnglat) {
...@@ -76,8 +77,8 @@ export default { ...@@ -76,8 +77,8 @@ export default {
position: position, position: position,
offset: new AMap.Pixel(-10, -10) offset: new AMap.Pixel(-10, -10)
}) })
map.add(marker); map.add(marker)
map.setFitView(); map.setFitView()
}, },
getAddress(e) { getAddress(e) {
console.log(e) console.log(e)
...@@ -99,6 +100,11 @@ export default { ...@@ -99,6 +100,11 @@ export default {
geocoder.getAddress(lnglat, (status, result) => { geocoder.getAddress(lnglat, (status, result) => {
self.lnglat = lnglat self.lnglat = lnglat
self.address = result.regeocode.formattedAddress self.address = result.regeocode.formattedAddress
geocoder.getLocation(self.address, (status, result) => {
if (status === 'complete' && result.info === 'OK') {
this.geocoderAddress = result.geocodes[0]
}
})
}) })
}) })
}, },
......
import { Http } from 'glsx-common'
export const provinceList = function() {
return new Http().get('https://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/provinceList')
}
<template>
<div>
<el-form ref="provinceForm" :model="provinceForm" label-width="80px" inline="true" class="province">
<el-select v-model="provinceForm.provinceName" placeholder="选择省份" @change="selectProvince" class="select-padding">
<el-option v-for="item in AllData" :key="item.provinceCode" :label="item.provinceName" :value="item.provinceName" @click.native="selectProvince(item)"></el-option>
</el-select>
<el-select v-model="provinceForm.cityName" placeholder="选择您所在的市" style="width:250px" @change="selectCity" class="select-padding">
<el-option v-for="item in cityList" :key="item.cityCode" :label="item.cityName" :value="item.cityName" @click.native="selectCity(item)"></el-option>
</el-select>
</el-form>
</div>
</template>
<script>
import { provinceList } from './index'
export default {
name: 'Province',
// props: ['provinceName', 'cityName'],
data() {
return {
provinceList: provinceList(),
AllData: [],
cityList: [{ cityCode: '', cityName: '请先选择省' }],
provinceForm: {
provinceName: '', // 省值
cityName: '', // 市值
provinceCode: '',
cityCode: ''
}
}
},
inject: ['provinceEditAccount'],
mounted() {
// 初始化
this.getProvinceList()
console.log(this.provinceEditAccount, '====')
// if (this.province.provinceName) {
// console.log('++++')
// this.init(this.province.provinceName, this.province.cityName)
// }
},
methods: {
init(provinceName, cityName) {
console.log(provinceName, cityName)
this.provinceForm = {
provinceName: provinceName,
cityName: cityName
}
this.AllData.map(item => {
if (item.provinceName.indexOf(provinceName) != -1) {
this.cityList = item.cityInfoList
this.provinceForm.provinceCode = item.provinceCode
this.cityList.map(itm => {
if (cityName == itm.cityName) {
this.provinceForm.cityCode = itm.cityCode
}
})
}
})
},
async getProvinceList() {
const { provinceInfoList: provinceList } = await this.provinceList
this.AllData = provinceList
// this.$set(this, 'AllData', provinceList)
if (this.provinceEditAccount) {
this.init(this.provinceEditAccount.provinceName, this.provinceEditAccount.cityName)
}
},
// 选择省
selectProvince(val) {
console.log(val)
this.provinceForm.cityName = ''
this.cityList = val.cityInfoList
this.$emit('getProvince', val.provinceName, val.provinceCode)
},
// 选择市
selectCity(val) {
this.$emit('getCity', val.cityName, val.cityCode)
}
}
}
</script>
<style scoped lang="scss">
.province {
display: inline-flex;
}
.select-padding {
margin-right: 10px;
}
</style>
...@@ -3,25 +3,25 @@ ...@@ -3,25 +3,25 @@
* @version: * @version:
* @Author: limin * @Author: limin
* @Date: 2021-06-07 14:12:32 * @Date: 2021-06-07 14:12:32
* @LastEditors: Please set LastEditors * @LastEditors: huyue
* @LastEditTime: 2022-03-15 10:07:01 * @LastEditTime: 2022-04-12 11:11:32
*/ */
// 根据环境引入不同配置 process.env.VUE_APP_ENV // 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js') // let request = require('@/http/request.js')
let cfg = require('./conf.js') let cfg = require('./conf.js')
import { Http } from 'glsx-common' import { Http } from 'glsx-common'
let timeout = 30000 //超时时间 let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) { export const fetchConfig = function(isEnv = false) {
// if (isEnv) { if (isEnv) {
// let { request } = cfg let { request } = cfg
// Object.assign(request, { timeout }) Object.assign(request, { timeout })
// return Promise.resolve(cfg) return Promise.resolve(cfg)
// } }
return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') // return new Http().get('https://oss-config.test.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
// return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config') return new Http().get('http://oss-config.dev.glsx.com.cn/mock/617ba1df1072f92988f05a14/account/config')
} }
export const config = { export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file \ No newline at end of file
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
/* /*
* @Author: your name * @Author: your name
* @Date: 2022-03-02 15:56:07 * @Date: 2022-03-02 15:56:07
* @LastEditTime: 2022-04-02 14:35:06 * @LastEditTime: 2022-04-12 16:36:12
* @LastEditors: your name * @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\setup\qiankun.js * @FilePath: \scrm-micro-settings\src\setup\qiankun.js
*/ */
...@@ -10,14 +10,14 @@ import Vue from 'vue' ...@@ -10,14 +10,14 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js' // import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config' import { fetchConfig } from '@/config'
import ElementUI from 'element-ui' import ElementUI from 'element-ui'
import { GLButton, GLTable, GLFooter } from 'glsx-components' //权限按钮 (根据权限动态创建) import { GLButton, GLTable, GLFooter, GLCombiForm, GLTableButton } from 'glsx-components' //权限按钮 (根据权限动态创建)
import { getRoutes } from '@/router' import { getRoutes } from '@/router'
import GlCombiForm from '@/components/GlCombiForm'
import render from './render' import render from './render'
Vue.use(ElementUI) Vue.use(ElementUI)
Vue.use(GLTable) Vue.use(GLTable)
Vue.use(GLFooter) Vue.use(GLFooter)
Vue.use(GlCombiForm) Vue.use(GLCombiForm)
Vue.use(GLTableButton)
// import GLTable from '@/components/glsx-table/index' // import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable) // Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css' import 'glsx-components/dist/glsx-components.css'
......
...@@ -412,7 +412,7 @@ export default { ...@@ -412,7 +412,7 @@ export default {
this.findAllDictData('business_type') this.findAllDictData('business_type')
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.account-header { .account-header {
......
...@@ -47,6 +47,8 @@ ...@@ -47,6 +47,8 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item size="small" label="商户地址" class="form-row"> <el-form-item size="small" label="商户地址" class="form-row">
<!-- 省市 -->
<ProvinceCity ref="provinceForm" @getProvince="getProvince" @getCity="getCity"></ProvinceCity>
<el-input readonly v-model="accountAddForm.merchantAddress"></el-input> <el-input readonly v-model="accountAddForm.merchantAddress"></el-input>
<el-button type="primary" class="form-btn" @click="hanleSelectMap">选择地址</el-button> <el-button type="primary" class="form-btn" @click="hanleSelectMap">选择地址</el-button>
</el-form-item> </el-form-item>
...@@ -143,9 +145,11 @@ ...@@ -143,9 +145,11 @@
import util from '@/utils/util' import util from '@/utils/util'
import mapView from '@/components/mapView/index' import mapView from '@/components/mapView/index'
import SelectBrand from '../../baseInfo/selectBrand.vue' import SelectBrand from '../../baseInfo/selectBrand.vue'
import ProvinceCity from '@/components/province-city/index.vue'
export default { export default {
name: 'base', name: 'base',
components: { components: {
ProvinceCity,
mapView, mapView,
SelectBrand SelectBrand
}, },
...@@ -191,7 +195,11 @@ export default { ...@@ -191,7 +195,11 @@ export default {
{ validator: validatePhone, trigger: 'blur' } { validator: validatePhone, trigger: 'blur' }
] ]
}, },
brandListTree: [] brandListTree: [],
provinceCode: '',
provinceName: '',
cityCode: '',
cityName: ''
} }
}, },
watch: { watch: {
...@@ -201,13 +209,11 @@ export default { ...@@ -201,13 +209,11 @@ export default {
}, },
methods: { methods: {
checkBrandList(chant) { checkBrandList(chant) {
let merchantBrandMain = chant.filter(item=>item) let merchantBrandMain = chant.filter(item => item)
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain) this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) { if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = [] this.accountAddForm.merchantBrandMain = []
} }
console.log(this.accountAddForm.merchantBrandMain)
this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain) this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain)
}, },
checkBusinessType(type) { checkBusinessType(type) {
...@@ -228,7 +234,7 @@ export default { ...@@ -228,7 +234,7 @@ export default {
const brandListTree = await this.$apis.baseInfo.brandList({}) const brandListTree = await this.$apis.baseInfo.brandList({})
brandListTree.forEach(item => { brandListTree.forEach(item => {
let child = item.children let child = item.children
if(!child) return if (!child) return
child.forEach(k => { child.forEach(k => {
delete k.children delete k.children
}) })
...@@ -255,15 +261,57 @@ export default { ...@@ -255,15 +261,57 @@ export default {
return data.label.indexOf(value) !== -1 return data.label.indexOf(value) !== -1
}, },
getAddress() { getAddress() {
console.log(this.$refs.mapForm.geocoderAddress)
if (!this.$refs.mapForm.address) { if (!this.$refs.mapForm.address) {
this.$message.error('请选择地址') this.$message.error('请选择地址')
return return
} }
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address this.accountAddForm.merchantAddress = this.$refs.mapForm.address
var address = this.accountAddForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat let lnglat = this.$refs.mapForm.lnglat
this.accountAddForm.lat = lnglat.lat this.accountAddForm.lat = lnglat.lat
this.accountAddForm.lng = lnglat.lng this.accountAddForm.lng = lnglat.lng
var fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
// 获取省市
var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city
var province = provinceIdx.slice(0, 2)
var city = cityIdx.slice(0, 2)
// 判断省市是否匹配
if (this.accountAddForm.provinceName) {
this.accountAddForm.provinceName = this.accountAddForm.provinceName.slice(0, 2)
this.accountAddForm.cityName = this.accountAddForm.cityName.slice(0, 2)
if (this.accountAddForm.provinceName !== province || this.accountAddForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择')
this.accountAddForm.merchantAddress = ''
return
}
}
this.dialogMapVisible = false
this.accountAddForm.provinceName = province
this.accountAddForm.cityName = city
this.$refs.provinceForm.init(province, city)
const { provinceCode, cityCode } = this.$refs.provinceForm.provinceForm
this.accountAddForm.provinceCode = provinceCode
this.accountAddForm.cityCode = cityCode
},
// 当直接点击选择地址时,获取省市ID
init(province, city) {
this.$refs.provinceForm.init(province, city)
},
// 获取省
getProvince(provinceName, provinceCode) {
this.$set(this.accountAddForm, 'merchantAddress', '')
// 强制更新 merchantAddress
this.$forceUpdate()
this.accountAddForm.provinceName = provinceName
this.accountAddForm.provinceCode = provinceCode
},
// 获取市
getCity(cityName, cityCode) {
this.accountAddForm.cityName = cityName
this.accountAddForm.cityCode = cityCode
this.accountAddForm.merchantAddress = ''
}, },
delImg(index) { delImg(index) {
this.accountAddForm.merchantFiles.splice(index, 1) this.accountAddForm.merchantFiles.splice(index, 1)
...@@ -321,7 +369,7 @@ export default { ...@@ -321,7 +369,7 @@ export default {
this.brandList() this.brandList()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.base-info { .base-info {
...@@ -459,4 +507,4 @@ export default { ...@@ -459,4 +507,4 @@ export default {
} }
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -72,7 +72,6 @@ export default { ...@@ -72,7 +72,6 @@ export default {
}, },
methods: { methods: {
handleClik(tab, event) { handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name const tabId = tab.name
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId) const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : '' this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
...@@ -81,7 +80,6 @@ export default { ...@@ -81,7 +80,6 @@ export default {
this.$parent.editStatus = true this.$parent.editStatus = true
this.productTab = data.length != 0 ? data[data.length - 1].productId : '' this.productTab = data.length != 0 ? data[data.length - 1].productId : ''
const { tabName, tabMenu, productTab } = this const { tabName, tabMenu, productTab } = this
console.log(tabName, data)
// 设置全选 // 设置全选
var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses var arr = tabMenu.find(i => i.accounttypeId == tabName).products.find(j => j.productId == productTab).merchantProTreeResponses
this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr)) this.$refs[`tree_${tabName}_${productTab}`][0].setCheckedKeys(this.getAllId(arr))
...@@ -108,7 +106,6 @@ export default { ...@@ -108,7 +106,6 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
this.addStyle() this.addStyle()
}) })
console.log(this.tabMenu)
this.accountTypes = tabMenu.map(item => { this.accountTypes = tabMenu.map(item => {
return { return {
products: null, products: null,
...@@ -128,7 +125,6 @@ export default { ...@@ -128,7 +125,6 @@ export default {
account = 'accountTypeSearchRequest' account = 'accountTypeSearchRequest'
} }
this.$apis.store[account](params).then(res => { this.$apis.store[account](params).then(res => {
console.log(res)
let tabMenu = res let tabMenu = res
this.accountList = tabMenu.map(item => { this.accountList = tabMenu.map(item => {
return { return {
...@@ -140,8 +136,6 @@ export default { ...@@ -140,8 +136,6 @@ export default {
// productId: '' // productId: ''
} }
}) })
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => { this.accountTypes = tabMenu.map(item => {
return { return {
products: null, products: null,
...@@ -160,9 +154,7 @@ export default { ...@@ -160,9 +154,7 @@ export default {
this.$apis.store.findPermissionsByMerId(params).then(res => { this.$apis.store.findPermissionsByMerId(params).then(res => {
this.tabMenu_x = util.deepClone(res) this.tabMenu_x = util.deepClone(res)
res.forEach(item => { res.forEach(item => {
console.log(item)
this.accountList.forEach(itm => { this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) { if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm) this.tabMenu.push(itm)
item.products.forEach(i => { item.products.forEach(i => {
...@@ -192,7 +184,6 @@ export default { ...@@ -192,7 +184,6 @@ export default {
this.accountList = util.deepClone(this.tabMenu_s) this.accountList = util.deepClone(this.tabMenu_s)
this.tabMenu_x.forEach(item => { this.tabMenu_x.forEach(item => {
this.accountList.forEach(itm => { this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) { if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm) this.tabMenu.push(itm)
item.products.forEach(i => { item.products.forEach(i => {
...@@ -244,7 +235,6 @@ export default { ...@@ -244,7 +235,6 @@ export default {
this.uniteChildSame(currentObj, true) this.uniteChildSame(currentObj, true)
} else { } else {
// 未选中 处理子节点全部未选中 // 未选中 处理子节点全部未选中
console.log(currentObj)
if (currentObj.children !== null) { if (currentObj.children !== null) {
if (currentObj.children.length !== 0) { if (currentObj.children.length !== 0) {
this.uniteChildSame(currentObj, false) this.uniteChildSame(currentObj, false)
...@@ -290,7 +280,6 @@ export default { ...@@ -290,7 +280,6 @@ export default {
uniteChildSame(treeList, isSelected) { uniteChildSame(treeList, isSelected) {
const tree_ref = `tree_${this.tabName}_${this.productTab}` const tree_ref = `tree_${this.tabName}_${this.productTab}`
this.$refs[tree_ref][0].setChecked(treeList.id, isSelected) this.$refs[tree_ref][0].setChecked(treeList.id, isSelected)
console.log(treeList)
if (treeList.children !== null) { if (treeList.children !== null) {
for (let i = 0; i < treeList.children.length; i++) { for (let i = 0; i < treeList.children.length; i++) {
this.uniteChildSame(treeList.children[i], isSelected) this.uniteChildSame(treeList.children[i], isSelected)
...@@ -327,7 +316,6 @@ export default { ...@@ -327,7 +316,6 @@ export default {
let productList = [] let productList = []
item.productsArr.forEach(itm => { item.productsArr.forEach(itm => {
const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : [] const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : []
console.log(checkedNodes)
const menuIdList = checkedNodes const menuIdList = checkedNodes
// .filter((item) => item.logo === "menu") // .filter((item) => item.logo === "menu")
.filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect') .filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect')
...@@ -359,7 +347,6 @@ export default { ...@@ -359,7 +347,6 @@ export default {
}) })
}) })
} }
console.log(menuIdList, functionIdList, functionValueIdLists, list)
if (this.roleType) { if (this.roleType) {
productList.push({ productList.push({
productId: itm.productId, productId: itm.productId,
...@@ -388,7 +375,6 @@ export default { ...@@ -388,7 +375,6 @@ export default {
} }
} }
}) })
console.log(this.accountTypes)
return this.accountTypes return this.accountTypes
} }
}, },
...@@ -496,4 +482,4 @@ export default { ...@@ -496,4 +482,4 @@ export default {
margin-bottom: 12px; margin-bottom: 12px;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -136,6 +136,16 @@ ...@@ -136,6 +136,16 @@
<span class="itemName">主营品牌:</span> <span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span> <span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</el-col> </el-col>
<el-col :span="12" class="flexCol">
<span class="itemName">驻店电话:</span>
<span class="itemValue">{{ firstPageObj.residentPhone || '-' }}</span>
</el-col>
</el-row>
<el-row>
<el-col :span="12" class="flexCol">
<span class="itemName">营业时间:</span>
<span class="itemValue">{{ firstPageObj.bussinessBegintime ? firstPageObj.bussinessBegintime + '-' + firstPageObj.bussinessEndtime : '-' }}</span>
</el-col>
</el-row> </el-row>
</div> </div>
</div> </div>
...@@ -292,13 +302,11 @@ export default { ...@@ -292,13 +302,11 @@ export default {
}, },
{ {
label: '操作人', label: '操作人',
prop: 'userName', prop: 'userName'
width: 180
}, },
{ {
label: '操作时间', label: '操作时间',
prop: 'createdTime', prop: 'createdTime'
width: 180
} }
] ]
}, },
...@@ -348,7 +356,7 @@ export default { ...@@ -348,7 +356,7 @@ export default {
}, },
//将后台返回数据中数值为空的字段全部替换为“-” //将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) { formateNullFieldData(initialData) {
const isEmpty = function (val) { const isEmpty = function(val) {
if (!String(val) || String(val) === 'null') { if (!String(val) || String(val) === 'null') {
return '-' return '-'
} }
...@@ -356,7 +364,7 @@ export default { ...@@ -356,7 +364,7 @@ export default {
} }
var that = this var that = this
if (initialData instanceof Array) { if (initialData instanceof Array) {
initialData.forEach(function (val, key, array) { initialData.forEach(function(val, key, array) {
array[key] = that.formateNullFieldData(val) array[key] = that.formateNullFieldData(val)
}) })
} else if (initialData instanceof Object) { } else if (initialData instanceof Object) {
...@@ -404,7 +412,6 @@ export default { ...@@ -404,7 +412,6 @@ export default {
findMenuFunTreeByMerId() { findMenuFunTreeByMerId() {
this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => { this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => {
if (res) { if (res) {
console.log(res, '功能树的信息')
this.powerDataArray = res this.powerDataArray = res
this.handlerTreeDom() this.handlerTreeDom()
} }
...@@ -451,7 +458,6 @@ export default { ...@@ -451,7 +458,6 @@ export default {
}) })
) )
this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval) this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval)
console.log(this.merchantProTreeResponsesArray)
this.maxval = maxval - 1 this.maxval = maxval - 1
this.$nextTick(() => { this.$nextTick(() => {
this.changeTreeClass(maxval) this.changeTreeClass(maxval)
...@@ -499,11 +505,8 @@ export default { ...@@ -499,11 +505,8 @@ export default {
// param.pageNum=this.$refs.subMerchantTable.page.pageNum // param.pageNum=this.$refs.subMerchantTable.page.pageNum
this.$apis.merchant.getSecondTable(param).then(res => { this.$apis.merchant.getSecondTable(param).then(res => {
if (res) { if (res) {
console.log('2', res)
let data = this.formateNullFieldData(res) let data = this.formateNullFieldData(res)
this.subMerchantTableList = data this.subMerchantTableList = data
this.subMerchantTableTotal = res.length this.subMerchantTableTotal = res.length
} }
// total > 50?calc(100vh - '199px'): calc(100vh - '152px') // total > 50?calc(100vh - '199px'): calc(100vh - '152px')
...@@ -549,7 +552,6 @@ export default { ...@@ -549,7 +552,6 @@ export default {
this.getFirstInfo() this.getFirstInfo()
this.findMenuFunTreeByMerId() this.findMenuFunTreeByMerId()
this.getSecondInfo() this.getSecondInfo()
this.getSecondTree() this.getSecondTree()
}, },
......
...@@ -130,6 +130,10 @@ export default { ...@@ -130,6 +130,10 @@ export default {
lat: null, lat: null,
lng: null, lng: null,
merchantAddress: null, merchantAddress: null,
provinceName: null,
provinceCode: null,
cityName: null,
cityCode: null,
merchantName: null, merchantName: null,
merchantAbbreviation: null, merchantAbbreviation: null,
merchantType: null, merchantType: null,
...@@ -169,6 +173,11 @@ export default { ...@@ -169,6 +173,11 @@ export default {
} }
} }
}, },
provide() {
return {
provinceEditAccount: this.accountAddForm
}
},
watch: { watch: {
filterText(val) { filterText(val) {
this.$refs.brandTree.filter(val) this.$refs.brandTree.filter(val)
...@@ -314,7 +323,7 @@ export default { ...@@ -314,7 +323,7 @@ export default {
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name) let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',') params.businessScopeCustomize = businessScopeCustomize.join(',')
params.merchantFiles = JSON.stringify(params.merchantFiles) params.merchantFiles = JSON.stringify(params.merchantFiles)
const merchantBrandList = this.$refs.baseInfoForm.$refs.brandListTree.getMerchantBrandList() const merchantBrandList = this.$refs.baseInfoForm.$refs.brandListTree.getMerchantBrandList()
params.merchantBrandListJson = JSON.stringify(merchantBrandList) params.merchantBrandListJson = JSON.stringify(merchantBrandList)
Promise.all([pm1, pm2]).then(() => { Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then(res => { this.$apis.store.updateMerchant(params).then(res => {
...@@ -361,7 +370,7 @@ export default { ...@@ -361,7 +370,7 @@ export default {
}) })
}, },
renderView(res) { renderView(res) {
let { isloginName, bussinessBegintime, bussinessEndtime, lat, merchantBrandMain, businessType, lng, merchantAddress, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessScope, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res let { isloginName, bussinessBegintime, bussinessEndtime, lat, merchantBrandMain, businessType, lng, merchantAddress, provinceName, cityName, provinceCode, cityCode, merchantName, merchantAbbreviation, merchantType, merchantOrgcode, merchantLegalPerson, merchantLegalPersonPhone, residentContact, residentPhone, merchantLoginAccount, merchantLoginPassword, merchantAccountLevel, businessScope, businessScopeCustomize, merchantBrand, merchantFileResponses, merchantModel, accountTypes, accountType, accounttypeId, channelId, status, parentId } = res
this.accountInfoForm.merchantLoginAccount = merchantLoginAccount this.accountInfoForm.merchantLoginAccount = merchantLoginAccount
this.accountInfoForm.merchantLoginPassword = merchantLoginPassword this.accountInfoForm.merchantLoginPassword = merchantLoginPassword
this.accountTypes = accountTypes this.accountTypes = accountTypes
...@@ -407,6 +416,10 @@ export default { ...@@ -407,6 +416,10 @@ export default {
lat, lat,
lng, lng,
merchantAddress, merchantAddress,
provinceName,
cityName,
provinceCode,
cityCode,
merchantName, merchantName,
merchantAbbreviation, merchantAbbreviation,
merchantType, merchantType,
...@@ -423,6 +436,7 @@ export default { ...@@ -423,6 +436,7 @@ export default {
accounttypeId: accountType, accounttypeId: accountType,
merchantBrandMain merchantBrandMain
}) })
// 省市回显
merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',') merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',')
this.$refs.baseInfoForm.checkBrandList(merchantBrandMain) this.$refs.baseInfoForm.checkBrandList(merchantBrandMain)
this.$refs.baseInfoForm.checkBusinessType(businessType) this.$refs.baseInfoForm.checkBusinessType(businessType)
...@@ -446,7 +460,7 @@ export default { ...@@ -446,7 +460,7 @@ export default {
this.findAllDictData() this.findAllDictData()
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.tab-edit-status { .tab-edit-status {
...@@ -611,4 +625,4 @@ export default { ...@@ -611,4 +625,4 @@ export default {
z-index: 999; z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1); box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
} }
</style>
\ No newline at end of file \ No newline at end of file
</style>
...@@ -12,6 +12,7 @@ ...@@ -12,6 +12,7 @@
<div class="information-form-box"> <div class="information-form-box">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px"> <el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px">
<el-form-item size="small" label="商户地址" class="map-row"> <el-form-item size="small" label="商户地址" class="map-row">
<Province ref="provinceForm" @getProvince="getProvince" @getCity="getCity"></Province>
<el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input> <el-input v-model="infoForm.merchantAddress" placeholder="请选择商户地址" readonly="readonly"></el-input>
<el-button @click="hanleSelectMap" type="primary">选择地址</el-button> <el-button @click="hanleSelectMap" type="primary">选择地址</el-button>
</el-form-item> </el-form-item>
...@@ -23,6 +24,10 @@ ...@@ -23,6 +24,10 @@
<el-form-item size="small" label="营业时间" class="time-row"> <el-form-item size="small" label="营业时间" class="time-row">
<el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker> <el-time-picker size="small" value-format="HH:mm:ss" is-range v-model="infoForm.bussinessTime" range-separator="至" start-placeholder="开始时间" end-placeholder="结束时间" placeholder="选择时间范围"></el-time-picker>
</el-form-item> </el-form-item>
<el-form-item size="small" label="驻店电话" style="position: relative;">
<el-input v-model="infoForm.residentPhone" placeholder="此电话会在小程序上显示,请填写真实有效的电话或手机号"></el-input>
<div @click="showTelDia" class="show-address">显示位置</div>
</el-form-item>
<el-form-item size="small" label="主营品牌" style="height: 500px"> <el-form-item size="small" label="主营品牌" style="height: 500px">
<select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand> <select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand>
</el-form-item> </el-form-item>
...@@ -39,27 +44,37 @@ ...@@ -39,27 +44,37 @@
<el-button type="primary" @click="handleSave">提交</el-button> <el-button type="primary" @click="handleSave">提交</el-button>
<el-button @click="goback">取消</el-button> <el-button @click="goback">取消</el-button>
</GLFooter> </GLFooter>
<TelPosition ref="telDialog" :visible.sync="dialogTelVisible"></TelPosition>
</div> </div>
</template> </template>
<script> <script>
import mapView from '@/components/mapView/index' import mapView from '@/components/mapView/index'
import SelectBrand from './selectBrand.vue' import SelectBrand from './selectBrand.vue'
import TelPosition from './telPosition.vue'
import Province from '@/components/province-city/index.vue'
export default { export default {
name: 'EditInfo', name: 'EditInfo',
components: { components: {
Province,
mapView, mapView,
SelectBrand SelectBrand,
TelPosition
}, },
data() { data() {
return { return {
checkedAll: false, checkedAll: false,
filterText: '', filterText: '',
dialogMapVisible: false, dialogMapVisible: false,
dialogTelVisible: false,
mapHeight: 450, mapHeight: 450,
infoForm: { infoForm: {
businessType: [1, 2, 3, 4, 5, 6], businessType: [1, 2, 3, 4, 5, 6],
bussinessTime: [] bussinessTime: [],
provinceName: '',
provinceCode: '',
cityName: '',
cityCode: ''
}, },
businessType: [], businessType: [],
brandListTree: [] brandListTree: []
...@@ -72,9 +87,8 @@ export default { ...@@ -72,9 +87,8 @@ export default {
async brandList() { async brandList() {
this.$refs.brandListTree.loading = true this.$refs.brandListTree.loading = true
this.businessType = await this.$apis.store.findAllDictData({ dictType: 'business_type' }) this.businessType = await this.$apis.store.findAllDictData({ dictType: 'business_type' })
console.log(this.businessType)
const infoForm = await this.$apis.store.findMerchantBaseInfo({ merchantId: this.$globalState.session.merchantId }) const infoForm = await this.$apis.store.findMerchantBaseInfo({ merchantId: this.$globalState.session.merchantId })
const { merchantAddress, lng, lat, id, merchantName, businessType, bussinessTime, bussinessBegintime, bussinessEndtime, channelId, merchantNo, merchantBrandMain } = infoForm const { merchantAddress, provinceName, cityName, provinceCode, cityCode, lng, lat, id, merchantName, businessType, bussinessTime, bussinessBegintime, bussinessEndtime, channelId, merchantNo, merchantBrandMain } = infoForm
this.infoForm = { this.infoForm = {
merchantAddress, merchantAddress,
lng, lng,
...@@ -85,18 +99,21 @@ export default { ...@@ -85,18 +99,21 @@ export default {
bussinessTime: [bussinessBegintime, bussinessEndtime], bussinessTime: [bussinessBegintime, bussinessEndtime],
merchantBrandMain, merchantBrandMain,
merchantNo, merchantNo,
channelId channelId,
provinceName,
cityName,
provinceCode,
cityCode
} }
// 省市回显
this.$refs.provinceForm.init(this.infoForm.provinceName, this.infoForm.cityName)
if (!businessType) { if (!businessType) {
this.infoForm.businessType = [1, 2, 3, 4, 5, 6] this.infoForm.businessType = [1, 2, 3, 4, 5, 6]
} else { } else {
const businessType = this.infoForm.businessType.split(',') const businessType = this.infoForm.businessType.split(',')
this.infoForm.businessType = businessType.map(item => (item = parseInt(item))) this.infoForm.businessType = businessType.map(item => (item = parseInt(item)))
console.log(this.infoForm.businessType)
} }
console.log(this.infoForm.businessType)
const brandListTree = await this.$apis.baseInfo.brandList({}) const brandListTree = await this.$apis.baseInfo.brandList({})
console.log(brandListTree)
brandListTree.forEach(item => { brandListTree.forEach(item => {
let child = item.children let child = item.children
if (!child) return if (!child) return
...@@ -105,7 +122,6 @@ export default { ...@@ -105,7 +122,6 @@ export default {
}) })
}) })
this.brandListTree = brandListTree this.brandListTree = brandListTree
if (!this.infoForm.merchantBrandMain) { if (!this.infoForm.merchantBrandMain) {
this.infoForm.merchantBrandMain = [] this.infoForm.merchantBrandMain = []
} else { } else {
...@@ -130,15 +146,59 @@ export default { ...@@ -130,15 +146,59 @@ export default {
this.$message.error('请选择地址') this.$message.error('请选择地址')
return return
} }
this.dialogMapVisible = false
this.infoForm.merchantAddress = this.$refs.mapForm.address this.infoForm.merchantAddress = this.$refs.mapForm.address
var address = this.infoForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat let lnglat = this.$refs.mapForm.lnglat
this.infoForm.lat = lnglat.lat this.infoForm.lat = lnglat.lat
this.infoForm.lng = lnglat.lng this.infoForm.lng = lnglat.lng
var fullAddress = this.$refs.mapForm.geocoderAddress.addressComponent
// 获取省市
var provinceIdx = fullAddress.province
var cityIdx = fullAddress.city
var province = provinceIdx.slice(0, 2)
var city = cityIdx.slice(0, 2)
// 判断省市是否匹配
if (this.infoForm.provinceName) {
this.infoForm.provinceName = this.infoForm.provinceName.slice(0, 2)
this.infoForm.cityName = this.infoForm.cityName.slice(0, 2)
if (this.infoForm.provinceName !== province || this.infoForm.cityName !== city) {
this.$message.error('您选择的地址错误,请重新选择')
this.infoForm.merchantAddress = ''
return
}
}
this.dialogMapVisible = false
this.infoForm.provinceName = province
this.infoForm.cityName = city
// 当直接点击选择地址时,获取省市ID
this.$refs.provinceForm.init(province, city)
},
// 获取省
getProvince(provinceName, provinceCode) {
this.infoForm.merchantAddress = ''
this.infoForm.provinceName = provinceName
this.infoForm.provinceCode = provinceCode
},
// 获取市
getCity(cityName, cityCode) {
this.infoForm.cityName = cityName
this.infoForm.cityCode = cityCode
this.infoForm.merchantAddress = ''
},
// 展示驻点电话弹框
showTelDia() {
this.$refs.telDialog.init(this.infoForm.residentPhone)
}, },
handleSave() { handleSave() {
const params = this.infoForm const params = this.infoForm
console.log(this.infoForm) // 获取省市信息
const { provinceName, provinceCode, cityName, cityCode } = this.$refs.provinceForm.provinceForm
if (!params.provinceCode) {
params.provinceName = provinceName
params.provinceCode = provinceCode
params.cityName = cityName
params.cityCode = cityCode
}
if (params.bussinessTime) { if (params.bussinessTime) {
params.bussinessBegintime = params.bussinessTime[0] params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1] params.bussinessEndtime = params.bussinessTime[1]
...@@ -197,4 +257,13 @@ export default { ...@@ -197,4 +257,13 @@ export default {
} }
} }
} }
.show-address {
position: absolute;
right: -66px;
top: 50%;
transform: translateY(-50%);
font-size: 14px;
color: #5850ff;
cursor: pointer;
}
</style> </style>
<template>
<div>
<el-dialog :visible.sync="dialogTelVisible" width="30%">
<div class="dialog-show">
<img src="@/assets/tel-show.png" alt="" />
<div class="tel-plus">联系电话:{{ residentPhone }}</div>
</div>
</el-dialog>
</div>
</template>
<script>
export default {
name: 'telPositon',
data() {
return {
dialogTelVisible: false,
residentPhone: ''
}
},
methods: {
init(residentPhone) {
this.dialogTelVisible = true
residentPhone ? (this.residentPhone = residentPhone) : (this.residentPhone = '400-0000-400')
}
}
}
</script>
<style lang="scss" scoped>
.dialog-show {
position: relative;
width: 534px;
height: 650px;
.tel-plus {
position: absolute;
top: 395px;
left: 276px;
height: 25px;
font-size: 16px;
color: #656566;
font-family: PingFangSC-Regular, PingFang SC;
line-height: 25px;
}
}
/deep/ .el-dialog {
background-color: transparent;
box-shadow: 0 1px 3px rgba(0, 0, 0, 0);
}
/deep/ .el-dialog__header {
border-bottom: transparent;
}
/deep/ .el-dialog__headerbtn .el-dialog__close {
color: #191717;
}
/deep/ .el-dialog__headerbtn {
font-size: 23px;
}
</style>
...@@ -10,27 +10,15 @@ ...@@ -10,27 +10,15 @@
</p> </p>
</div> </div>
<div class="follow-form" :style="{ 'min-height': formHeight + 'px' }"> <div class="follow-form" :style="{ 'min-height': formHeight + 'px' }">
<el-form :inline="true" :model="searchForm" class="follow-form-item"> <GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<el-form-item label="跟进专员类型"> <div class="follow-btn">
<el-select size="small" v-model="searchForm.followerTypeId" placeholder="请选择"> <GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<el-option v-for="item in optionsType" :key="item.id" :label="item.followName" :value="item.id"></el-option> <!-- <el-button size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</el-button> -->
</el-select> </div>
</el-form-item>
<el-form-item label="员工搜索">
<el-input size="small" v-model="searchForm.staffName" placeholder="请输入员工姓名"></el-input>
</el-form-item>
<el-form-item>
<el-button @click="handleReset" size="small">重置</el-button>
<el-button type="primary" @click="handleSearch" size="small">查询</el-button>
</el-form-item>
<el-form-item class="follow-form-jump">
<!-- <GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</GLButton> -->
<el-button size="small" icon="el-icon-plus" type="primary" @click="openDrawer">跟进专员</el-button>
</el-form-item>
</el-form>
<GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch"> <GLTable ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="handleSearch">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton fn="删除" type="text" @click="handleDele(scope.scope)">删除</GLButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <el-button fn="删除" type="text" @click="handleDele(scope.scope)">删除</el-button> -->
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -44,11 +32,9 @@ ...@@ -44,11 +32,9 @@
import addSale from './components/addSale' import addSale from './components/addSale'
export default { export default {
name: 'index', name: 'index',
components: { components: {
addSale addSale
}, },
data() { data() {
return { return {
alertStatus: true, alertStatus: true,
...@@ -59,18 +45,23 @@ export default { ...@@ -59,18 +45,23 @@ export default {
followerTypeId: '', followerTypeId: '',
staffName: '' staffName: ''
}, },
optionsType: [ searchFormData: [
{ {
value: '', label: '跟进专员类型',
label: '全部' name: 'followerTypeId',
type: 'select',
placeholder: '全部',
optionsType: [],
optionList: [],
optionId: 'id',
optionLabel: 'followName',
optionsName: 'followName'
}, },
{ {
value: '1', label: '员工搜索',
label: '新车跟进专员' name: 'staffName',
}, type: 'input',
{ placeholder: '请输入员工姓名'
value: '2',
label: '售后跟进专员'
} }
], ],
scope: { scope: {
...@@ -79,7 +70,9 @@ export default { ...@@ -79,7 +70,9 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数 // 表格参数
tableParams: { tableParams: {
tableOption: true, tableOption: {
width: 80
},
mutiSelectName: 'user', mutiSelectName: 'user',
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [ tableColumns: [
...@@ -89,23 +82,28 @@ export default { ...@@ -89,23 +82,28 @@ export default {
}, },
{ {
label: '部门', label: '部门',
prop: 'departmentName' prop: 'departmentName',
minWidth: 100
}, },
{ {
label: '跟进专员类型', label: '跟进专员类型',
prop: 'followerTypeName' prop: 'followerTypeName',
minWidth: 150
}, },
{ {
label: '手机号', label: '手机号',
prop: 'staffPhone' prop: 'staffPhone',
minWidth: 150
}, },
{ {
label: '首次开通时间', label: '首次开通时间',
prop: 'followerCreatedTime' prop: 'followerCreatedTime',
minWidth: 150
}, },
{ {
label: '是否有外部联系人权限', label: '是否有外部联系人权限',
prop: 'isAddOutsider', prop: 'isAddOutsider',
width: '200',
formatter: cellValue => { formatter: cellValue => {
return { return {
0: '是', 0: '是',
...@@ -115,6 +113,24 @@ export default { ...@@ -115,6 +113,24 @@ export default {
} }
] ]
}, },
buttonList: [
{
type: 'GLButton',
name: row => {
return '删除'
},
attrs: {
type: 'text',
fn: '删除'
},
condition: row => {
return true
},
listeners: {
click: this.handleDele
}
}
],
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
tableData: [], tableData: [],
tableTotal: 0 tableTotal: 0
...@@ -158,7 +174,7 @@ export default { ...@@ -158,7 +174,7 @@ export default {
userIds, userIds,
businessTypeId businessTypeId
} }
console.log(params, '1253715427'); console.log(params, '1253715427')
this.$apis.emp.saveFollowerStaff(params).then(res => { this.$apis.emp.saveFollowerStaff(params).then(res => {
if (res) { if (res) {
this.handleClose() this.handleClose()
...@@ -190,6 +206,8 @@ export default { ...@@ -190,6 +206,8 @@ export default {
listEntFollowerType() { listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => { this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.optionsType = [{ followName: '全部', id: '' }].concat(res) this.optionsType = [{ followName: '全部', id: '' }].concat(res)
let idx = this.searchFormData.findIndex(item => item.name == 'followerTypeId')
this.searchFormData[idx].optionList = this.optionsType
}) })
}, },
handleDele(scope) { handleDele(scope) {
...@@ -247,7 +265,7 @@ export default { ...@@ -247,7 +265,7 @@ export default {
this.formHeight = document.documentElement.clientHeight - 230 this.formHeight = document.documentElement.clientHeight - 230
} }
} }
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.slide-fade-enter-active { .slide-fade-enter-active {
...@@ -299,14 +317,6 @@ export default { ...@@ -299,14 +317,6 @@ export default {
background: #ffffff; background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1); box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px; padding: 20px;
/deep/ {
.el-form-item {
margin-right: 20px;
}
.el-button {
margin-left: 20px;
}
}
&-item { &-item {
position: relative; position: relative;
.follow-form-jump { .follow-form-jump {
...@@ -321,4 +331,9 @@ export default { ...@@ -321,4 +331,9 @@ export default {
overflow-y: auto; overflow-y: auto;
} }
} }
</style>
\ No newline at end of file \ No newline at end of file
.follow-btn {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>
<template> <template>
<div class="role-home-page"> <div class="role-home-page">
<div class="top_widget"> <div class="top_widget">
<GLButton size="small" fn="创建角色" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</GLButton> <!-- <GLButton size="small" fn="创建角色" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</GLButton> -->
<!-- <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button> --> <el-button size="small" icon="el-icon-plus" type="primary" @click="toCreatePage">创建角色</el-button>
</div> </div>
<div class="table_widget"> <div class="table_widget">
<div class="search_widget"> <div>
<div class="left_wrap"> <GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="toFindData" @handleRest="reSetFindData"></GLCombiForm>
<div v-if="accountLevel != 4" class="top_select">
<span class="select_label">商户名称</span>
<el-select size="small" clearable filterable v-model="searchForm.merchantId" placeholder="请选择">
<el-option v-for="item in merchantList" :key="item.id" :label="item.merchantName" :value="item.id"></el-option>
</el-select>
</div>
<div class="top_select">
<span class="select_label">状态</span>
<el-select size="small" v-model="searchForm.delFlag" placeholder="请选择">
<el-option v-for="item in optionData" :key="item.value" :label="item.label" :value="item.value"></el-option>
</el-select>
</div>
<div class="top_select">
<span class="select_label">角色名称</span>
<el-input style="width: 76%" size="small" v-model="searchForm.roleName" clearable placeholder="请输入"></el-input>
</div>
</div>
<div class="btn_wrapper">
<el-button size="small" @click="reSetFindData">重置</el-button>
<el-button type="primary" size="small" @click="toFindData">查询</el-button>
</div>
</div> </div>
<GLTable v-if="distoryTable" ref="table" :layout="layout" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData"> <GLTable v-if="distoryTable" ref="table" :tableData="tableData" :tableTotal="tableTotal" :pageConf="pageConf" :tableParams="tableParams" @refreshTable="getTableData">
<template slot="auth-button" slot-scope="scope" :data="scope.scope"> <template slot="auth-button" slot-scope="scope" :data="scope.scope">
<GLButton type="text" @click="toLookPage(scope.scope)" fn="查看">查看</GLButton> <GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<GLButton v-if="!scope.scope.defalutRole" fn="修改" type="text" @click="toEditPage(scope.scope)">修改</GLButton>
<!-- <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button> <!-- <el-button type="text" @click="toLookPage(scope.scope)">查看</el-button>
<el-button v-if="scope.scope.roleName!='超级管理员'" type="text" @click="toEditPage(scope.scope)">修改</el-button> --> <el-button v-if="scope.scope.roleName != '超级管理员'" type="text" @click="toEditPage(scope.scope)">修改</el-button>
<el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button> <el-button v-if="scope.scope.delFlag" type="text" @click="todelete(scope.scope)">删除</el-button> -->
</template> </template>
</GLTable> </GLTable>
</div> </div>
...@@ -49,53 +27,83 @@ export default { ...@@ -49,53 +27,83 @@ export default {
data() { data() {
return { return {
searchForm: { searchForm: {
delFlag: 2, delFlag: '',
roleName: '', roleName: '',
merchantId: '' merchantId: ''
}, },
optionData: [ searchFormData: [
{ {
value: 2, label: '商户名称',
label: '全部' name: 'merchantId',
type: 'select',
placeholder: '全部',
optionList: [],
optionId: 'id',
optionLabel: 'merchantName',
optionsName: 'merchantName',
isHide: true
}, },
{ {
value: 1, label: '状态',
label: '草稿' name: 'delFlag',
type: 'select',
placeholder: '全部',
optionList: [
{
optionId: '',
optionLabel: '全部'
},
{
optionId: 0,
optionLabel: '启用'
},
{
optionId: 1,
optionLabel: '草稿'
}
],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'optionLabel'
}, },
{ {
value: 0, label: '角色名称',
label: '启用' name: 'roleName',
type: 'input'
} }
], ],
//表格配置 //表格配置
layout: 'sizes, prev, pager, next, jumper, ->, total', layout: 'sizes, prev, pager, next, jumper, ->, total',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' }, pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: { tableParams: {
tableOption: true, tableOption: {
width: '150'
},
btnId: new Date().getTime() + parseInt(Math.random() * 1000), btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [ tableColumns: [
{ {
label: '角色名称', label: '角色名称',
prop: 'roleName' prop: 'roleName',
minWidth: '200'
}, },
{ {
label: '角色号', label: '角色号',
prop: 'roleCode' prop: 'roleCode',
minWidth: '200'
}, },
{ {
label: '状态', label: '状态',
prop: 'statusName', prop: 'statusName'
width: '100px'
}, },
{ {
label: '创建时间', label: '创建时间',
prop: 'createdTime', prop: 'createdTime',
width: '160px' width: '180'
}, },
{ {
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
width: '160px', width: '180',
formatter: val => { formatter: val => {
if (!val.updatedTime) { if (!val.updatedTime) {
return '--' return '--'
...@@ -106,6 +114,55 @@ export default { ...@@ -106,6 +114,55 @@ export default {
} }
] ]
}, },
buttonList: [
{
type: 'GLButton',
name: row => {
return '查看'
},
attrs: {
type: 'text',
fn: '查看'
},
condition: row => {
return true
},
listeners: {
click: this.toLookPage
}
},
{
type: 'GLButton',
name: row => {
return '修改'
},
condition: row => {
return !row.defalutRole
},
attrs: {
type: 'text',
fn: '修改'
},
listeners: {
click: this.toEditPage
}
},
{
type: 'el-button',
name: row => {
return '删除'
},
condition: row => {
return row.delFlag
},
attrs: {
type: 'text'
},
listeners: {
click: this.todelete
}
}
],
tableData: [], tableData: [],
merchantList: [], merchantList: [],
tableTotal: 0, tableTotal: 0,
...@@ -120,7 +177,6 @@ export default { ...@@ -120,7 +177,6 @@ export default {
getTableData() { getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm let { delFlag, roleName, merchantId } = this.searchForm
let para = {} let para = {}
console.log(merchantId)
if (!this.distoryTable) { if (!this.distoryTable) {
//代表重置 //代表重置
para = { para = {
...@@ -159,8 +215,10 @@ export default { ...@@ -159,8 +215,10 @@ export default {
this.merchantList = res || [] this.merchantList = res || []
this.merchantList.unshift({ this.merchantList.unshift({
merchantName: '全部', merchantName: '全部',
id: 0 id: ''
}) })
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].optionList = this.merchantList
// this.filterList() // this.filterList()
}) })
}, },
...@@ -179,7 +237,7 @@ export default { ...@@ -179,7 +237,7 @@ export default {
reSetFindData() { reSetFindData() {
this.distoryTable = false this.distoryTable = false
this.searchForm = { this.searchForm = {
delFlag: 2, delFlag: '',
roleName: '', roleName: '',
merchantId: '' merchantId: ''
} }
...@@ -227,9 +285,12 @@ export default { ...@@ -227,9 +285,12 @@ export default {
created() { created() {
const { session } = this.$globalState const { session } = this.$globalState
let accountLevel = session.accountLevel let accountLevel = session.accountLevel
console.log(accountLevel)
if (accountLevel != 4) { if (accountLevel != 4) {
this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName' }) this.tableParams.tableColumns.splice(2, 0, { label: '所属商户名', prop: 'merchantName', width: '300', line: 1 })
this.getMerchantName() this.getMerchantName()
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].isHide = false
} }
this.accountLevel = accountLevel this.accountLevel = accountLevel
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!