<template>
|
<div class="app-container">
|
<el-form :model="queryParams" ref="queryForm" :inline="true" label-width="68px">
|
<el-form-item label="厂商名称" prop="name">
|
<el-input
|
v-model="queryParams.name"
|
placeholder="请输入厂商名称"
|
clearable
|
size="small"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item label="厂商代码" prop="code">
|
<el-input
|
v-model="queryParams.code"
|
placeholder="请输入厂商代码"
|
clearable
|
size="small"
|
@keyup.enter.native="handleQuery"
|
/>
|
</el-form-item>
|
<el-form-item>
|
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
</el-form-item>
|
</el-form>
|
|
<el-table v-loading="loading" :data="manufacturerList" highlight-current-row
|
@current-change="handleCurrentChange">
|
<el-table-column label="序号" align="center" width="50">
|
<template slot-scope="scope">
|
<span>{{ scope.$index + (queryParams.pageNum - 1) * queryParams.pageSize + 1 }} </span>
|
</template>
|
</el-table-column>
|
<el-table-column label="厂商名称" min-width="220" align="center" prop="name" />
|
<el-table-column label="厂商代码" min-width="180" align="center" prop="code" />
|
<el-table-column label="联系方式" min-width="150" align="center" prop="phone" />
|
<el-table-column label="邮箱" min-width="180" align="center" prop="mailbox" />
|
<el-table-column label="联系地址" min-width="180" align="center" prop="contactAddress" show-overflow-tooltip />
|
</el-table>
|
|
<pagination
|
v-show="total>0"
|
:total="total"
|
:page.sync="queryParams.pageNum"
|
:limit.sync="queryParams.pageSize"
|
@pagination="getList"
|
/>
|
</div>
|
</template>
|
|
<script>
|
import { listManufacturer } from "@/api/oa/manufacturer";
|
|
export default {
|
name: "Manufacturer",
|
data() {
|
return {
|
loading: false,
|
// 总条数
|
total: 0,
|
// 厂商表格数据
|
manufacturerList: [],
|
// 查询参数
|
queryParams: {
|
pageNum: 1,
|
pageSize: 10,
|
name: undefined,
|
code: undefined
|
},
|
currentRow: undefined
|
};
|
},
|
created() {
|
this.getList();
|
},
|
methods: {
|
/** 查询厂商列表 */
|
getList() {
|
this.loading = true;
|
listManufacturer(this.queryParams).then(response => {
|
this.manufacturerList = response.rows;
|
this.total = response.total;
|
this.loading = false;
|
});
|
},
|
/** 搜索按钮操作 */
|
handleQuery() {
|
this.queryParams.pageNum = 1;
|
this.getList();
|
},
|
/** 重置按钮操作 */
|
resetQuery() {
|
this.resetForm("queryForm");
|
this.handleQuery();
|
},
|
handleCurrentChange(v) {
|
this.currentRow = v;
|
}
|
}
|
};
|
</script>
|