Commit aa8bc78b by 匡雅琴

详情联调

1 parent be144ba4
......@@ -26,7 +26,7 @@
<!-- 选择PDF -->
<div v-show="materialAddForm.materialType == 1">
<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>
</div>
</div>
......@@ -142,7 +142,7 @@
<div class="avatar-uploader-desc">
<i class="el-icon-plus avatar-uploader-desc-icon"></i>
<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 @click="phoneVisible = !phoneVisible" class="view-phone">查看效果></div>
</div>
......@@ -259,6 +259,16 @@ export default {
this.$apis.material.materialDetail(params).then(res => {
// console.log(res,'1212121212');
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 {
},
// 上传PDF
handlePdfChange(e) {
console.log(e)
var file = e.srcElement.files[0]
var reader = new FileReader()
// 默认10MB
......@@ -319,7 +330,8 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
console.log(res)
// console.log(res)
this.materialAddForm.materialUrl = res.data
}
})
}
......@@ -332,7 +344,7 @@ export default {
const limitSize = 1
const isLt = file.size / 1024 / 1024 < limitSize
if (!isLt) {
this.$message.error('上传PDF大小不能超过' + limitSize + 'MB!')
this.$message.error('上传图片大小不能超过' + limitSize + 'MB!')
return true
}
reader.readAsDataURL(file)
......@@ -341,7 +353,8 @@ export default {
const base64 = file.name.split('.')[1] + '@' + imgFile.split(',')[1]
this.$apis.common.pictureUpload({ file: base64 }).then(res => {
if (res) {
console.log(res)
// console.log(res)
this.materialAddForm.titleUrl = res.data
}
})
}
......
......@@ -3,11 +3,11 @@
<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-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 label="业务类型:" prop="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-form-item>
<span class="tips">添加业务类型,该素材组里面的所有素材均会添加此业务类型</span>
......@@ -23,12 +23,12 @@
<script>
export default {
name: 'addMaterialGroupDia',
props: {
props: {
eventBus: Object,
businessTypes: {
type: Array
}
},
},
data() {
return {
title: '创建素材组',
......@@ -50,7 +50,7 @@ export default {
methods: {
init(addOrEdit, value, group) {
// this.findAllDictData('business_type')
console.log(value, '123');
console.log(value, '123')
this.dialogVisible = true
this.materialGroupAddForm = {
materialGroupName: '',
......@@ -66,8 +66,13 @@ export default {
var params = {}
params.id = value.id
this.$apis.material.materialGroupDetail(params).then(res => {
console.log(res);
console.log(res, '---')
this.materialGroupAddForm = res
if (res.businessType) {
this.materialGroupAddForm.businessType = this.materialGroupAddForm.businessType.split(',')
} else {
this.materialGroupAddForm.businessType = []
}
})
}
// Object.assign(this.materialGroupAddForm, value)
......@@ -87,22 +92,9 @@ export default {
},
// 创建
submitForm() {
console.log(this.materialGroupAddForm);
this.$refs.materialGroupAddForm.validate((valid) => {
console.log(this.materialGroupAddForm)
this.$refs.materialGroupAddForm.validate(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
if (this.materialGroupAddForm.id) {
......@@ -110,6 +102,19 @@ export default {
this.dialogVisible = false
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.dialogVisible = false
} else {
......@@ -117,12 +122,12 @@ export default {
message: '请输入素材组名称',
type: 'warning'
})
return false;
return false
}
});
})
},
handleCheckChange(val) {
console.log(val);
console.log(val)
this.materialGroupAddForm.businessType = val
// console.log(this.materialGroupAddForm);
}
......@@ -134,7 +139,7 @@ export default {
.checkbox-group {
width: 567px;
box-sizing: border-box;
background: #F5F5F5;
background: #f5f5f5;
padding: 16px 0 0 16px;
.el-checkbox {
width: 140px;
......
......@@ -63,7 +63,7 @@
<el-button type="text" @click="addMaterial(2, scope.scope)">编辑</el-button>
<el-popover placement="right" trigger="click">
<ul>
<li @click="handleForbid(scope.scope)">禁用</li>
<li @click="handleForbid(scope.scope)">{{ scope.scope.status == 0 ? '禁用' : '启用' }}</li>
<li @click="handleDelete(scope.scope)">删除</li>
</ul>
<el-button type="text" slot="reference" class="btn-more">更多</el-button>
......@@ -186,7 +186,7 @@ export default {
{
label: '素材内容',
prop: 'materialContentRpcResponse',
addHtml: 'materialContent',
addHtml: 'materialContentRpcResponse',
width: 240
},
{
......@@ -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: '更新时间',
prop: 'updatedTime',
width: 180,
......@@ -399,7 +355,7 @@ export default {
params.id = scope.id
params.status = -1
console.log(params)
this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', { params: params })
this.secondConfirm('提示', '禁用素材,所有已经发送给客户的素材链接均会失效,是否继续禁用?', 'material', 'materialEdit', params )
},
// 素材删除
handleDelete(scope) {
......
......@@ -22,8 +22,8 @@
<span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span>
</div>
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">素材地址:</div>
<div class="materialDetail-desc-item" v-if="detailInfo.materialType == 1">
<div class="materialDetail-item-name" v-if="detailInfo.materialType == 1">素材地址:</div>
{{ detailInfo.materialUrl }}
<span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
</div>
......@@ -50,10 +50,11 @@
<div class="content-item">
<div class="content-item-text">
<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 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>
......@@ -123,7 +124,7 @@
</div>
<div class="dataList-item">
<div class="dataList-item-title">打开率</div>
<h2>{{ overviewInfo.openRate }}</h2>
<h2>{{ overviewInfo.openRate }}%</h2>
<!-- <div class="dataList-item-num">今日:{{ overviewInfo.totalPeopleSend }}</div> -->
</div>
</div>
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!