Commit 81662038 by 王志慧

Merge branch 'SAAS+V4.44.1' into 'SAAS+V4.44.3-0920'

开发提测合并

See merge request !363
2 parents 09fca1a7 3f6341c3
......@@ -40,12 +40,12 @@ export function exportStatisticsList(data) {
// 新增内容
export function addContent(data) {
data.method = `${path}material.record.add`
return request(data)
return request(data, "post")
}
// 编辑内容
export function updateContent(data) {
data.method = `${path}material.record.update`
return request(data)
return request(data, "post")
}
// 获取会员权益/升级和积分商城 门店
......@@ -101,3 +101,60 @@ export function contentManagerTaskById(data) {
data.method = `dj.api.smartcarlife.contentManagerTask.getById`
return request(data, "POST")
}
// 获取接待场景
export function receptionSceneList(data) {
data.method = 'dj.api.material.reception.scene.list'
return request(data, "POST")
}
// 获取客户标签树
export function getLabelList(data) {
data.method = 'dj.api.material.customer.label.list'
return request(data, "POST")
}
// 单一商品
export function listAllInWithPage(data) {
data.method = 'dj.api.smartcarlife.upgradeGoods.listAllInWithPage'
return request(data, "POST")
}
// 套餐商品
export function allInPage(data) {
data.method = 'dj.api.smartcarlife.merchantPackageGoodsInfo.allInPage'
return request(data, "POST")
}
// 获取产品词条列表
export function productTextPage(data) {
data.method = 'dj.api.material.product.text.page'
return request(data, "POST")
}
// 分页获取产品词条列表
export function productPage(data) {
data.method = `dj.api.material.product.text.page`
return request(data, "POST")
}
// 获取产品词条详情
export function productDetail(data) {
data.method = `dj.api.material.product.text.detail`
return request(data, "POST")
}
// 删除产品词条
export function productDelete(data) {
data.method = `dj.api.material.product.text.delete`
return request(data, "POST")
}
// 保存产品词条
export function productSave(data) {
data.method = `dj.api.material.product.text.save`
return request(data, "POST")
}
// 更新产品词条
export function productUpdate(data) {
data.method = `dj.api.material.product.text.update`
return request(data, "POST")
}
......@@ -270,5 +270,17 @@ export const routerName = {
activePath: "/staffMassSending"
},
component: _import("contentManager/sopContentDetail")
},
91308: {
path: "/productEntry",
name: "productEntry",
meta: {
title: "产品词条",
authId: "91308",
parentId: "913",
cache: false
},
auth: [],
component: _import("contentManager/productEntry/index")
}
}
......@@ -6,7 +6,7 @@
size="small"
icon="el-icon-puls"
key="btn-i"
:disabled="imageUrlArr.length"
:disabled="!!imageUrlArr.length"
@click="selectFile()"
>上传文件</el-button
>
......
/*
* @Description:
* @Author: huyue
* @Date: 2024-04-01 15:03:31
* @LastEditors: huyue
* @LastEditTime: 2024-09-02 16:06:04
*/
// 内容类型
export const CONTENT_TYPE_OPTIONS = [
{
......@@ -11,6 +18,10 @@ export const CONTENT_TYPE_OPTIONS = [
{
id: 2,
label: "PDF"
},
{
id: 3,
label: "富文本"
}
]
// 场景
......@@ -45,6 +56,10 @@ export const CHANNEL_OPTIONS = [
{
id: 1,
label: "营销素材"
},
{
id: 2,
label: "展业助手"
}
]
// 状态
......
......@@ -6,8 +6,32 @@
ref="showSearch"
class="show-search"
:search-form="searchForm"
:form-data="showFormData"
>
:form-data="showFormData">
<div slot="customerLabel">
<el-select v-model="searchForm.customerLabel" clearable value-key="labelId" @focus="focus('tag')" placeholder="请选择">
<el-option-group
v-for="group in tagList"
:key="group.labelId"
:label="group.labelName">
<el-option
v-for="item in group.nextList"
:key="item.labelId"
:label="item.labelName"
:value="item">
</el-option>
</el-option-group>
</el-select>
</div>
<div slot="receptionScene">
<el-select v-model="searchForm.receptionScene" clearable value-key="id" @focus="focus('reception')" placeholder="请选择">
<el-option
v-for="item in receptionSceneList"
:key="item.id"
:label="item.receptionSceneName"
:value="item">
</el-option>
</el-select>
</div>
</d2-search>
<div class="up-btns">
<el-button :id="tableParams.btnId" size="small" type="primary" handle>
......@@ -34,11 +58,10 @@
</d2-table-header>
<d2-table
ref="contentTable"
:search-form="searchForm"
:search-form="searchFormSearch"
:table-params="tableParams"
:get-list-api="getListApi"
:before-search-fn="beforeSearchFn"
>
:before-search-fn="beforeSearchFn">
<div slot="merchantSlot" slot-scope="scope">
<div v-if="scope.scope.showMerchant == 0">全部门店</div>
<el-popover v-else placement="top" width="245" trigger="hover">
......@@ -46,8 +69,7 @@
<div
class="merchant-name"
v-for="(item, index) in scope.scope.assignInfos || []"
:key="index"
>
:key="index">
{{ item.assignName }}
</div>
</div>
......@@ -63,8 +85,7 @@
:style="{
'background-color': statusEnum[scope.scope.status].color
}"
class="circle"
></span>
class="circle"></span>
<span>{{ statusEnum[scope.scope.status].name }}</span>
</div>
<div slot="auth-button" slot-scope="scope">
......@@ -121,6 +142,7 @@
<auth-button :data="scope.scope" :show-btn-ids="['9130103']" />
</span>
</template>
<el-button v-show="scope.scope.showChannel == 2" type="text" size="mini" @click="handleClone(scope.scope)">克隆</el-button>
</div>
</d2-table>
</div>
......@@ -128,7 +150,7 @@
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { deepClone } from "@/common/util"
import {
CONTENT_TYPE_OPTIONS,
SCENE_OPTIONS,
......@@ -140,7 +162,9 @@ import {
getMerchantList,
getContenttList,
batchOperaterContent,
delContent
delContent,
getLabelList,
receptionSceneList
} from "@api/contentManager"
export default {
name: "ContentManagerList",
......@@ -153,7 +177,8 @@ export default {
scene: "",
showChannel: "",
merchantId: "",
status: ""
status: "",
meal: ''
},
showFormData: [
{
......@@ -179,7 +204,17 @@ export default {
optionList: [],
optionId: "id",
optionLabel: "label",
optionsName: "sceneOptions"
optionsName: "sceneOptions",
changeAttr: (value, targetItem) => {
console.log(value)
if (value !== '') {
this.getLabelList(value)
this.receptionList(value)
} else {
this.tagList = []
this.receptionSceneList = []
}
}
},
{
label: "可见渠道",
......@@ -206,6 +241,20 @@ export default {
optionId: "id",
optionLabel: "label",
optionsName: "statuslOptions"
},
{
label: "客户标签",
name: "customerLabel",
addHtml: "customerLabel"
},
{
label: "接待场景",
name: "receptionScene",
addHtml: "receptionScene"
// optionList: [],
// optionId: "id",
// optionLabel: "label",
// optionsName: "receptionSceneOptions"
}
],
// 基本数据
......@@ -217,6 +266,7 @@ export default {
},
tableSearchForm: {},
getListApi: getContenttList,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
......@@ -238,7 +288,8 @@ export default {
return {
0: "图片",
1: "视频",
2: "PDF"
2: "PDF",
3: "富文本"
}[cellValue.type]
}
},
......@@ -263,11 +314,36 @@ export default {
formatter: (cellValue) => {
return {
0: "培训资料",
1: "营销素材"
1: "营销素材",
2: "展业助手"
}[cellValue.showChannel]
}
},
{
label: "客户标签",
prop: "customerLabelInfoList",
width: "120px",
formatter: (cellValue) => {
return cellValue.customerLabelInfoList && cellValue.customerLabelInfoList.length > 0 ? cellValue.customerLabelInfoList.map(item => item.labelName).join(",") : '-'
}
},
{
label: "关联商品",
prop: "productPackageInfoList",
width: "200px",
formatter: (cellValue) => {
return cellValue.productPackageInfoList && cellValue.productPackageInfoList.length > 0 ? cellValue.productPackageInfoList.map(item => item.upgradeGoodsName).join(",") : '-'
}
},
{
label: '接待场景',
prop: "receptionSceneInfoList",
width: '120px',
formatter: (cellValue) => {
return cellValue.receptionSceneInfoList && cellValue.receptionSceneInfoList.length > 0 ? cellValue.receptionSceneInfoList.map(item => item.receptionSceneName).join(",") : '-'
}
},
{
label: "可见门店",
prop: "showMerchant",
width: "120px",
......@@ -295,10 +371,24 @@ export default {
prop: "createdDate"
}
]
}
},
// 客户档案相关内容
loading: false,
mealList: [
{
upgradeGoodsName: 'test1',
id: 1
}
],
mealPage: {
pageSize: 10,
currentPage: 1
},
mealTotal: 0,
tagList: [],
receptionSceneList: []
}
},
mounted() {
var params = { currentPage: 1, pageSize: 2000, merchantIdName: "" }
this.getBaseData()
......@@ -345,13 +435,40 @@ export default {
for (const key in this.searchForm) {
this.searchForm[key] = ""
}
this.tagList = []
this.receptionSceneList = []
this.$refs.contentTable.refreshTable(true, true)
},
beforeSearchFn() {
return new Promise((resolve) => {
this.searchFormSearch = this.getParams()
resolve()
})
},
getParams() {
console.log(this.searchForm)
var params = deepClone(this.searchForm)
// if (params.meal) {
// params.meal = params.meal.join(',')
// }
if (params.customerLabel) {
params.customerLabelList = [{
labelId: params.customerLabel.labelId,
labelName: params.customerLabel.labelName,
level: 2,
parentId: params.customerLabel.parentId
}]
delete params.customerLabel
}
if (params.receptionScene) {
params.receptionSceneInfoList = [{
receptionSceneId: params.receptionScene.id,
receptionSceneName: params.receptionScene.receptionSceneName
}]
delete params.receptionScene
}
return params
},
handleAdd(row) {
const query = {}
if (row?.id) {
......@@ -396,6 +513,15 @@ export default {
}
})
},
handleClone(row) {
console.log(row)
this.$router.push({
name: "contentAdd",
params: {
id: row.id
}
})
},
// 批量启用
mutiStart() {
this.mutiStartOrStop(1)
......@@ -462,6 +588,25 @@ export default {
.catch((err) => {
console.log(err)
})
},
focus(name) {
console.log(this.searchForm.scene)
if (this.searchForm.scene === '') {
return this.$message.error(`请先选择业务场景`)
}
// if (name == 'tag') {
// this.getLabelList(this.searchForm.scene)
// } else if (name == 'reception') {
// this.receptionList(this.searchForm.scene)
// }
},
// 获取接待场景
async receptionList(scene) {
this.receptionSceneList = await receptionSceneList({ scene })
},
// 获取客户标签
async getLabelList(scene) {
this.tagList = await getLabelList({ scene })
}
}
}
......
<!-- 员工群发 - 列表 -->
<template>
<div>
<!-- class="order-detail" -->
<d2-container>
<!-- <div class="offline-account"> -->
<div class="header" slot="header" style="padding: 10px 20px">
<d2-search
ref="showSearch"
class="show-search"
:search-form="searchForm"
:label-width="labelWidth"
:form-data="showFormData"
/>
<div class="up-btns">
<el-button @click="handleSearch" size="small" type="primary">
查询
</el-button>
<el-button size="small" @click="handleReset"> 重置 </el-button>
</div>
</div>
<div class="d2-container-content">
<div class="content-panel">
<div class="content-item item-first" @click="handleAdd">
<div class="first-add">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
</div>
<div class="first-desc">新增产品词条</div>
</div>
<div class="content-item" v-for="item in productList" :key="item.id">
<div class="content-title">
{{ item.headings }}
</div>
<div class="content-time">
创建时间:{{ item.createdDate | formatTime }}
</div>
<div class="content-footer">
<a class="edit-btn" @click="handleEdit(item)">编辑</a>
<a class="del-btn" @click="handleDel(item)">删除</a>
</div>
</div>
</div>
<el-pagination
background
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page="currentPage"
:page-sizes="[10, 20, 30, 40]"
:page-size="10"
:total="total"
layout="sizes,total,->,prev,pager,next,jumper"
/>
</div>
</d2-container>
<add-drawer
@close="close"
:form="form"
:dialogVisible="dialogVisible"
v-if="dialogVisible"
></add-drawer>
</div>
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { contentTypeList, sendStatusList } from "@/common/constants.js"
import { productPage, productDetail, productDelete } from "@api/contentManager"
import AddDrawer from "../components/AddDrawer/index"
export default {
name: "productEntry",
components: {
AddDrawer
},
data() {
return {
currentPage: 1,
pageSize: 10,
total: 0,
dialogVisible: false,
labelWidth: "100px",
searchForm: {
headings: ""
},
form: {},
productList: [
{
id: 1
},
{
id: 12
},
{
id: 13
},
{
id: 14
},
{
id: 15
},
{
id: 16
}
],
searchFormSearch: {},
showFormData: [
{
label: "产品名称",
name: "headings",
type: "input",
maxlength: "20",
isClear: true
}
],
baseData: {
contentTypeList: deepClone(contentTypeList),
sendStatusList: deepClone(sendStatusList)
},
infos: [],
recordInfo: null,
addVisible: false
}
},
mounted() {
this.getList()
},
filters: {
formatTime(time) {
return Util.dateFormate(time, "YYYY-MM-DD HH:mm:ss")
}
},
methods: {
handleSizeChange(val) {
this.pageSize = val
this.getList()
},
handleCurrentChange(val) {
console.log(`当前页: ${val}`)
this.currentPage = val
this.getList()
},
getList() {
productPage({
pageSize: this.pageSize,
currentPage: this.currentPage,
headings: this.searchForm.headings
}).then((res) => {
const { list, total } = res || {}
this.productList = list
this.total = total
})
},
close() {
this.dialogVisible = false
this.handleSearch()
},
handleEdit(row) {
productDetail({ id: row.id }).then((res) => {
this.form = res || {}
})
this.dialogVisible = true
},
handleAdd() {
this.form = {
pictureList: [],
content: "",
audio: ""
}
this.dialogVisible = true
},
handleSearch() {
this.getList()
},
handleReset() {
this.searchForm = {
headings: ""
}
this.handleSearch()
},
// 删除
handleDel(row) {
this.$confirm("删除后不可恢复,是否确定删除?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning",
closeOnClickModal: false
})
.then(() => {
productDelete({ id: row.id }).then((res) => {
this.notice.okTips()
this.getList()
})
})
.catch((err) => {
console.log(err)
})
},
goStatisticsPage(row) {
this.$router.push({
name: "statisticsPage",
query: {
id: row.id,
title: row.title
}
})
}
}
}
</script>
<style scoped lang="scss">
.count-txt {
font-weight: 700;
color: #2a58ad;
margin: 0 2px;
}
.d2-container-content {
height: calc(100vh - 300px);
.content-panel {
height: calc(100% - 20px);
}
}
.leftSpan {
display: inline-block;
box-sizing: border-box;
margin-right: 10px;
}
.content-panel {
width: 100%;
display: grid;
grid-template-columns: repeat(4, 1fr); /* 将容器分成四个相等的部分 */
grid-gap: 30px;
grid-template-rows: repeat(3, 124px); /* 两行,每行100px */
.content-item {
width: 100%;
height: 124px;
border-radius: 4px;
opacity: 1;
border: 1px solid #0000001a;
background: #ffffff;
box-shadow: 0 0 8px 0 #0000000d;
padding: 16px;
box-sizing: border-box;
.content-title {
color: #333333;
font-size: 16px;
font-weight: 600;
white-space: nowrap;
text-overflow: ellipsis;
overflow: hidden;
width: 100%;
}
.content-time {
color: #999999;
font-size: 12px;
margin: 6px 0;
}
.content-footer {
border-top: 1px solid #0000001a;
height: 60px;
line-height: 60px;
a {
font-size: 14px;
color: #666666;
cursor: pointer;
&.edit-btn {
color: #185efe;
font-size: 14px;
margin-right: 10px;
}
}
}
&.item-first {
text-align: center;
border: 1px solid #00000026;
background: #0000000a;
cursor: pointer;
.first-add {
i {
font-size: 16px;
margin-top: 20px;
}
}
.first-desc {
color: #666666;
font-size: 14px;
line-height: 32px;
}
}
}
}
</style>
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!