提交 e4f16c88 编写于 作者: U unknown

Merge branch 'front_end_dev_1.5' of https://gitee.com/LinkWeChat/link-wechat into front_end_dev_1.5

import request from "@/utils/request";
const wecom = window.CONFIG.services.wecom;
const service = wecom + "/portrait";
import request from '@/utils/request'
const wecom = window.CONFIG.services.wecom
const service = wecom + '/portrait'
// 根据客户id和当前企业员工id获取客户详细信息
export function getCustomerInfo(params) {
return request({
url: service + "/findWeCustomerInfo",
params,
});
url: service + '/findWeCustomerInfo',
params
})
}
// 客户画像资料更新
export function getWeCustomerInfo(data) {
return request({
url: service + "/updateWeCustomerInfo",
url: service + '/updateWeCustomerInfo',
method: 'post',
data:{
"externalUserid": data.externalUserid, // 客户Id
"userId": data.userId, // 员工Id
"remarkMobiles": data.remarkMobiles, // 手机号
"birthday": data.birthday, // 客户生日
"email": data.email, // 邮箱
"address": data.address, // 地址
"qq": data.qq, // qq
"position": data.position, // 职业
"remarkCorpName": data.remarkCorpName, // 公司
"description": data.description, // 其他描述
data: {
externalUserid: data.externalUserid, // 客户Id
userId: data.userId, // 员工Id
remarkMobiles: data.remarkMobiles, // 手机号
birthday: data.birthday, // 客户生日
email: data.email, // 邮箱
address: data.address, // 地址
qq: data.qq, // qq
position: data.position, // 职业
remarkCorpName: data.remarkCorpName, // 公司
description: data.description // 其他描述
}
});
})
}
// 获取当前系统所有可用标签
export function getAllTags(params) {
return request({
url: service + "/findAllTags",
params,
});
url: service + '/findAllTags',
params
})
}
// 更新客户画像标签
// 更新客户画像标签
export function updateWeCustomerPorTraitTag(data) {
return request({
url: service + "/updateWeCustomerPorTraitTag",
url: service + '/updateWeCustomerPorTraitTag',
method: 'post',
data,
});
data
})
}
// 查看客户添加的员工
export function findAddaddEmployes(params) {
return request({
url: service + "/findAddaddEmployes/" + params,
});
}
return request({
url: service + '/findAddaddEmployes/' + params
})
}
// 获取用户添加的群
export function findAddGroupNum(params) {
return request({
url: service + "/findAddGroupNum",
params,
});
}
return request({
url: service + '/findAddGroupNum',
params
})
}
// 获取轨迹信息
export function findTrajectory(params) {
return request({
url: service + "/findTrajectory",
params,
});
/**
*
* @param {*}
{
pageNum:
pageSize:
trajectoryType: 轨迹类型(1:信息动态;2:社交动态;3:活动规则;4:待办动态)
userId: 员工的id
externalUserid: 客户id
}
// 添加或编辑轨迹
* @returns
*/
export function findTrajectory(params) {
return request({
url: service + '/findTrajectory',
params
})
}
// 添加或编辑轨迹
export function addOrEditWaitHandle(data) {
return request({
url: service + "/addOrEditWaitHandle",
method: 'post',
data,
});
}
// 删除轨迹
return request({
url: service + '/addOrEditWaitHandle',
method: 'post',
data
})
}
// 删除轨迹
export function removeTrajectory(params) {
return request({
url: service + "/removeTrajectory/" + params,
method: 'delete',
});
}
// 完成待办
return request({
url: service + '/removeTrajectory/' + params,
method: 'delete'
})
}
// 完成待办
export function handleWait(params) {
return request({
url: service + "/handleWait/" + params,
method: 'delete',
});
}
\ No newline at end of file
return request({
url: service + '/handleWait/' + params,
method: 'delete'
})
}
<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>
......
......@@ -22,7 +22,7 @@
>{{
form.remark
? form.remark
: (form.name || '') + '_' + (form.remarkCorpName || '')
: (form.name || '') + '-' + (form.remarkCorpName || '')
}}
&nbsp; &nbsp;</span
><span
......@@ -70,15 +70,19 @@
<div class="data" is-link @click="labelEdit">编辑</div>
</div>
<van-row gutter="10" class="labelstyle">
<van-col span="4.5" v-for="(item, index) in labels" :key="index">
<van-col
span="4.5"
v-for="(item, index) in form.weTagGroupList"
:key="index"
>
<div
class="label"
v-for="(item1, index1) in item.weTags"
:key="index1"
>
{{ item1.name }}
</div></van-col
>
</div>
</van-col>
<!-- <van-col span="4.5"> <div class="label">标签1</div></van-col>
<van-col span="4.5"> <div class="label">标签1</div></van-col>
<van-col span="4.5"> <div class="label">标签1</div></van-col>
......@@ -88,51 +92,7 @@
</van-row>
</div>
<div class="divider"></div>
<!-- 点击客户标签里的编辑触发弹出框开始 -->
<van-action-sheet v-model="show">
<van-nav-bar
title="客户标签"
right-text="取消"
@click-right="show = false"
/>
<div class="content">
<span>测试:</span>
<van-row gutter="8" class="labelstyle">
<van-col span="4.5" v-for="(item, index) in grouplabel" :key="index"
><div
class="label"
@click="userLabel(item)"
:style="
addTag.some((item1) => item1.tagId == item.tagId)
? isActive
: ''
"
>
{{ item.name }}
</div></van-col
>
</van-row>
<div class="branch" v-if="true">
<van-divider />
<p>标签组:</p>
<van-row gutter="8" class="labelstyle">
<van-col span="4.5" v-for="(item, index) in alllabel" :key="index"
><div
class="label"
:class="{ styleactive: styleactive == item.groupId }"
@click="changeLabel(item)"
>
{{ item.gourpName }}
</div></van-col
>
</van-row>
<van-button type="info" class="saveinfo" round @click="saveInfo"
>保存</van-button
>
</div>
</div>
</van-action-sheet>
<!-- 点击客户标签里的编辑触发弹出框结束 -->
<!-- 社交关系 -->
<div class="realationship">
<div class="detail">
......@@ -161,33 +121,86 @@
<div>客户轨迹</div>
<div class="data" is-link @click="usershow = true">添加待办></div>
</div>
<van-row gutter="8" class="labelstyle">
<van-tabs v-model="query.trajectoryType" @change="changeInfo">
<van-tab :name="1" title="信息动态"></van-tab>
<van-tab :name="2" title="社交动态"></van-tab>
<van-tab :name="3" title="活动动态"></van-tab>
<van-tab :name="4" title="待办动态"></van-tab>
</van-tabs>
<!-- <van-row gutter="8" class="labelstyle">
<van-col span="6">
<div class="label1" @click="information" :style="styleActive1">
<div
class="label1"
@click="changeInfo('information')"
:style="styleActive1"
>
信息动态
</div></van-col
>
<van-col span="6">
<div class="label1" @click="socialContact" :style="styleActive2">
<div
class="label1"
@click="changeInfo('socialContact')"
:style="styleActive2"
>
社交动态
</div></van-col
>
<van-col span="6">
<div class="label1" @click="activity" :style="styleActive3">
<div
class="label1"
@click="changeInfo('activity')"
:style="styleActive3"
>
活动动态
</div></van-col
>
<van-col span="6">
<div class="label1" @click="dealtWith" :style="styleActive4">
<div
class="label1"
@click="changeInfo('dealtWith')"
:style="styleActive4"
>
待办动态
</div></van-col
>
</van-row>
</van-row> -->
<!-- 步骤条 -->
<StepList :stepList="list"></StepList>
</div>
<!-- 点击客户标签里的编辑触发弹出框开始 -->
<van-action-sheet v-model="show">
<van-nav-bar
title="客户标签管理"
right-text="取消"
@click-right="show = false"
/>
<div class="content">
<div v-for="(item, index) in alllabel" :key="index">
<div class="mb10 mt5">{{ item.gourpName }}</div>
<div class="labelstyle">
<div
v-for="(unit, unique) in item.weTags"
:key="unique"
class="label"
:style="addTag.some((e) => e.tagId == unit.tagId) ? isActive : ''"
@click="userLabel(unit)"
>
{{ unit.name }}
</div>
</div>
</div>
</div>
<van-button type="info" class="saveinfo" round @click="saveInfo"
>保存</van-button
>
</van-action-sheet>
<!-- 点击客户标签里的编辑触发弹出框结束 -->
<!-- 点击添加待办触发弹出框开始 -->
<van-action-sheet v-model="usershow">
<van-nav-bar
......@@ -274,7 +287,7 @@
</van-form>
</van-action-sheet>
<!-- 点击添加待办触发弹出框结束 -->
<div class="divider"></div>
<!-- <div class="divider"></div> -->
</div>
</template>
......@@ -289,9 +302,12 @@ import {
addOrEditWaitHandle
} from '@/api/portrait'
// import { getUserInfo } from "@/api/common";
import StepList from '../../components/StepList.vue'
import StepList from '@/components/StepList.vue'
import { param2Obj } from '@/utils/index'
export default {
components: {
StepList
},
data() {
return {
// 客户标签弹出框
......@@ -320,10 +336,8 @@ export default {
// 待办动态
todonewsshow: false,
// 接口开始
// externalUserid: "wm2H-nDQAACG5x4XjsM1OoW8UVfpbn3A", // 客户Id
// externalUserid: "wmiGuBCgAAgeijfvvpJ62cBfwrB-c4kw",
externalUserid: '',
// userId: this.$store.state.userId, // 员工Id
// externalUserid: 'wmiGuBCgAAoCBD1frD3hRplbsXoBLx6g', // 客户Id
// externalUserid: 'wmiGuBCgAAgeijfvvpJ62cBfwrB-c4kw',
form: {
name: '', // 昵称
remarkMobiles: '', // 手机号
......@@ -337,15 +351,12 @@ export default {
description: '', // 其他描述
weTagGroupList: [] // 客户标签合集
},
labels: [], // 客户标签
alllabel: [], // 标签组
grouplabel: [], // 一组标签
// 点击测试组标签获取的变量
groupId: '',
name: '',
tagId: '',
addTag: [], // 添加的参数
isactive: false,
isActive: 'background:#1989fa;color:#fff',
styleActive1: '',
styleActive2: '',
......@@ -356,14 +367,14 @@ export default {
groupChat: [], // 添加的群聊
commonGroup: [], // 共同的群聊
// 客户轨迹
pageNum: 1,
pageSize: 3,
trajectoryType: 0,
query: {
page: 1,
trajectoryType: 1
},
loading: false,
finished: false,
list: [],
styleactive: '',
flage: true,
agentId: ''
}
},
......@@ -375,6 +386,7 @@ export default {
computed: {
userId() {
return this.$store.state.userId
// || 'FengJuZhuDeJieDao'
},
// activeLabel : () => {
// this.addTag.forEach((value) => {
......@@ -387,6 +399,32 @@ export default {
return this.dateagency == this.getTime() ? date.getHours() : 0
}
},
created() {
this.$toast.loading({
message: 'loading...',
duration: 0,
forbidClick: true
})
// 获取agentId
let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash)
query = Object.assign(query, hash)
this.agentId = query.agentId
// console.log(agentId)
// this.findAddaddEmployes()
// this.findAddGroupNum()
// this.getCustomerInfo()
// this.findTrajectory()
// getAllTags()
// .then(({ data }) => {
// this.alllabel = data
// })
// .catch((err) => {
// console.log(err)
// })
},
methods: {
// 时间处理器
getTime(data) {
......@@ -426,7 +464,6 @@ export default {
_this.findTrajectory()
getAllTags()
.then(({ data }) => {
// console.log(data);
_this.alllabel = data
})
.catch((err) => {
......@@ -463,14 +500,16 @@ export default {
})
},
// 获取轨迹信息
findTrajectory() {
let _this = this
let form = _this.trajectoryType
? {
trajectoryType: _this.trajectoryType
}
: ''
findTrajectory(form)
findTrajectory(page) {
let query = {
pageNum: page,
pageSize: 10,
userId: this.userId,
externalUserid: this.externalUserid
}
Object.assign(query, this.query)
page && (query.page = page)
findTrajectory(query)
.then((data) => {
// console.log(data.total);
this.list = data.rows
......@@ -480,35 +519,8 @@ export default {
})
},
// 点击信息动态
information() {
// console.log(123);
;(this.trajectoryType = 1), this.findTrajectory()
this.styleActive1 = 'background:#1989fa;color:#fff'
this.styleActive2 = ''
this.styleActive3 = ''
this.styleActive4 = ''
},
socialContact() {
;(this.trajectoryType = 2), this.findTrajectory()
this.styleActive1 = ''
this.styleActive2 = 'background:#1989fa;color:#fff'
this.styleActive3 = ''
this.styleActive4 = ''
},
activity() {
this.trajectoryType = 3
changeInfo() {
this.findTrajectory()
this.styleActive1 = ''
this.styleActive2 = ''
this.styleActive3 = 'background:#1989fa;color:#fff'
this.styleActive4 = ''
},
dealtWith() {
;(this.trajectoryType = 4), this.findTrajectory()
this.styleActive1 = ''
this.styleActive2 = ''
this.styleActive3 = ''
this.styleActive4 = 'background:#1989fa;color:#fff'
},
// 添加代办
// 表单提交
......@@ -582,45 +594,26 @@ export default {
},
// 第一层标签
userLabel(item) {
// debugger
// console.log(item.tagId);
if (this.addTag.length == 0) {
let index = this.addTag.findIndex((e) => {
return item.tagId == e.tagId
})
// 数组里不存在该对象,则添加
if (index == -1) {
this.addTag.push({
groupId: item.groupId,
name: item.name,
tagId: item.tagId
})
} else {
this.addTag.forEach((item1) => {
if (item.tagId == item1.tagId) {
this.flage = false // 数组里存在该对象
}
})
// 数组里不存在该对象,则添加
if (this.flage) {
this.addTag.push({
groupId: item.groupId,
name: item.name,
tagId: item.tagId
})
} else {
// 数组里存在该对象,则删除
this.addTag = this.addTag.filter((element) => {
return element.name !== item.name
})
}
// 数组里存在该对象,则删除
this.addTag.splice(index, 1)
}
},
// 第二层标签
changeLabel(item) {
// console.log(item);
this.styleactive = item.groupId
this.grouplabel = item.weTags
},
saveInfo() {
// 更新客户画像标签 [{ groupId: this.groupId, name: this.name, tagId: this.tagId }]
updateWeCustomerPorTraitTag({
externalUserid: this.externalUserid,
userId: this.userId,
addTag: this.addTag
})
.then((res) => {
......@@ -641,10 +634,9 @@ export default {
// 点击编辑按钮
labelEdit() {
this.show = true
// console.log(this.labels);
if (this.labels) {
this.labels.forEach((ele) => {
this.addTag.push(ele.weTags[0])
if (this.form.weTagGroupList) {
this.form.weTagGroupList.forEach((ele) => {
this.addTag.push(...ele.weTags[0])
})
}
// 获取用户当前的lable,将当前用户的lable与所有lable进行对比,相同的弹框内蓝色展示
......@@ -691,29 +683,12 @@ export default {
.then(({ data }) => {
// console.log(data);
this.form = data
this.labels = this.form.weTagGroupList
// console.log(this.form);
})
.catch((err) => {
console.log(err)
})
}
},
created() {
this.$toast.loading({
message: 'loading...',
duration: 0,
forbidClick: true
})
// 获取agentId
let query = param2Obj(window.location.search)
let hash = param2Obj(window.location.hash)
query = Object.assign(query, hash)
this.agentId = query.agentId
console.log(agentId)
},
components: {
StepList
}
}
</script>
......@@ -741,6 +716,7 @@ export default {
.detail {
display: flex;
justify-content: space-between;
align-items: center;
.c9 {
color: #9c9c9c;
}
......@@ -770,7 +746,11 @@ export default {
background-color: #f2f2f2;
}
.content {
padding: 16px 16px 160px;
max-height: 60vh;
position: relative;
margin: 16px 0 60px;
padding: 0 16px;
overflow: auto;
}
.van-action-sheet__header {
.van-icon-cross {
......@@ -782,33 +762,32 @@ export default {
.labelstyle {
display: flex;
flex-wrap: wrap;
// justify-content: space-between;
padding-top: 10px;
align-items: center;
.label,
.label1 {
display: inline-block;
width: 60px;
height: 18px;
min-width: 45px;
font-size: 12px;
padding: 4px 5px 3px;
// background-color: #f2f2f2;
color: #2c8cf0;
border: 1px solid #2c8cf0;
text-align: center;
margin: 10px 0 10px 10px;
margin: 0 0 10px 10px;
line-height: 16px;
border-radius: 6px;
border-radius: 4px;
}
}
.branch {
position: relative;
.saveinfo {
position: absolute;
width: 90%;
height: 30px;
left: 50%;
top: 150%;
transform: translate(-50%, -50%);
}
}
.saveinfo {
position: absolute;
width: 90%;
height: 30px;
left: 50%;
bottom: 0;
transform: translate(-50%, -50%);
}
// 社交关系
......@@ -891,14 +870,15 @@ export default {
padding: 0 10px;
}
}
/deep/.styleactive {
// background: #f00;
color: #2c8cf0;
}
.iconfont {
color: #2c8cf0;
}
.icon-xingbie {
color: pink;
}
.van-divider {
margin: 10px 0;
}
</style>
const baseUrl = window.location.origin.includes('localhost') ? window.location.origin : 'http://146.56.222.200:8090'
const baseUrl = window.location.origin.includes('localhost') ? window.location.origin : 'http://demo.linkwechat.cn:8090'
// 'http://106.13.201.219'
// const baseUrl = window.location.origin+'/mock/11'
// const baseUrl = 'http://47.112.117.15:40001/mock/11'
......
......@@ -2,7 +2,7 @@
ENV = 'development'
# 仟微管理系统/开发环境
VUE_APP_BASE_API = 'http://119.45.28.29:8090'
VUE_APP_BASE_API = 'http://demo.linkwechat.cn/api'
# VUE_APP_BASE_API = 'http://n3rpzt.natappfree.cc'
# 开发环境IP
......
......@@ -57,7 +57,7 @@
"normalize.css": "^8.0.1",
"nprogress": "0.2.0",
"path-to-regexp": "2.4.0",
"performance_test_plugins_milk": "^0.0.5",
"performance_test_plugins_milk": "^0.0.7",
"promise.prototype.finally": "^3.1.2",
"screenfull": "4.2.0",
"sortablejs": "1.8.4",
......
......@@ -15,7 +15,7 @@ userName:
export function getList(params) {
return request({
url: service + '/leaveUserAllocateList',
params,
params
})
}
......@@ -33,7 +33,7 @@ userName:
export function getListNo(params) {
return request({
url: service + '/leaveUserNoAllocateList',
params,
params
})
}
......@@ -49,7 +49,7 @@ export function allocate(data) {
return request({
url: service + '/allocateLeaveUserAboutData',
method: 'put',
data,
data
})
}
......@@ -67,6 +67,24 @@ export function allocate(data) {
export function getAllocateCustomers(params) {
return request({
url: service + '/getAllocateCustomers',
params,
params
})
}
/**
* 离职已分配客户群
* @param {*} params
{
"pageNum": 0,
"pageSize": 0,
"beginTime": "",
"endTime": "",
"oldOwner": "" 原群主ID
}
*/
export function getAllocateGroups(params) {
return request({
url: service + '/getAllocateGroups',
params
})
}
......@@ -10,7 +10,11 @@
</el-breadcrumb-item>
<el-breadcrumb-item v-for="(item, index) in levelList" :key="item.path">
<span
v-if="item.redirect === 'noRedirect' || index == levelList.length - 1"
v-if="
item.redirect === 'noRedirect' ||
index == levelList.length - 1 ||
!/^\//gi.test(item.redirect)
"
class="no-redirect"
>{{ item.meta.title }}</span
>
......@@ -35,7 +39,7 @@ import pathToRegexp from 'path-to-regexp'
export default {
data() {
return {
levelList: null,
levelList: null
}
},
watch: {
......@@ -46,12 +50,12 @@ export default {
}
this.$store.state.app.busininessDesc = ''
this.getBreadcrumb()
},
}
},
computed: {
busininessDesc() {
return this.$store.state.app.busininessDesc
},
}
},
created() {
this.getBreadcrumb()
......@@ -62,7 +66,6 @@ export default {
let matched = this.$route.matched.filter(
(item) => item.meta && item.meta.title
)
console.log(matched)
const first = matched[0]
// if (!this.isDashboard(first)) {
......@@ -92,8 +95,8 @@ export default {
return
}
this.$router.push(this.pathCompile(path))
},
},
}
}
}
</script>
......@@ -106,7 +109,7 @@ export default {
margin-left: 8px;
.no-redirect {
color: $blue;
color: #999;
cursor: text;
}
}
......
......@@ -6,13 +6,13 @@ import View from '@/layout/components/View'
const permission = {
state: {
routes: [],
addRoutes: [],
addRoutes: []
},
mutations: {
SET_ROUTES: (state, routes) => {
state.addRoutes = routes
state.routes = constantRoutes.concat(routes)
},
}
},
actions: {
// 生成路由
......@@ -26,20 +26,22 @@ const permission = {
resolve(accessedRoutes)
})
})
},
},
}
}
}
// 遍历后台传来的路由字符串,转换为组件对象
function filterAsyncRouter(asyncRouterMap, level) {
return asyncRouterMap.filter((route) => {
let level = 0
function filterAsyncRouter(asyncRouterMap) {
level++
let res = asyncRouterMap.filter((route) => {
if (route.component) {
// Layout组件特殊处理
if (route.component === 'Layout') {
if (route.redirect === 'noRedirect' && route.children.length) {
route.redirect = route.path + '/' + route.children[0].path
}
if (level === 2) {
if (level != 1) {
route.component = View
} else {
route.component = Layout
......@@ -49,10 +51,12 @@ function filterAsyncRouter(asyncRouterMap, level) {
}
}
if (route.children != null && route.children && route.children.length) {
route.children = filterAsyncRouter(route.children, 2)
route.children = filterAsyncRouter(route.children)
}
return true
})
level--
return res
}
export const loadView = (view) => {
......
......@@ -60,7 +60,7 @@ export function yearMouthDay(data) {
var date = time.getDate();
console.log(year+'-'+add0(month)+'-'+add0(date))
return year+'-'+add0(month)+'-'+add0(date)
}
function add0(m){return m<10?'0'+m:m }
......@@ -185,7 +185,7 @@ export function dataURLtoFile (dataURL) {
/**
* 整理echat 数据
* @param {*} arrData 数据
* @param {*} arrData 数据
*/
export function arrData (data) {
let obj={
......@@ -199,17 +199,10 @@ export function arrData (data) {
data.forEach((a,b)=>{
obj.arr1.push(a.newApplyCnt)
obj.btm1.push(a.xtime)
if(!!a.newMemberCnt){
obj.arr3.push(a.newMemberCnt)
}else{
obj.arr3=[]
}
obj.arr3.push(a.newMemberCnt)
obj.arr2.push(a.newContactCnt)
obj.arr4.push(a.negativeFeedbackCnt)
})
//newApplyCnt =>arr1
//newContactCnt =>arr2
//negativeFeedbackCnt =>arr4
console.log(obj)
return obj
}
......@@ -13,7 +13,7 @@ const service = axios.create({
? '/api'
: process.env.VUE_APP_BASE_API,
// 超时
timeout: 10000,
timeout: 10000
})
// request拦截器
service.interceptors.request.use(
......@@ -47,7 +47,7 @@ service.interceptors.response.use(
{
confirmButtonText: '重新登录',
cancelButtonText: '取消',
type: 'warning',
type: 'warning'
}
).then(() => {
store.dispatch('LogOut').then(() => {
......@@ -57,32 +57,34 @@ service.interceptors.response.use(
} else if (code === 500) {
Message({
message: msg,
type: 'error',
type: 'error'
})
return Promise.reject(new Error(msg))
// return Promise.reject(new Error(msg))
return Promise.reject()
} else {
Notification.error({
title: msg,
title: msg
})
return Promise.reject('error')
return Promise.reject()
}
},
(error) => {
console.log('err' + error)
let { message } = error
let { message, response, config } = error
if (message == 'Network Error') {
message = '后端接口连接异常'
} else if (message.includes('timeout')) {
message = '系统接口请求超时'
} else if (message.includes('Request failed with status code')) {
message = '系统接口' + message.substr(message.length - 3) + '异常'
} else if (response) {
let status = response.status
mes = '系统接口:' + status + '异常'
}
Message({
message: message,
message: `${message}:${config.url}`,
type: 'error',
duration: 5 * 1000,
duration: 5 * 1000
})
return Promise.reject(error)
return Promise.reject()
}
)
......
<script>
import { getAllocateCustomers } from '@/api/customer/dimission'
import AllocatedStaffDetailList from './allocatedStaffDetailList'
export default {
......@@ -8,18 +7,8 @@ export default {
props: {},
data() {
return {
// 查询参数
query: {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
beginTime: undefined,
endTime: undefined,
},
loading: false,
total: 0,
list: [],
dateRange: [], // 离职日期
active: 'customer',
dateRange: [] // 离职日期
}
},
watch: {},
......@@ -28,13 +17,14 @@ export default {
mounted() {},
methods: {
getList() {
this.$refs.AllocatedStaffDetailList.getList(1)
this.$refs[this.active].getList(1)
},
resetForm(formName) {
this.dateRange = []
this.$refs['queryForm'].resetFields()
},
},
this.getList()
}
}
}
</script>
......@@ -43,14 +33,14 @@ export default {
<el-form
ref="queryForm"
:inline="true"
:model="query"
label-width="100px"
label-width="70px"
class="top-search"
>
<el-form-item label="离职日期">
<el-date-picker
v-model="dateRange"
type="daterange"
value-format="yyyy-MM-dd"
:picker-options="pickerOptions"
range-separator="至"
start-placeholder="开始日期"
......@@ -74,17 +64,18 @@ export default {
</el-form-item>
</el-form>
<el-tabs value="first" type="card">
<el-tab-pane label="已分配客户" name="first">
<el-tabs v-model="active">
<el-tab-pane label="已分配客户" name="customer">
<AllocatedStaffDetailList
ref="AllocatedStaffDetailList"
ref="customer"
:dateRange="dateRange"
></AllocatedStaffDetailList>
</el-tab-pane>
<el-tab-pane label="已分配群聊" name="second">
<el-tab-pane label="已分配群聊" name="group">
<AllocatedStaffDetailList
ref="AllocatedStaffDetailList"
ref="group"
:dateRange="dateRange"
type="group"
></AllocatedStaffDetailList>
</el-tab-pane>
</el-tabs>
......
<script>
import { getAllocateCustomers } from '@/api/customer/dimission'
import {
getAllocateCustomers,
getAllocateGroups
} from '@/api/customer/dimission'
export default {
name: 'AllocatedStaffDetailList',
......@@ -8,6 +11,10 @@ export default {
dateRange: {
type: Array,
default: () => []
},
type: {
type: String,
default: 'customer'
}
},
data() {
......@@ -17,6 +24,7 @@ export default {
pageNum: 1,
pageSize: 10,
handoverUserId: undefined,
oldOwner: undefined,
beginTime: undefined,
endTime: undefined
},
......@@ -29,6 +37,7 @@ export default {
computed: {},
created() {
this.query.handoverUserId = this.$route.query.userId
this.query.oldOwner = this.$route.query.userId
this.getList()
},
mounted() {},
......@@ -41,7 +50,9 @@ export default {
}
page && (this.query.pageNum = page)
this.loading = true
getAllocateCustomers(this.query)
;(this.type === 'customer' ? getAllocateCustomers : getAllocateGroups)(
this.query
)
.then(({ rows, total }) => {
this.list = rows
this.total = +total
......@@ -63,8 +74,16 @@ export default {
tooltip-effect="dark"
style="width: 100%"
>
<el-table-column prop="customerName" label="客户名称"></el-table-column>
<el-table-column prop="takeUserName" label="接替员工"></el-table-column>
<el-table-column
v-if="type === 'customer'"
prop="customerName"
label="客户名称"
></el-table-column>
<el-table-column v-else prop="groupName" label="群名称"></el-table-column>
<el-table-column
:prop="type === 'customer' ? 'takeUserName' : 'newOwnerName'"
label="接替员工"
></el-table-column>
<el-table-column
prop="department"
label="接替员工所属部门"
......
......@@ -80,6 +80,7 @@ export default {
this.dialogVisibleSelectUser = true
return
}
let loading = this.$loading()
api
.allocate({
handoverUserid: this.currentRow.userId,
......@@ -87,6 +88,10 @@ export default {
})
.then(() => {
this.msgSuccess('操作成功')
loading.close()
})
.catch(() => {
loading.close()
})
},
// 选中数据
......@@ -157,6 +162,7 @@ export default {
</div>
<el-table
v-loading="loading"
ref="multipleTable"
:data="list"
tooltip-effect="dark"
......
......@@ -165,6 +165,9 @@ export default {
form.messageType = '1'
} else if (form.textMessage.content) {
form.messageType = '0'
} else {
this.msgInfo('消息内容不能为空')
return Promise.reject()
}
// debugger
form.tag = form.tag.map((d) => d.tagId) + ''
......
此差异已折叠。
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册