sms_manage.vue 3.7KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. <template>
  2. <div class="main-contain">
  3. <div class="position">
  4. <bread-crumb :crumbs="crumbs"></bread-crumb>
  5. <el-button
  6. :disabled="$store.getters.xt_user.subscibe.state==3?true:false"
  7. @click="sendAction"
  8. style="float:right;"
  9. type="primary"
  10. icon="el-icon-message"
  11. size="small"
  12. >群发短信</el-button>
  13. </div>
  14. <div class="app-container" style="padding: 0 5px; background-color: #f6f8f9;">
  15. <div style="background-color: #fff; padding: 5px 0;">
  16. <el-table :data="records">
  17. <el-table-column label="发送内容" align="center" prop="full_content" :show-overflow-tooltip="true" min-width="48%">
  18. </el-table-column>
  19. <el-table-column label="发送状态" align="center" min-width="15%">
  20. <template slot-scope="scope">
  21. {{ send_status_text(scope.row.status) }}
  22. </template>
  23. </el-table-column>
  24. <el-table-column label="发送人数/到达条数" align="center" min-width="22%">
  25. <template slot-scope="scope">
  26. {{ scope.row.total_count }}/{{ scope.row.success_count }}
  27. </template>
  28. </el-table-column>
  29. <el-table-column label="审核状态" align="center" min-width="15%">
  30. <template slot-scope="scope">
  31. {{ review_status_text(scope.row.status) }}
  32. </template>
  33. </el-table-column>
  34. </el-table>
  35. <div style="padding-top: 15px; padding-left: 10px;">
  36. <el-pagination :total="record_total" :current-page.sync="current_page" :page-size="10" layout="total, prev, pager, next" @current-change="getSendRecords()"></el-pagination>
  37. </div>
  38. </div>
  39. </div>
  40. </div>
  41. </template>
  42. <script>
  43. import BreadCrumb from "@/scrm_pages/components/bread-crumb"
  44. import { fetchBatchSendRecords } from "@/api/sms"
  45. export default {
  46. name: "SMSManage",
  47. components: {
  48. BreadCrumb,
  49. },
  50. data() {
  51. return {
  52. crumbs: [
  53. { path: false, name: "客户管理" },
  54. { path: false, name: "短信管理" },
  55. ],
  56. record_total: 0,
  57. current_page: 1,
  58. records: [],
  59. }
  60. },
  61. mounted() {
  62. this.getSendRecords()
  63. },
  64. methods: {
  65. getSendRecords: function() {
  66. fetchBatchSendRecords(this.current_page).then(rs => {
  67. var resp = rs.data
  68. if (resp.state == 1) {
  69. this.records = resp.data.records
  70. this.record_total = resp.data.total
  71. } else {
  72. this.$message.error(resp.msg)
  73. }
  74. }).catch(err => {
  75. this.$message.error(err)
  76. })
  77. },
  78. sendAction: function() {
  79. this.$router.push({path:'/sms/send'})
  80. },
  81. send_status_text: function(status) {
  82. if (status == 4) {
  83. return "已发送"
  84. } else if (status == 5) {
  85. return "发送失败"
  86. } else {
  87. return "未发送"
  88. }
  89. },
  90. review_status_text: function(status) {
  91. if (status == 1) {
  92. return "待审核"
  93. } else if (status == 2) {
  94. return "未通过"
  95. } else {
  96. return "通过"
  97. }
  98. },
  99. },
  100. }
  101. </script>
  102. <style lang="scss" scoped>
  103. </style>