Commit e90d9907 by chenweisong

营销模块改bug

parent 5865daef
...@@ -8,7 +8,7 @@ ...@@ -8,7 +8,7 @@
<div class="fl selects-date" @click="changeModel(2)"> <div class="fl selects-date" @click="changeModel(2)">
<selectDate :value="showSelectDateValue"></selectDate> <selectDate :value="showSelectDateValue"></selectDate>
</div> </div>
<div class="fr selects-stars" @click="collectFn"> <div v-if="public" class="fr selects-stars" @click="collectFn">
<img v-if="!isStar" class="stars" src="../../assets/app/star.png"/> <img v-if="!isStar" class="stars" src="../../assets/app/star.png"/>
<img v-if="isStar" class="stars" src="../../assets/app/starYellow.png"/> <img v-if="isStar" class="stars" src="../../assets/app/starYellow.png"/>
</div> </div>
...@@ -21,6 +21,7 @@ ...@@ -21,6 +21,7 @@
</div> </div>
<div v-if="showUpperLevel" @click="changeUpperLevel" class="upper-level">上一级</div> <div v-if="showUpperLevel" @click="changeUpperLevel" class="upper-level">上一级</div>
<ModelArea <ModelArea
:public="public"
:userInfo="userInfo" :userInfo="userInfo"
:initFlag="initFlag" :initFlag="initFlag"
ref="areaRef" ref="areaRef"
...@@ -178,6 +179,7 @@ ...@@ -178,6 +179,7 @@
}, },
data() { data() {
return { return {
public: true,
tabActive: REAL_TIME, tabActive: REAL_TIME,
showUpperLevel: false, showUpperLevel: false,
isShowTable: false, isShowTable: false,
...@@ -455,7 +457,7 @@ ...@@ -455,7 +457,7 @@
async fetch() { async fetch() {
let res = null; let res = null;
try { try {
res = await this.post(this.$urls.data483, {}); res = await this.post(this.public ? this.$urls.data483 : this.$urls.dataPublic483, {});
} catch (error) { } catch (error) {
console.log("error :", error); console.log("error :", error);
Indicator.close(); Indicator.close();
...@@ -496,14 +498,14 @@ ...@@ -496,14 +498,14 @@
let url = ""; let url = "";
let dateStr = ""; let dateStr = "";
if (this.tabActive === MONTH) { if (this.tabActive === MONTH) {
url = this.$urls.data485; url = this.public ? this.$urls.data485 : this.$urls.dataPublic485;
dateStr = formatDateTimeReg( dateStr = formatDateTimeReg(
new Date(this.mouthActiveDate), new Date(this.mouthActiveDate),
"YYYY-MM-DD mm:ss" "YYYY-MM-DD mm:ss"
); );
} else { } else {
// url = this.$urls.data481 // url = this.$urls.data481
url = this.$urls.data484; url = this.public ? this.$urls.data484 : this.$urls.dataPublic484;
// dateStr = formatDateTimeReg(new Date(), "YYYY-MM-DD mm:ss"); // dateStr = formatDateTimeReg(new Date(), "YYYY-MM-DD mm:ss");
dateStr = formatDateTimeReg(new Date(this.now), "YYYY-MM-DD mm:ss"); dateStr = formatDateTimeReg(new Date(this.now), "YYYY-MM-DD mm:ss");
} }
...@@ -846,7 +848,13 @@ ...@@ -846,7 +848,13 @@
this.selectArea.level = Number(this.userInfo.level) + 1; this.selectArea.level = Number(this.userInfo.level) + 1;
this.selectArea.areaId = this.userInfo.aid; this.selectArea.areaId = this.userInfo.aid;
this.selectArea.selectAreaName = this.userInfo.area; this.selectArea.selectAreaName = this.userInfo.area;
let origin = this.$route.query.origin;
if (origin && origin === "p0") {
this.public = false;
} else {
this.public = true;
this.isExistedCollect(); this.isExistedCollect();
}
await this.fetch(); await this.fetch();
await this.getData(); await this.getData();
} }
......
...@@ -15,10 +15,15 @@ ...@@ -15,10 +15,15 @@
<div class="clearfix"></div> <div class="clearfix"></div>
</div> </div>
<div v-show="tabActive === 1 && showTime" class="time" ref="timeRef">{{showTime}}</div> <div v-show="tabActive === 1 && showTime" class="time" ref="timeRef">
{{showTime}}
</div>
<div v-if="showUpperLevel" @click="changeUpperLevel" class="upper-level">上一级</div> <div v-if="showUpperLevel" @click="changeUpperLevel" class="upper-level">上一级</div>
<ModelArea <ModelArea
:public="public" :public="public"
:userInfo="userInfo"
:initFlag="initFlag"
ref="areaRef" ref="areaRef"
:defaultId="areaId" :defaultId="areaId"
:showModel="showModel" :showModel="showModel"
...@@ -54,6 +59,15 @@ ...@@ -54,6 +59,15 @@
<span @click="clickTab(2)" <span @click="clickTab(2)"
:class="{active : tabActive === 2 }" :class="{active : tabActive === 2 }"
class="month">月通报</span> class="month">月通报</span>
<div @click.prevent.stop="boreShow "
class="bore"
>
<span class="caliber">口径</span>
<span class="question"> ? </span>
<Popup @hide="hidePop"
v-if="popObjMouth.visable"
:obj="popObjMouth"></Popup>
</div>
</div> </div>
<div ref="kpiRef" class="kpis"> <div ref="kpiRef" class="kpis">
<div class="kpi" :style="{width: kpiWidth}"> <div class="kpi" :style="{width: kpiWidth}">
...@@ -139,11 +153,12 @@ ...@@ -139,11 +153,12 @@
import {formatDateTime, formatDateTimeReg} from "libs/common/common"; import {formatDateTime, formatDateTimeReg} from "libs/common/common";
import {createIScrollerAuto, refreshScrollerAuto} from "libs/iscrollTable"; import {createIScrollerAuto, refreshScrollerAuto} from "libs/iscrollTable";
import {Toast, Indicator} from "mint-ui"; import {Toast, Indicator} from "mint-ui";
import ModelArea from "com/app/gridMarketing/area.vue"; import ModelArea from "com/app/gridMarketing/area2.vue";
import ModelDate from "com/app/gridMarketing/appModelDate.vue"; import ModelDate from "com/app/gridMarketing/appModelDate.vue";
import SelectArea from "com/app/add/selectArea.vue"; import SelectArea from "com/app/add/selectArea.vue";
import selectDate from "com/app/add/selectDate.vue"; import selectDate from "com/app/add/selectDate.vue";
import commonMixin from "mixins/common/common.js"; import commonMixin from "mixins/common/common.js";
import Popup from "com/app/common/popup.vue";
const REAL_TIME = 1, const REAL_TIME = 1,
MONTH = 2; MONTH = 2;
...@@ -152,7 +167,8 @@ ...@@ -152,7 +167,8 @@
ModelArea, ModelArea,
ModelDate, ModelDate,
SelectArea, SelectArea,
selectDate selectDate,
Popup
}, },
mixins: [commonMixin], mixins: [commonMixin],
computed: { computed: {
...@@ -163,6 +179,7 @@ ...@@ -163,6 +179,7 @@
}, },
data() { data() {
return { return {
public: true,
tabActive: REAL_TIME, tabActive: REAL_TIME,
showUpperLevel: false, showUpperLevel: false,
isShowTable: false, isShowTable: false,
...@@ -179,17 +196,16 @@ ...@@ -179,17 +196,16 @@
headerListLength: 0, headerListLength: 0,
headerList: [], headerList: [],
scroll: null, scroll: null,
public: true,
isStar: false, isStar: false,
initFlag: false,
// 选择的地区 // 选择的地区
selectArea: { selectArea: {
// 层级 ,用户身份接口的: 0 是省,1 是市,2 是区或者分公司- // 层级 ,用户身份接口的: 0 是省,1 是市,2 是区或者分公司-
// 478 地区筛选接口的是:省是1 地市是2 区县是3 网格是4 渠道是5 // 478 地区筛选接口的是:省是1 地市是2 区县是3 网格是4 渠道是5
level: Number(this.$route.query.level) + 1, // 地区层级 level: 1, // 地区层级
areaId: this.$route.query.areaId, // 731, //地区id areaId: 0, // 731, //地区id
selectAreaName: this.$route.query.area //选择了的地区的名字 selectAreaName: "全省" //选择了的地区的名字
}, },
showSelectDateValue: this.getYesday(2, 0), showSelectDateValue: this.getYesday(2, 0),
defaultDate: new Date(new Date(new Date().getTime())), //前一天, defaultDate: new Date(new Date(new Date().getTime())), //前一天,
...@@ -232,16 +248,17 @@ ...@@ -232,16 +248,17 @@
detailAreaId: "", detailAreaId: "",
kpiId: "", // kpi 详情的 code 值 kpiId: "", // kpi 详情的 code 值
userInfo: { userInfo: {
account: this.$route.query.account, // "XUSHENG1", account: "",
aid: this.$route.query.aid, // 18411, //地区id aid: 0, // 18411, //地区id
areaId: this.$route.query.areaId, // 731, //地区id areaId: 0, // 731, //地区id
area: this.$route.query.area, // "A_长沙", 地区名 area: "全省", // "A_长沙", 地区名
id: this.$route.query.id, // "OCxusheng1", 用户id id: 0, // "OCxusheng1", 用户id
level: parseInt(this.$route.query.level), // 等级 ,0 是省,1 是市,2 是区或者分公司 level: 0, // 等级 ,0 是省,1 是市,2 是区或者分公司
phone: this.$route.query.phone, // "13873110056", phone: "", // "13873110056",
pid: this.$route.query.pid, // 0, 上级id pid: 0, // 0, 上级id
username: this.$route.query.username // "徐胜", 用户名 username: "", // "徐胜", 用户名
}, },
showTime: "", showTime: "",
activeKpiCode: "", activeKpiCode: "",
activeKpiItem: {}, activeKpiItem: {},
...@@ -250,7 +267,19 @@ ...@@ -250,7 +267,19 @@
kpiListOrigin: [], kpiListOrigin: [],
currentKpiCode: "", currentKpiCode: "",
changeUpperLevelIng: false, changeUpperLevelIng: false,
changeCacheFlag: false changeCacheFlag: false,
popObjMouth: {
//口径的数据
title: "",
ind_unit: "元",
remark: "",
top: "0.5rem",
right: "-0.2rem",
topRight: "0.15rem",
visable: false,
type: 1,
activeIndex: '' // 当前激活
},
}; };
}, },
filters: { filters: {
...@@ -264,6 +293,19 @@ ...@@ -264,6 +293,19 @@
} }
}, },
methods: { methods: {
hidePop(type) {
this.popObjMouth.visable = false;
this.popObjMouth.remark = "";
},
boreShow() {
// console.log(this.activeKpiItem)
this.popObjMouth.remark = this.activeKpiItem.remarks;
if (this.popObjMouth.remark) {
this.popObjMouth.visable = true;
} else {
Toast("该指标下没有口径说明 !");
}
},
changeUpperLevel() { changeUpperLevel() {
this.changeUpperLevelIng = true; this.changeUpperLevelIng = true;
let length = this.cacheList.length; let length = this.cacheList.length;
...@@ -524,6 +566,8 @@ ...@@ -524,6 +566,8 @@
} else { } else {
refreshScrollerAuto(); refreshScrollerAuto();
} }
// 当第一次采集数据完成,开始 选择地区查数据功能
this.initFlag = true;
}); });
} else { } else {
Toast(res.data.message); Toast(res.data.message);
...@@ -758,9 +802,48 @@ ...@@ -758,9 +802,48 @@
.catch(error => { .catch(error => {
console.log(error); console.log(error);
}); });
}
}, },
async isInRiseList() {
let res = null;
try {
res = await this.post(this.$urls.isInRiseList, {
phone: this.$route.query.phone
});
} catch (error) {
console.log("error :", error);
return;
}
// Indicator.close();
if (res === null) return;
console.log(res)
if (!!res.isInRiseList) {
this.userInfo.account = this.$route.query.account;
this.userInfo.aid = 0; // 18411, //地区id
this.userInfo.areaId = 0; // 731, //地区id
this.userInfo.area = "全省";
this.userInfo.level = 0; // 等级 ,0 是省,1 是市,2 是区或者分公司
this.userInfo.pid = 0; // 0, 上级id
this.userInfo.username = this.$route.query.username;
this.userInfo.phone = this.$route.query.phone;
this.userInfo.id = this.$route.query.id;
} else {
this.userInfo = {
account: this.$route.query.account, // "XUSHENG1",
aid: this.$route.query.aid, // 18411, //地区id
areaId: this.$route.query.areaId, // 731, //地区id
area: this.$route.query.area, // "A_长沙", 地区名
id: this.$route.query.id, // "OCxusheng1", 用户id
level: parseInt(this.$route.query.level), // 等级 ,0 是省,1 是市,2 是区或者分公司
phone: this.$route.query.phone, // "13873110056",
pid: this.$route.query.pid, // 0, 上级id
username: this.$route.query.username
}// "徐胜", 用户名 account: "", // "XUSHENG1",
}
}
}
,
async created() { async created() {
await this.isInRiseList();
this.areaId = this.userInfo.aid; this.areaId = this.userInfo.aid;
this.selectArea.level = Number(this.userInfo.level) + 1; this.selectArea.level = Number(this.userInfo.level) + 1;
this.selectArea.areaId = this.userInfo.aid; this.selectArea.areaId = this.userInfo.aid;
...@@ -774,29 +857,34 @@ ...@@ -774,29 +857,34 @@
} }
await this.fetch(); await this.fetch();
await this.getData(); await this.getData();
}, }
,
watch: { watch: {
showUpperLevel(val) { showUpperLevel(val) {
}, }
,
cacheList: { cacheList: {
immediate: true, immediate: true,
handler(list) { handler(list) {
console.log("change1: ", list) console.log("change1: ", list)
} }
}, }
,
cacheList2: { cacheList2: {
immediate: true, immediate: true,
handler(list) { handler(list) {
console.log("change2: ", list) console.log("change2: ", list)
} }
} }
}, }
,
mounted() { mounted() {
this.tabHeight = this.$refs.tabRef.offsetHeight; this.tabHeight = this.$refs.tabRef.offsetHeight;
// this.getData(); // this.getData();
this.setTitle({title: "网格营销跟踪"}); this.setTitle({title: "网格营销跟踪"});
} }
}; }
;
</script> </script>
<style lang="less"> <style lang="less">
.selects-area { .selects-area {
...@@ -827,7 +915,6 @@ ...@@ -827,7 +915,6 @@
.time { .time {
height: 0.4rem; height: 0.4rem;
// padding: 0.1rem 0;
padding-left: 2.5rem; padding-left: 2.5rem;
font-size: 0.26rem; font-size: 0.26rem;
color: #fff; color: #fff;
...@@ -878,6 +965,7 @@ ...@@ -878,6 +965,7 @@
font-size: 0.28rem; font-size: 0.28rem;
text-align: center; text-align: center;
/*padding-left: 1.8rem;*/ /*padding-left: 1.8rem;*/
position: relative;
.day, .day,
.month { .month {
...@@ -896,6 +984,27 @@ ...@@ -896,6 +984,27 @@
background-color: #2b90fa; background-color: #2b90fa;
color: #fff; color: #fff;
} }
.bore {
position: absolute;
top: 0.3rem;
right: .35rem;
height: 0.5rem;
color: #999;
.question {
display: inline-block;
width: 0.2rem;
height: 0.2rem;
overflow: hidden;
line-height: 0.2rem;
border-radius: 50%;
color: #999;
text-align: center;
border: 1px solid #999;
}
}
} }
.bg { .bg {
...@@ -1090,5 +1199,6 @@ ...@@ -1090,5 +1199,6 @@
.stars { .stars {
width: 0.4rem; width: 0.4rem;
} }
} }
</style> </style>
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment