index.vue
2.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
<!-- 物料列表 -->
<template>
<d2-container>
<el-form
:inline="true"
:model="searchForm"
label-width="85px"
slot="header"
>
<el-form-item label="名称">
<el-input v-model="searchForm.keyWord" placeholder="请输入名称" clearable></el-input>
</el-form-item>
<el-form-item>
<el-button type="primary" icon="el-icon-search" @click="getList">查询</el-button>
</el-form-item>
</el-form>
<d2-table-header title="物料列表"></d2-table-header>
<d2-table
ref="table"
:searchForm="searchForm"
:tableData="tableData"
:tableTotal="tableTotal"
:tableParams="tableParams"
@refreshTable="getList"
></d2-table>
</d2-container>
</template>
<script>
import { getListApi } from '@api/table2'
import notice from '@/common/notice'
export default {
name: 'fimsTable2',
data() {
return {
searchForm: {
keyWord: ''
},
getListApi: getListApi,
// 表格
tableData: [],
tableTotal: 10,
tableParams: {
listName: 'deviceList',
tableColumns: [{
label: '物料代码',
prop: 'deviceNum',
width: '170'
}, {
label: '物料编码',
prop: 'deviceCode',
width: '170'
}, {
label: 'CRC物料号',
prop: 'crcCode',
width: '170'
}, {
label: '图号',
prop: 'drawNum',
width: '170'
}, {
label: '物料名称',
prop: 'deviceName',
minWidth: '200'
}, {
label: '规格',
prop: 'specifications',
width: '140'
}, {
label: '责任人',
prop: 'responsible',
width: '120'
}]
}
}
},
mounted() {
this.getList()
},
methods: {
getList(page) {
const params = {
...(page || { pageCount: 10, pageSize: 1 }),
...this.searchForm
}
getListApi(params).then(res => {
// console.log(res)
this.tableData = res.data
this.tableTotal = res.pagination.totalCount
}).catch(() => {
notice.errorTips()
})
}
}
}
</script>
<style scoped>
</style>