Commit e20d2c27 by 胡悦

内容管理添加展业助手相关功能

1 parent 82fa94b7
......@@ -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,33 @@ 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")
}
......@@ -6,7 +6,7 @@
size="small"
icon="el-icon-puls"
key="btn-i"
:disabled="imageUrlArr.length"
:disabled="!!imageUrlArr.length"
@click="selectFile()"
>上传文件</el-button
>
......
......@@ -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">
......@@ -128,7 +149,7 @@
</template>
<script>
import { Util, deepClone } from "@/common/util"
import { deepClone } from "@/common/util"
import {
CONTENT_TYPE_OPTIONS,
SCENE_OPTIONS,
......@@ -140,7 +161,9 @@ import {
getMerchantList,
getContenttList,
batchOperaterContent,
delContent
delContentm,
getLabelList,
receptionSceneList
} from "@api/contentManager"
export default {
name: "ContentManagerList",
......@@ -153,7 +176,8 @@ export default {
scene: "",
showChannel: "",
merchantId: "",
status: ""
status: "",
meal: ''
},
showFormData: [
{
......@@ -179,7 +203,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 +240,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 +265,7 @@ export default {
},
tableSearchForm: {},
getListApi: getContenttList,
searchFormSearch: {},
tableParams: {
btnId: new Date().getTime() + parseInt(Math.random() * 1000),
listName: "list",
......@@ -238,7 +287,8 @@ export default {
return {
0: "图片",
1: "视频",
2: "PDF"
2: "PDF",
3: "富文本"
}[cellValue.type]
}
},
......@@ -263,11 +313,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 +370,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 +434,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.customerLabelInfoList = [{
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) {
......@@ -462,6 +578,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 })
}
}
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!