feat: 统计完成
This commit is contained in:
@@ -11,23 +11,26 @@
|
||||
</div>
|
||||
<div class="flex-row">
|
||||
<div class="left-row flex-col">
|
||||
<ai-title title="6月五星门店(排名不分先后)">
|
||||
<ai-title :title="`${new Date().getMonth()}月五星门店(排名不分先后)`">
|
||||
<template #rightBtn>
|
||||
<label class="tooltip">默认选择一个网格</label>
|
||||
<el-select placeholder="请选择网格" v-model="form.data" size="small">
|
||||
<el-option
|
||||
v-for="item in []"
|
||||
:key="item.value"
|
||||
:label="item.label"
|
||||
:value="item.value">
|
||||
</el-option>
|
||||
</el-select>
|
||||
<ai-select
|
||||
v-model="search.girdCode"
|
||||
@change="(search.current = 1), getList()"
|
||||
placeholder="请选择网格"
|
||||
size="small"
|
||||
:selectList="gridList">
|
||||
</ai-select>
|
||||
</template>
|
||||
</ai-title>
|
||||
<div class="table-wrap">
|
||||
<ai-table :is-show-pagination="false"
|
||||
:tableData="tableData"
|
||||
style="height: 100%"
|
||||
height="100%"
|
||||
:col-configs="colConfigs"></ai-table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="right-row flex-col">
|
||||
<ai-title title="网格五星门店数量排名"></ai-title>
|
||||
<div class="bar-chart" ref="chartRef"></div>
|
||||
@@ -37,26 +40,26 @@
|
||||
<ai-search-bar>
|
||||
<template #left>
|
||||
<ai-select
|
||||
v-model="search.applyItemId"
|
||||
@change="(search.current = 1), getList()"
|
||||
v-model="form.operatorType"
|
||||
@change="(form.current = 1), getList1()"
|
||||
placeholder="经营类型"
|
||||
:selectList="[]">
|
||||
:selectList="$dict.getDict('operatorType')">
|
||||
</ai-select>
|
||||
<ai-select
|
||||
v-model="search.applyItemId"
|
||||
@change="(search.current = 1), getList()"
|
||||
v-model="form.girdCode"
|
||||
@change="(form.current = 1), getList1()"
|
||||
placeholder="所属网格"
|
||||
:selectList="[]">
|
||||
:selectList="gridList">
|
||||
</ai-select>
|
||||
</template>
|
||||
<template #right>
|
||||
<el-input
|
||||
v-model="search.createUserName"
|
||||
v-model="form.shopName"
|
||||
size="small"
|
||||
v-throttle="() => {search.current = 1, getList()}"
|
||||
v-throttle="() => {form.current = 1, getList1()}"
|
||||
placeholder="请输入门店名称"
|
||||
clearable
|
||||
@clear="search.current = 1, search.createUserName = '', getList()"
|
||||
@clear="form.current = 1, form.shopName = '', getList1()"
|
||||
suffix-icon="iconfont iconSearch">
|
||||
</el-input>
|
||||
</template>
|
||||
@@ -73,13 +76,13 @@
|
||||
slot="pic"
|
||||
align="left">
|
||||
<template v-slot="{ row }">
|
||||
<img :src="row.picUrl" alt="" v-viewer>
|
||||
<img :src="row.fileUrl" alt="" v-viewer>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
<el-table-column label="门店评分" slot="mark" align="center">
|
||||
<template v-slot="{row}">
|
||||
<el-rate :value="4" show-score text-color="#ff9900" disabled></el-rate>
|
||||
<el-rate :value="row.storeScore" show-score text-color="#ff9900" disabled></el-rate>
|
||||
</template>
|
||||
</el-table-column>
|
||||
|
||||
@@ -94,56 +97,163 @@ let chartInstance = null;
|
||||
export default {
|
||||
name: "AppMarkStatic",
|
||||
label: '门店统计',
|
||||
props: {
|
||||
instance: Function,
|
||||
dict: Object
|
||||
},
|
||||
|
||||
data() {
|
||||
return {
|
||||
data: {},
|
||||
form: {},
|
||||
search:{},
|
||||
form: {
|
||||
current:1,
|
||||
pages:10,
|
||||
operatorType:'',
|
||||
girdCode:'',
|
||||
shopName:'',
|
||||
},
|
||||
search: {
|
||||
girdCode:'',
|
||||
fiveStartTime:new Date().getMonth().toString(),
|
||||
storeLevel:'5',
|
||||
pages:1000
|
||||
},
|
||||
cardList: [
|
||||
{
|
||||
label: '门店总数量',
|
||||
value: 122
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '总网格数',
|
||||
value: 122
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '总网格员',
|
||||
value: 122
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
label: '五星门店',
|
||||
value: 122
|
||||
value: 0
|
||||
}
|
||||
],
|
||||
gridList:[],
|
||||
tableData: [],
|
||||
colConfigs: [
|
||||
{prop: '1', label: '门店名称', align: 'center'},
|
||||
{prop: '2', label: '经营类型', align: 'center'},
|
||||
{prop: '3', label: '经营者名称', align: 'center'},
|
||||
{prop: 'shopName', label: '门店名称', align: 'center'},
|
||||
{prop: 'operatorType', label: '经营类型', align: 'center',render:(h,{row})=>{
|
||||
return h('span',null,this.dict.getLabel('operatorType',row.operatorType))
|
||||
}},
|
||||
{prop: 'name', label: '经营者名称', align: 'center'},
|
||||
],
|
||||
total: 10,
|
||||
colConfigs1: [
|
||||
{type: "selection"},
|
||||
{slot: 'pic', align: 'center'},
|
||||
{ prop: 'integralUserName', label: '门店名称', align: 'center' },
|
||||
{ prop: 'areaName', label: '经营者姓名', align: 'center' },
|
||||
{ prop: 'girdName', label: '联系电话', align: 'center' },
|
||||
{prop: 'shopName', label: '门店名称', align: 'center'},
|
||||
{prop: 'name', label: '经营者姓名', align: 'center'},
|
||||
{prop: 'phone', label: '联系电话', align: 'center'},
|
||||
{prop: 'createTime', label: '录入时间', align: 'center'},
|
||||
{ prop: 'createTime', label: '所属网格', align: 'center' },
|
||||
{ prop: 'status', label: '门店地址', align: 'center'},
|
||||
{ prop: 'auditUserName', label: '经营类型', align: 'center' },
|
||||
{prop: 'girdName', label: '所属网格', align: 'center'},
|
||||
{prop: 'address', label: '门店地址', align: 'center'},
|
||||
{prop: 'operatorType', label: '经营类型', align: 'center',render:(h,{row})=>{
|
||||
return h('span',null,this.dict.getLabel('operatorType',row.operatorType))
|
||||
}},
|
||||
{slot: 'mark', align: 'center'}
|
||||
],
|
||||
tableData1: [],
|
||||
chartList:[]
|
||||
}
|
||||
},
|
||||
|
||||
methods: {
|
||||
getList(){
|
||||
|
||||
mounted() {
|
||||
this.$dict.load('operatorType').then(()=>{
|
||||
this.girdList()
|
||||
this.queryShopDetail()
|
||||
this.getList()
|
||||
this.countByFiveStars()
|
||||
})
|
||||
},
|
||||
|
||||
methods: {
|
||||
async countByFiveStars(){
|
||||
try {
|
||||
const {code, data:{records}} = await this.instance.post('/app/appShopStatistics/countByFiveStars',null,{
|
||||
pages:1000
|
||||
})
|
||||
if (code === 0) {
|
||||
this.chartList = records?.reverse() || []
|
||||
this.initChart()
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
async girdList() {
|
||||
try {
|
||||
const {code, data:{records}} = await this.instance.post('/app/appShopStatistics/girdList',null,{
|
||||
pages:1000
|
||||
})
|
||||
if (code === 0) {
|
||||
this.gridList = records?.map(item=>{
|
||||
return {
|
||||
dictName:item.girdName,
|
||||
dictValue:item.girdCode
|
||||
}
|
||||
})
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
async queryShopDetail() {
|
||||
try {
|
||||
const {code, data} = await this.instance.post('/app/appShopStatistics/queryShopDetail')
|
||||
if (code === 0) {
|
||||
const list = ['shopCounts','girdCounts','girdPersons','fiveStarsShops']
|
||||
list.forEach((item,index)=>{
|
||||
this.cardList[index].value = data[item]
|
||||
})
|
||||
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
// 五星门店列表查询
|
||||
async getList() {
|
||||
try {
|
||||
const {code, data:{records}} = await this.instance.post('/app/appshoparchives/list',null,{
|
||||
params:{
|
||||
...this.search,
|
||||
}
|
||||
})
|
||||
if (code === 0) {
|
||||
this.tableData = records
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
// 列表查询
|
||||
async getList2() {
|
||||
try {
|
||||
const {code, data:{records,total}} = await this.instance.post('/app/appShopStatistics/list',null,{
|
||||
params:{
|
||||
...this.form,
|
||||
}
|
||||
})
|
||||
if (code === 0) {
|
||||
this.total = total
|
||||
this.tableData1 = records
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
},
|
||||
|
||||
resize() {
|
||||
if (chartInstance) {
|
||||
chartInstance.resize()
|
||||
@@ -174,16 +284,16 @@ export default {
|
||||
},
|
||||
yAxis: {
|
||||
type: 'category',
|
||||
data: ['Brazil', 'Indonesia', 'USA', 'India', 'China', 'World']
|
||||
data: this.chartList?.map(item=>item.girdName)
|
||||
},
|
||||
series: [
|
||||
{
|
||||
name: '2012',
|
||||
type: 'bar',
|
||||
barWidth:'20%',
|
||||
itemStyle: {
|
||||
color:'#389FFF'
|
||||
color: '#389FFF',
|
||||
},
|
||||
data: [19325, 23438, 31000, 121594, 134141, 681807]
|
||||
data: this.chartList?.map(item=>item.fiveStarsCount)
|
||||
}
|
||||
]
|
||||
})
|
||||
@@ -192,10 +302,6 @@ export default {
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
this.initChart()
|
||||
},
|
||||
|
||||
beforeDestroy() {
|
||||
if (chartInstance) {
|
||||
chartInstance.dispose()
|
||||
@@ -263,6 +369,7 @@ export default {
|
||||
.left-row {
|
||||
height: 100%;
|
||||
width: 50%;
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.right-row {
|
||||
@@ -274,6 +381,11 @@ export default {
|
||||
.flex-col {
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.table-wrap{
|
||||
flex: 1;
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.mt-10 {
|
||||
|
||||
@@ -124,7 +124,10 @@ export default {
|
||||
],
|
||||
tableData: [],
|
||||
dialog:false,
|
||||
form:{},
|
||||
form:{
|
||||
startTime:'',
|
||||
endTime:''
|
||||
},
|
||||
rules:{
|
||||
taskName:[ { required: true, message: '请输入任务名称', trigger: 'blur' }],
|
||||
startTime:[ { required: true, message: '请选择开始时间', trigger: 'change' }],
|
||||
@@ -148,7 +151,9 @@ export default {
|
||||
if(valid){
|
||||
try {
|
||||
const {code} = await this.instance.post('/app/apptaskmanage/addOrUpdate',{
|
||||
...this.form
|
||||
...this.form,
|
||||
startTime:`${this.form.startTime} 00:00:00`,
|
||||
endTime:`${this.form.startTime} 23:59:59`,
|
||||
})
|
||||
if(code===0){
|
||||
this.$message.success('保存成功')
|
||||
|
||||
Reference in New Issue
Block a user