|
@@ -1,1427 +0,0 @@
|
|
|
-<template>
|
|
|
- <div class="p-2">
|
|
|
- <a-row class="r1" :gutter="8">
|
|
|
- <a-col :xl="7" :xxl="6" v-if="siteList.length > 1">
|
|
|
- <div class="choose-site">
|
|
|
- <span class="t1">站点:</span>
|
|
|
- <select-site @comMethods="changeSite"/>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- <a-col :xl="8" :xxl="6">
|
|
|
- <div class="choose-site">
|
|
|
- <span class="t1">询盘时间:</span>
|
|
|
- <a-range-picker @change="onChangeDatePciker" :disabledDate="disabledDate"
|
|
|
- :value="rangeDate" style="width:70%"/>
|
|
|
- </div>
|
|
|
- </a-col>
|
|
|
- <a-col :xl="9" :xxl="12">
|
|
|
- <a-button :class="queryParam.dateType == '' ? 'active' : ''" @click="setTime('')">全部时间
|
|
|
- </a-button>
|
|
|
- <a-button :class="queryParam.dateType == 'thirtyDay' ? 'active' : ''"
|
|
|
- @click="setTime('thirtyDay')">近30天
|
|
|
- </a-button>
|
|
|
- <a-button :class="queryParam.dateType == 'sevenDay' ? 'active' : ''"
|
|
|
- @click="setTime('sevenDay')">近一周
|
|
|
- </a-button>
|
|
|
- <a-button :class="queryParam.dateType == 'yesterday' ? 'active' : ''"
|
|
|
- @click="setTime('yesterday')">昨日
|
|
|
- </a-button>
|
|
|
- <a-button :class="queryParam.dateType == 'today' ? 'active' : ''" @click="setTime('today')">
|
|
|
- 今日
|
|
|
- </a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
-
|
|
|
- <a-row class="r2">
|
|
|
- <a-col :span="8">
|
|
|
- <p class="t1"><img :src="toReadImg"/>待阅读询盘</p>
|
|
|
- <p class="t2" @click="getList('noRead')">{{ enquiryNums.noRead }}</p>
|
|
|
- </a-col>
|
|
|
- <a-col :span="8">
|
|
|
- <p class="t1"><img :src="toClassified"/>待分类询盘</p>
|
|
|
- <p class="t2" @click="getList('wait')">{{ enquiryNums.wait }}</p>
|
|
|
- </a-col>
|
|
|
- <a-col :span="8">
|
|
|
- <p class="t1"><img :src="toTotal"/>累计询盘</p>
|
|
|
- <p class="t2" @click="getList('all')">{{ enquiryNums.all }}</p>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
-
|
|
|
- <a-row class="r3" type="flex" :gutter="8">
|
|
|
- <a-col flex="2">
|
|
|
- <a-input placeholder="邮箱/姓名/国家" v-model="queryParam.searchText"></a-input>
|
|
|
- </a-col>
|
|
|
- <a-col flex="2">
|
|
|
- <a-input placeholder="询盘内容" v-model="queryParam.searchContent"></a-input>
|
|
|
- </a-col>
|
|
|
- <a-col flex="2">
|
|
|
- <a-select v-model="queryParam.userEffective"
|
|
|
- :allowClear="true"
|
|
|
- placeholder="全部分类"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <a-select-option :key="2" :value="2">待分类</a-select-option>
|
|
|
- <a-select-option :key="1" :value="1">有效询盘</a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-col>
|
|
|
- <a-col flex="2">
|
|
|
- <a-select v-model="queryParam.readStatus"
|
|
|
- :allowClear="true"
|
|
|
- placeholder="全部阅读状态"
|
|
|
- style="width: 100%"
|
|
|
- >
|
|
|
- <a-select-option value="0">
|
|
|
- 未读
|
|
|
- </a-select-option>
|
|
|
- <a-select-option value="1">
|
|
|
- 已读
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-col>
|
|
|
- <a-col v-if="haveSubAccount" flex="2">
|
|
|
- <a-select placeholder="全部跟进人"
|
|
|
- v-model="queryParam.principalUid"
|
|
|
- showSearch
|
|
|
- allowClear
|
|
|
- style="width: 100%"
|
|
|
- :filterOption="filterOption">
|
|
|
- <a-select-option key="ALL" value="ALL">所有人</a-select-option>
|
|
|
- <a-select-option v-for="principal in subAccountOptions" :key="principal.id"
|
|
|
- :value="principal.id">
|
|
|
- {{ principal.username }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </a-col>
|
|
|
- <a-col flex="500px" style="text-align:right">
|
|
|
- <a-button type="primary" @click="searchQuery">查询</a-button>
|
|
|
- <a-button ghost type="primary" @click="searchReset" style="margin-left: 8px">重置</a-button>
|
|
|
- <a-button ghost type="primary" @click="handleExportXlsLU('询盘列表')"
|
|
|
- style="margin-left: 8px" :loading="excelLoading">导出Excel
|
|
|
- </a-button>
|
|
|
- <a-button ghost type="primary" @click="recycleBinVisible" style="margin-left: 8px">回收站
|
|
|
- </a-button>
|
|
|
- <a-button ghost type="primary" @click="showBlackList" style="margin-left: 8px">黑名单
|
|
|
- </a-button>
|
|
|
- </a-col>
|
|
|
- </a-row>
|
|
|
-
|
|
|
- <a-flex class="r4" vertical>
|
|
|
-
|
|
|
- <div class="ant-alert ant-alert-info" style="margin-bottom: 16px;">
|
|
|
- <i class="anticon anticon-info-circle ant-alert-icon"></i>已选择<a style="font-weight: 600">{{
|
|
|
- selectedRowKeys.length
|
|
|
- }}</a>项
|
|
|
- <a style="margin-left: 24px" @click="onClearSelected">清空</a>
|
|
|
- <a @click="enquiryReady" style="margin-left: 24px">标为已读</a>
|
|
|
- <a v-if="haveSubAccount && siteCode !== dictSiteCode"
|
|
|
- :style="(userRole.indexOf('admin') > -1 || userRole.indexOf('adweb_admin') > -1 || userRole.indexOf('adweb_seo_manager') > -1 || userRole.indexOf('adweb_site_manager') > -1) ? 'margin-left: 24px;pointer-events: none;' : 'margin-left: 24px;'"
|
|
|
- @click="showEditPrincipalModal">
|
|
|
- 调整跟进人
|
|
|
- </a>
|
|
|
- <a v-if="siteCode === dictSiteCode" @click="forwardDetailAll" style="margin-left: 24px">
|
|
|
- 转发
|
|
|
- </a>
|
|
|
- <a @click="enquiryDeleteAll" style="margin-left: 24px">删除</a>
|
|
|
- </div>
|
|
|
-
|
|
|
- <a-table
|
|
|
- :columns="defColumns"
|
|
|
- :data-source="dataSource"
|
|
|
- size="middle"
|
|
|
- :scroll="{x:true}"
|
|
|
- :rowKey="record => record.id"
|
|
|
- :pagination="ipagination"
|
|
|
- :loading="loading"
|
|
|
- class="j-table-force-nowrap"
|
|
|
- :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
|
|
|
- @change="handleTableChange"
|
|
|
- >
|
|
|
- <template slot="readStatus" slot-scope="text,record">
|
|
|
- <a v-if="text == 0" class="theme-color" @click="enquiryDetail(record)">未读</a>
|
|
|
- <span v-else>已读</span>
|
|
|
- </template>
|
|
|
- <template slot="principalUidSlot" slot-scope="text,record">
|
|
|
- <a-select placeholder="请选择跟进人"
|
|
|
- v-model="record.principalUid"
|
|
|
- style="width: 180px;"
|
|
|
- showSearch
|
|
|
- :filterOption="filterOption"
|
|
|
- @change="selectPrincipal(record)"
|
|
|
- :disabled="userRole.indexOf('admin') > -1 || userRole.indexOf('adweb_admin') > -1 || userRole.indexOf('adweb_seo_manager') > -1 || userRole.indexOf('adweb_site_manager') > -1 || siteCode === dictSiteCode">
|
|
|
- <a-select-option key="ALL" value="ALL">所有人</a-select-option>
|
|
|
- <a-select-option v-for="principal in subAccountOptions" :key="principal.id"
|
|
|
- :value="principal.id">
|
|
|
- {{ principal.username }}
|
|
|
- </a-select-option>
|
|
|
- </a-select>
|
|
|
- </template>
|
|
|
- <template slot="tips" slot-scope="text">
|
|
|
- <template v-if="!text">-</template>
|
|
|
- <template v-else-if="text.indexOf('http') < 0">-</template>
|
|
|
- <template v-else-if="text.indexOf('http') === 0">
|
|
|
- <template v-if="text.lastIndexOf('/') <= 7">
|
|
|
- <a v-if="edition === 1" :href="text" target="_blank"
|
|
|
- style="text-decoration: underline">Home</a>
|
|
|
- <span v-else>Home</span>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <a v-if="edition === 1" :href="text" target="_blank"
|
|
|
- style="text-decoration: underline">{{
|
|
|
- text.substring(text.lastIndexOf('/') + 1).slice(0, 45) + (text.substring(text.lastIndexOf('/') + 1).length > 45 ? "..." : "")
|
|
|
- }}</a>
|
|
|
- <span v-else>{{ text.substring(text.lastIndexOf('/') + 1) }}</span>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-else-if="text.indexOf('http') > 0">
|
|
|
- <a v-if="edition === 1" :href="text.substring(text.indexOf('http'))" target="_blank"
|
|
|
- style="text-decoration: underline">{{
|
|
|
- text.substring(0, text.indexOf('http')).slice(0, 45) + (text.substring(0, text.indexOf('http')).length > 45 ? "..." : "")
|
|
|
- }}</a>
|
|
|
- <span v-else>{{ text.substring(0, text.indexOf('http')) }}</span>
|
|
|
- </template>
|
|
|
- <template v-else>-</template>
|
|
|
- </template>
|
|
|
-
|
|
|
- <template slot="userEffective" slot-scope="text, record">
|
|
|
- <a class="theme-color" v-if="text === 2"
|
|
|
- @click="enquiryDetail(record)">{{ record.userEffectiveStr }}</a>
|
|
|
- <span v-else-if="text == 0" style="color: #fa8c16">{{ record.userEffectiveStr }}</span>
|
|
|
- <span v-else>{{ record.userEffectiveStr }}</span>
|
|
|
- </template>
|
|
|
-
|
|
|
- <div slot="action" slot-scope="text, record" style="padding: 5px 8px;">
|
|
|
- <a-tag v-if="siteCode === dictSiteCode" color="blue" @click="forwardDetail(record)"
|
|
|
- style="cursor:pointer;">
|
|
|
- 转发
|
|
|
- </a-tag>
|
|
|
- <a-tag color="purple" @click="enquiryDetail(record)" style="cursor:pointer;">
|
|
|
- 详情
|
|
|
- </a-tag>
|
|
|
- <a-popconfirm
|
|
|
- title="确认拒收后,该用户会归入【黑名单】,后期不再接收该用户的询盘信息~"
|
|
|
- ok-text="是"
|
|
|
- cancel-text="否"
|
|
|
- placement="topRight"
|
|
|
- @confirm="enquiryAddBlackList(record)"
|
|
|
- >
|
|
|
- <a-tag color="orange" style="cursor:pointer;">
|
|
|
- 拒收
|
|
|
- </a-tag>
|
|
|
- </a-popconfirm>
|
|
|
- <a-tag color="green" @click="enquiryRecord(record)" style="cursor:pointer;">
|
|
|
- 跟踪
|
|
|
- </a-tag>
|
|
|
- <a-tag color="blue"
|
|
|
- v-if='record.visitId !== null && record.visitId !== "" && record.visitId !== undefined'
|
|
|
- style="cursor:pointer;" @click="enquiryTrack(record)">
|
|
|
- 访问记录
|
|
|
- </a-tag>
|
|
|
- </div>
|
|
|
- <div slot="contactSlot" slot-scope="text, record">
|
|
|
- <div style="width: 150px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis">
|
|
|
- {{ text }}
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- <div slot="filterDropdown">
|
|
|
- <a-card>
|
|
|
- <a-checkbox-group @change="onColSettingsChange" v-model="settingColumns"
|
|
|
- :defaultValue="settingColumns">
|
|
|
- <a-row>
|
|
|
- <template v-for="(item,index) in columns" v-if="item.dataIndex != 'pluginName'">
|
|
|
- <template v-if="item.dataIndex === 'action'"></template>
|
|
|
- <template v-else-if="item.dataIndex === 'principalUid'">
|
|
|
- <template v-if="haveSubAccount">
|
|
|
- <a-col :span="12">
|
|
|
- <a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox>
|
|
|
- </a-col>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-else-if="item.dataIndex === 'siteName'">
|
|
|
- <template
|
|
|
- v-if="siteList !== null && siteList !== undefined && siteList.length >= 2">
|
|
|
- <a-col :span="12">
|
|
|
- <a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox>
|
|
|
- </a-col>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- <template v-else>
|
|
|
- <a-col :span="12">
|
|
|
- <a-checkbox :value="item.dataIndex">{{ item.title }}</a-checkbox>
|
|
|
- </a-col>
|
|
|
- </template>
|
|
|
- </template>
|
|
|
- </a-row>
|
|
|
- </a-checkbox-group>
|
|
|
- </a-card>
|
|
|
- </div>
|
|
|
- <div slot="copyEmail" slot-scope="text, record">
|
|
|
- <a-popover>
|
|
|
- <template slot="content">
|
|
|
- {{ text }}
|
|
|
- </template>
|
|
|
- <a @click.prevent="copyEmailFunction(text)" :href="'mailto:'+text"
|
|
|
- v-if="text">{{ text.slice(0, 30) + (text.length > 30 ? "..." : "") }}</a>
|
|
|
- <div v-else>--</div>
|
|
|
- </a-popover>
|
|
|
- </div>
|
|
|
-
|
|
|
- <div slot="detailsSlot" slot-scope="text, record">
|
|
|
- <a @click="enquiryDetail(record)" style="margin: 0 10px 0 10px">
|
|
|
- {{record.context ? record.context.substr(0, 50) : '--'}}</a>
|
|
|
- </div>
|
|
|
-
|
|
|
- <a-icon slot="filterIcon" type='setting' :style="{ fontSize:'16px',color: '#108ee9' }"/>
|
|
|
- </a-table>
|
|
|
- </a-flex>
|
|
|
-
|
|
|
- <!--访问记录-->
|
|
|
- <enquiry-track ref="enquiryTrack"></enquiry-track>
|
|
|
- <!--跟踪记录-->
|
|
|
- <enquiry-genzong ref="enquiryGenzong"></enquiry-genzong>
|
|
|
- <!--回收站-->
|
|
|
- <xp-recycle-bin-modal ref="XpRecycleBinModal" @ok="getTableAndNum"/>
|
|
|
- <!--询盘详情 reload用于子组件删除询盘功能刷新父组件table showDelBtn用于展示删除按钮-->
|
|
|
- <enquiry-detail :userEffectiveOption="userEffectiveOption" :showDelBtn="true"
|
|
|
- @reload="getTableAndNum()" @ok="getTableAndNum"
|
|
|
- ref="enquiryDetail"></enquiry-detail>
|
|
|
- <!--黑名单-->
|
|
|
- <black-list ref="blackList" @ok="getTableAndNum"></black-list>
|
|
|
- <!-- 调整产品跟进人 -->
|
|
|
- <a-modal
|
|
|
- title="跟进人"
|
|
|
- :visible="modalVisible"
|
|
|
- @ok="editPrincipal"
|
|
|
- @cancel="cancelEditPrincipal"
|
|
|
- >
|
|
|
- <a-radio-group v-model="selectedUserId">
|
|
|
- <a-radio :style="radioStyle" value="ALL">
|
|
|
- 所有人
|
|
|
- </a-radio>
|
|
|
- <a-radio v-for="item in subAccountOptions" :style="radioStyle" :value="item.id">
|
|
|
- {{ item.username }}
|
|
|
- </a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </a-modal>
|
|
|
-
|
|
|
- <!-- 转发询盘 -->
|
|
|
- <a-modal
|
|
|
- title="转发"
|
|
|
- :visible="forwardVisible"
|
|
|
- @ok="editForward"
|
|
|
- @cancel="cancelEditForward"
|
|
|
- :confirm-loading="forwardLoading"
|
|
|
- >
|
|
|
- <a-radio-group v-model="selectedUserId">
|
|
|
- <!-- <a-radio :style="radioStyle" value="ALL">-->
|
|
|
- <!-- 所有人-->
|
|
|
- <!-- </a-radio>-->
|
|
|
- <a-radio v-for="item in otherSubAccountOptions" :style="radioStyle" :value="item.id">
|
|
|
- {{ item.username }}
|
|
|
- </a-radio>
|
|
|
- </a-radio-group>
|
|
|
- </a-modal>
|
|
|
- </div>
|
|
|
-
|
|
|
-</template>
|
|
|
-
|
|
|
-<script>
|
|
|
-import toReadImg from '/@/assets/enquiry/enquiryListTop3.svg';
|
|
|
-import toClassified from '/@/assets/enquiry/enquiryListTop2.svg';
|
|
|
-import toTotal from '/@/assets/enquiry/enquiryListTop4.svg';
|
|
|
-
|
|
|
-import {postAction, getAction, downFile, putAction} from '/@/api/manage/manage'
|
|
|
-import {JeecgListMixin} from '/@/hooks/component/JeecgListMixin'
|
|
|
-import enquiryTrack from '/@/views/adweb/enquiry/modules/enquiryTrack.vue'
|
|
|
-import enquiryGenzong from '/src/views/adweb/enquiry/modules/enquiryTrackRecord.vue'
|
|
|
-import enquiryDetail from '/@/views/adweb/enquiry/modules/enquiryDetail.vue'
|
|
|
-import XpRecycleBinModal from '/@/views/adweb/system/modules/XpRecycleBinModal.vue'
|
|
|
-import blackList from '/@/views/adweb/enquiry/modules/blackList.vue'
|
|
|
-import Qs from 'qs'
|
|
|
-import selectSite from '/@/components/adweb/selectSite.vue'
|
|
|
-import '/@/assets/less/common.less'
|
|
|
-import moment from 'moment'
|
|
|
-import {useUserStore} from "@/store/modules/user";
|
|
|
-import {createLocalStorage} from "@/utils/cache";
|
|
|
-import {useMessage} from "@/hooks/web/useMessage";
|
|
|
-
|
|
|
-const $ls = createLocalStorage();
|
|
|
-const { createMessage } = useMessage();
|
|
|
-
|
|
|
-export default {
|
|
|
- name: 'AdwebEnquiryList',
|
|
|
- mixins: [JeecgListMixin],
|
|
|
- components: {
|
|
|
- enquiryTrack,
|
|
|
- enquiryGenzong,
|
|
|
- XpRecycleBinModal,
|
|
|
- enquiryDetail,
|
|
|
- blackList,
|
|
|
- selectSite
|
|
|
- },
|
|
|
- data() {
|
|
|
- return {
|
|
|
- toReadImg,
|
|
|
- toClassified,
|
|
|
- toTotal,
|
|
|
- userRole: '',
|
|
|
- siteList: [],
|
|
|
- userEffectiveOption: Array(),
|
|
|
- userEffective: [],
|
|
|
- excelLoading: false,
|
|
|
- forwardLoading: false,
|
|
|
- targetUserEffect: undefined,
|
|
|
- rangeDate: undefined,
|
|
|
- // 表头
|
|
|
- settingColumns: [
|
|
|
- 'siteName',
|
|
|
- 'contact',
|
|
|
- 'fromEmail',
|
|
|
- 'phone',
|
|
|
- 'readStatus',
|
|
|
- 'principalUid',
|
|
|
- 'fromPage',
|
|
|
- 'userEffective',
|
|
|
- 'countryName',
|
|
|
- 'recordCtime',
|
|
|
- 'pluginName',
|
|
|
- 'action',
|
|
|
- ],
|
|
|
- columns: [
|
|
|
- {
|
|
|
- title: '站点名称',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'siteName'
|
|
|
- },
|
|
|
- {
|
|
|
- title: '姓名',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'contact',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'contactSlot',
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '邮箱',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'fromEmail',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'copyEmail',
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: 'whatsApp',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'whatsApp',
|
|
|
- customCell: function (text) {
|
|
|
- if (text == null || text == '' || text == undefined) {
|
|
|
- return '--'
|
|
|
- } else {
|
|
|
- return text
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- title: '手机号',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'phone',
|
|
|
- customCell: function (text) {
|
|
|
- if (text == null || text == '' || text == undefined) {
|
|
|
- return '--'
|
|
|
- } else {
|
|
|
- return text
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- title: '来源IP',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'fromIp',
|
|
|
- customCell: function (text) {
|
|
|
- if (text == null || text == '' || text == undefined) {
|
|
|
- return '--'
|
|
|
- } else {
|
|
|
- return text
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- {
|
|
|
- title: '状态',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'readStatus',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'readStatus'
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '询盘详情',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'details',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'detailsSlot',
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '跟进人',
|
|
|
- align: "center",
|
|
|
- dataIndex: 'principalUid',
|
|
|
- scopedSlots: {
|
|
|
- filterDropdown: 'filterDropdown2',
|
|
|
- filterIcon: 'filterIcon2',
|
|
|
- customCell: 'principalUidSlot',
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '来源页面',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'fromPage',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'tips'
|
|
|
- },
|
|
|
- },
|
|
|
- {
|
|
|
- title: '分类',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'userEffective',
|
|
|
- scopedSlots: {
|
|
|
- customCell: 'userEffective'
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '来源国家',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'countryName',
|
|
|
- customCell: function (text) {
|
|
|
- if (text == null || text == '' || text == undefined) {
|
|
|
- return '--'
|
|
|
- } else {
|
|
|
- return text
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '来源插件',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'pluginName',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '询盘时间',
|
|
|
- align: 'left',
|
|
|
- dataIndex: 'recordCtime',
|
|
|
- customCell: function (text) {
|
|
|
- return !text ? '' : (text.length > 16 ? text.substr(0, 16) : text)
|
|
|
- }
|
|
|
- },
|
|
|
- {
|
|
|
- title: '操作',
|
|
|
- dataIndex: 'action',
|
|
|
- align: 'left',
|
|
|
- width: "180px",
|
|
|
- fixed: 'right',
|
|
|
- scopedSlots: {
|
|
|
- filterDropdown: 'filterDropdown',
|
|
|
- filterIcon: 'filterIcon',
|
|
|
- customCell: 'action'
|
|
|
- }
|
|
|
- }
|
|
|
- ],
|
|
|
- defColumns: [],
|
|
|
- url: {
|
|
|
- list: "/adweb/adwebEnquiry/list"
|
|
|
- },
|
|
|
- enquiryNums: {
|
|
|
- all: 0,
|
|
|
- noRead: 0,
|
|
|
- product: 0,
|
|
|
- wait: 0
|
|
|
- },
|
|
|
- ipagination: {
|
|
|
- current: 1,
|
|
|
- pageSize: 30,
|
|
|
- pageSizeOptions: ['15', '30', '45', '60'],
|
|
|
- showTotal: (total, range) => {
|
|
|
- return range[0] + "-" + range[1] + " 共" + total + "条"
|
|
|
- },
|
|
|
- showQuickJumper: true,
|
|
|
- showSizeChanger: true,
|
|
|
- total: 0
|
|
|
- },
|
|
|
- queryParam: {
|
|
|
- readStatus: undefined,
|
|
|
- userEffective: undefined
|
|
|
- },
|
|
|
- disableMixinCreated: true,
|
|
|
- // 调整跟进人相关的字段 start
|
|
|
- modalVisible: false,
|
|
|
- forwardVisible: false,
|
|
|
- //转发询盘信息
|
|
|
- forwardEnquiryDetail: undefined,
|
|
|
- siteCode: undefined,
|
|
|
- subAccountOptions: [],
|
|
|
- otherSubAccountOptions: [],
|
|
|
- haveSubAccount: false,
|
|
|
- radioStyle: {
|
|
|
- display: 'block',
|
|
|
- height: '30px',
|
|
|
- lineHeight: '30px',
|
|
|
- },
|
|
|
- tempTopNumber: 0,
|
|
|
- selectedUserId: undefined,
|
|
|
- // 调整跟进人相关的字段 end
|
|
|
- routerQuery: {},
|
|
|
- edition: 1,
|
|
|
- dictSiteCode: '',
|
|
|
- }
|
|
|
- },
|
|
|
- created() {
|
|
|
- this.siteCode = localStorage.getItem('siteCode');
|
|
|
- this.getTurnInquiryCode();
|
|
|
- },
|
|
|
- mounted() {
|
|
|
- this.userRole = useUserStore().roleList;
|
|
|
- this.getSiteListWithQueryConditon();
|
|
|
- this.getEffectiveList();
|
|
|
- },
|
|
|
- watch: {
|
|
|
- $route: {
|
|
|
- immediate: true,
|
|
|
- handler() {
|
|
|
- this.queryParam.dateType = '';
|
|
|
- let query = this.$route.query;
|
|
|
- this.routerQuery = query
|
|
|
- // 时间筛选
|
|
|
- if (query.dateType || query.start || query.end || query.offset) {
|
|
|
- this.queryParam.start = query.start;
|
|
|
- this.queryParam.end = query.end;
|
|
|
- if (query.dateType && query.offset) {
|
|
|
- //判断是否有偏移量
|
|
|
- this.setTimeWithoutReloadData(query.dateType, query.offset);
|
|
|
- this.queryParam.start = moment(this.rangeDate[0]._d).format("YYYY-MM-DD")
|
|
|
- this.queryParam.end = moment(this.rangeDate[1]._d).format("YYYY-MM-DD")
|
|
|
- this.queryParam.dateType = query.dateType;
|
|
|
- } else if (query.dateType && !query.offset) {
|
|
|
- this.queryParam.dateType = query.dateType;
|
|
|
- this.setTimeWithoutReloadData(this.queryParam.dateType);
|
|
|
- } else {
|
|
|
- if (query.start && query.end) {
|
|
|
- this.queryParam.dateType = undefined;
|
|
|
- this.rangeDate = [moment(query.start), moment(query.end)];
|
|
|
- // this.rangeDate = [moment(this.queryParam.start), moment(this.queryParam.end)];
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- // 其它筛选条件
|
|
|
- if (query.searchText) {
|
|
|
- this.queryParam.searchText = query.searchText;
|
|
|
- }
|
|
|
- if (query.searchContent) {
|
|
|
- this.queryParam.searchContent = query.searchContent;
|
|
|
- }
|
|
|
- if (query.readStatus) {
|
|
|
- this.queryParam.readStatus = query.readStatus;
|
|
|
- }
|
|
|
- }
|
|
|
- }
|
|
|
- },
|
|
|
- methods: {
|
|
|
- // ====================和调整跟进人相关的方法 start ======================
|
|
|
- // 获取子账户的下拉框选项
|
|
|
- getSubAccountOptions() {
|
|
|
- let that = this;
|
|
|
- getAction('/usercountry/subAccounts/options?siteId=' + that.queryParam.siteId).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- that.subAccountOptions = res.result;
|
|
|
- that.haveSubAccount = res.result !== null && res.result !== undefined && res.result.length > 0;
|
|
|
- that.initColumns();
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 显示选择跟进人的弹窗
|
|
|
- showEditPrincipalModal() {
|
|
|
- let that = this;
|
|
|
- if (that.selectedRowKeys.length <= 0) {
|
|
|
- createMessage.warning('请选择至少一条记录!');
|
|
|
- return;
|
|
|
- }
|
|
|
- that.modalVisible = true;
|
|
|
- },
|
|
|
- // 编辑跟进人
|
|
|
- editPrincipal() {
|
|
|
- if (this.selectedRowKeys.length <= 0) {
|
|
|
- createMessage.warning('请选择至少一条记录!');
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.selectedUserId) {
|
|
|
- createMessage.warning('请选择跟进人!');
|
|
|
- return;
|
|
|
- }
|
|
|
- var ids = "";
|
|
|
- for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
|
|
- ids += this.selectedRowKeys[a] + ",";
|
|
|
- }
|
|
|
- var that = this;
|
|
|
- that.loading = true;
|
|
|
- let param = {
|
|
|
- 'ids': ids,
|
|
|
- 'uid': that.selectedUserId
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/setPrincipalBatch', param).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success(res.message);
|
|
|
- that.loadData();
|
|
|
- that.onClearSelected();
|
|
|
- that.cancelEditPrincipal();
|
|
|
- } else {
|
|
|
- createMessage.warning(res.message);
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- that.loading = false;
|
|
|
- });
|
|
|
- },
|
|
|
- // 单个产品,点击下拉框直接修改
|
|
|
- selectPrincipal(record) {
|
|
|
- console.log(record);
|
|
|
- let params = {
|
|
|
- productId: record.id,
|
|
|
- uid: record.principalUid === undefined ? 'ALL' : record.principalUid
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/setPrincipal', params).then((res) => {
|
|
|
- if (res.code == 200) {
|
|
|
- createMessage.success('操作成功!');
|
|
|
- } else {
|
|
|
- if (res.code == 403 || res.code == 500) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- this.loadData();
|
|
|
- } else {
|
|
|
- createMessage.success('操作失败!');
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- // 取消跟进人的编辑
|
|
|
- cancelEditPrincipal() {
|
|
|
- this.selectedUserId = undefined;
|
|
|
- this.modalVisible = false;
|
|
|
- },
|
|
|
- // ====================和调整跟进人相关的方法 end ======================
|
|
|
- //日期选择只能今天之前
|
|
|
- disabledDate(current) {
|
|
|
- return current && current > moment().endOf('day');
|
|
|
- },
|
|
|
- //访问记录
|
|
|
- enquiryTrack(record) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.enquiryTrack.init(record)
|
|
|
- })
|
|
|
- },
|
|
|
- //跟踪记录
|
|
|
- enquiryRecord(record) {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.enquiryGenzong.init(record)
|
|
|
- })
|
|
|
- },
|
|
|
- //转发询盘
|
|
|
- forwardDetail(record) {
|
|
|
- let that = this;
|
|
|
- that.getOtherSubAccountOptions(record);
|
|
|
- this.forwardEnquiryDetail = record.id;
|
|
|
- that.forwardVisible = true;
|
|
|
- },
|
|
|
- //批量转发询盘
|
|
|
- forwardDetailAll() {
|
|
|
- if (this.selectedRowKeys.length <= 0) {
|
|
|
- createMessage.warning('请选择至少一条记录!');
|
|
|
- return;
|
|
|
- }
|
|
|
- getAction('/usercountry/otherSubAccounts/options?siteId=' + this.queryParam.siteId).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.otherSubAccountOptions = res.result;
|
|
|
- }
|
|
|
- })
|
|
|
- this.forwardEnquiryDetail = ""
|
|
|
- for (var a = 0; a < this.selectedRowKeys.length; a++) {
|
|
|
- this.forwardEnquiryDetail += this.selectedRowKeys[a] + ",";
|
|
|
- }
|
|
|
- this.forwardVisible = true;
|
|
|
- },
|
|
|
- // 编辑转发
|
|
|
- editForward() {
|
|
|
- if (this.forwardEnquiryDetail === undefined) {
|
|
|
- createMessage.warning('请选择询盘信息!');
|
|
|
- return;
|
|
|
- }
|
|
|
- if (!this.selectedUserId) {
|
|
|
- createMessage.warning('请选择跟进人!');
|
|
|
- return;
|
|
|
- }
|
|
|
-
|
|
|
- var that = this;
|
|
|
- that.forwardLoading = true;
|
|
|
- let param = {
|
|
|
- 'ids': that.forwardEnquiryDetail,
|
|
|
- 'uid': that.selectedUserId,
|
|
|
- 'code': that.siteCode
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/setForward', param).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success(res.message);
|
|
|
- that.loadData();
|
|
|
- that.cancelEditForward();
|
|
|
- that.getEnquiryNums();
|
|
|
- that.selectedRowKeys = [];
|
|
|
- } else {
|
|
|
- createMessage.warning(res.message);
|
|
|
- }
|
|
|
- }).finally(() => {
|
|
|
- that.forwardLoading = false;
|
|
|
- });
|
|
|
- },
|
|
|
-
|
|
|
- // 取消转发的编辑
|
|
|
- cancelEditForward() {
|
|
|
- this.selectedUserId = undefined;
|
|
|
- this.forwardEnquiryDetail = undefined;
|
|
|
- this.forwardVisible = false;
|
|
|
- },
|
|
|
- // 获取子账户的下拉框选项
|
|
|
- getOtherSubAccountOptions(record) {
|
|
|
- let that = this;
|
|
|
- getAction('/usercountry/otherSubAccounts/options?siteId=' + that.queryParam.siteId).then(res => {
|
|
|
- if (res.code === 200) {
|
|
|
- that.otherSubAccountOptions = res.result.filter(item => item.id !== record.principalUid);
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //获取需要轮流询盘的站点code
|
|
|
- getTurnInquiryCode() {
|
|
|
- getAction('/adweb/adwebEnquiry/getTurnInquiryCode').then((res) => {
|
|
|
- if (res.code === 200) {
|
|
|
- this.dictSiteCode = res.result[0].value;
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //询盘详情
|
|
|
- enquiryDetail(record) {
|
|
|
- if (record.readStatus == 0) {
|
|
|
- getAction('/adweb/adwebEnquiry/read?id=' + record.id).then(res => {
|
|
|
- this.getTableAndNum()
|
|
|
- })
|
|
|
- }
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.enquiryDetail.init(record)
|
|
|
- })
|
|
|
- },
|
|
|
- productDetail(record) {
|
|
|
- const param = {
|
|
|
- siteCode: record.siteCode,
|
|
|
- fromPage: record.fromPage,
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/getProductDetail', param).then(res => {
|
|
|
- console.log(res)
|
|
|
- })
|
|
|
- },
|
|
|
- //黑名单
|
|
|
- showBlackList() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.blackList.init(this.queryParam.siteId)
|
|
|
- })
|
|
|
- },
|
|
|
- //回收箱
|
|
|
- recycleBinVisible() {
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.XpRecycleBinModal.init(this.queryParam.siteId, '1,2')
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //重新刷新页面数据及获取询盘数量
|
|
|
- getTableAndNum(arg, clearParam) {
|
|
|
- // 设置默认站点
|
|
|
- let siteId = this.queryParam.siteId;
|
|
|
- let siteList = this.siteList;
|
|
|
- for (let site of siteList) {
|
|
|
- if (site.id === siteId) {
|
|
|
- localStorage.setItem("siteCode", site.code);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- this.getEnquiryNums()
|
|
|
- this.getSubAccountOptions();
|
|
|
- if (clearParam) {
|
|
|
- if (this.queryParam.readStatus) {
|
|
|
- delete this.queryParam.readStatus
|
|
|
- }
|
|
|
- if (this.queryParam.searchText) {
|
|
|
- delete this.queryParam.searchText
|
|
|
- }
|
|
|
- if (this.queryParam.searchContent) {
|
|
|
- delete this.queryParam.searchContent
|
|
|
- }
|
|
|
- if (this.queryParam.userEffective) {
|
|
|
- delete this.queryParam.userEffective
|
|
|
- }
|
|
|
- if (this.queryParam.principalUid) {
|
|
|
- delete this.queryParam.principalUid;
|
|
|
- }
|
|
|
- }
|
|
|
- this.loadData(arg)
|
|
|
- },
|
|
|
-
|
|
|
- //重新刷新页面数据及获取询盘数量,不清除查询条件
|
|
|
- getTableAndNumWithQueryCondition(arg) {
|
|
|
- this.getEnquiryNums()
|
|
|
- this.getSubAccountOptions();
|
|
|
- this.loadData(arg)
|
|
|
- },
|
|
|
-
|
|
|
- //重写重置,原先整体查询条件重置,改为只清空部分
|
|
|
- searchReset() {
|
|
|
- //this.queryParam = {}
|
|
|
- if (this.queryParam.readStatus) {
|
|
|
- delete this.queryParam.readStatus
|
|
|
- }
|
|
|
- if (this.queryParam.searchText) {
|
|
|
- delete this.queryParam.searchText
|
|
|
- }
|
|
|
- if (this.queryParam.searchContent) {
|
|
|
- delete this.queryParam.searchContent
|
|
|
- }
|
|
|
- if (this.queryParam.userEffective) {
|
|
|
- delete this.queryParam.userEffective
|
|
|
- }
|
|
|
- if (this.queryParam.principalUid) {
|
|
|
- delete this.queryParam.principalUid;
|
|
|
- }
|
|
|
- this.getTableAndNum(1);
|
|
|
- this.onClearSelected();
|
|
|
- },
|
|
|
-
|
|
|
- changeSite(value, e) {
|
|
|
-
|
|
|
- this.selectSiteInfo = e.info
|
|
|
- this.queryParam.siteId = this.selectSiteInfo.id;
|
|
|
- this.siteCode = localStorage.getItem('siteCode');
|
|
|
- this.getTableAndNum(undefined, true)
|
|
|
- },
|
|
|
-
|
|
|
- //设置列表的时间查询条件
|
|
|
- setTime(time) {
|
|
|
- this.queryParam.dateType = time
|
|
|
- this.queryParam.start = ''
|
|
|
- this.queryParam.end = ''
|
|
|
- // sevenDay thirtyDay today yesterday
|
|
|
- if (time == '') {
|
|
|
- this.rangeDate = undefined
|
|
|
- } else if (time == 'sevenDay') {
|
|
|
- this.rangeDate = [moment().subtract(6, "days"), moment()]
|
|
|
- } else if (time == 'thirtyDay') {
|
|
|
- this.rangeDate = [moment().subtract(29, "days"), moment()]
|
|
|
- } else if (time == 'today') {
|
|
|
- this.rangeDate = [moment(), moment()]
|
|
|
- } else if (time == 'yesterday') {
|
|
|
- this.rangeDate = [moment().subtract(1, "days"), moment().subtract(1, "days")]
|
|
|
- }
|
|
|
- this.getTableAndNum()
|
|
|
- },
|
|
|
-
|
|
|
- //设置列表的时间查询条件,但不查询数据
|
|
|
- setTimeWithoutReloadData(time, offset) {
|
|
|
- if (!offset) {
|
|
|
- offset = 0;
|
|
|
- }
|
|
|
- if (time == 'today' || time == 'yesterday') {
|
|
|
- offset = 0;
|
|
|
- }
|
|
|
- offset = Number(offset);
|
|
|
- this.queryParam.dateType = time
|
|
|
- this.queryParam.start = ''
|
|
|
- this.queryParam.end = ''
|
|
|
- if (time == '') {
|
|
|
- this.rangeDate = undefined
|
|
|
- } else if (time == 'sevenDay') {
|
|
|
- this.rangeDate = [moment().subtract(6 + offset, "days"), moment().subtract(offset, "days")]
|
|
|
- } else if (time == 'thirtyDay') {
|
|
|
- this.rangeDate = [moment().subtract(29 + offset, "days"), moment().subtract(offset, "days")]
|
|
|
- } else if (time == 'today') {
|
|
|
- this.rangeDate = [moment().subtract(offset, "days"), moment().subtract(offset, "days")]
|
|
|
- } else if (time == 'yesterday') {
|
|
|
- this.rangeDate = [moment().subtract(1 + offset, "days"), moment().subtract(1 + offset, "days")]
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- //搜索条件部分的逻辑
|
|
|
- onChangeDatePciker(date, dateString) {
|
|
|
- if (dateString.length > 0) {
|
|
|
- this.rangeDate = date
|
|
|
- this.queryParam.start = dateString[0]
|
|
|
- this.queryParam.end = dateString[1]
|
|
|
- this.queryParam.dateType = undefined
|
|
|
- this.getTableAndNum()
|
|
|
- }
|
|
|
- },
|
|
|
-
|
|
|
- getList(type) {
|
|
|
- //清空查询条件
|
|
|
- this.queryParam.principalUid = undefined;
|
|
|
- this.queryParam.searchText = undefined;
|
|
|
- this.queryParam.searchContent = undefined;
|
|
|
- if (type == 'noRead') {
|
|
|
- this.queryParam.readStatus = '0'
|
|
|
- this.queryParam.userEffective = undefined
|
|
|
- }
|
|
|
- if (type == 'product') {
|
|
|
- this.queryParam.userEffective = 1
|
|
|
- console.log('1', this.queryParam)
|
|
|
-
|
|
|
- this.queryParam.readStatus = undefined
|
|
|
- console.log('2', this.queryParam)
|
|
|
-
|
|
|
- }
|
|
|
- if (type == 'wait') {
|
|
|
- this.queryParam.userEffective = 2
|
|
|
- this.queryParam.readStatus = undefined
|
|
|
- }
|
|
|
- if (type == 'all') {
|
|
|
- this.queryParam.userEffective = undefined
|
|
|
- this.queryParam.readStatus = undefined
|
|
|
- }
|
|
|
- this.loadData(1)
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //获取站点列表,获取表格数据的时候不清除查询条件
|
|
|
- getSiteListWithQueryConditon() {
|
|
|
- let that = this
|
|
|
- getAction('/adweb/adwebSite/getSiteListByUid').then(function (res) {
|
|
|
- if (res.code === 200) {
|
|
|
-
|
|
|
-
|
|
|
- if (res.result.length === 1) {
|
|
|
- that.queryParam.siteId = res.result[0].id
|
|
|
- } else {
|
|
|
- let isInSite = false
|
|
|
- for (let i in res.result) {
|
|
|
- if (localStorage.getItem('siteCode') !== null && res.result[i].code === localStorage.getItem('siteCode')) {
|
|
|
- isInSite = true
|
|
|
- that.queryParam.siteId = res.result[i].id
|
|
|
- }
|
|
|
- }
|
|
|
- if (localStorage.getItem('siteCode') !== null && isInSite) {
|
|
|
- } else {
|
|
|
- that.queryParam.siteId = res.result[0].id
|
|
|
- localStorage.setItem('siteCode', res.result[0].code)
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- that.siteList = res.result;
|
|
|
- that.initColumns();
|
|
|
- //如果首页查询数据,直接走下面,return掉,防止接口多次请求
|
|
|
- if (that.routerQuery.timeType) {
|
|
|
- let start
|
|
|
- if (that.routerQuery.timeType == 'thisWeek') {
|
|
|
- start = moment().subtract(moment().day() - 1, 'days').format('YYYY-MM-DD')
|
|
|
- }
|
|
|
- if (that.routerQuery.timeType == 'thisMonth') {
|
|
|
- start = moment().startOf('month').format('YYYY-MM-DD');
|
|
|
- }
|
|
|
- let end = moment().format('YYYY-MM-DD')
|
|
|
- that.rangeDate = [moment(start), moment(end)];
|
|
|
- that.queryParam.start = start
|
|
|
- that.queryParam.end = end
|
|
|
- that.queryParam.dateType = undefined
|
|
|
- that.getTableAndNum()
|
|
|
- return
|
|
|
- }
|
|
|
-
|
|
|
- if (that.routerQuery.siteCode) {
|
|
|
- that.queryParam.siteId = Number(that.routerQuery.siteCode)
|
|
|
- }
|
|
|
- that.getTableAndNumWithQueryCondition()
|
|
|
- } else {
|
|
|
- createMessage.error('获取站点失败!')
|
|
|
- }
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //获取询盘分类列表
|
|
|
- getEffectiveList() {
|
|
|
- let that = this
|
|
|
- getAction('/adweb/adwebEnquiry/getEnquiryCatalog').then(function (res) {
|
|
|
- if (res.code == 200) {
|
|
|
- that.userEffectiveOption = JSON.parse(res.result);
|
|
|
- } else {
|
|
|
- createMessage.error('获取询盘分类失败!')
|
|
|
- }
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //批量分配询盘
|
|
|
- changeUserEffective(e) {
|
|
|
- let that = this
|
|
|
- if (e == '') {
|
|
|
- return
|
|
|
- }
|
|
|
- let d = {
|
|
|
- id: that.selectedRowKeys.toString(),
|
|
|
- userEffective: e
|
|
|
- }
|
|
|
- postAction('/adweb/adwebEnquiry/update/user/effective', Qs.stringify(d)).then(function (res) {
|
|
|
- if (res.code == 200) {
|
|
|
- createMessage.success('批量分类修改成功!');
|
|
|
- that.getTableAndNum()
|
|
|
- } else {
|
|
|
- if (res.code == 403) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- } else {
|
|
|
- createMessage.error('分类修改失败!')
|
|
|
- }
|
|
|
- }
|
|
|
- }).catch(function (err) {
|
|
|
- console.log(err)
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- // 删除
|
|
|
- enquiryDelete(id) {
|
|
|
- getAction('/adweb/adwebEnquiry/delBatch', {id: id}).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success(`删除询盘成功!`)
|
|
|
- this.getTableAndNum()
|
|
|
- } else {
|
|
|
- if (res.code == 403) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- } else {
|
|
|
- createMessage.error('删除失败!')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //批量删除
|
|
|
- enquiryDeleteAll() {
|
|
|
- if (this.selectedRowKeys.length <= 0) {
|
|
|
- createMessage.warning('请选择至少一条记录!');
|
|
|
- return;
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/delBatch', {id: this.selectedRowKeys.toString()}).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success(`批量删除询盘成功!`)
|
|
|
- this.getTableAndNum()
|
|
|
- this.onClearSelected();
|
|
|
- } else {
|
|
|
- if (res.code == 403) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- } else {
|
|
|
- createMessage.error('删除失败!')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
- //批量设为已读
|
|
|
- enquiryReady() {
|
|
|
- if (this.selectedRowKeys.length <= 0) {
|
|
|
- createMessage.warning('请选择至少一条记录!');
|
|
|
- return;
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/read', {id: this.selectedRowKeys.toString()}).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success('批量设置已读成功!')
|
|
|
- this.getTableAndNum()
|
|
|
- this.onClearSelected();
|
|
|
- } else {
|
|
|
- if (res.code == 403) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- } else {
|
|
|
- createMessage.error('设置失败!')
|
|
|
- }
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //拒收
|
|
|
- enquiryAddBlackList(record) {
|
|
|
- delete record.wasteEnquiry
|
|
|
- postAction('/enquiry/blacklist/addBlacklist', record).then(res => {
|
|
|
- if (res.success) {
|
|
|
- createMessage.success(`拒收成功!`)
|
|
|
- this.getTableAndNum()
|
|
|
- } else {
|
|
|
- if (res.code == 403 || res.code == 500) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- } else {
|
|
|
- createMessage.error('拒收失败!')
|
|
|
- }
|
|
|
-
|
|
|
- }
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
- //获取不同状态询盘的数量
|
|
|
- getEnquiryNums() {
|
|
|
- let siteId = ''
|
|
|
- let that = this
|
|
|
- if (that.queryParam.siteId && that.queryParam.siteId != '') {
|
|
|
- siteId = that.queryParam.siteId
|
|
|
- } else {
|
|
|
- siteId = ''
|
|
|
- }
|
|
|
- let d = {
|
|
|
- siteId: siteId,
|
|
|
- dateType: that.queryParam.dateType,
|
|
|
- start: that.queryParam.start,
|
|
|
- end: that.queryParam.end
|
|
|
- }
|
|
|
- getAction('/adweb/adwebEnquiry/getEnquiryNums', d).then(res => {
|
|
|
- if (res.code == 200) {
|
|
|
- that.enquiryNums.all = res.result.all
|
|
|
- that.enquiryNums.noRead = res.result.noRead
|
|
|
- that.enquiryNums.product = res.result.product
|
|
|
- that.enquiryNums.wait = res.result.wait
|
|
|
- } else {
|
|
|
- that.enquiryNums.all = 0
|
|
|
- that.enquiryNums.noRead = 0
|
|
|
- that.enquiryNums.product = 0
|
|
|
- that.enquiryNums.wait = 0
|
|
|
- }
|
|
|
-
|
|
|
- })
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- filterOption(inputValue, option) {
|
|
|
- return option.componentOptions.children[0].text.indexOf(inputValue) >= 0
|
|
|
- },
|
|
|
-
|
|
|
-
|
|
|
- //列设置更改事件
|
|
|
- onColSettingsChange(checkedValues) {
|
|
|
- var key = this.$route.name + ":colsettings";
|
|
|
- $ls.set(key, checkedValues, 7 * 24 * 60 * 60 * 1000)
|
|
|
- this.settingColumns = checkedValues;
|
|
|
- const cols = this.columns.filter(item => {
|
|
|
- if (item.key == 'rowIndex' || item.dataIndex == 'action') {
|
|
|
- return true
|
|
|
- }
|
|
|
- if (this.settingColumns.includes(item.dataIndex)) {
|
|
|
- return true
|
|
|
- }
|
|
|
- return false
|
|
|
- })
|
|
|
- this.defColumns = cols;
|
|
|
- },
|
|
|
-
|
|
|
- initColumns() {
|
|
|
- let that = this;
|
|
|
-
|
|
|
- // 从缓存中获取存放的展示列
|
|
|
- var key = this.$route.name + ":colsettings";
|
|
|
- let columnIndexs = $ls.get(key);
|
|
|
-
|
|
|
- if (columnIndexs !== null && columnIndexs !== undefined) {
|
|
|
- that.settingColumns = columnIndexs;
|
|
|
- }
|
|
|
-
|
|
|
- // 重置显示的列
|
|
|
- that.defColumns = this.columns.filter(item => {
|
|
|
- if (item.dataIndex === 'action') {
|
|
|
- return true;
|
|
|
- }
|
|
|
- if (item.dataIndex === 'principalUid') {
|
|
|
- return that.haveSubAccount;
|
|
|
- }
|
|
|
- if (item.dataIndex === 'siteName') {
|
|
|
- return that.siteList !== null && that.siteList !== undefined && that.siteList.length >= 2
|
|
|
- }
|
|
|
-
|
|
|
- if (that.userRole.indexOf('admin') > -1 || that.userRole.indexOf('adweb_admin') > -1 || that.userRole.indexOf('adweb_seo_manager') > -1 || that.userRole.indexOf('adweb_site_manager') > -1) {
|
|
|
- if (item.dataIndex === 'pluginName') {
|
|
|
- return true;
|
|
|
- }
|
|
|
- }
|
|
|
- if (that.settingColumns.includes(item.dataIndex)) {
|
|
|
- return true;
|
|
|
- }
|
|
|
- return false;
|
|
|
- });
|
|
|
- },
|
|
|
- handleExportXlsLU(fileName) {
|
|
|
- let that = this
|
|
|
- if (that.edition == 2) {
|
|
|
- createMessage.warning('"演示版"没有操作权限,如果需要操作,请切换到"正式版"再操作!');
|
|
|
- return;
|
|
|
- } else {
|
|
|
- let param = this.getQueryParams();
|
|
|
- if (!param.userEffective) {
|
|
|
- param.userEffective = '1,2';
|
|
|
- }
|
|
|
- if (param.siteId === 0) {
|
|
|
- createMessage.warning("请先选择站点!");
|
|
|
- return;
|
|
|
- }
|
|
|
- this.excelLoading = true;
|
|
|
- downFile("/adweb/adwebEnquiry/exportExcel", param).then((data) => {
|
|
|
- this.excelLoading = false;
|
|
|
- if (!data) {
|
|
|
- createMessage.warning("文件下载失败")
|
|
|
- return
|
|
|
- }
|
|
|
- if (typeof window.navigator.msSaveBlob !== 'undefined') {
|
|
|
- window.navigator.msSaveBlob(new Blob([data], {type: 'application/vnd.ms-excel'}), fileName + '.xlsx')
|
|
|
- } else {
|
|
|
- let url = window.URL.createObjectURL(new Blob([data], {type: 'application/vnd.ms-excel'}))
|
|
|
- let link = document.createElement('a')
|
|
|
- link.style.display = 'none'
|
|
|
- link.href = url
|
|
|
- link.setAttribute('download', fileName + '.xlsx')
|
|
|
- document.body.appendChild(link)
|
|
|
- link.click()
|
|
|
- document.body.removeChild(link); //下载完成移除元素
|
|
|
- window.URL.revokeObjectURL(url); //释放掉blob对象
|
|
|
- }
|
|
|
- })
|
|
|
- }
|
|
|
- },
|
|
|
-//复制email到剪切板
|
|
|
- copyEmailFunction(text) {
|
|
|
- let that = this;
|
|
|
- //复制email到剪切板
|
|
|
- if (!navigator.clipboard) {
|
|
|
- console.log('浏览器不支持navigator');
|
|
|
- let copy = (e) => {
|
|
|
- e.preventDefault()
|
|
|
- e.clipboardData.setData('text/plain', text)
|
|
|
- createMessage.success('复制成功');
|
|
|
- document.removeEventListener('copy', copy)
|
|
|
- }
|
|
|
- document.addEventListener('copy', copy)
|
|
|
- document.execCommand("Copy");
|
|
|
- return
|
|
|
- }
|
|
|
- navigator.clipboard.writeText(text).then(function () {
|
|
|
- createMessage.success('复制成功');
|
|
|
- }, function (err) {
|
|
|
- createMessage.error('复制失败');
|
|
|
- });
|
|
|
- },
|
|
|
- loadData(arg) {
|
|
|
- if (!this.url.list) {
|
|
|
- createMessage.error("请设置url.list属性!")
|
|
|
- return
|
|
|
- }
|
|
|
- //加载数据 若传入参数1则加载第一页的内容
|
|
|
- if (arg === 1) {
|
|
|
- this.ipagination.current = 1;
|
|
|
- }
|
|
|
- var params = this.getQueryParams();//查询条件
|
|
|
- if (!params.userEffective) {
|
|
|
- params.userEffective = '1,2';
|
|
|
- }
|
|
|
- this.loading = true;
|
|
|
- getAction(this.url.list, params).then((res) => {
|
|
|
- if (res.success) {
|
|
|
- //update-begin---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
- this.dataSource = res.result.records || res.result;
|
|
|
- if (res.result.total != 0) {
|
|
|
- this.ipagination.total = res.result.total;
|
|
|
- } else {
|
|
|
- this.ipagination.total = 0;
|
|
|
- }
|
|
|
- //update-end---author:zhangyafei Date:20201118 for:适配不分页的数据列表------------
|
|
|
- }
|
|
|
- if (res.code === 510) {
|
|
|
- createMessage.warning(res.message)
|
|
|
- }
|
|
|
- this.loading = false;
|
|
|
- })
|
|
|
- },
|
|
|
- }
|
|
|
-}
|
|
|
-</script>
|
|
|
-
|
|
|
-<style lang="less" scoped>
|
|
|
-.ant-alert {
|
|
|
- /deep/ .ant-btn {
|
|
|
- border-radius: 0;
|
|
|
- margin-left: 10px;
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.theme-color {
|
|
|
- color: @primary-color;
|
|
|
-}
|
|
|
-
|
|
|
-.r1 {
|
|
|
- .choose-site {
|
|
|
- display: flex;
|
|
|
- }
|
|
|
-
|
|
|
- .t1 {
|
|
|
- font-size: 18px;
|
|
|
- }
|
|
|
-
|
|
|
- .ant-calendar-picker {
|
|
|
- margin-right: 20px;
|
|
|
-
|
|
|
- }
|
|
|
-
|
|
|
-
|
|
|
-}
|
|
|
-
|
|
|
-.r2 {
|
|
|
- background: #fff;
|
|
|
- border-radius: 10px;
|
|
|
- padding: 30px 20px;
|
|
|
- margin-top: 20px;
|
|
|
-
|
|
|
- .ant-col:not(:last-child) {
|
|
|
- border-right: 1px solid #e6e6e6;
|
|
|
- }
|
|
|
-
|
|
|
- p {
|
|
|
- margin: 0;
|
|
|
- text-align: center;
|
|
|
-
|
|
|
- &.t1 {
|
|
|
- color: #333;
|
|
|
- margin-bottom: 15px;
|
|
|
-
|
|
|
- img {
|
|
|
- margin-right: 10px;
|
|
|
- width: 15px;
|
|
|
- margin-top: -5px;
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- &.t2 {
|
|
|
- color: @primary-color;
|
|
|
- font-size: 30px;
|
|
|
- font-weight: 500;
|
|
|
- line-height: 1;
|
|
|
- text-decoration: underline;
|
|
|
- cursor: pointer;
|
|
|
- padding-left: 25px;
|
|
|
- }
|
|
|
- }
|
|
|
-}
|
|
|
-
|
|
|
-.r3 {
|
|
|
- margin-top: 20px;
|
|
|
-}
|
|
|
-
|
|
|
-.r4 {
|
|
|
- margin-top: 20px;
|
|
|
-
|
|
|
- /deep/ .ant-table-tbody {
|
|
|
- background: #fff;
|
|
|
- }
|
|
|
-
|
|
|
- /deep/ .ant-table-tbody > tr > td {
|
|
|
- border-bottom: 1px solid #f7f7f7;
|
|
|
- }
|
|
|
-}
|
|
|
-</style>
|