You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

140 lines
3.4 KiB

<template>
<div class="app-container">
<div class="search">
<el-form :inline="true" class="tab-header">
<span style="font-size: 16px; font-weight: 500">物料:</span>
<el-input
v-model="page.params.name"
style="width: 150px; margin-left: 10px"
/>
<el-button
type="primary"
size="small"
style="margin-left: 10px"
icon="el-icon-search"
@click="dosearch"
>查询</el-button
>
<el-button
type="primary"
size="small"
icon="el-icon-refresh"
@click="resetSearch"
>重置</el-button
>
</el-form>
</div>
<div class="listconadd" style="padding: 20px">
<el-table
v-loading="tableLoading"
:data="tableData"
border
style="width: 100%"
>
<el-table-column
label="序号"
width="55px"
:index="indexMethod"
type="index"
align="center"
></el-table-column>
<el-table-column prop="code" label="物料编码" align="center">
</el-table-column>
<el-table-column prop="name" label="物料名称" align="center">
</el-table-column>
<el-table-column prop="unit" label="规格单位" align="center">
</el-table-column>
<el-table-column
prop="taxPrice"
label="含税单价"
align="center"
>
</el-table-column>
</el-table>
<div class="pages">
<div class="tit" />
<pagination
:total="page.total"
:page.sync="page.current"
:limit.sync="page.size"
@pagination="getPageList"
/>
</div>
</div>
</div>
</template>
<script>
import { selectMaterialInfoList } from "@/api/Zhj/essentialData/index.js";
import Pagination from '@/components/pagination'
export default {
components: {
Pagination
},
data() {
return {
tableLoading: false,
form: {},
page: {
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
name: "",
},
},
tableData: [],
};
},
mounted() {},
created() {
this.getPageList();
},
methods: {
getPageList() {
this.tableLoading = true;
selectMaterialInfoList(this.page)
.then((res) => {
this.tableLoading = false;
if (res.data.pages!=0) {
this.page.total = res.data.total;
this.tableData = res.data.records;
} else {
this.$message({
type: "warning",
message: "暂无该物料",
});
}
})
.catch(() => {
this.tableLoading = false;
});
},
// 查询某天的数据
dosearch() {
this.getPageList();
},
indexMethod(index) {
var pagestart = (this.page.current - 1) * this.page.size;
var pageindex = index + 1 + pagestart;
return pageindex;
},
resetSearch() {
this.page ={
total: 0, // 默认数据总数
current: 1, // 默认开始页面
size: 10, // 每页的数据条数
params: {
name: "",
},
}
this.getPageList();
}
},
};
</script>
<style scoped="scoped" >
</style>