Commit 39b87432 authored by zhengke's avatar zhengke

21

parents 8acb4f83 a6e5adce
...@@ -30,7 +30,14 @@ ...@@ -30,7 +30,14 @@
data data
}) })
} }
// 获取客户线索规则列表
static async getCustomerClueRuleList(data:any): Promise<HttpResponse> {
return Axios('QYCustomer/GetCustomerClueRuleList', {
method: 'post',
responseType: 'json',
data
})
}
} }
export default customerService export default customerService
<template>
<div class="requestgroup">
</div>
</template>
<script lang="ts">
import { defineComponent, ref, onMounted } from 'vue'
import customerService from '@/api/customer'
export default defineComponent({
setup() {
const filedList = ref([])
const addMsg = ref([])
onMounted(() => {//进入页面就调用
getCustomerFiledList();//获取客户字段
})
const getCustomerFiledList = () => {
customerService.getCustomerFiledList({ Enable: 1 }).then((res) => {
let data = res.data.Data
filedList.value = data;
filedList.value.forEach(x=>{// IsCustom 是否自定义字段 1是 2标签 3阶段
x.IsCustom = 1
})
let obj = { Id: '客户阶段', Name: '客户阶段', Type: 4 ,IsCustom:3}
filedList.value.unshift(obj)
let obj2 = { Id: '标签', Name: '标签', Type: 3 ,IsCustom:2}
filedList.value.unshift(obj2)
addMsg.value.push({
Name:filedList.value[0].Id,
Type:filedList.value,
Direction:1,
StartValue:'',
EndValue:'',
IsCustom:2,
})
})
}
return {
getCustomerFiledList
}
}
})
</script>
\ No newline at end of file
<template>
<div class="q-pa-md">
<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>
</div>
<div class="q-pa-md" v-if="ClueType === 1">
<table class="payTable">
<thead>
<tr>
<th>查询类型</th>
<th>是否默认</th>
<th>部门列表</th>
<th>人员列表</th>
<th>分配方式</th>
<th>条件列表</th>
<th>条件描述</th>
<th>排序</th>
<th width="4%"></th>
</tr>
</thead>
<!-- <tr v-if="data && data.length == 0">
<td :colspan="8" align="center">暂无数据</td>
</tr> -->
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd">
<template #item="{ element }">
<tr>
<td>
<span v-if="element.RuleSelectType === 1">并且</span>
<span v-if="element.RuleSelectType === 2">或者</span>
</td>
<td>
<span v-if="element.IsDefault == 1"></span>
<span v-else></span>
</td>
<td>
<span>{{ element.DeptList.join(',') }}</span>
</td>
<td>
<span>{{ element.EmpList.join(',') }}</span>
</td>
<td>
<span v-if="element.RuleAllotWay === 1">依次轮流</span>
<span v-if="element.RuleAllotWay === 2">随机分配</span>
</td>
<td>
<span>{{ element.ConditionList.join(',') }}</span>
</td>
<td>
<span>{{ element.ConditionStrList.join(',') }}</span>
</td>
<td>
<span>{{ element.Sort }}</span>
</td>
<td>
<i class="iconfont icon-left" style="font-size: 14px;color: #777;"></i>
</td>
</tr>
</template>
</draggable>
</table>
</div>
</div>
</template>
<script lang="ts">
import { defineComponent, ref, onMounted } from 'vue'
import draggable from "vuedraggable";
import customerService from '@/api/customer';
export default defineComponent({
component: {
draggable
},
setup() {
let data = ref([{
Id: 1,
RuleSelectType: 1,
IsDefault:1,
DeptList:[],
EmpList:[],
RuleAllotWay:1,
ConditionList:[],
ConditionStrList:[],
Sort:1
}])
const datadragEnd = (e: any) => {
console.log('拖动结束', e)
}
const getClueList = () => {
customerService.getCustomerClueRuleList({}).then(res => {
data.value = res.data.Data
console.log(59, data)
})
}
onMounted(() => {
getClueList();
})
return {
ClueType: ref(1),
data,
// columns,
datadragEnd
}
}
})
</script>
<style>
.payTable {
width: 100%;
border-collapse: collapse;
}
.payTable tr th {
background: #fff;
height: 40px;
font-size: 12px;
font-weight: bold;
color: #2d2d2d;
background: #dddee0;
}
.payTable tr {
background: #fff;
text-align: center;
height: 40px;
}
.payTable tr td {
font-size: 13px;
text-align: center;
color: #2d2d2d;
padding: 10px 0;
font-weight: bold;
border-bottom: 1px solid #e5e5e5;
}
</style>
\ No newline at end of file
<template> <template>
<requestgroup></requestgroup>
<div class="q-pa-md customerField"> <div class="q-pa-md customerField">
<table class="payTable"> <table class="payTable">
<thead> <thead>
...@@ -16,7 +17,7 @@ ...@@ -16,7 +17,7 @@
<tr v-if="data && data.length==0"> <tr v-if="data && data.length==0">
<td :colspan="8" align="center">暂无数据</td> <td :colspan="8" align="center">暂无数据</td>
</tr> </tr>
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd" :clone="cloneFun"> <draggable v-model="data" tag="tbody" item-key="Id" :move="getdata" @update="datadragEnd" :clone="cloneFun">
<template #item="{ element }"> <template #item="{ element }">
<tr> <tr>
<td><span>{{element.Name}}</span></td> <td><span>{{element.Name}}</span></td>
...@@ -58,15 +59,16 @@ ...@@ -58,15 +59,16 @@
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent ,ref, onMounted } from 'vue' import { defineComponent ,ref, onMounted } from 'vue'
import requestgroup from '../../../components/customer/request-group.vue'
import customerService from '@/api/customer' import customerService from '@/api/customer'
import draggable from "vuedraggable"; import draggable from "vuedraggable";
export default defineComponent({ export default defineComponent({
components: { draggable }, components: { draggable ,requestgroup},
setup() { setup() {
const data =ref([]); const data =ref([]);
const dragId =ref(0);
const changePage = () => { const changePage = () => {
customerService.getCustomerFiledList({ Enable: -1 }).then((res) => { customerService.getCustomerFiledList({ Enable: -1 }).then((res) => {
console.log(132,res)
data.value=res.data.Data data.value=res.data.Data
}) })
} }
...@@ -74,6 +76,11 @@ ...@@ -74,6 +76,11 @@
console.log('拖动结束',e) console.log('拖动结束',e)
} }
const getdata = (e:any) => {
console.log('拖动结束22323',e)
dragId.value = e.draggedContext.element.Id
}
onMounted(() => { onMounted(() => {
changePage() changePage()
...@@ -82,6 +89,7 @@ ...@@ -82,6 +89,7 @@
data, data,
changePage, changePage,
datadragEnd, datadragEnd,
getdata
} }
} }
......
...@@ -13,9 +13,11 @@ ...@@ -13,9 +13,11 @@
<q-tab name="yewumoshi" label="业务模式" /> <q-tab name="yewumoshi" label="业务模式" />
<q-tab name="field" label="客户字段" /> <q-tab name="field" label="客户字段" />
<q-tab name="label" label="标签" /> <q-tab name="label" label="标签" />
<q-tab name="clue" label="线索分配规则" />
</q-tabs> </q-tabs>
<div v-if="tab == 'field'"> <div>
<customer-Field></customer-Field> <customer-Field v-if="tab == 'field'"></customer-Field>
<clue-rule v-if="tab == 'clue'"></clue-rule>
</div> </div>
</q-page> </q-page>
</div> </div>
...@@ -23,13 +25,15 @@ ...@@ -23,13 +25,15 @@
<script lang="ts"> <script lang="ts">
import customerField from './components/customerField.vue' import customerField from './components/customerField.vue'
import clueRule from './components/clueRule.vue'
import { import {
defineComponent, defineComponent,
ref ref
} from 'vue' } from 'vue'
export default defineComponent({ export default defineComponent({
components: { components: {
customerField customerField,
clueRule
}, },
setup() { setup() {
return { return {
......
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