From cf0f90515e54818d0f2cbd603f820ab47aaaaf52 Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Fri, 22 Dec 2023 18:25:22 +0800 Subject: [PATCH] update --- pages/commercialBI/businessPortrait.vue | 95 +++++++++---- pages/commercialBI/carPortrait.vue | 25 +++- pages/commercialBI/components/headerTop.vue | 14 +- .../components/manager/revenueAnalysis.vue | 2 +- pages/commercialBI/formatPortraitBI.vue | 130 ++++++++++++------ pages/commercialBI/guestPortrait.vue | 26 +++- pages/commercialBI/managePortrait.vue | 24 +++- pages/map/detail.vue | 4 +- pages/projectProfitSharing/index.vue | 17 +-- 9 files changed, 233 insertions(+), 104 deletions(-) diff --git a/pages/commercialBI/businessPortrait.vue b/pages/commercialBI/businessPortrait.vue index 3da9fc7..b466b0b 100644 --- a/pages/commercialBI/businessPortrait.vue +++ b/pages/commercialBI/businessPortrait.vue @@ -6,7 +6,7 @@ + :haveFun="haveFun" :serviceTypeObj="serviceTypeObj" :serviceInfoObj="serviceInfoObj"/>
@@ -14,7 +14,7 @@

{{month}}月交易分析

