<template>
|
<div class="edit-selClient-box">
|
<el-dialog
|
:title="'销售线索'"
|
:visible.sync="editConfig.editVisible"
|
:width="dialogWidth"
|
:before-close="handleClose"
|
:append-to-body="true"
|
:close-on-click-modal="false"
|
>
|
<div class="bg-view">
|
<div class="query-bg">
|
<SearchCommonView
|
ref="searchCommonView"
|
:search-options="searchOptions"
|
@searchClick="searchClick"
|
@resetClick="resetClick"
|
/>
|
</div>
|
<el-table
|
:data="tableData"
|
border
|
size="mini"
|
v-loading="loading"
|
:header-cell-style="{ background: '#f7f7f7' }"
|
>
|
<el-table-column label="客户名称" prop="name" show-overflow-tooltip>
|
<template slot-scope="scope">
|
<span class="sel-name" @click="selNameClick(scope.row)">{{ scope.row.name }}</span>
|
</template>
|
</el-table-column>
|
<el-table-column label="商机状态" prop="businessStatus"></el-table-column>
|
<el-table-column label="商机来源" prop="sales_sources_id"></el-table-column>
|
<div slot="empty">
|
<el-empty :image-size="100"></el-empty>
|
</div>
|
</el-table>
|
<div slot="footer" class="dialog-footer">
|
<!-- <div class="remark">说明:支持多字段模糊查询,仅显示符合条件的前5条数据</div> -->
|
<div class="btn-pager">
|
<PagerView class="page" :pager-options="pagerOptions" v-on="pagerEvents" />
|
</div>
|
</div>
|
</div>
|
</el-dialog>
|
</div>
|
</template>
|
|
<script>
|
import { getSalesLeadsList } from "@/api/client/salesLead"
|
import pageMixin from "@/components/makepager/pager/mixin/pageMixin"
|
export default {
|
name: "EditSelChanceDialog",
|
mixins: [pageMixin],
|
props: {
|
editCommonConfig: {
|
type: Object,
|
default: () => {
|
return {
|
editVisible: false,
|
title: "",
|
infomation: {},
|
search_map:{},
|
}
|
}
|
}
|
},
|
components: {},
|
computed: {},
|
data() {
|
return {
|
dialogWidth: "50%",
|
editConfig: this.editCommonConfig,
|
queryInput: "",
|
select: "1",
|
tableData: [],
|
searchSelOptions: [],
|
loading: false,
|
searchOptions: [
|
{ value: "name", label: "客户名称" },
|
{ value: "businessStatus", label: "商机状态" },
|
{ value: "sales_sources_id", label: "商机来源" }
|
]
|
}
|
},
|
created() {
|
this.getData()
|
},
|
methods: {
|
handleClose() {
|
this.editConfig.editVisible = false
|
},
|
// 请求数据
|
async getData() {
|
this.loading = true
|
await getSalesLeadsList({
|
search_map: this.editCommonConfig.search_map,
|
page: this.pagerOptions.currPage,
|
pageSize: this.pagerOptions.pageSize
|
})
|
.then((res) => {
|
console.log(res)
|
if (res.code === 200) {
|
if (res.data.list && res.data.list.length > 0) {
|
const list = res.data.list.map((item) => {
|
return {
|
...item
|
}
|
})
|
this.tableData = list || []
|
this.pagerOptions.totalCount = res.data.count
|
} else {
|
this.tableData = []
|
}
|
} else {
|
this.tableData = []
|
}
|
this.loading = false
|
})
|
.catch((err) => {
|
console.log(err)
|
this.tableData = []
|
this.loading = false
|
})
|
},
|
selNameClick(row) {
|
this.editConfig.editVisible = false
|
console.log(row)
|
this.$emit("selClient", row, "lead")
|
},
|
// 搜索
|
searchClick(val, content) {
|
console.log(val, content)
|
this.search_map = {
|
[val.value]: content
|
}
|
this.getData()
|
},
|
resetClick() {
|
this.search_map = {}
|
this.getData()
|
}
|
}
|
}
|
</script>
|
|
<!-- Add "scoped" attribute to limit CSS to this component only -->
|
<style lang="scss" scoped>
|
.bg-view {
|
margin: 10px;
|
.query-bg {
|
margin-bottom: 10px;
|
display: flex;
|
justify-content: space-between;
|
.el-input {
|
width: 310px;
|
.el-select {
|
width: 100px;
|
}
|
}
|
.btn {
|
float: right;
|
}
|
}
|
}
|
.sel-name {
|
color: $color-primary;
|
cursor: pointer;
|
}
|
.dialog-footer {
|
height: 50px;
|
line-height: 50px;
|
color: red;
|
.btn-pager {
|
display: flex;
|
margin-top: 0px;
|
.page {
|
margin-left: auto;
|
}
|
}
|
}
|
::v-deep {
|
.input-with-select .el-input-group__prepend {
|
background-color: #fff;
|
}
|
}
|
</style>
|