Commit 0088259c authored by 罗超's avatar 罗超

客户

parent 7def1715
...@@ -112,7 +112,7 @@ module.exports = configure(function (ctx) { ...@@ -112,7 +112,7 @@ module.exports = configure(function (ctx) {
directives: ['ClosePopup'], directives: ['ClosePopup'],
// Quasar plugins // Quasar plugins
plugins: ['Notify','SessionStorage','Dialog'] plugins: ['Notify','SessionStorage','Dialog','Meta']
}, },
animations: 'all', // --- includes all animations animations: 'all', // --- includes all animations
......
...@@ -89,14 +89,22 @@ class CustomerService { ...@@ -89,14 +89,22 @@ class CustomerService {
data data
}) })
} }
//保存客户标签 //批量设置客户标签
static async saveCustomLabel(data: any): Promise<HttpResponse> { static async setCustomLabelBatch(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerLabelBatch', { return Axios('/QYCustomer/SetCustomerLabelBatch', {
method: 'post', method: 'post',
responseType: 'json', responseType: 'json',
data data
}) })
} }
//设置单个客户企业标签
static async setCustomLabel(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerLabelSingle', {
method: 'post',
responseType: 'json',
data
})
}
//获取客户旅程类型枚举列表 //获取客户旅程类型枚举列表
static async getCustomerTripType(data: any): Promise<HttpResponse> { static async getCustomerTripType(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/GetCustomerTripTypeEnumList', { return Axios('/QYCustomer/GetCustomerTripTypeEnumList', {
...@@ -121,6 +129,30 @@ class CustomerService { ...@@ -121,6 +129,30 @@ class CustomerService {
data data
}) })
} }
//客户转移
static async setCustomerTransfer(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerTransfer', {
method: 'post',
responseType: 'json',
data
})
}
//客户放弃至公海
static async setCustomerAbandon(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerAbandon', {
method: 'post',
responseType: 'json',
data
})
}
//删除客户
static async delCustomerInfo(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/DelCustomerInfo', {
method: 'post',
responseType: 'json',
data
})
}
} }
export {CutomerParams} export {CutomerParams}
export default CustomerService export default CustomerService
...@@ -28,7 +28,6 @@ router.beforeEach((to, from, next) => { ...@@ -28,7 +28,6 @@ router.beforeEach((to, from, next) => {
// 判断当前用户是否获取权限 // 判断当前用户是否获取权限
loadAsyncRouter = true loadAsyncRouter = true
const allAuth = getUserAllMenu() const allAuth = getUserAllMenu()
console.log('allAuth',allAuth)
next({ next({
...to, ...to,
replace: true replace: true
......
<template>
<q-dialog v-model="show" class="col-6" persistent position="right" full-width maximized
@hide="hideDialog">
<q-card class="full-height">
<q-card-section class="row items-center q-pb-none">
<div class="text-h6">
<slot name="head">
导入
</slot>
</div>
<q-space />
<q-btn icon="close" flat round dense v-close-popup />
</q-card-section>
<q-card-section class="q-pt-none">
<div class="row" style="width:800px ;max-width:800px">
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn flat label="取消" v-close-popup />
<q-btn color="primary" unelevated label="确定" />
</q-card-actions>
</q-card>
</q-dialog>
</template>
<script lang="ts">
import {
ref,
watch
} from 'vue'
export default {
props: {
modelValue: {
type: Boolean,
default: false,
required: true,
},
},
setup(props, ctx) {
let show = ref(false)
watch(
() => props.modelValue,
val => {
console.log(48,val)
show.value = val
}
)
let hideDialog = () => {
ctx.emit('update:modelValue', false)
}
return {
show,
hideDialog
}
}
}
</script>
<style scoped>
::-webkit-scrollbar {
height: 7px;
width: 7px;
}
::-webkit-scrollbar-thumb {
/*滚动条里面小方块*/
border-radius: 3px;
background-color: #ddd;
}
::-webkit-scrollbar-track-piece {
background-color: #fff;
-webkit-border-radius: 12px;
}
.list-title {
height: 50px;
padding-bottom: 10px;
color: #606266;
font-size: 14px;
box-sizing: border-box;
display: flex;
align-items: center;
}
.list-box {
height: 420px;
overflow-y: scroll;
}
.list-item {
display: flex;
justify-content: space-between;
align-items: center;
padding: 3px 0 0 10px;
border-radius: 5px;
height: 30px;
}
</style>
...@@ -445,7 +445,7 @@ ...@@ -445,7 +445,7 @@
>{{ qItem.Name }}</div> >{{ qItem.Name }}</div>
</div> </div>
<div class="follow_Component" style="flex-shrink:0"> <div class="follow_Component" style="flex-shrink:0">
<fileUpload @success="getCustomerPage()"></fileUpload> <fileUpload @success="getCustomerPage"></fileUpload>
<!-- <div class="editer_input"> <!-- <div class="editer_input">
<q-input v-model="text" style="50px" maxlength="1000" type="textarea" placeholder="请填写跟进记录" /> <q-input v-model="text" style="50px" maxlength="1000" type="textarea" placeholder="请填写跟进记录" />
</div>--> </div>-->
...@@ -497,9 +497,8 @@ ...@@ -497,9 +497,8 @@
<q-icon name="iconfont icon-close" size="15px" /> <q-icon name="iconfont icon-close" size="15px" />
</div> </div>
<labelgroup <labelgroup
v-if="isshowlabel" v-model="isshowlabel"
:list="LableList" :list="LableList"
@close="isshowlabel = false"
@submit="getlabel" @submit="getlabel"
></labelgroup> ></labelgroup>
</div> </div>
...@@ -510,7 +509,7 @@ import { ...@@ -510,7 +509,7 @@ import {
ref, ref,
reactive, reactive,
onMounted, onMounted,
provide provide,
} from 'vue' } from 'vue'
import { DownLoadFileByUrl } from '@/utils/upload' import { DownLoadFileByUrl } from '@/utils/upload'
import message from '@/utils/message' import message from '@/utils/message'
...@@ -546,7 +545,7 @@ export default { ...@@ -546,7 +545,7 @@ export default {
provide('CustomerId', props.CustomerId) provide('CustomerId', props.CustomerId)
//客户信息保存数据 //客户信息保存数据
const cutomMsg = reactive<dataParam>({ const cutomMsg = reactive<dataParam>({
CustomerId: 0, CustomerId: props.CustomerId,
Type: 2, Type: 2,
CustomId: 0, //自定义字段Id CustomId: 0, //自定义字段Id
Value: '' Value: ''
...@@ -555,7 +554,7 @@ export default { ...@@ -555,7 +554,7 @@ export default {
const customTripMsg = reactive<dataParam>({ const customTripMsg = reactive<dataParam>({
pageIndex: 1, pageIndex: 1,
pageSize: 10, pageSize: 10,
CustomerId: 0, CustomerId: props.CustomerId,
Type: 0 Type: 0
}) })
const persistent = ref(true) const persistent = ref(true)
...@@ -575,8 +574,8 @@ export default { ...@@ -575,8 +574,8 @@ export default {
TripPageCount: 0 TripPageCount: 0
}) })
//获取详情数据 //获取详情数据
const getCustomInfo = (param: msgParam) => { const getCustomInfo = () => {
customer.getCustomInfo(param).then(res => { customer.getCustomInfo(msg).then(res => {
data.dataList = res.data.Data; data.dataList = res.data.Data;
data.FiledDetailList = res.data.Data.FiledDetailList; data.FiledDetailList = res.data.Data.FiledDetailList;
data.FiledDetailList.forEach(x => { data.FiledDetailList.forEach(x => {
...@@ -595,8 +594,8 @@ export default { ...@@ -595,8 +594,8 @@ export default {
}) })
} }
//获取客户阶段下拉 //获取客户阶段下拉
const getCustomStage = (param) => { const getCustomStage = () => {
customer.getCustomStageList(param).then(res => { customer.getCustomStageList({}).then(res => {
data.customData = res.data.Data; data.customData = res.data.Data;
}) })
} }
...@@ -615,7 +614,7 @@ export default { ...@@ -615,7 +614,7 @@ export default {
} }
//点击单个保存自定义客户信息 //点击单个保存自定义客户信息
const saveCustomInfo = (e) => { const saveCustomInfo = (e) => {
cutomMsg.CustomerId = msg.CustomerId; cutomMsg.CustomerId = props.CustomerId;
cutomMsg.CustomId = e.Id; cutomMsg.CustomId = e.Id;
cutomMsg.Type = 2; cutomMsg.Type = 2;
if (e.Type == 4) { if (e.Type == 4) {
...@@ -624,7 +623,7 @@ export default { ...@@ -624,7 +623,7 @@ export default {
cutomMsg.Value = e.Value; cutomMsg.Value = e.Value;
} }
customer.saveCustomInfo(cutomMsg).then(res => { customer.saveCustomInfo(cutomMsg).then(res => {
getCustomInfo(msg); getCustomInfo();
message.successMsg(res.data.Message); message.successMsg(res.data.Message);
}) })
} }
...@@ -632,11 +631,11 @@ export default { ...@@ -632,11 +631,11 @@ export default {
e.isShowEdit = !e.isShowEdit; e.isShowEdit = !e.isShowEdit;
} }
const saveCustomGate = () => { const saveCustomGate = () => {
cutomMsg.CustomerId = msg.CustomerId; cutomMsg.CustomerId = props.CustomerId;
cutomMsg.Type = 1; cutomMsg.Type = 1;
cutomMsg.CustomId = 0; cutomMsg.CustomId = 0;
customer.saveCustomInfo(cutomMsg).then(res => { customer.saveCustomInfo(cutomMsg).then(res => {
getCustomInfo(msg); getCustomInfo();
data.isShowEdit = false; data.isShowEdit = false;
message.successMsg(res.data.Message); message.successMsg(res.data.Message);
}) })
...@@ -671,23 +670,23 @@ export default { ...@@ -671,23 +670,23 @@ export default {
isshowlabel.value = false; isshowlabel.value = false;
console.log(list); console.log(list);
const labelMsg = reactive<dataParam>({ const labelMsg = reactive<dataParam>({
CustomerIds: 0, CustomerId: 0,
LableIds: '' LableIds: ''
}) })
labelMsg.CustomerIds = msg.CustomerId; labelMsg.CustomerId = props.CustomerId;
let ckedArr: any[] = []; let ckedArr: any[] = [];
list.forEach(x => { list.forEach(x => {
ckedArr.push(x.Id); ckedArr.push(x.Id);
}) })
labelMsg.LableIds = ckedArr.toString(); labelMsg.LableIds = ckedArr.toString();
customer.saveCustomLabel(labelMsg).then(res => { customer.setCustomLabel(labelMsg).then(res => {
getCustomInfo(msg); getCustomInfo();
message.successMsg(res.data.Message); message.successMsg(res.data.Message);
}) })
} }
//获取客户旅程类型 //获取客户旅程类型
const getCustomerTripType = (param: any) => { const getCustomerTripType = () => {
customer.getCustomerTripType(param).then(res => { customer.getCustomerTripType({}).then(res => {
console.log(res, 'trip数据'); console.log(res, 'trip数据');
data.tripTypeArr = res.data.Data; data.tripTypeArr = res.data.Data;
let Obj = { let Obj = {
...@@ -699,9 +698,9 @@ export default { ...@@ -699,9 +698,9 @@ export default {
} }
//点击旅客类型 //点击旅客类型
const getckedType = (e) => { const getckedType = (e) => {
console.log(e, 'eee');
customTripMsg.CustomerId = msg.CustomerId;
customTripMsg.Type = e.Id; customTripMsg.Type = e.Id;
console.log(customTripMsg, 'customTripMsg');
getCustomerPage(); getCustomerPage();
} }
//获取客户旅程分页列表 //获取客户旅程分页列表
...@@ -717,10 +716,10 @@ export default { ...@@ -717,10 +716,10 @@ export default {
getCustomerPage(); getCustomerPage();
} }
onMounted(() => { onMounted(() => {
getCustomInfo(msg);
getCustomStage({});
getCustomerTripType({})
getCustomerPage(); getCustomerPage();
getCustomInfo();
getCustomStage();
getCustomerTripType()
}) })
return { return {
persistent, persistent,
...@@ -740,7 +739,8 @@ export default { ...@@ -740,7 +739,8 @@ export default {
customTripMsg, customTripMsg,
getckedType, getckedType,
changePage, changePage,
DownLoadFileByUrl DownLoadFileByUrl,
getCustomerPage
} }
} }
} }
......
...@@ -19,7 +19,7 @@ ...@@ -19,7 +19,7 @@
</style> </style>
<template> <template>
<div class="labelgroup"> <div class="labelgroup">
<q-dialog v-model="alert"> <q-dialog v-model="show" @hide="goclose">
<q-card> <q-card>
<q-card-section> <q-card-section>
<div class="text-h6">标签</div> <div class="text-h6">标签</div>
...@@ -44,7 +44,7 @@ ...@@ -44,7 +44,7 @@
</div> </div>
</q-card-section> </q-card-section>
<q-card-actions align="right" class="bg-white"> <q-card-actions align="right" class="bg-white">
<q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" @click="goclose" /> <q-btn label="取消" flat color="grey-10" style="font-weight:400 !important" v-close-popup />
<q-btn label="确定" color="accent q-px-md" style="font-weight:400 !important" @click="determine" /> <q-btn label="确定" color="accent q-px-md" style="font-weight:400 !important" @click="determine" />
</q-card-actions> </q-card-actions>
...@@ -53,11 +53,16 @@ ...@@ -53,11 +53,16 @@
</div> </div>
</template> </template>
<script> <script>
import { defineComponent, ref, onMounted } from 'vue' import { defineComponent, ref,watch, onMounted } from 'vue'
import customerSetService from '@/api/customerSet' import customerSetService from '@/api/customerSet'
export default defineComponent({ export default defineComponent({
props: { props: {
modelValue:{
type: Boolean,
default:false,
required: true
},
list: { list: {
type: Array, type: Array,
default: () => [] default: () => []
...@@ -65,10 +70,17 @@ ...@@ -65,10 +70,17 @@
}, },
setup(props, ctx) { setup(props, ctx) {
let show = ref(false)
watch(
() => props.modelValue,
val => {
show.value = val
}
)
let selectList = ref(props.list) let selectList = ref(props.list)
let LableList = ref([]) let LableList = ref([])
const goclose = () => {//关闭弹窗 const goclose = () => {//关闭弹窗
ctx.emit('close') ctx.emit('update:modelValue',false)
} }
const determine = () => {//确定并返回数据 const determine = () => {//确定并返回数据
ctx.emit('submit', selectList.value) ctx.emit('submit', selectList.value)
...@@ -126,10 +138,8 @@ ...@@ -126,10 +138,8 @@
onMounted(() => {//进入页面就调用 onMounted(() => {//进入页面就调用
getLabelList() getLabelList()
}) })
return { return {
alert: ref(true), show,
goclose, goclose,
determine, determine,
selectList, selectList,
......
...@@ -90,7 +90,7 @@ ...@@ -90,7 +90,7 @@
</div> </div>
<!-- StartValue --> <!-- StartValue -->
<div v-if="x.Name == '标签' && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')" <div v-if="x.Name == '标签' && (x.Direction == 1 || x.Direction == 2 || x.Direction == 3 || x.Direction == '')"
class="input_label" @click="showlabel(x, y)"> class="input_label" @click="showlabel(y)">
<div style="display: flex" v-if="lableList && lableList.length > 0"> <div style="display: flex" v-if="lableList && lableList.length > 0">
<div class="text-clamp-1 tag-select-input">{{ lableList[0].Name }}</div> <div class="text-clamp-1 tag-select-input">{{ lableList[0].Name }}</div>
<div v-if="lableList.length > 1" class="tag-select-input" style="margin-left: 5px"> <div v-if="lableList.length > 1" class="tag-select-input" style="margin-left: 5px">
...@@ -138,7 +138,7 @@ ...@@ -138,7 +138,7 @@
<div class="border-bottom" :style="{ height: (addMsg.length * 48 - 8 - 46 - 40) / 2 + 'px' }"></div> <div class="border-bottom" :style="{ height: (addMsg.length * 48 - 8 - 46 - 40) / 2 + 'px' }"></div>
</div> </div>
</div> </div>
<labelgroup v-if="isshowlabel" :list="lableList" @close="isshowlabel = false" @submit="getlabel"></labelgroup> <labelgroup v-model="isshowlabel" :list="lableList" @submit="getlabel"></labelgroup>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -429,7 +429,7 @@ ...@@ -429,7 +429,7 @@
addMsg.value.push(obj) addMsg.value.push(obj)
} }
const showlabel = (x, y) => { const showlabel = (y) => {
selectindex.value = y selectindex.value = y
isshowlabel.value = true isshowlabel.value = true
} }
......
// import message from '@/utils/message' import message from '@/utils/message'
import dayjs from 'dayjs' import dayjs from 'dayjs'
import { Dialog } from 'quasar'
import { reactive } from 'vue' import { reactive } from 'vue'
import customer, { CutomerParams } from '@/api/customer' import customerService, { CutomerParams } from '@/api/customer'
import customerSetService from '@/api/customerSet' import customerSetService from '@/api/customerSet'
import { ColumnDefaultState } from '@/@types/enumHelper' import { ColumnDefaultState } from '@/@types/enumHelper'
...@@ -9,12 +10,12 @@ interface memberParams { ...@@ -9,12 +10,12 @@ interface memberParams {
newId: number | string newId: number | string
DataType: number | string DataType: number | string
DeptId: number DeptId: number
ChildList: Array < any > | null ChildList: Array<any> | null
} }
interface dataParams { interface dataParams {
loading: boolean loading: boolean
columns: Array<any> columns: Array<any>
sysColumns:Array<any> sysColumns: Array<any>
showColumns: Array<any> showColumns: Array<any>
allColumns: Array<any> allColumns: Array<any>
dataList: Array<any> dataList: Array<any>
...@@ -24,13 +25,14 @@ interface dataParams { ...@@ -24,13 +25,14 @@ interface dataParams {
defaultArray: Array<number | string> defaultArray: Array<number | string>
customerCascaderValue: Array<any> | string customerCascaderValue: Array<any> | string
deptCascaderValue: string | null deptCascaderValue: string | null
colLoadingFinish:boolean colLoadingFinish: boolean
[key: string]: any
} }
const CustomerModule = () => { const CustomerModule = () => {
//获取列表 //获取列表
const getCustomerList = () => { const getCustomerList = () => {
data.loading=true data.loading = true
customer.getCustomerList(msg).then(res => { customerService.getCustomerList(msg).then(res => {
if (res.data.Code == 1) { if (res.data.Code == 1) {
data.loading = false data.loading = false
data.dataList = res.data.Data.PageData data.dataList = res.data.Data.PageData
...@@ -40,7 +42,7 @@ const CustomerModule = () => { ...@@ -40,7 +42,7 @@ const CustomerModule = () => {
} }
//调用获取下拉 //调用获取下拉
const getWayList = (param: any) => { const getWayList = (param: any) => {
customer.getWayList(param).then(res => { customerService.getWayList(param).then(res => {
if (res.data.Code == 1) { if (res.data.Code == 1) {
data.WayList = res.data.Data data.WayList = res.data.Data
} }
...@@ -48,7 +50,7 @@ const CustomerModule = () => { ...@@ -48,7 +50,7 @@ const CustomerModule = () => {
} }
//获取员工数据 //获取员工数据
const getEmployeeData = () => { const getEmployeeData = () => {
customer.getEmployeeData({}).then(res => { customerService.getEmployeeData({}).then(res => {
data.EmployeeList = res.data.Data data.EmployeeList = res.data.Data
// 重组唯一id // 重组唯一id
if (data.EmployeeList.length == 0) return if (data.EmployeeList.length == 0) return
...@@ -63,7 +65,7 @@ const CustomerModule = () => { ...@@ -63,7 +65,7 @@ const CustomerModule = () => {
}) })
}) })
} }
const getChildList = (ChildList: Array < any > ) => { const getChildList = (ChildList: Array<any>) => {
ChildList.forEach(x => { ChildList.forEach(x => {
x.newId = x.DataType + '-' + x.DeptId x.newId = x.DataType + '-' + x.DeptId
if (x.DataType === 2) { if (x.DataType === 2) {
...@@ -81,6 +83,10 @@ const CustomerModule = () => { ...@@ -81,6 +83,10 @@ const CustomerModule = () => {
const data = reactive<dataParams>({ const data = reactive<dataParams>({
loading: false, loading: false,
isshowlabel: false,//设置标签弹窗
showTransfer: false,//转移客户弹窗
showAbandon: false,//放弃客户弹窗
showImport:false,//导入组件弹窗
columns: [ columns: [
{ {
name: 'CustomerName', name: 'CustomerName',
...@@ -108,6 +114,16 @@ const CustomerModule = () => { ...@@ -108,6 +114,16 @@ const CustomerModule = () => {
field: 'carbs', field: 'carbs',
align: 'left' align: 'left'
}, },
{
name: 'CreateTime',
label: '创建时间',
field: 'CreateTime',
align: 'left',
sortable: true,
sort: (a, b) => {
return Date.parse(a) - Date.parse(b)
}
},
{ {
name: 'sodium', name: 'sodium',
label: '负责人', label: '负责人',
...@@ -130,7 +146,11 @@ const CustomerModule = () => { ...@@ -130,7 +146,11 @@ const CustomerModule = () => {
name: 'FriendTime', name: 'FriendTime',
label: '添加好友时间', label: '添加好友时间',
field: 'FriendTime', field: 'FriendTime',
align: 'left' align: 'left',
sortable: true,
sort: (a, b) => {
return Date.parse(a) - Date.parse(b)
}
}, },
{ {
name: 'CheckInNum', name: 'CheckInNum',
...@@ -171,7 +191,8 @@ const CustomerModule = () => { ...@@ -171,7 +191,8 @@ const CustomerModule = () => {
OrderBy: 1, //排序 OrderBy: 1, //排序
AddCondition: 0 //查询条件 AddCondition: 0 //查询条件
}) })
const TypeList = reactive([{ const TypeList = reactive([
{
Name: '企业', Name: '企业',
Id: 0 Id: 0
}, },
...@@ -188,7 +209,8 @@ const CustomerModule = () => { ...@@ -188,7 +209,8 @@ const CustomerModule = () => {
Id: 3 Id: 3
} }
]) ])
const TimeList = reactive([{ const TimeList = reactive([
{
Name: '客户创建时间', Name: '客户创建时间',
Id: 1 Id: 1
}, },
...@@ -203,7 +225,7 @@ const CustomerModule = () => { ...@@ -203,7 +225,7 @@ const CustomerModule = () => {
msg.FriendETime = '' msg.FriendETime = ''
msg.CreateSTime = '' msg.CreateSTime = ''
msg.CreateETime = '' msg.CreateETime = ''
TimeObj.timeRange=null TimeObj.timeRange = null
} }
//选择时间范围 //选择时间范围
const changeTimeRange = val => { const changeTimeRange = val => {
...@@ -218,18 +240,20 @@ const CustomerModule = () => { ...@@ -218,18 +240,20 @@ const CustomerModule = () => {
msg.FriendETime = e msg.FriendETime = e
} }
} else { } else {
msg.FriendSTime = '' msg.FriendSTime = ''
msg.FriendETime = '' msg.FriendETime = ''
msg.CreateSTime = '' msg.CreateSTime = ''
msg.CreateETime = '' msg.CreateETime = ''
} }
getCustomerList() getCustomerList()
} }
//客户筛选 //客户筛选
const CustomList = reactive([{ const CustomList = reactive([
{
label: '好友关系', label: '好友关系',
value: '1', value: '1',
children: [{ children: [
{
label: '未添加', label: '未添加',
value: '1-1' value: '1-1'
}, },
...@@ -249,11 +273,11 @@ const CustomerModule = () => { ...@@ -249,11 +273,11 @@ const CustomerModule = () => {
} }
]) ])
const SeletObj = reactive ({ const SeletObj = reactive({
selectVal: '', selectVal: '',
selectWay: 0 selectWay: 0
}) })
const TimeObj = reactive ({ const TimeObj = reactive({
timeWay: 1, timeWay: 1,
timeRange: null timeRange: null
}) })
...@@ -298,34 +322,98 @@ const CustomerModule = () => { ...@@ -298,34 +322,98 @@ const CustomerModule = () => {
data.showColumns.push(e.field) data.showColumns.push(e.field)
data.allColumns.push({ name: e.label, value: e.field, visible: true, IsCustom: 0 }) data.allColumns.push({ name: e.label, value: e.field, visible: true, IsCustom: 0 })
}) })
customerSetService customerSetService
.getCustomerFiledList({ .getCustomerFiledList({
Enable: 1 Enable: 1
}) })
.then(r => { .then(r => {
const tempCol = r.data.Data const tempCol = r.data.Data
if (tempCol && tempCol.length > 0) { if (tempCol && tempCol.length > 0) {
tempCol.sort((x, y) => {
tempCol.sort((x, y) => { return x.Sort - y.Sort
return x.Sort - y.Sort })
}) tempCol.forEach(x => {
tempCol.forEach(x => { const tempRow = { name: x.Name, label: x.Name, field: x.Name, align: 'left' }
const tempRow = { name: x.Name, label: x.Name, field: x.Name, align: 'left' } data.columns.push(tempRow)
data.columns.push(tempRow) if (x.IsDefault == ColumnDefaultState.Yes) {
if (x.IsDefault == ColumnDefaultState.Yes) { data.showColumns.push(x.Name)
data.showColumns.push(x.Name) }
} data.allColumns.push({ name: x.Name, value: x.Name, visible: x.IsDefault == ColumnDefaultState.Yes, data: x, IsCustom: 1 })
data.allColumns.push({ name: x.Name, value: x.Name, visible: x.IsDefault == ColumnDefaultState.Yes, data: x, IsCustom: 1 }) })
}) }
} //#region 添加菜单权限
//#region 添加菜单权限 data.columns.push({ name: 'setting', label: '自定义列', field: 'setting', align: 'left' })
data.columns.push({ name: 'setting', label: '自定义列', field: 'setting', align: 'left' }) data.showColumns.push('setting')
data.showColumns.push('setting') //#endregion
//#endregion
data.colLoadingFinish = true data.colLoadingFinish = true
})
const showDialog = (dialogName) => {
data[dialogName] = true
}
const getlabel = val => {
const ids=val.map(e=>e.Id).toString()
setLabel(ids)
}
const setLabel = (id) => {
const labelMsg = {
CustomerIds: data.selected.map(e => e.Id).toString(),
LableIds: id
}
customerService.setCustomLabelBatch(labelMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
})
}
const TransferMsg = reactive({
CustomerIds: '',
EmpId: 0
})
const setTransfer = async () => {
TransferMsg.CustomerIds = data.selected.map(e => e.Id).toString()
await customerService.setCustomerTransfer(TransferMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
data.showTransfer=false
})
TransferMsg.EmpId = 0
}
const AbandonMsg = reactive({
CustomerIds: '',
Reason: ""
})
const setAbandon = async () => {
AbandonMsg.CustomerIds = data.selected.map(e => e.Id).toString()
await customerService.setCustomerAbandon(AbandonMsg).then(res => {
message.successMsg(res.data.Message)
getCustomerList()
data.showAbandon = false
}) })
AbandonMsg.Reason = ''
}
const delCustomer = () => {
Dialog.create({
title: '确认删除?',
message: "请输入'删除'",
prompt: {
model: '',
isValid: val => val == '删除', // << here is the magic
outlined :true
},
cancel: '取消',
ok: '确认'
}).onOk(() => {
const delMsg = {
CustomerIds: data.selected.map(e => e.Id).toString()
}
customerService.delCustomerInfo(delMsg).then(res => {
message.successMsg(res.data.Message)
data.selected=[]
getCustomerList()
})
})
}
return { return {
getCustomerList, getCustomerList,
getWayList, getWayList,
...@@ -344,6 +432,14 @@ const CustomerModule = () => { ...@@ -344,6 +432,14 @@ const CustomerModule = () => {
CustomList, CustomList,
getDept, getDept,
customerUpdateValue, customerUpdateValue,
showDialog,
getlabel,
setLabel,
setTransfer,
TransferMsg,
AbandonMsg,
setAbandon,
delCustomer
} }
} }
......
...@@ -33,9 +33,6 @@ const groupingManageModule = () => { ...@@ -33,9 +33,6 @@ const groupingManageModule = () => {
console.log(msg.Name) console.log(msg.Name)
} }
const setTitle = (pageTitle: string, suffix = true) => { const setTitle = (pageTitle: string, suffix = true) => {
if (suffix) { if (suffix) {
title.value = `${pageTitle}-${StaticConfig.appsuffix}` title.value = `${pageTitle}-${StaticConfig.appsuffix}`
......
<template> <template>
<div class="q-pa-md customer"> <div class="q-pa-md customer">
<q-page padding style="background: #fff; border-radius: 10px"> <q-page padding style="background-color: #fff; border-radius: 10px">
<div class="page-search row items-center"> <div class="page-search row items-center" v-if="data.selected.length==0">
<div class="col row wrap q-mr-lg q-col-gutter-md"> <div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3"> <div class="col-3">
<q-input filled v-model="SeletObj.selectVal" clearable @clear="getCustomerList" <q-input filled v-model="SeletObj.selectVal" clearable @clear="getCustomerList" dense
@update:model-value="getSelectWay(), getCustomerList" placeholder="请输入"> @update:model-value="getSelectWay(), getCustomerList" placeholder="请输入">
<template #before> <template #before>
<div style="border-right: 1px solid #999"> <div style="border-right: 1px solid #999;padding-right:0">
<q-select filled @update:model-value="getSelectWay" option-value="Id" option-label="Name" <q-select filled @update:model-value="getSelectWay" option-value="Id" option-label="Name" dense
v-model="SeletObj.selectWay" :options="TypeList" emit-value map-options /> v-model="SeletObj.selectWay" :options="TypeList" emit-value map-options />
</div> </div>
</template> </template>
</q-input> </q-input>
</div> </div>
<div class="flex no-wrap"> <div class="flex no-wrap">
<q-select filled option-value="Id" option-label="Name" v-model="TimeObj.timeWay" :options="TimeList" <q-select filled option-value="Id" option-label="Name" v-model="TimeObj.timeWay" :options="TimeList" dense
emit-value map-options @update:model-value="changeTime"> </q-select> emit-value map-options @update:model-value="changeTime"> </q-select>
<n-config-provider :locale="zhCN" :date-locale="dateZhCN"> <n-config-provider :locale="zhCN" :date-locale="dateZhCN">
<n-date-picker v-model:value="TimeObj.timeRange" type="datetimerange" size="large" separator="至" clearable <n-date-picker v-model:value="TimeObj.timeRange" type="datetimerange" size="small" separator="至" clearable
class="full-height" @update:value='changeTimeRange'/> class="full-height" @update:value='changeTimeRange' />
</n-config-provider> </n-config-provider>
</div> </div>
<div class="col-2"> <div class="col-2">
...@@ -33,18 +33,63 @@ ...@@ -33,18 +33,63 @@
:options="data.EmployeeList" cascade children-field="ChildList" @update:value="getDept" /> :options="data.EmployeeList" cascade children-field="ChildList" @update:value="getDept" />
</div> </div>
<div class="col-2"> <div class="col-2">
<q-btn color="primary" size="sm" label="导入" /> <q-btn-dropdown label="导入" dense color="primary">
<q-btn color="primary" size="sm" style="margin-left: 20px" label="导出" /> <q-list>
<q-item>
<q-btn unelevated dense label="导入个人客户" @click="data.showImport=true"/>
</q-item>
<q-item>
<q-btn unelevated dense label="导入企业客户" />
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn-dropdown label="导出" color="primary" dense class="q-ml-md">
<q-list>
<q-item>
<q-btn unelevated dense label="导出个人客户" />
</q-item>
<q-item>
<q-btn unelevated dense label="导出企业客户" />
</q-item>
</q-list>
</q-btn-dropdown>
</div> </div>
</div> </div>
</div> </div>
<div class="select-navs row q-mb-md q-pa-sm flex justify-between items-center" v-if="data.selected.length>0">
<div class="flex items-center">
<div style="color: #111;font-weight:bold">已选择{{data.selected.length}}项</div>
<q-btn style="background-color: #fff; color: #606266" unelevated outline label="设置标签" class="q-ml-md"
@click="showDialog('isshowlabel')" />
<q-btn style="background-color: #fff; color: #606266" unelevated outline label="放弃" class="q-ml-md"
@click="showDialog('showAbandon')" />
<q-btn style="background-color: #fff; color: #606266" unelevated outline label="转移" class="q-ml-md"
@click="showDialog('showTransfer')" />
<q-btn-dropdown label="导出" outline style="background-color: #fff; color: #606266" class="q-ml-md">
<q-list>
<q-item>
<q-btn unelevated dense label="导出客户" />
</q-item>
<q-item>
<q-btn unelevated dense label="导出标签记录" />
</q-item>
</q-list>
</q-btn-dropdown>
<q-btn style="background-color: #FFEDED; color: #FF4949" unelevated outline label="彻底删除" class="q-ml-md"
@click="delCustomer" />
</div>
<q-icon name="cancel" size="sm" style="color:#707070" @click="data.selected=[]"></q-icon>
</div>
<div class="page-content" style="margin-top: 20px"> <div class="page-content" style="margin-top: 20px">
<q-table :rows="data.dataList" :columns="data.columns" class="sticky-tow-column-table full-height sticky-right-column-table" row-key="Id" :loading="data.loading" <q-table :rows="data.dataList" :columns="data.columns"
v-model:pagination="pagination" selection="multiple" v-model:selected="data.selected" :visible-columns="data.showColumns"> class="sticky-tow-column-table full-height sticky-right-column-table" row-key="Id" :loading="data.loading"
v-model:pagination="pagination" selection="multiple" v-model:selected="data.selected"
:visible-columns="data.showColumns">
<template v-slot:body-cell-CustomerName="props"> <template v-slot:body-cell-CustomerName="props">
<q-td auto-width :props="props"> <q-td auto-width :props="props">
<div class="cutomer_Header"> <div class="cutomer_Header">
<div class="customer_Img"> <div class="customer_Img">
<img :src="props.row.WeChatPhoto" style="width: 100%; height: 100%" /> <img :src="props.row.WeChatPhoto" style="width: 100%; height: 100%" />
</div> </div>
...@@ -64,13 +109,14 @@ ...@@ -64,13 +109,14 @@
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.pageCount" <q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.pageCount"
:input="true" @update:model-value="changePage" /> :input="true" @update:model-value="changePage" />
</template> </template>
<template v-for="x in data.allColumns.filter(x=>x.IsCustom>0)" :key="x.value" v-slot:[`body-cell-${x.value}`]="props"> <template v-for="x in data.allColumns.filter(x=>x.IsCustom>0)" :key="x.value"
<q-td auto-width :props="props"> v-slot:[`body-cell-${x.value}`]="props">
<q-td auto-width :props="props">
{{props.row.CustomFiledList.find(y=>y.Name==x.name).ShowValue}} {{props.row.CustomFiledList.find(y=>y.Name==x.name).ShowValue}}
</q-td> </q-td>
</template> </template>
<template v-slot:body-cell-setting="props"> <template v-slot:body-cell-setting="props">
<q-td :props="props" style="background:rgba(0,0,0,0)"></q-td> <q-td :props="props" style="background:rgba(0,0,0,0)"></q-td>
</template> </template>
<template v-slot:header-cell-setting="props"> <template v-slot:header-cell-setting="props">
<q-th class="mysetting" :props="props"> <q-th class="mysetting" :props="props">
...@@ -84,7 +130,65 @@ ...@@ -84,7 +130,65 @@
</q-table> </q-table>
<customRight v-if="isShowCustom" :CustomerId="CustomerId" @close="closeCustomer"></customRight> <customRight v-if="isShowCustom" :CustomerId="CustomerId" @close="closeCustomer"></customRight>
</div> </div>
<div>
<labelgroup v-model="data.isshowlabel" @submit="getlabel"></labelgroup>
</div>
<!-- ----------------转移客户-------------------------- -->
<q-dialog v-model="data.showTransfer" class="col-6" persistent>
<q-card style="width: 480px; max-width: 80vw">
<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-card-section class="q-pt-none">
<div class="row q-my-md flex items-center no-wrap" style="white-space:nowrap">
转移给:
<n-cascader v-model:value="TransferMsg.EmpId" clearable placeholder="客户筛选" check-strategy="child"
size="large" :show-path="false" max-tag-count="responsive" :options="data.EmployeeList" cascade
value-field="DeptId" label-field="DeptName" children-field="ChildList" />
</div>
<div>
90个自然日内,在职成员的每位客户仅可被转接2次。
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn flat label="取消" v-close-popup />
<q-btn color="primary" unelevated label="确定" @click="setTransfer" />
</q-card-actions>
</q-card>
</q-dialog>
<!-- ----------------放弃客户-------------------------- -->
<q-dialog v-model="data.showAbandon" class="col-6" persistent>
<q-card style="width: 480px; max-width: 80vw">
<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-card-section class="q-pt-none">
<div class="row q-my-md flex no-wrap" style="white-space:nowrap">
<q-input outlined v-model="AbandonMsg.Reason" label="放弃原因:" dense type="textarea" style="width:100%" />
</div>
<div>
放弃后,客户将进入公海
</div>
<div>
审批人 审批人为空(您所在部门没有设置主管),将自动通过审批
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn flat label="取消" v-close-popup />
<q-btn color="primary" unelevated label="确定" @click="setAbandon" />
</q-card-actions>
</q-card>
</q-dialog>
</q-page> </q-page>
<importComponents v-model="data.showImport"></importComponents>
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
...@@ -93,19 +197,30 @@ ...@@ -93,19 +197,30 @@
defineComponent, defineComponent,
onMounted onMounted
} from 'vue' } from 'vue'
import {
useMeta
} from 'quasar'
import CustomerModule from '@/module/customer/customerModule' import CustomerModule from '@/module/customer/customerModule'
import customRight from '@/components/common/customRight.vue' import customRight from '@/components/customer/customRight.vue'
import visibleColumns from '@/components/common/visibleColumns.vue' import visibleColumns from '@/components/common/visibleColumns.vue'
import labelgroup from '@/components/customer/label-group.vue'
import importComponents from '@/components/common/import.vue'
import { import {
zhCN, zhCN,
dateZhCN dateZhCN
} from 'naive-ui' } from 'naive-ui'
export default defineComponent({ export default defineComponent({
components: { components: {
customRight, customRight,
visibleColumns visibleColumns,
labelgroup,
importComponents
}, },
setup() { setup() {
useMeta({
title: '客户',
})
let { let {
getCustomerList, getCustomerList,
getWayList, getWayList,
...@@ -124,6 +239,13 @@ ...@@ -124,6 +239,13 @@
getEmployeeData, getEmployeeData,
getDept, getDept,
customerUpdateValue, customerUpdateValue,
showDialog,
getlabel,
setTransfer,
TransferMsg,
AbandonMsg,
setAbandon,
delCustomer
} = CustomerModule() } = CustomerModule()
let isShowCustom = ref(false) let isShowCustom = ref(false)
const closeCustomer = () => { const closeCustomer = () => {
...@@ -163,16 +285,27 @@ ...@@ -163,16 +285,27 @@
CustomerId, CustomerId,
getCustomInfo, getCustomInfo,
customerUpdateValue, customerUpdateValue,
showDialog,
getlabel,
setTransfer,
TransferMsg,
AbandonMsg,
setAbandon,
delCustomer
} }
} }
}) })
</script> </script>
<style lang="scss"> <style>
.customer .q-field__before { .customer .q-field__before {
padding-right: 0 !important; padding-right: 0 !important;
} }
.v-binder-follower-container {
z-index: 99999999 !important;
}
</style> </style>
<style lang="scss" scoped> <style lang="scss" scoped>
.cutomer_Header { .cutomer_Header {
...@@ -198,13 +331,13 @@ ...@@ -198,13 +331,13 @@
} }
::v-deep .n-base-selection-label { ::v-deep .n-base-selection-label {
height: 54px; height: 40px;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
border: none !important; border: none !important;
} }
::v-deep .n-base-selection-input { ::v-deep .n-base-selection-input {
height: 54px; height: 40px;
display: flex; display: flex;
align-items: center; align-items: center;
border: none !important; border: none !important;
...@@ -218,8 +351,13 @@ ...@@ -218,8 +351,13 @@
} }
::v-deep .n-base-selection-tags { ::v-deep .n-base-selection-tags {
height: 54px; height: 40px;
background-color: rgba(0, 0, 0, 0.05); background-color: rgba(0, 0, 0, 0.05);
} }
.select-navs {
background-color: #f6f6f6;
border-radius: 4px;
}
</style> </style>
...@@ -35,7 +35,7 @@ import customerPhase from './components/customerPhase.vue' ...@@ -35,7 +35,7 @@ import customerPhase from './components/customerPhase.vue'
import customerlabel from './components/customerlabel.vue' import customerlabel from './components/customerlabel.vue'
import CustomerOperation from "./components/CustomerOperation.vue" import CustomerOperation from "./components/CustomerOperation.vue"
import router from '@/router/index' import router from '@/router/index'
import { useMeta } from 'quasar'
import { import {
defineComponent, defineComponent,
ref ref
...@@ -51,6 +51,7 @@ export default defineComponent({ ...@@ -51,6 +51,7 @@ export default defineComponent({
CustomerOperation CustomerOperation
}, },
setup() { setup() {
useMeta({title: '客户设置'})
let tab = ref<string>('field') let tab = ref<string>('field')
if (router.currentRoute.value.query && router.currentRoute.value.query.type) { if (router.currentRoute.value.query && router.currentRoute.value.query.type) {
tab.value = router.currentRoute.value.query.type as string tab.value = router.currentRoute.value.query.type as string
......
...@@ -16,6 +16,5 @@ export function getAuth() { ...@@ -16,6 +16,5 @@ export function getAuth() {
*/ */
export function getUserAllMenu() { export function getUserAllMenu() {
const auths = getStoreGetter<UserGetter>('user', 'getUserAllAuth') const auths = getStoreGetter<UserGetter>('user', 'getUserAllAuth')
console.log(auths)
return auths.length > 0 ? auths : ResultType.EmptyArray return auths.length > 0 ? auths : ResultType.EmptyArray
} }
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