Commit 5676688a authored by 罗超's avatar 罗超

1

parent 043ea0aa
......@@ -232,6 +232,46 @@ class customerSetService {
data
})
}
// 获取客户库列表
static async getCustomerLibraryList(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/GetCustomerLibraryList', {
method: 'post',
responseType: 'json',
data
})
}
// 获取客户库详情
static async GetCustomerLibraryInfo(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/GetCustomerLibraryInfo', {
method: 'post',
responseType: 'json',
data
})
}
// 新增修改客户库信息
static async setCustomerLibraryInfo(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerLibraryInfo', {
method: 'post',
responseType: 'json',
data
})
}
// 获取查重规则
static async getCustomerLibraryLookRepeat(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/GetCustomerLibraryLookRepeat', {
method: 'post',
responseType: 'json',
data
})
}
// 设置查重规则
static async setCustomerLibraryLookRepeat(data: any): Promise<HttpResponse> {
return Axios('/QYCustomer/SetCustomerLibraryLookRepeat', {
method: 'post',
responseType: 'json',
data
})
}
}
export default customerSetService
......@@ -318,7 +318,6 @@
}
case 4: {
//多选
console.log('多选',e)
e.labelType = 4
e.directionList = directionList1
if (find.OptionsList) {
......@@ -337,7 +336,6 @@
} else {
birthday.value = []
}
console.log(5, e.StartValue)
break
}
case 6: {
......@@ -412,7 +410,7 @@
}
const addsList = () => {
let obj: params = {
Id: filedList.value[2].Id,
Id: "",
Name: '',
Type: '',
Direction: '',
......@@ -563,39 +561,25 @@
addMsg.value[y].StartValue = s
addMsg.value[y].EndValue = e
}
const checkRule = (val: Array < params > ) => {
let flag = false
flag = val.every(e => {
if (e.Type == 1) {
if (e.Direction == 1 || e.Direction == 2 || e.Direction == 3) {
return !!e.Id && !!e.StartValue
} else {
return !!e.Id && e.Direction
}
} else if (e.Type == 2) {
if (e.Direction == 1 || e.Direction == 2) {
return !!e.Id && !!e.StartValue
} else {
return e.Id && e.Direction
}
} else if (e.Type == 3) {
return e.Id && e.StartValue
} else if (e.Type == 4) {
return e.Id && e.StartValue && e.EndValue
} else {
return e.Id && e.Direction && e.StartValue
// 验证重复
const validateRepeat=(arr,oldArr)=>{
let flag= true
arr.reduce((pre,cur,index)=>{
const preValues=Object.values(pre).toString()
const curValues=Object.values(cur).toString()
if(preValues==curValues&&(cur.Id??''!=='')&&(cur.StartValue??''!=='') ){
oldArr[index].StartValue=''
flag=false
Notify.create({
type: 'warning',
position: 'top',
message: '已存在相同规则'
})
}
return cur
})
if (!flag) {
Notify.create({
type: 'warning',
position: 'top',
message: '规则适用范围不可空'
})
}
return flag
}
watch(
() => [...addMsg.value],
val => {
......@@ -613,7 +597,10 @@
newVal.push(item)
})
console.log('change', newVal)
ctx.emit('change', newVal)
if(validateRepeat(newVal,val)){
ctx.emit('change', newVal)
}
}, {
deep: true
}
......@@ -651,7 +638,6 @@
changeDate,
changeRange,
changeAddCondition,
checkRule,
getLabelByIds,
}
}
......
<template>
<div class="q-pa-md businessModel">
<div class="full-width business-header">
请选择您的业务模式:
</div>
<div class="box-businessModel" :class="{ 'checked-border': msg.type == 1 }" @click="chooseChange(1)">
<i class="iconfont icon-customer" style="font-size:38px"></i>
<div>个人客户</div>
<div class="right" v-if="msg.type == 1">
<q-icon name="check" class="check-icon" />
</div>
</div>
<div class="box-businessModel" :class="{ 'checked-border': msg.type == 2 }" @click="chooseChange(2)">
<div >
<i class="iconfont icon-customer" style="font-size:38px"></i>
<span class="q-mx-md" style="font-size:28px">+</span>
<i class="iconfont icon-qiye" style="font-size:38px"></i>
</div>
<div>个人客户 + 企业客户</div>
<div class="right" v-if="msg.type == 2">
<q-icon name="check" class="check-icon" />
</div>
</div>
</div>
</template>
<script lang="ts">
import {
defineComponent,
reactive,
} from 'vue'
export default defineComponent({
setup() {
const msg = reactive({
type: 1
})
const chooseChange = (n) => {
msg.type = n;
console.log(msg)
}
return {
msg,
chooseChange
}
}
})
</script>
<style lang="scss" scoped>
.businessModel {
overflow: hidden;
display: flex;
flex-wrap: wrap;
margin: 0 auto;
width: 700px;
justify-content: space-between;
margin-top: 191px;
.business-header {
font-size: 16px;
font-weight: 700;
margin-bottom: 15px;
}
.box-businessModel {
cursor: pointer;
width: 311px;
height: 198px;
background: #f9f9f9;
border-radius: 5px;
display: flex;
justify-content: center;
flex-direction: column;
align-items: center;
position: relative;
.right {
position: absolute;
right: -20px;
bottom: -20px;
display: block;
width: 0;
height: 0;
transform: rotate(45deg);
border: 20px solid transparent;
border-left: 20px solid #3470ff;
.check-icon {
position: absolute;
top: -8px;
left: -19px;
transform: rotate(-45deg);
font-size: 14px;
font-weight: 700;
color: #fff;
}
}
}
}
.checked-border {
background-color: #edf2fd !important;
border: 2px solid #3470ff !important;
color: #3470ff;
}
</style>
<template>
<div class="q-pa-md">
<div class="q-py-md">
<div class="flex justify-between q-mb-md">
<div>
<q-btn color="primary" unelevated label="+新增客户库" class="q-mr-md" />
<span>了解多客户库的好处</span>
</div>
<q-btn text-color="accent" outline unelevated label="设置查重规则" @click="showRuleDig=true" />
</div>
<q-table class="sticky-right-column-table" :rows="list" flat :columns="columns" row-key="Id">
<template v-slot:body-cell-range="props">
<q-td :props="props">
<div v-for="(item,index) in props.row.DeptList" :key="index">{{item.DeptName}}</div>
</q-td>
</template>
<template v-slot:body-cell-seasRule="props">
<q-td :props="props">
<div>查看规则</div>
</q-td>
</template>
<template v-slot:body-cell-libRule="props">
<q-td :props="props">
<div>查看规则</div>
</q-td>
</template>
<template v-slot:body-cell-IsAllowRepeat="props">
<q-td :props="props">
<div v-if="props.row.IsAllowRepeat===1"></div>
<div v-if="props.row.IsAllowRepeat===2"></div>
</q-td>
</template>
<template v-slot:body-cell-operate="props">
<q-td :props="props">
<q-btn color="accent" flat label="编辑" />
<q-btn color="negative" flat label="删除" />
</q-td>
</template>
</q-table>
</div>
<!-- 查重规则弹窗 -->
<q-dialog v-model="showRuleDig" full-height maximized position="right" transition-show="slide-left">
<q-card>
<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>
<div style="width:750px">
<q-item tag="label" v-ripple>
<q-item-section avatar top>
<q-radio v-model="LookRepeat" :val="1" color="primary" />
</q-item-section>
<q-item-section>
<div class="ruleset-title">全局查重 (一个客户在整个企业内,只允许被一个员工跟进)</div>
<div class="ruleset-box">
<div class="ruleset-txt">
一个客户,在整个企业内查重(整个企业不允许创建重复客户)
</div>
<div class="ruleset-img">
<div class="ruleset-icon">
<i class="iconfont icon-customer" style="font-size:38px"></i>
</div>
<div class="ruleset-img-center">
</div>
</div>
</div>
</q-item-section>
</q-item>
</div>
</q-card-section>
<q-card-actions align="right" class="bg-white text-teal">
<q-btn color="accent" unelevated label="确定" />
</q-card-actions>
</q-card>
</q-dialog>
</div>
</template>
<script lang="ts">
import {
defineComponent,
reactive,
toRefs,
onMounted
} from 'vue'
// import draggable from "vuedraggable";
// import { Dialog } from 'quasar'
// import message from '@/utils/message'
import customerSetService from '@/api/customerSet';
// import router from '@/router/index'
export default defineComponent({
setup() {
const msg = reactive({
Name: ""
})
const data = reactive({
list: [],
columns: [{
name: 'Name',
label: '名称',
field: 'Name',
align: 'left',
}, {
name: 'range',
label: '适用范围',
field: 'range',
align: 'left',
}, {
name: 'seasRule',
label: '公海回收规则',
field: 'seasRule',
align: 'left',
}, {
name: 'libRule',
label: '私库限额规则',
field: 'libRule',
align: 'left',
}, {
name: 'IsAllowRepeat',
label: '是否允许重复客户',
field: 'IsAllowRepeat',
align: 'left',
}, {
name: 'UpdateTime',
label: '创建时间',
field: 'UpdateTime',
align: 'left',
}, {
name: 'operate',
label: '操作',
field: 'operate',
align: 'left',
style: 'width: 200px'
}],
showRuleDig: false
})
const getList = () => {
customerSetService.getCustomerLibraryList(msg).then(res => {
data.list = res.data.Data
})
}
const LookRepeatMsg = reactive({ //查重规则 1客户库查重 2全局查重
LookRepeat: 1
})
const getLookRepeat = () => {
customerSetService.getCustomerLibraryLookRepeat({}).then(res => {
console.log(res.data.Data)
LookRepeatMsg.LookRepeat = res.data.Data
})
}
onMounted(() => {
getList()
getLookRepeat()
})
return {
...toRefs(data),
...toRefs(LookRepeatMsg),
}
}
})
</script>
<style lang="scss" scoped>
.ruleset-title{
line-height: 40px;
}
.ruleset-box{
width: 606px;
align-items: center;
color: #333;
padding: 30px 0 42px 0;
margin: 10px 0 35px 0px;
border-radius: 8px;
border: 1px solid #ccc;
.ruleset-txt{
text-align: center;
}
.ruleset-img{
margin-top: 24px;
.ruleset-icon{
text-align: center;
color: #91d170;
font-size: 33px;
}
}
}
</style>
......@@ -16,6 +16,7 @@
<q-tab name="clue" label="线索分配规则" />
<q-tab name="phase" label="客户阶段" />
<q-tab name="operation" label="客户操作" />
<q-tab name="seas" label="客户库-公海" />
</q-tabs>
<div class="container fit">
<businessModel v-if="tab == 'model'"></businessModel>
......@@ -24,6 +25,7 @@
<customer-phase v-if="tab == 'phase'"></customer-phase>
<customerlabel v-if="tab == 'label'"></customerlabel>
<CustomerOperation v-if="tab == 'operation'"></CustomerOperation>
<highSeas v-if="tab == 'seas'"></highSeas>
</div>
</q-page>
</div>
......@@ -36,6 +38,7 @@ import clueRule from './components/clueRule.vue'
import customerPhase from './components/customerPhase.vue'
import customerlabel from './components/customerlabel.vue'
import CustomerOperation from "./components/CustomerOperation.vue"
import highSeas from "./components/highSeas.vue"
import router from '@/router/index'
import { useMeta } from 'quasar'
import {
......@@ -51,7 +54,8 @@ export default defineComponent({
clueRule,
customerPhase,
customerlabel,
CustomerOperation
CustomerOperation,
highSeas,
},
setup() {
useMeta({title: '客户设置'})
......
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