Commit 5051100a by huaying

fix: 欢迎语

parent 130f1a41
......@@ -128,7 +128,7 @@
<script>
import { actCodeListApi } from '@/api/actCode.js';
// import errMsg from '@/common/js/error';
import { deleteRequest, getRequest, postRequest, postJsonRequest } from '@/api/api';
import { deleteRequest, getRequest, postJsonRequest } from '@/api/api';
export default {
name: 'actCodeTable',
directives: {
......@@ -367,13 +367,13 @@ export default {
created() {
this.getTableList();
this.searchGroup();
// this.getStraff();
// this.getStore();
this.getStraff();
this.getStore();
},
methods: {
// 获取导购列表数据
async getStraff() {
await postRequest(`/api-plug/search-clerk?type=2`, { name: this.name });
await postJsonRequest(`/api-plug/search-clerk?type=2`, { name: this.name });
},
async getStore() {
const obj = {
......@@ -383,7 +383,7 @@ export default {
scenes: 'integral',
creatorId: ''
};
await postRequest(`/api-plug/query-store-by-code-name-new?requestProject=haoban-manage-web`, obj);
await postJsonRequest(`/api-plug/query-store-by-code-name-new?requestProject=haoban-manage-web`, obj);
},
onLoadmore() {
if (this.pageParamGroup.pageNum >= this.pageParamGroup.total) return;
......@@ -489,12 +489,12 @@ export default {
// delete this.searchForm.dateTime;
actCodeListApi(Object.assign({}, this.searchForm, this.pageParam))
.then(res => {
// this.totalCount = res.data.result.totalCount || 0;
// if (res.data.result.result.length && Array.isArray(res.data.result.result)) {
// this.tableData = [].concat(res.data.result.result);
// } else {
// this.tableData = [];
// }
this.totalCount = res.data.result.totalCount || 0;
if (res.data.result.result.length && Array.isArray(res.data.result.result)) {
this.tableData = [].concat(res.data.result.result);
} else {
this.tableData = [];
}
})
.finally(_ => {
this.loadingStatus = false;
......
......@@ -20,60 +20,7 @@
<!-- <dm-memberTag-group :visiable.sync="tagsDialogVisible" @save="saveTagPop"></dm-memberTag-group> -->
</el-form-item>
<dm-sub-title text="欢迎语设置" type="line" class="mt40b20" />
<welcomeItem></welcomeItem>
<!-- <el-row>
<el-col :span="17">
<el-form-item label="活码类型">
<el-radio-group v-model="welcomesType">
<el-radio :label="1">活码欢迎语</el-radio>
<el-radio :label="2">不发送欢迎语</el-radio>
</el-radio-group>
<ul class="tabs" v-if="welcomesType == 1">
<li>1.下方的欢迎语取自【设置-欢迎语设置】中的“特殊欢迎语”;</li>
<li>2.配置“活码欢迎语”后,通过此活码添加好友后,系统自动推送此处所配置的欢迎语</li>
<li>(根据企业微信规则,若所添加的该成员在企业微信后台已经配置了欢迎语,那么会推送企微后台所配置的欢迎语,不会推送此处的欢迎语)</li>
</ul>
<ul class="tabs" v-if="welcomesType == 2">
<li>通过此活码添加好友后,系统不推送欢迎语,及时在【设置-欢迎语设置】中为该成员配置了欢迎语。</li>
<li>(根据企业微信规则,若所添加的该成员在企业微信后台已经配置了欢迎语,那么企微后台的欢迎语会照常推送)</li>
</ul>
</el-form-item>
<el-form-item label="选择欢迎语" v-if="welcomesType == 1">
<div class="welcomeTable">
<div class="wtabTop">
<el-input class="w260" placeholder="请输入标题" v-model="welcomePage.search"></el-input>
<el-button plain class="ylbtn" @click="changeRoute">新建欢迎语</el-button>
</div>
<el-table :data="welcomeTableData">
<el-table-column width="55">
<template slot-scope="scope">
<el-radio :label="scope.$index" @change.native="getCurrentRow(scope.row)" v-model="welcome">&nbsp;</el-radio>
</template>
</el-table-column>
<el-table-column prop="welcomeTitle" label="标题" width="158px"></el-table-column>
<el-table-column prop="welcomeContent" label="内容" show-overflow-tooltip></el-table-column>
<el-table-column prop="welcomeEnclosure" label="附件" width="212px" show-overflow-tooltip>
<template slot-scope="{ row }">
<div class="enclosureBox">
<el-image class="img" :src="row.welcomeEnclosure.img">
<div slot="error" class="image-slot img">
<i class="el-icon-picture-outline" style="font-size:40px;"></i>
</div>
</el-image>
<p>{{ row.welcomeEnclosure.imgName }}</p>
</div>
</template>
</el-table-column>
</el-table>
<dm-pagination class="paginationBox" background @current-change="handleCurrentChange" :current-page="welcomePage.currentPage" layout=" prev, pager, next " :page-size="4" :total="100"> </dm-pagination>
</div>
</el-form-item>
</el-col>
<el-col :span="7" v-if="welcomesType == 1 && welcomeContent != ''">
<p class="welcomeTitle">欢迎语预览</p>
<previewWelcome :welcomeContent="welcomeContent"></previewWelcome>
</el-col>
</el-row> -->
<welcomeItem @getWelcomeId="getWelcomeId"></welcomeItem>
</el-form>
</div>
<div class="saveBtn">
......@@ -120,22 +67,10 @@ export default {
storeId: '' //门店id
// hmUserNum: null //多人活码人数
},
// welcomesType: 1,
rules: {
// hmType: [{ required: true, message: '请选择活码类型', trigger: 'blur' }],
hmGroupId: [{ required: true, message: '请选择活码分组', trigger: 'blur' }]
// clerkIdList: [{ required: true, message: '请选择使用成员', trigger: 'blur' }]
},
// welcomeTableData: [],
tagsDialogVisible: false,
// welcome: '',
// templateSelection: {},
// welcomeContent: '',
// // 欢迎语参数
// welcomePage: {
// search: '',
// currentPage: 1
// },
// 分组参数
pageParam: {
groupName: '',
......@@ -148,7 +83,6 @@ export default {
};
},
created() {
// this.getWelcomeTable();
this.searchGroup();
},
methods: {
......@@ -195,62 +129,9 @@ export default {
this.remoteMethod();
}
},
// // 当前页变化
// handleCurrentChange(val) {
// this.welcomePage.currentPage = val;
// this.getWelcomeTable();
// },
// // 选择欢迎语列表数据
// getWelcomeTable() {
// this.welcomeTableData = [
// {
// welcomeId: 1,
// welcomeTitle: '标题标题标题',
// welcomeContent: '欢迎语内容欢迎语内容欢迎语内容 欢迎语内容欢迎语内容欢迎语内容欢迎语内容欢迎语内容 欢迎语内容欢迎语内容',
// welcomeEnclosure: {
// img: 'https://fuss10.elemecdn.com/e/5d/4a731a90594a4af544c0c25941171jpeg.jpeg',
// imgName: '图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称'
// }
// },
// {
// welcomeId: 2,
// welcomeTitle: '标题标题标题',
// welcomeContent: '内容房价还是大家开始的房价款',
// welcomeEnclosure: {
// img: '',
// imgName: '图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称'
// }
// },
// {
// welcomeId: 3,
// welcomeTitle: '标题标题标题',
// welcomeContent: '内容房价还是大家开始的房价款',
// welcomeEnclosure: {
// img: '',
// imgName: '图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称'
// }
// },
// {
// welcomeId: 4,
// welcomeTitle: '标题标题标题',
// welcomeContent: '内容房价还是大家开始的房价款',
// welcomeEnclosure: {
// img: '',
// imgName: '图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称图片名称'
// }
// }
// ];
// },
// // 新建欢迎语
// changeRoute() {
// this.$router.push({ path: '/salutatorySet' });
// },
// getCurrentRow(row) {
// // 获取选中数据 row表示选中这一行的数据,可以从里面提取所需要的值
// this.templateSelection = row;
// this.welcomeContent = row.welcomeContent;
// this.form.welcomeId = row.welcomeId;
// },
getWelcomeId(e) {
this.form.welcomeId = e;
},
// 保存按钮
save() {
this.$refs.form.validate(async valid => {
......@@ -284,9 +165,6 @@ export default {
.mr15 {
margin-right: 15px;
}
.w260 {
width: 260px;
}
.formBox {
margin-bottom: 86px;
.tabs {
......@@ -304,48 +182,6 @@ export default {
font-size: 14px;
padding-right: 4px;
}
.welcomeTitle {
text-align: center;
margin-bottom: 26px;
margin-top: 6px;
font-weight: 500;
color: #303133;
font-size: 14px;
}
.welcomeTable {
width: 720px;
height: 429px;
border: 1px solid #dcdfe6;
padding: 12px;
position: relative;
.wtabTop {
display: flex;
justify-content: space-between;
margin-bottom: 12px;
}
.paginationBox {
position: absolute;
right: 7px;
bottom: 0;
margin-top: 46px;
margin-right: -4px;
}
.enclosureBox {
display: flex;
align-items: center;
.img {
width: 40px;
height: 40px;
margin-right: 10px;
}
p {
width: 143px;
max-width: 143px;
overflow: hidden;
text-overflow: ellipsis;
}
}
}
}
.saveBtn {
......
......@@ -33,13 +33,13 @@
<el-table-column prop="welcomeContent" label="内容" show-overflow-tooltip></el-table-column>
<el-table-column label="附件" width="212px" show-overflow-tooltip>
<template slot-scope="{ row }">
<div class="enclosureBox">
<el-image class="img" :src="row.welcomeMediaList.mediaUrl">
<div class="enclosureBox" v-for="item in row.welcomeMediaList" :key="item.welcomeId">
<el-image class="img" :src="item.mediaUrl">
<div slot="error" class="image-slot img">
<i class="el-icon-picture-outline" style="font-size:40px;"></i>
</div>
</el-image>
<p>{{ row.welcomeMediaList.mediaTitle ? row.welcomeMediaList.mediaTitle : '--' }}</p>
<p>{{ item.mediaTitle ? item.mediaTitle : '--' }}</p>
</div>
</template>
</el-table-column>
......@@ -106,6 +106,7 @@ export default {
this.templateSelection = row;
this.welcomeContent = row.welcomeContent;
this.welcomeId = row.welcomeId;
this.$emit('getWelcomeId', row.welcomeId);
}
}
};
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment