Commit d46f7d80 authored by 罗超's avatar 罗超

1

parent 01693467
......@@ -70,7 +70,7 @@
<!-- name -->
<q-select
outlined
v-model="x.Name"
v-model="x.Id"
:options="filedList"
dense
class="my-special-class"
......@@ -387,6 +387,7 @@ export default defineComponent({
}
filedList.value.unshift(obj2)
addMsg.value.push({
Id: '标签',
Name: '标签',
Type: 1,
Direction: '',
......@@ -403,6 +404,7 @@ export default defineComponent({
}
const addsList = () => {
let obj: params = {
Id:0,
Name: '',
Type: '',
Direction: '',
......@@ -415,7 +417,6 @@ export default defineComponent({
}
const showlabel = (y) => {
selectindex.value = y;
if (addMsg.value[y].StartValue == '') { //为空赋值为数组
LableList.value = []
......@@ -471,6 +472,7 @@ export default defineComponent({
let changeName = (val: any, y: number) => {
addMsg.value[y].StartValue = ''
addMsg.value[y].EndValue = ''
switch (val) {
case "标签": {
addMsg.value[y].IsCustom = 2
......@@ -487,6 +489,10 @@ export default defineComponent({
let find: any = filedList.value.find((e) => {
return e.Id == val
})
if(find){
addMsg.value[y].Name = find.Name
}
console.log(500,find)
switch (find.Type) {
case 1: {
addMsg.value[y].directionList = directionList2
......
<template>
<div class="q-pa-md">
<requestGroup/>
<div class="q-gutter-lg">
<q-radio v-model="ClueType" :val="1" label="自动分配"></q-radio>
<q-radio v-model="ClueType" :val="2" label="手动分配"></q-radio>
<q-radio v-model="configMsg.ClueType" :val="1" label="自动分配" @update:model-value='configChange'></q-radio>
<q-radio v-model="configMsg.ClueType" :val="2" label="手动分配" @update:model-value='configChange'></q-radio>
</div>
<div class="q-pa-md" v-if="ClueType === 1">
<div class="q-pa-md" v-if="configMsg.ClueType === 1">
<div class="aoto-matic-header">
若客户满足多条规则,会优先按照编号顺序执行规则
<q-btn color="primary" label="+新增规则" style="margin-left: 10px;" @click="jumpPage('/editor/editRule')"/>
<q-btn
color="primary"
label="+新增规则"
style="margin-left: 10px;"
@click="jumpPage('/editor/editRule')"
/>
</div>
<table class="payTable">
<thead>
......@@ -24,7 +28,7 @@
<th width="5%"></th>
</tr>
</thead>
<tr v-if="data.length == 0&&defaultData.length == 0">
<tr v-if="data.length == 0 && defaultData.length == 0">
<td :colspan="9" align="center">暂无数据</td>
</tr>
<template v-if="defaultData.length > 0">
......@@ -61,14 +65,19 @@
style="font-weight:400;color: #3FC4FF"
class="q-mr-xs"
label="编辑"
@click="jumpPage('/editor/editRule',item.Id)"
@click="jumpPage('/editor/editRule', item.Id)"
/>
</td>
<td>
</td>
<td></td>
</tr>
</template>
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd" v-if="data.length > 0">
<draggable
v-model="data"
tag="tbody"
item-key="Id"
@update="datadragEnd"
v-if="data.length > 0"
>
<template #item="{ element }">
<tr>
<td>
......@@ -103,7 +112,7 @@
style="font-weight:400;color: #3FC4FF"
class="q-mr-xs"
label="编辑"
@click="jumpPage('/editor/editRule',element.Id)"
@click="jumpPage('/editor/editRule', element.Id)"
/>
<q-btn
v-if="element.IsDefault != 1"
......@@ -124,15 +133,34 @@
</draggable>
</table>
</div>
<div class="q-pa-md manual" v-if="configMsg.ClueType === 2">
<div class="box-manual " :class="{'checked-border':configMsg.ClueAllotWay==1}" @click="configMsg.ClueAllotWay=1;configChange()">
<q-icon name="autorenew" size="lg" />
<div>按已选员工顺序依次轮流分配</div>
<div class="right" v-if="configMsg.ClueAllotWay==1">
<q-icon name="check" class="check-icon" />
</div>
</div>
<div class="box-manual" :class="{'checked-border':configMsg.ClueAllotWay==2}" @click="configMsg.ClueAllotWay=2;configChange()">
<q-icon name="shuffle" size="lg" />
<div>按已选员工随机分配</div>
<div class="right" v-if="configMsg.ClueAllotWay==2">
<q-icon name="check" class="check-icon" />
</div>
</div>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, reactive, onMounted } from 'vue'
import {
defineComponent,
reactive,
onMounted
} from 'vue'
import draggable from "vuedraggable";
import customerService from '@/api/customer';
import requestGroup from '@/components/customer/request-group.vue'
import router from '@/router/index'
// import { url } from 'inspector';
interface dataType {
Id: number,
RuleSelectType: number,
......@@ -144,51 +172,71 @@ interface dataType {
ConditionStrList: Array<string>,
Sort: number
}
interface dataConfigType {
Id?: number,
ClueType: number,
ClueAllotWay: number
}
export default defineComponent({
components: {
draggable,
requestGroup
},
setup() {
let defaultData:Array<dataType>= reactive([])
let data:Array<dataType>= reactive([])
let defaultData: Array<dataType> = reactive([])
let data: Array<dataType> = reactive([])
const datadragEnd = (e: any) => {
console.log('拖动结束', e)
}
const getClueList = () => {
customerService.getCustomerClueRuleList({}).then(res => {
res.data.Data.map((item:dataType)=>{
if(item.IsDefault===1){
res.data.Data.map((item: dataType) => {
if (item.IsDefault === 1) {
defaultData.push(item)
}else{
} else {
data.push(item)
}
})
console.log(69,defaultData)
console.log(123, data)
})
}
const jumpPage=(url:string,Id=0)=>{
let configMsg=reactive <dataConfigType>( {
ClueType: 1,// 1手动分配 2自动分配
ClueAllotWay: 1,// 1依次轮流 2随机分配
})
const getCustomerClueRuleConfig = () => {
customerService.getCustomerClueRuleConfig({}).then(res => {
let data=res.data.Data
configMsg.ClueType=data.ClueType
configMsg.ClueAllotWay=data.ClueAllotWay
})
}
const jumpPage = (url: string, Id = 0) => {
router.push({
path:url,
query:{
path: url,
query: {
Id
}
})
}
const configChange=()=>{
customerService.setCustomerClueRuleConfig(configMsg).then(res => {
console.log(228,res.data)
})
}
onMounted(() => {
getClueList();
getCustomerClueRuleConfig();
})
return {
ClueType: ref(1),
configChange,
defaultData,
data,
datadragEnd,
jumpPage
jumpPage,
configMsg
}
}
})
</script>
<style lang="scss" scoped>
.payTable {
......@@ -219,6 +267,7 @@ export default defineComponent({
font-weight: bold;
border-bottom: 1px solid #e5e5e5;
}
.aoto-matic-header {
display: flex;
align-items: center;
......@@ -228,4 +277,53 @@ export default defineComponent({
color: #858598;
font-size: 14px;
}
.manual {
height: 100%;
display: flex;
margin: 0 auto;
width: 800px;
justify-content: space-around;
margin-top: 191px;
.box-manual {
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>
......@@ -5,7 +5,7 @@
<q-breadcrumbs-el label="返回" icon="navigate_before" @click="jumpBeforePage" />
<q-breadcrumbs-el label="编辑" />
</q-breadcrumbs>
<q-btn color="primary" label="完成" />
<q-btn color="primary" label="完成" @click="setCustomerClueRuleInfo"/>
</div>
<div class="container">
<div class="content-block">
......@@ -34,26 +34,27 @@
<div class="fission-subtitle flex align-center">
选择分配规则:
<div class="q-gutter-sm">
<q-radio v-model="data.editMsg.RuleAllotWay" :val="1" label="顺序分配" />
<q-radio v-model="data.editMsg.RuleAllotWay" :val="2" label="随机分配" />
<q-radio v-model="editMsg.RuleAllotWay" :val="1" label="顺序分配" />
<q-radio v-model="editMsg.RuleAllotWay" :val="2" label="随机分配" />
</div>
</div>
</div>
</div>
<departmentStaff
v-model="data.showDialog"
v-model:defaultArray="data.defaultArray"
v-model="showDialog"
v-model:defaultArray="defaultArray"
nodeKey="newId"
labelKey="DeptName"
childrenKey="ChildList"
strategy='leaf'
:treeData="data.dataTree"
:treeData="dataTree"
/>
</div>
</template>
<script lang="ts">
import {
defineComponent,
toRefs,
onMounted
} from 'vue'
import requestGroup from '@/components/customer/request-group.vue'
......@@ -71,10 +72,10 @@ export default defineComponent({
msg,
data,
getDetail,
getEmployeeData
getEmployeeData,
setCustomerClueRuleInfo,
} = editRuleModule();
onMounted(() => {
if (msg().RuleId > 0) {
console.log('getDetail', msg())
getDetail()
......@@ -84,7 +85,8 @@ export default defineComponent({
return {
jumpBeforePage,
changeDialog,
data,
...toRefs(data),
setCustomerClueRuleInfo
}
}
......
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