123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659 |
- <template>
- <div class="app-container" style="padding: 0 20px 20px 20px">
- <!-- 顶部操作区域 -->
- <!-- <date-picker @prev-month="handlePrevMonth" @next-month="handleNextMonth" /> -->
- <!-- 筛选项 -->
- <div class="filter-container">
- <div class="filter-control">
- <span>标签词:</span>
- <el-input
- v-model="listQuery.remarks"
- placeholder="标签词"
- clearable
- style="width: 150px"
- @keyup.enter.native="getList"
- @clear="getList"
- />
- </div>
- <div class="filter-control">
- <span>机构名称:</span>
- <el-input
- v-model="listQuery.clubName"
- placeholder="机构名称"
- clearable
- @keyup.enter.native="getList"
- @clear="getList"
- />
- </div>
- <div class="filter-control">
- <span>咨询类别:</span>
- <el-select v-model="listQuery.consult" clearable style="width: 120px" @change="getList">
- <el-option value="" label="请选择" />
- <el-option v-for="(item, index) in categoryList" :key="index" :label="item.className" :value="item.id" />
- </el-select>
- </div>
- <div class="filter-control">
- <span>是否注册:</span>
- <el-select v-model="listQuery.isRegister" clearable style="width: 120px" @change="getList">
- <el-option value="" label="请选择" />
- <el-option :value="1" label="未注册" />
- <el-option :value="2" label="已注册" />
- </el-select>
- </div>
- <div class="filter-control">
- <span>新分配机构:</span>
- <el-select v-model="listQuery.newDeal" clearable style="width: 120px" @change="getList">
- <el-option value="" label="请选择" />
- <el-option :value="1" label="是" />
- <el-option :value="2" label="否" />
- </el-select>
- </div>
- <div class="filter-control">
- <span>提交时间:</span>
- <el-date-picker
- v-model="time"
- type="daterange"
- unlink-panels
- value-format="yyyy-MM-dd"
- range-separator="至"
- start-placeholder="开始日期"
- end-placeholder="结束日期"
- :picker-options="pickerOptions"
- @change="handleDatePick"
- />
- </div>
- <div class="filter-control">
- <el-button type="primary" @click="getList"> 查询 </el-button>
- </div>
- </div>
- <div class="filter-container">
- <span class="span-labels">
- 【查询时间内】咨询客户总数:
- <el-tag type="primary" size="small">
- {{ totalInfo.number }}
- </el-tag>
- </span>
- <span class="span-labels">
- 已注册客户总数:
- <el-tag type="primary" size="small">
- {{ totalInfo.registeredNumber }}
- </el-tag>
- </span>
- <span class="span-labels">
- 未注册客户总数:
- <el-tag type="primary" size="small">
- {{ totalInfo.unRegisteredNumber }}
- </el-tag>
- </span>
- </div>
- <div class="filter-container">
- <span
- v-for="(item, index) in serviceList"
- :key="index"
- style="margin-right: 15px; margin-bottom: 5px; display: inline-block"
- >
- <el-button :type="sellerTabsIndex === index ? 'primary' : ''" @click="handeleTabsClick(item, index)">
- {{ item.linkMan }}:
- {{ item.registeredNumber + item.unregisteredNumber }}
- ({{ item.registeredNumber }} +{{ item.unregisteredNumber }})
- </el-button>
- </span>
- </div>
- <div class="filter-container">
- <span class="span-labels">
- <el-tag type="primary" size="small">{{ sellerTabsInfo.linkMan }}</el-tag>
- 【查询时间内】咨询客户总数:
- <el-tag type="primary" size="small">
- {{ sellerTabsInfo.registeredNumber + sellerTabsInfo.unregisteredNumber }}
- </el-tag>
- </span>
- <span class="span-labels">
- 已注册客户总数:
- <el-tag type="primary" size="small">
- {{ sellerTabsInfo.registeredNumber }}
- </el-tag>
- </span>
- <span class="span-labels">
- 未注册客户总数:
- <el-tag type="primary" size="small">
- {{ sellerTabsInfo.unregisteredNumber }}
- </el-tag>
- </span>
- </div>
- <div class="filter-container">
- <template v-if="isLoading">
- <div class="list-loading">
- <p style="color: #ffffff"><i class="el-icon-loading"></i></p>
- </div>
- </template>
- <template v-else>
- <div v-if="list.length === 0" class="list-main-empty">
- <p style="color: #999999">暂无咨询记录</p>
- </div>
- <div v-for="(item, index) in list" v-else :key="index" class="list-main">
- <div class="list-main-item consult-list">
- <span class="list-time">{{ item.addTime }}</span>
- <el-row :gutter="24" class="box-row">
- <el-col v-if="item.clubName" :span="6"><b>机构:</b> {{ item.clubName }}</el-col>
- <el-col :span="6"><b>咨询人:</b> {{ item.questionMan }}</el-col>
- <el-col v-if="item.contractMobile" :span="12"><b>手机号:</b> {{ item.contractMobile }}</el-col>
- </el-row>
- <template v-if="item.product && item.product.length > 0">
- <el-row :gutter="24" class="box-row">
- <el-col :span="6"><b>咨询商品:</b></el-col>
- </el-row>
- <el-row :gutter="24" class="box-row">
- <el-col :span="24">
- <el-table :data="item.product" border width="1000">
- <el-table-column prop="mainImage" label="商品图片" align="center" width="100">
- <template slot-scope="{ row }">
- <el-popover placement="top-start" title="" width="180" trigger="hover">
- <img :src="row.mainImage" alt="" style="width: 150px; height: 150px" />
- <img slot="reference" :src="row.mainImage" alt="" style="width: 30px; height: 30px" />
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column prop="name" label="商品名称" align="center" />
- <el-table-column prop="shopName" label="供应商名称" align="center" />
- </el-table>
- </el-col>
- </el-row>
- </template>
- <template v-if="item.reports && item.reports.length > 0">
- <el-row :gutter="24" class="box-row">
- <el-col :span="6"><b>咨询报备:</b></el-col>
- </el-row>
- <el-row :gutter="24" class="box-row">
- <el-col :span="24">
- <el-table :data="item.reports" border width="1000">
- <el-table-column prop="mainImage" label="商品图片" align="center" width="100">
- <template slot-scope="{ row }">
- <el-popover placement="top-start" title="" width="180" trigger="hover">
- <img :src="row.mainImage" alt="" style="width: 150px; height: 150px" />
- <img slot="reference" :src="row.mainImage" alt="" style="width: 30px; height: 30px" />
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column prop="productName" label="商品名称" align="center" />
- <el-table-column prop="reportText" label="报备事由" align="center" />
- <el-table-column prop="status" label="审核状态" align="center" width="100">
- <template slot-scope="{ row }">
- <el-tag v-if="row.status === 1" type="warning" size="small">待审核</el-tag>
- <el-tag v-else-if="row.status === 2" type="success" size="small">已审核</el-tag>
- <el-tag v-else type="danger" size="small">审核未通过</el-tag>
- </template>
- </el-table-column>
- <el-table-column prop="auditName" label="审核人" align="center" width="100">
- <template slot-scope="{ row }">
- {{ row.auditName ? row.auditName : '---' }}
- </template>
- </el-table-column>
- <el-table-column prop="auditTime" label="审核时间" align="center">
- <template slot-scope="{ row }">
- {{ row.auditTime ? row.auditTime : '---' }}
- </template>
- </el-table-column>
- <el-table-column prop="auditText" label="备注" align="center">
- <template slot-scope="{ row }">
- {{ row.auditText ? row.auditText : '---' }}
- </template>
- </el-table-column>
- </el-table>
- </el-col>
- </el-row>
- </template>
- <el-row :gutter="24" class="box-row">
- <el-col :span="6">
- <b>沟通情况:</b>
- <el-tag v-if="item.communicationSituation === 1" type="danger" size="small"> 联系不上 </el-tag>
- <el-tag v-else type="success" size="small">
- 已沟通
- <template v-if="item.communicationMethods === '1'"> (电话) </template>
- <template v-if="item.communicationMethods === '2'"> (微信) </template>
- <template v-if="item.communicationMethods === '1,2' || item.communicationMethods === '2,1'">
- (电话,微信)
- </template>
- </el-tag>
- </el-col>
- <el-col v-if="item.customerSource !== null" :span="6">
- <b>客户来源:</b>
- <el-tag type="success" size="small">
- {{ item.customerSource | sourceActionsFilters }}
- </el-tag>
- </el-col>
- <el-col v-if="item.customerGender !== null" :span="6">
- <b>客户性别:</b>
- <el-tag v-if="item.customerGender === 0" type="success" size="small"> 男 </el-tag>
- <el-tag v-if="item.customerGender === 1" type="success" size="small"> 女 </el-tag>
- </el-col>
- </el-row>
- <el-row :gutter="24" class="box-row">
- <el-col v-if="item.customerAge" :span="6">
- <b>客户年龄:</b>
- <el-tag type="success" size="small"> {{ item.customerAge }} </el-tag>
- </el-col>
- <el-col :span="6">
- <b>加群情况:</b>
- <el-tag v-if="item.groupAddition === 0" type="success" size="small"> 已加群 </el-tag>
- <el-tag v-else type="danger" size="small"> 未加群 </el-tag>
- </el-col>
- <el-col v-if="item.consultType" :span="12">
- <b>咨询类别:</b>
- <el-tag
- v-for="(consultType, consultTypeIndex) in item.consultType.split(',')"
- :key="consultTypeIndex"
- style="margin: 0 1px"
- type="info"
- size="small"
- effect="dark"
- >
- {{ consultType }}
- </el-tag>
- </el-col>
- </el-row>
- <el-row :gutter="24" class="box-row">
- <el-col v-if="item.satisfied" :span="6">
- <b>意向程度:</b>
- <el-tag type="success" size="small"> {{ (item.satisfied * 1) | intenActionsFilters }} </el-tag>
- </el-col>
- <el-col v-if="item.pinceSensitve" :span="6">
- <b>价格敏感度:</b>
- <el-tag type="success" size="small"> {{ (item.pinceSensitve * 1) | pinceFilters }} </el-tag>
- </el-col>
- <el-col v-if="item.followup" :span="6">
- <b>跟进状态:</b>
- <el-tag type="success" size="small"> {{ (item.followup * 1) | followupFilters }} </el-tag>
- </el-col>
- </el-row>
- <el-row v-if="item.remarks" :gutter="24" class="box-row">
- <el-col :span="24">
- <b>标签词:</b>
- <el-tag
- v-for="(remarks, remarksIndex) in item.remarks.split(',')"
- :key="remarksIndex"
- style="margin: 0 1px"
- type="success"
- size="small"
- effect="dark"
- >
- {{ remarks }}
- </el-tag>
- </el-col>
- </el-row>
- <el-row v-if="item.extra" :gutter="24" class="box-row">
- <el-col :span="24">
- <b>额外说明:</b>
- {{ item.extra }}
- </el-col>
- </el-row>
- <el-row v-if="item.imageList.length > 0" :gutter="24" class="box-row">
- <el-col :span="24">
- <b>图片:</b>
- </el-col>
- <el-col :span="24">
- <div
- v-for="(image, imageIndex) in item.imageList"
- :key="imageIndex"
- class="item-image"
- style="width: 100px; height: 100px; margin: 5px; float: left"
- >
- <el-popover placement="top-start" title="" width="180" trigger="hover">
- <img :src="image" alt="" style="width: 150px; height: 150px" />
- <img slot="reference" :src="image" alt="" style="width: 100px; height: 100px" />
- </el-popover>
- </div>
- </el-col>
- </el-row>
- <el-row v-if="item.fileList.length > 0" :gutter="24" class="box-row">
- <el-col :span="24">
- <b>文件:</b>
- </el-col>
- <el-col :span="24">
- <div v-for="(file, fileIndex) in item.fileList" :key="fileIndex" class="item-file">
- <el-tag type="warning" size="small"> {{ file.fileName }} </el-tag>
- <el-button type="primary" size="mini" style="margin: 5px 10px" @click="handlePreview(file)">
- 预览
- </el-button>
- <el-button type="primary" size="mini" style="margin: 5px 10px" @click="handleDownload(file)">
- 下载
- </el-button>
- </div>
- </el-col>
- </el-row>
- </div>
- </div>
- </template>
- </div>
- <!-- 页码 -->
- <pagination
- :total="total"
- :page-sizes="[20]"
- :page-size="20"
- :page.sync="listQuery.pageNum"
- :limit.sync="listQuery.pageSize"
- @pagination="getRemarksRegistList"
- />
- </div>
- </template>
- <script>
- import { downloadWithUrl } from '@/utils'
- import openWindow from '@/utils/open-window'
- import { getClassName, getServiceList, getRemarksRegistList } from '@/api/user/consult/consult'
- // import DatePicker from './components/datePicker'
- import pickerOptions from '@/utils/time-picker.js'
- export default {
- name: 'ConsultList',
- components: {
- // DatePicker
- },
- filters: {
- followupFilters(value) {
- // 跟进状态
- const map = {
- 1: '跟进中',
- 2: '跟进完成',
- 3: '已放弃'
- }
- return map[value]
- },
- pinceFilters(value) {
- // 价格敏感度
- const map = {
- 1: '敏感',
- 2: '适中',
- 3: '不敏感',
- 4: '不明确'
- }
- return map[value]
- },
- intenActionsFilters(value) {
- // 意向
- const map = {
- 1: '意向强烈',
- 2: '意向一般',
- 3: '意向平淡',
- 4: '随便看看'
- }
- return map[value]
- },
- sourceActionsFilters(value) {
- // 客户来源
- console.log('value', value)
- const map = {
- 0: '搜素引擎',
- 1: '小程序',
- 2: '公众号',
- 3: '小红书',
- 4: '微博',
- 5: '搜狐',
- 7: '抖音',
- 8: '视频号',
- 9: '朋友推荐',
- 6: '其他'
- }
- return map[value]
- }
- },
- data() {
- return {
- time: '',
- pickerOptions,
- isLoading: true,
- listQuery: {
- remarks: '', // 标签词
- consult: '', // 咨询类别
- clubName: '', // 机构名称
- newDeal: '', // 新分配机构状态 0 全部 1 是 2否
- isRegister: '', // 是否注册 0 全部 1 未注册 2已注册
- startTime: '', // 开始时间
- endTime: '', // 结束时间
- serviceProviderId: '', // 协销Id
- pageNum: 1,
- pageSize: 20
- },
- freezeTimeText: '',
- list: [],
- total: 0,
- categoryList: [],
- totalInfo: {},
- sellerTabsIndex: 0,
- sellerTabsInfo: {},
- serviceList: []
- }
- },
- computed: {},
- created() {
- this.initDate()
- },
- mounted() {},
- methods: {
- initDate() {
- // 初始化获取当前年月
- this.getClassName()
- this.getServiceList(this.listQuery.startTime, this.listQuery.endTime)
- this.getList()
- },
- // 选择时间
- handleDatePick() {
- if (this.time && this.time.length > 0) {
- this.listQuery.startTime = this.time[0]
- this.listQuery.endTime = this.time[1]
- } else {
- this.listQuery.startTime = ''
- this.listQuery.endTime = ''
- }
- this.getServiceList(this.listQuery.startTime, this.listQuery.endTime)
- this.getList()
- },
- // 获取行为记录列表
- getList() {
- this.listQuery.pageNum = 1
- this.getRemarksRegistList()
- },
- // 获取咨询类别选项
- async getClassName() {
- try {
- const res = await getClassName()
- this.categoryList = res.data
- } catch (error) {
- console.log(error)
- }
- },
- // 获取当天协销咨询记录信息
- async getServiceList(startTime, endTime) {
- try {
- this.sellerTabsIndex = 0
- const res = await getServiceList({ startTime: startTime, endTime: endTime })
- this.serviceList = res.data.serviceList
- this.totalInfo = { ...this.totalInfo, ...res.data }
- this.sellerTabsInfo = this.serviceList[0]
- this.listQuery.serviceProviderId = this.serviceList[0].serviceProviderId
- this.getRemarksRegistList()
- } catch (error) {
- console.log(error)
- }
- },
- // 获取咨询记录
- async getRemarksRegistList() {
- try {
- this.isLoading = true
- if (this.time && this.time.length > 0) {
- this.listQuery.startTime = this.time[0]
- this.listQuery.endTime = this.time[1]
- } else {
- this.listQuery.startTime = ''
- this.listQuery.endTime = ''
- }
- const res = await getRemarksRegistList(this.listQuery)
- this.list = res.data.results
- this.total = res.data.totalRecord
- this.isLoading = false
- } catch (error) {
- console.log(error)
- }
- },
- // 预览文件
- handlePreview(file) {
- const fileName = file.fileName
- let url = `https://view.officeapps.live.com/op/view.aspx?src=${encodeURIComponent(file.fileUrl)}`
- if (fileName.endsWith('.pdf') || fileName.endsWith('.doc')) {
- url = file.fileUrl
- }
- openWindow(url, `${file.fileName}`, 800, 460)
- },
- // 下载文件
- async handleDownload(file) {
- const params = `fileName=${encodeURIComponent(file.fileName)}&ossName=${encodeURIComponent(file.ossName)}`
- const url = process.env.VUE_APP_BASE_API + `/user/remarks/remarks/download?${params}`
- downloadWithUrl(url, file.fileName)
- },
- // 机构跳转
- handleClubHrefLink(row) {
- return (
- process.env.VUE_APP_ADMIN_URL +
- `/a/user/jumpLink/toOldAdmin?type=1&clubId=${row.clubId}&clubName=${row.corporateName}`
- )
- },
- // 查看详情
- handleRecordDetail(row) {
- this.$router.push({
- path: '/user/detail-list',
- query: { ip: row.ip, accessDate: row.accessDate, userId: row.userId }
- })
- },
- formattedDateFn(dateString) {
- // 创建一个Date对象,将字符串解析为日期和时间
- const date = new Date(dateString)
- // 使用toISOString()方法将Date对象转换为ISO格式的字符串
- const isoString = date.toISOString()
- // 从ISO格式字符串中提取日期部分
- const dateOnly = isoString.substring(0, isoString.indexOf('T'))
- // 将日期格式化为"YYYY-MM-DD"格式
- const formattedDate = dateOnly.replace(/-/g, '-')
- return formattedDate
- },
- handleNextMonth(value) {
- // 加日期
- this.listQuery.todayTime = value
- this.getServiceList(this.listQuery.todayTime)
- this.getList()
- console.log('todayTime', this.listQuery.todayTime)
- },
- handlePrevMonth(value) {
- // 减日期
- this.listQuery.todayTime = value
- this.getServiceList(this.listQuery.todayTime)
- this.getList()
- console.log('todayTime', this.listQuery.todayTime)
- },
- handeleTabsClick(item, index) {
- // 切换协销
- console.log('item', item)
- this.sellerTabsIndex = index
- this.sellerTabsInfo = item
- this.listQuery.serviceProviderId = item.serviceProviderId
- this.listQuery.pageNum = 1
- this.getList()
- }
- }
- }
- </script>
- <style>
- .filter-container {
- padding: 10px;
- background: #f7f7f7;
- margin: 10px 0;
- }
- .span-labels {
- font-size: 14px;
- color: #666666;
- margin-right: 50px;
- }
- .list-loading {
- width: 100%;
- height: 300px;
- padding: 40px;
- line-height: 220px;
- box-sizing: border-box;
- position: relative;
- text-align: center;
- background: #ffffff;
- }
- .list-loading .el-icon-loading {
- font-size: 40px;
- color: #409eff;
- }
- .list-main-empty {
- width: 100%;
- height: 300px;
- padding: 40px;
- line-height: 220px;
- box-sizing: border-box;
- position: relative;
- text-align: center;
- }
- .list-main {
- width: 100%;
- height: auto;
- padding: 24px 16px 24px 160px;
- box-sizing: border-box;
- position: relative;
- }
- .list-main::before {
- content: '';
- height: 100%;
- border-left: 2px dashed #e1e1e1;
- position: absolute;
- left: 120px;
- top: 0;
- }
- .list-main-item {
- width: 94%;
- min-height: 200px;
- box-sizing: border-box;
- padding: 24px 35px;
- background: #e1e1e1;
- background-size: cover;
- position: relative;
- border-radius: 16px;
- }
- .list-main-item::before {
- content: '';
- width: 20px;
- height: 20px;
- background: #999999;
- border-radius: 50%;
- background-size: cover;
- position: absolute;
- top: 30px;
- left: -49px;
- }
- .list-main-item::after {
- content: '';
- width: 0;
- height: 0;
- border-width: 30px;
- border-style: solid;
- border-color: transparent #e1e1e1 transparent transparent;
- position: absolute;
- left: -55px;
- top: 10px;
- }
- .list-main-item.consult-list .list-time {
- display: inline-block;
- font-size: 20px;
- color: #333333;
- position: absolute;
- top: 7px;
- left: -164px;
- font-weight: bold;
- width: 120px;
- text-align: center;
- }
- .box-row {
- margin-bottom: 14px;
- }
- </style>
|