Commit 45ce30ec by 匡雅琴

素材详情调试

1 parent bf3e536c
......@@ -151,7 +151,7 @@ const sendDetailPage = params => {
const findAllDictData = params => {
params.method = 'merchants.api.menu.findAllDictData'
return http({
url: '/rop-merchants/router',
url: 'http://rop-merchant.dev.glsx.com.cn/rop-merchants/router',
method: 'POST',
data: params,
sign: true
......
......@@ -17,7 +17,7 @@
<slot v-if="item.addHtml" :name="item.addHtml" :scope="item"></slot>
<span v-else-if="item.type === 'showTxt'">{{ formObj[item.name] }}</span>
<div v-else-if="item.type === 'input'">
<el-input :placeholder="item.placeholder || '请输入' + item.label" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<el-input :placeholder="item.placeholder || '请输入' + item.label" :prefix-icon="item.prefixIcon" v-model.trim="formObj[item.name]" :disabled="item.isDisabled" :maxlength="item.maxlength" :clearable="item.isClear || false" :type="item.inputType || 'text'" :rows="item.rows || 2" :style="{ width: item.width || defaultWidth }" :show-word-limit="item.showLimit || false" :show-password="item.showPass || false" @keydown.native="e => handleInputDown(e, item)">
<span v-if="item.prepend" slot="prepend">{{ item.prepend }}</span>
<span v-if="item.append" slot="append">{{ item.append }}</span>
</el-input>
......@@ -53,6 +53,13 @@
</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>
<slot :name="item.suffixSlot" :scope="item"></slot>
</div>
<!-- radio -->
<el-radio-group v-else-if="item.type === 'radio'" v-model="formObj[item.name]" :disabled="item.isDisabled" @change="item.handleRadioChange">
<el-radio v-for="subItem in item.optionList" :key="subItem[item.optionId]" :label="subItem[item.optionId]">{{ subItem[item.optionLabel] }}</el-radio>
......
......@@ -20,8 +20,8 @@ module.exports = {
request: {
// baseURL: 'http://scrm.test.glsx.com.cn/',
// baseURL: 'http://192.168.2.42:8064/',
// baseURL: 'http://scrm.dev.glsx.com.cn/',
baseURL: 'http://192.168.1.78:8065/',
baseURL: 'http://scrm.dev.glsx.com.cn/',
// baseURL: 'http://192.168.1.78:8065/',
// 设置超时时间
timeout: 180000,
// 携带凭证
......
......@@ -6,7 +6,7 @@
<el-divider></el-divider>
<el-form-item v-if="routeInfo.addOrEdit == 1" label="选择素材组:" prop="selectMaterialGroup">
<el-select v-model="materialAddForm.groupId" placeholder="请选择" :size="size">
<el-option v-for="item in groupCounter" :key="item" :label="item.materialGroupName" :value="item.id"></el-option>
<el-option v-for="item in groupCounter" :key="item.id" :label="item.materialGroupName" :value="item.id"></el-option>
</el-select>
</el-form-item>
<el-form-item v-else label="选择素材组:">
......@@ -80,7 +80,7 @@
</el-popover>
:</span>
</span>
<el-checkbox v-model="materialAddForm.isNotifySender">客户打开素材链接时通知发送人</el-checkbox>
<el-checkbox v-model="materialAddForm.isNotifySender" :checked="checked" @change="notifyChange">客户打开素材链接时通知发送人</el-checkbox>
<span class="track-tips track-info">(客户不包括本商户的员工)</span>
</el-form-item>
<el-form-item prop="tagJson">
......@@ -208,12 +208,13 @@ export default {
materialType: '',
materialUrl: '',
businessType: [],
isNotifySender: '',
isNotifySender: -1,
tagJson: [],
title: '',
desc: '',
imageUrl: ''
},
checked: false,
groupCounter: [],
// 素材类型--链接
linkForm: {
......@@ -254,6 +255,7 @@ export default {
methods: {
getParams() {
var params = JSON.parse(JSON.stringify(this.materialAddForm))
params.businessType = params.businessType.toString()
return params
},
// 获取素材详情
......@@ -268,6 +270,7 @@ export default {
// 获取全部素材组
getMaterialList() {
this.$apis.material.getMaterialList({}).then(res => {
console.log(res,'datadata');
this.groupCounter = res
})
},
......@@ -276,8 +279,11 @@ export default {
var params = {}
params.isDefault = 0
this.$apis.material.addMaterialGroup(params).then(res => {
console.log(res);
this.groupCounter = res
// console.log(res);
// this.groupCounter = res
if (res) {
this.getMaterialList()
}
})
},
// 获取所有业务类型
......@@ -298,6 +304,10 @@ export default {
console.log(value)
this.materialAddForm.materialType = value
},
// 是否通知
notifyChange() {
this.checked = !this.checked
},
// 上传PDF
handlePdfChange(e) {
var file = e.srcElement.files[0]
......@@ -344,10 +354,28 @@ export default {
},
// 存草稿
onSave() {
var params = this.getParams()
params.status = 2
this.$apis.material.materialInsert(params).then(res => {
console.log(res);
this.$refs.materialAddForm.validate(valid => {
if (valid) {
var params = this.getParams()
params.status = 2
if (this.checked) {
params.isNotifySender = 0
}
this.$apis.material.materialInsert(params).then(res => {
if (res) {
this.$message({
message: '保存成功',
type: 'success'
});
this.$router.push({
path: '/material/index',
})
}
return
})
} else {
return false
}
})
},
// 提交
......@@ -355,12 +383,22 @@ export default {
this.$refs.materialAddForm.validate(valid => {
if (valid) {
var params = this.getParams()
if (this.checked) {
params.isNotifySender = 0
}
console.log(params, 'paramsw2wwww');
this.$apis.material.materialInsert(params).then(res => {
console.log(res);
if (res) {
this.$message({
message: '创建成功',
type: 'success'
});
this.$router.push({
path: '/material/index',
})
}
})
} else {
console.log('error submit!!')
return false
}
})
......
......@@ -7,7 +7,7 @@
</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="value in businessTypes" :key="value" :label="value">{{ value }}</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>
......@@ -45,6 +45,7 @@ export default {
},
methods: {
init(addOrEdit, value, group) {
this.findAllDictData()
console.log(addOrEdit, value, group, '123');
this.dialogVisible = true
this.materialGroupAddForm = {}
......@@ -70,10 +71,15 @@ export default {
dictType
}
this.$apis.material.findAllDictData(params).then(res => {
// console.log(res, 'resres');
if (res) {
if (dictType == 'business_type') {
this.businessTypes = res
}
res.forEach(item => {
if (item.dictType == 'business_type') {
this.businessTypes.push(item)
}
})
// console.log(this.businessTypes);
// return this.businessTypes
}
})
},
......
......@@ -86,7 +86,7 @@ export default {
params.groupId = item.id
params.pageNum = 1
params.pageSize = 10
this.$emit('getList', params, item.materialGroupName)
this.$emit('getList', params, item)
},
// 打开1-新增, 2-编辑 素材组弹框
handleAddGroup(addOrEdit, value) {
......
......@@ -2,8 +2,8 @@
<div>
<glsx-combi-form ref="readPerDetailFormRef" :formObj="searchForm" :formData="readPerDetailFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="readPerDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="readPerDetailTableData" :pageConf="pageConf" :tableTotal="tableTotal">
......@@ -15,30 +15,35 @@
import url from "@/assets/empty.png"
export default {
name: 'readPerDetail',
props: ['materialId'],
data() {
return {
url,
searchForm: {
customerName: '',
customerPhone: '',
staffName: ''
staffName: '',
materialId: this.materialId,
},
getListApi: this.$apis.material.readDetailPage,
readPerDetailFormData: [
{
label: '客户名称:',
label: '名称:',
name: 'customerName',
maxlength: 10,
type: 'input'
type: 'input',
placehoder: '请输入内容'
},{
label: '客户手机号:',
name: 'customerPhone',
placehoder: '请输入手机号',
type: 'input'
},
{
label: '发送人:',
name: 'staffName',
maxlength: 10,
placehoder: '请输入内容',
type: 'input'
}
],
......@@ -51,7 +56,7 @@ export default {
prop: 'customerName'
},
{
label: '客户手机号',
label: '电话号码',
prop: 'customerPhone'
},
{
......
......@@ -2,23 +2,23 @@
<div>
<glsx-combi-form ref="staffSendFormRef" :formObj="searchForm" :formData="staffSendFormData" :inline="true">
<span slot="footer" slot-scope="scope" class="select-pro">
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
<el-button type="default" :size="size" @click="handleReset(scope)">重置</el-button>
<el-button type="primary" :size="size" @click="handleSearch(scope)">查询</el-button>
</span>
</glsx-combi-form>
<GLTable ref="staffSendDetailRef" :getListApi="getListApi" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal">
</GLTable>
<GLTable ref="staffSendDetailRef" :getListApi="getListApi" :beforeSearchFn="beforeSearchFn" :noDataImg="url" :searchForm="searchForm" :tableParams="tableParams" :tableData="staffSendTableData" :pageConf="pageConf" :tableTotal="tableTotal"></GLTable>
</div>
</template>
<script>
import url from "@/assets/empty.png"
import url from '@/assets/empty.png'
export default {
name: 'staffSendDetail',
props: ['materialId'],
data() {
return {
url,
searchForm: {
materialId: this.materialId,
employeeName: ''
},
staffSendFormData: [
......@@ -26,7 +26,8 @@ export default {
label: '',
name: 'employeeName',
type: 'input',
placeholder: '请输入姓名'
placeholder: '请输入姓名',
prefixIcon: 'el-icon-search'
}
],
getListApi: this.$apis.material.sendDetailPage,
......@@ -68,16 +69,14 @@ export default {
// 重置
handleReset() {
this.searchForm = {
customerName: '',
customerPhone: '',
staffName: ''
staffName: '',
materialId: this.materialId
}
this.handleSearch()
},
}
}
}
</script>
<style lang="" scoped>
</style>
......@@ -94,6 +94,7 @@ export default {
url,
eventBus: new Vue(),
searchForm: {
groupId: '',
materialType: '',
businessType: '',
status: '',
......@@ -110,8 +111,9 @@ export default {
{
label: '业务类型:',
name: 'businessType',
type: 'select',
placeholder: '全部'
type: 'selectDict',
placeholder: '全部',
optionList: this.businessTypes
},
{
label: '素材类型:',
......@@ -331,6 +333,7 @@ export default {
let clientHeight = document.documentElement.clientHeight
let offTop = document.querySelector('.tabelList').offsetTop
this.boxHeight = clientHeight - offTop + 'px'
this.findAllDictData('business_type')
},
methods: {
// 搜索
......@@ -354,9 +357,7 @@ export default {
}
this.$apis.material.findAllDictData(params).then(res => {
if (res) {
if (dictType == 'business_type') {
this.businessTypes = res
}
this.businessTypes = res.data
}
})
},
......@@ -423,11 +424,14 @@ export default {
}
},
// 点击素材组获取素材组素材
getList(params, materialGroupName) {
this.materialGroupName = materialGroupName
getList(params, item) {
console.log(item, '7758');
this.materialGroupName = item.materialGroupName
this.searchForm.groupId = item.id
this.$apis.material.materialList(params).then(res => {
this.materialTableData = res.data
})
this.handleSearch()
},
// 功能介绍弹框
showIntroductionDialog() {
......
......@@ -15,16 +15,17 @@
</div>
</div>
<div class="matrial-detail-containner">
<div class="matrial-detail">
<div class="matrial-detail-left">
<span class="materialDetail-title-sub">{{ detailInfo.materialName }}</span>
<span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span>
</div>
</div>
<div :class="{ 'materialDetail-desc': true, 'materialDetail-expand': !detailVisible }">
<div class="matrial-detail">
<div class="matrial-detail-left">
<span class="materialDetail-title-sub">{{ detailInfo.materialName }}</span>
<span class="matrial-detail-left-pre" @click="visibleImg = true">预览</span>
</div>
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">素材地址:</div>
{{ detailInfo.materialUrl }}
<span class="item-name-info">(备注:直接复制素材地址发送给客户无法接受通知提醒)</span>
</div>
<div class="materialDetail-desc-row">
<div class="materialDetail-desc-col">
......@@ -35,9 +36,9 @@
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">
<label>*</label>
发动机号:
素材类型:
</div>
{{ detailInfo.address }}
{{ detailInfo.materialType }}
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">动态通知:</div>
......@@ -71,7 +72,7 @@
</div>
<div class="materialDetail-desc-item">
<div class="materialDetail-item-name">行为标签:</div>
{{ detailInfo.tagJson }}
<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>
......@@ -120,7 +121,7 @@
<div class="dataList-item">
<div class="dataList-item-title">打开率</div>
<h2>{{ overviewInfo.openRate }}</h2>
<div class="dataList-item-num">今日:{{ overviewInfo.totalPeopleSend }}</div>
<!-- <div class="dataList-item-num">今日:{{ overviewInfo.totalPeopleSend }}</div> -->
</div>
</div>
<div class="detailTable">
......@@ -128,8 +129,8 @@
<el-tab-pane label="员工发送明细" name="staffSendDetail"></el-tab-pane>
<el-tab-pane label="阅读人员明细" name="readPerDetail"></el-tab-pane>
</el-tabs>
<staffSendDetail v-if="activeName == 'staffSendDetail'"></staffSendDetail>
<readPerDetail v-if="activeName == 'readPerDetail'"></readPerDetail>
<staffSendDetail v-if="activeName == 'staffSendDetail'" :materialId="routerInfo.id"></staffSendDetail>
<readPerDetail v-if="activeName == 'readPerDetail'" :materialId="routerInfo.id"></readPerDetail>
</div>
</div>
</div>
......@@ -163,7 +164,7 @@ export default {
}
},
mounted() {
this.routerInfo = this.$router.query.id
this.routerInfo = this.$route.query
this.getMaterialdetail()
this.getDataOverview()
},
......@@ -171,19 +172,19 @@ export default {
// 获取素材详情
getMaterialdetail() {
var params = {}
params.id = this.routerInfo
this.$apis.material.materialdetail(params).then(res => {
console.log(res);
// this.detailInfo = res
params.id = this.routerInfo.id
this.$apis.material.materialDetail(params).then(res => {
console.log(res, 'dhakfh');
this.detailInfo = res
})
},
// 获取数据概览
getDataOverview() {
var params = {}
params.id = this.routerInfo
params.materialId = this.routerInfo.id
this.$apis.material.dataOverview(params).then(res => {
console.log(res);
// this.overviewInfo = res
this.overviewInfo = res
})
},
handleClick() {
......@@ -370,4 +371,9 @@ export default {
display: inline-block;
margin: 17px 0 0 20px;
}
.item-name-info {
font-size: 14px;
color: #999999;
line-height: 20px;
}
</style>
\ No newline at end of file
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!