dealer_list.vue 5.5 KB

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