|
@@ -1,97 +1,97 @@
|
1
|
1
|
<template>
|
2
|
|
-<div class="main-contain">
|
3
|
|
- <div class=" sign-and-weigh-box" style="background: white">
|
4
|
|
-
|
5
|
|
- <manufacturer-or-dealer-dialog :titles="manufacturerDialog.titles" :formValue="manufacturerDialog.formValue"
|
6
|
|
- :visibility="manufacturerDialog.isVisibility"
|
7
|
|
- :type="manufacturerDialog.type" :isCreated="manufacturerDialog.isCreated"
|
8
|
|
- v-on:dialog-comfirm="manufacturerDialogComfirm"
|
9
|
|
- v-on:dialog-cancle="manufacturerDialogCancle"></manufacturer-or-dealer-dialog>
|
10
|
|
-
|
11
|
|
- <el-row>
|
12
|
|
- <el-col>
|
13
|
|
-
|
14
|
|
- <div>
|
15
|
|
- <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px" type="primary" @click="showDialog">新增</el-button>
|
16
|
|
- </div>
|
17
|
|
-
|
18
|
|
- <!--<div class="dataTitle"></div>-->
|
19
|
|
-
|
20
|
|
- <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="manufacturerData" :class="signAndWeighBoxPatients" style="width: 100%" border
|
21
|
|
- v-loading="loading"
|
22
|
|
- >
|
23
|
|
- <el-table-column type="index" label="序号" min-width="20" align="center"></el-table-column>
|
24
|
|
- <el-table-column label="厂家编码" min-width="30" align="center">
|
25
|
|
- <template slot-scope="scope">
|
26
|
|
- {{scope.row.manufacturer_code}}
|
27
|
|
- </template>
|
28
|
|
- </el-table-column>
|
29
|
|
- <el-table-column label="厂家名称" min-width="30" align="center">
|
30
|
|
- <template slot-scope="scope">
|
31
|
|
- {{scope.row.manufacturer_name}}
|
32
|
|
-
|
33
|
|
- </template>
|
34
|
|
- </el-table-column>
|
35
|
|
- <el-table-column label="联系人" min-width="30" align="center">
|
36
|
|
- <template slot-scope="scope">
|
37
|
|
- {{scope.row.contact}}
|
38
|
|
-
|
39
|
|
- </template>
|
40
|
|
- </el-table-column>
|
41
|
|
- <el-table-column label="联系人电话" min-width="30" align="center">
|
42
|
|
- <template slot-scope="scope">
|
43
|
|
- {{scope.row.contact_phone}}
|
44
|
|
-
|
45
|
|
- </template>
|
46
|
|
- </el-table-column>
|
47
|
|
- <el-table-column label="联系地址" min-width="70" align="center">
|
48
|
|
- <template slot-scope="scope">
|
49
|
|
- {{scope.row.contact_address}}
|
50
|
|
- </template>
|
51
|
|
- </el-table-column>
|
52
|
|
- <el-table-column label="操作" align="center">
|
53
|
|
- <template slot-scope="scope">
|
54
|
|
- <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
55
|
|
- <el-button
|
56
|
|
- size="small"
|
57
|
|
- type="primary"
|
58
|
|
- icon="el-icon-edit-outline"
|
59
|
|
- @click="handleEdit(scope.$index, scope.row)">
|
60
|
|
- </el-button>
|
61
|
|
- </el-tooltip>
|
62
|
|
- <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
63
|
|
- <el-button
|
64
|
|
- size="small"
|
65
|
|
- type="danger"
|
66
|
|
- icon="el-icon-delete"
|
67
|
|
- @click="handleDelete(scope.$index, scope.row)">
|
68
|
|
- </el-button>
|
69
|
|
- </el-tooltip>
|
70
|
|
- <!--<el-button-->
|
|
2
|
+ <div class="main-contain">
|
|
3
|
+ <div class=" sign-and-weigh-box" style="background: white">
|
|
4
|
+
|
|
5
|
+ <manufacturer-or-dealer-dialog ref="dialog" :titles="manufacturerDialog.titles" :formValue="manufacturerDialog.formValue"
|
|
6
|
+ :visibility="manufacturerDialog.isVisibility"
|
|
7
|
+ :type="manufacturerDialog.type" :isCreated="manufacturerDialog.isCreated"
|
|
8
|
+ v-on:dialog-comfirm="manufacturerDialogComfirm"
|
|
9
|
+ v-on:dialog-cancle="manufacturerDialogCancle"></manufacturer-or-dealer-dialog>
|
|
10
|
+
|
|
11
|
+ <el-row :gutter="15">
|
|
12
|
+ <el-col>
|
|
13
|
+
|
|
14
|
+ <div>
|
|
15
|
+ <el-button size="small" icon="el-icon-circle-plus-outline" style="float: right;margin-bottom: 15px"
|
|
16
|
+ type="primary" @click="showDialog">新增
|
|
17
|
+ </el-button>
|
|
18
|
+ </div>
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+ <el-table :header-cell-style="{backgroundColor: 'rgb(245, 247, 250)'}" :data="manufacturerData"
|
|
22
|
+ style="width: 100%" border
|
|
23
|
+ v-loading="loading"
|
|
24
|
+ >
|
|
25
|
+ <el-table-column label="厂家编码" align="center">
|
|
26
|
+ <template slot-scope="scope">
|
|
27
|
+ {{scope.row.manufacturer_code}}
|
|
28
|
+ </template>
|
|
29
|
+ </el-table-column>
|
|
30
|
+ <el-table-column label="厂家名称" align="center">
|
|
31
|
+ <template slot-scope="scope">
|
|
32
|
+ {{scope.row.manufacturer_name}}
|
|
33
|
+
|
|
34
|
+ </template>
|
|
35
|
+ </el-table-column>
|
|
36
|
+ <el-table-column label="联系人" align="center">
|
|
37
|
+ <template slot-scope="scope">
|
|
38
|
+ {{scope.row.contact}}
|
|
39
|
+
|
|
40
|
+ </template>
|
|
41
|
+ </el-table-column>
|
|
42
|
+ <el-table-column label="联系人电话" align="center">
|
|
43
|
+ <template slot-scope="scope">
|
|
44
|
+ {{scope.row.contact_phone}}
|
|
45
|
+
|
|
46
|
+ </template>
|
|
47
|
+ </el-table-column>
|
|
48
|
+ <el-table-column label="联系地址" align="center">
|
|
49
|
+ <template slot-scope="scope">
|
|
50
|
+ {{scope.row.contact_address}}
|
|
51
|
+ </template>
|
|
52
|
+ </el-table-column>
|
|
53
|
+ <el-table-column label="操作" align="center">
|
|
54
|
+ <template slot-scope="scope">
|
|
55
|
+ <el-tooltip class="item" effect="dark" content="编辑" placement="top">
|
|
56
|
+ <el-button
|
|
57
|
+ size="small"
|
|
58
|
+ type="primary"
|
|
59
|
+ icon="el-icon-edit-outline"
|
|
60
|
+ @click="handleEdit(scope.$index, scope.row)">
|
|
61
|
+ </el-button>
|
|
62
|
+ </el-tooltip>
|
|
63
|
+ <el-tooltip class="item" effect="dark" content="删除" placement="top">
|
|
64
|
+ <el-button
|
|
65
|
+ size="small"
|
|
66
|
+ type="danger"
|
|
67
|
+ icon="el-icon-delete"
|
|
68
|
+ @click="handleDelete(scope.$index, scope.row)">
|
|
69
|
+ </el-button>
|
|
70
|
+ </el-tooltip>
|
|
71
|
+ <!--<el-button-->
|
71
|
72
|
<!--size="mini"-->
|
72
|
73
|
<!--type="primary"-->
|
73
|
74
|
<!--@click="showDetails(scope.$index, scope.row)">查看详情-->
|
74
|
|
- <!--</el-button>-->
|
75
|
|
- </template>
|
76
|
|
- </el-table-column>
|
77
|
|
- </el-table>
|
78
|
|
-
|
79
|
|
- <el-pagination
|
80
|
|
- @size-change="handleSizeChange"
|
81
|
|
- @current-change="handleCurrentChange"
|
82
|
|
- :page-sizes="[7]"
|
83
|
|
- :page-size="7"
|
84
|
|
- background
|
85
|
|
- align="right"
|
86
|
|
- style="margin-top:20px;"
|
87
|
|
- layout="total, sizes, prev, pager, next, jumper"
|
88
|
|
- :total="total">
|
89
|
|
- </el-pagination>
|
90
|
|
-
|
91
|
|
- </el-col>
|
92
|
|
- </el-row>
|
|
75
|
+ <!--</el-button>-->
|
|
76
|
+ </template>
|
|
77
|
+ </el-table-column>
|
|
78
|
+ </el-table>
|
|
79
|
+
|
|
80
|
+ <el-pagination
|
|
81
|
+ @size-change="handleSizeChange"
|
|
82
|
+ @current-change="handleCurrentChange"
|
|
83
|
+ :page-sizes="[7]"
|
|
84
|
+ :page-size="7"
|
|
85
|
+ background
|
|
86
|
+ align="right"
|
|
87
|
+ style="margin-top:20px;"
|
|
88
|
+ layout="total, sizes, prev, pager, next, jumper"
|
|
89
|
+ :total="total">
|
|
90
|
+ </el-pagination>
|
|
91
|
+ </el-col>
|
|
92
|
+ </el-row>
|
|
93
|
+ </div>
|
93
|
94
|
</div>
|
94
|
|
-</div>
|
95
|
95
|
|
96
|
96
|
</template>
|
97
|
97
|
|
|
@@ -99,17 +99,17 @@
|
99
|
99
|
import manufacturerOrDealerDialog from '../Dialog/manufacturerOrDealerDialog'
|
100
|
100
|
import {
|
101
|
101
|
createManufacturer,
|
102
|
|
- modifyManufacturer,
|
103
|
|
- getManufacturerList,
|
104
|
102
|
deleteManufacturer,
|
105
|
|
- GetManufacturer
|
106
|
|
- } from "@/api/stock";
|
|
103
|
+ GetManufacturer,
|
|
104
|
+ getManufacturerList,
|
|
105
|
+ modifyManufacturer
|
|
106
|
+ } from '@/api/stock'
|
107
|
107
|
|
108
|
108
|
export default {
|
109
|
109
|
components: {
|
110
|
|
- manufacturerOrDealerDialog,
|
|
110
|
+ manufacturerOrDealerDialog
|
111
|
111
|
},
|
112
|
|
- name: "manufacturer",
|
|
112
|
+ name: 'manufacturer',
|
113
|
113
|
data() {
|
114
|
114
|
return {
|
115
|
115
|
signAndWeighBoxPatients: 'sign-and-weigh-box-patients',
|
|
@@ -120,11 +120,11 @@
|
120
|
120
|
|
121
|
121
|
page: 1,
|
122
|
122
|
limit: 7,
|
123
|
|
- loading:false,
|
|
123
|
+ loading: false,
|
124
|
124
|
|
125
|
125
|
manufacturer_code: '',
|
126
|
126
|
editId: '',
|
127
|
|
- editIndex:'',
|
|
127
|
+ editIndex: '',
|
128
|
128
|
manufacturerDialog: {
|
129
|
129
|
titles: '新增厂家',
|
130
|
130
|
isVisibility: false,
|
|
@@ -138,7 +138,7 @@
|
138
|
138
|
platform_number: '',
|
139
|
139
|
email: '',
|
140
|
140
|
contact_address: '',
|
141
|
|
- remark: '',
|
|
141
|
+ remark: ''
|
142
|
142
|
},
|
143
|
143
|
resetForm: {
|
144
|
144
|
manufacturer_name: '',
|
|
@@ -148,15 +148,14 @@
|
148
|
148
|
platform_number: '',
|
149
|
149
|
email: '',
|
150
|
150
|
contact_address: '',
|
151
|
|
- remark: '',
|
152
|
|
- },
|
|
151
|
+ remark: ''
|
|
152
|
+ }
|
153
|
153
|
}
|
154
|
154
|
|
155
|
|
-
|
156
|
|
- };
|
|
155
|
+ }
|
157
|
156
|
},
|
158
|
157
|
methods: {
|
159
|
|
- handleEdit: function (index, row) {
|
|
158
|
+ handleEdit: function(index, row) {
|
160
|
159
|
this.editId = row.id
|
161
|
160
|
this.editIndex = index
|
162
|
161
|
let params = {
|
|
@@ -164,8 +163,8 @@
|
164
|
163
|
}
|
165
|
164
|
GetManufacturer(params).then(response => {
|
166
|
165
|
if (response.data.state == 0) {
|
167
|
|
- this.$message.error(response.data.msg);
|
168
|
|
- return false;
|
|
166
|
+ this.$message.error(response.data.msg)
|
|
167
|
+ return false
|
169
|
168
|
} else {
|
170
|
169
|
this.manufacturerDialog.formValue.manufacturer_name = response.data.data.manufacturer.manufacturer_name
|
171
|
170
|
this.manufacturerDialog.formValue.contact = response.data.data.manufacturer.contact
|
|
@@ -175,15 +174,14 @@
|
175
|
174
|
this.manufacturerDialog.formValue.contact_address = response.data.data.manufacturer.contact_address
|
176
|
175
|
this.manufacturerDialog.formValue.remark = response.data.data.manufacturer.remark
|
177
|
176
|
this.manufacturerDialog.isCreated = 2
|
178
|
|
- this.manufacturerDialog.isVisibility = true
|
|
177
|
+ this.$refs.dialog.show()
|
179
|
178
|
this.manufacturer_code = response.data.data.manufacturer.manufacturer_code
|
180
|
179
|
|
181
|
180
|
}
|
182
|
|
- });
|
|
181
|
+ })
|
183
|
182
|
|
184
|
183
|
},
|
185
|
|
- handleDelete: function (index, row) {
|
186
|
|
-
|
|
184
|
+ handleDelete: function(index, row) {
|
187
|
185
|
|
188
|
186
|
this.$confirm('确认删除这条厂家信息?', '删除厂家信息', {
|
189
|
187
|
confirmButtonText: '确定',
|
|
@@ -196,31 +194,30 @@
|
196
|
194
|
|
197
|
195
|
deleteManufacturer(params).then(response => {
|
198
|
196
|
if (response.data.state == 0) {
|
199
|
|
- this.$message.error(response.data.msg);
|
200
|
|
- return false;
|
|
197
|
+ this.$message.error(response.data.msg)
|
|
198
|
+ return false
|
201
|
199
|
} else {
|
202
|
|
- this.manufacturerData.splice(index, 1);
|
|
200
|
+ this.manufacturerData.splice(index, 1)
|
203
|
201
|
this.$notify({
|
204
|
|
- title: "成功",
|
205
|
|
- message: "厂家已经删除",
|
206
|
|
- type: "success",
|
|
202
|
+ title: '成功',
|
|
203
|
+ message: '厂家已经删除',
|
|
204
|
+ type: 'success',
|
207
|
205
|
duration: 2000
|
208
|
|
- });
|
|
206
|
+ })
|
209
|
207
|
}
|
210
|
|
- });
|
|
208
|
+ })
|
211
|
209
|
}).catch(() => {
|
212
|
|
- });
|
213
|
|
-
|
|
210
|
+ })
|
214
|
211
|
|
215
|
212
|
},
|
216
|
|
- showDetails: function (index, row) {
|
|
213
|
+ showDetails: function(index, row) {
|
217
|
214
|
let params = {
|
218
|
215
|
id: row.id
|
219
|
216
|
}
|
220
|
217
|
GetManufacturer(params).then(response => {
|
221
|
218
|
if (response.data.state == 0) {
|
222
|
|
- this.$message.error(response.data.msg);
|
223
|
|
- return false;
|
|
219
|
+ this.$message.error(response.data.msg)
|
|
220
|
+ return false
|
224
|
221
|
} else {
|
225
|
222
|
this.manufacturerDialog.formValue.manufacturer_name = response.data.data.manufacturer.manufacturer_name
|
226
|
223
|
this.manufacturerDialog.formValue.contact = response.data.data.manufacturer.contact
|
|
@@ -232,11 +229,11 @@
|
232
|
229
|
this.manufacturerDialog.isCreated = 3
|
233
|
230
|
this.manufacturerDialog.isVisibility = true
|
234
|
231
|
}
|
235
|
|
- });
|
|
232
|
+ })
|
236
|
233
|
},
|
237
|
|
- manufacturerDialogComfirm: function (val) {
|
238
|
|
- this.manufacturerDialog.isVisibility = false
|
239
|
|
-
|
|
234
|
+ manufacturerDialogComfirm: function(val) {
|
|
235
|
+ // this.manufacturerDialog.isVisibility = false
|
|
236
|
+ this.$refs.dialog.hide()
|
240
|
237
|
if (val.isCreated == 2) { //修改
|
241
|
238
|
let params = {
|
242
|
239
|
'manufacturer_name': val.manufacturer_name,
|
|
@@ -251,8 +248,8 @@
|
251
|
248
|
}
|
252
|
249
|
modifyManufacturer(params).then(response => {
|
253
|
250
|
if (response.data.state == 0) {
|
254
|
|
- this.$message.error(response.data.msg);
|
255
|
|
- return false;
|
|
251
|
+ this.$message.error(response.data.msg)
|
|
252
|
+ return false
|
256
|
253
|
} else {
|
257
|
254
|
this.manufacturerData[this.editIndex].manufacturer_name = response.data.data.manufacturer.manufacturer_name
|
258
|
255
|
this.manufacturerData[this.editIndex].contact = response.data.data.manufacturer.contact
|
|
@@ -263,61 +260,61 @@
|
263
|
260
|
this.manufacturerData[this.editIndex].remark = response.data.data.manufacturer.remark
|
264
|
261
|
this.manufacturerData[this.editIndex].manufacturer_code = response.data.data.manufacturer.manufacturer_code
|
265
|
262
|
this.$notify({
|
266
|
|
- title: "成功",
|
267
|
|
- message: "修改成功",
|
268
|
|
- type: "success",
|
|
263
|
+ title: '成功',
|
|
264
|
+ message: '修改成功',
|
|
265
|
+ type: 'success',
|
269
|
266
|
duration: 2000
|
270
|
|
- });
|
|
267
|
+ })
|
271
|
268
|
|
272
|
269
|
}
|
273
|
|
- });
|
|
270
|
+ })
|
274
|
271
|
|
275
|
272
|
} else if (val.isCreated == 1) { //新增
|
276
|
273
|
createManufacturer(val).then(response => {
|
277
|
274
|
if (response.data.state == 0) {
|
278
|
|
- this.$message.error(response.data.msg);
|
279
|
|
- return false;
|
|
275
|
+ this.$message.error(response.data.msg)
|
|
276
|
+ return false
|
280
|
277
|
} else {
|
281
|
278
|
this.manufacturerData.unshift(response.data.data.manufacturer)
|
282
|
279
|
this.$notify({
|
283
|
|
- title: "成功",
|
284
|
|
- message: "新增成功",
|
285
|
|
- type: "success",
|
|
280
|
+ title: '成功',
|
|
281
|
+ message: '新增成功',
|
|
282
|
+ type: 'success',
|
286
|
283
|
duration: 2000
|
287
|
|
- });
|
|
284
|
+ })
|
288
|
285
|
|
289
|
286
|
}
|
290
|
|
- });
|
|
287
|
+ })
|
291
|
288
|
|
292
|
289
|
}
|
293
|
290
|
|
294
|
|
-
|
295
|
291
|
},
|
296
|
|
- manufacturerDialogCancle: function () {
|
297
|
|
- this.manufacturerDialog.isVisibility = false
|
|
292
|
+ manufacturerDialogCancle: function() {
|
|
293
|
+ this.$refs.dialog.hide()
|
|
294
|
+
|
298
|
295
|
},
|
299
|
|
- showDialog: function () {
|
|
296
|
+ showDialog: function() {
|
300
|
297
|
this.manufacturerDialog.formValue = Object.assign({}, this.manufacturerDialog.resetForm)
|
301
|
|
- this.manufacturerDialog.isVisibility = true
|
|
298
|
+ this.$refs.dialog.show()
|
302
|
299
|
this.manufacturerDialog.isCreated = 1
|
303
|
300
|
|
304
|
301
|
}, handleSizeChange(val) {
|
305
|
|
- this.limit = val;
|
306
|
|
- this.getList();
|
|
302
|
+ this.limit = val
|
|
303
|
+ this.getList()
|
307
|
304
|
}, handleCurrentChange(val) {
|
308
|
|
- this.page = val;
|
309
|
|
- this.getList();
|
310
|
|
- },getList(){
|
|
305
|
+ this.page = val
|
|
306
|
+ this.getList()
|
|
307
|
+ }, getList() {
|
311
|
308
|
let params = {
|
312
|
|
- 'page':this.page,
|
313
|
|
- 'limit':this.limit
|
|
309
|
+ 'page': this.page,
|
|
310
|
+ 'limit': this.limit
|
314
|
311
|
}
|
315
|
312
|
this.loading = true
|
316
|
313
|
getManufacturerList(params).then(response => {
|
317
|
314
|
if (response.data.state == 0) {
|
318
|
315
|
this.loading = false
|
319
|
|
- this.$message.error(response.data.msg);
|
320
|
|
- return false;
|
|
316
|
+ this.$message.error(response.data.msg)
|
|
317
|
+ return false
|
321
|
318
|
} else {
|
322
|
319
|
this.loading = false
|
323
|
320
|
this.total = response.data.data.total
|
|
@@ -326,7 +323,7 @@
|
326
|
323
|
this.manufacturerData.push(response.data.data.manufacturer[i])
|
327
|
324
|
}
|
328
|
325
|
}
|
329
|
|
- });
|
|
326
|
+ })
|
330
|
327
|
|
331
|
328
|
}
|
332
|
329
|
},
|
|
@@ -334,62 +331,8 @@
|
334
|
331
|
this.getList()
|
335
|
332
|
|
336
|
333
|
}
|
337
|
|
- };
|
338
|
|
-</script>
|
339
|
|
-
|
340
|
|
-<style rel="stylesheet/css" lang="scss" scoped>
|
341
|
|
- .information {
|
342
|
|
- border: 1px #dcdfe6 solid;
|
343
|
|
- padding: 30px 20px 30px 20px;
|
344
|
|
-
|
345
|
|
- .border {
|
346
|
|
- border-bottom: 1px #dcdfe6 solid;
|
347
|
|
- margin: 0px 0 20px 0;
|
348
|
|
- }
|
349
|
|
- }
|
350
|
|
-
|
351
|
|
- .title {
|
352
|
|
- height: 44px;
|
353
|
|
- line-height: 44px;
|
354
|
|
- padding: 0 0 0 10px;
|
355
|
|
- margin: 0 0 10px 0;
|
356
|
|
- // border-radius: 4px 4px 0 0;
|
357
|
|
- }
|
358
|
|
-
|
359
|
|
- .edit_separater {
|
360
|
|
- border-top: 1px solid rgb(233, 233, 233);
|
361
|
|
- margin-top: 15px;
|
362
|
|
- margin-bottom: 15px;
|
363
|
334
|
}
|
|
335
|
+</script>
|
364
|
336
|
|
365
|
|
-</style>
|
366
|
|
-
|
367
|
|
-<style>
|
368
|
|
- .sign-and-weigh-box .sign-and-weigh-box-patients .cell {
|
369
|
|
- font-size: 12px;
|
370
|
|
- }
|
371
|
337
|
|
372
|
|
- .sign-and-weigh-box .sign-and-weigh-box-patients .current-row > td {
|
373
|
|
- background: #6fb5fa;
|
374
|
|
- }
|
375
|
338
|
|
376
|
|
- .dataTitle {
|
377
|
|
- color: #409eff;
|
378
|
|
- font-size: 16px;
|
379
|
|
- border-bottom: 1px #409eff solid;
|
380
|
|
- height: 36px;
|
381
|
|
- line-height: 30px;
|
382
|
|
- margin: 0 0 15px 0;
|
383
|
|
- position: relative;
|
384
|
|
- padding: 0 0 6px 15px;
|
385
|
|
- &::before {
|
386
|
|
- position: absolute;
|
387
|
|
- left: 0;
|
388
|
|
- bottom: 10px;
|
389
|
|
- content: "";
|
390
|
|
- width: 2px;
|
391
|
|
- height: 20px;
|
392
|
|
- background: #409eff;
|
393
|
|
- }
|
394
|
|
- }
|
395
|
|
-</style>
|