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 @@
"el-tree-transfer": "^2.2.6",
"element-ui": "^2.4.5",
"glsx-common": "^1.4.6",
"glsx-components": "^1.3.6",
"glsx-components": "^1.3.9",
"lodash": "^4.17.21",
"qrcodejs2": "^0.0.2",
"vue": "^2.6.10",
......@@ -43,4 +43,4 @@
"> 1%",
"last 2 versions"
]
}
\ No newline at end of file
}
@import './demo.scss';
img {
width: 100%;
height: 100%;
......@@ -134,11 +136,12 @@ img {
height: 4px;
}
::-webkit-scrollbar-thumb {
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 4px;
background-color: rgba(144, 147, 153, .3);
}
.el-message--info {
height: 40px;
background: #e6e9ff;
......@@ -147,14 +150,16 @@ img {
font-size: 14px;
color: rgba(0, 0, 0, 0.65);
}
.el-message .el-icon-info {
color: #5850ff;
font-size: 16px;
}
.el-cascader-menu {
max-height:500px;
max-height: 500px;
}
.footer-panel {
display: flex;
align-items: center;
......@@ -166,4 +171,4 @@ img {
background: #ffffff;
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
\ No newline at end of file
}
\ No newline at end of file
......@@ -9,3 +9,29 @@
.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
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
/**
* 时间控件-限制月份
*/
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
<!-- <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
<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 {
return {
input: '',
address: '',
lnglat: []
lnglat: [],
geocoderAddress: {}
}
},
......@@ -56,7 +57,7 @@ export default {
if (status === 'complete' && result.poiList.pois.length) {
let lnglat = result.poiList.pois[0].location
_this.getAddress(lnglat)
}
}
})
},
addMarker(lnglat) {
......@@ -76,8 +77,8 @@ export default {
position: position,
offset: new AMap.Pixel(-10, -10)
})
map.add(marker);
map.setFitView();
map.add(marker)
map.setFitView()
},
getAddress(e) {
console.log(e)
......@@ -99,6 +100,11 @@ export default {
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]
}
})
})
})
},
......
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 @@
* @version:
* @Author: limin
* @Date: 2021-06-07 14:12:32
* @LastEditors: Please set LastEditors
* @LastEditTime: 2022-03-15 10:07:01
* @LastEditors: huyue
* @LastEditTime: 2022-04-12 11:11:32
*/
// 根据环境引入不同配置 process.env.VUE_APP_ENV
// let request = require('@/http/request.js')
let cfg = require('./conf.js')
import { Http } from 'glsx-common'
let timeout = 30000 //超时时间
export const fetchConfig = function (isEnv = true) {
// if (isEnv) {
// let { request } = cfg
// Object.assign(request, { timeout })
// return Promise.resolve(cfg)
// }
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')
export const fetchConfig = function(isEnv = false) {
if (isEnv) {
let { request } = cfg
Object.assign(request, { timeout })
return Promise.resolve(cfg)
}
// 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')
}
export const config = {
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
\ No newline at end of file
install(vue, cfg) {
vue.prototype.$config = cfg
}
}
/*
* @Author: your name
* @Date: 2022-03-02 15:56:07
* @LastEditTime: 2022-04-02 14:35:06
* @LastEditors: your name
* @LastEditTime: 2022-04-12 16:36:12
* @LastEditors: huyue
* @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
* @FilePath: \scrm-micro-settings\src\setup\qiankun.js
*/
......@@ -10,14 +10,14 @@ import Vue from 'vue'
// import { message } from '@/plugins/element.js'
import { fetchConfig } from '@/config'
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 GlCombiForm from '@/components/GlCombiForm'
import render from './render'
Vue.use(ElementUI)
Vue.use(GLTable)
Vue.use(GLFooter)
Vue.use(GlCombiForm)
Vue.use(GLCombiForm)
Vue.use(GLTableButton)
// import GLTable from '@/components/glsx-table/index'
// Vue.component('GLTable', GLTable)
import 'glsx-components/dist/glsx-components.css'
......
......@@ -412,7 +412,7 @@ export default {
this.findAllDictData('business_type')
}
}
</script>
</script>
<style scoped lang="scss">
.account-header {
......
......@@ -47,6 +47,8 @@
<el-row>
<el-col :span="24">
<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-button type="primary" class="form-btn" @click="hanleSelectMap">选择地址</el-button>
</el-form-item>
......@@ -143,9 +145,11 @@
import util from '@/utils/util'
import mapView from '@/components/mapView/index'
import SelectBrand from '../../baseInfo/selectBrand.vue'
import ProvinceCity from '@/components/province-city/index.vue'
export default {
name: 'base',
components: {
ProvinceCity,
mapView,
SelectBrand
},
......@@ -191,7 +195,11 @@ export default {
{ validator: validatePhone, trigger: 'blur' }
]
},
brandListTree: []
brandListTree: [],
provinceCode: '',
provinceName: '',
cityCode: '',
cityName: ''
}
},
watch: {
......@@ -201,13 +209,11 @@ export default {
},
methods: {
checkBrandList(chant) {
let merchantBrandMain = chant.filter(item=>item)
let merchantBrandMain = chant.filter(item => item)
this.$set(this.accountAddForm, 'merchantBrandMain', merchantBrandMain)
console.log(this.accountAddForm.merchantBrandMain)
if (!this.accountAddForm.merchantBrandMain) {
this.accountAddForm.merchantBrandMain = []
}
console.log(this.accountAddForm.merchantBrandMain)
this.$refs.brandListTree.getCheckList(this.accountAddForm.merchantBrandMain)
},
checkBusinessType(type) {
......@@ -228,7 +234,7 @@ export default {
const brandListTree = await this.$apis.baseInfo.brandList({})
brandListTree.forEach(item => {
let child = item.children
if(!child) return
if (!child) return
child.forEach(k => {
delete k.children
})
......@@ -255,15 +261,57 @@ export default {
return data.label.indexOf(value) !== -1
},
getAddress() {
console.log(this.$refs.mapForm.geocoderAddress)
if (!this.$refs.mapForm.address) {
this.$message.error('请选择地址')
return
}
this.dialogMapVisible = false
this.accountAddForm.merchantAddress = this.$refs.mapForm.address
var address = this.accountAddForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat
this.accountAddForm.lat = lnglat.lat
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) {
this.accountAddForm.merchantFiles.splice(index, 1)
......@@ -321,7 +369,7 @@ export default {
this.brandList()
}
}
</script>
</script>
<style scoped lang="scss">
.base-info {
......@@ -459,4 +507,4 @@ export default {
}
}
}
</style>
\ No newline at end of file
</style>
......@@ -72,7 +72,6 @@ export default {
},
methods: {
handleClik(tab, event) {
console.log(tab, event)
const tabId = tab.name
const productTab = this.tabMenu.find(i => i.accounttypeId == tabId)
this.productTab = productTab.productsArr[0] ? productTab.productsArr[0].productId : ''
......@@ -81,7 +80,6 @@ export default {
this.$parent.editStatus = true
this.productTab = data.length != 0 ? data[data.length - 1].productId : ''
const { tabName, tabMenu, productTab } = this
console.log(tabName, data)
// 设置全选
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))
......@@ -108,7 +106,6 @@ export default {
this.$nextTick(() => {
this.addStyle()
})
console.log(this.tabMenu)
this.accountTypes = tabMenu.map(item => {
return {
products: null,
......@@ -128,7 +125,6 @@ export default {
account = 'accountTypeSearchRequest'
}
this.$apis.store[account](params).then(res => {
console.log(res)
let tabMenu = res
this.accountList = tabMenu.map(item => {
return {
......@@ -140,8 +136,6 @@ export default {
// productId: ''
}
})
console.log(this.accountList)
this.accountTypes = tabMenu.map(item => {
return {
products: null,
......@@ -160,9 +154,7 @@ export default {
this.$apis.store.findPermissionsByMerId(params).then(res => {
this.tabMenu_x = util.deepClone(res)
res.forEach(item => {
console.log(item)
this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
item.products.forEach(i => {
......@@ -192,7 +184,6 @@ export default {
this.accountList = util.deepClone(this.tabMenu_s)
this.tabMenu_x.forEach(item => {
this.accountList.forEach(itm => {
console.log(itm)
if (item.accounttypeId == itm.accounttypeId) {
this.tabMenu.push(itm)
item.products.forEach(i => {
......@@ -244,7 +235,6 @@ export default {
this.uniteChildSame(currentObj, true)
} else {
// 未选中 处理子节点全部未选中
console.log(currentObj)
if (currentObj.children !== null) {
if (currentObj.children.length !== 0) {
this.uniteChildSame(currentObj, false)
......@@ -290,7 +280,6 @@ export default {
uniteChildSame(treeList, isSelected) {
const tree_ref = `tree_${this.tabName}_${this.productTab}`
this.$refs[tree_ref][0].setChecked(treeList.id, isSelected)
console.log(treeList)
if (treeList.children !== null) {
for (let i = 0; i < treeList.children.length; i++) {
this.uniteChildSame(treeList.children[i], isSelected)
......@@ -327,7 +316,6 @@ export default {
let productList = []
item.productsArr.forEach(itm => {
const checkedNodes = this.$refs[`tree_${item.accounttypeId}_${itm.productId}`] ? this.$refs[`tree_${item.accounttypeId}_${itm.productId}`][0].getCheckedNodes() : []
console.log(checkedNodes)
const menuIdList = checkedNodes
// .filter((item) => item.logo === "menu")
.filter(item => item.logo !== 'function' && item.logo !== 'functionValue' && item.logo !== 'neglect')
......@@ -359,7 +347,6 @@ export default {
})
})
}
console.log(menuIdList, functionIdList, functionValueIdLists, list)
if (this.roleType) {
productList.push({
productId: itm.productId,
......@@ -388,7 +375,6 @@ export default {
}
}
})
console.log(this.accountTypes)
return this.accountTypes
}
},
......@@ -496,4 +482,4 @@ export default {
margin-bottom: 12px;
}
}
</style>
\ No newline at end of file
</style>
......@@ -136,6 +136,16 @@
<span class="itemName">主营品牌:</span>
<span class="itemValue">{{ firstPageObj.merchantBrandName || '-' }}</span>
</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>
</div>
</div>
......@@ -292,13 +302,11 @@ export default {
},
{
label: '操作人',
prop: 'userName',
width: 180
prop: 'userName'
},
{
label: '操作时间',
prop: 'createdTime',
width: 180
prop: 'createdTime'
}
]
},
......@@ -348,7 +356,7 @@ export default {
},
//将后台返回数据中数值为空的字段全部替换为“-”
formateNullFieldData(initialData) {
const isEmpty = function (val) {
const isEmpty = function(val) {
if (!String(val) || String(val) === 'null') {
return '-'
}
......@@ -356,7 +364,7 @@ export default {
}
var that = this
if (initialData instanceof Array) {
initialData.forEach(function (val, key, array) {
initialData.forEach(function(val, key, array) {
array[key] = that.formateNullFieldData(val)
})
} else if (initialData instanceof Object) {
......@@ -404,7 +412,6 @@ export default {
findMenuFunTreeByMerId() {
this.$apis.merchant.findMenuFunTreeByMerId({ id: this.merchantId }).then(res => {
if (res) {
console.log(res, '功能树的信息')
this.powerDataArray = res
this.handlerTreeDom()
}
......@@ -451,7 +458,6 @@ export default {
})
)
this.merchantProTreeResponsesArray = this.toContiuneTree(this.merchantProTreeResponsesArray, 0, maxval)
console.log(this.merchantProTreeResponsesArray)
this.maxval = maxval - 1
this.$nextTick(() => {
this.changeTreeClass(maxval)
......@@ -499,11 +505,8 @@ export default {
// param.pageNum=this.$refs.subMerchantTable.page.pageNum
this.$apis.merchant.getSecondTable(param).then(res => {
if (res) {
console.log('2', res)
let data = this.formateNullFieldData(res)
this.subMerchantTableList = data
this.subMerchantTableTotal = res.length
}
// total > 50?calc(100vh - '199px'): calc(100vh - '152px')
......@@ -549,7 +552,6 @@ export default {
this.getFirstInfo()
this.findMenuFunTreeByMerId()
this.getSecondInfo()
this.getSecondTree()
},
......
......@@ -130,6 +130,10 @@ export default {
lat: null,
lng: null,
merchantAddress: null,
provinceName: null,
provinceCode: null,
cityName: null,
cityCode: null,
merchantName: null,
merchantAbbreviation: null,
merchantType: null,
......@@ -169,6 +173,11 @@ export default {
}
}
},
provide() {
return {
provinceEditAccount: this.accountAddForm
}
},
watch: {
filterText(val) {
this.$refs.brandTree.filter(val)
......@@ -314,7 +323,7 @@ export default {
let businessScopeCustomize = this.businessScopeCustomize.map(item => item.name)
params.businessScopeCustomize = businessScopeCustomize.join(',')
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)
Promise.all([pm1, pm2]).then(() => {
this.$apis.store.updateMerchant(params).then(res => {
......@@ -361,7 +370,7 @@ export default {
})
},
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.merchantLoginPassword = merchantLoginPassword
this.accountTypes = accountTypes
......@@ -407,6 +416,10 @@ export default {
lat,
lng,
merchantAddress,
provinceName,
cityName,
provinceCode,
cityCode,
merchantName,
merchantAbbreviation,
merchantType,
......@@ -423,6 +436,7 @@ export default {
accounttypeId: accountType,
merchantBrandMain
})
// 省市回显
merchantBrandMain = merchantBrandMain.replaceAll(';', ',').split(',')
this.$refs.baseInfoForm.checkBrandList(merchantBrandMain)
this.$refs.baseInfoForm.checkBusinessType(businessType)
......@@ -446,7 +460,7 @@ export default {
this.findAllDictData()
}
}
</script>
</script>
<style scoped lang="scss">
.tab-edit-status {
......@@ -611,4 +625,4 @@ export default {
z-index: 999;
box-shadow: 0px -1px 1px 0px rgba(88, 80, 255, 0.1);
}
</style>
\ No newline at end of file
</style>
......@@ -12,6 +12,7 @@
<div class="information-form-box">
<el-form ref="baseForm" :model="infoForm" class="account-body-form" label-width="120px">
<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-button @click="hanleSelectMap" type="primary">选择地址</el-button>
</el-form-item>
......@@ -23,6 +24,10 @@
<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-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">
<select-brand :brandListTree="brandListTree" ref="brandListTree"></select-brand>
</el-form-item>
......@@ -39,27 +44,37 @@
<el-button type="primary" @click="handleSave">提交</el-button>
<el-button @click="goback">取消</el-button>
</GLFooter>
<TelPosition ref="telDialog" :visible.sync="dialogTelVisible"></TelPosition>
</div>
</template>
<script>
import mapView from '@/components/mapView/index'
import SelectBrand from './selectBrand.vue'
import TelPosition from './telPosition.vue'
import Province from '@/components/province-city/index.vue'
export default {
name: 'EditInfo',
components: {
Province,
mapView,
SelectBrand
SelectBrand,
TelPosition
},
data() {
return {
checkedAll: false,
filterText: '',
dialogMapVisible: false,
dialogTelVisible: false,
mapHeight: 450,
infoForm: {
businessType: [1, 2, 3, 4, 5, 6],
bussinessTime: []
bussinessTime: [],
provinceName: '',
provinceCode: '',
cityName: '',
cityCode: ''
},
businessType: [],
brandListTree: []
......@@ -72,9 +87,8 @@ export default {
async brandList() {
this.$refs.brandListTree.loading = true
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 { 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 = {
merchantAddress,
lng,
......@@ -85,18 +99,21 @@ export default {
bussinessTime: [bussinessBegintime, bussinessEndtime],
merchantBrandMain,
merchantNo,
channelId
channelId,
provinceName,
cityName,
provinceCode,
cityCode
}
// 省市回显
this.$refs.provinceForm.init(this.infoForm.provinceName, this.infoForm.cityName)
if (!businessType) {
this.infoForm.businessType = [1, 2, 3, 4, 5, 6]
} else {
const businessType = this.infoForm.businessType.split(',')
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({})
console.log(brandListTree)
brandListTree.forEach(item => {
let child = item.children
if (!child) return
......@@ -105,7 +122,6 @@ export default {
})
})
this.brandListTree = brandListTree
if (!this.infoForm.merchantBrandMain) {
this.infoForm.merchantBrandMain = []
} else {
......@@ -130,15 +146,59 @@ export default {
this.$message.error('请选择地址')
return
}
this.dialogMapVisible = false
this.infoForm.merchantAddress = this.$refs.mapForm.address
var address = this.infoForm.merchantAddress
let lnglat = this.$refs.mapForm.lnglat
this.infoForm.lat = lnglat.lat
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() {
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) {
params.bussinessBegintime = params.bussinessTime[0]
params.bussinessEndtime = params.bussinessTime[1]
......@@ -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>
<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 @@
</p>
</div>
<div class="follow-form" :style="{ 'min-height': formHeight + 'px' }">
<el-form :inline="true" :model="searchForm" class="follow-form-item">
<el-form-item label="跟进专员类型">
<el-select size="small" v-model="searchForm.followerTypeId" placeholder="请选择">
<el-option v-for="item in optionsType" :key="item.id" :label="item.followName" :value="item.id"></el-option>
</el-select>
</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>
<GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="handleSearch" @handleRest="handleReset"></GLCombiForm>
<div class="follow-btn">
<GLButton fn="新增" size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</GLButton>
<!-- <el-button size="small" icon="el-icon-plus" type="primary" plain @click="openDrawer">跟进专员</el-button> -->
</div>
<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">
<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>
</GLTable>
</div>
......@@ -44,11 +32,9 @@
import addSale from './components/addSale'
export default {
name: 'index',
components: {
addSale
},
data() {
return {
alertStatus: true,
......@@ -59,18 +45,23 @@ export default {
followerTypeId: '',
staffName: ''
},
optionsType: [
searchFormData: [
{
value: '',
label: '全部'
label: '跟进专员类型',
name: 'followerTypeId',
type: 'select',
placeholder: '全部',
optionsType: [],
optionList: [],
optionId: 'id',
optionLabel: 'followName',
optionsName: 'followName'
},
{
value: '1',
label: '新车跟进专员'
},
{
value: '2',
label: '售后跟进专员'
label: '员工搜索',
name: 'staffName',
type: 'input',
placeholder: '请输入员工姓名'
}
],
scope: {
......@@ -79,7 +70,9 @@ export default {
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
tableOption: true,
tableOption: {
width: 80
},
mutiSelectName: 'user',
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
......@@ -89,23 +82,28 @@ export default {
},
{
label: '部门',
prop: 'departmentName'
prop: 'departmentName',
minWidth: 100
},
{
label: '跟进专员类型',
prop: 'followerTypeName'
prop: 'followerTypeName',
minWidth: 150
},
{
label: '手机号',
prop: 'staffPhone'
prop: 'staffPhone',
minWidth: 150
},
{
label: '首次开通时间',
prop: 'followerCreatedTime'
prop: 'followerCreatedTime',
minWidth: 150
},
{
label: '是否有外部联系人权限',
prop: 'isAddOutsider',
width: '200',
formatter: cellValue => {
return {
0: '是',
......@@ -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',
tableData: [],
tableTotal: 0
......@@ -158,7 +174,7 @@ export default {
userIds,
businessTypeId
}
console.log(params, '1253715427');
console.log(params, '1253715427')
this.$apis.emp.saveFollowerStaff(params).then(res => {
if (res) {
this.handleClose()
......@@ -190,6 +206,8 @@ export default {
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.optionsType = [{ followName: '全部', id: '' }].concat(res)
let idx = this.searchFormData.findIndex(item => item.name == 'followerTypeId')
this.searchFormData[idx].optionList = this.optionsType
})
},
handleDele(scope) {
......@@ -247,7 +265,7 @@ export default {
this.formHeight = document.documentElement.clientHeight - 230
}
}
</script>
</script>
<style scoped lang="scss">
.slide-fade-enter-active {
......@@ -299,14 +317,6 @@ export default {
background: #ffffff;
box-shadow: 0 10px 20px 0 rgba(88, 80, 255, 0.1);
padding: 20px;
/deep/ {
.el-form-item {
margin-right: 20px;
}
.el-button {
margin-left: 20px;
}
}
&-item {
position: relative;
.follow-form-jump {
......@@ -321,4 +331,9 @@ export default {
overflow-y: auto;
}
}
</style>
\ No newline at end of file
.follow-btn {
display: flex;
justify-content: flex-end;
margin-bottom: 20px;
}
</style>
<template>
<div class="role-home-page">
<div class="top_widget">
<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> -->
<!-- <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>
</div>
<div class="table_widget">
<div class="search_widget">
<div class="left_wrap">
<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>
<GLCombiForm ref="showSearch" :formObj="searchForm" :searchSelectObj="searchSelectObj" :formData="searchFormData" :inline="true" @handleOk="toFindData" @handleRest="reSetFindData"></GLCombiForm>
</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">
<GLButton type="text" @click="toLookPage(scope.scope)" fn="查看">查看</GLButton>
<GLButton v-if="!scope.scope.defalutRole" fn="修改" type="text" @click="toEditPage(scope.scope)">修改</GLButton>
<GLTableButton :buttonList="buttonList" :buttonItem="scope.scope"></GLTableButton>
<!-- <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.delFlag" type="text" @click="todelete(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> -->
</template>
</GLTable>
</div>
......@@ -49,53 +27,83 @@ export default {
data() {
return {
searchForm: {
delFlag: 2,
delFlag: '',
roleName: '',
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',
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
tableParams: {
tableOption: true,
tableOption: {
width: '150'
},
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
tableColumns: [
{
label: '角色名称',
prop: 'roleName'
prop: 'roleName',
minWidth: '200'
},
{
label: '角色号',
prop: 'roleCode'
prop: 'roleCode',
minWidth: '200'
},
{
label: '状态',
prop: 'statusName',
width: '100px'
prop: 'statusName'
},
{
label: '创建时间',
prop: 'createdTime',
width: '160px'
width: '180'
},
{
label: '更新时间',
prop: 'updatedTime',
width: '160px',
width: '180',
formatter: val => {
if (!val.updatedTime) {
return '--'
......@@ -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: [],
merchantList: [],
tableTotal: 0,
......@@ -120,7 +177,6 @@ export default {
getTableData() {
let { delFlag, roleName, merchantId } = this.searchForm
let para = {}
console.log(merchantId)
if (!this.distoryTable) {
//代表重置
para = {
......@@ -159,8 +215,10 @@ export default {
this.merchantList = res || []
this.merchantList.unshift({
merchantName: '全部',
id: 0
id: ''
})
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].optionList = this.merchantList
// this.filterList()
})
},
......@@ -179,7 +237,7 @@ export default {
reSetFindData() {
this.distoryTable = false
this.searchForm = {
delFlag: 2,
delFlag: '',
roleName: '',
merchantId: ''
}
......@@ -227,9 +285,12 @@ export default {
created() {
const { session } = this.$globalState
let accountLevel = session.accountLevel
console.log(accountLevel)
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()
let idx = this.searchFormData.findIndex(item => item.name == 'merchantId')
this.searchFormData[idx].isHide = false
}
this.accountLevel = accountLevel
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!