Commit 8b1e197e authored by 罗超's avatar 罗超

1

parent 92d641f6
...@@ -10,5 +10,5 @@ export default defineComponent({ ...@@ -10,5 +10,5 @@ export default defineComponent({
</script> </script>
<style lang="sass"> <style lang="sass">
@import url('./css/font.sass') @import url('./css/font.sass')
@import url('//at.alicdn.com/t/font_2930340_slk9lu50bhg.css') @import url('//at.alicdn.com/t/font_2930340_td0kzqw2z1.css')
</style> </style>
...@@ -109,8 +109,23 @@ service.interceptors.response.use( ...@@ -109,8 +109,23 @@ service.interceptors.response.use(
/** 请求有响应 */ /** 请求有响应 */
async (response: AxiosResponse) => { async (response: AxiosResponse) => {
if (response.status === 200) { if (response.status === 200) {
if (response.data.Code === 1) { if (response.data.Code === 1) {
return Promise.resolve(response) return Promise.resolve(response)
} else {
Notify.create({
message: response.data.Message,
color: 'warning',
textColor: 'dark',
icon: 'announcement',
position:"top"
})
if (response.data.Code === 10000 || response.data.Code === 10001) {
localStorage.clear()
router.replace({
path: '/auth/login'
})
}
} }
} else { } else {
const __text = getErrorCode2text(response) const __text = getErrorCode2text(response)
......
...@@ -105,6 +105,12 @@ const linksList = [ ...@@ -105,6 +105,12 @@ const linksList = [
MenuName: '客户', MenuName: '客户',
MenuIcon: 'school', MenuIcon: 'school',
MenuUrl: '/customer' MenuUrl: '/customer'
},
{
MenuId: 11-3,
MenuName: '线索',
MenuIcon: 'school',
MenuUrl: '/clue'
} }
] ]
}, },
......
...@@ -5,6 +5,10 @@ ...@@ -5,6 +5,10 @@
<q-radio v-model="ClueType" :val="2" label="手动分配"></q-radio> <q-radio v-model="ClueType" :val="2" label="手动分配"></q-radio>
</div> </div>
<div class="q-pa-md" v-if="ClueType === 1"> <div class="q-pa-md" v-if="ClueType === 1">
<div class="aoto-matic-header">
若客户满足多条规则,会优先按照编号顺序执行规则
<q-btn color="primary" label="+新增规则" style="margin-left: 10px;" />
</div>
<table class="payTable"> <table class="payTable">
<thead> <thead>
<tr> <tr>
...@@ -13,16 +17,55 @@ ...@@ -13,16 +17,55 @@
<th>部门列表</th> <th>部门列表</th>
<th>人员列表</th> <th>人员列表</th>
<th>分配方式</th> <th>分配方式</th>
<th>条件列表</th>
<th>条件描述</th> <th>条件描述</th>
<th>排序</th> <th>排序</th>
<th width="4%"></th> <th width="10%">编辑</th>
<th width="5%"></th>
</tr> </tr>
</thead> </thead>
<!-- <tr v-if="data && data.length == 0"> <tr v-if="data.length == 0&&defaultData.length == 0">
<td :colspan="8" align="center">暂无数据</td> <td :colspan="9" align="center">暂无数据</td>
</tr> --> </tr>
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd"> <tr v-for="item in defaultData" v-if="defaultData.length > 0">
<td>
<span v-if="item.RuleSelectType === 1">并且</span>
<span v-if="item.RuleSelectType === 2">或者</span>
</td>
<td>
<span v-if="item.IsDefault == 1"></span>
<span v-else></span>
</td>
<td>
<span>{{ item.DeptList.join(',') }}</span>
</td>
<td>
<span>{{ item.EmpList.join(',') }}</span>
</td>
<td>
<span v-if="item.RuleAllotWay === 1">依次轮流</span>
<span v-if="item.RuleAllotWay === 2">随机分配</span>
</td>
<td>
<span>未匹配设定规则的客户</span>
</td>
<td>
<span>{{ item.Sort }}</span>
</td>
<td>
<q-btn
flat
size="xs"
icon="edit"
style="font-weight:400;color: #3FC4FF"
class="q-mr-xs"
label="编辑"
/>
</td>
<td>
</td>
</tr>
<draggable v-model="data" tag="tbody" item-key="Id" @update="datadragEnd" v-if="data.length > 0">
<template #item="{ element }"> <template #item="{ element }">
<tr> <tr>
<td> <td>
...@@ -43,18 +86,35 @@ ...@@ -43,18 +86,35 @@
<span v-if="element.RuleAllotWay === 1">依次轮流</span> <span v-if="element.RuleAllotWay === 1">依次轮流</span>
<span v-if="element.RuleAllotWay === 2">随机分配</span> <span v-if="element.RuleAllotWay === 2">随机分配</span>
</td> </td>
<td>
<span>{{ element.ConditionList.join(',') }}</span>
</td>
<td> <td>
<span>{{ element.ConditionStrList.join(',') }}</span> <span>{{ element.ConditionStrList.join(',') }}</span>
</td> </td>
<td> <td>
<span>{{ element.Sort }}</span> <span>{{ element.Sort }}</span>
</td> </td>
<td> <td>
<i class="iconfont icon-left" style="font-size: 14px;color: #777;"></i> <q-btn
flat
size="xs"
icon="edit"
style="font-weight:400;color: #3FC4FF"
class="q-mr-xs"
label="编辑"
@click="goedit(element)"
/>
<q-btn
v-if="element.IsDefault != 1"
flat
size="xs"
icon="delete"
color="negative"
class="q-mr-xs"
label="删除"
@click="godelete(element, 3, index)"
/>
</td>
<td>
<i class="iconfont icon-drag" style="font-size: 20px;color: #777;"></i>
</td> </td>
</tr> </tr>
</template> </template>
...@@ -64,32 +124,42 @@ ...@@ -64,32 +124,42 @@
</div> </div>
</template> </template>
<script lang="ts"> <script lang="ts">
import { defineComponent, ref, onMounted } from 'vue' import { defineComponent, ref, reactive, onMounted } from 'vue'
import draggable from "vuedraggable"; import draggable from "vuedraggable";
import customerService from '@/api/customer'; import customerService from '@/api/customer';
interface dataType {
Id: number,
RuleSelectType: number,
IsDefault: number,
DeptList: Array<any>,
EmpList: Array<any>,
RuleAllotWay: number,
ConditionList: Array<any>,
ConditionStrList: Array<string>,
Sort: number
}
export default defineComponent({ export default defineComponent({
component: { components: {
draggable draggable
}, },
setup() { setup() {
let data = ref([{ let defaultData:Array<dataType>= reactive([])
Id: 1, let data:Array<dataType>= reactive([])
RuleSelectType: 1,
IsDefault:1,
DeptList:[],
EmpList:[],
RuleAllotWay:1,
ConditionList:[],
ConditionStrList:[],
Sort:1
}])
const datadragEnd = (e: any) => { const datadragEnd = (e: any) => {
console.log('拖动结束', e) console.log('拖动结束', e)
} }
const getClueList = () => { const getClueList = () => {
customerService.getCustomerClueRuleList({}).then(res => { customerService.getCustomerClueRuleList({}).then(res => {
data.value = res.data.Data res.data.Data.map((item:dataType)=>{
console.log(59, data) if(item.IsDefault===1){
defaultData.push(item)
}else{
data.push(item)
}
})
console.log(69,defaultData)
console.log(123, data)
}) })
} }
onMounted(() => { onMounted(() => {
...@@ -97,14 +167,14 @@ export default defineComponent({ ...@@ -97,14 +167,14 @@ export default defineComponent({
}) })
return { return {
ClueType: ref(1), ClueType: ref(1),
defaultData,
data, data,
// columns,
datadragEnd datadragEnd
} }
} }
}) })
</script> </script>
<style> <style lang="scss" scoped>
.payTable { .payTable {
width: 100%; width: 100%;
border-collapse: collapse; border-collapse: collapse;
...@@ -133,4 +203,13 @@ export default defineComponent({ ...@@ -133,4 +203,13 @@ export default defineComponent({
font-weight: bold; font-weight: bold;
border-bottom: 1px solid #e5e5e5; border-bottom: 1px solid #e5e5e5;
} }
.aoto-matic-header {
display: flex;
align-items: center;
justify-content: flex-end;
margin-bottom: 10px;
margin-left: 2px;
color: #858598;
font-size: 14px;
}
</style> </style>
\ No newline at end of file
...@@ -37,7 +37,7 @@ export default defineComponent({ ...@@ -37,7 +37,7 @@ export default defineComponent({
}, },
setup() { setup() {
return { return {
tab: ref('field') tab: ref('clue')
} }
} }
......
...@@ -2,25 +2,39 @@ import { RouteRecordRaw } from 'vue-router' ...@@ -2,25 +2,39 @@ import { RouteRecordRaw } from 'vue-router'
const routes: RouteRecordRaw[] = [ const routes: RouteRecordRaw[] = [
{ {
path: '/index', path: '/',
redirect: '/index',
component: () => import('@/layouts/MainLayout.vue'), component: () => import('@/layouts/MainLayout.vue'),
children: [{ path: '', component: () => import('@/pages/Index.vue') }] children: [
//首页
{
path: '/index',
component: () => import('@/pages/Index.vue')
}, },
//素材分组
{ {
path: '/groupingManage', path: '/groupingManage',
component: () => import('@/layouts/MainLayout.vue'), component: () => import('@/pages/drainage/groupingManage.vue')
children: [{ path: '', component: () => import('@/pages/drainage/groupingManage.vue') }]
}, },
{//客户管理 客户设置 //客户管理--------------------
// 客户设置
{
path: '/customerSetup', path: '/customerSetup',
component: () => import('@/layouts/MainLayout.vue'), component: () => import('@/pages/customer/customerSetup.vue')
children: [{ path: '', component: () => import('@/pages/customer/customerSetup.vue') }]
}, },
//客户
{ {
path: '/customer', path: '/customer',
component: () => import('@/layouts/MainLayout.vue'), component: () => import('@/pages/customerManage/customer.vue')
children: [{ path: '', component: () => import('@/pages/customerManage/customer.vue') }]
}, },
//线索
{
path: '/clue',
component: () => import('@/pages/customerManage/clue.vue')
}
]
},
{ {
path: '/auth/login', path: '/auth/login',
component: () => import('@/pages/auth/login.vue') component: () => import('@/pages/auth/login.vue')
......
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