Commit 3cbadd41 authored by 罗超's avatar 罗超

1

parent a927beb9
......@@ -60,6 +60,7 @@
<div class="edit_info_wrap">
<q-select
filled
dense
option-value="Id"
size="sm"
v-model="cutomMsg.Value"
......@@ -67,7 +68,7 @@
:options="data.customData"
emit-value
map-options
label="请选择客户阶段"
placeholder="请选择客户阶段"
/>
</div>
</div>
......@@ -110,7 +111,7 @@
</div>
<div class="edit_content">
<div class="edit_info_wrap">
<q-input filled v-model="item.Value" placeholder="请输入要修改的值"></q-input>
<q-input filled dense v-model="item.Value" placeholder="请输入要修改的值"></q-input>
</div>
</div>
</div>
......@@ -146,7 +147,7 @@
</div>
<div class="edit_content">
<div class="edit_info_wrap">
<q-input filled v-model="item.Value" maxlength="50" placeholder="请输入要修改的值"></q-input>
<q-input filled dense v-model="item.Value" maxlength="50" placeholder="请输入要修改的值"></q-input>
</div>
</div>
</div>
......@@ -184,6 +185,7 @@
<div class="edit_info_wrap">
<q-select
filled
dense
option-value="Id"
size="sm"
v-model="item.Value"
......@@ -191,7 +193,7 @@
:options="item.OptionsList"
emit-value
map-options
label="请选择"
placeholder="请选择"
/>
</div>
</div>
......@@ -230,6 +232,7 @@
<div class="edit_info_wrap">
<q-select
filled
dense
multiple
use-chips
option-value="Id"
......@@ -239,7 +242,7 @@
:options="item.OptionsList"
emit-value
map-options
label="请选择"
placeholder="请选择"
/>
</div>
</div>
......@@ -277,7 +280,7 @@
</div>
<div class="edit_content">
<div class="edit_info_wrap">
<q-input filled v-model="item.Value" mask="date" :rules="['date']">
<q-input filled dense v-model="item.Value" mask="date" :rules="['date']">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy
......@@ -330,7 +333,7 @@
</div>
<div class="edit_content">
<div class="edit_info_wrap">
<q-input filled v-model="item.Value" mask="date" :rules="['date']">
<q-input filled dense v-model="item.Value" mask="date" :rules="['date']">
<template v-slot:append>
<q-icon name="event" class="cursor-pointer">
<q-popup-proxy
......@@ -383,7 +386,7 @@
</div>
<div class="edit_content">
<div class="edit_info_wrap">
<q-input filled v-model="item.Value" maxlength="20" placeholder="数值"></q-input>
<q-input filled dense v-model="item.Value" maxlength="20" placeholder="数值"></q-input>
</div>
</div>
</div>
......
import { ref, reactive } from 'vue'
import { reactive } from 'vue'
import customerSetService from '@/api/customerSet'
import customerService from '@/api/customer'
// import customerService from '@/api/customer'
import router from '@/router/index'
import message from '@/utils/message'
const msg = () => {
const curQueryId = Number(router.currentRoute.value.query.Id)
return {
RuleId: curQueryId
}
}
const condition = ref<any>(null)
const data = reactive<any>({
step:1
step: 1,
text: '',
radio: 1,
showDeptDialog: false,
dataTree: [],
defaultDept:[],
})
const editMsg = reactive({
Id: 0,
Name: '打丧尸',
IsAllowRepeat: 1,
DeptList: [] as any,
EmpList: [] as any,
RecyclingType: 1,
ConditionList: [] as any,
NotRecycleTimeList: [] as any,
RemindDay: 0,
RemindType: 1,
LimitDay: 0,
PrivateLibraryType: ''
})
const jumpBeforePage = () => {
router.push({
path: '/customerSetup',
......@@ -25,78 +43,65 @@ const jumpBeforePage = () => {
}
const editRuleModule = () => {
//获取分配客户条件
const getCondition = val => {
data.editMsg.ConditionList = [...val]
}
//获取已选部门成员
const getdpt = val => {
data.showDialog = false
data.editMsg.DeptList = []
data.editMsg.EmpList = []
editMsg.DeptList = []
val.map(e => {
if (e.Id.slice(0, 1) == 1) {
data.editMsg.DeptList.push({
DeptId: e.Id.slice(2),
DeptName: e.Name
})
} else {
data.editMsg.EmpList.push({
Id: e.Id.slice(2),
EmployeeName: e.Name
})
}
editMsg.DeptList.push({
DeptId: e.Id,
DeptName: e.DeptName
})
})
console.log(val, 'dpt')
}
//获取已选人数
const getNum = n => {
const getNum = (n) => {
data.peopleNum = n
}
//获取线索详情
const getDetail = () => {
customerSetService.getCustomerClueRuleDetail(msg()).then(res => {
const d = res.data.Data
data.editMsg.DeptList = d.DeptList
data.editMsg.EmpList = d.EmpList
data.editMsg.ConditionList = d.ConditionList
data.defaultConditionList = d.ConditionList
data.editMsg.RuleAllotWay = d.RuleAllotWay
data.editMsg.RuleSelectType = d.RuleSelectType
const Dep = d.DeptList.map(e => {
return '1-' + e.DeptId
})
const Emp = d.EmpList.map(e => {
return '2-' + e.Id
// data.editMsg.DeptList = d.DeptList
// data.editMsg.EmpList = d.EmpList
// data.editMsg.ConditionList = d.ConditionList
// data.defaultConditionList = d.ConditionList
// data.editMsg.RuleAllotWay = d.RuleAllotWay
// data.editMsg.RuleSelectType = d.RuleSelectType
data.defaultDept = d.DeptList.map(e => {
return e.DeptId
})
data.defaultArray = [...Dep, ...Emp]
})
}
const showDeptDig = () => {
data.showDeptDialog = true
}
//获取部门数据
const getEmployeeData = () => {
customerService.getEmployeeData({}).then(res => {
customerSetService.getDeptTree({}).then(res => {
console.log(res.data.Data, '部门')
data.dataTree = res.data.Data
// 重组唯一id
if (data.dataTree.length == 0) return
data.dataTree.forEach(x => {
x.newId = x.DataType + '-' + x.DeptId
if (x.ChildList && x.ChildList.length > 0) {
getChildList(x.ChildList)
}
})
})
}
const getChildList = (ChildList: Array<any>) => {
ChildList.forEach(x => {
x.newId = x.DataType + '-' + x.DeptId
if (x.ChildList && x.ChildList.length > 0) {
getChildList(x.ChildList)
}
// data.dataTree.forEach(x => {
// x.newId = x.DataType + '-' + x.DeptId
// if (x.ChildList && x.ChildList.length > 0) {
// getChildList(x.ChildList)
// }
// })
})
}
// const getChildList = (ChildList: Array<any>) => {
// ChildList.forEach(x => {
// x.newId = x.DataType + '-' + x.DeptId
// if (x.ChildList && x.ChildList.length > 0) {
// getChildList(x.ChildList)
// }
// })
// }
// 新增,修改
const setCustomerClueRuleInfo = () => {
customerSetService.setCustomerClueRuleInfo(data.editMsg).then(res => {
......@@ -114,15 +119,16 @@ const editRuleModule = () => {
return {
msg,
condition,
data,
editMsg,
getDetail,
getEmployeeData,
jumpBeforePage,
setCustomerClueRuleInfo,
getCondition,
getdpt,
getNum,
//----------new---
showDeptDig,
}
}
......
......@@ -65,12 +65,12 @@ const editRuleModule = () => {
if (e.Id.slice(0, 1) == 1) {
data.editMsg.DeptList.push({
DeptId: e.Id.slice(2),
DeptName: e.Name
DeptName: e.DeptName
})
} else {
data.editMsg.EmpList.push({
Id: e.Id.slice(2),
EmployeeName: e.Name
EmployeeName: e.DeptName
})
}
})
......
......@@ -52,7 +52,7 @@
</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">
<q-table class="sticky-right-column-table" :rows="list" flat :columns="columns" hide-bottom 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>
......
......@@ -376,7 +376,7 @@
}
.tipBox {
font-size: 12px;
font-size: 13px;
line-height: 1.8;
}
......
......@@ -7,18 +7,71 @@
</q-breadcrumbs>
<q-btn color="primary" label="完成" @click="setCustomerClueRuleInfo" />
</div>
<div class="container">
<q-stepper v-model="step" vertical color="primary" animated flat class="step-container">
<q-step :name="1" title="基础设置" icon="settings" :done="step > 1" style="height: 100px;">
<div class="editCustomerLib flex">
<q-stepper v-model="step" vertical color="primary" animated flat header-nav class="step-container">
<q-step :name="1" title="基础设置" icon="settings" :done="step > 1" style="height: 125px;">
</q-step>
<q-step :name="2" title="公海设置" icon="settings" :done="step > 2" style="height: 100px;">
<q-step :name="2" title="公海设置" icon="settings" :done="step > 2" style="height: 125px;">
</q-step>
<q-step :name="3" title="私库规则" icon="settings" :done="step = 3" style="height: 100px;">
<q-step :name="3" title="私库规则" icon="settings" :done="step == 3" style="height: 125px;">
</q-step>
</q-stepper>
<div class="container">
<div v-if="step==1">
<div class="content-block">
<div class="block-title q-mb-sm">基础信息</div>
<div class="block-subtitle q-mb-xs"> 名称 <span style="color:#f00">*</span></div>
<q-input outlined dense v-model="editMsg.Name" clearable maxlength="8" placeholder="请输入客户库名称"
:suffix="editMsg.Name?`${editMsg.Name.length}/8`:'0/8'" class="q-mb-md" style="width:450px" />
<div class="block-subtitle q-mb-xs"> 是否允许重复客户 <span style="color:#f00">*</span></div>
<q-radio v-model="editMsg.IsAllowRepeat" :val="2" dense class="full-width q-mb-xs">
<div class="">
<span class="q-ml-sm"></span>
<span class="text-subTip q-ml-sm"> 不支持创建重复客户(一个客户只能被一个员工跟进)</span>
<n-popover trigger="hover" placement="top">
<template #trigger>
<q-icon name="help" size="xs" color="grey-4" />
</template>
<div class="tipBox">
特殊情况:由于员工扫码添加客户微信不可控,所以可也能造成<br />
重复客户的情况。针对这种场景,会有撞单提示,且支持向其他负责人<br />
申请共享客户,共享成功后,申请人的客户详情将被合并覆盖。
</div>
</n-popover>
</div>
</q-radio>
<q-radio v-model="editMsg.IsAllowRepeat" :val="1" dense>
<span class="q-ml-sm"></span>
<span class="text-subTip q-ml-sm"> 不支持创建重复客户(一个客户只能被一个员工跟进)</span>
</q-radio>
</div>
<div class="content-block q-mt-md">
<div class="block-title q-mb-sm">权限范围</div>
<div class="block-subtitle q-mb-xs"> 适用部门 <span style="color:#f00">*</span></div>
<div class="q-my-sm flex justify-between items-center">
<q-btn outline color="primary" label="选择部门/成员" @click="showDeptDig" />
<div class="flex align-center depart-title">
<span>已选:0人</span>
<div class="per"></div>
<span>有效账号数(已启用探马账号人数):0人</span>
</div>
</div>
<div class="Dept-box ">
<q-chip color="primary" v-for="(item,index) in editMsg.DeptList" :key="index" text-color="white"
icon="work">{{item.DeptName}}</q-chip>
</div>
</div>
</div>
<div class="q-mt-md">
<q-btn unelevated color="white" text-color="black" label="上一步" />
<q-btn unelevated color="accent" label="下一步" class="q-ml-md" />
</div>
</div>
</div>
<departmentStaff v-model="showDialog" :defaultArray="defaultArray" nodeKey="newId" labelKey="DeptName"
childrenKey="ChildList" strategy="leaf" :treeData="dataTree" @select="getdpt" @getNum="getNum" />
<departmentStaff v-model="showDeptDialog" :defaultArray="defaultDept" nodeKey="DeptId" :showType="1"
labelKey="DeptName" childrenKey="ChildList" strategy="leaf" :treeData="dataTree" @select="getdpt"
@getNum="getNum" />
</div>
</template>
<script lang="ts">
......@@ -32,7 +85,6 @@
import editRuleModule from '@/module/customer/editor/editCustomerLibModule'
export default defineComponent({
components: {
departmentStaff,
},
setup() {
......@@ -40,30 +92,29 @@
jumpBeforePage,
msg,
data,
condition,
getDetail,
editMsg,
// getDetail,
getEmployeeData,
setCustomerClueRuleInfo,
getCondition,
getdpt,
getNum,
showDeptDig,
} = editRuleModule();
onMounted(() => {
if (msg().RuleId > 0) {
// data.editMsg.Id = msg().RuleId
getDetail()
// getDetail()
}
getEmployeeData()
})
return {
jumpBeforePage,
condition,
...toRefs(data),
editMsg,
setCustomerClueRuleInfo,
getCondition,
getdpt,
getNum,
showDeptDig
}
}
......@@ -87,18 +138,53 @@
background-color: #fff;
}
.container {
.editCustomerLib {
.step-container {
width: 200px;
height:calc(100vh - 70px);
height: calc(100vh - 70px);
padding: 40px;
flex-shrink: 0;
border-right: 1px solid #d7d7d7;
overflow-x: hidden;
}
.container {
width: 1087px;
margin: 50px auto 0;
padding-bottom: 50px;
.content-block {
width: 1087px;
padding: 30px 20px;
border-radius: 8px;
background-color: #fff;
.block-title {
font-size: 16px;
color: #000;
}
.block-subtitle {
font-size: 14px;
color: #000;
}
.inputTip {
color: #909399;
font-size: 12px;
}
}
}
}
.tipBox {
font-size: 14px;
line-height: 1.8;
}
.text-subTip {
color: #858598;
}
</style>
......@@ -21,7 +21,7 @@
<div class="content-block mt20">
<div class="fission-title">分配给以下部门/成员</div>
<div class="fission-subtitle">适用部门/成员</div>
<div class="departs flex-between-center">
<div class="departs flex justify-between items-center">
<q-btn outline color="primary" label="选择部门/成员" @click="changeDialog" />
<div class="flex align-center depart-title">
<span>已选:{{ peopleNum }}</span>
......
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