Commit 5702a66c by chenwq

feat(一客一群): 新增一客一群预生成功能模块

- 新增一客一群主页面,包含三个标签页:一客一群、企微群管理、4S店配置
- 添加创建群活码页面及路由配置
- 实现群活码列表查询功能及相关API接口
- 新增提示信息组件,用于展示各标签页的操作说明
1 parent d9967575
...@@ -387,3 +387,9 @@ export function getVehicleConditionInfoPage(data = {}) { ...@@ -387,3 +387,9 @@ export function getVehicleConditionInfoPage(data = {}) {
timeout: 30000, timeout: 30000,
}); });
} }
/**
* 一客一码分页列表
*/
export function getLiveCodePage(data) {
return gscPost("/liveCode/page", data);
}
...@@ -458,4 +458,79 @@ export const routerName = { ...@@ -458,4 +458,79 @@ export const routerName = {
], ],
component: _import("usedCarManagement/vehicleConditionInfo/index"), component: _import("usedCarManagement/vehicleConditionInfo/index"),
}, },
92010: {
path: "/oneCustomerOneGroup",
name: "oneCustomerOneGroup",
meta: {
title: "一客一群(预生成)",
authId: "92010",
parentId: "920",
cache: false,
},
auth: [
{
authId: "9201001",
parentId: "92010",
label: "创建群活码",
category: "Button",
type: "primary",
handle: "handleEditGroupCode",
addRoutePath: [
{
authId: "9201006",
name: "创建群活码",
parentId: "92010",
},
],
},
{
authId: "9201002",
parentId: "92010",
label: "批量删除",
category: "Button",
type: "primary",
handle: "handleBatchDelete",
},
{
authId: "9201003",
parentId: "92010",
label: "下载",
handle: "handleDownload",
},
{
authId: "9201004",
parentId: "92010",
label: "修改",
handle: "handleEdit",
},
{
authId: "9201005",
parentId: "92010",
label: "删除",
handle: "handleDelete",
},
{
authId: "9201007",
parentId: "92010",
label: "新增配置",
category: "Button",
type: "primary",
handle: "handleEditConfig",
},
],
component: _import("usedCarManagement/oneCustomerOneGroup/index"),
},
9201006: {
path: "/createGroupCode",
name: "createGroupCode",
meta: {
title: "创建群活码",
authId: "9201006",
parentId: "92010",
activePath: "/oneCustomerOneGroup",
cache: false,
},
auth: [],
component: _import("usedCarManagement/oneCustomerOneGroup/createGroupCode"),
},
}; };
<template>
<d2-container class="container">
<template #header>
<div class="header">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
label-width="100px"
/>
<div class="up-btns">
<el-button
:id="tableParams.btnId"
size="small"
type="primary"
>
查询
</el-button>
<el-button size="small" @click="handleReset">
重置
</el-button>
</div>
</div>
</template>
<div class="d2-container-content">
<d2-table-header :left-span="12">
<span slot="left" class="title">群列表</span>
<span style="display: inline-block; margin-right: 10px">
<auth-button
category="Button"
:show-btn-ids="['9201001']"
/>
</span>
<span style="display: inline-block">
<auth-button
category="Button"
:show-btn-ids="['9201002']"
/>
</span>
</d2-table-header>
<d2-table
ref="recordTable"
:search-form="{
t: searchFormSearch,
}"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
:selectable-fn="selectableFn"
>
<template #auth-button="scope">
<div width="400">
<span style="margin-right: 10px">
<auth-button
:data="scope.scope"
:show-btn-ids="['9201003']"
/>
</span>
<span style="margin-right: 10px">
<auth-button
:data="scope.scope"
:show-btn-ids="['9201004']"
/>
</span>
<span>
<auth-button
:data="scope.scope"
:show-btn-ids="['9201005']"
/>
</span>
</div>
</template>
</d2-table>
</div>
</d2-container>
</template>
<script>
import { getLiveCodePage } from "@/api/usedCarManagement";
export default {
name: "OneCustomerGroupTab",
data() {
return {
searchForm: {
liveName: "",
remark: "",
createdBy: "",
},
searchFormSearch: {},
showFormData: [
{
label: "活码名称",
name: "liveName",
type: "input",
placeholder: "请输入活码名称",
maxLength: 50,
},
{
label: "备注",
name: "remark",
type: "input",
placeholder: "请输入备注",
maxLength: 50,
},
{
label: "创建人",
name: "createdBy",
type: "input",
placeholder: "请输入创建人",
maxLength: 50,
},
],
getListApi: getLiveCodePage,
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "records",
tableOption: true,
tableColumns: [
{ label: "活码名称", prop: "liveName", minWidth: "150" },
{ label: "备注", prop: "remark", minWidth: "120" },
{ label: "群总数", prop: "groupCount", width: "100" },
{
label: "已接待客户群",
prop: "occupiedGroupCount",
width: "120",
},
{
label: "可接待客户群",
prop: "idleGroupCount",
width: "120",
},
{ label: "创建时间", prop: "createdDate", width: "80" },
{ label: "创建人", prop: "createdBy", minWidth: "150" },
],
},
};
},
methods: {
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = { ...this.searchForm };
resolve();
});
},
selectableFn(row) {
return true;
},
handleReset() {
this.searchForm = {
liveName: "",
remark: "",
createdBy: "",
};
this.searchFormSearch = { ...this.searchForm };
this.$refs.recordTable.refreshTable(true, true);
},
handleEditGroupCode() {
this.$router.push({ name: "createGroupCode" });
},
handleBatchDelete() {
this.$message.info("点击了批量删除");
},
handleSelectionChange(val) {
console.log("selection", val);
},
handleDownload(row) {
if (!row.defaultQrCodeUrl) {
this.$message.error("该群未配置二维码");
return;
}
let a = document.createElement("a");
a.setAttribute("id", "exportToExport");
a.setAttribute("href", row.defaultQrCodeUrl || "");
a.setAttribute("target", "_blank");
document.body.appendChild(a);
a.click();
},
handleDelete(row) {
this.$message.info("点击了删除: " + row.id);
},
},
};
</script>
<style lang="scss" scoped>
.container {
margin-top: 100px;
.title {
color: #333333;
font-size: 16px;
}
}
</style>
<template>
<div class="store-config-tab">
<el-empty description="4S店配置 - 开发中"></el-empty>
</div>
</template>
<script>
export default {
name: "StoreConfigTab",
};
</script>
<style lang="scss" scoped>
.store-config-tab {
background: #fff;
padding: 40px;
border-radius: 4px;
}
</style>
<template>
<div class="tips-box-container">
<i class="el-icon-warning"></i>
<div class="tips-content">
<div v-for="(tip, index) in tips" :key="index" class="tip-item">
<span class="tip-text">{{ tip }}</span>
</div>
</div>
</div>
</template>
<script>
export default {
name: "TipsBox",
props: {
tips: {
type: Array,
default: () => [],
},
},
};
</script>
<style lang="scss" scoped>
.tips-box-container {
background: #fff3e8;
padding: 8px 20px;
display: flex;
align-items: flex-start; /* 顶部对齐 */
.el-icon-warning {
color: #ff8d1a;
margin: 2px 6px 0 0;
}
.tips-content {
.tip-item {
margin: 0;
font-size: 13px;
color: #ff8d1a;
.tip-text {
flex: 1; /* 让文字部分占据剩余空间 */
}
}
}
}
</style>
<template>
<div class="wecom-group-tab">
<el-empty description="企微群管理 - 开发中"></el-empty>
</div>
</template>
<script>
export default {
name: "WecomGroupTab",
};
</script>
<style lang="scss" scoped>
.wecom-group-tab {
background: #fff;
padding: 40px;
border-radius: 4px;
}
</style>
<template>
<div class="create-group-code">
<el-card>
<div slot="header" class="clearfix">
<span>创建群活码</span>
<el-button style="float: right; padding: 3px 0" type="text" @click="handleBack">返回</el-button>
</div>
<el-form ref="form" :model="form" label-width="120px" style="max-width: 600px; margin: 20px auto;">
<el-form-item label="活码名称" prop="name" :rules="[{ required: true, message: '请输入活码名称', trigger: 'blur' }]">
<el-input v-model="form.name" placeholder="请输入活码名称"></el-input>
</el-form-item>
<el-form-item label="备注" prop="remark">
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注"></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" @click="onSubmit">保存</el-button>
<el-button @click="handleBack">取消</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</template>
<script>
export default {
name: 'CreateGroupCode',
data() {
return {
form: {
name: '',
remark: ''
}
}
},
methods: {
onSubmit() {
this.$refs.form.validate((valid) => {
if (valid) {
this.$message.success('保存成功')
this.handleBack()
}
})
},
handleBack() {
this.$router.go(-1)
}
}
}
</script>
<style lang="scss" scoped>
.create-group-code {
padding: 20px;
}
</style>
<template>
<div class="one-customer-one-group">
<el-tabs v-model="activeName" class="custom-tabs" @tab-click="handleClick">
<el-tab-pane
v-for="(item, index) in tabPaneList"
:key="index"
:label="item.label"
:name="item.name"
>
</el-tab-pane>
</el-tabs>
<TipsBox :tips="tabPaneList[activeIdx].tips" />
<OneCustomerGroupTab v-if="activeName === 'oneCustomerGroup'" />
<WecomGroupTab v-if="activeName === 'wecomGroup'" />
<StoreConfigTab v-if="activeName === 'storeConfig'" />
</div>
</template>
<script>
import OneCustomerGroupTab from "./components/OneCustomerGroupTab.vue";
import WecomGroupTab from "./components/WecomGroupTab.vue";
import StoreConfigTab from "./components/StoreConfigTab.vue";
import TipsBox from "./components/TipsBox.vue";
export default {
name: "OneCustomerOneGroup",
components: {
OneCustomerGroupTab,
WecomGroupTab,
StoreConfigTab,
TipsBox,
},
data() {
return {
activeName: "oneCustomerGroup",
activeIdx: 0,
tabPaneList: [
{
label: "一客一群",
name: "oneCustomerGroup",
tips: [
"1、可将多个群二维码组合生成一个活码,当客户扫码进群后即与该群产生绑定,不会在接待新的客户入群。你好!欢迎使用企微魔方功能。",
"2、如群码内设置的可用群聊不足时,可使用自动创群功能自动创建群聊并填充至对应活码中。",
],
},
{
label: "企微群管理",
name: "wecomGroup",
tips: ["管理企微已新建群数据,并支持手动释放企微群。"],
},
{
label: "4S店配置",
name: "storeConfig",
tips: [
"管理并配置各4S店与其对应的总部定价师关联关系,以便线索精确分配。",
],
},
],
};
},
methods: {
handleClick(tab, event) {
this.activeIdx = tab.index;
this.activeName = tab.name;
},
},
};
</script>
<style lang="scss" scoped>
.one-customer-one-group {
padding: 0 20px 20px 20px;
background-color: #f0f2f5;
min-height: calc(100vh - 100px);
::v-deep .custom-tabs {
.el-tabs__header {
background-color: #fff;
padding: 0 20px;
margin: 0;
}
.el-tabs__nav-wrap::after {
height: 1px;
background-color: #e4e7ed;
}
.el-tabs__item {
height: 54px;
line-height: 54px;
font-size: 16px;
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!