TmplDrawer.vue
2.17 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
<template>
<el-drawer class="tmpl-drawer" size="70%" :visible.sync="tmplDrawerVisible" :wrapperClosable="wrapperClosable" :before-close="handleClose">
<div slot="title">对账字段配置</div>
<div class="container">
<AccountTmpl ref="accountTmpl" :type="type" :tmplSelectList="tmplSelectList"></AccountTmpl>
</div>
<div class="tmpl-footer">
<el-button @click="handleClose">取消</el-button>
<el-button @click="handleConfirm" type="primary" :loading="$store.state.d2admin.loading.value">确定</el-button>
</div>
</el-drawer>
</template>
<script>
import AccountTmpl from "../accountTmplManage/components/AccountTmpl"
import { deepClone } from '@/common/util'
import { tmplCheckField } from '@api/accountManage'
export default {
name: 'TmplDrawer',
components: {
AccountTmpl
},
props: {
tmplDrawerVisible: {
type: Boolean,
default: false
},
type: {
type: String,
default: '1'
},
tmplSelectList: {
type: Array,
default: () => []
}
},
data() {
return {
wrapperClosable: false
}
},
methods: {
handleClose() {
this.$emit('handleClose')
},
handleConfirm() {
const params = {
type: this.type,
fieldIds: deepClone(this.$refs.accountTmpl.getSelected())
}
tmplCheckField(params).then(res => {
this.$emit('handleConfirm', {
fieldIds: deepClone(this.$refs.accountTmpl.getSelected())
})
})
},
},
mounted() { },
};
</script>
<style lang="scss" scoped>
::v-deep.tmpl-drawer {
.el-drawer__body {
overflow: scroll;
height: calc(100% - 400px);
}
.el-drawer__header {
box-sizing: border-box;
height: 60px;
line-height: 60px;
border-bottom: 1px solid #e5e5e5;
padding: 0 0 0 20px;
color: #333333;
font-size: 20px;
font-weight: bold;
margin-bottom: 0;
}
.container {
box-sizing: border-box;
overflow: scroll;
padding: 20px 20px 60px;
}
}
.tmpl-footer {
position: absolute;
width: 100%;
height: 60px;
line-height: 60px;
bottom: 0;
right: 0;
background: #ffffff;
text-align: right;
margin-right: 30px;
z-index: 9;
}
</style>