123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209 |
- <template>
- <div class="app-container">
- <div v-if="isShow">
- <!-- 筛选条件 -->
- <div>
- <Collapse :screen-form="searchForm">
- <template #right_btn>
- <el-button size="mini" @click="clearFn">清空</el-button>
- <el-button size="mini" type="primary" @click="searchFn">搜索</el-button>
- </template>
- <template #search>
- <el-form ref="searchForm" :model="searchForm" label-width="70px" size="mini" label-position="left">
- <el-row :gutter="20">
- <el-col :xs="24" :sm="12" :lg="6">
- <el-form-item label="名称" prop="keyword">
- <el-input v-model="searchForm.keyword" placeholder="请输入名称"></el-input>
- </el-form-item>
- </el-col>
- </el-row>
- </el-form>
- </template>
- </Collapse>
- </div>
- <!-- 按钮 -->
- <div class="btn-group clearfix">
- <div class="fr">
- <ExportButton :exUrl="'customer/export'" :exParams="exParams" />
- </div>
- </div>
- <div class="mymain-container">
- <div class="table">
- <el-table
- v-loading="listLoading"
- :data="dataList"
- element-loading-text="Loading"
- border
- fit
- highlight-current-row
- stripe
- >
- <el-table-column align="left" label="客户编码" prop="number" min-width="110">
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.number" />
- <span>{{ scope.row.number }}</span>
- </template>
- </el-table-column>
- <el-table-column align="left" label="客户名称" prop="name" min-width="260" show-overflow-tooltip>
- <template slot-scope="scope">
- <CopyButton :copyText="scope.row.name" />
- <span>{{ scope.row.name }}</span>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="简称"
- prop="shortName"
- min-width="200"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column prop="forbidStatus" align="left" label="禁用状态" min-width="100" show-overflow-tooltip>
- <template slot-scope="scope">
- <el-tag size="mini" type="success" v-if="scope.row.forbidStatus === 'A'">正常</el-tag>
- <el-tag size="mini" type="danger" v-else-if="scope.row.flag === 'B'">禁用</el-tag>
- </template>
- </el-table-column>
- <el-table-column
- align="left"
- label="使用组织"
- prop="useOrgName"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="更新人"
- prop="updateBy"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="left"
- label="更新时间"
- prop="updateTime"
- min-width="160"
- show-overflow-tooltip
- ></el-table-column>
- <el-table-column
- align="center"
- label="操作"
- prop="caozuo"
- min-width="160"
- show-overflow-tooltip
- fixed="right"
- >
- <template slot-scope="scope">
- <el-button type="text" class="textColor" @click="editFn(scope.row.id)">详情</el-button>
- </template>
- </el-table-column>
- </el-table>
- </div>
- <!-- 分页 -->
- <div class="fr">
- <el-pagination
- @size-change="handleSizeChange"
- @current-change="handleCurrentChange"
- :current-page="currentPage"
- :page-sizes="[10, 20, 30, 50]"
- :page-size="pageSize"
- layout="total, sizes, prev, pager, next, jumper"
- :total="listTotal"
- >
- </el-pagination>
- </div>
- </div>
- </div>
- <DealerListDetail :infoList="inforList" v-else />
- </div>
- </template>
- <script>
- import { getDealerList, getDealerInfo } from '@/api/basic_data/dealer'
- import DealerListDetail from './components/dealer_list-detail.vue'
- export default {
- data() {
- return {
- isShow: true,
- dataList: [], // 列表数据
- listLoading: false, // 列表加载loading
- screenForm: {},
- currentPage: 1, // 当前页码
- pageSize: 10, // 每页数量
- listTotal: 0, // 列表总数
- searchForm: {
- keyword: ''
- },
- inforList: {},
- isCollapse: true
- }
- },
- components: {
- DealerListDetail
- },
- created() {
- this.getList()
- },
- computed: {
- exParams() {
- return {
- keyword: this.searchForm.keyword
- }
- }
- },
- methods: {
- // 提交筛选表单
- submitScreenForm() {
- this.currentPage = 1
- this.getList()
- },
- // 重置筛选表单
- resetScreenForm() {
- this.$refs.screenForm.resetFields()
- this.currentPage = 1
- this.getList()
- },
- // 更改每页数量
- handleSizeChange(val) {
- this.pageSize = val
- this.currentPage = 1
- this.getList()
- },
- // 更改当前页
- handleCurrentChange(val) {
- this.currentPage = val
- this.getList()
- },
- //搜索功能
- async searchFn() {
- this.currentPage = 1
- this.getList()
- },
- //重置
- clearFn() {
- this.$refs.searchForm.resetFields()
- },
- //获取列表数据
- async getList() {
- let params = {
- ...this.searchForm,
- pageNum: this.currentPage,
- pageSize: this.pageSize
- }
- const res = await getDealerList(params)
- this.dataList = res.data.records
- this.listTotal = res.data.total
- },
- async editFn(id) {
- this.isShow = false
- const res = await getDealerInfo({ id })
- this.inforList = res.data
- }
- }
- }
- </script>
- <style lang="scss" scoped></style>
|