|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810 |
- <template>
- <view class="pages">
- <!-- 筛选框 -->
- <view class="boxtittabs">
- <view class="items" @tap="screenShow = true">{{ showTimeText }}
- <u-icon name="arrow-down" size="24" style="padding-left: 12rpx"></u-icon>
- </view>
- <view class="items" @tap="showSelect('companyList')">{{ showBeText }}
- <u-icon name="arrow-down" size="24" style="padding-left: 12rpx"></u-icon>
- </view>
- <view class="items" @tap="showSelect('houseList')">{{ showBeText1 }}
- <u-icon name="arrow-down" size="24" style="padding-left: 12rpx"></u-icon>
- </view>
- </view>
-
- <!-- 编辑指标 -->
- <view class="edit" v-if="CHECKAUTHORITY('biEditTarget')">
- <view class="edits" @click="toEdit">
- 编辑指标
- </view>
- </view>
-
- <!-- 待处理 -->
- <view class="grop">
-
- <view class="title">
- <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
- mode="" />
- 转写消费
- </view>
-
- <view class="grid5">
- <block v-for="(item,index) in stayPendingProcessingArr">
- <view :key="index" class="real" v-if="item.show">
- <view class="realnum">{{item.data || 0}}</view>
- <view class="realtext">{{ item.title }}</view>
- </view>
- </block>
- </view>
-
- </view>
-
-
- <!-- 接待简报 -->
- <view class="grop">
- <view class="title">
- <image class="title-icon" src="https://static.quhouse.com/bc2ec951ad9a47e5bf58f2829926e143.png"
- mode="" />
- 接待简报
- </view>
-
- <view class="grid4">
- <block v-for="(item,index) in ReceptionBriefingArr">
- <view :key="index" class="real" v-if="item.show">
- <view class="realnum">{{item.data || 0}}{{ item.unit }}</view>
- <view class="realtext">{{ item.title }}</view>
- </view>
- </block>
- </view>
- </view>
-
- <!-- 排名柱状图 -->
- <block v-for="(item, index) in IndexRankingArr">
- <view class="grop" :key="index" v-if="item.show">
- <view class="titles">
- <view class="lside">
- {{item.title}}排名(top10)
- </view>
- <view class="rside">
- <view class="rside-item" :class="{active: item.isShowCity}" @click="checkCity(item, '按项目')">
- 按项目
- </view>
- <view class="rside-item" :class="{active: !item.isShowCity}" @click="checkCity(item, '按城市')">
- 按城市
- </view>
- </view>
- </view>
-
- <view class="echarts">
- <template v-if="item.type">
- <template v-if="item.isShowCity">
- <qiun-data-charts :type="item.type" :chartData="item.lineOptsect" :opts="item.lineOpts"
- background="none" :ontouch="true" :canvasId="item.canvasId" :canvas2d="true" />
- </template>
- <template v-else>
- <qiun-data-charts :type="item.type" :chartData="item.lineOptsect1" :opts="item.lineOpts"
- background="none" :ontouch="true" :canvasId="item.canvasId1" :canvas2d="true" />
- </template>
- </template>
- <template v-else>
- <view class="empty">
- <view
- style="width: 100%;height: 300rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;">
- <view style="width: 100%;text-align: center;">
- <image style="width: 220rpx;height: 200rpx;"
- src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode="">
- </image>
- </view>
- <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据
- </view>
- </view>
- </view>
- </template>
- </view>
- </view>
- </block>
-
-
- <!-- 趋势折线图 -->
- <block v-for="(item, index) in IndicatorTrendsArr">
- <view class="grop" :key="index" v-if="item.show">
- <view class="titles">
- <view class="lside">
- {{item.title}}趋势
- </view>
- </view>
-
- <view class="echarts">
- <template v-if="item.lineOptsect">
- <qiun-data-charts :type="item.type" :chartData="item.lineOptsect" :opts="item.lineOpts"
- background="none" :ontouch="true" :canvasId="item.canvasId" :canvas2d="true" />
- </template>
- <template v-else>
- <view class="empty">
- <view
- style="width: 100%;height: 300rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;">
- <view style="width: 100%;text-align: center;">
- <image style="width: 220rpx;height: 200rpx;"
- src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode="">
- </image>
- </view>
- <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据
- </view>
- </view>
- </view>
- </template>
- </view>
- </view>
- </block>
-
-
- <!-- 分布饼图 -->
- <block v-for="(item, index) in IndicatorDistributionArr">
- <view class="grop" :key="index" v-if="item.show">
- <view class="titles">
- <view class="lside">
- {{item.title}}分布
- </view>
- </view>
-
- <view class="echarts">
- <template v-if="item.type">
- <qiun-data-charts :type="item.type" :chartData="item.lineOptsect" :opts="item.lineOpts"
- background="none" :ontouch="true" :canvasId="item.canvasId" :canvas2d="true" />
- </template>
- <template v-else>
- <view class="empty">
- <view
- style="width: 100%;height: 300rpx;display: flex;flex-direction: column;justify-content: center;align-items: center;">
- <view style="width: 100%;text-align: center;">
- <image style="width: 220rpx;height: 200rpx;"
- src="https://static.quhouse.com/zhikong_xcx_img/nodatalist.png" mode="">
- </image>
- </view>
- <view style="text-align: center;width: 100%;margin-top: 20rpx;color: #999999;">暂无数据
- </view>
- </view>
- </view>
- </template>
- </view>
- </view>
-
- </block>
-
- <!-- 更多筛选 -->
- <u-popup v-model="screenShow" mode="bottom" height="400">
- <view class="screen">
- <view class="boxtittab">
- <view class="tabbox">
- <view :class="{ activecllasscet: params.dateType == 0 }" @click="tabtimetap(0, '今天')">今天</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: params.dateType == 1 }" @click="tabtimetap(1, '近七天')">近七天
- </view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: params.dateType == 2 }" @click="tabtimetap(2, '近30天')">近30天
- </view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet: params.dateType == null }" @click="tabtimetap(null, '自定义')">自定义
- </view>
- </view>
- </view>
- </view>
- </u-popup>
-
- <!-- 日期选择器 -->
- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
-
- <!-- 项目&公司 -->
- <u-select :mask-close-able="false" label-name="templateName" value-name="id" v-model="showTemplate"
- mode="single-column" :list="templateList" @cancel="templateCancel" @confirm="templateConfirm"></u-select>
- </view>
- </template>
-
- <script>
- const config = require("@/config");
- import * as allArrList from './arr.js'
- export default {
- data() {
- return {
- showTimeText: '近七天', // 展示文字
- showBeText: '公司', //
- showBeText1: '项目', //
- showTemplate: false,
- screenShow: false, // 日期选择器
- totalTimeShow: false, // 日期选择器
- templateList: [], // 销讲业务
- houseList: [], // 项目列表
- companyList: [], // 项目列表
- stayPendingProcessingArr: allArrList.stayPendingProcessingArr, // 待处理
- ReceptionBriefingArr: allArrList.ReceptionBriefingArr, // 接待简报
- IndexRankingArr: allArrList.IndexRankingArr, // 排名
- IndicatorTrendsArr: allArrList.IndicatorTrendsArr, // 排名
- IndicatorDistributionArr: allArrList.IndicatorDistributionArr, // 排名
- params: {
- staDate: '', //开启时间
- endDate: '', // 结束时间
- houseId: '', // 楼盘
- orgCode: '', // 公司code
- dateType: 1, // 自定义时间 今天0 近七天1 30天2
- },
- needFormatArr: ['stayPendingProcessingArr', 'ReceptionBriefingArr', 'IndexRankingArr',
- 'IndicatorTrendsArr', 'IndicatorDistributionArr'
- ], // 需要格式化的数组
- publicId: '', // 标识区别选择的是公司还是项目
-
- publicOpts: {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE", "#3CA272", "#FC8452", "#9A60B4",
- "#ea7ccc"
- ],
- padding: [15, 15, 0, 5],
- enableScroll: true,
- legend: {},
- xAxis: {
- rotateLabel: true,
- rotateAngle: 90,
- fontSize: 10,
- itemCount: 4,
- },
- yAxis: {
- gridType: "dash",
- },
- extra: {
- line: {
- type: "straight",
- width: 2,
- activeType: "hollow"
- }
- }
- }
- };
- },
-
- onLoad() {
- this.getHouse()
- this.getCompany()
- this.initPage()
- },
-
- onPullDownRefresh() {
- this.initPage()
-
- setTimeout(() => {
- uni.stopPullDownRefresh()
- }, 2000)
- },
-
- methods: {
-
- // 字典
- biDictionary() {
- this.$u.get('/customer/biDict').then(res => {
- if (res) {
- this.needFormatArr.forEach((item, index) => {
- this[item] = this[item].map(it => {
- return {
- ...it,
- indexType: index
- }
- })
-
- let arr1 = res.filter(arr => arr.indexType == index)
- arr1.map(ie => {
- let objs = this[item].findIndex(obj => {
- return obj.title == ie.indexName && obj.indexType == ie
- .indexType
- }) || 0
- this[item][objs].id = ie.id || ''
- })
- })
- this.getFindBiByAccountId()
- }
- })
- },
-
- // 回显
- getFindBiByAccountId() {
- this.$u.get('/customer/findBiByAccountId').then(res => {
- if (res) {
- let arr = [...res.index1.split(','), ...res.index2.split(','), ...res.index3.split(','),
- ...res.index4.split(','), ...res.index5.split(',')
- ]
- this.needFormatArr.forEach(item => {
- this[item].forEach(items => {
- let obj = arr.find(obj => obj == items.id)
- if (obj) items.show = true
- else items.show = false
- })
- })
- }
- })
- },
-
- async initPage() {
- await this.biDictionary()
- await this.bishowIndex1()
- await this.bishowIndex2()
- this.$nextTick(() => {
- this.bishowIndex3()
- this.bishowIndex4()
- this.bishowIndex5()
- })
- },
-
- checkCity(item, name) {
- if (name == '按项目') {
- item.isShowCity = true
- } else {
- item.isShowCity = false
- }
- this.$forceUpdate()
- },
-
- bishowIndex1() {
- this.$u.post('/customer/bishowIndex1', this.params).then(res => {
- if (res) {
- this.stayPendingProcessingArr.forEach(item => {
- item.data = res[item.id] || 0
- })
- }
- })
- },
-
- bishowIndex2() {
- this.$u.post('/customer/bishowIndex2', this.params).then(res => {
- if (res) {
- this.ReceptionBriefingArr.forEach(item => {
- item.data = res[item.id] || 0
- })
- }
- })
- },
-
- bishowIndex3() {
- this.$u.post('/customer/bishowIndex3', this.params).then(res => {
- if (res) {
- this.IndexRankingArr.forEach(item => {
- if (res[item.id] && res[item.id].data.length > 0) {
- // 按项目
- item.canvasId = `IndexRankingArr${item.id}`
- item.lineOptsect = {
- categories: res[item.id].data.map(itme => {
- return itme.name
- }),
- series: [{
- name: item.title,
- data: JSON.parse(JSON.stringify(res[item.id].data)),
- }]
- }
- item.type = 'column'
- item.lineOpts = this.publicOpts
- item.lineOpts.legend = {
- show: false
- }
-
- // 按城市
- item.canvasId1 = `IndexRankingArrs${item.id}`
- item.lineOptsect1 = {
- categories: res[item.id].data2.map(itme => {
- return itme.name
- }),
- series: [{
- name: item.title,
- data: JSON.parse(JSON.stringify(res[item.id].data2))
- }]
- }
- this.$forceUpdate()
- } else {
- item.lineOptsect = null
- this.$forceUpdate()
- }
- })
- }
- })
- },
-
- bishowIndex5() {
- this.$u.post('/customer/bishowIndex5', this.params).then(res => {
- if (res) {
- this.IndicatorDistributionArr.forEach(item => {
- if (res[item.id]) {
- item.type = 'pie'
- item.canvasId = `IndicatorDistributionArrs${item.id}`
- item.lineOptsect = {
- series: [{
- data: JSON.parse(JSON.stringify(res[item.id]))
- }]
- }
- item.lineOpts = {
- color: ["#1890FF", "#91CB74", "#FAC858", "#EE6666", "#73C0DE",
- "#3CA272", "#FC8452", "#9A60B4", "#ea7ccc"
- ],
- padding: [20, 20, 20, 20],
- enableScroll: false,
- extra: {
- pie: {
- activeOpacity: 0.5,
- activeRadius: 10,
- offsetAngle: 0.5,
- labelWidth: 15,
- border: false,
- borderWidth: 3,
- borderColor: "#FFFFFF"
- },
- markLine: {
- labelOffsetX: 10,
- labelOffsetY: 10,
- }
- },
-
- }
- // '无效原因'
- if (item.id == 55) {
- item.lineOpts.legend = {
- show: false
- }
- }
- this.$forceUpdate()
- } else {
- item.lineOptsect = null
- this.$forceUpdate()
- }
-
- })
- }
- })
- },
-
- bishowIndex4() {
- this.$u.post('/customer/bishowIndex4', this.params).then(res => {
- if (res) {
- this.IndicatorTrendsArr.forEach(item => {
- if (res[item.id]) {
- item.canvasId = `IndicatorTrendsArr${item.id}`
- item.lineOptsect = {
- categories: [],
- series: [{
- name: item.title,
- data: []
- }]
- }
- item.type = 'line'
- item.lineOpts = this.publicOpts
- res[item.id].forEach(itme => {
- item.lineOptsect.categories.push(itme.statDate.split(' ')[0])
- item.lineOptsect.series[0].data.push(itme[item.params] || 0)
- })
- this.$forceUpdate()
- } else {
- item.lineOptsect = null
- this.$forceUpdate()
- }
- })
- }
- })
- },
-
- toEdit() {
- uni.navigateTo({
- url: '/pages/center/RuleEditing/RuleEditing'
- })
- },
-
- showSelect(params) {
- this.publicId = params
- this.templateList = this[params]
- this.showTemplate = true
- },
-
- // 获取项目
- getHouse() {
- uni.request({
- url: config.service.getUser,
- method: "GET",
- header: {
- 'content-type': 'application/json',
- 'Authorization': 'Bearer ' + uni.getStorageSync('weapp_session_login_data').token
- },
- success: (res) => {
- this.houseList = res.data.data.houseList.map(item => {
- return {
- id: item.id,
- templateName: item.propertyName,
- }
- })
- }
- })
- },
-
- // 获取公司
- getCompany() {
- this.$u.post('/customer/getMyOrg').then(res => {
- if (res) {
- this.companyList = res.map(item => {
- return {
- id: item.orgCode,
- templateName: item.name
- }
- })
- }
- })
- },
-
- //时间切换
- tabtimetap(index, text) {
- this.params.dateType = index;
- if (index == null) {
- this.totalTimeShow = true;
- this.screenShow = false
- } else {
- this.screenShow = false
- this.showTimeText = text
- this.params.endDate = ''
- this.params.staDate = ''
- this.initPage()
- }
- },
-
- //自定义时间
- totalTimeChange(e) {
- this.screenShow = false
- this.showTimeText = `${e.startDate}-${e.endDate}`
- this.params.dateType = null;
- this.params.endDate = e.endDate
- this.params.staDate = e.startDate
- this.initPage()
- },
-
- //
- templateCancel() {
- this.showTemplate = false;
- },
-
- //
- templateConfirm(e) {
- this.showTemplate = false;
- if (this.publicId == 'houseList') {
- this.showBeText1 = e[0].label
- this.params.houseId = e[0].value
- } else {
- this.showBeText = e[0].label
- this.params.orgCode = e[0].value
- }
- this.initPage()
- },
- },
- }
- </script>
-
- <style lang="scss" scoped>
- .pages {
- padding: 0 0 20rpx 0;
- width: 100vw;
- min-height: 100vh;
- background: #f2f2f2;
- display: flex;
- flex-direction: column;
-
- .boxtittabs {
- width: 100%;
- height: 92rpx;
- background: #FFFFFF;
- display: flex;
- align-items: center;
- position: sticky;
- top: var(--window-top);
-
- .items {
- padding: 0 24rpx;
- width: 50%;
- height: 100%;
- display: flex;
- align-items: center;
- justify-content: center;
- overflow: hidden;
- white-space: nowrap;
- text-overflow: ellipsis;
- }
- }
-
- .screen {
-
- //时间切换的样式
- .boxtittab {
- width: 100%;
- height: 100%;
- background: #FFFFFF;
- display: flex;
- flex-direction: column;
- border: none;
-
- .tabbox {
- flex: 1;
- height: 100%;
- text-align: center;
- line-height: 92rpx;
- color: #666666;
- font-size: 28rpx;
- font-weight: 400;
- display: flex;
- justify-content: center;
-
- .activecllasscet {
- width: 96rpx;
- color: #2671E2;
- font-weight: 600;
- border-bottom: 4rpx solid #2671E2;
- }
- }
- }
-
- }
-
- .edit {
- margin: 20rpx 0 0 0;
- padding: 0 20rpx;
- width: 100%;
- display: flex;
- align-items: center;
- justify-content: flex-end;
-
- .edits {
- padding: 10rpx 20rpx;
- background: #1890FF;
- color: #fff;
- border-radius: 16rpx;
- font-size: 32rpx;
- }
- }
-
-
- .grop {
- margin: 20rpx 0 0 0;
- padding: 20rpx;
- width: 100%;
- background: #fff;
-
- .title {
- height: 42rpx;
- font-size: 30rpx;
- font-family: PingFangSC-Semibold, PingFang SC;
- font-weight: 600;
- color: #333333;
- line-height: 42rpx;
- margin-bottom: 24rpx;
- display: flex;
- align-items: center;
-
- .title-icon {
- width: 12rpx;
- height: 20rpx;
- margin-right: 18rpx;
- }
- }
-
- .titles {
- width: 100%;
- display: flex;
-
- .lside {
- flex-grow: 1;
- height: 42rpx;
- font-size: 30rpx;
- font-family: PingFangSC-Semibold, PingFang SC;
- font-weight: 600;
- color: #333333;
- line-height: 42rpx;
- margin-bottom: 24rpx;
- display: flex;
- align-items: center;
- }
-
- .rside {
- flex-shrink: 0;
- display: flex;
- align-items: center;
-
- .rside-item {
- margin: 0 10rpx 0 0;
-
- &.active {
- color: #1890FF;
- }
- }
- }
- }
-
- .grid5 {
- padding: 20rpx 0;
- grid-row-gap: 20rpx;
-
- .real {
- width: 100%;
- height: 100%;
-
- .realnum {
- width: 100%;
- text-align: center;
- height: 50rpx;
- font-size: 36rpx;
- font-family: SourceHanSansCN-Medium, SourceHanSansCN;
- font-weight: bold;
- color: #333333;
- line-height: 50rpx;
-
- .qushi-icon {
- width: 28rpx;
- height: 14rpx;
- margin-left: 2rpx;
- }
- }
-
- .realtext {
- width: 100%;
- text-align: center;
- margin-top: 8rpx;
- height: 32rpx;
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 32rpx;
- }
- }
- }
-
- .grid4 {
- padding: 20rpx 0;
- grid-row-gap: 20rpx;
-
- .real {
- width: 100%;
- height: 100%;
-
- .realnum {
- width: 100%;
- text-align: center;
- height: 50rpx;
- font-size: 36rpx;
- font-family: SourceHanSansCN-Medium, SourceHanSansCN;
- font-weight: bold;
- color: #333333;
- line-height: 50rpx;
-
- .qushi-icon {
- width: 28rpx;
- height: 14rpx;
- margin-left: 2rpx;
- }
- }
-
- .realtext {
- width: 100%;
- text-align: center;
- margin-top: 8rpx;
- height: 32rpx;
- font-size: 24rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- line-height: 32rpx;
- }
- }
-
- }
- }
-
- .grid5 {
- display: grid;
- grid-template-columns: repeat(5, 1fr);
- }
-
- .grid4 {
- display: grid;
- grid-template-columns: repeat(4, 1fr);
- }
- }
- </style>
|