| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348 |
- <template>
- <div class="app-container">
- <el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch" label-width="100px">
- <el-form-item label="客户会员id" prop="fsUserId">
- <el-input
- v-model="queryParams.fsUserId"
- placeholder="请输入客户会员id"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item label="企微客户id" prop="extId">
- <el-input
- v-model="queryParams.extId"
- placeholder="请输入客户id"
- clearable
- size="small"
- @keyup.enter.native="handleQuery"
- />
- </el-form-item>
- <el-form-item>
- <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
- <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
- </el-form-item>
- </el-form>
- <el-row :gutter="10" class="mb8">
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="warning"-->
- <!-- plain-->
- <!-- icon="el-icon-download"-->
- <!-- size="mini"-->
- <!-- :loading="exportLoading"-->
- <!-- @click="handleExport"-->
- <!-- v-hasPermi="['qw:externalContact:export']"-->
- <!-- >导出</el-button>-->
- <!-- </el-col>-->
- <!-- <el-col :span="1.5">-->
- <!-- <el-button-->
- <!-- type="warning"-->
- <!-- plain-->
- <!-- icon="el-icon-download"-->
- <!-- size="mini"-->
- <!-- :loading="exportUnionidLoading"-->
- <!-- @click="handleExportUnionId"-->
- <!-- v-hasPermi="['qw:externalContact:export']"-->
- <!-- >导出unionid</el-button>-->
- <!-- </el-col>-->
- <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
- </el-row>
- <el-table v-loading="loading" :data="externalContactList" @selection-change="handleSelectionChange" border>
- <el-table-column type="selection" width="55" align="center" />
- <el-table-column label="企微客户ID" align="center" prop="id" />
- <el-table-column label="客户会员ID" align="center" prop="fsUserId" />
- <el-table-column label="企微客户头像" align="center" prop="avatar" width="100px">
- <template slot-scope="scope">
- <el-popover
- placement="right"
- title=""
- trigger="hover">
- <img slot="reference" :src="scope.row.avatar" width="60px">
- <img :src="scope.row.avatar" style="max-width: 200px;">
- </el-popover>
- </template>
- </el-table-column>
- <el-table-column label="企微客户名称" prop="name" width="110px"/>
- <el-table-column label="销售企微昵称" align="center" prop="qwUserName" width="120px"/>
- <el-table-column label="企微部门" align="center" prop="departmentName" width="120px"/>
- <el-table-column label="用户类别" align="center" prop="type">
- <template slot-scope="scope">
- <dict-tag :options="typeOptions" :value="scope.row.type"/>
- </template>
- </el-table-column>
- <el-table-column label="性别" align="center" prop="gender">
- <template slot-scope="scope">
- <dict-tag :options="genderOptions" :value="scope.row.gender"/>
- </template>
- </el-table-column>
- <el-table-column label="备注" align="center" prop="remark" />
- <el-table-column label="描述信息" align="center" prop="description" />
- <el-table-column label="标签" align="center" prop="tagIdsName" width="250px">
- <template slot-scope="scope">
- <div v-for="name in scope.row.tagIdsName" style="display: inline;">
- <el-tag type="success">{{ name }}</el-tag>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="状态" align="center" prop="status" width="120px" >
- <template slot-scope="scope">
- <dict-tag :options="statusOptions" :value="scope.row.status"/>
- </template>
- </el-table-column>
- <el-table-column label="客户等级" align="center" prop="level" width="120px" >
- <template slot-scope="scope">
- <dict-tag :options="ratingType" :value="scope.row.level"/>
- </template>
- </el-table-column>
- <el-table-column label="等级状态" align="center" prop="levelType" width="120px" >
- <template slot-scope="scope">
- <dict-tag :options="ratingUpFall" :value="scope.row.levelType"/>
- </template>
- </el-table-column>
- <el-table-column label="添加时间" align="center" prop="createTime" width="100px" />
- <el-table-column label="流失时间" align="center" prop="lossTime" width="100px" />
- <el-table-column label="删除时间" align="center" prop="delTime" width="100px" />
- <el-table-column label="备注电话号码" align="center" prop="remarkMobiles" width="150px">
- <template slot-scope="scope">
- <div v-for="i in JSON.parse(scope.row.remarkMobiles)" :key="i">{{i}}</div>
- </template>
- </el-table-column>
- <el-table-column label="备注企业名称" align="center" prop="remarkCorpName" />
- <el-table-column label="来源" align="center" prop="addWay" width="100px">
- <template slot-scope="scope">
- <dict-tag :options="addWayOptions" :value="scope.row.addWay"/>
- </template>
- </el-table-column>
- <el-table-column label="转接状态" align="center" prop="transferStatus" width="100px" >
- <template slot-scope="scope">
- <dict-tag :options="transferStatusOptions" :value="scope.row.transferStatus"/>
- </template>
- </el-table-column>
- <el-table-column label="是否被拉黑" align="center" prop="manageStatusName" width="130px">
- <template slot-scope="scope">
- {{ scope.row.manageStatusName || (scope.row.manageStatus === 2 ? '是' : scope.row.manageStatus === 1 ? '否' : '-') }}
- </template>
- </el-table-column>
- <el-table-column label="拉黑原因" align="center" prop="manageRemark" show-overflow-tooltip />
- <el-table-column label="企业id" align="center" prop="corpId" />
- <el-table-column label="重粉看课历史" width="140px" align="center" fixed="right">
- <template slot-scope="scope">
- <div v-if="scope.row.fsUserId">
- <el-tag type="success" v-if="scope.row.isRepeat == 0" size="mini">正常</el-tag>
- <el-tag type="danger" v-if="scope.row.isRepeat == 1" size="mini">重粉</el-tag>
- <el-button
- size="mini"
- type="text"
- @click="openRepeatCourseHistory(scope.row)"
- >看课历史
- </el-button>
- </div>
- </template>
- </el-table-column>
- <el-table-column label="是否绑定会员" width="100px" align="center" fixed="right">
- <template slot-scope="scope">
- <el-tag v-if="scope.row.fsUserId" >已绑定</el-tag>
- <el-tag v-else type="info"> 未绑定</el-tag>
- </template>
- </el-table-column>
- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="80px" fixed="right">
- <template slot-scope="scope">
- <el-button
- size="mini"
- type="text"
- icon="el-icon-edit"
- @click="handleUpdate(scope.row)"
- v-hasPermi="['qw:externalContact:edit']"
- >修改</el-button>
- </template>
- </el-table-column>
- </el-table>
- <pagination-more
- :total="total"
- :page.sync="queryParams.pageNum"
- :limit.sync="queryParams.pageSize"
- @pagination="getList"
- />
- <repeat-course-history-drawer ref="repeatCourseHistoryDrawer" />
- <el-dialog :title="title" :visible.sync="open" width="500px" append-to-body>
- <el-form ref="form" :model="form" label-width="100px">
- <el-form-item label="是否拉黑" prop="manageStatus">
- <el-select v-model="form.manageStatus" placeholder="请选择管理状态" clearable size="small">
- <el-option label="否" :value="1" />
- <el-option label="是" :value="2" />
- </el-select>
- </el-form-item>
- <el-form-item label="拉黑原因" prop="manageRemark">
- <el-input v-model="form.manageRemark" placeholder="请输入拉黑原因" type="textarea"/>
- </el-form-item>
- </el-form>
- <div slot="footer" class="dialog-footer">
- <el-button type="primary" @click="submitForm">确 定</el-button>
- <el-button @click="cancel">取 消</el-button>
- </div>
- </el-dialog>
- </div>
- </template>
- <script>
- import { listExternalContact, getExternalContact, updateExternalContact } from "@/api/qw/externalContact";
- import PaginationMore from '@/components/PaginationMore/index.vue'
- import RepeatCourseHistoryDrawer from './RepeatCourseHistoryDrawer.vue'
- export default {
- name: "ExternalContact",
- components: { PaginationMore, RepeatCourseHistoryDrawer },
- data() {
- return {
- loading: false,
- ratingUpFall: [],
- genderOptions: [],
- typeOptions: [],
- statusOptions: [],
- ratingType: [],
- addWayOptions: [],
- transferStatusOptions: [],
- ids: [],
- single: true,
- multiple: true,
- showSearch: true,
- total: 0,
- externalContactList: [],
- queryParams: {
- pageNum: 1,
- pageSize: 10,
- fsUserId: null,
- extId: null,
- },
- open: false,
- title: "",
- form: {},
- };
- },
- created() {
- //用户类别
- this.getDicts("sys_qw_externalContact_type").then(response => {
- this.typeOptions = response.data;
- });
- //客户等级
- this.getDicts("sys_qw_sop_rating_type").then(response => {
- this.ratingType = response.data;
- });
- //等级状态
- this.getDicts("sys_qw_sop_rating_upFall").then(response => {
- this.ratingUpFall = response.data;
- });
- //性别
- this.getDicts("sys_sex").then(response => {
- this.genderOptions = response.data;
- });
- //状态
- this.getDicts("sys_qw_external_contact_status").then(response => {
- this.statusOptions = response.data;
- });
- //来源
- this.getDicts("sys_qw_externalContact_addWay").then(response => {
- this.addWayOptions = response.data;
- });
- //转接状态
- this.getDicts("sys_qw_transfer_status").then(response => {
- this.transferStatusOptions = response.data;
- });
- },
- methods: {
- openRepeatCourseHistory(row) {
- const drawer = this.$refs.repeatCourseHistoryDrawer
- if (drawer && typeof drawer.open === 'function') {
- drawer.open(row)
- }
- },
- /** 查询企业微信客户列表 */
- getList() {
- this.loading = true;
- listExternalContact(this.queryParams).then(response => {
- this.externalContactList = response.rows;
- this.total = response.total;
- this.loading = false;
- });
- },
- /** 搜索按钮操作 */
- handleQuery() {
- if (!this.queryParams.fsUserId && !this.queryParams.extId) {
- return this.$message.warning({
- message: "请至少输入客户会员id或企微客户id",
- duration: 3000
- });
- }
- this.queryParams.pageNum = 1;
- this.getList();
- },
- /** 重置按钮操作 */
- resetQuery() {
- this.resetForm("queryForm");
- this.queryParams.fsUserId = null;
- this.queryParams.extId = null;
- this.externalContactList = [];
- this.total = 0;
- },
- // 多选框选中数据
- handleSelectionChange(selection) {
- this.ids = selection.map(item => item.id)
- this.single = selection.length!==1
- this.multiple = !selection.length
- },
- cancel() {
- this.open = false;
- this.reset();
- },
- reset() {
- this.form = {
- id: null,
- manageStatus: 1,
- manageRemark: null,
- };
- this.resetForm("form");
- },
- handleUpdate(row) {
- this.reset();
- const id = row.id;
- getExternalContact(id).then(response => {
- this.form = response.data;
- this.form.manageStatus = this.form.manageStatus != null ? Number(this.form.manageStatus) : 1;
- this.open = true;
- this.title = "修改企微客户";
- });
- },
- submitForm() {
- this.$refs["form"].validate(valid => {
- if (valid && this.form.id != null) {
- updateExternalContact(this.form).then(() => {
- this.msgSuccess("修改成功");
- this.open = false;
- this.getList();
- });
- }
- });
- },
- }
- };
- </script>
|