Commit efc6234b authored by Mac's avatar Mac

客户阶段

parent db422319
......@@ -467,6 +467,41 @@ export function SetSynvEduEmployee(data) {
})
}
/**
* 获取客户阶段流程列表
*
*/
export function getCustomerStageFlowList(data) {
return request({
url: '/QYCustomer/GetCustomerStageFlowList',
method: 'post',
data
})
}
/**
* 获取客户阶段列表
*
*/
export function getCustomerStageList(data) {
return request({
url: '/QYCustomer/GetCustomerStageList',
method: 'post',
data
})
}
/**
* 新增修改客户阶段
*
*/
export function setCustomerStageInfo(data) {
return request({
url: '/QYCustomer/SetCustomerStageInfo',
method: 'post',
data
})
}
......
<style>
@import "../../../financial/css/cssReset.css";
.addPhase {
padding: 20px;
}
.addPhase .box {
width: 100%;
border-radius: 6px;
background: #fff;
padding: 20px;
margin-bottom: 25px;
}
.addPhase .bold{
font-weight: 760;
font-size: 16px;
color: #333;
border-left: 3px solid #3470ff;
margin-bottom: 20px;
margin-left: -20px;
padding-left: 20px;
}
</style>
<template>
<div class="addPhase" style="background: transparent;">
<div class="box">
<div class="bold">名称</div>
<q-input clearable debounce filled maxlength="20" counter v-model="addMsg.FlowName" style="width:600px"
@input="$forceUpdate()" placeholder="名称" :rules="[val => !!val || '不能为空']" />
</div>
<div class="box">
<div class="bold">阶段适用范围</div>
<q-btn class="q-mr-md" label="选择部门/成员" @click="outerVisible = true" />
</div>
<div class="box">
<div class="bold">选择使用阶段</div>
<div style="display:flex;align-items: center;">
</div>
</div>
<div v-if="StageList">
<div class="box" v-for="(x,y) in StageList" v-if="x.Type==2">
<div class="bold" v-if="x.Name=='已输单'">选择输单原因</div>
<div class="bold" v-if="x.Name=='无效'">选择无效原因</div>
<div style="display:flex;align-items: center;flex-wrap: wrap;">
<q-checkbox v-model="addMsg.LoseCause" v-if="x.Name=='已输单'"
v-for="(item,index) in x.OptionsList" :key='index' :val="item.Id"
:label="item.Name" />
<q-checkbox v-model="addMsg.InvalidCause" v-if="x.Name=='无效'"
v-for="(item,index) in x.OptionsList" :key='index' :val="item.Id"
:label="item.Name" />
</div>
</div>
</div>
<div class="box">
<el-form label-width="120px">
</el-form>
<q-card-actions align="left" class="bg-white" >
<q-btn color="accent" class="q-mr-md" label="保存" @click="savemove()" style="width: 100px;"
:loading="loading" />
<q-btn class="q-mr-md" label="返回" @click="goblck()" style="width: 60px;" />
</q-card-actions>
</div>
<!-- 人员/部门选择 -->
<choiceapprovalorbranch v-if="outerVisible" @close="outerVisible = false" @success="getsuccess2" :byval='showMember' cptype="1"></choiceapprovalorbranch>
</div>
</template>
<script>
import choiceapprovalorbranch from './components/choiceapprovalorbranch'
import {
getCustomerStageList,
} from '../../../../api/system/wechat';
export default {
meta: {
title: "阶段管理"
},
components: {
choiceapprovalorbranch
},
name: "addPhase",
data() {
return {
loading: false,
outerVisible:false,
addMsg:{
FlowName:'',
DeptEmpList:[],
UseStage:'',
LoseCause:[],
InvalidCause:[],
},
showMember:[],
StageList:[],
}
},
created() {
this.getCustomerStageList()
},
methods: {
goblck() {//返回上一个页面
this.$router.go(-1);//返回上一层
},
savemove(){
},
getCustomerStageList(){
getCustomerStageList({}).then(res => {
this.loading = false
if (res.Code == 1) {
this.StageList = res.Data
}
})
},
getsuccess2(list,type){
console.log(list)
this.showMember = list
this.outerVisible = false
},
}
}
</script>
\ No newline at end of file
......@@ -58,6 +58,7 @@
<el-form-item label="列表选项:" v-if='tab==3|| tab==4'>
<draggable v-model="addMsg.OptionsList">
<div v-for="(x,y) in addMsg.OptionsList" :key='y' style="display: flex;align-items: center;margin-bottom: 10px;">
<i class="iconfont icon-weiyi" style="font-size: 14px;color: #777;margin-right: 10px;"></i>
<q-input clearable filled maxlength="16" v-model="x.Name" style="width: 280px;" @input="$forceUpdate()" label="列表项值" />
<q-btn round size="xs" color="deep-orange" icon="delete" v-if="addMsg.OptionsList.length>1" @click="addMsg.OptionsList.splice(y,1)" style='margin-left: 10px;'/>
<q-btn round size="xs" color="primary" icon="add" v-if="addMsg.OptionsList.length==y+1" @click="addMsg.OptionsList.push({Id:0,Name:''})" style='margin-left: 10px;'/>
......
<style>
.choiceappoval .ApprovalProcessBg {
background: #f8f8f8;
max-height: 400px;
overflow-y: auto;
}
.choiceappoval .Approval_yxList {
width: 300px;
background: #f8f8f8;
min-height: 400px;
max-height: 400px;
overflow-y: auto;
}
.choiceappoval .Approval_yxList li {
display: inline-block;
width: 100%;
line-height: 40px;
text-indent: 15px;
border-bottom: 1px dotted #eee;
}
</style>
<template>
<div>
<q-dialog v-model="IsShow" persistent>
<q-card style="width: 700px; max-width: 80vw;" class="choiceappoval">
<q-card-section class="row items-center q-pb-none ">
<div class="text-h6">选择企业成员</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-separator />
<q-card-section class="q-pt-none" style="padding: 20px 0;">
<div style="display: flex;align-items: flex-start;justify-content: space-between;">
<div style="width: 300px; margin: 0 20px;">
<p style="margin: 0 0 10px 0;display: flex;align-items: center;">选择:<el-input
style="width: 200px;" placeholder="输入关键字进行过滤" v-model="filterText">
</el-input>
</p>
<el-tree class='ApprovalProcessBg' :filter-node-method="filterNode" :data="memberList"
show-checkbox ref="treeUser" :props="defaultProps" :render-after-expand="false"
node-key="DeptId" @check-change="handleNodeChange" @check='btncheck'>
</el-tree>
</div>
<div style="width: 300px; margin: 0 20px;">
<p style="margin: 0 0 20px 0;">已选:</p>
<div class="Approval_yxList">
<li v-for="item in showMember">{{item.DeptName}}
<i @click="mySetCheckedKeys(item.DeptId)"
class="el-icon-circle-close showMemberIcon"></i>
</li>
</div>
</div>
</div>
</q-card-section>
<q-separator />
<q-card-actions align="right" class="bg-white">
<q-btn class="q-mr-md" label="取消" @click="closeEditOrder" />
<q-btn color="accent" class="q-mr-md" label="确定" @click="saveOrderInfo()" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script>
import {
getEmployeeAddrBook
} from '../../../../../api/users/user'
export default {
props: {
outerindex: {
type: String,
default: '',
},
byval:{
type: Array,
default: [],
},
cptype:{//1是列表上使用2 新增使用
type:String,
default: '1',
}
},
data() {
return {
IsShow: true,
memberList: [],
filterText: "",
defaultProps: {
children: 'ChildList',
label: 'DeptName',
},
userList: [],
showMember: [],
memberSetCheckedKeys: [],
sysUserKeys: [],
newList:[]
}
},
created() {
if(this.byval.length>0){
this.memberSetCheckedKeys = [];
this.showMember = JSON.parse(JSON.stringify(this.byval))
this.byval.forEach(x=>{
this.memberSetCheckedKeys.push(x.DeptId)
})
}
this.getMember()//部门下面选择员工
},
mounted() {
},
watch: {
filterText(val) {
this.$refs.treeUser.filter(val);
},
},
methods: {
getMember() {
let _arr = this.sysUserKeys.concat(this.memberSetCheckedKeys)
getEmployeeAddrBook({}).then(res => {
if (res.Code == 1) {
this.memberList = res.Data
let _this = this;
_this.$refs.treeUser.setCheckedKeys(_arr);
}
}).catch(() => {
})
},
filterNode(value, data) {
if (!value) return true;
return data.DeptName.indexOf(value) !== -1;
},
handleNodeChange(data, checked) {
console.log(data,checked)
data.IsCheck = checked;
if (data.DataType == 2 && data.IsCheck) { //是员工且选中
let isExsit = false
this.showMember.forEach(x => {
if (x.DeptId == data.DeptId) {
isExsit = true
return false
}
})
if (!isExsit) {
this.showMember.push({
DeptName: data.DeptName,
DeptId: data.DeptId,
DataType:data.DataType
})
this.memberSetCheckedKeys.push(data.DeptId)
}
} else if (data.DataType == 2 && !data.IsCheck) {
if (this.showMember.findIndex(item => item.DeptId === data.DeptId) != -1) {
this.showMember.splice(this.showMember.findIndex(item => item.DeptId === data.DeptId), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId), 1)
if (this.showMember.findIndex(item => item.DeptId === data.ParentId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1)
}
}
}
if (data.DataType != 2 && data.IsCheck) {
if (this.memberSetCheckedKeys.findIndex(item => item === data.DeptId) == -1) {
this.memberSetCheckedKeys.push(data.DeptId)
}
} else if (data.DataType == 2 && !data.IsCheck) {
if (this.memberSetCheckedKeys.findIndex(item => item === data.DeptId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.DeptId), 1)
if (this.showMember.findIndex(item => item.DeptId === data.ParentId) != -1) {
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === data.ParentId), 1)
}
}
}
},
btncheck(){//对数据的处理
this.getdataprocess()
},
getdataprocess(){
},
getChildList(x,list){
},
mySetCheckedKeys(id) {
if (this.memberSetCheckedKeys.length == 0)
return
if (id == -1) {
this.$refs.treeUser.setCheckedKeys(this.memberSetCheckedKeys)
return
}
this.showMember.splice(this.showMember.findIndex(item => item.DeptId === id), 1)
this.memberSetCheckedKeys.splice(this.memberSetCheckedKeys.findIndex(item => item === id), 1)
this.$refs.treeUser.setCheckedKeys(this.memberSetCheckedKeys);
},
//关闭弹窗
closeEditOrder() {
this.$emit('close')
},
saveOrderInfo() {
this.$emit('success',this.showMember,this.cptype)
}
}
}
</script>
\ No newline at end of file
......@@ -17,10 +17,11 @@
<th>是否必填</th>
<th width="13%">操作信息</th>
<th width="12%">操作</th>
<th width="4%"></th>
</tr>
</thead>
<tr v-if="data.length==0">
<td :colspan="7" align="center">暂无数据</td>
<td :colspan="8" align="center">暂无数据</td>
</tr>
<draggable v-model="data" element="tbody" :move="getdata" @update="datadragEnd">
<tr v-for="(item,index) in data" :key="index">
......@@ -48,6 +49,9 @@
<q-btn v-if='item.IsDefault!=1' flat size="xs" icon="delete" color="negative" class="q-mr-xs"
label="删除" @click="godelete(item,3,index)" />
</td>
<td>
<i class="iconfont icon-weiyi" style="font-size: 14px;color: #777;"></i>
</td>
</tr>
</draggable>
</table>
......
<template>
<div class="customerPhase page-body">
<div style="display: flex;align-items: center;justify-content: space-between;">
<div style="display: flex;align-items: center;">
<q-btn v-if="data.length<20" color="accent" style="margin-bottom: 10px;" class="q-mr-md" label="创建阶段流程" @click="goestablish()"></q-btn>
<span style="margin-left: 20px;color: rgb(133, 133, 152);">已添加:{{data.length}}/20</span>
</div>
<q-btn color="white" text-color="black" style="margin-bottom: 10px;" class="q-mr-md" label="阶段管理"
@click="stageManagement()"></q-btn>
</div>
<div class="page-content">
<table class="payTable">
<thead>
<tr>
<th>名称</th>
<th>适用范围</th>
<th>启用</th>
<th>阶段</th>
<th width="13%">操作信息</th>
<th width="12%">操作</th>
</tr>
</thead>
<tr v-if="data.length==0">
<td :colspan="6" align="center">暂无数据</td>
</tr>
<tr v-for="(item,index) in data" :key="index">
<td><span>{{item.FlowName}}</span></td>
<td>
<span v-for="(x,y) in item.DeptEmpList" :key='y'>
<el-tag type="danger" v-if="x.Type==0">{{x.Name}}</el-tag>
<el-tag type="success" v-if="x.Type==1">{{x.Name}}</el-tag>
<el-tag v-if="x.Type==2">{{x.Name}}</el-tag>
</span>
</td>
<td>
<q-toggle v-if="item.IsDefault==1" v-model="item.Enable" :true-value="1" :false-value="2"
icon="lock" disable />
<q-toggle v-else v-model="item.Enable" :true-value="1" :false-value="2"
@input="godelete(item,1,index)" />
</td>
<td>
<span v-for="(x,y) in item.StageList" :key='y'>
{{x}}{{item.StageList.length!=y+1?'->':''}}
</span>
</td>
<td>
<div>{{item.UpdateByName}}</div>
<div>{{item.UpdateTime}}</div>
</td>
<td>
<q-btn v-if='item.IsDefault!=1' flat size="xs" icon="edit" style="font-weight:400;color: #3FC4FF" class="q-mr-xs"
label="编辑" @click="goedit(item)" />
<q-btn v-if='item.IsDefault!=1' flat size="xs" icon="delete" color="negative" class="q-mr-xs"
label="删除" @click="godelete(item,3,index)" />
</td>
</tr>
</table>
<div v-if="Isadd==true">
<addfield :obj='addMsg' :deptl='deptl' :tabsList='tabsList' :checkboxList='checkboxList'
@getcancel='getcancel'></addfield>
</div>
</div>
</div>
</template>
<script>
import addfield from "./components/addfield"
import {
getCustomerStageFlowList,
} from '../../../../api/system/wechat';
//部门
import {
getDeptTree
} from '../../../../api/system/dept'
export default {
components: {
addfield,
},
data() {
return {
loading: false,
data: [],
Isadd: false,
addMsg: null,
Enable: -1,
deptl: [],//部门下拉
tabsList: [],
checkboxList: [],//输入类型 数组
dragId: 0,//拖动的ID
}
},
created() {
this.getList()
this.getDepartList()
},
methods: {
goaddfield() {//新增字段
this.Isadd = true;
this.addMsg = null
},
goedit(item) {
this.Isadd = true;
this.addMsg = JSON.parse(JSON.stringify(item))
},
godelete(item, type, index) {//删除
let text = ''
if (type == 1) {//tyep等于1和2的时候 先让弹出提示 然后再给予掉接口 所以把原本的值暂时先赋值给本身
text = '确定修改启用状态'
if (item.Enable == 2) {
this.data[index].Enable = 1
} else {
this.data[index].Enable = 2
}
} else if (type == 2) {
text = '确定修改必填状态'
if (item.Required == 2) {
this.data[index].Required = 1
} else {
this.data[index].Required = 2
}
} else if (type == 3) {
text = '删除后字段不在显示,是否删除?'
}
this.$q.dialog({
title: "提示信息",
message: text,
cancel: {
label: "取消",
flat: true
},
ok: {
label: "确认",
flat: true,
focus: true
}
}).onOk(() => {
this.setFiledState(item, type)
});
},
setFiledState(item, Type) {
let msg = {
Type: Type,
FiledId: item.Id,
SortFiledId: 0,
}
setCustomerFiledState(msg).then(res => {
if (res.Code == 1) {
this.$q.notify({
icon: 'iconfont icon-chenggong',
color: 'accent',
timeout: 2000,
message: res.Message,
position: 'top'
})
this.getList()
}
})
},
getcancel(type) {
this.Isadd = false;
this.tabsList.forEach(x => {
x.disable = false
})
if (type == 2) {//数据保存成功的处理
this.getList()
}
},
getList() {
this.loading = true
getCustomerStageFlowList({ Enable: 0 }).then(res => {
this.loading = false
if (res.Code == 1) {
this.data = res.Data;
}
})
},
//获取部门下拉数据
getDepartList(id) {
let msg = {
School_Id: 0
}
getDeptTree(msg).then(res => {
if (res.Code == 1) {
this.deptl = res.Data;
}
})
},
stageManagement() {//阶段管理
this.$router.push({
path: '/enterprise/customer/CSChild/stageManagement',
});
},
goestablish() {//创建阶段流程
this.$router.push({
path: '/enterprise/customer/CSChild/addPhase',
});
}
}
}
</script>
<style>
.customerPhase .payTable {
width: 100%;
border-collapse: collapse;
}
.customerPhase .payTable tr th {
background: #fff;
height: 40px;
font-size: 12px;
font-weight: bold;
color: #2D2D2D;
background: #DDDEE0;
}
.customerPhase .payTable tr {
background: #fff;
text-align: center;
height: 40px;
}
.customerPhase .payTable tr td {
font-size: 13px;
text-align: center;
color: #2D2D2D;
padding: 10px 0;
font-weight: bold;
border-bottom: 1px solid #E5E5E5;
}
</style>
\ No newline at end of file
This diff is collapsed.
......@@ -16,9 +16,11 @@
 121212
