Commit aa8bc78b by 匡雅琴

详情联调

1 parent be144ba4
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
<!-- 选择PDF --> <!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1"> <div v-show="materialAddForm.materialType == 1">
<div class="pdf-show"> <div class="pdf-show">
<input type="file" style="opacity: 0" accept=".pdf" @change="handlePdfChange(e)" /> <input type="file" style="opacity: 0" accept=".pdf" @change="e => handlePdfChange(e)" />
<el-button icon="el-icon-plus" :size="size">选择文件</el-button> <el-button icon="el-icon-plus" :size="size">选择文件</el-button>
</div> </div>
</div> </div>
...@@ -142,7 +142,7 @@ ...@@ -142,7 +142,7 @@
<div class="avatar-uploader-desc"> <div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i> <i class="el-icon-plus avatar-uploader-desc-icon"></i>
<div class="avatar-uploader-desc-word">上传照片</div> <div class="avatar-uploader-desc-word">上传照片</div>
<input type="file" style="opacity: 0" accept=".pdf" @change="handleImgChange(e)" /> <input type="file" style="opacity: 0" accept=".jpg, .jpeg, .png" @change="e => handleImgChange(e)" />
</div> </div>
<div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div> <div @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div>
</div> </div>
...@@ -259,6 +259,16 @@ export default { ...@@ -259,6 +259,16 @@ export default {
this.$apis.material.materialDetail(params).then(res => { this.$apis.material.materialDetail(params).then(res => {
// console.log(res,'1212121212'); // console.log(res,'1212121212');
this.materialAddForm = res this.materialAddForm = res
if (res.businessType) {
this.materialAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
} else {
this.materialGroupAddForm.businessType = []
}
if (res.isNotifySender == 0) {
this.materialGroupAddForm.isNotifySender = true
} else {
this.materialGroupAddForm.isNotifySender = false
}
}) })
}, },
// 获取全部素材组 // 获取全部素材组
...@@ -304,6 +314,7 @@ export default { ...@@ -304,6 +314,7 @@ export default {
}, },
// 上传PDF // 上传PDF
handlePdfChange(e) { handlePdfChange(e) {
console.log(e)
var file = e.srcElement.files[0] var file = e.srcElement.files[0]
var reader = new FileReader() var reader = new FileReader()
// 默认10MB // 默认10MB
...@@ -319,7 +330,8 @@ export default { ...@@ -319,7 +330,8 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
console.log(res) // console.log(res)
this.materialAddForm.materialUrl = res.data
} }
}) })
} }
...@@ -332,7 +344,7 @@ export default { ...@@ -332,7 +344,7 @@ export default {
const limitSize = 1 const limitSize = 1
const isLt = file.size / 1024 / 1024 < limitSize const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) { if (!isLt) {
this.$message.error('上传PDF大小不能超过' + limitSize + 'MB!') this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true return true
} }
reader.readAsDataURL(file) reader.readAsDataURL(file)
...@@ -341,7 +353,8 @@ export default { ...@@ -341,7 +353,8 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1] const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => { this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) { if (res) {
console.log(res) // console.log(res)
this.materialAddForm.titleUrl = res.data
} }
}) })
} }
......
...@@ -3,11 +3,11 @@ ...@@ -3,11 +3,11 @@
<el-dialog :title="title" :visible.sync="dialogVisible" width="720px" :before-close="!dialogVisible"> <el-dialog :title="title" :visible.sync="dialogVisible" width="720px" :before-close="!dialogVisible">
<el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="110px" :rules="materialGroupAddRules"> <el-form ref="materialGroupAddForm" :model="materialGroupAddForm" label-width="110px" :rules="materialGroupAddRules">
<el-form-item label="分组名称:" prop="materialGroupName"> <el-form-item label="分组名称:" prop="materialGroupName">
<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"> <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 v-for="item in businessTypes" :key="item.id" :label="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,12 +23,12 @@ ...@@ -23,12 +23,12 @@
<script> <script>
export default { export default {
name: 'addMaterialGroupDia', name: 'addMaterialGroupDia',
props: { props: {
eventBus: Object, eventBus: Object,
businessTypes: { businessTypes: {
type: Array type: Array
} }
}, },
data() { data() {
return { return {
title: '创建素材组', title: '创建素材组',
...@@ -50,7 +50,7 @@ export default { ...@@ -50,7 +50,7 @@ export default {
methods: { methods: {
init(addOrEdit, value, group) { init(addOrEdit, value, group) {
// this.findAllDictData('business_type') // this.findAllDictData('business_type')
console.log(value, '123'); console.log(value, '123')
this.dialogVisible = true this.dialogVisible = true
this.materialGroupAddForm = { this.materialGroupAddForm = {
materialGroupName: '', materialGroupName: '',
...@@ -66,8 +66,13 @@ export default { ...@@ -66,8 +66,13 @@ export default {
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, '---')
this.materialGroupAddForm = res this.materialGroupAddForm = res
if (res.businessType) {
this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
} else {
this.materialGroupAddForm.businessType = []
}
}) })
} }
// Object.assign(this.materialGroupAddForm, value) // Object.assign(this.materialGroupAddForm, value)
...@@ -87,22 +92,9 @@ export default { ...@@ -87,22 +92,9 @@ export default {
}, },
// 创建 // 创建
submitForm() { submitForm() {
console.log(this.materialGroupAddForm); console.log(this.materialGroupAddForm)
this.$refs.materialGroupAddForm.validate((valid) => { this.$refs.materialGroupAddForm.validate(valid => {
if (valid) { if (valid) {
// 判断素材组名称是否重复
var groupName = []
this.groupCounter.forEach(item => {
groupName.push(item.materialGroupName)
})
var idx = groupName.indexOf(this.materialGroupAddForm.materialGroupName)
if (idx != -1) {
this.$message({
message: '素材组名称不能重复',
type: 'warning'
})
return
}
// 判断是创建还是编辑 // 判断是创建还是编辑
// debugger // debugger
if (this.materialGroupAddForm.id) { if (this.materialGroupAddForm.id) {
...@@ -110,6 +102,19 @@ export default { ...@@ -110,6 +102,19 @@ export default {
this.dialogVisible = false this.dialogVisible = false
return return
} }
// 判断素材组名称是否重复
var groupName = []
this.groupCounter.forEach(item => {
groupName.push(item.materialGroupName)
})
var idx = groupName.indexOf(this.materialGroupAddForm.materialGroupName)
if (idx != -1) {
this.$message({
message: '素材组名称不能重复',
type: 'warning'
})
return
}
this.eventBus.$emit('addMaterialGroup', this.materialGroupAddForm) this.eventBus.$emit('addMaterialGroup', this.materialGroupAddForm)
this.dialogVisible = false this.dialogVisible = false
} else { } else {
...@@ -117,12 +122,12 @@ export default { ...@@ -117,12 +122,12 @@ export default {
message: '请输入素材组名称', message: '请输入素材组名称',
type: 'warning' type: 'warning'
}) })
return false; return false
} }
}); })
}, },
handleCheckChange(val) { handleCheckChange(val) {
console.log(val); console.log(val)
this.materialGroupAddForm.businessType = val this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm); // console.log(this.materialGroupAddForm);
} }
...@@ -134,7 +139,7 @@ export default { ...@@ -134,7 +139,7 @@ export default {
.checkbox-group { .checkbox-group {
width: 567px; width: 567px;
box-sizing: border-box; box-sizing: border-box;
background: #F5F5F5; background: #f5f5f5;
padding: 16px 0 0 16px; padding: 16px 0 0 16px;
.el-checkbox { .el-checkbox {
width: 140px; width: 140px;
......
...@@ -63,7 +63,7 @@ ...@@ -63,7 +63,7 @@
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button> <el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button>
<el-popover placement="right" trigger="click"> <el-popover placement="right" trigger="click">
<ul> <ul>
<li @click="handleForbid(scope.scope)">禁用</li> <li @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</li>
<li @click="handleDelete(scope.scope)">删除</li> <li @click="handleDelete(scope.scope)">删除</li>
</ul> </ul>
<el-button type="text" slot="reference" class="btn-more">更多</el-button> <el-button type="text" slot="reference" class="btn-more">更多</el-button>
...@@ -186,7 +186,7 @@ export default { ...@@ -186,7 +186,7 @@ export default {
{ {
label: '素材内容', label: '素材内容',
prop: 'materialContentRpcResponse', prop: 'materialContentRpcResponse',
addHtml: 'materialContent', addHtml: 'materialContentRpcResponse',
width: 240 width: 240
}, },
{ {
...@@ -288,50 +288,6 @@ export default { ...@@ -288,50 +288,6 @@ export default {
} }
}, },
{ {
label: '有效阅读人数',
prop: 'effect_readPer',
sortable: true,
width: 180,
renderHeader: (h, { column, $index }) => {
return h(
'div',
{
style: {
display: 'inline-flex',
'align-items': 'center'
}
},
[
'有效阅读人数',
h(
'el-popover',
{
attrs: {
placement: 'top-start',
width: '240',
trigger: 'hover',
content: '用户购买活动商品的总销售额。'
}
},
[
h('img', {
style: {
width: '14px',
height: '14px',
'margin-left': '4px'
},
attrs: {
src: iconUrl
},
slot: 'reference'
})
]
)
]
)
}
},
{
label: '更新时间', label: '更新时间',
prop: 'updatedTime', prop: 'updatedTime',
width: 180, width: 180,
...@@ -399,7 +355,7 @@ export default { ...@@ -399,7 +355,7 @@ export default {
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 )
}, },
// 素材删除 // 素材删除
handleDelete(scope) { handleDelete(scope) {
......
...@@ -22,8 +22,8 @@ ...@@ -22,8 +22,8 @@
<span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span> <span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span>
</div> </div>
</div> </div>
<div class="materialDetail-desc-item"> <div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1">
<div class="materialDetail-item-name">素材地址:</div> <div class="materialDetail-item-name" v-if="detailInfo.materialType == 1">素材地址:</div>
{{ detailInfo.materialUrl }} {{ detailInfo.materialUrl }}
<span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span> <span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
</div> </div>
...@@ -50,10 +50,11 @@ ...@@ -50,10 +50,11 @@
<div class="content-item"> <div class="content-item">
<div class="content-item-text"> <div class="content-item-text">
<div class="content-item-title">{{ detailInfo.materialName }}</div> <div class="content-item-title">{{ detailInfo.materialName }}</div>
<div class="content-item-desc">{{ detailInfo.materialUrl }}</div> <div class="content-item-desc" v-if="detailInfo.materialType == 3" v-html="detailInfo.materialUrl"></div>
</div> </div>
<div class="content-item-image"> <div class="content-item-image">
<img src="@/assets/material/car.png" alt=""> <img src="@/assets/material/car.png" alt="" v-if="detailInfo.materialType == 3">
<img src="@/assets/material/pdf.png" alt="" v-if="detailInfo.materialType == 1">
</div> </div>
</div> </div>
</div> </div>
...@@ -123,7 +124,7 @@ ...@@ -123,7 +124,7 @@
</div> </div>
<div class="dataList-item"> <div class="dataList-item">
<div class="dataList-item-title">打开率</div> <div class="dataList-item-title">打开率</div>
<h2>{{ overviewInfo.openRate }}</h2> <h2>{{ overviewInfo.openRate }}%</h2>
<!-- <div class="dataList-item-num">今日:{{ overviewInfo.totalPeopleSend }}</div> --> <!-- <div class="dataList-item-num">今日:{{ overviewInfo.totalPeopleSend }}</div> -->
</div> </div>
</div> </div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!