Commit f9b1694a by yangming

end

1 parent 33f0f17f
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: false,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: true,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
// this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: false,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: true,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: true,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
.el-dialog__header,
.el-dialog__footer {
border: none;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="summary-ranking-panel">
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>门店企微客户数排行</span>
<el-radio-group v-model="radioStore" @change="tabRank" size="mini">
<el-radio-button label="1">累计新增</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">累计流失</el-radio-button>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">企微客户数</div>
</div>
<div
class="chart-empty-box"
v-if="custSortList.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in custSortList" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.shopName">
{{ item.shopName }}
</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.custCount) / custSortMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'门店企微客户数均值:' + custAvergCount" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * custAvergCount) / custSortMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.custCount }}</div>
</div>
</div>
</div>
</div>
</div>
<div
class="scrm-box-f summary-ranking-box"
:style="{
height: rankHeight + 'px'
}"
>
<div class="summary-ranking-title scrm-c3">
<span>各门店产值排行</span>
<el-radio-group v-model="radioOutput" size="mini" class="summary-time-select" @change="tabOutput">
<el-radio-button label="1">累计产值</el-radio-button>
<el-radio-button label="2">今日新增</el-radio-button>
<el-radio-button label="3">{{ monthValue }}</el-radio-button>
<el-select v-model="monthValue" placeholder="">
<el-option v-for="item in getBeforeMonth" :key="item" :label="item" :value="item"></el-option>
</el-select>
</el-radio-group>
</div>
<div class="summary-ranking-th">
<div class="summary-ranking-sno">排行</div>
<div class="summary-ranking-name">门店名称</div>
<div class="summary-ranking-value">总产值</div>
</div>
<div
class="chart-empty-box"
v-if="outputRank.length == 0"
:style="{
height: rankHeight - 110 + 'px'
}"
>
<div class="chart-empty">
<img src="@/assets/img/empty.png" />
<div class="chart-empty-d">暂无数据</div>
</div>
</div>
<div class="ranking-td-panel" v-else>
<div class="summary-ranking-td" v-for="(item, index) in outputRank" :key="index">
<div class="summary-ranking-sno">
<span class="ranking-sno-circle2" v-if="index > 2">{{ index + 1 }}</span>
<span class="ranking-sno-circle" v-else>{{ index + 1 }}</span>
</div>
<div class="summary-ranking-name text-hide" :title="item.merchantName">{{ item.merchantName }}</div>
<div class="summary-ranking-value">
<div class="summary-process-panel">
<div class="summary-progress-bar">
<div class="summary-progress-barout"></div>
<div class="summary-progress-barin" :style="{ width: (100 * item.totalOutputValue) / totalOutputValueMax + '%' }"></div>
<el-tooltip class="item" effect="dark" :content="'各门店产值均值:' + averageValue" placement="top">
<div class="summary-progress-avg" :style="{ width: (100 * averageValue) / totalOutputValueMax + '%' }"></div>
</el-tooltip>
</div>
<div class="summary-progress-value">{{ item.totalOutputValue }}</div>
</div>
</div>
</div>
</div>
</div>
<el-dialog center :visible.sync="dialogVisible" width="30%" class="dialog-panel">
<span>您还没有门店,暂无数据,请先创建门店</span>
<span slot="footer" class="dialog-footer">
<el-button type="primary" @click="jumpStore">去创建</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
import util from '@/utils/util'
export default {
name: 'summaryRanking',
data() {
return {
dialogVisible: false,
rankHeight: 0,
custSortMax: 0,
totalOutputValueMax: 0,
averageValue: 0,
custAvergCount: 0,
chartStatus: false,
radioStore: '1',
radioOutput: '1',
custSortList: [],
monthArr: [],
monthValue: new Date().getFullYear() + '年' + new Date().getMonth() + '月',
yearValue: new Date().getFullYear(),
summaryArr: [],
outputRank: [],
getBeforeMonth: util.getBeforeMonth(12)
}
},
watch: {
monthValue() {
if (this.radioOutput == 3) {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
}
},
methods: {
jumpStore() {
this.dialogVisible = false
this.$history.push('/settings/account/index')
},
tabRank() {
this.getSort()
},
tabOutput() {
if (this.radioOutput == 1) {
this.getOutput()
} else if (this.radioOutput == 2) {
this.getOutput(util.getBeforeDate(), util.getBeforeDate())
} else {
let year = this.monthValue.split('年')
let month = year[1].split('月')
this.getOutput(year[0] + '-' + month[0] + '-01', util.getCurrentMonthLast(year[0] + '-' + month[0]))
}
},
getOutput(dataStartDateStr, dataEndDateStr) {
this.$apis.home
.merchantRank({
dataStartDateStr,
dataEndDateStr
})
.then(res => {
this.outputRank = res
this.totalOutputValueMax = 0
this.averageValue = res ? res[0].averageValue : 0
this.outputRank.forEach(item => {
if (item.totalOutputValue >= this.totalOutputValueMax) {
this.totalOutputValueMax = item.totalOutputValue ? item.totalOutputValue : 1
}
})
})
},
getSort() {
this.$apis.home
.getSort({
sortType: this.radioStore
})
.then(res => {
this.custSortList = res.custSortList ? res.custSortList : []
this.custAvergCount = res.custAvergCount
let modelStatus
if (this.$globalState.session.merchantModel == 1 && this.$globalState.session.accountLevel == 1 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.$globalState.session.merchantModel == 2 && this.$globalState.session.accountLevel == 4 && sessionStorage.getItem('wxAcess')) {
modelStatus = true
}
if (this.custSortList.length == 0 && !sessionStorage.getItem('firstStatus') && modelStatus) {
this.dialogVisible = true
sessionStorage.setItem('firstStatus', 1)
return
}
this.custSortMax = 0
this.custSortList.forEach(item => {
if (item.custCount >= this.custSortMax) {
this.custSortMax = item.custCount ? item.custCount : 1
}
})
console.log(this.custSortMax)
})
}
},
mounted() {
let clientHeight = document.documentElement.clientHeight
this.rankHeight = clientHeight - 490
this.getSort()
this.getOutput()
}
}
</script>
<style scoped lang="scss">
.dialog-panel {
/deep/ {
.el-dialog__body {
text-align: center;
}
.el-dialog__header,
.el-dialog__footer {
border: none;
}
}
}
.summary-ranking-panel {
display: flex;
.summary-ranking-box {
width: 50%;
min-height: 220px;
&:first-child {
margin-right: 20px;
}
}
.summary-ranking-title {
height: 64px;
line-height: 64px;
padding: 0px 20px;
display: flex;
justify-content: space-between;
align-items: center;
span {
font-weight: 600;
}
}
.summary-time-select {
position: relative;
/deep/ .el-select {
width: px;
position: absolute;
right: 0px;
top: 5px;
.el-input__inner {
line-height: 20px;
height: 20px;
border: none;
width: 0px;
padding: 0px;
}
.el-input--suffix {
transform: translateX(-50px);
}
.el-input__suffix {
transform: translateX(52px);
right: 0px;
.el-input__icon {
line-height: 20px;
}
}
}
}
.summary-ranking-th {
display: flex;
border-radius: 2px 2px 0px 0px;
height: 46px;
line-height: 46px;
color: #000000;
background: rgba(0, 0, 0, 0.02);
.summary-ranking-sno {
width: 80px;
text-align: center;
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
}
}
.ranking-td-panel {
overflow-y: auto;
height: calc(100% - 110px);
background: #fff;
}
.summary-ranking-td {
display: flex;
height: 30px;
height: 46px;
line-height: 46px;
align-items: center;
color: #333333;
.summary-ranking-sno {
width: 80px;
text-align: center;
.ranking-sno-circle {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: #2a2946;
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
.ranking-sno-circle2 {
display: inline-block;
text-align: center;
line-height: 18px;
width: 18px;
height: 18px;
background: rgba(0, 0, 0, 0.15);
color: #ffffff;
border-radius: 50%;
font-size: 12px;
}
}
.summary-ranking-name {
width: 160px;
}
.summary-ranking-value {
flex: 1;
.summary-process-panel {
position: relative;
line-height: 1;
display: flex;
align-items: center;
.summary-progress-bar {
position: relative;
height: 10px;
flex: 1;
.summary-progress-barout {
width: 100%;
height: 100%;
background-color: #ebeef5;
}
.summary-progress-barin {
position: absolute;
top: 0px;
left: 0px;
height: 100%;
background-color: #5850ff;
}
.summary-progress-avg {
position: absolute;
bottom: -5px;
left: 0px;
height: 2px;
background-color: #fe9c1c;
}
}
.summary-progress-value {
width: 64px;
margin-left: 20px;
}
}
}
}
}
.chart-empty-box {
display: flex;
justify-content: center;
align-items: center;
}
.chart-empty {
width: 100px;
text-align: center;
&-d {
font-size: 14px;
font-weight: 400;
color: #000000;
line-height: 32px;
}
img {
width: 64px;
height: 32px;
}
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
this.$emit('closeDrawer')
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
watch: {
typeIndex: {
handler() {
this.editStatus = true
}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0 && this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
watch: {
typeIndex: {
handler() {
this.editStatus = true
},
deep: true
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0 && this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
this.editStatus = true
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0 && this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
this.editStatus = true
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0 || this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
this.editStatus = true
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0 || this.editStatus) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.editStatus = false
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
<template>
<div class="drawer-sale-panel">
<el-form label-width="150px" :model="addForm">
<div class="scrm-textRight sale-reload">
<el-button size="small" slot="append" type="primary" @click="syncEntmicroIsOutsiderStaff" :loading="loading">同步有外部联系人权限的员工</el-button>
</div>
<el-form-item label="请选择员工">
<div class="sale-select">
<div class="el-input-tag input-tag-wrapper" @click="foucusTagInput">
<el-tag effect="plain" type="info" v-for="(tag, idx) in innerTags" :key="idx" closable :disable-transitions="false" @close="remove(tag)">
<i class="el-icon-user-solid"></i>
{{ tag.staffName }}
</el-tag>
<el-input size="small" v-model.trim="newTag" placeholder="选择员工" @input="inputTag" style="outline: none; border: none"></el-input>
</div>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="searchEmp">查询</el-button></div>
</div>
<div>
<div class="select-sale-panel">
<select-emp @selectTable="selectTable" ref="selectEmpTabel"></select-emp>
<div class="popper__arrow"></div>
</div>
</div>
</el-form-item>
<el-form-item label="请选择跟进员工类型">
<div class="emp-type">
<div @click="handleType(index)" :class="{ checked: typeIndex == index }" class="emp-type-btn" v-for="(item, index) in empType" :key="index">
{{ item.followName }}
<i class="el-icon-error" @click="delEmpType(item, index)" v-if="!item.commonFlag"></i>
</div>
</div>
<div class="sale-select">
<el-input size="small" v-model="empTypeValue" placeholder="添加类型名称" maxlength="8" show-word-limit></el-input>
<div><el-button size="small" class="sale-select-btn" type="primary" @click="addEmpType">新增</el-button></div>
</div>
<div class="sale-type-desc">跟进员工类型最多新增30个,已新增{{ empType.length - empTypeF.length }}个</div>
</el-form-item>
<el-form-item style="text-align: center">
<el-button @click="onCancel" size="small">取消</el-button>
<el-button type="primary" @click="onSubmit" size="small">确定</el-button>
</el-form-item>
</el-form>
</div>
</template>
<script>
import selectEmp from './selectEmp'
export default {
name: 'addSale',
components: {
selectEmp
},
data() {
return {
loading: false,
editStatus: false,
addForm: {},
typeIndex: 0,
empType: [],
empTypeF: [],
empTypeValue: '',
newTag: '',
innerTags: [],
dialog_temp: {}
}
},
methods: {
init() {
this.newTag = ''
this.innerTags = []
this.empTypeValue = ''
if (this.$refs.selectEmpTabel.listTree.length != 0) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$refs.selectEmpTabel.clearSelection()
}
},
selectTable(val) {
this.innerTags = val
},
listEntFollowerType() {
this.$apis.emp.listEntFollowerType({ merchantId: this.$globalState.session.merchantId }).then(res => {
this.empType = res
this.empTypeF = res.filter(item => item.commonFlag)
})
},
handleType(index) {
this.typeIndex = index
},
foucusTagInput() {
if (this.readOnly || !this.$el.querySelector('.tag-input')) {
return
} else {
this.$el.querySelector('.tag-input').focus()
}
},
remove(row) {
this.$refs.selectEmpTabel.clearSelect(row)
},
//查询
searchEmp() {
this.$refs.selectEmpTabel.listEntmicroStaff(this.newTag)
},
addEmpType() {
if (!this.empTypeValue) {
this.$message.error('请输入类型名称')
return
}
if (this.empType.length == 33) {
this.$message.error('跟进员工类型最多新增30个')
return
}
let params = {
followName: this.empTypeValue,
merchantid: this.$globalState.session.merchantId
}
this.$apis.emp.saveFollowerType(params).then(res => {
this.listEntFollowerType()
})
this.empTypeValue = ''
},
delEmpType(item, index) {
this.$apis.emp.deleteFollowerType({ id: item.id }).then(res => {
if (res) {
this.listEntFollowerType()
this.typeIndex = 0
}
})
},
syncEntmicroIsOutsiderStaff() {
this.loading = true
let params = {
departmentId: 1,
merchantId: this.$globalState.session.merchantId
}
this.$apis.emp.syncEntmicroIsOutsiderStaff(params).then(res => {
if (res) {
this.$refs.selectEmpTabel.listEntmicroStaff()
this.$message({
message: '同步成功',
type: 'success'
})
}
this.loading = false
})
},
onSubmit() {
if (this.innerTags.length == 0) {
this.$message({
message: '请选择员工',
type: 'error'
})
return
}
let userIds = []
this.innerTags.forEach(item => {
userIds.push(item.userId)
})
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
},
onCancel() {
if (this.innerTags.length != 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
}
},
mounted() {
this.listEntFollowerType()
}
}
</script>
<style scoped lang="scss">
.drawer-sale-panel {
padding: 0px 20px;
.sale-reload {
margin-bottom: 10px;
}
.sale-select {
display: flex;
align-items: center;
}
.sale-select-btn {
margin-left: 8px;
}
.sale-type-desc {
font-size: 14px;
font-weight: 400;
color: #adadad;
line-height: 17px;
margin-top: 10px;
}
}
.emp-type {
margin-bottom: 10px;
&-btn {
cursor: pointer;
display: inline-block;
padding: 8px 10px;
margin-bottom: 10px;
margin-right: 10px;
position: relative;
background: #ffffff;
border-radius: 4px;
border: 1px solid #e8e8ea;
line-height: 1;
font-size: 14px;
color: #7d7d7d;
&.checked {
border: 1px solid #5850ff;
color: #5850ff;
}
i {
position: absolute;
right: -6px;
top: -6px;
font-size: 12px;
color: #999999;
}
}
}
.input-tag-wrapper {
position: relative;
font-size: 14px;
background-color: #fff;
background-image: none;
border-radius: 4px;
border: 1px solid #dcdfe6;
box-sizing: border-box;
color: #666;
display: inline-block;
outline: none;
padding: 0 10px 0 5px;
flex-wrap: wrap;
line-height: 32px;
transition: border-color 0.2s cubic-bezier(0.645, 0.045, 0.355, 1);
width: 100%;
display: flex;
align-items: center;
/deep/ input {
/* input { */
/* background-color: red!important; 调试用的样式 */
outline: none !important;
border: none !important;
}
/deep/ .el-input {
min-width: 150px;
width: auto;
flex: 1;
}
i {
color: #75acff;
margin-right: 3px;
font-size: 14px;
}
}
.el-tag {
margin-right: 4px;
height: 26px;
line-height: 24px;
}
.tag-input {
background: transparent;
border: none !important;
font-size: 14px;
height: 32px;
outline: none;
padding-left: 0;
width: 100px;
}
.el-input-tag--mini .tag-input {
height: 24px;
line-height: 24px;
}
.el-input-tag--small .tag-input {
height: 32px;
line-height: 32px;
}
.el-input-tag--medium .tag-input {
height: 32px;
line-height: 32px;
}
</style>
\ No newline at end of file \ No newline at end of file
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
"core-js": "^3.4.4", "core-js": "^3.4.4",
"el-tree-transfer": "^2.2.6", "el-tree-transfer": "^2.2.6",
"glsx-common": "^1.4.6", "glsx-common": "^1.4.6",
"glsx-components": "^1.2.8", "glsx-components": "^1.3.2",
"glsx-table": "^1.0.9" "glsx-table": "^1.0.9"
}, },
"devDependencies": { "devDependencies": {
......
...@@ -237,6 +237,10 @@ export default { ...@@ -237,6 +237,10 @@ export default {
.el-dialog__body { .el-dialog__body {
text-align: center; text-align: center;
} }
.el-dialog__header,
.el-dialog__footer {
border: none;
}
} }
} }
.summary-ranking-panel { .summary-ranking-panel {
......
...@@ -56,6 +56,7 @@ export default { ...@@ -56,6 +56,7 @@ export default {
data() { data() {
return { return {
loading: false, loading: false,
editStatus: false,
addForm: {}, addForm: {},
typeIndex: 0, typeIndex: 0,
empType: [], empType: [],
...@@ -66,7 +67,6 @@ export default { ...@@ -66,7 +67,6 @@ export default {
dialog_temp: {} dialog_temp: {}
} }
}, },
methods: { methods: {
init() { init() {
this.newTag = '' this.newTag = ''
...@@ -161,7 +161,17 @@ export default { ...@@ -161,7 +161,17 @@ export default {
this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds) this.$emit('handSelectdEmp', this.empType[this.typeIndex].id, userIds)
}, },
onCancel() { onCancel() {
this.$emit('closeDrawer') if (this.innerTags.length != 0) {
this.$confirm('当前有内容信息未保存,是否继续返回?', '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
this.$emit('closeDrawer')
})
} else {
this.$emit('closeDrawer')
}
} }
}, },
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!