From c10acc56933b7d504b7705b6c014e4b99826a8a5 Mon Sep 17 00:00:00 2001 From: cclu <1106109051@qq.com> Date: Wed, 29 May 2024 18:49:12 +0800 Subject: [PATCH] update --- pages/earlyWarning/detail.vue | 378 ++++++++++---- pages/earlyWarning/index.vue | 537 ++++++++++++++------ pages/earlyWarning/projectWarning.vue | 338 +++++++++--- pages/earlyWarning/projectWarningDetail.vue | 204 ++++++-- 4 files changed, 1091 insertions(+), 366 deletions(-) diff --git a/pages/earlyWarning/detail.vue b/pages/earlyWarning/detail.vue index fd1f4c4..b8ad476 100644 --- a/pages/earlyWarning/detail.vue +++ b/pages/earlyWarning/detail.vue @@ -1,34 +1,38 @@ @@ -242,10 +386,13 @@ } .headerBox{ width: 100%; - position: absolute; + position: fixed; left: 0; + top: 0; + z-index: 20; box-sizing: border-box; - padding: 32rpx; + background: linear-gradient( 180deg, #D8E3FF 0%, #E5EBF9 100%); + //padding: 32rpx; display: flex; align-items: center; .backIconBox{ @@ -384,7 +531,7 @@ .valueAdd{ font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 46rpx; + font-size: 42rpx; color: #E83944; line-height: 64rpx; text-align: left; @@ -393,7 +540,7 @@ .valueGreen{ font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 46rpx; + font-size: 42rpx; color: #127E5B; line-height: 40rpx; text-align: left; @@ -459,6 +606,39 @@ background: #F5F4F4; margin: 24rpx 0 24rpx 0; } + + .descBox{ + width: 100%; + background: #F8F8F8; + border-radius: 16rpx; + box-sizing: border-box; + padding: 16rpx; + margin-top: 24rpx; + .monthText{ + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #FFFFFF; + line-height: 24rpx; + text-align: left; + font-style: normal; + padding: 6rpx 8rpx; + background: #F2792E; + border-radius: 4rpx; + margin-right: 6rpx; + display: inline-block; + margin-bottom: 8rpx; + } + .descTitle{ + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: gray; + .desc{ + color: red; + } + } + } } } } @@ -469,6 +649,7 @@ border-radius: 32rpx 32rpx 0rpx 0rpx; box-sizing: border-box; padding: 24rpx 32rpx; + margin-top: 32rpx; .contentTop{ display: flex; align-items: center; @@ -478,13 +659,11 @@ margin-right: 12rpx; } .topTitle{ + font-size: 32rpx; font-family: PingFangSC, PingFang SC; font-weight: 600; - font-size: 28rpx; - color: #212226; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #160002; + line-height: 44rpx; margin-left: 12rpx; } } @@ -500,13 +679,11 @@ align-items: center; justify-content: flex-start; .topName{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #786B6C; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #9A9A9A; + line-height: 36rpx; } .sortIconBox{ display: flex; @@ -542,14 +719,15 @@ align-items: center; justify-content: space-between; .listItemLeft{ - width: 80%; + width: 100%; display: flex; - align-items: center; + align-items: flex-start; .logoBox{ width: 80rpx; height: 80rpx; border-radius: 16rpx; overflow: hidden; + margin-right: 16rpx; .logo{ width: 100%; height: 100%; @@ -558,20 +736,36 @@ .titleBox{ width: calc(100% - 96rpx); + flex: 1; .itemTitle{ - font-family: PingFangSC, PingFang SC; - font-weight: 600; font-size: 28rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; color: #160002; line-height: 40rpx; - text-align: left; - font-style: normal; display: inline-block; - width: 60%; + width: 50%; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; } + .MERCHANTS_NAME{ + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #571519; + line-height: 44rpx; + text-align: left; + font-style: normal; + padding: 4rpx 16rpx; + background: #FCF1D3; + border-radius: 4rpx; + display: inline-block; + width: 50%; + text-overflow: ellipsis; + overflow: hidden; + white-space: nowrap; + } .itemTypeBox{ .mode{ display: inline-block; @@ -579,7 +773,7 @@ border-radius: 4rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 20rpx; + font-size: 24rpx; color: #FF6531; line-height: 28rpx; text-align: left; @@ -591,7 +785,7 @@ border-radius: 4rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 20rpx; + font-size: 24rpx; color: #1979FE; line-height: 28rpx; text-align: left; @@ -616,22 +810,20 @@ .bottomValue{ } .name{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #A69E9F; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #9A9A9A; + line-height: 36rpx; + margin-left: 4rpx; + white-space: nowrap; } .value{ + font-size: 28rpx; font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 28rpx; color: #160002; - line-height: 40rpx; - text-align: left; - font-style: normal; + line-height: 32rpx; } .add{ font-family: DINAlternate, DINAlternate; diff --git a/pages/earlyWarning/index.vue b/pages/earlyWarning/index.vue index 561b07f..8d2d564 100644 --- a/pages/earlyWarning/index.vue +++ b/pages/earlyWarning/index.vue @@ -2,30 +2,33 @@ - - - - - - - + + + + + + + + + + + {{`${startDate}${endDate===startDate?'':`-${endDate}`}`}} + + + + + - {{`${startDate}-${endDate}`}} - - - - - - 经营异常预警 + 经营过程预警 - + 车流增加,服务区营收减少 @@ -33,7 +36,7 @@ {{ sumObj['车流增加,服务区营收减少'] || 0 }} - + 车流增加,门店的营收减少 @@ -41,18 +44,18 @@ {{ sumObj['车流增加,门店的营收减少'] || 0 }} - + 车流增加,营收增长不匹配 - {{ sumObj['车流增加,营收增长不匹配 '] || 0 }} + {{ sumObj['车流增加,营收增长不匹配'] || 0 }} - + - 车流减少,营收降低不匹配 + 车流减少,营收降低不匹配 {{ sumObj['车流减少,营收降低不匹配'] || 0 }} @@ -62,44 +65,72 @@ - - - 服务区数据 - /同比去年 + + + + 服务区数据 + /同比去年 + + + + + {{searchCount}} + + 筛选 + - - - - - 经营 - + + + + 经营 - - - - 营收 - + + + 营收 - - - - 增长 - + + + 增长 - - - - 减少 - + + + 减少 - - - - 筛选 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -108,18 +139,18 @@ 服务区名称 - + 对客销售 - - + + - + 入区车流 - - + + @@ -136,9 +167,9 @@ - + - {{ `${item.ShopINCList.length}个门店` }} + @@ -150,16 +181,21 @@ - 对客销售 - /万元 + + 对客销售 + /万元 + + + - {{ item.RevenueINC.curYearData?$util.getMoney(item.RevenueINC.curYearData / 10000):'-' }} - - - {{item.RevenueINC.increaseData?$util.getMoney(item.RevenueINC.increaseData / 10000):'-' }} - - {{item.RevenueINC.increaseRate?`${item.RevenueINC.increaseRate}%`:'-' }} - 同比 + + {{ item.RevenueINC.curYearData?item.RevenueINC.curYearData>0?`+${$util.getMoney(item.RevenueINC.curYearData / 10000)}`:item.RevenueINC.curYearData<0?`${$util.getMoney(item.RevenueINC.curYearData / 10000)}`:'0':'-' }} + + + + {{item.RevenueINC.increaseData?item.RevenueINC.increaseData>0?`+${$util.getMoney(item.RevenueINC.increaseData / 10000)}`:item.RevenueINC.increaseData<0?`${$util.getMoney(item.RevenueINC.increaseData / 10000)}`:'0':'-' }} + + {{item.RevenueINC.increaseRate?item.RevenueINC.increaseRate>0?`+${item.RevenueINC.increaseRate}%`:item.RevenueINC.increaseRate<0?`${item.RevenueINC.increaseRate}%`:'0':'-' }} @@ -168,17 +204,22 @@ - 入区车流 - /万辆 - - {{ item.BayonetINC.curYearData?$util.getMoney(item.BayonetINC.curYearData / 10000):'-' }} - - - {{item.BayonetINC.increaseData?$util.getMoney(item.BayonetINC.increaseData / 10000):'-' }} - - {{item.BayonetINC.increaseRate?`${item.BayonetINC.increaseRate}%`:'-' }} - 同比 + + 入区车流 + /万辆 + + + + + {{ item.BayonetINC.curYearData?item.BayonetINC.curYearData>0?`+${$util.getMoney(item.BayonetINC.curYearData / 10000)}`:item.BayonetINC.curYearData<0?`${$util.getMoney(item.BayonetINC.curYearData / 10000)}`:'0':'-' }} + + + + {{item.BayonetINC.increaseData?item.BayonetINC.increaseData>0?`+${$util.getMoney(item.BayonetINC.increaseData / 10000)}`:item.BayonetINC.increaseData<0?`${$util.getMoney(item.BayonetINC.increaseData / 10000)}`:'0':'-' }} + + {{item.BayonetINC.increaseRate?item.BayonetINC.increaseRate>0?`+${item.BayonetINC.increaseRate}%`:item.BayonetINC.increaseRate<0?`${item.BayonetINC.increaseRate}%`:'':'-' }} + @@ -246,8 +287,8 @@ // datetimerange:[moment().format('YYYY/MM'),moment().format('YYYY/MM')] startDate: moment().subtract(1,'months').format('YYYY/MM'),//开始时间 endDate: moment().subtract(1,'months').format('YYYY/MM'),// 结束时间 - start: moment().subtract(1,'months').format('YYYY/MM'),// 结束时间开始范围 - end: moment().format('YYYY/MM'),// 结束的时间范围 + start: moment().subtract(1,'months').format('YYYY-MM'),// 结束时间开始范围 + end: moment().format('YYYY-MM-DD'),// 结束的时间范围 useInfo:{},// 用户信息 statisticsType: 0,// 经营模式 shopTrade: 0,// 经营业态 @@ -256,6 +297,10 @@ selectTab: 1,// 选择的tab dataList: [],// 遍历的展示数组 sumObj:{},// 合计对象 + searchCount: 0,// 搜索条件的数量 + sortName: 1,// 1是对客销售 2是入区车流 + sortType: 1,// 1是降序 2是升序 + allServerPartId:'',// 所有服务区 } }, onLoad(query){ @@ -265,12 +310,42 @@ let userInfo = uni.getStorageSync('vuex') userInfo = JSON.parse(userInfo) this.useInfo = JSON.parse(JSON.stringify(userInfo)) + + let serverList = this.useInfo.userData.serverPartList + let serverPartId = '' + if (serverList && serverList.length>0){ + serverList.forEach(item=>{ + if (serverPartId){ + serverPartId +=`,${item.value}` + }else{ + serverPartId = item.value + } + }) + } + this.allServerPartId = serverPartId + this.handleBrandType() this.handleGetWarningNumber() this.handleGetPageData() + + this.handleGetSearchCount() }, methods:{ + // 修改排序 + handleChangeSortName(value){ + if (value===this.sortName){ + if (this.sortType===1){ + this.sortType=0 + }else{ + this.sortType=1 + } + }else{ + this.sortName = value + this.sortType=1 + } + this.dataList = this.handleSortList(this.dataList) + }, // 显示弹出框 handleShowPopup(){ this.showPop = true @@ -287,7 +362,9 @@ }, // 修改结束时间 handleGetEndTime(e){ + console.log('e',e) this.endDate = moment(e.detail.value).format('YYYY/MM') + console.log('this.endDate',this.endDate) }, // 经营业态数据 async handleBrandType(){ @@ -329,22 +406,45 @@ this.sorterType = e } }, + // 查询条件有多少个 + handleGetSearchCount(){ + // 多少个查询条件 + let num = 0 + if (this.startDate || this.endDate){ + num+=1 + } + if (this.statisticsType>0){ + num+=1 + } + if (this.shopTrade>0){ + num+=1 + } + if (this.sorterType>0){ + num+=1 + } + this.searchCount = num + console.log('searchCount',this.searchCount) + }, // 确定按钮 handleSubmit(){ + this.handleGetSearchCount() this.showPop = false + this.handleGetWarningNumber() this.handleGetPageData() }, // 跳转详情 handleGoDetail(obj){ let date = '' if (this.startDate === this.endDate){ - let month = new Date(this.startDate).getMonth() + 1 + console.log('this.startDate',this.startDate) + let month = new Date(this.startDate.replace('/','-')).getMonth() + 1 + console.log('month',month) date = `${month<10?'0'+month:month}月` }else{ - date = `${moment(this.startDate).format('YYYYMM')}-${moment(this.endDate).format('YYYYMM')}` + date = `${moment(this.startDate.replace('/','-')).format('YYYYMM')}-${moment(this.endDate.replace('/','-')).format('YYYYMM')}` } - this.$util.toNextRoute('navigateTo', `/pages/earlyWarning/detail?obj=${JSON.stringify(obj)}&date=${date}`) + this.$util.toNextRoute('navigateTo', `/pages/earlyWarning/detail?obj=${JSON.stringify(obj)}&date=${date}&type=${this.selectTab}`) }, // 返回上一级 handleBack(){ @@ -355,8 +455,8 @@ // 异常合计数量 async handleGetWarningNumber(){ const req = { - StatisticsStartMonth: moment(this.startDate).format('YYYYMM'), - StatisticsEndMonth: moment(this.endDate).format('YYYYMM'), + StatisticsStartMonth: this.startDate.replace('/',''), + StatisticsEndMonth: this.endDate.replace('/',''), BusinessTradeType: this.statisticsType || '', shopTrade: this.shopTrade || '' } @@ -378,18 +478,19 @@ }) const params = { pushProvinceCode: this.useInfo.userData.ProvinceCode || '340000', - StatisticsStartMonth: moment(this.startDate).format('YYYYMM'), - StatisticsEndMonth: moment(this.endDate).format('YYYYMM'), - businessRegion:1, + StatisticsStartMonth: this.startDate.replace('/',''), + StatisticsEndMonth: this.endDate.replace('/',''), + // businessRegion:1, calcQOQ: false, calcYOY: true, calcBayonet: true, - // showLevel: 1, + sorterType: this.sorterType || '', BusinessTradeType: this.statisticsType || '', - shopTrade: this.shopTrade || '', - showLevel: this.sorterType || '', + // shopTrade: this.shopTrade || '', + // showLevel: this.sorterType || '', + waringType: this.selectTab, + ServerpartId: this.allServerPartId || '' } - let req = {} if (this.selectTab===1){ req = { @@ -418,6 +519,7 @@ showRevenue: 2, } } + console.log('req2312312',req) const data = await request.$webGet('CommercialApi/Revenue/GetMonthINCAnalysis',req) if (data.Result_Data.List && data.Result_Data.List.length>0){ let list = wrapTreeNode(data.Result_Data.List) @@ -429,6 +531,13 @@ item.children.forEach((subItem)=>{ if (subItem.children && subItem.children.length>0){ subItem.children.forEach((thirdItem)=>{ + if (thirdItem.ShopINCList && thirdItem.ShopINCList.length>0){ + thirdItem.ShopINCList.forEach(fourth=>{ + if (fourth.ServerpartShopName==='自营超市' && fourth.RevenueINC.increaseRate>0){ + thirdItem.showWarning = true + } + }) + } res.push(thirdItem) }) } @@ -436,9 +545,47 @@ } }) console.log('res',res) - this.dataList = res + this.dataList = this.handleSortList(res) } uni.hideLoading() + }, + // 排序方法 + handleSortList(list){ + var len = list.length; + for (var i = 0; i < len - 1; i++) { + for (var j = 0; j < len - 1 - i; j++) { + if (this.sortType === 1){ + if (this.sortName ===1){ + if (list[j].RevenueINC.curYearData < list[j + 1].RevenueINC.curYearData) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + }else if(this.sortName===2){ + if (list[j].BayonetINC.curYearData < list[j + 1].BayonetINC.curYearData) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + } + }else{ + if (this.sortName ===1){ + if (list[j].RevenueINC.curYearData > list[j + 1].RevenueINC.curYearData) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + }else if(this.sortName===2){ + if (list[j].BayonetINC.curYearData > list[j + 1].BayonetINC.curYearData) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + } + } + } + } + return list } } } @@ -459,10 +606,13 @@ } .headerBox{ width: 100%; - position: absolute; + position: fixed; left: 0; + top: 0; + z-index: 20; box-sizing: border-box; - padding: 32rpx; + background: linear-gradient( 180deg, #D8E3FF 0%, #E5EBF9 100%); + //padding: 32rpx; display: flex; align-items: center; .backIconBox{ @@ -549,12 +699,15 @@ border-bottom-right-radius: 16rpx; border-bottom-left-radius: 16rpx; box-sizing: border-box; - padding: 24rpx; + padding: 12rpx 12rpx; + .contentItem{ display: flex; align-items: center; justify-content: space-between; - margin-bottom: 24rpx; + padding: 12rpx 12rpx; + border-radius: 12rpx; + //margin-bottom: 24rpx; .itemIcon{ width: 48rpx; height: 48rpx; @@ -563,7 +716,7 @@ .contentText{ font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; + font-size: 26rpx; color: #160002; line-height: 40rpx; text-align: left; @@ -571,21 +724,24 @@ } .value{ font-family: DINAlternate, DINAlternate; + font-size: 28rpx; font-weight: bold; - font-size: 36rpx; color: #160002; line-height: 42rpx; text-align: center; font-style: normal; } } + .selectItem{ + background: #D9E9FF; + } } } } .servicepartContent{ width: 100%; - height: calc(100vh - 616rpx); + //height: calc(100vh - 616rpx); border-top-left-radius: 32rpx; border-top-right-radius: 32rpx; background: #fff; @@ -594,32 +750,74 @@ .contentTitle{ display: flex; align-items: center; - .contentIcon{ - width: 48rpx; - height: 48rpx; - } - .titleBox{ - margin-left: 12rpx; - .title{ - font-family: PingFangSC, PingFang SC; - font-weight: 600; - font-size: 28rpx; - color: #212226; - line-height: 40rpx; - text-align: left; - font-style: normal; + justify-content: space-between; + .contentTitleLeft{ + display: flex; + align-items: center; + .contentIcon{ + width: 48rpx; + height: 48rpx; } - .desc{ + .titleBox{ + margin-left: 12rpx; + .title{ + font-size: 32rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 600; + color: #160002; + line-height: 44rpx; + } + .desc{ + font-size: 24rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + color: #9A9A9A; + line-height: 36rpx; + margin-left: 8rpx; + } + } + } + .contentTitleRight{ + .fixedRight{ + width: 138rpx; + height: 72rpx; + background: #fff; + box-sizing: border-box; + padding: 22rpx; + display: flex; + align-items: center; font-family: PingFangSC, PingFang SC; font-weight: 400; font-size: 28rpx; - color: #786B6C; + color: #160002; line-height: 40rpx; text-align: left; font-style: normal; - margin-left: 8rpx; + .filterIcon{ + width: 24rpx; + height: 28rpx; + margin-right: 4rpx; + } + .searchCountBox{ + width: 28rpx; + height: 28rpx; + background: #2363FF; + border-radius: 15rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #FFFFFF; + line-height: 24rpx; + text-align: left; + font-style: normal; + display: flex; + align-items: center; + justify-content: center; + margin-right: 6rpx; + } } } + } .selectBox{ width: 100%; @@ -628,10 +826,12 @@ align-items: center; margin-top: 28rpx; .scrollBox{ - width: calc(100% - 132rpx); + //width: calc(100% - 140rpx); + width: 100%; height: 72rpx; display: flex; - white-space: nowrap; + justify-content: space-between; + //white-space: nowrap; .scrollItem{ background: #F5F5F5; border-radius: 8rpx; @@ -647,7 +847,7 @@ .text{ font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; + font-size: 26rpx; color: #786B6C; line-height: 40rpx; text-align: right; @@ -662,7 +862,7 @@ } } .fixedRight{ - width: 132rpx; + width: 138rpx; height: 72rpx; background: #fff; box-sizing: border-box; @@ -681,12 +881,30 @@ height: 28rpx; margin-right: 4rpx; } + .searchCountBox{ + width: 28rpx; + height: 28rpx; + background: #2363FF; + border-radius: 15rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #FFFFFF; + line-height: 24rpx; + text-align: left; + font-style: normal; + display: flex; + align-items: center; + justify-content: center; + margin-right: 6rpx; + } } } .dataList{ width: calc(100% - 32rpx); - height: calc(100% - 200rpx); + background: #fff; + //height: calc(100% - 200rpx); margin-top: 24rpx; .listTitle{ display: flex; @@ -694,25 +912,21 @@ border-bottom: 1px solid #F1F1F1; padding-bottom: 16rpx; .titleName{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #786B6C; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #9A9A9A; + line-height: 36rpx; } .sortItem{ display: flex; align-items: center; .sortName{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #786B6C; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #9A9A9A; + line-height: 36rpx; } .sortIconBox{ display: flex; @@ -767,23 +981,20 @@ font-style: normal; } .name{ - font-family: PingFangSC, PingFang SC; - font-weight: 600; font-size: 28rpx; - color: #160002; - line-height: 40rpx; - text-align: left; - font-style: normal; - } - .unit{ font-family: PingFangSC, PingFang SC; font-weight: 400; + color: #160002; + line-height: 40rpx; + } + .unit{ font-size: 24rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; color: #9A9A9A; - line-height: 32rpx; - text-align: left; - font-style: normal; + line-height: 36rpx; margin-left: 4rpx; + white-space: nowrap; } .message{ width: 32rpx; @@ -846,31 +1057,44 @@ } } .secondItemTop{ - margin-bottom: 16rpx; + margin-bottom: 4rpx; + display: flex; + justify-content: space-between; + align-items: center; .itemTopName{ + font-size: 28rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; color: #160002; line-height: 40rpx; - text-align: left; - font-style: normal; } .itemTopUnit{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; color: #9A9A9A; - line-height: 40rpx; - text-align: left; - font-style: normal; + line-height: 36rpx; margin-left: 4rpx; } + .addReduce{ + width: 28rpx; + height: 28rpx; + margin-right: 4px; + border-radius: 50%; + } + } + .normalValue{ + font-family: DINAlternate, DINAlternate; + font-size: 24rpx; + color: #9A9A9A; + line-height: 40rpx; + text-align: left; + font-style: normal; } .itemValue{ font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 36rpx; + font-size: 28rpx; color: #E83944; line-height: 40rpx; text-align: left; @@ -879,13 +1103,22 @@ .itemGreenValue{ font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 36rpx; + font-size: 28rpx; color: #127E5B; line-height: 40rpx; text-align: left; font-style: normal; } .addRate{ + margin-top: 4rpx; + .normalValue{ + font-family: DINAlternate, DINAlternate; + font-size: 24rpx; + color: #9A9A9A; + line-height: 32rpx; + text-align: left; + font-style: normal; + } .redValue{ font-family: DINAlternate, DINAlternate; font-weight: bold; @@ -913,6 +1146,7 @@ text-align: left; font-style: normal; margin-left: 8rpx; + white-space: nowrap; } } } @@ -945,6 +1179,7 @@ width: 40rpx; height: 40rpx; } + } .filterBox{ diff --git a/pages/earlyWarning/projectWarning.vue b/pages/earlyWarning/projectWarning.vue index 4057567..c1ce603 100644 --- a/pages/earlyWarning/projectWarning.vue +++ b/pages/earlyWarning/projectWarning.vue @@ -2,27 +2,29 @@ - - - - - - - + + + + + + + + + + {{`${startDate}-${endDate}`}} + + + + + - {{`${startDate}-${endDate}`}} - - - - - - 经营异常预警 + 项目异常预警 @@ -30,7 +32,7 @@ - 15 + {{sumObj[1] || '-'}} 项目未有营业 @@ -40,37 +42,39 @@ - 15 + {{sumObj[2] || '-'}} 项目利润过低 - - - - - - 15 - 项目预亏预警 - - - - 15 + {{sumObj[3] || '-'}} 商家退场告警 + + + + + + {{sumObj[4] || '-'}} + 项目预亏预警 + + + + + - 15 + {{sumObj[5] || '-'}} 商家退场预警 @@ -80,7 +84,7 @@ - 15 + {{sumObj[6] || '-'}} 租金提成偏低 @@ -90,7 +94,7 @@ - 15 + {{sumObj[7] || '-'}} 保底租金过高 @@ -100,7 +104,7 @@ - 15 + {{sumObj[8] || '-'}} 业态缺失告警 @@ -110,10 +114,18 @@ - - - 商家数据 + + + + 商家数据 + + + {{searchCount}} + + 筛选 + + @@ -167,10 +179,11 @@ - - - 筛选 - + + + + + @@ -179,18 +192,18 @@ 门店名称 - + 营收金额 - - + + - + 盈利金额 - - + + @@ -199,7 +212,7 @@ - + @@ -212,6 +225,7 @@ + {{item.MERCHANTS_NAME || ''}} {{ businessTypeObj[item.BUSINESS_TYPE] }} {{ `${item.ENDDATE}结束` }} @@ -246,9 +260,9 @@ 统计时间 - {{startDate}} + {{startDate}} - - {{endDate}} + {{endDate}} @@ -303,7 +317,11 @@ export default { 2000: "固定租金", 3000: "保底采购", 4000: "业主自营", - } + }, + searchCount: 0,// 搜索条件数量 + sortName: 1,// 1是营收金额 2是盈利金额 + sortType: 1,// 1是降序 2是升序 + sumObj:{}, } }, onLoad(){ @@ -326,13 +344,46 @@ export default { } this.allServerPartId = serverPartId console.log('this.allServerPartId',this.allServerPartId) - + this.handleGetWarningSum() this.handleGetPageData() + this.handleGetSearchCount() }, methods:{ + // 修改排序 + handleChangeSortName(value){ + if (value===this.sortName){ + if (this.sortType===1){ + this.sortType=0 + }else{ + this.sortType=1 + } + }else{ + this.sortName = value + this.sortType=1 + } + this.dataList = this.handleSortList(this.dataList) + }, + // 查询条件有多少个 + handleGetSearchCount(){ + // 多少个查询条件 + let num = 0 + if (this.startDate || this.endDate){ + num+=1 + } + if (this.businessStatus>0){ + num+=1 + } + if (this.businessType>0){ + num+=1 + } + + this.searchCount = num + }, handleSubmit(){ + this.handleGetSearchCount() this.showPop = false + this.handleGetWarningSum() this.handleGetPageData() }, // 切换tab @@ -395,10 +446,68 @@ export default { BusinessState: this.businessStatus || '', WarningType: this.selectTab } - const data = await request.$webGet('/EShangApiMain/BusinessProject/GetAccountWarningList',req) - this.dataList = data.Result_Data.List + const data = await request.$webGet('EShangApiMain/BusinessProject/GetAccountWarningList',req) + this.dataList = this.handleSortList(data.Result_Data.List) console.log('this.dataList',this.dataList) uni.hideLoading() + }, + // 拿到合计的方法 + async handleGetWarningSum(){ + const req = { + ServerpartId: this.allServerPartId, + Business_Type: this.businessType || '', + // SettlementMode:'', + BusinessState: this.businessStatus || '', + WarningType: this.selectTab + } + const data = await request.$webGet('EShangApiMain/BusinessProject/GetAccountWarningListSummary',req) + console.log('data2312312',data) + let list = data.Result_Data.List + let obj = {} + if (list && list.length>0){ + list.forEach(item=>{ + obj[item.pid] = item.value + }) + } + this.sumObj = obj + }, + // 排序方法 + handleSortList(list){ + var len = list.length; + for (var i = 0; i < len - 1; i++) { + for (var j = 0; j < len - 1 - i; j++) { + if (this.sortType === 1){ + if (this.sortName ===1){ + if (list[j].REVENUE_AMOUNT < list[j + 1].REVENUE_AMOUNT) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + }else if(this.sortName===2){ + if (list[j].PROFIT_AMOUNT < list[j + 1].PROFIT_AMOUNT) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + } + }else{ + if (this.sortName ===1){ + if (list[j].REVENUE_AMOUNT > list[j + 1].REVENUE_AMOUNT) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + }else if(this.sortName===2){ + if (list[j].PROFIT_AMOUNT > list[j + 1].PROFIT_AMOUNT) { // 比较相邻元素大小并交换位置 + var temp = list[j]; + list[j] = list[j + 1]; + list[j + 1] = temp; + } + } + } + } + } + return list } } } @@ -417,10 +526,13 @@ export default { } .headerBox{ width: 100%; - position: absolute; + position: fixed; left: 0; + top: 0; + z-index: 20; box-sizing: border-box; - padding: 32rpx; + background: linear-gradient( 180deg, #D8E3FF 0%, #E5EBF9 100%); + //padding: 32rpx; display: flex; align-items: center; .backIconBox{ @@ -567,6 +679,7 @@ export default { .contentTitle{ display: flex; align-items: center; + justify-content: space-between; .contentIcon{ width: 48rpx; height: 48rpx; @@ -574,23 +687,58 @@ export default { .titleBox{ margin-left: 12rpx; .title{ + font-size: 32rpx; font-family: PingFangSC, PingFang SC; font-weight: 600; - font-size: 28rpx; - color: #212226; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #160002; + line-height: 44rpx; } .desc{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #786B6C; - line-height: 40rpx; + color: #9A9A9A; + line-height: 36rpx; + margin-left: 8rpx; + } + } + + .fixedRight{ + width: 138rpx; + height: 72rpx; + background: #fff; + box-sizing: border-box; + padding: 22rpx; + display: flex; + align-items: center; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 28rpx; + color: #160002; + line-height: 40rpx; + text-align: left; + font-style: normal; + .filterIcon{ + width: 24rpx; + height: 28rpx; + margin-right: 4rpx; + } + .searchCountBox{ + width: 28rpx; + height: 28rpx; + background: #2363FF; + border-radius: 15rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #FFFFFF; + line-height: 24rpx; text-align: left; font-style: normal; - margin-left: 8rpx; + display: flex; + align-items: center; + justify-content: center; + margin-right: 6rpx; } } } @@ -601,7 +749,8 @@ export default { align-items: center; margin-top: 28rpx; .scrollBox{ - width: calc(100% - 132rpx); + //width: calc(100% - 140rpx); + width: calc(100% - 32rpx); height: 72rpx; display: flex; white-space: nowrap; @@ -635,7 +784,7 @@ export default { } } .fixedRight{ - width: 132rpx; + width: 138rpx; height: 72rpx; background: #fff; box-sizing: border-box; @@ -654,6 +803,23 @@ export default { height: 28rpx; margin-right: 4rpx; } + .searchCountBox{ + width: 28rpx; + height: 28rpx; + background: #2363FF; + border-radius: 15rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #FFFFFF; + line-height: 24rpx; + text-align: left; + font-style: normal; + display: flex; + align-items: center; + justify-content: center; + margin-right: 6rpx; + } } } .dataList{ @@ -678,13 +844,11 @@ export default { display: flex; align-items: center; .sortName{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 28rpx; - color: #786B6C; - line-height: 40rpx; - text-align: left; - font-style: normal; + color: #9A9A9A; + line-height: 36rpx; } .sortIconBox{ display: flex; @@ -714,7 +878,7 @@ export default { box-sizing: border-box; padding: 24rpx; display: flex; - align-items: center; + align-items: flex-start; position: relative; margin-bottom: 24rpx; .bg{ @@ -727,11 +891,12 @@ export default { .listItemLeft{ width: 96rpx; height: 96rpx; + border-radius: 16rpx; margin-right: 16rpx; overflow: hidden; .shopLogo{ - width: 100%; - height: 100%; + width: 96rpx; + height: 96rpx; } } .listItemRight{ @@ -768,13 +933,11 @@ export default { margin-right: 12rpx; } .shopName{ - font-family: PingFangSC, PingFang SC; - font-weight: 600; font-size: 28rpx; + font-family: PingFangSC, PingFang SC; + font-weight: 400; color: #160002; line-height: 40rpx; - text-align: left; - font-style: normal; } } .rightTopRight{ @@ -784,6 +947,18 @@ export default { } } } + .MERCHANTS_NAME{ + font-family: PingFangSC, PingFang SC; + font-weight: 400; + font-size: 24rpx; + color: #571519; + line-height: 44rpx; + text-align: left; + font-style: normal; + padding: 4rpx 16rpx; + background: #FCF1D3; + border-radius: 4rpx; + } .rightBottom{ .type{ font-family: PingFangSC, PingFang SC; @@ -819,22 +994,19 @@ export default { display: flex; flex-direction: column; .value{ + font-size: 28rpx; font-family: DINAlternate, DINAlternate; font-weight: bold; - font-size: 32rpx; color: #160002; - line-height: 40rpx; - text-align: left; - font-style: normal; + line-height: 32rpx; + margin-top: 8rpx; } .unit{ + font-size: 24rpx; font-family: PingFangSC, PingFang SC; font-weight: 400; - font-size: 24rpx; color: #9A9A9A; line-height: 36rpx; - text-align: left; - font-style: normal; } } } diff --git a/pages/earlyWarning/projectWarningDetail.vue b/pages/earlyWarning/projectWarningDetail.vue index 7e55d12..a4f2034 100644 --- a/pages/earlyWarning/projectWarningDetail.vue +++ b/pages/earlyWarning/projectWarningDetail.vue @@ -1,20 +1,25 @@