Commit be144ba4 by 匡雅琴

编辑素材修改

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