AgencyList.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <template>
  2. <div class="full-container-p24">
  3. <div style="display: flex; justify-content: space-between">
  4. <div style="display: flex">
  5. <el-input
  6. placeholder="请输入代理/手机号"
  7. prefix-icon="el-icon-search"
  8. v-model="term"
  9. clearable
  10. style="height: 32px; width: 330px; line-height: 32px"
  11. ></el-input>
  12. <div class="seach-btn" @click="getAgencyList(1)">查询</div>
  13. </div>
  14. </div>
  15. <div style="margin-top: 24px">
  16. <el-table :data="tableData" stripe style="width: 100%">
  17. <el-table-column
  18. type="index"
  19. label="序号"
  20. min-width="80"
  21. align="center"
  22. ></el-table-column>
  23. <el-table-column
  24. prop="userName"
  25. label="代理名称"
  26. min-width="120"
  27. align="center"
  28. ></el-table-column>
  29. <el-table-column
  30. prop="phone"
  31. label="手机号"
  32. min-width="160"
  33. align="center"
  34. ></el-table-column>
  35. <el-table-column
  36. prop="createTime"
  37. label="入驻时间"
  38. min-width="200"
  39. align="center"
  40. ></el-table-column>
  41. <el-table-column label="操作" min-width="80" align="center">
  42. <template v-slot="scope">
  43. <el-button
  44. @click="agencySubAccountList(scope.row.id, tableData)"
  45. link
  46. type="primary"
  47. size="small"
  48. >
  49. 查看详情
  50. </el-button>
  51. </template>
  52. </el-table-column>
  53. </el-table>
  54. <div style="width: 100%; text-align: right; margin-top: 43px">
  55. <el-pagination
  56. background
  57. layout="prev, pager, next"
  58. :current-page="currentPage"
  59. :total="total"
  60. @current-change="pageChange"
  61. ></el-pagination>
  62. </div>
  63. </div>
  64. </div>
  65. </template>
  66. <script>
  67. import { ref, h, reactive, toRefs, onMounted } from "vue";
  68. import { ElNotification, ElMessageBox, ElMessage } from "element-plus";
  69. import store from "../../store";
  70. import router from "../../router";
  71. import md5 from "md5";
  72. import api from "../../apis/fetch";
  73. export default {
  74. setup() {
  75. let currentPage = ref(1);
  76. let term = ref("");
  77. let tableData = ref([]);
  78. let total = ref(0);
  79. async function getAgencyList(page) {
  80. currentPage.value = page || currentPage.value;
  81. let res = await api.getAgencyList({
  82. currentPage: currentPage.value,
  83. size: 10,
  84. term: term.value,
  85. });
  86. if (res.data.status == 0) {
  87. tableData.value = res.data.result;
  88. total.value = res.data.total;
  89. } else {
  90. tableData.value = [];
  91. total.value = 0;
  92. }
  93. }
  94. async function agencySubAccountList(id) {
  95. router.push({
  96. path: "/agencySubAccountList",
  97. query: {
  98. id,
  99. },
  100. });
  101. }
  102. function pageChange(e) {
  103. currentPage.value = e;
  104. getAgencyList();
  105. }
  106. getAgencyList();
  107. onMounted(() => {});
  108. return {
  109. currentPage,
  110. term,
  111. tableData,
  112. total,
  113. getAgencyList,
  114. agencySubAccountList,
  115. pageChange,
  116. };
  117. },
  118. };
  119. </script>
  120. <style scoped>
  121. .seach-btn {
  122. display: inline-block;
  123. width: 60px;
  124. height: 38px;
  125. background: #0094fe;
  126. border-radius: 2px;
  127. font-size: 14px;
  128. font-family: PingFangSC-Regular, PingFang SC;
  129. font-weight: 400;
  130. color: #ffffff;
  131. text-align: center;
  132. line-height: 38px;
  133. margin-left: 10px;
  134. cursor: pointer;
  135. }
  136. .cargo-owner-add {
  137. width: 80px;
  138. height: 32px;
  139. border-radius: 2px;
  140. border: 1px solid #0094fe;
  141. font-size: 14px;
  142. font-family: PingFangSC-Regular, PingFang SC;
  143. font-weight: 400;
  144. color: #0094fe;
  145. line-height: 32px;
  146. text-align: center;
  147. cursor: pointer;
  148. }
  149. :deep().el-dialog {
  150. width: 560px;
  151. padding: 20px 50px;
  152. border-radius: 6px;
  153. }
  154. :deep() .el-dialog__title {
  155. font-size: 18px;
  156. font-family: PingFangSC-Regular, PingFang SC;
  157. font-weight: 400;
  158. color: #0094fe;
  159. }
  160. </style>