线索
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table :data="list" border stripe>
|
||||
<el-table :data="list" border>
|
||||
<el-table-column type="index" width="50" />
|
||||
<el-table-column label="来源名称">
|
||||
<template #default="{ row }">
|
||||
@@ -12,6 +12,11 @@
|
||||
<el-input v-model="row.link" placeholder="请输入" :clearable="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="是否启用" width="100px">
|
||||
<template #default="{ row }">
|
||||
<el-switch v-model="row.inEnable" :active-value="true" :inactive-value="false" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" width="100px">
|
||||
<template #default="{ $index }">
|
||||
<el-button type="primary" style="padding: 0px" text @click="handleRemove($index)"
|
||||
|
||||
@@ -1,82 +1,125 @@
|
||||
<template>
|
||||
<el-form :model="form" ref="sendForm" :rules="rules" label-width="100px" :inline="false">
|
||||
<el-form-item label="是否自动分配">
|
||||
<el-radio-group v-model="form.isAuto">
|
||||
<el-radio :label="1"> 自动分配 </el-radio>
|
||||
<el-radio :label="0"> 手动分配 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div v-if="form.isAuto">
|
||||
<el-form-item label="分配对象">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkUserAll"
|
||||
:indeterminate="userIndeterminate"
|
||||
@change="userCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.users" @change="userCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in userOptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="线索来源">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkResourceAll"
|
||||
:indeterminate="resourceIndeterminate"
|
||||
@change="resourceCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in resourceOptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="权重配置">
|
||||
<div>
|
||||
<div v-for="(item, index) in intentionOptions" :key="index" class="flex mb-10px">
|
||||
<div class="mr-15px" style="width: 100px">{{ item.label }}</div>
|
||||
<el-input v-model="item.value" type="number" placeholder="请输入权重">
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="分配时间">
|
||||
<el-time-picker
|
||||
v-model="form.sendTime"
|
||||
placeholder="任意时间点"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
<div class="flex">
|
||||
<div class="mr-20px" style="width: 500px">
|
||||
<el-input
|
||||
v-model="searchForm.keyword"
|
||||
placeholder="请输入关键字查询"
|
||||
clearable
|
||||
class="mb-10px"
|
||||
@keyup.enter="getUserList"
|
||||
/>
|
||||
|
||||
<el-table :data="userList" @cell-click="selectUser">
|
||||
<el-table-column prop="name" label="员工姓名" />
|
||||
<el-table-column prop="phone" label="电话" />
|
||||
<el-table-column prop="workNum" label="工号" />
|
||||
</el-table>
|
||||
<!-- 分页 -->
|
||||
<Pagination
|
||||
v-model:limit="searchForm.pageSize"
|
||||
v-model:page="searchForm.pageNum"
|
||||
:total="total"
|
||||
@pagination="getUserList"
|
||||
/>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<el-form :model="form" ref="sendForm" :rules="rules" label-width="100px" :inline="false">
|
||||
<el-form-item label="是否自动分配">
|
||||
<el-radio-group v-model="form.isAuto">
|
||||
<el-radio :label="1"> 自动分配 </el-radio>
|
||||
<el-radio :label="0"> 手动分配 </el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<div v-if="form.isAuto">
|
||||
<!-- <el-form-item label="分配对象">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkUserAll"
|
||||
:indeterminate="userIndeterminate"
|
||||
@change="userCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.users" @change="userCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in userOptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="线索来源">
|
||||
<div>
|
||||
<el-checkbox
|
||||
v-model="checkResourceAll"
|
||||
:indeterminate="resourceIndeterminate"
|
||||
@change="resourceCheckAllChange"
|
||||
>
|
||||
全选
|
||||
</el-checkbox>
|
||||
<el-checkbox-group v-model="form.resource" @change="resourceCheckedChange">
|
||||
<el-checkbox
|
||||
v-for="(item, index) in resourceOptions"
|
||||
:key="index"
|
||||
:label="item.value"
|
||||
:value="item.value"
|
||||
>
|
||||
{{ item.label }}
|
||||
</el-checkbox>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="权重配置">
|
||||
<div>
|
||||
<el-radio-group v-model="form.isRandom">
|
||||
<el-radio :label="1">
|
||||
<Tooltip message="根据剩余的线索平均分配到未分配线索的所有人" />
|
||||
平均分配
|
||||
</el-radio>
|
||||
<el-radio :label="0"> 权重分配 </el-radio>
|
||||
</el-radio-group>
|
||||
<div v-if="form.isRandom == 0">
|
||||
<div v-for="(item, index) in intentionOptions" :key="index" class="flex mb-10px">
|
||||
<div class="mr-15px" style="width: 100px">{{ item.label }}</div>
|
||||
<el-input v-model="item.value" type="number" placeholder="请输入权重">
|
||||
<template #suffix> % </template>
|
||||
</el-input>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="分配时间">
|
||||
<el-time-picker
|
||||
v-model="form.sendTime"
|
||||
placeholder="任意时间点"
|
||||
format="HH:mm"
|
||||
value-format="HH:mm"
|
||||
:clearable="false"
|
||||
/>
|
||||
</el-form-item>
|
||||
</div>
|
||||
<el-form-item>
|
||||
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||||
<el-button>重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup>
|
||||
const searchForm = ref({
|
||||
keyword: '',
|
||||
pageSize: 20,
|
||||
pageNum: 1
|
||||
})
|
||||
|
||||
const total = ref(1)
|
||||
|
||||
const userList = ref([{ name: '张三', phone: '1888888888', workNum: '202101030001' }])
|
||||
|
||||
const form = ref({
|
||||
isAuto: 1,
|
||||
users: [1, 2],
|
||||
@@ -85,23 +128,27 @@ const form = ref({
|
||||
})
|
||||
const rules = ref({})
|
||||
|
||||
const checkUserAll = ref(false)
|
||||
const userIndeterminate = ref(true)
|
||||
const userOptions = ref([
|
||||
{ label: '张三', value: 1 },
|
||||
{ label: '李四', value: 2 },
|
||||
{ label: '王二', value: 3 }
|
||||
])
|
||||
// const checkUserAll = ref(false)
|
||||
// const userIndeterminate = ref(true)
|
||||
// const userOptions = ref([
|
||||
// { label: '张三', value: 1 },
|
||||
// { label: '李四', value: 2 },
|
||||
// { label: '王二', value: 3 }
|
||||
// ])
|
||||
|
||||
function userCheckAllChange(val) {
|
||||
form.value.users = val ? userOptions.value.map((it) => it.value) : []
|
||||
userIndeterminate.value = false
|
||||
}
|
||||
// function userCheckAllChange(val) {
|
||||
// form.value.users = val ? userOptions.value.map((it) => it.value) : []
|
||||
// userIndeterminate.value = false
|
||||
// }
|
||||
|
||||
function userCheckedChange(val) {
|
||||
const checkedCount = val.length
|
||||
checkUserAll.value = checkedCount == userOptions.value.length
|
||||
userIndeterminate.value = checkedCount > 0 && checkedCount < userOptions.value.length
|
||||
// function userCheckedChange(val) {
|
||||
// const checkedCount = val.length
|
||||
// checkUserAll.value = checkedCount == userOptions.value.length
|
||||
// userIndeterminate.value = checkedCount > 0 && checkedCount < userOptions.value.length
|
||||
// }
|
||||
|
||||
function getUserList() {
|
||||
console.log('获取列表')
|
||||
}
|
||||
|
||||
function onSubmit() {
|
||||
@@ -133,6 +180,10 @@ const intentionOptions = ref([
|
||||
{ label: '低意向', value: 20 },
|
||||
{ label: '未知意向', value: 40 }
|
||||
])
|
||||
|
||||
function selectUser(row) {
|
||||
console.log(row)
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped></style>
|
||||
|
||||
Reference in New Issue
Block a user