管理系统PC前端
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.
dm-manage-web/src/views/zs/clue/components/SearchForm.vue

142 lines
4.8 KiB

2 years ago
<template>
<div>
2 years ago
<el-form ref="searchForm" :model="searchForm" inline size="mini">
2 years ago
<el-form-item label="筛选:" label-width="90px">
<DMRadio v-model="searchForm.quickSearch" :list="quickList" all-text="全部" @change="$emit('search')" />
</el-form-item>
<el-form-item label="意向状态:" label-width="90px">
<DMRadio v-model="searchForm.intentionState" :list="intentionOptions" all-text="全部" @change="$emit('search')" />
</el-form-item>
1 year ago
<el-form-item label="反馈状态:" label-width="90px">
<DMRadio v-model="searchForm.feedbackStatus" :list="feedbackTagOptions" all-text="全部" @change="$emit('search')" />
</el-form-item>
2 years ago
<el-row>
<el-form-item label="姓名/联系方式">
<el-input v-model="searchForm.name" placeholder="姓名/联系方式" clearable style="width: 200px" />
</el-form-item>
<el-form-item label="线索来源">
<el-select v-model="searchForm.source" placeholder="选择线索来源" clearable>
<el-option v-for="dict in sourceOptions" :key="dict.dictValue" :value="dict.dictValue" />
</el-select>
</el-form-item>
<el-form-item label="跟进人员">
<el-select v-model="searchForm.followUser2" placeholder="选择跟进人员" filterable clearable>
<el-option v-for="dict in userOptions" :key="dict.id" :label="dict.name" :value="dict.id" />
</el-select>
</el-form-item>
<el-form-item label="创建时间">
2 years ago
<el-date-picker v-model="createDateRange" style="width: 240px" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="pickDateChange" />
</el-form-item>
<el-form-item label="下次跟进日期">
<el-date-picker v-model="nextDateRange" style="width: 240px" type="daterange" range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期" @change="nextDateChange" />
2 years ago
</el-form-item>
<el-form-item label-width="0">
<el-button type="primary" icon="el-icon-search" @click="$emit('search')">搜索</el-button>
<el-button icon="el-icon-refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-row>
</el-form>
2 years ago
</div>
</template>
<script>
2 years ago
import DMRadio from '@/components/DMRadio';
2 years ago
export default {
2 years ago
components: {
DMRadio
},
props: {
userOptions: {
type: Array,
2 years ago
default: () => ([])
2 years ago
},
sourceOptions: {
type: Array,
2 years ago
default: () => ([])
2 years ago
},
2 years ago
form: {
type: Object,
default: () => ({})
}
2 years ago
},
data() {
return {
2 years ago
searchForm: { ...this.form },
2 years ago
quickList: [
{ value: 1, label: '我创建的' },
{ value: 2, label: '我的有效' },
{ value: 3, label: '有效线索' },
{ value: 4, label: '今日有效线索' },
{ value: 5, label: '今日跟踪' },
{ value: 6, label: '过期线索' },
{ value: 7, label: '相关线索' },
{ value: 8, label: '撞单线索' }
],
intentionOptions: [],
2 years ago
createDateRange: [],
1 year ago
nextDateRange: [],
feedbackTagOptions: [
{ value: 0, label: '待邀约' },
{ value: 1, label: '待分发' },
{ value: 2, label: '待跟进' },
{ value: 3, label: '待到场' },
{ value: 4, label: '已到场' }
],
2 years ago
};
},
watch: {
searchForm: {
handler(val) {
this.$emit('update:form', val);
},
deep: true
2 years ago
}
},
created() {
// 意向状态
this.getDicts('dm_intention_state').then((response) => {
2 years ago
const list = response.data;
this.intentionOptions = [];
2 years ago
list.map(item => {
this.intentionOptions.push({
value: item.dictValue,
label: item.dictLabel
2 years ago
});
});
});
2 years ago
},
methods: {
resetQuery() {
this.searchForm = {
name: undefined,
intentionState: undefined,
followUser2: undefined,
source: undefined,
quickSearch: undefined,
total: 0
};
2 years ago
this.createDateRange = [];
this.nextDateRange = [];
2 years ago
},
pickDateChange() {
2 years ago
if (this.createDateRange && this.createDateRange.length > 0) {
2 years ago
this.searchForm.createDateStart = this.createDateRange[0];
this.searchForm.createDateEnd = this.createDateRange[1];
} else {
this.searchForm.createDateStart = undefined;
this.searchForm.createDateEnd = undefined;
}
},
nextDateChange() {
2 years ago
if (this.nextDateRange && this.nextDateRange.length > 0) {
2 years ago
this.searchForm.nextDateStart = this.nextDateRange[0];
this.searchForm.nextDateEnd = this.nextDateRange[1];
} else {
this.searchForm.nextDateStart = undefined;
this.searchForm.nextDateEnd = undefined;
}
2 years ago
}
2 years ago
}
};
2 years ago
</script>