</div>
<div v-if="tabCheck=='1'" >
 
<customerField></customerField>
</div>
<div v-if="tabCheck=='6'" >
<customerPhase></customerPhase>
</div>
<q-inner-loading :showing="loading">
......@@ -35,9 +37,12 @@
} from '../../../api/system/wechat';
import customerField from './CSChild/customerField'
import customerPhase from './CSChild/customerPhase'
export default {
components: {
customerField,//客户字段
customerPhase,//客户阶段
},
meta: {
title: "客户设置"
......@@ -46,8 +51,8 @@
data() {
return {
loading: false,
MediumList:[{Name:'业务模式',Id:0},{Name:'客户字段',Id:1}],
tabCheck:1,
MediumList:[{Name:'业务模式',Id:0},{Name:'客户字段',Id:1},{Name:'客户阶段',Id:6}],
tabCheck:6,
}
},
created() {
......
......@@ -1259,6 +1259,17 @@ const routes = [{
component: () =>
import("pages/enterprise/customer/customerSetup")
},
{
path: "/enterprise/customer/CSChild/stageManagement", //企微 客户管理 客户阶段 阶段管理
component: () =>
import("pages/enterprise/customer/CSChild/stageManagement")
},
{
path: "/enterprise/customer/CSChild/addPhase", //企微 客户管理 客户阶段 创建阶段
component: () =>
import("pages/enterprise/customer/CSChild/addPhase")
},
......
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