Commit b873fef1 authored by 罗超's avatar 罗超

1

parent 724571e4
......@@ -17,7 +17,6 @@
"ant-design-vue": "^2.2.8",
"axios": "^0.21.1",
"core-js": "^3.6.5",
"dayjs": "^1.10.7",
"element-plus": "^1.2.0-beta.3",
"katex": "^0.13.18",
"lockr": "^0.9.0-beta.0",
......
import Axios from './axios'
import { HttpResponse } from '@/@types'
interface ClueParams {
ClueState:number
PageIndex: number
PageSize: number
pageCount: number
......
import { boot } from 'quasar/wrappers'
import Antd from 'ant-design-vue'
// import ElementPlus from 'element-plus'
// import 'element-plus/dist/index.css'
import 'element-plus/dist/index.css'
import 'ant-design-vue/dist/antd.css'
export default boot(({ app }) => {
// Set Antd instance on app
app.use(Antd)
// app.use(ElementPlus)
})
<template>
<q-dialog
v-model="modelValue"
v-model="show"
class="col-6"
persistent
transition-show="scale"
......@@ -81,7 +81,7 @@
</q-dialog>
</template>
<script lang="ts">
import { ref } from 'vue'
import { ref,watch } from 'vue'
interface parmas {
[key: string]: any
......@@ -95,7 +95,8 @@ export default {
props: {
modelValue: {
type: Boolean,
default: false
default: false,
required: true
},
//树形结构列表
treeData: {
......@@ -137,12 +138,16 @@ export default {
default: 'strict'
},
},
setup(props, ctx) {
let show=ref(false)
let tree = ref<any>(null);
let keys = ref<Array<string>>([])
let selectArray = ref<Array<SelectParams>>([])
let ticketArr = ref<Array<any>>([])
watch(()=>props.modelValue,(val)=>{
show.value=val
})
let hideDialog = () => {
ctx.emit("update:modelValue", false)
}
......@@ -161,7 +166,7 @@ export default {
let initDefault = () => {
selectArray.value = []
if (props.defaultArray && props.defaultArray.length > 0&&flag) {
props.defaultArray.map((e, i) => {
props.defaultArray.map((e) => {
if (e.slice(0, 1) == 1) {
const node = tree.value.getNodeByKey(e)
if (node[props.childrenKey] && node[props.childrenKey].length > 0) {
......@@ -253,6 +258,7 @@ export default {
ctx.emit('select', selectArray.value)
}
return {
show,
ticketArr,
myFilterMethod,
filter,
......
......@@ -33,14 +33,12 @@
</template>
<script lang="ts">
import {
ref,
reactive,
onMounted
} from 'vue'
import message from '@/utils/message'
import customer2 from '@/api/customer2'
// import message from '@/utils/message'
// import customer2 from '@/api/customer2'
export default {
setup(props, ctx) {
setup() {
interface dataParam {
[key: string]: any
}
......@@ -71,9 +69,9 @@
// message.error(`${info.file.name} file upload failed.`);
// }
};
onMounted(() => {
// onMounted(() => {
})
// })
return {
data,
uploadImg
......
This diff is collapsed.
import { ref, reactive } from 'vue'
import clueService, { ClueParams } from '@/api/clue'
import dayjs from 'dayjs'
const ClueModule = () => {
// 定义tab
......@@ -10,8 +11,28 @@ const ClueModule = () => {
}
return [tab, setTab]
}
const msg = reactive({
const TypeList = reactive([
{
Name: '企业',
Id: 0
},
{
Name: '昵称',
Id: 1
},
{
Name: '电话',
Id: 2
}
])
const SeletObj = reactive({
selectVal: '',
selectWay: 0
})
const msg = reactive<ClueParams>({
ClueState: 1,
PageIndex: 1,
PageSize: 10,
pageCount: 0,
......@@ -32,6 +53,16 @@ const ClueModule = () => {
OrderBy: 1, //排序
AddCondition: 0 //查询条件
})
const dateRange = ref([])
const format = 'YYYY/MM/DD'
const chooseDate = (val) => {
const a = dayjs(val[0]._d).format(format)
const b = dayjs(val[1]._d).format(format)
console.log(a, b)
msg.CreateSTime = a
msg.CreateETime = b
}
const data = reactive({
columns: [
{
......@@ -58,33 +89,31 @@ const ClueModule = () => {
EmployeeList: [],
rowsPerPage: 0
})
const TypeList = reactive([
{
Name: '企业',
Id: 0
},
{
Name: '昵称',
Id: 1
},
{
Name: '备注名',
Id: 2
},
{
Name: '电话',
Id: 3
}
])
//选择方式
const getSelectWay = () => {
msg.CorpName = ''
msg.WeChatName = ''
msg.CustomerMobile = ''
//1企业名称 2姓名 3备注名 4手机号
if (SeletObj.selectWay == 0) {
msg.CorpName = SeletObj.selectVal
}
if (SeletObj.selectWay == 1) {
msg.WeChatName = SeletObj.selectVal
}
if (SeletObj.selectWay == 2) {
msg.CustomerMobile = SeletObj.selectVal
}
}
//获取线索列表
const getCluerList = (param: ClueParams) => {
clueService.getCustomerClueList(param).then(res => {
const getCluerList = () => {
clueService.getCustomerClueList(msg).then(res => {
console.log(res, '数据')
data.dataList = res.data.Data.PageData
msg.pageCount = res.data.Data.PageCount
})
}
return { useTab, msg, data, getCluerList, TypeList }
return { useTab, msg, data, getCluerList, TypeList, SeletObj, getSelectWay, dateRange,format, chooseDate }
}
export default ClueModule
......@@ -7,9 +7,10 @@ interface dataParams {
showDialog: boolean
shape: number
dataTree: Array<any>
// defaultArray: Array<number | string>
defaultArray: Array<number | string>
defaultConditionList: Array<any>
editMsg: any
peopleNum:number
peopleNum: number
}
const msg = () => {
......@@ -19,12 +20,13 @@ const msg = () => {
}
}
const condition = ref<any>(null)
let defaultArray : Array<any>= []
const data = reactive<dataParams>({
showDialog: false,
shape: 0,
dataTree: [],
defaultArray: [],
defaultConditionList:[],
editMsg: {
Id: 0,
RuleSelectType: 1, //客户的查询类型 1并且 2或者
......@@ -33,18 +35,8 @@ const data = reactive<dataParams>({
RuleAllotWay: 1, //分配方式 1依次轮流 2随机分配
ConditionList: [] //条件列表
},
peopleNum:0
peopleNum: 0
})
// watch(
// () =>data.defaultArray,
// (val) => {
// val.map(e => {
// console.log('valDefault', e)
// })
// }
// )
const jumpBeforePage = () => {
router.push({
path: '/customerSetup',
......@@ -81,31 +73,30 @@ const editRuleModule = () => {
})
}
})
console.log(val,'dpt')
console.log(val, 'dpt')
}
//获取已选人数
const getNum = (n) => {
data.peopleNum=n
const getNum = n => {
data.peopleNum = n
}
//获取线索详情
const getDetail = () => {
customerService.getCustomerClueRuleDetail(msg()).then(res => {
defaultArray = []
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 Dep = d.DeptList.map(e => {
return '1-' + e.DeptId
})
const Emp= d.EmpList.map(e => {
return '2-'+ e.Id
const Emp = d.EmpList.map(e => {
return '2-' + e.Id
})
defaultArray = [...Dep, ...Emp]
console.log(defaultArray, 'ConditionList')
data.defaultArray = [...Dep, ...Emp]
console.log(d.ConditionList, 'ConditionList')
})
}
//获取部门数据
......@@ -135,7 +126,7 @@ const editRuleModule = () => {
const setCustomerClueRuleInfo = () => {
// console.log(data.editMsg.ConditionList)
// const flag = condition.value.checkRule(data.editMsg.ConditionList)
console.log(94, data.editMsg)
// console.log(94, flag)
// if (!flag) return
customerService.setCustomerClueRuleInfo(data.editMsg).then(res => {
message.successMsg(res.data.Message)
......@@ -145,15 +136,13 @@ const editRuleModule = () => {
query: {
type: 'clue'
}
})
},2000)
})
}, 2000)
})
}
return {
msg,
condition,
defaultArray,
data,
getDetail,
getEmployeeData,
......
......@@ -28,11 +28,11 @@
<thead>
<tr>
<th>排序</th>
<th>查询类型</th>
<!-- <th>查询类型</th> -->
<th>规则</th>
<th>部门列表</th>
<th>人员列表</th>
<th>分配方式</th>
<th>条件描述</th>
<th width="10%">编辑</th>
<th width="5%"></th>
</tr>
......@@ -43,24 +43,32 @@
<template v-if="defaultData.length > 0">
<tr v-for="(item,index) in defaultData" :key="index">
<td></td>
<td>
<!-- <td>
<span v-if="item.RuleSelectType === 1">并且</span>
<span v-if="item.RuleSelectType === 2">或者</span>
</td>-->
<td>
<div v-if="item.ConditionStrList.length > 0">
<div v-for="(e,i) in item.ConditionStrList" :key="i">{{ e }}</div>
</div>
<div v-else>未匹配设定规则的客户</div>
</td>
<td>
<div v-for="(e) in item.DeptList" :key="e.DeptId">{{ e.DeptName }}</div>
<div v-if="item.DeptList.length > 0">
<div v-for="(e) in item.DeptList" :key="e.DeptId">{{ e.DeptName }}</div>
</div>
<div v-else>-</div>
</td>
<td>
<div v-for="(e) in item.EmpList" :key="e.Id">{{ e.EmployeeName }}</div>
<div v-if="item.EmpList.length > 0">
<div v-for="(e) in item.EmpList" :key="e.Id">{{ e.EmployeeName }}</div>
</div>
<div v-else>-</div>
</td>
<td>
<span v-if="item.RuleAllotWay === 1">依次轮流</span>
<span v-if="item.RuleAllotWay === 2">随机分配</span>
</td>
<td>
<span>未匹配设定规则的客户</span>
</td>
<td>
<q-btn
flat
......@@ -83,32 +91,45 @@
v-if="data.length > 0"
:move="getDragId"
>
<template #item="{ element }">
<template #item="{ element, index }">
<tr>
<td>
<span style="color:#606266">{{ element.Sort + 1 }}</span>
<span style="color:#606266">{{ index + 1 }}</span>
</td>
<td>
<!-- <td>
<span v-if="element.RuleSelectType === 1">并且</span>
<span v-if="element.RuleSelectType === 2">或者</span>
</td>-->
<td>
<div v-if="element.ConditionStrList.length > 0">
<div v-for="(e,i) in element.ConditionStrList" :key="i">{{ e }}</div>
</div>
<div v-else>未匹配设定规则的客户</div>
</td>
<td>
<div
v-for="(e) in element.DeptList"
:key="e.DeptId"
>{{ e.DeptName }}</div>
<div v-if="element.DeptList.length > 0">
<div
v-for="(e) in element.DeptList"
:key="e.DeptId"
>{{ e.DeptName }}</div>
</div>
<div v-else>-</div>
</td>
<td>
<div v-for="(e) in element.EmpList" :key="e.Id">{{ e.EmployeeName }}</div>
<div v-if="element.EmpList.length > 0">
<div
v-for="(e) in element.EmpList"
:key="e.Id"
>{{ e.EmployeeName }}</div>
</div>
<div v-else>-</div>
</td>
<td>
<span v-if="element.RuleAllotWay === 1">依次轮流</span>
<span v-if="element.RuleAllotWay === 2">随机分配</span>
</td>
<td>
<span>{{ element.ConditionStrList.join(',') }}</span>
</td>
<td>
<q-btn
flat
......@@ -273,10 +294,10 @@ export default defineComponent({
const setState = (msg) => {
customerService.setCustomerClueRuleState(msg).then(res => {
message.successMsg(res.data.Message)
if(msg.Type==2){
message.successMsg(res.data.Message)
if (msg.Type == 2) {
getClueList()
}
}
})
}
onMounted(() => {
......@@ -322,7 +343,8 @@ export default defineComponent({
font-size: 13px;
text-align: center;
color: #2d2d2d;
padding: 10px 0;
box-sizing: border-box;
padding: 10px;
font-weight: bold;
border-bottom: 1px solid #e5e5e5;
}
......
......@@ -18,32 +18,58 @@
<div class="page-search row items-center">
<div class="col row wrap q-mr-lg q-col-gutter-md">
<div class="col-3">
<!-- <q-input filled v-model="SeletObj.selectVal" label='请输入'>
<q-input
filled
v-model="selectVal"
clearable
@clear="getCluerList"
@update:model-value="getSelectWay(), getCluerList()"
label="请输入"
>
<template #before>
<q-select filled style="width:120px;" @update:model-value="getSelectWay" option-value="Id" option-label="Name" v-model="SeletObj.selectWay"
:options="TypeList" emit-value map-options label="选择类型" />
<q-select
filled
style="width:120px;"
@update:model-value="getSelectWay"
option-value="Id"
option-label="Name"
v-model="selectWay"
:options="TypeList"
emit-value
map-options
label="选择类型"
/>
</template>
</q-input> -->
</q-input>
</div>
<div class="col-3">
<!-- <q-select filled style="width:120px;" @update:model-value="getSelectTime" option-value="Id" option-label="Name" v-model="TimeObj.timeWay"
:options="TimeList" emit-value map-options />
<q-date v-model="days" multiple /> -->
</div>
<div class="col-3">
<a-date-picker v-model:value="value1" />
<a-range-picker
style="width:auto"
v-model:value="dateRange"
size="large"
:locale="locale"
:format="format"
@change="chooseDate"
/>
</div>
</div>
</div>
<div class="page-content">
<q-table :rows="data.dataList"
<div class="page-content q-mt-lg">
<q-table
:rows="data.dataList"
:columns="data.columns"
class="my-sticky-header-column-table"
row-key="name"
selection="multiple">
selection="multiple"
>
<template v-slot:bottom>
<q-pagination class="full-width justify-end" v-model="msg.PageIndex" color="primary" :max="msg.pageCount"
:input="true" />
<q-pagination
class="full-width justify-end"
v-model="msg.PageIndex"
color="primary"
:max="msg.pageCount"
:input="true"
/>
</template>
</q-table>
</div>
......@@ -51,31 +77,36 @@
</div>
</template>
<script lang='ts'>
import {defineComponent,ref,onMounted} from 'vue'
import ClueModule from '@/module/customer/clueModule'
import { toRefs, defineComponent, onMounted } from 'vue'
import ClueModule from '@/module/customer/clueModule'
import locale from 'ant-design-vue/es/date-picker/locale/zh_CN';
export default defineComponent({
setup() {
let {
useTab, getCluerList, msg, data, TypeList, SeletObj, getSelectWay, dateRange, format, chooseDate
} = ClueModule()
let [tab, setTab] = useTab()
onMounted(() => {
getCluerList()
})
export default defineComponent({
setup() {
let {
useTab, getCluerList,msg,data,TypeList
} = ClueModule()
let [ tab ,setTab]=useTab()
onMounted(()=>{
getCluerList(msg)
})
return {
tab,setTab,msg, getCluerList,data,TypeList,value1:ref("")
}
return {
locale, tab, setTab, msg, getCluerList, data, TypeList, ...toRefs(SeletObj), getSelectWay, dateRange, format, chooseDate
}
})
}
})
</script>
<style lang="scss">
.customer .q-field__before{
padding-right:0!important;
}
.customer .q-field__before {
padding-right: 0 !important;
}
</style>
<style lang="scss" scoped>
</style>
::v-deep .ant-cascader-picker {
height: 100px;
border-radius: 4px;
background-color: rgba(0, 0, 0, 0.05);
overflow: hidden;
}
</style>
\ No newline at end of file
......@@ -5,13 +5,18 @@
<q-breadcrumbs-el label="返回" icon="navigate_before" @click="jumpBeforePage" />
<q-breadcrumbs-el label="编辑" />
</q-breadcrumbs>
<q-btn color="primary" label="完成" @click="setCustomerClueRuleInfo"/>
<q-btn color="primary" label="完成" @click="setCustomerClueRuleInfo" />
</div>
<div class="container">
<div class="content-block">
<div class="fission-title">选择待分配客户</div>
<div class="fission-subtitle">当待分配客户符合以下条件时</div>
<requestGroup v-model:addCondition="editMsg.RuleSelectType" :defaultData="editMsg.ConditionList" ref="condition" @change="getCondition"/>
<requestGroup
v-model:addCondition="editMsg.RuleSelectType"
:defaultData="defaultConditionList"
ref="condition"
@change="getCondition"
/>
</div>
<div class="content-block mt20">
<div class="fission-title">分配给以下部门/成员</div>
......@@ -19,14 +24,28 @@
<div class="departs flex-between-center">
<q-btn outline color="primary" label="选择部门/成员" @click="changeDialog" />
<div class="flex align-center depart-title">
<span>已选:{{peopleNum}}</span>
<span>已选:{{ peopleNum }}</span>
<div class="per"></div>
<span>有效账号数(已启用探马账号人数):0人</span>
</div>
</div>
<div class="staff-box mt20">
<q-chip color="primary" v-for="(item,index) in editMsg.DeptList" :key='index' text-color="white" icon="work" :label="item.DeptName"></q-chip>
<q-chip color="primary" v-for="(item,index) in editMsg.EmpList" :key='index' text-color="white" icon="person" :label="item.EmployeeName"></q-chip>
<q-chip
color="primary"
v-for="(item,index) in editMsg.DeptList"
:key="index"
text-color="white"
icon="work"
:label="item.DeptName"
></q-chip>
<q-chip
color="primary"
v-for="(item,index) in editMsg.EmpList"
:key="index"
text-color="white"
icon="person"
:label="item.EmployeeName"
></q-chip>
</div>
</div>
<div class="content-block mt20">
......@@ -46,7 +65,7 @@
nodeKey="newId"
labelKey="DeptName"
childrenKey="ChildList"
strategy='leaf'
strategy="leaf"
:treeData="dataTree"
@select="getdpt"
@getNum="getNum"
......@@ -73,7 +92,6 @@ export default defineComponent({
changeDialog,
msg,
data,
defaultArray,
condition,
getDetail,
getEmployeeData,
......@@ -84,15 +102,15 @@ export default defineComponent({
} = editRuleModule();
onMounted(() => {
if (msg().RuleId > 0) {
data.editMsg.Id=msg().RuleId
data.editMsg.Id = msg().RuleId
getDetail()
}else{
data.editMsg.DeptList=[]
data.editMsg.EmpList=[]
data.editMsg.ConditionList=[]
data.editMsg.RuleSelectType=1
data.editMsg.RuleAllotWay=1
defaultArray=[]
} else {
data.editMsg.DeptList = []
data.editMsg.EmpList = []
data.editMsg.ConditionList = []
data.editMsg.RuleSelectType = 1
data.editMsg.RuleAllotWay = 1
data.defaultArray = []
}
getEmployeeData()
})
......@@ -101,7 +119,6 @@ export default defineComponent({
changeDialog,
condition,
...toRefs(data),
defaultArray,
setCustomerClueRuleInfo,
getCondition,
getdpt,
......
This diff is collapsed.
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