dealer_list.vue 6.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209
  1. <template>
  2. <div class="app-container">
  3. <div v-if="isShow">
  4. <!-- 筛选条件 -->
  5. <div>
  6. <Collapse :screen-form="searchForm">
  7. <template #right_btn>
  8. <el-button size="mini" @click="clearFn">清空</el-button>
  9. <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
  10. </template>
  11. <template #search>
  12. <el-form ref="searchForm" :model="searchForm" label-width="70px" size="mini" label-position="left">
  13. <el-row :gutter="20">
  14. <el-col :xs="24" :sm="12" :lg="6">
  15. <el-form-item label="名称" prop="keyword">
  16. <el-input v-model="searchForm.keyword" placeholder="请输入名称"></el-input>
  17. </el-form-item>
  18. </el-col>
  19. </el-row>
  20. </el-form>
  21. </template>
  22. </Collapse>
  23. </div>
  24. <!-- 按钮 -->
  25. <div class="btn-group clearfix">
  26. <div class="fr">
  27. <ExportButton :exUrl="'customer/export'" :exParams="exParams" />
  28. </div>
  29. </div>
  30. <div class="mymain-container">
  31. <div class="table">
  32. <el-table
  33. v-loading="listLoading"
  34. :data="dataList"
  35. element-loading-text="Loading"
  36. border
  37. fit
  38. highlight-current-row
  39. stripe
  40. >
  41. <el-table-column align="left" label="客户编码" prop="number" min-width="110">
  42. <template slot-scope="scope">
  43. <CopyButton :copyText="scope.row.number" />
  44. <span>{{ scope.row.number }}</span>
  45. </template>
  46. </el-table-column>
  47. <el-table-column align="left" label="客户名称" prop="name" min-width="260" show-overflow-tooltip>
  48. <template slot-scope="scope">
  49. <CopyButton :copyText="scope.row.name" />
  50. <span>{{ scope.row.name }}</span>
  51. </template>
  52. </el-table-column>
  53. <el-table-column
  54. align="left"
  55. label="简称"
  56. prop="shortName"
  57. min-width="200"
  58. show-overflow-tooltip
  59. ></el-table-column>
  60. <el-table-column prop="forbidStatus" align="left" label="禁用状态" min-width="100" show-overflow-tooltip>
  61. <template slot-scope="scope">
  62. <el-tag size="mini" type="success" v-if="scope.row.forbidStatus === 'A'">正常</el-tag>
  63. <el-tag size="mini" type="danger" v-else-if="scope.row.flag === 'B'">禁用</el-tag>
  64. </template>
  65. </el-table-column>
  66. <el-table-column
  67. align="left"
  68. label="使用组织"
  69. prop="useOrgName"
  70. min-width="160"
  71. show-overflow-tooltip
  72. ></el-table-column>
  73. <el-table-column
  74. align="left"
  75. label="更新人"
  76. prop="updateBy"
  77. min-width="160"
  78. show-overflow-tooltip
  79. ></el-table-column>
  80. <el-table-column
  81. align="left"
  82. label="更新时间"
  83. prop="updateTime"
  84. min-width="160"
  85. show-overflow-tooltip
  86. ></el-table-column>
  87. <el-table-column
  88. align="center"
  89. label="操作"
  90. prop="caozuo"
  91. min-width="160"
  92. show-overflow-tooltip
  93. fixed="right"
  94. >
  95. <template slot-scope="scope">
  96. <el-button type="text" class="textColor" @click="editFn(scope.row.id)">详情</el-button>
  97. </template>
  98. </el-table-column>
  99. </el-table>
  100. </div>
  101. <!-- 分页 -->
  102. <div class="fr">
  103. <el-pagination
  104. @size-change="handleSizeChange"
  105. @current-change="handleCurrentChange"
  106. :current-page="currentPage"
  107. :page-sizes="[10, 20, 30, 50]"
  108. :page-size="pageSize"
  109. layout="total, sizes, prev, pager, next, jumper"
  110. :total="listTotal"
  111. >
  112. </el-pagination>
  113. </div>
  114. </div>
  115. </div>
  116. <DealerListDetail :infoList="inforList" v-else />
  117. </div>
  118. </template>
  119. <script>
  120. import { getDealerList, getDealerInfo } from '@/api/basic_data/dealer'
  121. import DealerListDetail from './components/dealer_list-detail.vue'
  122. export default {
  123. data() {
  124. return {
  125. isShow: true,
  126. dataList: [], // 列表数据
  127. listLoading: false, // 列表加载loading
  128. screenForm: {},
  129. currentPage: 1, // 当前页码
  130. pageSize: 10, // 每页数量
  131. listTotal: 0, // 列表总数
  132. searchForm: {
  133. keyword: ''
  134. },
  135. inforList: {},
  136. isCollapse: true
  137. }
  138. },
  139. components: {
  140. DealerListDetail
  141. },
  142. created() {
  143. this.getList()
  144. },
  145. computed: {
  146. exParams() {
  147. return {
  148. keyword: this.searchForm.keyword
  149. }
  150. }
  151. },
  152. methods: {
  153. // 提交筛选表单
  154. submitScreenForm() {
  155. this.currentPage = 1
  156. this.getList()
  157. },
  158. // 重置筛选表单
  159. resetScreenForm() {
  160. this.$refs.screenForm.resetFields()
  161. this.currentPage = 1
  162. this.getList()
  163. },
  164. // 更改每页数量
  165. handleSizeChange(val) {
  166. this.pageSize = val
  167. this.currentPage = 1
  168. this.getList()
  169. },
  170. // 更改当前页
  171. handleCurrentChange(val) {
  172. this.currentPage = val
  173. this.getList()
  174. },
  175. //搜索功能
  176. async searchFn() {
  177. this.currentPage = 1
  178. this.getList()
  179. },
  180. //重置
  181. clearFn() {
  182. this.$refs.searchForm.resetFields()
  183. },
  184. //获取列表数据
  185. async getList() {
  186. let params = {
  187. ...this.searchForm,
  188. pageNum: this.currentPage,
  189. pageSize: this.pageSize
  190. }
  191. const res = await getDealerList(params)
  192. this.dataList = res.data.records
  193. this.listTotal = res.data.total
  194. },
  195. async editFn(id) {
  196. this.isShow = false
  197. const res = await getDealerInfo({ id })
  198. this.inforList = res.data
  199. }
  200. }
  201. }
  202. </script>
  203. <style lang="scss" scoped></style>