Commit 9511364f by xinla

客户画像修改优化

1 parent f7a5f7c8
<template>
<div class="hello">
<h1>{{ msg }}</h1>
<p>
For a guide and recipes on how to configure / customize this project,<br />
check out the
<a href="https://cli.vuejs.org" target="_blank" rel="noopener"
>vue-cli documentation</a
>.
</p>
<h3>Installed CLI Plugins</h3>
<ul>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-babel"
target="_blank"
rel="noopener"
>babel</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-router"
target="_blank"
rel="noopener"
>router</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-vuex"
target="_blank"
rel="noopener"
>vuex</a
>
</li>
<li>
<a
href="https://github.com/vuejs/vue-cli/tree/dev/packages/%40vue/cli-plugin-eslint"
target="_blank"
rel="noopener"
>eslint</a
>
</li>
</ul>
<h3>Essential Links</h3>
<ul>
<li>
<a href="https://vuejs.org" target="_blank" rel="noopener">Core Docs</a>
</li>
<li>
<a href="https://forum.vuejs.org" target="_blank" rel="noopener"
>Forum</a
>
</li>
<li>
<a href="https://chat.vuejs.org" target="_blank" rel="noopener"
>Community Chat</a
>
</li>
<li>
<a href="https://twitter.com/vuejs" target="_blank" rel="noopener"
>Twitter</a
>
</li>
<li>
<a href="https://news.vuejs.org" target="_blank" rel="noopener">News</a>
</li>
</ul>
<h3>Ecosystem</h3>
<ul>
<li>
<a href="https://router.vuejs.org" target="_blank" rel="noopener"
>vue-router</a
>
</li>
<li>
<a href="https://vuex.vuejs.org" target="_blank" rel="noopener">vuex</a>
</li>
<li>
<a
href="https://github.com/vuejs/vue-devtools#vue-devtools"
target="_blank"
rel="noopener"
>vue-devtools</a
>
</li>
<li>
<a href="https://vue-loader.vuejs.org" target="_blank" rel="noopener"
>vue-loader</a
>
</li>
<li>
<a
href="https://github.com/vuejs/awesome-vue"
target="_blank"
rel="noopener"
>awesome-vue</a
>
</li>
</ul>
</div>
</template>
<script>
export default {
name: "HelloWorld",
props: {
msg: String
}
};
</script>
<!-- Add "scoped" attribute to limit CSS to this component only -->
<style scoped lang="less">
h3 {
margin: 40px 0 0;
}
ul {
list-style-type: none;
padding: 0;
}
li {
display: inline-block;
margin: 0 10px;
}
a {
color: #42b983;
}
</style>
......@@ -28,15 +28,15 @@
>
<span class="fs14">{{ chargeType(item1.trajectoryType) }}</span>
<span class="finish-box">
<span
class="finish"
v-if="item1.trajectoryType == 4 && item1.status !=3"
@click="finDynamic(item1.id)"
>完成</span
>
<span class="deldynamic" @click="delDynamic(item1.id)">删除</span>
<span
class="finish"
v-if="item1.trajectoryType == 4 && item1.status != 3"
@click="finDynamic(item1.id)"
>完成</span
>
<span class="deldynamic" @click="delDynamic(item1.id)">删除</span>
</span>
<p class="fs14 con ">{{ item1.content }}</p>
</van-step>
<!-- <van-step>
......@@ -53,10 +53,10 @@
</template>
<script>
import { removeTrajectory, handleWait } from "@/api/portrait";
import { removeTrajectory, handleWait } from '@/api/portrait'
export default {
props: ["stepList"],
inject:['reload'],
props: ['stepList'],
inject: ['reload'],
data() {
return {
// 步骤条
......@@ -66,45 +66,45 @@ export default {
// 轨迹内层
nlist: [],
oldele: [],
content: "",
content: '',
type: 0,
wList: [],
finished: false,
loading: false,
};
loading: false
}
},
watch: {
stepList(newVal, oldVal) {
// console.log(newVal, oldVal);
// console.log(newVal, oldVal);
if (newVal != oldVal) {
// debugger
this.wlist = [];
this.wList = [];
this.oldele = [];
this.nlist = [];
this.wlist = []
this.wList = []
this.oldele = []
this.nlist = []
}
newVal.forEach((ele) => {
this.oldele.push(parseInt(this.getTime(ele.createDate)));
this.oldele.push(parseInt(this.getTime(ele.createDate)))
// console.log(parseInt(this.getTime(ele.createDate)));
});
})
// console.log(this.oldele);
this.oldele = this.newArr(this.oldele).sort(this.f);
this.oldele = this.newArr(this.oldele).sort(this.f)
// console.log(this.oldele);
for (let i = 0; i < this.oldele.length; i++) {
for (let j = 0; j < newVal.length; j++) {
// console.log(newVal[j].createDate);
if (this.oldele[i] == this.getTime(newVal[j].createDate)) {
this.nlist.push(newVal[j]);
this.nlist.push(newVal[j])
// console.log(this.nlist);
}
}
this.wlist.push(this.nlist);
this.nlist = [];
this.wlist.push(this.nlist)
this.nlist = []
}
// console.log(this.wlist);
this.onLoad()
},
}
},
methods: {
onLoad() {
......@@ -112,82 +112,82 @@ export default {
// setTimeout 仅做示例,真实场景中一般为 ajax 请求
setTimeout(() => {
// debugger
let total = this.wlist.length > 10 ? 10 : this.wlist.length;
let total = this.wlist.length > 10 ? 10 : this.wlist.length
for (let i = 0; i < total; i++) {
this.wList.push(this.wlist[i]);
this.wList.push(this.wlist[i])
}
// 加载状态结束
this.loading = false;
this.loading = false
// 数据全部加载完成
if (this.wList.length >= this.wlist.length) {
this.finished = true;
this.finished = true
}
}, 1000);
}, 1000)
},
// 根据数字判断类型
chargeType(num) {
if (num == 1) {
return (this.type = "信息动态");
return (this.type = '信息动态')
} else if (num == 2) {
return (this.type = "社交动态");
return (this.type = '社交动态')
} else if (num == 3) {
return (this.type = "活动规则");
return (this.type = '活动规则')
} else if (num == 4) {
return (this.type = "待办动态");
return (this.type = '待办动态')
}
},
// 数组去重
newArr(arr) {
return Array.from(new Set(arr));
return Array.from(new Set(arr))
},
// 数组由大到小排序
f(a, b) {
//排序函数
return -(a - b); //取反并返回比较参数
return -(a - b) //取反并返回比较参数
},
// 时间处理器
getTime(data) {
const date = new Date(data);
const date = new Date(data)
// console.log(timer.getFullYear());
var Y = date.getFullYear();
var Y = date.getFullYear()
var M =
date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1;
var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
return Y + M + D;
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return Y + M + D
},
getTime1(data) {
const date = new Date(data);
const date = new Date(data)
// console.log(timer.getFullYear());
var Y = date.getFullYear() + "-";
var Y = date.getFullYear() + '-'
var M =
(date.getMonth() + 1 < 10
? "0" + (date.getMonth() + 1)
: date.getMonth() + 1) + "-";
var D = date.getDate() < 10 ? "0" + date.getDate() : date.getDate();
return Y + M + D;
? '0' + (date.getMonth() + 1)
: date.getMonth() + 1) + '-'
var D = date.getDate() < 10 ? '0' + date.getDate() : date.getDate()
return Y + M + D
},
getTime2(data) {
const date = new Date(data);
const date = new Date(data)
// console.log(timer.getFullYear());
var h =
(date.getHours() < 10 ? "0" + date.getHours() : date.getHours()) + ":";
(date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
var m =
date.getMinutes() < 10 ? "0" + date.getMinutes() : date.getMinutes();
return h + m;
date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return h + m
},
// 处理星期几
getTime3(time) {
var dateArray = time.split("-");
var dateArray = time.split('-')
var date = new Date(
dateArray[0],
parseInt(dateArray[1] - 1),
dateArray[2]
);
var week = "星期" + "日一二三四五六".charAt(date.getDay());
return week;
)
var week = '星期' + '日一二三四五六'.charAt(date.getDay())
return week
},
// 删除轨迹
delDynamic(id) {
......@@ -199,14 +199,14 @@ export default {
// this.msgSuccess("删除成功");
// debugger
// location.reload();
this.$toast.success('删除成功');
this.reload ()
this.$toast.success('删除成功')
this.reload()
// 重新获取全部数据
}
})
.catch((err) => {
console.log(err);
});
console.log(err)
})
},
// 点击完成
finDynamic(id) {
......@@ -214,15 +214,15 @@ export default {
.then((data) => {
if (data.code == 200) {
// this.delDynamic(id);
this.reload();
this.reload()
}
})
.catch((err) => {
console.log(err);
});
},
},
};
console.log(err)
})
}
}
}
</script>
<style lang="less" scoped>
......@@ -257,7 +257,7 @@ export default {
margin-top: 20px;
}
.finish-box {
display: inline-block;
display: inline-block;
position: relative;
left: 100px;
width: 25%;
......@@ -267,7 +267,7 @@ export default {
color: #2c8cf0;
font-size: 12px;
font-weight: 600;
// right: 30px;
// top: 0px;
// right: 30px;
// top: 0px;
}
</style>
......@@ -23,23 +23,21 @@
<div>
<span
>{{
form.remark
? form.remark
: form.name + '_' + form.remarkCorpName
user.remark
? user.remark
: (user.name || '') + '-' + (user.remarkCorpName || '')
}}
&nbsp; &nbsp;</span
><span
class="icon iconfont icon-man"
v-if="form.gender == 1"
></span>
</span>
<span class="icon iconfont icon-man" v-if="user.gender == 1">
</span>
<span
class="icon iconfont icon-xingbie"
v-else-if="form.gender == 2"
v-else-if="user.gender == 2"
></span>
<van-icon name="manager" color="#9c9c9c" v-else />
</div>
<div class="c9">
<span>昵称:</span><span>{{ form.name }}</span>
<span>昵称:</span><span>{{ user.name }}</span>
</div>
</div>
</div>
......@@ -53,6 +51,7 @@
input-align="right"
/>
<van-field
v-if="flage"
v-model="form.age"
name="年龄"
label="年龄"
......@@ -68,7 +67,12 @@
input-align="right"
@click="!flage ? (show = true) : ''"
/>
<van-popup v-model="show" position="bottom" round :style="{ height: '60%' }">
<van-popup
v-model="show"
position="bottom"
round
:style="{ height: '60%' }"
>
<van-datetime-picker
v-model="currentDate"
type="date"
......@@ -76,7 +80,7 @@
:min-date="minDate"
:max-date="maxDate"
@confirm="confirm"
@cancel = "cancel"
@cancel="cancel"
/></van-popup>
<!-- -------------------------- -->
<van-field
......@@ -128,7 +132,6 @@
</template>
<script>
import { getCustomerInfo, getWeCustomerInfo } from '@/api/portrait'
import { getUserInfo } from '@/api/common'
export default {
data() {
return {
......@@ -140,6 +143,7 @@ export default {
currentDate: new Date(2000, 0, 17),
// 接口开始
// 表单数据
user: {},
form: {
externalUserid: '', // 客户Id
userId: '', // 员工Id
......@@ -152,28 +156,25 @@ export default {
qq: '', // qq
position: '', // 职业
remarkCorpName: '', // 公司
description: '', // 其他描述
},
description: '' // 其他描述
}
}
},
computed: {
// 获取客户年龄
userId() {
return this.$store.state.userId // 员工Id
},
}
},
created() {
this.form.externalUserid = this.$route.query.customerId;
this.form.externalUserid = this.$route.query.customerId
// 获取客户详细信息
getCustomerInfo({
externalUserid: this.form.externalUserid,
userId: this.userId,
userId: this.userId
})
.then(({ data }) => {
// console.log(data);
this.form = data;
// console.log(this.form);
this.form = data
this.user = Object.assign({}, data)
})
.catch((err) => {
console.log(err)
......@@ -182,12 +183,12 @@ export default {
methods: {
// 选择生日
confirm(val) {
this.show = false
this.form.birthday =this.getTime (val)
console.log(val);
this.show = false
this.form.birthday = this.getTime(val)
console.log(val)
},
cancel () {
this.show = false
cancel() {
this.show = false
},
edit() {
this.flage = !this.flage
......@@ -203,24 +204,30 @@ export default {
: date.getMonth() + 1) + '-'
var D =
date.getDate() < 10 ? '0' + date.getDate() : date.getDate() + ' '
// var h =
// (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
// var m =
// date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
// var h =
// (date.getHours() < 10 ? '0' + date.getHours() : date.getHours()) + ':'
// var m =
// date.getMinutes() < 10 ? '0' + date.getMinutes() : date.getMinutes()
return Y + M + D
},
// 点击保存按钮提交表单
saveUserInformation() {
this.flage = !this.flage;
this.$toast.loading({
message: 'loading...',
duration: 0,
forbidClick: true
})
this.flage = !this.flage
this.form.userId = this.userId
getWeCustomerInfo(this.form)
.then((data) => {
console.log(data)
this.$toast('操作成功')
})
.catch((err) => {
console.log(err)
})
},
},
}
}
}
</script>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!