|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335 |
- <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" style="height: auto;padding-bottom: 20rpx;">
- <view class="audonum" v-if="item.name=='接待时长'">{{item.name}}/分</view>
- <view class="audonum" v-else>{{item.name}}</view>
- <view class="num" >
- <view class="" style="width: 35%;">
- {{index==1?item.num+'%':item.num}}
- </view>
- <view class="comparesize" v-if="compareFlag&&timepickpickisshow">
- <text style="margin-right: 10rpx;">对比:{{index==1?item.num1+'%':item.num1}} </text>
- <text :style="{color:item.num2*1>0?'red':'green'}">{{item.num2+'%'}} {{item.num2*1>0?'↑':'↓'}}</text>
- </view>
- </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;margin-top: 16rpx;"
- v-if="guwenshow&&lopanobj.name" @click="oninputtap()">
- <view class="title2-che" style="width: 220rpx;">{{lopanobj.name}}
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view>
-
- <view style="padding: 30rpx;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 style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;margin-top: 16rpx;"
- v-if="Selectlevelobj.name" @click="oninputtap2()">
- <view class="title2-che" style="width: 220rpx;">{{Selectlevelobj.name}}
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </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 style="display: flex;justify-content:center;padding-left: 30rpx;padding-right: 30rpx;margin-top: 16rpx;"
- v-if="erSelectlevelobj.name" @click="oninputtap3()">
- <view class="title2-che" style="width: 220rpx;">{{erSelectlevelobj.name}}
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view> -->
- </view>
- </view>
-
- <view style="display: flex;align-items: center;height: 80rpx;justify-content: center;" v-if="Selecttuandui&&Selecttuanduiobj.name"
- @click="oninputtap4()">
- <view class="title2-che" style="width: 220rpx;">{{Selecttuanduiobj.name}}
- <image class="righttochoose" src="../../../static/images/righttochoose.png" mode=""></image>
- </view>
- </view>
-
-
- <view class="single">
- <!-- <view class="danwei" style="margin-top: 10rpx;">销讲词执行率</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" v-if="timepickpickisshow">
- <view class="title">
- <view class="title1">对比报表</view>
- </view>
- <view class="table" v-if="!guwenFlag">
- <view v-for="(item,index) in tableDate" :key="index">
- <view class="tr">
- <view v-for="(item1,index1) in item" :key="index" style="width: 100%;">
- <view v-if="index1<item.length-1||index==0" class="td"
- style="border-right:1px solid #E0E0E0;">{{item1}}</view>
- <view v-if="index>0 && index1==item.length-1" class="td"
- style="border-right:1px solid #E0E0E0;" :style="{color:item1*1>0?'red':'green'}">
- {{item1==0?'--':item1+'%'}}{{item1*1>0?'↑':item1*1<0?'↓':''}}</view>
- </view>
- </view>
- </view>
- </view>
- <view class="table" v-if="guwenFlag" style="width: 100%;">
- <scroll-view scroll-x="true" style="white-space: nowrap;">
- <view v-for="(item,index) in tableDate" :key="index" :style="{display:index==0?'inline-block':'block'}">
- <view class="tr" style="display: inline-block;">
- <view v-for="(item1,index1) in item" :key="index1" class="trd" style="display: inline-block;">
- <view v-if="index==1&&index1>0" class="td" :style="{color:item1*1>0?'red':'green'}"
- style="border-right:1px solid #E0E0E0;">{{item1==0?'--':item1+'%'}}{{item1*1>0?'↑':item1*1<0?'↓':''}}</view>
- <view v-else-if="index>1&&index1>0" class="td" style="border-right:1px solid #E0E0E0;">
- {{item1+'%'}}</view>
- <view v-else class="td" style="border-right:1px solid #E0E0E0;">{{item1}}</view>
- </view>
- </view>
- </view>
- </scroll-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 {
- compareFlag: false,
- numlist: [{
- name: '接待量',
- num: '10',
- num1: '0',
- num2: '0'
- },
- {
- name: '平均执行率',
- num: '10',
- num1: '0',
- num2: '0'
- },
- {
- name: '接待时长',
- num: '10',
- num1: '0',
- num2: '0'
- },
- ],
- 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,
- tableDate: [],
- guwenFlag: false
- };
-
- },
- 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.numlist[0].num = data.startSumCustomer
- this.numlist[1].num = data.startFraction;
-
- this.numlist[2].num = Math.floor(data.startSumDuration/60) || 0;
- if (data.endSumDuration != null) {
- this.compareFlag = true
- // return
- this.numlist[0].num1 = data.endSumCustomer
- this.numlist[1].num1 = data.endFraction;
- this.numlist[2].num1 = Math.floor(data.endSumDuration/60) || 0;
- this.numlist[0].num2 = data.contrastSumCustomer
- this.numlist[1].num2 = data.contrastFraction;
- this.numlist[2].num2 = data.contrastSumDuration|| 0;
- } else {
- this.compareFlag = false
- }
- 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.tableDate=[]
- 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(
- child.statDate.substring(5,10) + 'vs' + item.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)
- that.guwenFlag = false
- // // 处理表格数据
- let arr = [
- ['时间', '时段一', '时段二', '变化']
- // {
- // time:'时间',
- // time1:'时段一',
- // time2:'时段二',
- // compare:'变化'
- // },
- ]
- that.lineOptsect.categories.map((item, index) => {
- let newarr = [item, data.lastValue[index].fraction, data.firstValue[index].fraction,data.contrast[index].data
- ]
- // obj.time=item
- // obj.time1=data.firstValue[index].fraction
- // obj.time2=data.lastValue[index].fraction
- // obj.compare=data.contrast[index].data
- // arr.push(obj)
- arr.push(newarr)
- })
- // console.log(arr)
- that.tableDate = arr
- }
- });
- },
- //顾问维度
- ConsultantDimension() {
- const that = this;
- that.lineOptsect = {
- categories: [],
- series: []
- };
- this.linetype = "radar";
- this.$u.post("/cusLvStatistics/accFirstLevelContrast", this.pamect).then(data => {
- // return
- if (this.pamect.showStatus == 0) {
- that.lineOptsect = {
- categories: [],
- series: [{
- name: '时段一',
- data: [],
- color: '#7ED3F4'
- }]
- }
- data.firstList.forEach((item, sdf) => {
- that.lineOptsect.categories.push(item.name)
- that.lineOptsect.series[0].data.push(data.firstList[sdf].total)
- })
- // 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.headerList.forEach((item, sdf) => {
- that.lineOptsect.categories.push(item.name)
- that.lineOptsect.series[0].data.push(data.firstList[sdf].total)
- that.lineOptsect.series[1].data.push(data.secondList[sdf].total)
- })
- // return
- // // 处理表格数据
- that.guwenFlag = true
- let arr = []
- arr[0] = ['时间', ...that.lineOptsect.categories]
- arr[1] = ['变化']
- arr[2] = ['时段一']
- arr[3] = ['时段二']
- // console.log(arr)
- data.firstList.map((item, index) => {
- arr[2].push(item.total)
- arr[3].push(data.secondList[index].total)
- arr[1].push(data.thirdList[index].total)
- })
- that.tableDate = arr
- }
- });
- },
- // 顾问纬度选择顾问
- 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(
- child.statDate.substring(5,10) + 'vs' + item.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)
- let that = this
- this.guwenFlag = false
- // // 处理表格数据
- let arr = [
- ['时间', '时段一', '时段二', '变化']
- ]
- that.lineOptsect.categories.map((item, index) => {
- let newarr = [item, data.lastList[
- index].avgExecutionRate, data.firstList[index].avgExecutionRate, data.contrast[index].data]
- arr.push(newarr)
- })
- // console.log(arr)
- that.tableDate = arr
- }
- })
- },
- //销讲二级:获取一级
- 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(
- child.statDate.substring(5,10) + 'vs' + item.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)
- that.guwenFlag = false
- // 团队处理数据
- // // 处理表格数据
- let arr = [
- ['时间', '时段一', '时段二', '变化']
- // {
- // time:'时间',
- // time1:'时段一',
- // time2:'时段二',
- // compare:'变化'
- // },
- ]
- that.lineOptsect.categories.map((item, index) => {
- let newarr = [item, data
- .lastValue.receptionStatList[index].fraction, data.firstValue.receptionStatList[index].fraction,data.contrast
- .receptionStatList[index].data
- ]
- // obj.time=item
- // obj.time1=data.firstValue[index].fraction
- // obj.time2=data.lastValue[index].fraction
- // obj.compare=data.contrast[index].data
- // arr.push(obj)
- arr.push(newarr)
- })
- // console.log(arr)
- that.tableDate = arr
- }
- }
- });
- },
-
- //算相隔天数
- 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;
- flex-wrap: nowrap;
-
- .td {
- text-align: center;
- font-size: 24rpx;
- font-weight: 400;
- color: #333333;
- height: 64rpx;
- line-height: 64rpx;
- // flex-shrink: 0;
- }
- .trd{
- flex-shrink: 0;
- min-width: 300rpx;
- // border-bottom: 1px solid #ccc;
- }
- .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: 10rpx;
-
- .timeshow {
- color: #666666;
- width: 100%;
- height: 50rpx;
- font-size: 28rpx;
- 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: 49rpx;
- 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;
- }
- }
-
- .comparesize {
- flex: 1;
- font-size: 24rpx;
- color: #666666;
- margin-top: 10rpx;
- }
- .grid:nth-child(1){
- border-right:none ;
- border-bottom:none ;
- }
- .grid:nth-child(3){
- width: 50.5%;
- }
- </style>
|