From c707186f4884cf81c8cd2646d87f1ecdae036daf Mon Sep 17 00:00:00 2001 From: wanglei <1336977847@qq.com> Date: Thu, 27 Jun 2024 10:47:18 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E7=BB=9F=E8=AE=A1=E5=AE=8C=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../AppMarkStatic/AppMarkStatic.vue | 218 +++++++++++++----- .../AppRateManage/components/AppraiseTask.vue | 9 +- 2 files changed, 172 insertions(+), 55 deletions(-) diff --git a/project/fengdu/AppOutSource/AppMarkStatic/AppMarkStatic.vue b/project/fengdu/AppOutSource/AppMarkStatic/AppMarkStatic.vue index 0b0bb4ff..57b5a7f7 100644 --- a/project/fengdu/AppOutSource/AppMarkStatic/AppMarkStatic.vue +++ b/project/fengdu/AppOutSource/AppMarkStatic/AppMarkStatic.vue @@ -11,22 +11,25 @@
- + - +
+ +
+
@@ -37,26 +40,26 @@ @@ -73,13 +76,13 @@ slot="pic" align="left"> @@ -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: 'createTime', label: '录入时间', align: 'center' }, - { prop: 'createTime', label: '所属网格', align: 'center' }, - { prop: 'status', label: '门店地址', align: 'center'}, - { prop: 'auditUserName', label: '经营类型', align: 'center' }, - {slot:'mark',align: 'center'} + {slot: 'pic', align: 'center'}, + {prop: 'shopName', label: '门店名称', align: 'center'}, + {prop: 'name', label: '经营者姓名', align: 'center'}, + {prop: 'phone', label: '联系电话', align: 'center'}, + {prop: 'createTime', 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', - itemStyle:{ - color:'#389FFF' + barWidth:'20%', + itemStyle: { + 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 { diff --git a/project/fengdu/AppOutSource/AppRateManage/components/AppraiseTask.vue b/project/fengdu/AppOutSource/AppRateManage/components/AppraiseTask.vue index b41020ef..29312517 100644 --- a/project/fengdu/AppOutSource/AppRateManage/components/AppraiseTask.vue +++ b/project/fengdu/AppOutSource/AppRateManage/components/AppraiseTask.vue @@ -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('保存成功')