You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
139 lines
4.1 KiB
139 lines
4.1 KiB
![]()
1 year ago
|
<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>
|
||
|
<el-form-item>
|
||
|
<el-button type="primary" @click="onSubmit">保存</el-button>
|
||
|
<el-button>重置</el-button>
|
||
|
</el-form-item>
|
||
|
</el-form>
|
||
|
</template>
|
||
|
|
||
|
<script setup>
|
||
|
const form = ref({
|
||
|
isAuto: 1,
|
||
|
users: [1, 2],
|
||
|
resource: [3],
|
||
|
sendTime: '00:00'
|
||
|
})
|
||
|
const rules = ref({})
|
||
|
|
||
|
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 userCheckedChange(val) {
|
||
|
const checkedCount = val.length
|
||
|
checkUserAll.value = checkedCount == userOptions.value.length
|
||
|
userIndeterminate.value = checkedCount > 0 && checkedCount < userOptions.value.length
|
||
|
}
|
||
|
|
||
|
function onSubmit() {
|
||
|
console.log('hhahah')
|
||
|
}
|
||
|
|
||
|
const checkResourceAll = ref(false)
|
||
|
const resourceIndeterminate = ref(true)
|
||
|
const resourceOptions = ref([
|
||
|
{ label: '抖音', value: 1 },
|
||
|
{ label: '一点通', value: 2 },
|
||
|
{ label: '驾考宝典', value: 3 }
|
||
|
])
|
||
|
|
||
|
function resourceCheckAllChange(val) {
|
||
|
form.value.resource = val ? resourceOptions.value.map((it) => it.value) : []
|
||
|
resourceIndeterminate.value = false
|
||
|
}
|
||
|
|
||
|
function resourceCheckedChange(val) {
|
||
|
const checkedCount = val.length
|
||
|
checkResourceAll.value = checkedCount == resourceOptions.value.length
|
||
|
resourceIndeterminate.value = checkedCount > 0 && checkedCount < resourceOptions.value.length
|
||
|
}
|
||
|
|
||
|
const intentionOptions = ref([
|
||
|
{ label: '高意向', value: 20 },
|
||
|
{ label: '中意向', value: 20 },
|
||
|
{ label: '低意向', value: 20 },
|
||
|
{ label: '未知意向', value: 40 }
|
||
|
])
|
||
|
</script>
|
||
|
|
||
|
<style lang="scss" scoped></style>
|