selectMutiProDialog.vue
1.84 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
<!-- 选择商品弹窗 -->
<template>
<glsx-dialog
class="muti-pro"
title="选择商品"
:isVisible.sync="isMutiSelectVisible"
width="70%"
@confirmDialog="handleMutiSelectConfirm"
@closeDialog="handleMutiSelectClose"
>
<glsx-table
ref="mutiProRef"
:tableParams="tableParams"
:tableData="tableData"
:pageConf="pageConf"
:beforeSearchFn="beforeSearchFn"
></glsx-table>
</glsx-dialog>
</template>
<script>
import glsxDialog from '@/components/glsx-dialog'
export default {
name: 'selectMutiProDialog',
data() {
return {
// 表格组件
getListApi: '',
tableData: [{
id: 1,
name: '商品名称1'
}, {
id: 2,
name: '商品名称2'
}],
pageConf: { pageSize: 'pageSize', pageNum: 'pageNum', totalCount: 'total' },
// 表格参数
tableParams: {
listName: 'list',
// 行数据的key
mutiSelectUniqueKey: 'id',
// 多选ref的名称
mutiSelectName: 'list',
tableOption: true,
tableColumns: [{
label: '商品名称',
prop: 'name'
}, {
label: '缩略图',
prop: 'title'
}, {
label: '价格(元)',
prop: 'status'
}, {
label: '来源门店',
prop: ''
}]
}
}
},
props: {
isMutiSelectVisible: {
type: Boolean,
default: false
}
},
components: {
glsxDialog
},
mounted() { },
methods: {
handleMutiSelectConfirm() {
var selectedData = this.$refs.mutiProRef.mutiSelectArr[this.tableParams.mutiSelectName]
console.log(selectedData)
this.$emit('handleMutiSelectConfirm', selectedData)
},
handleMutiSelectClose() {
this.$emit('handleMutiSelectClose')
}
}
}
</script>
<style>
</style>