index.vue 2.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <template>
  2. <div class="source pagePadding">
  3. <div
  4. v-if="powers && powers.length > 0 && powers.some((item) => item == '001')"
  5. v-loading="loading"
  6. >
  7. <el-row style="padding: 8px 0 10px 0">
  8. <el-col :span="4" style="width: 200px">
  9. <search-terrace
  10. :value="parmValue.platform_id"
  11. :disabled="false"
  12. :size="'mini'"
  13. :isDetail="false"
  14. :is_show="'0'"
  15. :placeholder="'业务平台'"
  16. @searchChange="platform_codesearchChange"
  17. />
  18. </el-col>
  19. </el-row>
  20. <el-table
  21. :data="tableData"
  22. style="width: 100%"
  23. border
  24. :size="size"
  25. stripe
  26. >
  27. <el-table-column label="序号" type="index"> </el-table-column>
  28. <el-table-column prop="platform_name" label="业务平台">
  29. </el-table-column>
  30. <el-table-column prop="source" label="销售渠道"> </el-table-column>
  31. </el-table>
  32. </div>
  33. <no-auth v-else></no-auth>
  34. </div>
  35. </template>
  36. <script>
  37. import asyncRequest from "@/apis/service/orderEntry/source";
  38. import { mapGetters } from "vuex";
  39. import resToken from "@/mixins/resToken";
  40. export default {
  41. name: "source",
  42. mixins: [resToken],
  43. computed: {
  44. //组件SIZE设置
  45. ...mapGetters(["tablebtnSize", "searchSize", "size"]),
  46. powers() {
  47. let tran =
  48. this.$store.getters.btnList.find(
  49. (item) => item.menu_route == "source"
  50. ) || {};
  51. if (tran && tran.action && tran.action.length > 0) {
  52. return tran.action;
  53. } else {
  54. return [];
  55. }
  56. },
  57. },
  58. data() {
  59. return {
  60. loading: true,
  61. parmValue: {
  62. platform_id: "",
  63. },
  64. tableData: [],
  65. };
  66. },
  67. mounted() {
  68. this.searchList();
  69. },
  70. methods: {
  71. restSearch() {
  72. this.parmValue = {
  73. platform_id: "",
  74. };
  75. this.searchList();
  76. },
  77. async platform_codesearchChange(e) {
  78. const { id } = e;
  79. this.parmValue.platform_id = id || "";
  80. await this.searchList();
  81. },
  82. // 刷新表格
  83. async searchList() {
  84. this.loading = true;
  85. const { code, data, message } = await asyncRequest.list(this.parmValue);
  86. if (code === 0) {
  87. this.tableData = data;
  88. } else if (code >= 100 && code <= 104) {
  89. await this.logout();
  90. } else {
  91. this.tableData = [];
  92. this.$message.warning(message);
  93. }
  94. this.loading = false;
  95. },
  96. },
  97. };
  98. </script>
  99. <style lang="scss" scoped>
  100. </style>