index.vue 5.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. <template>
  2. <div class="app-container">
  3. <!-- 搜索区域 -->
  4. <div class="filter-container">
  5. <span>供应商名称:</span>
  6. <el-input
  7. v-model="listQuery.shopName"
  8. placeholder="供应商名称"
  9. style="width: 200px"
  10. class="filter-item"
  11. @keyup.enter.native="getList"
  12. />
  13. <span>供应商类型:</span>
  14. <el-select
  15. v-model="listQuery.shopType"
  16. placeholder="供应商类型"
  17. clearable
  18. style="width: 200px"
  19. class="filter-item"
  20. @change="getList"
  21. >
  22. <el-option label="所有类型" value="" />
  23. <el-option label="代理商" :value="2" />
  24. <el-option label="品牌方" :value="1" />
  25. </el-select>
  26. <span>手机号:</span>
  27. <el-input
  28. v-model="listQuery.mobile"
  29. placeholder="手机号"
  30. style="width: 200px"
  31. class="filter-item"
  32. @keyup.enter.native="getList"
  33. />
  34. <span>审核状态:</span>
  35. <el-select
  36. v-model="listQuery.lowerAuditStatus"
  37. placeholder="供应商类型"
  38. clearable
  39. style="width: 200px"
  40. class="filter-item"
  41. @change="getList"
  42. >
  43. <el-option label="全部" value="" />
  44. <el-option label="已完成审核" :value="1" />
  45. <el-option label="未完成审核" :value="0" />
  46. </el-select>
  47. <span>联系人:</span>
  48. <el-input
  49. v-model="listQuery.linkMan"
  50. placeholder="联系人"
  51. style="width: 200px"
  52. class="filter-item"
  53. @keyup.enter.native="getList"
  54. />
  55. <el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
  56. </div>
  57. <!-- 搜索区域END -->
  58. <!-- 表格区域 -->
  59. <el-table
  60. v-loading="listLoading"
  61. :data="list"
  62. style="width: 100%"
  63. border
  64. fit
  65. highlight-current-row
  66. cell-class-name="table-cell"
  67. >
  68. <el-table-column label="序号" type="index" width="80" align="center" />
  69. <el-table-column prop="name" label="供应商名称" align="center" />
  70. <el-table-column label="供应商类型" width="150px" align="center">
  71. <template slot-scope="{ row }">
  72. <span v-if="row.shopType === 1">品牌方</span>
  73. <span v-if="row.shopType === 2">代理商</span>
  74. </template>
  75. </el-table-column>
  76. <el-table-column prop="mobile" label="手机号" width="200px" align="center" />
  77. <el-table-column prop="linkMan" label="联系人" width="200px" align="center" />
  78. <el-table-column label="审核状态" width="220px" align="center">
  79. <template slot-scope="{ row }">
  80. <el-tag v-if="row.lowerAuditStatus === 0" size="small" type="danger">未完成审核</el-tag>
  81. <el-tag v-if="row.lowerAuditStatus === 1" size="small" type="success">已完成审核</el-tag>
  82. </template>
  83. </el-table-column>
  84. <el-table-column label="操作" width="240px" align="center">
  85. <template slot-scope="{ row }">
  86. <el-badge :hidden="row.lowerAuditStatus === 1" :value="row.waitAuditNum" :max="99">
  87. <el-button
  88. type="primary"
  89. icon="el-icon-s-check"
  90. size="mini"
  91. @click="$_navigationTo(`auth-list?authUserId=${row.authUserId}`)"
  92. >品牌授权信息审核</el-button>
  93. </el-badge>
  94. </template>
  95. </el-table-column>
  96. </el-table>
  97. <!-- 表格区域END -->
  98. <!-- 页码 -->
  99. <pagination
  100. v-show="total > 0"
  101. :total="total"
  102. :page.sync="listQuery.pageNum"
  103. :limit.sync="listQuery.pageSize"
  104. @pagination="getList(listQuery)"
  105. />
  106. </div>
  107. </template>
  108. <script>
  109. import { fetchSupplierList } from '@/api/supplier'
  110. import Pagination from '@/components/Pagination'
  111. export default {
  112. components: { Pagination },
  113. data() {
  114. return {
  115. listQuery: {
  116. listType: 2,
  117. brandId: '', // 品牌id
  118. linkMan: '', // 联系人
  119. mobile: '', // 手机号
  120. pageNum: 0, // 页码
  121. pageSize: 20, // 分页大小
  122. shopName: '', // 供应商名称
  123. shopType: '', // 供应商类型
  124. lowerAuditStatus: ''
  125. },
  126. listLoading: false,
  127. list: [],
  128. total: 0
  129. }
  130. },
  131. created() {
  132. this.getList()
  133. },
  134. methods: {
  135. // 过滤列表
  136. handleFilter() {},
  137. // 获取供应商列表
  138. getList() {
  139. this.listLoading = true
  140. fetchSupplierList(this.listQuery)
  141. .then(res => {
  142. if (res.code !== 0) return
  143. this.list = res.data.list
  144. this.total = res.data.total
  145. })
  146. .finally(() => {
  147. this.listLoading = false
  148. })
  149. }
  150. }
  151. }
  152. </script>
  153. <style lang="scss" scoped>
  154. .filter-container {
  155. span {
  156. display: inline-block;
  157. margin-bottom: 10px;
  158. vertical-align: middle;
  159. font-size: 14px;
  160. }
  161. .el-button {
  162. display: inline-block;
  163. margin-bottom: 10px;
  164. vertical-align: middle;
  165. }
  166. .el-input,
  167. .el-select {
  168. margin-right: 10px;
  169. margin-left: 10px;
  170. }
  171. }
  172. .el-table .cell {
  173. overflow: visible;
  174. }
  175. </style>