提交 f74d0e37 authored 作者: lihuihui's avatar lihuihui

feat: 新增分发短信记录

上级 dfa42d0e
...@@ -138,6 +138,18 @@ export function getSmsTempDetail(id) { ...@@ -138,6 +138,18 @@ export function getSmsTempDetail(id) {
export function editSmsTemp(id, params) { export function editSmsTemp(id, params) {
return httpRequest.put(`/api/message/admin/v1/sms/${id}/template`, params) return httpRequest.put(`/api/message/admin/v1/sms/${id}/template`, params)
} }
/**
* 短信分发列表
*/
export function getSmsRecordList(params) {
return httpRequest.get('/api/message/admin/v1/sms/records', { params })
}
/**
* 短信分发列表
*/
export function getQueryRecord(params) {
return httpRequest.get('/api/message/admin/v1/sms/query-record', { params })
}
// export function uploadFile(data) { // export function uploadFile(data) {
// return httpRequest.post('/api/lms/util/upload-file', data, { // return httpRequest.post('/api/lms/util/upload-file', data, {
// headers: { 'Content-Type': 'multipart/form-data' } // headers: { 'Content-Type': 'multipart/form-data' }
......
<template>
<div>
<el-table :data="data">
<el-table-column property="Content" label="短信内容"></el-table-column>
<el-table-column property="PhoneNum" label="接收短信的手机号码"></el-table-column>
<el-table-column property="ReceiveDate" label="短信接收日期和时间"></el-table-column>
<el-table-column property="SendDate" label="短信发送日期和时间"></el-table-column>
<el-table-column property="SendDate" label="短信发送日期和时间"></el-table-column>
<el-table-column label="短信发送状态">
<template slot-scope="scope">
{{ getStatus(scope.row.SendStatus) }}
</template>
</el-table-column>
</el-table>
</div>
</template>
<script>
export default {
props: {
data: {
type: Array
}
},
data() {
return {
drawer: true,
direction: 'rtl'
}
},
methods: {
getStatus(n) {
const val = {
1: '等待回执',
2: '发送失败',
3: '发送成功'
}
return val[n]
},
handleClose(done) {
this.$confirm('确认关闭?')
.then(_ => {
done()
})
.catch(_ => {})
}
}
}
</script>
<style lang="scss" scoped>
</style>
...@@ -3,35 +3,20 @@ ...@@ -3,35 +3,20 @@
<div class="temp-box"> <div class="temp-box">
<div class="temp-title"> <div class="temp-title">
<div class="search"> <div class="search">
<span>名称</span> <el-input v-model="input" placeholder="" class="input"></el-input>
<el-input v-model="input" placeholder="请输入模板名称" class="input"></el-input>
<el-button type="primary" class="btn" @click="searchList">搜索</el-button> <el-button type="primary" class="btn" @click="searchList">搜索</el-button>
</div> </div>
<div class="tool-btn">
<el-button class="btn" @click="createTamp">创建</el-button>
<!-- <el-button class="btn">编辑</el-button> -->
<el-button v-if="selectItem.length" class="btn" @click="deleteTampList">删除</el-button>
<el-button v-else disabled class="btn">删除</el-button>
</div>
</div> </div>
<div class="table-box"> <div class="table-box">
<el-table @selection-change="handleSelectionChange" :data="tableData" tooltip-effect="dark" style="width: 100%"> <el-table @selection-change="handleSelectionChange" :data="tableData" tooltip-effect="dark" style="width: 100%">
<el-table-column type="selection" width="55"> </el-table-column> <!-- <el-table-column type="selection" width="55"> </el-table-column> -->
<el-table-column align="center" header-align="center" prop="id" label="id" width="180"> </el-table-column> <el-table-column align="center" header-align="center" prop="id" label="id"> </el-table-column>
<el-table-column align="center" header-align="center" prop="name" label="名称" width="180"> </el-table-column> <el-table-column align="center" header-align="center" prop="title" label="标题"> </el-table-column>
<el-table-column align="center" header-align="center" prop="created_at" label="创建时间" width="180"> <el-table-column align="center" header-align="center" prop="created_at" label="创建时间"> </el-table-column>
</el-table-column> <el-table-column align="center" header-align="center" prop="payload" label="消息模板载体"> </el-table-column>
<el-table-column align="center" header-align="center" label="通道">
<template slot-scope="scope">
<span v-for="(items, index) in scope.row.templates" :key="index">
{{ channelValue(items.channel) }}
</span>
</template>
</el-table-column>
<el-table-column label="操作" align="center" header-align="center"> <el-table-column label="操作" align="center" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="btn-color" type="text" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> <el-button class="btn-color" type="text" @click="handleDelete(scope.row)">查询</el-button>
<el-button class="btn-color" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
...@@ -40,18 +25,25 @@ ...@@ -40,18 +25,25 @@
<el-pagination layout="prev, pager, next" @current-change="changePage" :total="totals"> </el-pagination> <el-pagination layout="prev, pager, next" @current-change="changePage" :total="totals"> </el-pagination>
</div> </div>
</div> </div>
<el-drawer size="100%" title="" :visible.sync="drawer" :direction="direction">
<drawer-table :data="drawerData"></drawer-table>
</el-drawer>
</app-container> </app-container>
</template> </template>
<script> <script>
import AppContainer from '@/components/AppContainer' import AppContainer from '@/components/AppContainer'
import * as api from '@/api/common.js' import * as api from '@/api/common.js'
import drawerTable from './components/drawerTable.vue'
export default { export default {
components: { components: {
AppContainer AppContainer,
drawerTable
}, },
data() { data() {
return { return {
drawer: false,
drawerData: [],
input: '', input: '',
page: { page: {
page: 1, page: 1,
...@@ -59,7 +51,8 @@ export default { ...@@ -59,7 +51,8 @@ export default {
}, },
totals: 1, totals: 1,
tableData: [], tableData: [],
selectItem: [] selectItem: [],
direction: 'rtl'
} }
}, },
mounted() { mounted() {
...@@ -76,14 +69,23 @@ export default { ...@@ -76,14 +69,23 @@ export default {
} }
return json[n] return json[n]
}, },
templateTypeValue(n) {
const val = {
0: '验证码',
1: '短信通知',
2: '推广短信',
3: '国际/港澳台消息'
}
return val[n]
},
searchList() { searchList() {
this.getMsgTempList({ name: this.input }) this.getMsgTempList({ search_str: this.input })
}, },
getMsgTempList(params) { getMsgTempList(params) {
api api
.getMsgTempList(params) .getSmsRecordList(params)
.then(response => { .then(response => {
this.tableData = response.data.data this.tableData = response.data.items
this.totals = response.data.total this.totals = response.data.total
this.page.page = response.data.current_page this.page.page = response.data.current_page
// this.page.page = response.data.current_page // this.page.page = response.data.current_page
...@@ -93,9 +95,10 @@ export default { ...@@ -93,9 +95,10 @@ export default {
}, },
handleDelete(data) { handleDelete(data) {
api api
.deleteTemp(data.id) .getQueryRecord({ id: data.id })
.then(response => { .then(response => {
this.getMsgTempList() this.drawerData = response.data.detail.SmsSendDetailDTOs.SmsSendDetailDTO
this.drawer = true
}) })
.finally(() => {}) .finally(() => {})
}, },
......
...@@ -29,6 +29,17 @@ ...@@ -29,6 +29,17 @@
</el-option> </el-option>
</el-select> </el-select>
</div> </div>
<div class="write">
<div class="name">使用场景说明</div>
<el-input
v-if="tabIndex == 0"
class="inp-w inp-h"
type="textarea"
:rows="2"
placeholder="请输入内容"
v-model="formAll.form1.content2">
</el-input>
</div>
</div> </div>
<div class="btn-box"> <div class="btn-box">
<div class="content"> <div class="content">
...@@ -74,6 +85,10 @@ ...@@ -74,6 +85,10 @@
<div class="name">消息内容:</div> <div class="name">消息内容:</div>
<div class="con-text" v-html="formAll.form1.content"></div> <div class="con-text" v-html="formAll.form1.content"></div>
</div> </div>
<div class="write">
<div class="name">使用场景说明:</div>
<div class="con-text" v-html="formAll.form1.content2"></div>
</div>
</div> </div>
<div class="btn-box"> <div class="btn-box">
<div class="content"> <div class="content">
...@@ -99,6 +114,7 @@ export default { ...@@ -99,6 +114,7 @@ export default {
form1: { form1: {
title: '', title: '',
content: '', content: '',
content2: '',
select: 0 select: 0
} }
}, },
...@@ -127,10 +143,11 @@ export default { ...@@ -127,10 +143,11 @@ export default {
} }
}, },
mounted() { mounted() {
if (this.$router.query.id) { if (this.$route.query.id) {
const conForm = this.formAll.form1 const conForm = this.formAll.form1
conForm.title = this.form.title conForm.title = this.form.title
conForm.content = this.form.desc conForm.content = this.form.payload
conForm.content2 = this.form.desc
conForm.select = this.form.template_type conForm.select = this.form.template_type
} }
}, },
...@@ -158,9 +175,9 @@ export default { ...@@ -158,9 +175,9 @@ export default {
const forms = this.formAll.form1 const forms = this.formAll.form1
const param = { const param = {
title: forms.title, title: forms.title,
desc: forms.content, desc: forms.content2,
template_type: forms.select, template_type: forms.select,
payload: '您正在申请手机注册,验证码为:,5分钟内有效!' payload: forms.content
} }
if (id) { if (id) {
api api
...@@ -229,15 +246,16 @@ export default { ...@@ -229,15 +246,16 @@ export default {
padding-right: 20px; padding-right: 20px;
box-sizing: border-box; box-sizing: border-box;
display: flex; display: flex;
height: 40px; // height: 40px;
margin-bottom: 20px; margin-bottom: 20px;
&:nth-child(1){ &:nth-child(1){
margin-top: 30px; margin-top: 30px;
} }
&:nth-child(2){ &:nth-child(2){
height: 118px; // height: 118px;
} }
.name{ .name{
min-width: 90px;
font-size: 14px; font-size: 14px;
color: #333333; color: #333333;
line-height: 40px; line-height: 40px;
...@@ -246,7 +264,7 @@ export default { ...@@ -246,7 +264,7 @@ export default {
} }
::v-deep { ::v-deep {
textarea{ textarea{
height: 100% !important; // height: 50px !important;
resize:none; resize:none;
} }
} }
...@@ -454,7 +472,7 @@ export default { ...@@ -454,7 +472,7 @@ export default {
margin-bottom: 20px; margin-bottom: 20px;
} }
&:nth-child(2){ &:nth-child(2){
height: 118px; // height: 118px;
} }
.name{ .name{
font-size: 14px; font-size: 14px;
......
...@@ -2,11 +2,10 @@ ...@@ -2,11 +2,10 @@
<app-container> <app-container>
<div class="temp-box"> <div class="temp-box">
<div class="temp-title"> <div class="temp-title">
<!-- <div class="search"> <div class="search">
<span>名称</span> <el-input v-model="input" placeholder="" class="input"></el-input>
<el-input v-model="input" placeholder="请输入模板名称" class="input"></el-input>
<el-button type="primary" class="btn" @click="searchList">搜索</el-button> <el-button type="primary" class="btn" @click="searchList">搜索</el-button>
</div> --> </div>
<div> <div>
<el-button class="btn" @click="createTamp">创建</el-button> <el-button class="btn" @click="createTamp">创建</el-button>
</div> </div>
...@@ -23,9 +22,23 @@ ...@@ -23,9 +22,23 @@
{{ templateTypeValue(scope.row.template_type) }} {{ templateTypeValue(scope.row.template_type) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" header-align="center" label="审核状态">
<template slot-scope="scope">
<template v-if="scope.row.audit_status == 3">
<el-tooltip class="item" effect="dark" :content="scope.row.audit_info" placement="top-start">
<div>
{{ statusType(scope.row.audit_status) }}
</div>
</el-tooltip>
</template>
<template v-else>
{{ statusType(scope.row.audit_status) }}
</template>
</template>
</el-table-column>
<el-table-column label="操作" align="center" header-align="center"> <el-table-column label="操作" align="center" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-button class="btn-color" type="text" @click="handleEdit(scope.$index, scope.row)">编辑</el-button> <el-button v-if="scope.row.audit_status == 3" class="btn-color" type="text" @click="handleEdit(scope.$index, scope.row)">编辑</el-button>
<el-button class="btn-color" type="text" @click="handleDelete(scope.row)">删除</el-button> <el-button class="btn-color" type="text" @click="handleDelete(scope.row)">删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
...@@ -80,8 +93,16 @@ export default { ...@@ -80,8 +93,16 @@ export default {
} }
return val[n] return val[n]
}, },
statusType(n) {
const val = {
1: '审核中',
2: '审核通过',
3: '审核未通过'
}
return val[n]
},
searchList() { searchList() {
this.getMsgTempList({ name: this.input }) this.getMsgTempList({ title: this.input })
}, },
getMsgTempList(params) { getMsgTempList(params) {
api api
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论