|
@@ -1,238 +1,176 @@
|
1
|
1
|
<template>
|
2
|
|
- <div class="Placard">
|
3
|
|
- <div class="content">
|
4
|
|
- <div class="content_left">
|
5
|
|
- <el-table style="width: 100%;"
|
6
|
|
- ref="record_table"
|
7
|
|
- :data="list" border
|
8
|
|
- :header-cell-style="{'text-align': 'center'}"
|
9
|
|
- :cell-style = "{'text-align': 'center'}"
|
10
|
|
- :highlight-current-row="true"
|
11
|
|
- @current-change = 'getcurrentchange'
|
12
|
|
- >
|
13
|
|
- <el-table-column
|
14
|
|
- prop="name"
|
15
|
|
- label="选择智能设备"
|
16
|
|
- width="">
|
17
|
|
- </el-table-column>
|
18
|
|
- </el-table>
|
19
|
|
- </div>
|
20
|
|
- <div class="content_right">
|
21
|
|
- <div style="display: flex;height: 36px;margin-bottom: 10px;background: gainsboro;">
|
22
|
|
- <div style="flex: 1;line-height: 36px;">智能设备产品列表</div>
|
23
|
|
- <div style="flex: 1;text-align: right;">
|
24
|
|
- <el-button type="primary" size="small">设备数据导入</el-button>
|
25
|
|
- </div>
|
26
|
|
- </div>
|
27
|
|
- <el-table style="width: 100%;"
|
28
|
|
- :data="list_detail" border
|
29
|
|
- :header-cell-style="{'text-align': 'center'}"
|
30
|
|
- :cell-style = "{'text-align': 'center'}"
|
31
|
|
- :highlight-current-row="true"
|
32
|
|
- >
|
33
|
|
- <el-table-column
|
34
|
|
- prop="name"
|
35
|
|
- label="产品名称"
|
36
|
|
- width="">
|
37
|
|
- </el-table-column>
|
38
|
|
- <el-table-column
|
39
|
|
- prop="device_type"
|
40
|
|
- label="产品型号"
|
41
|
|
- width="">
|
42
|
|
- </el-table-column>
|
43
|
|
- <el-table-column
|
44
|
|
- prop="batch_num"
|
45
|
|
- label="产品编码"
|
46
|
|
- width="">
|
47
|
|
- </el-table-column>
|
48
|
|
- <el-table-column
|
49
|
|
- prop="serialno"
|
50
|
|
- label="产品序列号"
|
51
|
|
- width="">
|
52
|
|
- </el-table-column>
|
53
|
|
- <el-table-column
|
54
|
|
- prop="emq_password"
|
55
|
|
- label="产品MQTT密码"
|
56
|
|
- width="">
|
57
|
|
- </el-table-column>
|
58
|
|
- <el-table-column
|
59
|
|
- prop="production_date"
|
60
|
|
- label="生产日期"
|
61
|
|
- width="">
|
62
|
|
- <template slot-scope="scope">
|
63
|
|
- {{ (scope.row.production_date).split('T')[0] }}
|
64
|
|
- </template>
|
65
|
|
- </el-table-column>
|
66
|
|
- <el-table-column
|
67
|
|
- prop="expire_date"
|
68
|
|
- label="使用期限"
|
69
|
|
- width="">
|
70
|
|
- <template slot-scope="scope">
|
71
|
|
- {{ (scope.row.production_date).split('T')[0] }}
|
72
|
|
- </template>
|
73
|
|
- </el-table-column>
|
74
|
|
- <el-table-column
|
75
|
|
- prop="register_num"
|
76
|
|
- label="产品注册证编码"
|
77
|
|
- width="">
|
78
|
|
- </el-table-column>
|
79
|
|
- <el-table-column
|
80
|
|
- prop="vendor_name"
|
81
|
|
- label="产品注册人"
|
82
|
|
- width="">
|
83
|
|
- </el-table-column>
|
84
|
|
- <el-table-column
|
85
|
|
- prop="address"
|
86
|
|
- label="注册人地址"
|
87
|
|
- width="">
|
88
|
|
- </el-table-column>
|
89
|
|
- <el-table-column
|
90
|
|
- prop="contact"
|
91
|
|
- label="注册人联系方式"
|
92
|
|
- width="">
|
93
|
|
- </el-table-column>
|
94
|
|
- <el-table-column
|
95
|
|
- prop="production_license"
|
96
|
|
- label="注册生产许可证编号"
|
97
|
|
- width="">
|
98
|
|
- </el-table-column>
|
99
|
|
- <el-table-column
|
100
|
|
- prop="production_corporate"
|
101
|
|
- label="产品生产企业"
|
102
|
|
- width="">
|
103
|
|
- </el-table-column>
|
104
|
|
- <el-table-column
|
105
|
|
- prop="production_address"
|
106
|
|
- label="产品企业地址"
|
107
|
|
- width="">
|
108
|
|
- </el-table-column>
|
109
|
|
- <el-table-column
|
110
|
|
- prop="contact"
|
111
|
|
- label="生产企业联系方式"
|
112
|
|
- width="">
|
113
|
|
- </el-table-column>
|
114
|
|
- <el-table-column
|
115
|
|
- prop="status"
|
116
|
|
- label="激活状态"
|
117
|
|
- width="">
|
118
|
|
- <template slot-scope="scope">
|
119
|
|
- {{ getstatus(scope.row.status) }}
|
120
|
|
- </template>
|
121
|
|
- </el-table-column>
|
122
|
|
- </el-table>
|
123
|
|
- <div style="text-align: right;margin-top: 10px;">
|
124
|
|
- <el-pagination
|
125
|
|
- @size-change="handleSizeChange"
|
126
|
|
- @current-change="handleCurrentChange"
|
127
|
|
- :current-page="page"
|
128
|
|
- :page-sizes="[50,100, 200, 300, 400]"
|
129
|
|
- :page-size="limet"
|
130
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
131
|
|
- :total="total">
|
132
|
|
- </el-pagination>
|
|
2
|
+ <div class="Placard">
|
|
3
|
+ <div class="content">
|
|
4
|
+ <div class="content_left">
|
|
5
|
+ <el-table style="width: 100%;" ref="record_table" :data="list" border
|
|
6
|
+ :header-cell-style="{ 'text-align': 'center' }" :cell-style="{ 'text-align': 'center' }"
|
|
7
|
+ :highlight-current-row="true" @current-change='getcurrentchange'>
|
|
8
|
+ <el-table-column prop="name" label="选择智能设备" width="">
|
|
9
|
+ </el-table-column>
|
|
10
|
+ </el-table>
|
|
11
|
+ </div>
|
|
12
|
+ <div class="content_right">
|
|
13
|
+ <div style="display: flex;height: 36px;margin-bottom: 10px;background: gainsboro;">
|
|
14
|
+ <div style="flex: 1;line-height: 36px;">智能设备产品列表</div>
|
|
15
|
+ <div style="flex: 1;text-align: right;">
|
|
16
|
+ <el-button type="primary" size="small">设备数据导入</el-button>
|
133
|
17
|
</div>
|
134
|
18
|
</div>
|
135
|
|
- </div>
|
136
|
|
-
|
|
19
|
+ <el-table style="width: 100%;" :data="list_detail" border :header-cell-style="{ 'text-align': 'center' }"
|
|
20
|
+ :cell-style="{ 'text-align': 'center' }" :highlight-current-row="true">
|
|
21
|
+ <el-table-column prop="name" label="产品名称" width="">
|
|
22
|
+ </el-table-column>
|
|
23
|
+ <el-table-column prop="device_type" label="产品型号" width="">
|
|
24
|
+ </el-table-column>
|
|
25
|
+ <el-table-column prop="batch_num" label="产品编码" width="">
|
|
26
|
+ </el-table-column>
|
|
27
|
+ <el-table-column prop="serialno" label="产品序列号" width="">
|
|
28
|
+ </el-table-column>
|
|
29
|
+ <el-table-column prop="emq_password" label="产品MQTT密码" width="">
|
|
30
|
+ </el-table-column>
|
|
31
|
+ <el-table-column prop="production_date" label="生产日期" width="">
|
|
32
|
+ <template slot-scope="scope">
|
|
33
|
+ {{ (scope.row.production_date).split('T')[0] }}
|
|
34
|
+ </template>
|
|
35
|
+ </el-table-column>
|
|
36
|
+ <el-table-column prop="expire_date" label="使用期限" width="">
|
|
37
|
+ <template slot-scope="scope">
|
|
38
|
+ {{ (scope.row.production_date).split('T')[0] }}
|
|
39
|
+ </template>
|
|
40
|
+ </el-table-column>
|
|
41
|
+ <el-table-column prop="register_num" label="产品注册证编码" width="">
|
|
42
|
+ </el-table-column>
|
|
43
|
+ <el-table-column prop="vendor_name" label="产品注册人" width="">
|
|
44
|
+ </el-table-column>
|
|
45
|
+ <el-table-column prop="address" label="注册人地址" width="">
|
|
46
|
+ </el-table-column>
|
|
47
|
+ <el-table-column prop="contact" label="注册人联系方式" width="">
|
|
48
|
+ </el-table-column>
|
|
49
|
+ <el-table-column prop="production_license" label="注册生产许可证编号" width="">
|
|
50
|
+ </el-table-column>
|
|
51
|
+ <el-table-column prop="production_corporate" label="产品生产企业" width="">
|
|
52
|
+ </el-table-column>
|
|
53
|
+ <el-table-column prop="production_address" label="产品企业地址" width="">
|
|
54
|
+ </el-table-column>
|
|
55
|
+ <el-table-column prop="contact" label="生产企业联系方式" width="">
|
|
56
|
+ </el-table-column>
|
|
57
|
+ <el-table-column prop="status" label="激活状态" width="">
|
|
58
|
+ <template slot-scope="scope">
|
|
59
|
+ {{ getstatus(scope.row.status) }}
|
|
60
|
+ </template>
|
|
61
|
+ </el-table-column>
|
|
62
|
+ </el-table>
|
|
63
|
+ <div style="text-align: right;margin-top: 10px;">
|
|
64
|
+ <el-pagination @size-change="handleSizeChange" @current-change="handleCurrentChange" :current-page="page"
|
|
65
|
+ :page-sizes="[50, 100, 200, 300, 400]" :page-size="limet" layout="total, sizes, prev, pager, next, jumper"
|
|
66
|
+ :total="total">
|
|
67
|
+ </el-pagination>
|
|
68
|
+ </div>
|
|
69
|
+ </div>
|
137
|
70
|
</div>
|
|
71
|
+
|
|
72
|
+ </div>
|
138
|
73
|
</template>
|
139
|
74
|
|
140
|
75
|
<script>
|
141
|
|
-import {devicelist,devicetypes} from '../../api/index'
|
|
76
|
+import { devicelist, devicetypes } from '../../api/index'
|
142
|
77
|
export default {
|
143
|
|
- data(){
|
144
|
|
- return {
|
145
|
|
- list:[],
|
146
|
|
- list_detail:[],
|
147
|
|
- total:0,
|
148
|
|
- page:1,//当前页数
|
149
|
|
- limet:50,//一页调数
|
|
78
|
+ data() {
|
|
79
|
+ return {
|
|
80
|
+ list: [],
|
|
81
|
+ list_detail: [],
|
|
82
|
+ total: 0,
|
|
83
|
+ page: 1,//当前页数
|
|
84
|
+ limet: 50,//一页调数
|
|
85
|
+ }
|
|
86
|
+ },
|
|
87
|
+ created() {
|
|
88
|
+ this.getdevicetypes()
|
|
89
|
+ // this.getnum()
|
|
90
|
+ },
|
|
91
|
+ methods: {
|
|
92
|
+ getdevicetypes() {
|
|
93
|
+ devicetypes().then(response => {
|
|
94
|
+ console.log('1111111res', response.data);
|
|
95
|
+ this.list = response.data
|
|
96
|
+ if (this.list[0].value == 1) {
|
|
97
|
+ this.list[0].name = '尿检仪'
|
150
|
98
|
}
|
|
99
|
+ })
|
151
|
100
|
},
|
152
|
|
- created(){
|
153
|
|
- this.getdevicetypes()
|
154
|
|
- // this.getnum()
|
155
|
|
- },
|
156
|
|
- methods:{
|
157
|
|
- getdevicetypes(){
|
158
|
|
- devicetypes().then(response =>{
|
159
|
|
- console.log('1111111res',response.data);
|
160
|
|
- this.list=response.data
|
161
|
|
- if(this.list[0].value==1){
|
162
|
|
- this.list[0].name = '尿检仪'
|
163
|
|
- }
|
164
|
|
- })
|
165
|
|
- },
|
166
|
|
- getdevicelist(val){
|
167
|
|
- const params ={
|
168
|
|
- pageNum:this.page,
|
169
|
|
- pageSize:this.limet,
|
170
|
|
- deviceType:val,
|
171
|
|
- }
|
172
|
|
- devicelist(params).then(response =>{
|
173
|
|
- console.log('rsponse.data',response.data);
|
174
|
|
- if(response.state == 1){
|
175
|
|
- this.list_detail = response.data.list
|
176
|
|
- this.total = response.data.list.length
|
177
|
|
- // this.list = response.data.list
|
178
|
|
- // this.$refs.record_table.setCurrentRow(this.list[0])
|
179
|
|
- // this.getdevicedetail(this.list[0].id)
|
180
|
|
- console.log('list',response.data.list, this.list);
|
181
|
|
- }
|
182
|
|
- })
|
183
|
|
- },
|
184
|
|
- getcurrentchange(val){
|
185
|
|
- console.log(val,'val')
|
186
|
|
- this.getdevicelist(val.type)
|
187
|
|
- },
|
188
|
|
-
|
189
|
|
- // 每页条数
|
190
|
|
- handleSizeChange(val){
|
191
|
|
- this.limet = val
|
192
|
|
- },
|
193
|
|
- // 当前页
|
194
|
|
- handleCurrentChange(val){
|
195
|
|
- this.page = val
|
196
|
|
- },
|
197
|
|
- getstatus(val){
|
198
|
|
- switch(val){
|
199
|
|
- case 0: return '未分配'
|
200
|
|
- break;
|
201
|
|
- case 1: return '已分配'
|
202
|
|
- break;
|
203
|
|
- case 2: return '包装中'
|
204
|
|
- break;
|
205
|
|
- case 6: return '废弃'
|
206
|
|
- break;
|
207
|
|
- case 99: return '已出厂'
|
208
|
|
- break;
|
209
|
|
- case 100: return '销售中'
|
210
|
|
- break;
|
211
|
|
- case 101: return '已售出'
|
212
|
|
- break;
|
213
|
|
- default: return ''
|
|
101
|
+ getdevicelist(val) {
|
|
102
|
+ const params = {
|
|
103
|
+ pageNum: this.page,
|
|
104
|
+ pageSize: this.limet,
|
|
105
|
+ deviceType: val,
|
|
106
|
+ }
|
|
107
|
+ devicelist(params).then(response => {
|
|
108
|
+ console.log('rsponse.data', response.data);
|
|
109
|
+ if (response.state == 1) {
|
|
110
|
+ this.list_detail = response.data.list
|
|
111
|
+ this.total = response.data.list.length
|
|
112
|
+ // this.list = response.data.list
|
|
113
|
+ // this.$refs.record_table.setCurrentRow(this.list[0])
|
|
114
|
+ // this.getdevicedetail(this.list[0].id)
|
|
115
|
+ console.log('list', response.data.list, this.list);
|
214
|
116
|
}
|
215
|
|
- },
|
216
|
|
-
|
217
|
|
- }
|
|
117
|
+ })
|
|
118
|
+ },
|
|
119
|
+ getcurrentchange(val) {
|
|
120
|
+ console.log(val, 'val')
|
|
121
|
+ this.getdevicelist(val.type)
|
|
122
|
+ },
|
|
123
|
+
|
|
124
|
+ // 每页条数
|
|
125
|
+ handleSizeChange(val) {
|
|
126
|
+ this.limet = val
|
|
127
|
+ },
|
|
128
|
+ // 当前页
|
|
129
|
+ handleCurrentChange(val) {
|
|
130
|
+ this.page = val
|
|
131
|
+ },
|
|
132
|
+ getstatus(val) {
|
|
133
|
+ switch (val) {
|
|
134
|
+ case 0: return '未分配'
|
|
135
|
+ break;
|
|
136
|
+ case 1: return '已分配'
|
|
137
|
+ break;
|
|
138
|
+ case 2: return '包装中'
|
|
139
|
+ break;
|
|
140
|
+ case 6: return '废弃'
|
|
141
|
+ break;
|
|
142
|
+ case 99: return '已出厂'
|
|
143
|
+ break;
|
|
144
|
+ case 100: return '销售中'
|
|
145
|
+ break;
|
|
146
|
+ case 101: return '已售出'
|
|
147
|
+ break;
|
|
148
|
+ default: return ''
|
|
149
|
+ }
|
|
150
|
+ },
|
|
151
|
+
|
|
152
|
+ }
|
218
|
153
|
|
219
|
154
|
}
|
220
|
155
|
</script>
|
221
|
156
|
|
222
|
157
|
<style scoped lang="scss">
|
223
|
|
-.Placard{
|
224
|
|
- width: 100%;
|
225
|
|
- min-height: 100%;
|
226
|
|
- padding: 15px;
|
227
|
|
- box-sizing: border-box;
|
|
158
|
+.Placard {
|
|
159
|
+ width: 100%;
|
|
160
|
+ min-height: 100%;
|
|
161
|
+ padding: 15px;
|
|
162
|
+ box-sizing: border-box;
|
228
|
163
|
}
|
229
|
|
-.content{
|
|
164
|
+
|
|
165
|
+.content {
|
230
|
166
|
display: flex;
|
231
|
|
- .content_left{
|
|
167
|
+
|
|
168
|
+ .content_left {
|
232
|
169
|
width: 15%;
|
233
|
170
|
margin-right: 10px;
|
234
|
171
|
}
|
235
|
|
- .content_right{
|
|
172
|
+
|
|
173
|
+ .content_right {
|
236
|
174
|
width: 84%;
|
237
|
175
|
}
|
238
|
176
|
}
|