- + {{ single }} @@ -91,6 +91,7 @@ import BestsellerShop from "./components/bussiness/bestsellerShop.vue"; import NoData from "./components/noData.vue"; import BandLevel from "./components/format/bandLevel.vue"; import commercialType from "./commercialType.vue"; +import {getFieldEnum} from "../../util/dateTime"; export default { name: "businessPortrait", @@ -138,28 +139,36 @@ export default { }, single:'',//显示时间 endData:'', // 结束时间 + startTime:'',// 开始时间 month:'',//显示月份 - haveFun:{} + haveFun:{}, + lastDay:'', + serviceTypeObj:{},// 服务区类型对象 + serviceInfoObj:{} } }, onLoad(option) { - let serviceInfo = JSON.parse(option.serviceInfo) + if (option.serviceInfo){ + this.serviceInfo = JSON.parse(option.serviceInfo) + } this.backType = option.type - this.serviceInfo = serviceInfo //跳转的时候带上时间 this.time = option.time - this.endData = new Date() + this.endData = uni.getStorageSync('lastDay') + this.startTime = '2023-01-01' + // 服务区类型枚举 + this.handleServiceType() }, onShow(){ let storeTime = uni.getStorageSync('lastDay') if (storeTime){ this.time = storeTime + this.lastDay = storeTime } this.single = this.$util.getThisMonthHave(this.time) const date = new Date(this.time) let month = date.getMonth() + 1 this.month = month<10?'0' + month:month - console.log('this.time',this.time) let storeServiceInfo = uni.getStorageSync('currentService') if (storeServiceInfo){ @@ -218,12 +227,24 @@ export default { ServerpartId:this.serviceInfo.Serverpart_ID } const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req) + this.serviceInfoObj = total.Result_Data this.haveFun = { car:total.Result_Data.HASPILOTLOUNGE, charge:total.Result_Data.HASCHARGE , bady:total.Result_Data.HASMOTHER , gusetHome:total.Result_Data.HASGUESTROOM } + }, + // 枚举服务区类型 SERVERPART_TYPE + async handleServiceType(){ + const data = await getFieldEnum({ FieldExplainField: 'SERVERPART_TYPE' }); + console.log('data',data) + let obj = {} + data.forEach(item=>{ + obj[Number(item.value)] = item.label + }) + console.log('obj',obj) + this.serviceTypeObj = obj }, bindDateChange(e){ const date = new Date(e.detail.value) @@ -279,32 +300,52 @@ export default { uni.setStorageSync('currentService',res) }, async getTransactionList(){ - const nowDate = new Date() - const selectDate = new Date(this.time) + const nowDate = new Date(this.lastDay) + const selectDate = new Date(this.single) + // 选择日期的年份 + let selectYear = selectDate.getFullYear() + let nowYear = nowDate.getFullYear() let selectMonth = selectDate.getMonth() + 1 let nowDateMonth = nowDate.getMonth() + 1 let time - if (selectMonth === nowDateMonth){ - let nowYear = nowDate.getFullYear() - let m - let nowDay = nowDate.getDate() - 1 - if (nowDateMonth<10){ - m = '0' + nowDateMonth - } - if (nowDay<10){ - nowDay = '0' + nowDay - } - time = `${nowYear}-${m}-${nowDay}` + // 下方逻辑 如果选择的月份 是当前的月份 那就取选择的时间 不然就取那个月的最后一天 + // 如果同一年 + if (selectYear===nowYear && selectMonth===nowDateMonth){ + time = this.lastDay }else{ - let selectYear = selectDate.getFullYear() - let m - if (selectMonth<10){ - m = '0' + selectMonth - } - let selectDay = this.$util.getThisMonthDay(`${selectYear}-${m}`) - time = `${selectYear}-${m}-${selectDay}` + let haveDay = this.$util.getThisMonthDay(`${selectYear}-${selectMonth}`) + if (selectMonth<10){ + selectMonth='0'+selectMonth + } + time = `${selectYear}-${selectMonth}-${haveDay}` } + // if (selectYear===nowYear){ + // if (selectMonth === nowDateMonth){ + // let nowYear = nowDate.getFullYear() + // let m + // let nowDay = nowDate.getDate() - 1 + // if (nowDateMonth<10){ + // m = '0' + nowDateMonth + // } + // if (nowDay<10){ + // nowDay = '0' + nowDay + // } + // time = `${nowYear}-${m}-${nowDay}` + // }else{ + // let selectYear = selectDate.getFullYear() + // let m + // if (selectMonth<10){ + // m = '0' + selectMonth + // } + // let selectDay = this.$util.getThisMonthDay(`${selectYear}-${m}`) + // time = `${selectYear}-${m}-${selectDay}` + // } + // }else{ + // + // } + + let req = { Province_Code:'340000', diff --git a/pages/commercialBI/carPortrait.vue b/pages/commercialBI/carPortrait.vue index cf84fe8..e47b8de 100644 --- a/pages/commercialBI/carPortrait.vue +++ b/pages/commercialBI/carPortrait.vue @@ -20,8 +20,8 @@
-
-
+
+
@@ -42,7 +42,7 @@
-
A类
+
{{serviceTypeObj[serviceInfoObj.SERVERPART_TYPE]}}
查看更多 @@ -344,6 +344,7 @@ import CommercialType from "./commercialType.vue"; import shopCell from "../everdayRenven/components/listUnit.vue"; import EntryRate from "./components/car/entryRate.vue"; import anhuiYestodayRevenueData from "../everdayRenven/components/anhuiYestodayRevenueData"; +import {getFieldEnum} from "../../util/dateTime"; export default { name: "carPortrait", data(){ @@ -395,7 +396,9 @@ export default { headMsg:null, searchEndTime:'', searchText:'',// 展示全省情況时显示的日期内容 - haveFun:{} + haveFun:{}, + serviceTypeObj:{},// 服务区类型对象 + serviceInfoObj:{} } }, components: { @@ -410,6 +413,8 @@ export default { onLoad(option){ this.isShowAllProvince = option.mustAllProvince this.backType = option.type + // 服务区类型枚举 + this.handleServiceType() }, onShow(){ this.carTypeList.forEach(item=>{ @@ -517,6 +522,17 @@ export default { handleGoServiceMessage(){ this.$util.toNextRoute('navigateTo', `/pages/map/detail`) }, + // 枚举服务区类型 SERVERPART_TYPE + async handleServiceType(){ + const data = await getFieldEnum({ FieldExplainField: 'SERVERPART_TYPE' }); + console.log('data',data) + let obj = {} + data.forEach(item=>{ + obj[Number(item.value)] = item.label + }) + console.log('obj',obj) + this.serviceTypeObj = obj + }, showScoreAnimation1(copyRightItems,id) { /* cxt_arc.arc(x, y, r, sAngle, eAngle, counterclockwise); @@ -689,6 +705,7 @@ export default { total.Result_Data.RegionInfo.forEach((item,index)=>{ tabList.push({name:item.SERVERPART_REGIONNAME,value:index+1}) }) + this.serviceInfoObj = total.Result_Data this.tabList = tabList this.haveFun = { car:total.Result_Data.HASPILOTLOUNGE, diff --git a/pages/commercialBI/components/headerTop.vue b/pages/commercialBI/components/headerTop.vue index b0adbb5..c789dbb 100644 --- a/pages/commercialBI/components/headerTop.vue +++ b/pages/commercialBI/components/headerTop.vue @@ -9,8 +9,8 @@
-
-
+
+
@@ -27,7 +27,7 @@
-
A类
+
{{serviceTypeObj[serviceInfoObj.SERVERPART_TYPE]}}
查看更多 @@ -155,6 +155,14 @@ export default { bady:false, gusetHome:false } + }, + serviceInfoObj:{ + type:Object, + default:()=>{} + }, + serviceTypeObj:{ + type:Object, + default:()=>{} } }, data() { diff --git a/pages/commercialBI/components/manager/revenueAnalysis.vue b/pages/commercialBI/components/manager/revenueAnalysis.vue index 62b67c8..ed4e712 100644 --- a/pages/commercialBI/components/manager/revenueAnalysis.vue +++ b/pages/commercialBI/components/manager/revenueAnalysis.vue @@ -112,7 +112,7 @@ export default { this.dataInfo.TotalOffAmount = this.$util.fmoney(this.dataInfo.TotalOffAmount,2) this.dataInfo.TicketCount = this.$util.fmoney(this.dataInfo.TicketCount,2) this.dataInfo.TotalCount = this.$util.fmoney(this.dataInfo.TotalCount,2) - this.dataInfo.average = this.$util.fmoney((value.CashPay / value.TicketCount),2) + this.dataInfo.average = value.TicketCount? this.$util.fmoney((Number(value.CashPay) / Number(value.TicketCount)),2):'0.00' // this.dataInfo.ContractProfitLoss = this.$util.fmoney(this.dataInfo.ContractProfitLoss) // this.dataInfo.SalesPerSquareMeter = this.$util.fmoney(this.dataInfo.SalesPerSquareMeter) } diff --git a/pages/commercialBI/formatPortraitBI.vue b/pages/commercialBI/formatPortraitBI.vue index b8aede8..f8dcd53 100644 --- a/pages/commercialBI/formatPortraitBI.vue +++ b/pages/commercialBI/formatPortraitBI.vue @@ -6,15 +6,29 @@ + :haveFun="haveFun" :serviceTypeObj="serviceTypeObj" :serviceInfoObj="serviceInfoObj"/>
-
+
+

品牌指数

+
+
+
+ +

{{item[0]}}({{item[1]}})

+
+
+ +
+ +
+ +

{{thisMonth}}月业态充盈度

- + {{ single }} @@ -23,7 +37,7 @@
-
+
@@ -45,19 +59,6 @@ -
-

品牌指数

-
-
-
- -

{{item[0]}}({{item[1]}})

-
-
- -
- -
@@ -72,6 +73,7 @@ import ConsumptionLevel from "./components/format/consumLevel.vue"; import BandNumber from "./components/format/bandNumber.vue"; import NoData from "./components/noData.vue"; import commercialType from "./commercialType.vue"; +import {getFieldEnum} from "../../util/dateTime"; export default { name: "businessPortrait", @@ -120,16 +122,25 @@ export default { single:'',//显示时间 thisMonth:'',//几月 endData:'', // 结束时间 - haveFun:{} + haveFun:{}, + startDate:'',// 开始时间 + serviceTypeObj:{},// 服务区类型对象 + serviceInfoObj:{} } }, onLoad(option) { - let serviceInfo = JSON.parse(option.serviceInfo) - this.backType = option.type - this.serviceInfo = serviceInfo - //跳转的时候带上时间 - this.time = option.time - this.endData = new Date() + if (option){ + if (option.serviceInfo){ + this.serviceInfo = JSON.parse(option.serviceInfo) + } + this.backType = option.type + //跳转的时候带上时间 + this.time = option.time + } + this.endData = uni.getStorageSync('lastDay') + this.startDate = '2023-01-01' + // 服务区类型枚举 + this.handleServiceType() }, onShow(){ let storeTime = uni.getStorageSync('lastDay') @@ -171,35 +182,63 @@ export default { this.$util.addUserBehavior() }, methods:{ + // 枚举服务区类型 SERVERPART_TYPE + async handleServiceType(){ + const data = await getFieldEnum({ FieldExplainField: 'SERVERPART_TYPE' }); + console.log('data',data) + let obj = {} + data.forEach(item=>{ + obj[Number(item.value)] = item.label + }) + console.log('obj',obj) + this.serviceTypeObj = obj + }, bindDateChange(e){ + this.fillDegreeList = [] + this.brandInfoList = [] const date = new Date(e.detail.value) - const nowDate = new Date() + let storeTime = uni.getStorageSync('lastDay') + const nowDate = new Date(storeTime) let nowMonth = nowDate.getMonth() + 1 - let m = date.getMonth() + 1 this.single = e.detail.value - let d - if (nowMonth === m){ - let nowYear = nowDate.getFullYear() - let nowMonth = nowDate.getMonth() +1 - if (nowMonth<10){ - nowMonth = '0'+ nowMonth - } - let nowDay = nowDate.getDate() - 1 - if (nowDay<10){ - nowDay = '0'+ nowDay - } - this.time = `${nowYear}-${nowMonth}-${nowDay}` - d = nowDay + let y = date.getFullYear() + let m = date.getMonth() + 1 + let nowY = nowDate.getFullYear() + let nowM = nowDate.getMonth() + 1 + if (y === nowY && m === nowM){ + this.time = storeTime }else{ - d = this.$util.getThisMonthDay(e.detail.value) - this.time = e.detail.value + '-' + d - } - if (m<10){ - m = '0' + m + let d = this.$util.getThisMonthDay(e.detail.value) + if (m<10){ + m = '0' + m + } + this.time = `${y}-${m}-${d}` } + + + // let d + // if (nowMonth === m){ + // let nowYear = nowDate.getFullYear() + // let nowMonth = nowDate.getMonth() +1 + // if (nowMonth<10){ + // nowMonth = '0'+ nowMonth + // } + // let nowDay = nowDate.getDate() - 1 + // if (nowDay<10){ + // nowDay = '0'+ nowDay + // } + // this.time = `${nowYear}-${nowMonth}-${nowDay}` + // d = nowDay + // }else{ + // d = this.$util.getThisMonthDay(e.detail.value) + // this.time = e.detail.value + '-' + d + // } + // if (m<10){ + // m = '0' + m + // } this.thisMonth = m - this.endTime = e.detail.value + '-' + d + this.endTime = storeTime this.onRefresh() console.log('this.time',this.time) }, @@ -217,6 +256,7 @@ export default { ServerpartId:this.serviceInfo.Serverpart_ID } const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req) + this.serviceInfoObj = total.Result_Data this.haveFun = { car:total.Result_Data.HASPILOTLOUNGE, charge:total.Result_Data.HASCHARGE , diff --git a/pages/commercialBI/guestPortrait.vue b/pages/commercialBI/guestPortrait.vue index 4c9a04c..212fedc 100644 --- a/pages/commercialBI/guestPortrait.vue +++ b/pages/commercialBI/guestPortrait.vue @@ -6,7 +6,7 @@ + :haveFun="haveFun" :serviceTypeObj="serviceTypeObj" :serviceInfoObj="serviceInfoObj"/>
@@ -78,6 +78,7 @@ import ConsumptionLevel from "./components/guest/consumptionLevel.vue"; import BusinessType from "./components/guest/businessType.vue"; import NoData from "./components/noData.vue"; import commercialType from "./commercialType.vue"; +import {getFieldEnum} from "../../util/dateTime"; export default { name: "guestPortrait", components:{NoData, BusinessType, ConsumptionLevel, ConsumPrefer, analyse, headerTop,customerFirst,customerSecond,commercialType}, @@ -118,16 +119,21 @@ export default { single:'',//显示时间 thisMonth:'',//几月 endData:'', // 结束时间 - haveFun:{} + haveFun:{}, + serviceTypeObj:{},// 服务区类型对象 + serviceInfoObj:{} } }, onLoad(option){ - let serviceInfo = JSON.parse(option.serviceInfo) + if (option.serviceInfo){ + this.serviceInfo = JSON.parse(option.serviceInfo) + } this.backType = option.type - this.serviceInfo = serviceInfo //跳转的时候带上时间 this.time = option.time this.endData = new Date() + // 服务区类型枚举 + this.handleServiceType() }, onShow(){ let storeTime = uni.getStorageSync('lastDay') @@ -188,6 +194,17 @@ export default { this.endTime = e.detail.value + '-' + d this.onRefresh() }, + // 枚举服务区类型 SERVERPART_TYPE + async handleServiceType(){ + const data = await getFieldEnum({ FieldExplainField: 'SERVERPART_TYPE' }); + console.log('data',data) + let obj = {} + data.forEach(item=>{ + obj[Number(item.value)] = item.label + }) + console.log('obj',obj) + this.serviceTypeObj = obj + }, //重新调一遍页面数据的方法 onRefresh(){ //客群分析男女的气泡图 @@ -207,6 +224,7 @@ export default { ServerpartId:this.serviceInfo.Serverpart_ID } const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req) + this.serviceInfoObj = total.Result_Data this.haveFun = { car:total.Result_Data.HASPILOTLOUNGE, charge:total.Result_Data.HASCHARGE , diff --git a/pages/commercialBI/managePortrait.vue b/pages/commercialBI/managePortrait.vue index 8c045a2..d6b368a 100644 --- a/pages/commercialBI/managePortrait.vue +++ b/pages/commercialBI/managePortrait.vue @@ -6,7 +6,7 @@ + :haveFun="haveFun" :serviceTypeObj="serviceTypeObj" :serviceInfoObj="serviceInfoObj"/>
@@ -197,6 +197,7 @@ import RevenueTrends from "./components/manager/revenueTrends.vue"; import request from '@/util/index.js' import NoData from "./components/noData.vue"; import commercialType from "./commercialType.vue"; +import {getFieldEnum} from "../../util/dateTime"; export default { name: "businessPortrait", @@ -251,14 +252,19 @@ export default { month:'', haveFun:{}, monthDetail:{},// 月度汇总信息 头部的内容 + serviceTypeObj:{},// 服务区类型对象 + serviceInfoObj:{} } }, onLoad(option) { - let serviceInfo = JSON.parse(option.serviceInfo) + if (option.serviceInfo){ + this.serviceInfo = JSON.parse(option.serviceInfo) + } this.backType = option.type - this.serviceInfo = serviceInfo //跳转的时候带上时间 this.time = option.time + // 服务区类型枚举 + this.handleServiceType() }, onShow(){ this.monthDetail = undefined @@ -310,12 +316,24 @@ export default { this.$util.addUserBehavior() }, methods:{ + // 枚举服务区类型 SERVERPART_TYPE + async handleServiceType(){ + const data = await getFieldEnum({ FieldExplainField: 'SERVERPART_TYPE' }); + console.log('data',data) + let obj = {} + data.forEach(item=>{ + obj[Number(item.value)] = item.label + }) + console.log('obj',obj) + this.serviceTypeObj = obj + }, //获取服务区基本信息 async getServiceInfo(){ let req = { ServerpartId:this.serviceInfo.Serverpart_ID } const total = await request.$webGet('CommercialApi/BaseInfo/GetServerpartInfo',req) + this.serviceInfoObj = total.Result_Data this.haveFun = { car:total.Result_Data.HASPILOTLOUNGE, charge:total.Result_Data.HASCHARGE , diff --git a/pages/map/detail.vue b/pages/map/detail.vue index f081c46..06d6958 100644 --- a/pages/map/detail.vue +++ b/pages/map/detail.vue @@ -16,12 +16,12 @@
- + -
+
{{currentImg + 1}} / {{ topBg.length }} diff --git a/pages/projectProfitSharing/index.vue b/pages/projectProfitSharing/index.vue index 40f7d8b..07a11b2 100644 --- a/pages/projectProfitSharing/index.vue +++ b/pages/projectProfitSharing/index.vue @@ -27,7 +27,7 @@
- + 驿达应收 商家欠款 @@ -46,7 +46,7 @@ - +
@@ -189,8 +189,6 @@ export default { } }, onLoad(query){ - console.log('query',query) - console.log('query.noShowTab',typeof (query.noShowTab)) if (query.noShowTab==='true'){ this.showTab = false } @@ -219,7 +217,6 @@ export default { }, methods:{ handleChangeTime(e){ - console.log('e',e) const date = new Date(e.detail.value) const y = date.getFullYear() let m = date.getMonth() + 1 @@ -252,8 +249,6 @@ export default { const data = await request.$webGet('EShangApiMain/Finance/GetProjectSummary',req) this.showList = wrapTreeNode(data.Result_Data.List) this.otherData = data.Result_Data.OtherData - console.log('showList',this.showList) - console.log('otherData',this.otherData) uni.hideLoading() this.$forceUpdate() }else{ @@ -262,8 +257,6 @@ export default { // this.realList = list this.showList = list this.otherData = data.Result_Data.OtherData - console.log('showList',this.showList) - console.log('otherData',this.otherData) uni.hideLoading() this.$forceUpdate() } @@ -271,7 +264,6 @@ export default { // // 排序方法 // handleDescList(list){ // let descList = JSON.parse(JSON.stringify(list)) - // console.log('descList',descList) // if (this.searchField===0){ // //按照到账排序 // if (this.descType === 'ascend'){ @@ -323,7 +315,6 @@ export default { }) this.$forceUpdate() - console.log('this.showList',this.showList) }, // 显示第二层子集 handleShowSecondChildren(obj,subObj,index){ @@ -341,27 +332,23 @@ export default { // 拿到结算模式的枚举 async handleGetSETTLEMENT(){ const data = await getFieldEnum({ FieldExplainField: 'SETTLEMENT_MODES' }); - console.log('data',data) if (data && data.length>0){ let obj = {} data.forEach(item=>{ obj[item.value] = item.label }) this.settlement = obj - console.log('this.settlement',this.settlement) } }, // 拿到合同类型的枚举 async handleGetCOMPACTTYPE(){ const data = await getFieldEnum({ FieldExplainField: 'COMPACT_CHARACTER' }); - console.log('data',data) if (data && data.length>0){ let obj = {} data.forEach(item=>{ obj[item.value] = item.label }) this.compactType = obj - console.log('this.compactType',this.compactType) } }, // 改变排序状态