| | |
| | | <div class="message-status"> |
| | | <span>短信回执:</span> |
| | | <el-select v-model="messageStatus" placeholder="请选择"> |
| | | <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.value"> |
| | | <el-option v-for="item in statusList" :key="item.value" :label="item.label" :value="item.label"> |
| | | </el-option> |
| | | </el-select> |
| | | </div> |
| | | <div class="find"> |
| | | <el-button type="primary" icon="el-icon-search" @click="handleSearch">查询</el-button> |
| | | <el-button type="primary" icon="el-icon-search" @click="getTableData">查询</el-button> |
| | | <el-button icon="el-icon-delete-solid" @click="handleReset">重置</el-button> |
| | | </div> |
| | | </div> |
| | |
| | | @selection-change="tableChange"> |
| | | <el-table-column type="selection" min-width="5"> |
| | | </el-table-column> |
| | | <el-table-column label="ID" min-width="5"> |
| | | <el-table-column label="ID" min-width="5" prop="id"> |
| | | <template slot-scope="scope">{{ scope.row.id }}</template> |
| | | </el-table-column> |
| | | <el-table-column prop="head" label="标题" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="updateTime" label="发送时间" min-width="10"> |
| | | <template slot-scope="scope"> |
| | | <span>{{changeTime(scope.row)}}</span> |
| | | </template> |
| | | <el-table-column prop="createTime" label="发送时间" min-width="10"> |
| | | </el-table-column> |
| | | <el-table-column prop="targetFrom" label="发送账号" min-width="15"> |
| | | </el-table-column> |
| | | <el-table-column prop="status" label="发布状态" min-width="5"> |
| | | <template slot-scope="scope"> |
| | | {{scope.row.status === 0 ? '发送失败' :'发送成功'}} |
| | | </template> |
| | | <template slot-scope="scope"> |
| | | <span>{{ statusList.find(item => item.value === scope.row.status).label }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="operation" label="操作" min-width="15"> |
| | | <template slot-scope="scope"> |
| | | <div class="operation"> |
| | | <el-link class="leftPx" icon="el-icon-delete-solid" :underline="false" |
| | | @click="handleDelete([scope.row.id])">删除</el-link> |
| | | <el-link icon="el-icon-edit" class="leftPx" :underline="false" @click="handleEdit(scope.row)">重新发送</el-link> |
| | | <el-link icon="el-icon-edit" class="leftPx" :underline="false" @click="resend(scope.row)">重新发送</el-link> |
| | | </div> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <!-- 新建消息 --> |
| | | <el-dialog title="新建消息" :visible.sync="isShowDialog" width="80%" |
| | | <el-dialog title="新建消息" :destroy-on-close="true" :key="dialogType" :visible.sync="isShowDialog" width="80%" |
| | | :before-close="handleConfirmClose"> |
| | | <MyCreate @closeMyDialog="closeDialog" :type="dialogType"></MyCreate> |
| | | </el-dialog> |
| | |
| | | <script> |
| | | import helper from '@/utils/mydate' |
| | | import MyCreate from './createSms' |
| | | import { getMessageList, deleteMessage } from "@/api/operate/messageManagement"; |
| | | import {getMessageList, deleteMessage, sendMessage} from "@/api/operate/messageManagement"; |
| | | |
| | | export default { |
| | | components: { |
| | |
| | | data() { |
| | | return { |
| | | tableData: [], |
| | | context: "", |
| | | dialogEdit:false, |
| | | context: null, |
| | | isShowDialog: false, |
| | | dialogView: false, |
| | | totalNum: null, |
| | | pageSize: 10, |
| | | currentPage: 1, |
| | |
| | | } |
| | | ], |
| | | tempList: [], |
| | | messageStatus: 2, |
| | | messageStatus: '全部', |
| | | messageKind: '00', |
| | | statusList: [ |
| | | { |
| | |
| | | this.getTableData(); |
| | | }, |
| | | methods: { |
| | | // 查询 |
| | | handleSearch(){ |
| | | this.getTableData(); |
| | | }, |
| | | // 重置 |
| | | handleReset(){ |
| | | |
| | | this.context = null; |
| | | this.currentPage = 1; |
| | | this.messageStatus = '全部'; |
| | | this.getTableData(); |
| | | }, |
| | | // 删除信息 |
| | | handleDelete(ids) { |
| | | this.$confirm('确认删除?') |
| | | .then(() => { |
| | | deleteMessage(ids) |
| | | deleteMessage({ ids: ids.join(',')}) |
| | | .then(() => { |
| | | this.$message({ type: 'success', message: '操作成功' }); |
| | | this.getTableData(); |
| | |
| | | }, |
| | | |
| | | getTableData() { |
| | | getMessageList() |
| | | const respondResult = this.messageStatus === '全部' ? null : this.messageStatus; |
| | | getMessageList({ channelCode: '03', current: this.currentPage, |
| | | respondResult, pageSize: this.pageSize, head: this.context }) |
| | | .then(({ records, total }) => { |
| | | this.tableData = records; |
| | | this.totalNum = total; |
| | |
| | | this.$message({ type: 'error', message: err }); |
| | | }) |
| | | }, |
| | | |
| | | resend(data) { |
| | | if (data.status === 1) { |
| | | return; |
| | | } |
| | | sendMessage(data) |
| | | .then(() => { |
| | | this.$message.success('操作成功'); |
| | | this.getTableData(); |
| | | }) |
| | | .catch(err => this.$message.error(`${err}`)) |
| | | }, |
| | | |
| | | // 批量下拉框操作 |
| | | async selectChange(list) { |
| | | if (this.tempList.length !== 0) { |
| | |
| | | // 当前页改变触发事件 |
| | | changeCurrentPage(page) { |
| | | this.currentPage = page; |
| | | this.setTableData(); |
| | | this.getTableData(); |
| | | }, |
| | | // 确认关闭弹窗 |
| | | handleConfirmClose(done) { |