|
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198 |
- <template>
- <view>
- <view class="timetabct">
- <view class="timetabctview">
- <view :class="{ activecllasscet: activeTotal == 0 }" @click="tabtimetap(0)">7天</view>
- </view>
- <view class="timetabctview">
- <view :class="{ activecllasscet: activeTotal == 1 }" @click="tabtimetap(1)">15天</view>
- </view>
- <view class="timetabctview">
- <view :class="{ activecllasscet: activeTotal == 2 }" @click="tabtimetap(2)">30天</view>
- </view>
- </view>
-
- <view class="timepick">
- <view class="timepicktime">
- <view @click="tabtimetap(3)">{{sheartime1}}</view>
- <view>
- <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
- </view>
- </view>
- <view class="timepickpick">
- <view @click="checkboxChange()" style="width: 40rpx;height:40rpx;border: 1rpx solid #E0E0E0;">
- <image v-if="timepickpickisshow" style="width: 40rpx;height: 40rpx;"
- src="../../../static/images/xuanzhong.png" mode=""></image>
- </view>
- <view style="font-size:26rpx;text-indent: 12rpx;">对比</view>
- </view>
- <view class="timepicktime" v-if="timepickpickisshow">
- <view @click="tabtimetap(4)">{{sheartime2}}</view>
- <view>
- <image class="Underimg" src="../../../static/images/Underimg.png" mode=""></image>
- </view>
- </view>
- </view>
-
- <view class="timeduibi">
- <view class="timeshow">数据起始时间:<text style="color: #333333;">{{kanbanlist.kaishitime}}</text></view>
- <view class="timeshow" v-if="kanbanlist.duibitime.length!=0">
- 数据对比时间:
- <text style="color: #333333;">{{kanbanlist.duibitime}}</text>
- </view>
- </view>
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="boxzonglan" style="min-height: 100rpx;">
- <view class="zonglantit">简报</view>
- <view class="zonglanbox">
- <view class="grid" v-for="(item,index) in numlist" :key="index">
- <view class="audonum">{{item.name}}</text></view>
- <view class="num">{{item.num}}</view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="boxtittab" style="border: none;height: 82rpx;">
- <view class="tabbox">
- <view :class="{ activecllasscet2: newactiveTotal == 0 }" @click="tabxuanxiangtap(0)">项目</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet2: newactiveTotal == 1 }" @click="tabxuanxiangtap(1)">顾问</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet2: newactiveTotal == 2 }" @click="tabxuanxiangtap(2)">团队</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet2: newactiveTotal == 3 }" @click="tabxuanxiangtap(3)">销讲一级</view>
- </view>
- <view class="tabbox">
- <view :class="{ activecllasscet2: newactiveTotal == 4 }" @click="tabxuanxiangtap(4)">销讲二级</view>
- </view>
- </view>
-
-
- <view class="chart">
- <view style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;">
- <view class="title2-che">执行率
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view>
-
- <view style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;" v-if="guwenshow">
- <view class="title2-che">选择顾问
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- <!-- <view>选择顾问:</view>
- <view style="width:75%;">
- <input @click="oninputtap()" v-model="lopanobj.name" type="text" disabled="true"
- :border="border" placeholder="请选择" />
- </view>
- <view>
- <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
- style="width:12rpx;height:23rpx;margin-left: 16rpx;">
- </view> -->
- </view>
-
- <view style="padding-bottom: 20rpx;align-items: center;" v-if="Selectlevel">
- <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;">
- <view>选择一级:</view>
- <view style="width:75%;">
- <input @click="oninputtap2()" v-model="Selectlevelobj.name" type="text" disabled="true"
- :border="border" placeholder="请选择" />
- </view>
- <view>
- <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
- style="width:12rpx;height:23rpx;margin-left: 16rpx;">
- </view>
- </view>
- <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;">
- <view>选择二级:</view>
- <view style="width:75%;">
- <input @click="oninputtap3()" v-model="erSelectlevelobj.name" type="text" disabled="true"
- :border="border" placeholder="请选择" />
- </view>
- <view>
- <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
- style="width:12rpx;height:23rpx;margin-left: 16rpx;">
- </view>
- </view>
- </view>
-
- <view style="display: flex;align-items: center;border-bottom: 1px solid #C9C9C9;height: 80rpx;"
- v-if="Selecttuandui">
- <view>团队选择:</view>
- <view style="width:75%;">
- <input @click="oninputtap4()" v-model="Selecttuanduiobj.name" type="text" disabled="true"
- :border="border" placeholder="请选择" />
- </view>
- <view>
- <image src="https://qufang.oss-cn-beijing.aliyuncs.com/upload/icon/xcx/jjycrm/qf/more.png"
- style="width:12rpx;height:23rpx;margin-left: 16rpx;">
- </view>
- </view>
-
-
- <view class="single">
- <view class="danwei">销讲词执行率</view>
- <view class="uchaserbox" v-if="lineOptsect.series.length!=0">
- <qiun-data-charts :style="!showCanvas?'display:none':''" :type="linetype" :chartData="lineOptsect"
- background="none" :ontouch="true" canvasId="wangxiaohuaerlingeryilingwuyibao"
- :canvas2d="true" />
- </view>
- <view v-else style="width: 100%;">
- <view style="width: 100%;text-align: center;">
- <image style="width: 200rpx;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>
-
- </view>
-
- <view style="width: 100%;height: 20rpx;background: #FAFAFA;"></view>
- <view class="single">
- <view class="title">
- <view class="title1">对比报表</view>
- </view>
- <view class="table">
- <view class="tr">
- <view class="th" style="width: 30%;border-right:1px solid #E0E0E0;">时间</view>
- <view class="th" style="width: 20%;border-right:1px solid #E0E0E0;">时段1</view>
- <view class="th" style="width: 20%;border-right:1px solid #E0E0E0;">时段2</view>
- <view class="th" style="width: 30%;">变化</view>
- </view>
- <view class="tr">
- <view class="td" style="width: 30%;border-right:1px solid #E0E0E0;">06-20 VS 06-10</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">500</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">60</view>
- <view class="td" style="width: 30%;">+500(+19.83%)</view>
- </view>
- <view class="tr">
- <view class="td" style="width: 30%;border-right:1px solid #E0E0E0;">06-20 VS 06-10</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">500</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">60</view>
- <view class="td" style="width: 30%;">+500(+19.83%)</view>
- </view>
- <view class="tr">
- <view class="td" style="width: 30%;border-right:1px solid #E0E0E0;">06-20 VS 06-10</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">500</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">60</view>
- <view class="td" style="width: 30%;">+500(+19.83%)</view>
- </view>
- <view class="tr">
- <view class="td" style="width: 30%;border-right:1px solid #E0E0E0;">06-20 VS 06-10</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">500</view>
- <view class="td" style="width: 20%;border-right:1px solid #E0E0E0;">60</view>
- <view class="td" style="width: 30%;">+500(+19.83%)</view>
- </view>
- </view>
- </view>
- <view style="width: 100%;height: 60rpx;"></view>
- <view v-if="Showhiddenunits">
- <u-select v-model="Showhiddenunits" mode="single-column" :list="selectlist" @confirm="confirm">
- </u-select>
- </view>
- <view v-if="Showhiddenunits2">
- <u-select v-model="Showhiddenunits2" mode="single-column" :list="selectlist2" @confirm="confirm2">
- </u-select>
- </view>
- <view v-if="Showhiddenunits3">
- <u-select v-model="Showhiddenunits3" mode="single-column" :list="selectlist3" @confirm="confirm3">
- </u-select>
- </view>
- <view v-if="Showhiddenunits4">
- <u-select v-model="Showhiddenunits4" mode="single-column" :list="selectlist4" @confirm="confirm4">
- </u-select>
- </view>
- <u-calendar v-model="totalTimeShow" mode="range" @change="totalTimeChange"></u-calendar>
- <newcalendar v-model="totalTimeShow2" :planNum='intervaltime' mode="date" @change="totalTimeChange2"></newcalendar>
- </view>
-
- </template>
- <script>
- import newcalendar from '@/components/newcalendar/newcalendar.vue';
-
- export default {
- data() {
- return {
- numlist:[
- {name:'接待量',num:'10'},
- {name:'平均执行率',num:'10'},
- {name:'接待客户',num:'10'},
- ],
- activeTotal: 0, //时间下标
- newactiveTotal: 0, //tab下标
- totalTimeShow: false,
- totalTimeShow2: false,
- totalTimeShow3: false,
- cWidth: uni.upx2px(690),
- cHeight: uni.upx2px(453),
- AcHeight: uni.upx2px(500),
- kanbanlist: { //录音和测评的数据
- kaishitime: '',
- duibitime: '',
- audonum: '',
- audotime: "",
- avgDuration: '',
- fraction: ''
- },
- pamect: { //接口参数
- houseId: '',
- timeType: "4",
- firstStartDate: '', //第一次开始时间
- firstEndDate: '', //第一次结束时间
- lastStartDate: '',
- lastEndDate: '',
- accountId: '', //顾问ids
- marketingId: '', //二级销讲id
- deptId: "", //部门id
- showStatus: 0
- },
- linetype: "line",
- lineOptsect: {}, //图表数据
- Showhiddenunits: false,
- selectlist: [],
- guwenshow: false,
- lopanobj: {
- id: '',
- name: ''
- },
- //二级相关
- Selectlevel: false,
- Selectlevelobj: {
- id: '',
- name: ''
- },
- erSelectlevelobj: {
- id: '',
- name: ''
- },
- Showhiddenunits2: false,
- Showhiddenunits3: false,
- selectlist2: [],
- selectlist3: [],
- //团队相关
- Selecttuandui: false,
- selectlist4: [],
- Selecttuanduiobj: {
- id: '',
- name: ''
- },
- Showhiddenunits4: false,
- showCanvas: true,
-
- timepickpickisshow: false,
- sheartime1: "",
- sheartime2: "",
- intervaltime: 0
- };
-
- },
- components: {
- newcalendar
- },
- onLoad: function(options) {
- this.pamect.houseId = uni.getStorageSync('buildingID').id;
- this.init()
- },
- watch: {
- Showhiddenunits(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- Showhiddenunits2(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- Showhiddenunits3(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- Showhiddenunits4(newValue, oldValue) {
- this.showCanvas = !newValue
- },
-
- totalTimeShow(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- totalTimeShow2(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- totalTimeShow3(newValue, oldValue) {
- this.showCanvas = !newValue
- },
- },
- methods: {
- //是否对比
- checkboxChange() {
- if (this.newactiveTotal == 3) {
- uni.showToast({
- title: '销讲一级无对比',
- duration: 2000
- });
- return
- }
- if (this.newactiveTotal == 2) {
- if (this.Selecttuanduiobj.id == '') {
- uni.showToast({
- title: '全部团队无对比',
- duration: 2000
- });
- return
- }
- }
-
- if (this.timepickpickisshow == true) {
- this.timepickpickisshow = false;
- this.pamect.showStatus = 0;
- this.init()
- } else {
- this.timepickpickisshow = true;
- this.pamect.showStatus = 1;
- }
- this.activeTotal = 8;
- },
- init() {
- this.$u.post("/cusLvStatistics/lyAndcp", this.pamect).then(data => {
- this.pamect.lastStartDate = data.lastStartDate;
- this.pamect.lastEndDate = data.lastEndDate;
-
- this.sheartime1 = data.lastStartDate.substring(5, 10) + "--" + data.lastEndDate.substring(5,
- 10);
- this.sheartime2 = '请选择';
- this.kanbanlist.duibitime = '';
- var kaishi = this.DateDiff(data.lastStartDate, data.lastEndDate);
- this.kanbanlist.kaishitime = data.lastStartDate + "至" + data.lastEndDate + "(" + kaishi + "天)";
- if (this.pamect.showStatus == 1) {
- this.sheartime2 = data.firstStartDate.substring(5, 10) + "--" + data.firstEndDate
- .substring(5, 10);
- var jeishu = this.DateDiff(data.firstStartDate, data.firstEndDate);
- this.kanbanlist.duibitime = data.firstStartDate + "至" + data.firstEndDate + "(" + jeishu +
- "天)";
- }
- this.kanbanlist.audonum = data.sumCustomer;
- this.kanbanlist.audotime = data.avgDuration;
- this.kanbanlist.avgDuration = data.fraction;
- this.kanbanlist.fraction = data.fraction;
-
- if (this.newactiveTotal == 0) {
- this.ProjectDimension()
- } else if (this.newactiveTotal == 1) {
- if (this.pamect.accountId == "") {
- this.getguwenlist()
- } else {
- this.ConsultantDimension()
- }
- } else if (this.newactiveTotal == 2) {
- if (this.pamect.deptId == "") {
- this.getuanduilist()
- } else {
- this.TeamCompared()
- }
- } else if (this.newactiveTotal == 3) {
- this.speakingLevel()
- } else {
- if (this.pamect.marketingId == '') {
- this.getonsyiji()
- } else {
- this.aboutEecondary()
- }
- }
- });
- },
- //起始时间
- totalTimeChange(e) {
- this.pamect.lastStartDate = e.startDate;
- this.pamect.lastEndDate = e.endDate;
- var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
- this.kanbanlist.kaishitime = this.pamect.lastStartDate + "至" + this.pamect.lastEndDate + "(" + kaishi +
- "天)";
-
- if (this.pamect.showStatus == 0) {
- this.init()
- this.totalTimeShow = false;
- } else {
- if (this.pamect.firstStartDate.length == 0) {
- uni.showToast({
- title: '请选择对比时间',
- duration: 2000
- });
- } else {
- var jshu = this.DateDiff(this.pamect.firstStartDate, this.pamect.firstEndDate)
- if (kaishi == jshu) {
- this.init()
- } else {
- uni.showToast({
- title: '请选择相同天数',
- duration: 2000
- });
- }
- }
- this.totalTimeShow = false;
- }
- },
- //对比时间
- totalTimeChange2(e) {
- var d = new Date(e.result);
- d.setDate(d.getDate() + this.intervaltime);
- var year = d.getFullYear();
- var month = d.getMonth() + 1;
- if (month < 10) month = '0' + month;
- var day = d.getDate();
- if (day < 10) day = '0' + day;
- this.pamect.firstStartDate = e.result;
- this.pamect.firstEndDate = year + '-' + month + '-' + day;
- console.log(this.pamect.firstStartDate)
- var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
- var jeishu = this.DateDiff(this.pamect.firstStartDate, this.pamect.firstEndDate)
- this.kanbanlist.duibitime = this.pamect.firstStartDate + "至" + this.pamect.firstEndDate + "(" + jeishu +
- "天)";
-
- console.log(this.pamect.lastStartDate, this.pamect.lastEndDate, kaishi, jeishu)
- if (kaishi == jeishu) {
- this.init()
- } else {
- uni.showToast({
- title: '请选择相同天数',
- duration: 2000
- });
- }
- this.totalTimeShow2 = false;
- },
- //自定义时间
- totalTimeChange3(e) {
- this.pamect.firstStartDate = "";
- this.pamect.firstEndDate = "";
- this.pamect.lastStartDate = e.startDate;
- this.pamect.lastEndDate = e.endDate;
- this.init()
- this.totalTimeShow3 = false;
- },
-
-
- //时间切换
- tabtimetap(index) {
- if (index == 0) {
- this.pamect.timeType = "4";
- this.pamect.firstStartDate = '';
- this.pamect.firstEndDate = '';
- this.pamect.lastStartDate = '';
- this.pamect.lastEndDate = '';
- this.init()
- } else if (index == 1) {
- this.pamect.timeType = "5";
- this.pamect.firstStartDate = '';
- this.pamect.firstEndDate = '';
- this.pamect.lastStartDate = '';
- this.pamect.lastEndDate = '';
- this.init()
- } else if (index == 2) {
- this.pamect.timeType = "6";
- this.pamect.firstStartDate = '';
- this.pamect.firstEndDate = '';
- this.pamect.lastStartDate = '';
- this.pamect.lastEndDate = '';
- this.init()
- } else if (index == 3) {
- this.pamect.timeType = "";
- this.totalTimeShow = true;
- } else if (index == 4) {
- this.pamect.timeType = "";
- var kaishi = this.DateDiff(this.pamect.lastStartDate, this.pamect.lastEndDate)
- console.log(kaishi)
- this.intervaltime = kaishi - 1;
- this.totalTimeShow2 = true;
- } else {
- this.pamect.timeType = "";
- this.totalTimeShow3 = true;
- }
- this.activeTotal = index;
- },
- //tab切换
- tabxuanxiangtap(index) {
- this.newactiveTotal = index;
- this.guwenshow = false;
- this.Selectlevel = false;
- this.Selecttuandui = false;
-
- this.pamect.showStatus = 0;
- this.pamect.timeType = "4";
- this.pamect.firstStartDate = '';
- this.pamect.firstEndDate = '';
- this.pamect.lastStartDate = '';
- this.pamect.lastEndDate = '';
- this.pamect.accountId = '';
- this.pamect.marketingId = '';
- this.pamect.deptId = ""
- this.activeTotal = 0;
- this.timepickpickisshow = false;
- this.init()
-
- if (index == 1) {
- this.guwenshow = true;
- }
- },
- //项目维度
- ProjectDimension() {
- const that = this;
- that.lineOptsect = {
- categories: [],
- series: []
- };
- this.linetype = "line";
- this.$u.post("/cusLvStatistics/teamOrOneValueShow", this.pamect).then(data => {
- if (this.pamect.showStatus == 0) {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- }]
- }
- data.lastValue.forEach((child, zxc) => {
- that.lineOptsect.categories.push(child.statDate.substring(5, 10))
- })
- that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction);
- } else {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- },
- {
- name: '对比时间',
- data: [],
- color: '#FF7070'
- },
- ]
- }
- data.firstValue.forEach((item, sdf) => {
- data.lastValue.forEach((child, zxc) => {
- if (sdf == zxc) {
- that.lineOptsect.categories.push(item.statDate.substring(5,
- 10) + 'vs' + child.statDate.substring(5, 10))
- }
- })
- })
- that.lineOptsect.series[1].data = data.firstValue.map(item => item.fraction);
- that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction)
- }
- });
- },
- //顾问维度
- ConsultantDimension() {
- const that = this;
- that.lineOptsect = {
- categories: [],
- series: []
- };
- this.linetype = "line";
- this.$u.post("/cusLvStatistics/teamOrOneValueShow", this.pamect).then(data => {
- if (this.pamect.showStatus == 0) {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- }]
- }
- data.lastValue.forEach((item, sdf) => {
- that.lineOptsect.categories.push(item.statDate.substring(5, 10))
- })
- that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction);
- } else {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- },
- {
- name: '对比时间',
- data: [],
- color: '#FF7070'
- },
- ]
- }
- data.firstValue.forEach((item, sdf) => {
- data.lastValue.forEach((child, zxc) => {
- if (sdf == zxc) {
- that.lineOptsect.categories.push(item.statDate.substring(5,
- 10) + 'vs' + child.statDate.substring(5, 10))
- }
- })
- })
- that.lineOptsect.series[1].data = data.firstValue.map(item => item.fraction);
- that.lineOptsect.series[0].data = data.lastValue.map(item => item.fraction)
- }
- });
- },
- // 顾问纬度选择顾问
- oninputtap() {
- this.Showhiddenunits = true;
- },
- // 顾问选择确认
- confirm(e) {
- this.lopanobj.id = e[0].value;
- this.lopanobj.name = e[0].label;
- this.pamect.accountId = this.lopanobj.id;
- this.ConsultantDimension()
- this.Showhiddenunits = false;
- },
- //获取顾问
- getguwenlist() {
- this.$u.post("/cusLvStatistics/selectAllAccountIdByHouseId", {
- houseId: this.pamect.houseId
- }).then(data => {
- this.selectlist = [];
- if (data.length == 0) {
- this.lineOptsect = {
- categories: [],
- series: []
- };
- this.guwenshow = false;
- return
- } else {
- this.guwenshow = true;
- data.forEach(item => {
- this.selectlist.push({
- value: item.accountId,
- label: item.name
- })
- })
- this.lopanobj.id = data[0].accountId;
- this.lopanobj.name = data[0].name;
- this.pamect.accountId = this.lopanobj.id;
- this.ConsultantDimension()
- }
- })
- },
- //销讲一级
- speakingLevel() {
- this.linetype = "radar";
- this.lineOptsect = {
- categories: [],
- series: []
- };
- this.$u.post("/cusLvStatistics/firstLevelContrast", this.pamect).then(data => {
- if (data.length == 0) {
- return
- } else {
- let list = data.map(item => {
- return item.name
- });
- let list1 = data.map(item => {
- if (item.avgExecutionRate == null) {
- item.avgExecutionRate = 0
- } else {
- item.avgExecutionRate = item.avgExecutionRate
- }
- return item.avgExecutionRate
- });
- this.lineOptsect = {
- "categories": list,
- "series": [{
- "name": "",
- "data": list1
- }]
- }
- }
- })
- },
- //销讲二级
- aboutEecondary() {
- this.lineOptsect = {};
- this.linetype = "line";
- this.$u.post("/cusLvStatistics/level2Contrast", this.pamect).then(data => {
- if (this.pamect.showStatus == 0) {
- this.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- }]
- }
- data.lastList.forEach((item, sdf) => {
- this.lineOptsect.categories.push(item.statDate.substring(5, 10))
- })
- this.lineOptsect.series[0].data = data.lastList.map(item => item.avgExecutionRate);
- } else {
- this.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- },
- {
- name: '对比时间',
- data: [],
- color: '#FF7070'
- },
- ]
- }
- data.firstList.forEach((item, sdf) => {
- data.lastList.forEach((child, zxc) => {
- if (sdf == zxc) {
- this.lineOptsect.categories.push(item.statDate.substring(5,
- 10) + 'vs' + child.statDate.substring(5, 10))
- }
- })
- })
- this.lineOptsect.series[1].data = data.firstList.map(item => item.avgExecutionRate);
- this.lineOptsect.series[0].data = data.lastList.map(item => item.avgExecutionRate)
- }
- })
- },
- //销讲二级:获取一级
- getonsyiji() {
- this.$u.post("/cusLvStatistics/findAllFirstLevel", {
- houseId: this.pamect.houseId
- }).then(data => {
- this.selectlist2 = [];
- if (data.length == 0) {
- this.Selectlevel = false;
- this.lineOptsect = {
- categories: [],
- series: []
- };
- return
- } else {
- this.Selectlevel = true;
- data.forEach(item => {
- this.selectlist2.push({
- value: item.marketingId,
- label: item.name
- })
- })
- this.Selectlevelobj.id = data[0].marketingId;
- this.Selectlevelobj.name = data[0].name;
- this.getonserji(this.Selectlevelobj.id)
- }
- })
- },
- //销讲二级:通过一级获取二级
- getonserji(ccd) {
- this.$u.post("/cusLvStatistics/findLevel2ByFirstLevel", {
- houseId: this.pamect.houseId,
- marketingId: ccd
- }).then(data => {
- this.selectlist3 = [];
- data.forEach(item => {
- this.selectlist3.push({
- value: item.marketingId,
- label: item.name
- })
- })
- this.erSelectlevelobj.id = data[0].marketingId;
- this.erSelectlevelobj.name = data[0].name;
- this.pamect.marketingId = this.erSelectlevelobj.id;
- this.aboutEecondary()
- })
- },
- //销讲二级:一级选择
- oninputtap2() {
- this.Showhiddenunits2 = true;
- },
- //销讲二级:二级选择
- oninputtap3() {
- if (this.Selectlevelobj.id == "") {
- uni.showToast({
- title: '请先选择一级',
- duration: 2000
- });
- } else {
- this.Showhiddenunits3 = true;
- }
- },
- //销讲二级:一级选择确认
- confirm2(e) {
- this.Selectlevelobj.id = e[0].value;
- this.Selectlevelobj.name = e[0].label;
- this.getonserji(this.Selectlevelobj.id)
- },
- //销讲二级:二级选择确认
- confirm3(e) {
- this.erSelectlevelobj.id = e[0].value;
- this.erSelectlevelobj.name = e[0].label;
- this.pamect.marketingId = this.erSelectlevelobj.id;
- this.aboutEecondary()
- },
-
-
-
-
-
- //团队请选择
- oninputtap4() {
- this.Showhiddenunits4 = true;
- },
- //团队选择确认
- confirm4(e) {
- this.Selecttuanduiobj.id = e[0].value;
- this.Selecttuanduiobj.name = e[0].label;
- this.pamect.deptId = this.Selecttuanduiobj.id;
-
- this.pamect.showStatus = 0;
- this.pamect.timeType = "4";
- this.pamect.firstStartDate = '';
- this.pamect.firstEndDate = '';
- this.pamect.lastStartDate = '';
- this.pamect.lastEndDate = '';
- this.activeTotal = 0;
- this.timepickpickisshow = false;
- this.init()
- this.TeamCompared()
- },
- //获取团队列表
- getuanduilist() {
- this.$u.post("/cusLvStatistics/findAllDeptIdByHouseId ", {
- houseId: this.pamect.houseId
- }).then(data => {
- this.selectlist4 = [{
- value: "",
- label: "全部"
- }];
- if (data.length == 0) {
- this.Selecttuandui = false;
- this.lineOptsect = {
- categories: [],
- series: []
- };
- return
- } else {
- this.Selecttuandui = true;
- data.forEach(item => {
- this.selectlist4.push({
- value: item.deptId,
- label: item.deptName
- })
- })
- this.Selecttuanduiobj.id = "";
- this.Selecttuanduiobj.name = "全部";
- this.pamect.deptId = this.Selecttuanduiobj.id;
- this.TeamCompared()
- }
- })
- },
- //团队对比
- TeamCompared() {
- const that = this;
- that.lineOptsect = {};
- this.linetype = "line";
- this.$u.post("/cusLvStatistics/teamOrOneValueShowByDept", this.pamect).then(data => {
- if (this.Selecttuanduiobj.id == "") {
- var newlist = [];
- for (var i in data) {
- var ect = data[i].receptionStatList.map(item => {
- if (item.fraction == null) {
- item.fraction = 0
- } else {
- item.fraction = item.fraction
- }
- return item.fraction
- });
- newlist.push({
- name: data[i].deptName,
- data: ect
- })
- }
- var timelist = [];
- for (var i in data) {
- var ect = data[i].receptionStatList.map(item => {
- return item.statDate
- });
- timelist.push({
- name: data[i].deptName,
- data: ect
- })
- }
- var xAxisdata = [];
- timelist[0].data.forEach((item, sdf) => {
- xAxisdata.push(item.substring(5, 10))
- })
- that.lineOptsect = {
- categories: xAxisdata,
- series: newlist
- }
- } else {
- if (this.pamect.showStatus == 0) {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- }]
- }
- data.lastValue.receptionStatList.forEach((item, sdf) => {
- that.lineOptsect.categories.push(item.statDate.substring(5, 10))
- })
- that.lineOptsect.series[0].data = data.lastValue.receptionStatList.map(item => item
- .fraction);
- } else {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '起始时间',
- data: [],
- color: '#7ED3F4'
- },
- {
- name: '对比时间',
- data: [],
- color: '#FF7070'
- },
- ]
- }
- data.firstValue.receptionStatList.forEach((item, sdf) => {
- data.lastValue.receptionStatList.forEach((child, zxc) => {
- if (sdf == zxc) {
- that.lineOptsect.categories.push(item.statDate.substring(5,
- 10) + 'vs' + child.statDate.substring(5, 10))
- }
- })
- })
- that.lineOptsect.series[1].data = data.firstValue.receptionStatList.map(item => item
- .fraction);
- that.lineOptsect.series[0].data = data.lastValue.receptionStatList.map(item => item
- .fraction)
- }
- }
- });
- },
-
- //算相隔天数
- DateDiff(sDate1, sDate2) {
- var aDate, oDate1, oDate2, iDays;
- aDate = sDate1.split("-");
- oDate1 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]); //转换为yyyy-MM-dd格式
- aDate = sDate2.split("-");
- oDate2 = new Date(aDate[1] + '-' + aDate[2] + '-' + aDate[0]);
- iDays = parseInt(Math.abs(oDate1 - oDate2) / 1000 / 60 / 60 / 24); //把相差的毫秒数转换为天数
- return iDays + 1; //返回相差天数
- },
- },
- }
- </script>
- <style lang="scss" scoped>
- .title2-che{
- width: 178rpx;
- height: 48rpx;
- background: #FFFFFF;
- border-radius: 6rpx;
- border: 1px solid #E0E0E0;
- line-height: 48rpx;
- font-size: 28rpx;
- font-weight: 400;
- color: #666666;
- text-indent: 12rpx;
- margin-left: 35rpx;
- position: relative;
- .righttochoose{
- width: 18rpx;
- height: 24rpx;
- position: absolute;
- top: 12rpx;
- right: 12rpx;
- }
- }
- .table {
- border: 0px solid darkgray;
- .tr {
- display: flex;
- width: 100%;
- justify-content: center;
- height: 64rpx;
- align-items: center;
- border-bottom: 1px solid #E0E0E0;
- .td {
- text-align: center;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
- height: 64rpx;
- line-height: 64rpx;
- }
- .th {
- height: 64rpx;
- text-align: center;
- font-size: 28rpx;
- font-weight: 400;
- color: #666666;
- line-height: 64rpx;
- }
- }
- }
- .activecllasscet2 {
- color: #2671E2;
- border-bottom: 2px solid #2671E2;
- }
-
- .timeduibi{
- width: 100%;
- background: #FFFFFF;
- padding-bottom: 36rpx;
- .timeshow {
- color: #666666;
- width: 100%;
- height: 50rpx;
- height: 26rpx;
- font-size: 26rpx;
- line-height: 50rpx;
- text-indent: 30rpx;
- }
- }
-
-
-
-
-
-
- // 顶部时间切换
- .timetabct {
- width: 100%;
- height: 98rpx;
- display: flex;
- align-items: center;
- border-bottom: 1px solid #E0E0E0;
- }
-
- .timetabctview {
- flex: 1;
- height: 100%;
- display: flex;
- justify-content: center;
- align-items: center;
- }
-
- .timetabct view {
- width: 94rpx;
- text-align: center;
- height: 100%;
- line-height: 98rpx;
- font-size: 28rpx;
- font-family: PingFangSC-Regular, PingFang SC;
- font-weight: 400;
- color: #666666;
- }
-
- .activecllasscet {
- border-bottom: 2px solid #2671E2;
- }
-
- // 对比时间切换
- .timepick {
- width: 100%;
- height: 90rpx;
- display: flex;
- align-items: center;
- background: #FFFFFF;
- }
-
- .timepicktime {
- width: 260rpx;
- height: 50rpx;
- border: 1rpx solid #E0E0E0;
- margin-left: 30rpx;
- display: flex;
- background: #FFFFFF;
- }
-
- .timepicktime>view:nth-of-type(1) {
- width: 210rpx;
- height: 100%;
- line-height: 50rpx;
- font-size: 26rpx;
- font-weight: 400;
- text-align: center;
- }
-
- .timepicktime>view:nth-of-type(2) {
- width: 50rpx;
- height: 100%;
- border-left: 1px solid #E0E0E0;
- }
-
- .timepickpick {
- width: 110rpx;
- height: 50rpx;
- margin-left: 30rpx;
- display: flex;
- align-items: center;
- }
-
- .Underimg {
- width: 50rpx;
- height: 50rpx;
- margin-top: -2rpx;
- }
-
-
-
-
- .timeButton {
- width: 100%;
- height: 60rpx;
- display: flex;
- color: #b1b1b1;
- font-size: 28rpx;
-
- .item {
- text-align: center;
- line-height: 60rpx;
- padding-left: 12rpx;
- padding-right: 12rpx;
- border-radius: 8rpx;
- border: 1px solid #E0E0E0;
- margin-right: 20rpx;
-
- &.active {
- color: #FFFFFF;
- background-color: #2671E2;
- }
- }
- }
-
-
-
- .boardbox {
- width: 100%;
- height: 172rpx;
- display: flex;
- align-items: center;
- background: #F4F8FD;
- border-radius: 8rpx;
- margin-top: 28rpx;
-
- .boardbox-zuo {
- width: 50%;
- height: 120rpx;
- border-right: 1px solid #E0E0E0;
- }
-
- .boardbox-you {
- width: 50%;
- height: 120rpx;
- }
-
- .boardbox-text1 {
- width: 100%;
- text-align: center;
- font-size: 28rpx;
- color: #333333;
- }
-
- .boardbox-text2 {
- width: 100%;
- text-align: center;
- font-size: 26rpx;
- color: #333333;
- margin-top: 10rpx;
- }
- }
- </style>
|