Commit be144ba4 by 匡雅琴

编辑素材修改

1 parent 45ce30ec
......@@ -49,14 +49,7 @@
<!-- 选择框 -->
<div v-else-if="item.type === 'select'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem.optionId" :label="subItem.optionLabel" :value="subItem.optionId" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- 字典选择框 -->
<div v-else-if="item.type === 'selectDict'">
<el-select :style="{ width: item.width || defaultWidth }" v-model="formObj[item.name]" :clearable="item.isClear || false" :placeholder="item.placeholder || '请选择' + item.label" :filterable="!item.noFilter" :disabled="item.isDisabled" :no-data-text="item.noDataText || '无数据'" :multiple="item.multiple || false" :collapse-tags="item.collapseTags || true" @change="selectAddAttr($event, item)">
<el-option v-for="subItem in item.optionList" :key="subItem.id" :label="subItem" :value="subItem.id" :disabled="subItem.isDisabled || false"></el-option>
<el-option v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionLabel]" :value="subItem[item.optionId]" :disabled="subItem.isDisabled || false"></el-option>
</el-select>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
......
......@@ -6,8 +6,8 @@
<el-input v-model="materialGroupAddForm.materialGroupName" maxlength="8" show-word-limit :size="size" placeholder="客户跟进" style="width:567px"></el-input>
</el-form-item>
<el-form-item label="业务类型:" prop="businessType">
<el-checkbox-group class="checkbox-group" v-model="materialGroupAddForm.businessType" @change="handleCheckChange">
<el-checkbox v-for="item in businessTypes" :key="item.id" :label="item.dictLabel"></el-checkbox>
<el-checkbox-group class="checkbox-group" v-model="materialGroupAddForm.businessType">
<el-checkbox v-for="item in businessTypes" :key="item" :label="item.id">{{ item.dictLabel }}</el-checkbox>
</el-checkbox-group>
</el-form-item>
<span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
......@@ -23,7 +23,12 @@
<script>
export default {
name: 'addMaterialGroupDia',
props: { eventBus: Object },
props: {
eventBus: Object,
businessTypes: {
type: Array
}
},
data() {
return {
title: '创建素材组',
......@@ -34,7 +39,6 @@ export default {
businessType: []
},
groupCounter: [],
businessTypes: [],
materialGroupAddRules: {
materialGroupName: [
{ required: true, message: '请输入分组名称', trigger: 'blur' },
......@@ -45,10 +49,13 @@ export default {
},
methods: {
init(addOrEdit, value, group) {
this.findAllDictData()
console.log(addOrEdit, value, group, '123');
// this.findAllDictData('business_type')
console.log(value, '123');
this.dialogVisible = true
this.materialGroupAddForm = {}
this.materialGroupAddForm = {
materialGroupName: '',
businessType: []
}
this.groupCounter = group
if (addOrEdit == 2) {
this.title = '编辑素材组'
......@@ -56,7 +63,7 @@ export default {
this.materialGroupAddForm.materialGroupName = '新车素材组'
return
}
var params = []
var params = {}
params.id = value.id
this.$apis.material.materialGroupDetail(params).then(res => {
console.log(res);
......@@ -71,15 +78,10 @@ export default {
dictType
}
this.$apis.material.findAllDictData(params).then(res => {
// console.log(res, 'resres');
if (res) {
res.forEach(item => {
if (item.dictType == 'business_type') {
this.businessTypes.push(item)
}
})
// console.log(this.businessTypes);
// return this.businessTypes
if (dictType == 'business_type') {
this.businessTypes = res
}
}
})
},
......
......@@ -27,7 +27,7 @@
<div>
<ul>
<li @click="handleStick(item)">{{ item.orderTime ? '取消置顶' : '置顶' }}</li>
<li @click="handleAddGroup(2)">修改</li>
<li @click="handleAddGroup(2,item)">修改</li>
<li @click="handleDeleteGroup(item.id)">删除</li>
</ul>
</div>
......
......@@ -93,7 +93,8 @@ export default {
this.searchForm = {
customerName: '',
customerPhone: '',
staffName: ''
staffName: '',
materialId: this.materialId
}
this.handleSearch()
},
......
......@@ -21,24 +21,30 @@
</glsx-combi-form>
</div>
<div class="tabelList">
<el-row :style="{height: boxHeight}">
<el-row :style="{ height: boxHeight }">
<el-col :span="5">
<div class="left" :style="{height: boxHeight}">
<div class="left" :style="{ height: boxHeight }">
<MaterialGroup @openAddDialog="addDialogShow" :eventBus="eventBus" @getList="getList"></MaterialGroup>
</div>
</el-col>
<el-col :span="19">
<div class="right" :style="{height: boxHeight}">
<div class="right" :style="{ height: boxHeight }">
<div class="groupTitle">{{ materialGroupName ? materialGroupName : '新车素材组' }}(共{{ materialTableData.length }}条数据)</div>
<GLTable ref="materialRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="materialTableData" :pageConf="pageConf" :tableTotal="tableTotal" @sortChange="sortChange" :isCustomHead="true" :customHeadShowList="customHeadShowList">
<!-- 素材内容 -->
<div slot="materialContentRpcResponse" slot-scope="scope">
<div v-for="item in scope" :key="item">
<!-- 素材为PDF -->
<div v-if="item.materialType == 1"></div>
<!-- 素材为图文 -->
<div v-else></div>
</div>
<!-- 素材为PDF -->
<span v-if="scope.scope.materialType == 1">
<span>{{ scope.scope.materialContentRpcResponse.materialName }}</span>
<img src="@/assets/material/pdf.png" alt="">
</span>
<!-- 素材为自定义链接 -->
<span v-if="scope.scope.materialType == 2"></span>
<!-- 图文 -->
<span v-if="scope.scope.materialType == 3">
<span>{{ scope.scope.materialContentRpcResponse.materialName }}</span>
<img src="@/assets/material/car.png" alt="">
</span>
</div>
<!-- 状态 -->
<div slot="status" slot-scope="scope">
......@@ -69,7 +75,7 @@
</el-row>
</div>
</div>
<AddMaterialGroupDia ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<AddMaterialGroupDia :businessTypes="businessTypes" ref="addMaterialGroup" :dialogVisible="materialGroupDialog" :eventBus="eventBus"></AddMaterialGroupDia>
<FunctionIntroduc :introductionDialog="introductionDialog" @closeIntroductDia="closeIntroductDia"></FunctionIntroduc>
</div>
</template>
......@@ -111,9 +117,12 @@ export default {
{
label: '业务类型:',
name: 'businessType',
type: 'selectDict',
type: 'select',
placeholder: '全部',
optionList: this.businessTypes
optionList: [],
optionId: 'dictValue',
optionLabel: 'dictLabel',
optionsName: 'dictValue'
},
{
label: '素材类型:',
......@@ -128,11 +137,15 @@ export default {
{
optionId: 2,
optionLabel: '自定义链接'
},{
},
{
optionId: 3,
optionLabel: '图文'
}
]
],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'optionLabel'
},
{
label: '状态:',
......@@ -141,17 +154,21 @@ export default {
placeholder: '全部(不包括删除)',
optionList: [
{
optionId: 1,
optionId: 0,
optionLabel: '启用'
},
{
optionId: 2,
optionId: -1,
optionLabel: '禁用'
},{
optionId: 3,
},
{
optionId: 2,
optionLabel: '草稿'
}
]
],
optionId: 'optionId',
optionLabel: 'optionLabel',
optionsName: 'optionLabel'
}
],
materialFormData2: [
......@@ -206,10 +223,10 @@ export default {
width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
},
}
},
[
h('img', {
h('img', {
style: {
width: '14px',
height: '14px',
......@@ -218,8 +235,7 @@ export default {
attrs: {
src: iconUrl
},
slot: 'reference',
slot: 'reference'
})
]
)
......@@ -251,10 +267,10 @@ export default {
width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
},
}
},
[
h('img', {
h('img', {
style: {
width: '14px',
height: '14px',
......@@ -263,8 +279,7 @@ export default {
attrs: {
src: iconUrl
},
slot: 'reference',
slot: 'reference'
})
]
)
......@@ -296,10 +311,10 @@ export default {
width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
},
}
},
[
h('img', {
h('img', {
style: {
width: '14px',
height: '14px',
......@@ -308,8 +323,7 @@ export default {
attrs: {
src: iconUrl
},
slot: 'reference',
slot: 'reference'
})
]
)
......@@ -357,7 +371,9 @@ export default {
}
this.$apis.material.findAllDictData(params).then(res => {
if (res) {
this.businessTypes = res.data
this.businessTypes = res
this.materialFormData1[0].optionList = res
console.log(this.businessTypes)
}
})
},
......@@ -378,11 +394,11 @@ export default {
},
// 素材禁用
handleForbid(scope) {
console.log(scope);
console.log(scope)
var params = {}
params.id = scope.id
params.status = -1
console.log(params);
console.log(params)
this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', { params: params })
},
// 素材删除
......@@ -409,7 +425,7 @@ export default {
var fieldName = sort.prop
var sortingType = sort.order
//如果字段名称为“创建时间”,将“创建时间”转换为时间戳,才能进行大小比较
if(fieldName=="updatedTime"){
if (fieldName == 'updatedTime') {
this.materialTableData.map(item => {
item.updatedTime = this.$moment(item.updatedTime).valueOf()
})
......@@ -425,7 +441,7 @@ export default {
},
// 点击素材组获取素材组素材
getList(params, item) {
console.log(item, '7758');
console.log(item, '7758')
this.materialGroupName = item.materialGroupName
this.searchForm.groupId = item.id
this.$apis.material.materialList(params).then(res => {
......
......@@ -42,16 +42,19 @@
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">动态通知:</div>
{{ detailInfo.isNotifySender }}
<span v-if="detailInfo.isNotifySender == -1">否</span>
<span v-if="detailInfo.isNotifySender == 0">是</span>
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">素材内容:</div>
<div class="content-item">
<div class="content-item-text">
<div class="content-item-title">素材标题内容(默认)备份</div>
<div class="content-item-desc">内容内容内容内容内容内容内内内容内容内容内容内容内容内内</div>
<div class="content-item-title">{{ detailInfo.materialName }}</div>
<div class="content-item-desc">{{ detailInfo.materialUrl }}</div>
</div>
<div class="content-item-image">
<img src="@/assets/material/car.png" alt="">
</div>
<div class="content-item-image"></div>
</div>
</div>
</div>
......@@ -72,14 +75,14 @@
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">行为标签:</div>
<el-tag type="info" v-if="detailInfo.tagJson.length">{{ detailInfo.tagJson }}</el-tag>
<!-- <el-tag type="info" v-if="detailInfo.tagJson.length">{{ detailInfo.tagJson }}</el-tag> -->
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">分享设置:</div>
<div class="content-item">
<div class="content-item-text">
<div class="content-item-title">素材标题内容(默认)备份</div>
<div class="content-item-desc">内容内容内容内容内容内容内内内容内容内容内容内容内容内内</div>
<div class="content-item-title">{{ detailInfo.materialTitle }}</div>
<div class="content-item-desc">{{ detailInfo.description }}</div>
</div>
<div class="content-item-image"></div>
</div>
......@@ -95,7 +98,7 @@
<div class="summarization-time">
<span>统计时间:</span>
<el-date-picker v-model="selectTime" type="daterange" range-separator="至" start-placeholder="开始日期" end-placeholder="结束日期" :size="size"></el-date-picker>
<el-button type="primary" :size="size">确定</el-button>
<el-button type="primary" :size="size" @click="pickDate">确定</el-button>
</div>
<div class="dataList">
<div class="dataList-item">
......@@ -146,6 +149,7 @@
<script>
import staffSendDetail from './components/staffSendDetail.vue'
import readPerDetail from './components/readPerDetail.vue'
import dayjs from 'dayjs'
export default {
name: 'materialDetail',
components: {
......@@ -183,7 +187,19 @@ export default {
var params = {}
params.materialId = this.routerInfo.id
this.$apis.material.dataOverview(params).then(res => {
console.log(res);
// console.log(res);
this.overviewInfo = res
})
},
// 时间筛选数据概览
pickDate() {
var params = {}
params.materialId = this.routerInfo.id
var startTime = dayjs(this.selectTime[0]).format('YYYY-MM-DD HH:mm:ss')
var endTime = dayjs(this.selectTime[1]).format('YYYY-MM-DD HH:mm:ss')
params.startTime = startTime
params.endTime = endTime
this.$apis.material.dataOverview(params).then(res => {
this.overviewInfo = res
})
},
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!