| | |
| | | @keyup.enter.native="reGetList" |
| | | /> |
| | | </el-form-item> |
| | | <el-form-item label="短信类型"> |
| | | <el-select v-model="smsType" clearable placeholder="选择短信类型" @change="reGetList"> |
| | | <el-option |
| | | v-for="item in smsTypeOpts" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item> |
| | | <el-button type="cyan" icon="el-icon-search" size="mini" @click="reGetList">搜索</el-button> |
| | | <el-button icon="el-icon-refresh" size="mini" @click="resetHandle">重置</el-button> |
| | | <el-button type="primary" icon="el-icon-download" size="mini" @click="exportList">下载发送模板</el-button> |
| | | </el-form-item> |
| | | </el-form> |
| | | <!-- 搜索区 ↑↑↑↑↑↑↑↑↑↑ --> |
| | |
| | | <el-table-column label="发送总数" prop="sendTotal" align="center" /> |
| | | <el-table-column label="状态" prop="status" align="center"> |
| | | <template slot-scope="scope"> |
| | | <span v-if="scope.row.isUp == 0">待执行</span> |
| | | <span v-if="scope.row.isUp == 1">执行中</span> |
| | | <span v-if="scope.row.isUp == 2">完成</span> |
| | | <span v-if="scope.row.isUp == 3">取消</span> |
| | | <span v-if="scope.row.isUp == 4">失败</span> |
| | | <span v-if="scope.row.status == 0">待执行</span> |
| | | <span v-if="scope.row.status == 1">执行中</span> |
| | | <span v-if="scope.row.status == 2">完成</span> |
| | | <span v-if="scope.row.status == 3">取消</span> |
| | | <span v-if="scope.row.status == 4">失败</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column label="短信模内容" prop="smsTemplate" align="center" min-width="160"> |
| | |
| | | /> |
| | | </template> |
| | | </el-table-column> --> |
| | | <!-- <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120"> |
| | | <el-table-column label="操作" align="center" class-name="small-padding fixed-width" width="120"> |
| | | <template slot-scope="scope"> |
| | | <el-button |
| | | <!-- <el-button |
| | | size="mini" |
| | | type="text" |
| | | icon="el-icon-edit" |
| | | @click="showEditDialog(scope.row)" |
| | | >编辑</el-button> |
| | | >编辑</el-button> --> |
| | | <el-button |
| | | size="mini" |
| | | type="text warn" |
| | | icon="el-icon-delete" |
| | | @click="handleDelete(scope.row)" |
| | | >删除</el-button> |
| | | >取消批次</el-button> |
| | | </template> |
| | | </el-table-column> --> |
| | | </el-table-column> |
| | | </el-table> |
| | | |
| | | <!-- 新增&编辑 --> |
| | |
| | | </el-form-item> |
| | | <el-form-item label="批次编号" prop="batchCode"> |
| | | <el-input v-model="dialogData.batchCode" placeholder="请输入批次编号" maxlength="255" /> |
| | | </el-form-item> |
| | | <el-form-item label="短信类型" prop="smsType"> |
| | | <el-select v-model="dialogData.smsType" clearable placeholder="选择短信类型"> |
| | | <el-option |
| | | v-for="item in smsTypeOpts" |
| | | :key="item.value" |
| | | :label="item.label" |
| | | :value="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="上传文件" prop="uploadFiles"> |
| | | <div class="upload_single_file"> |
| | |
| | | |
| | | <script> |
| | | import BackToTop from '@/components/BackToTop' |
| | | import { getToken } from '@/utils/auth' // get token from session |
| | | // import WangEnduit from '@/components/WangEnduit' // 富文本 |
| | | export default { |
| | | name: 'Index', |
| | |
| | | // keyWord: '', // 搜索区字段,可自行扩展其余字段 |
| | | batchName: '', |
| | | batchCode: '', |
| | | smsType: '', |
| | | |
| | | objectName: '短信', // 对象名称,用于删除提示、启用提示、弹窗标题等 |
| | | |
| | |
| | | // 弹窗数据 |
| | | dialogVisible: false, |
| | | dialogData: {}, |
| | | |
| | | smsTypeOpts: [ |
| | | { label: '验证码', value: 0 }, |
| | | { label: '通知短信', value: 1 }, |
| | | { label: '营销短信', value: 2 } |
| | | ], |
| | | |
| | | // 富文本编辑器 |
| | | // rangenum: null, |
| | |
| | | ], |
| | | smsTemplate: [ |
| | | { required: true, message: '短信模内容不能为空', trigger: 'change' } |
| | | ], |
| | | smsType: [ |
| | | { required: true, message: '短信类型不能为空', trigger: 'change' } |
| | | ] |
| | | // isUp: [ |
| | | // { required: true, message: '是否上架不能为空', trigger: 'change' } |
| | |
| | | |
| | | // 获取列表 |
| | | getList() { |
| | | var { pageNum, pageSize, batchName, batchCode } = this |
| | | var { pageNum, pageSize, batchName, batchCode, smsType } = this |
| | | this.postFN({ |
| | | url: 'send-general/list', |
| | | header: { 'Content-Type': 'application/json;charset=UTF-8' }, |
| | |
| | | pageSize: pageSize, |
| | | |
| | | batchName: batchName, |
| | | batchCode: batchCode |
| | | batchCode: batchCode, |
| | | smsType: smsType |
| | | }, |
| | | mockData: { |
| | | code: 100, |
| | |
| | | resetHandle() { |
| | | this.batchCode = '' |
| | | this.batchName = '' |
| | | this.smsType = '' |
| | | this.reGetList() |
| | | }, |
| | | // 删除 |
| | | handleDelete(item) { |
| | | // 打开二次确认弹窗 |
| | | this.$confirm('是否确认删除该' + this.objectName + '?', '提示', { |
| | | this.$confirm('是否确认取消该短信批次?', '提示', { |
| | | confirmButtonText: '确定', |
| | | cancelButtonText: '取消', |
| | | type: 'warning' |
| | | }).then(() => { |
| | | // 确定回调 |
| | | // TODO url |
| | | this.postFN({ |
| | | url: 'xxx', |
| | | url: 'send-general/cancel', |
| | | header: { 'Content-Type': 'application/json;charset=UTF-8' }, |
| | | params: { |
| | | id: item.id |
| | | }, |
| | |
| | | } |
| | | }, () => { |
| | | this.getList() |
| | | this.$messageSuc('删除成功') |
| | | this.$messageSuc('取消成功') |
| | | }) |
| | | }).catch(() => {}) |
| | | }, |
| | |
| | | var dialogData = { |
| | | batchCode: '', |
| | | batchName: '', |
| | | smsTemplate: '' |
| | | smsTemplate: '', |
| | | smsType: '' |
| | | } |
| | | this.uploadFiles = [] |
| | | this.dialogVisible = true |
| | |
| | | const a = filename.split('').reverse().join('') |
| | | const b = a.substring(0, a.search(/\./)).split('').reverse().join('') |
| | | return b |
| | | } |
| | | }, |
| | | // 上传文件 ↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑ |
| | | // 导出列表 |
| | | exportList() { |
| | | var adminToken = getToken() |
| | | const path = `${window.location.protocol}//${window.location.host}/sms/send-general/get/temp?adminToken=${adminToken}` |
| | | console.log('path', path) |
| | | window.location.href = path |
| | | } |
| | | } |
| | | } |
| | | </script> |