dyztsd.vue
3.91 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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
<!--
* @Description: 单元状态设定
* @Autor: renchao
* @LastEditTime: 2023-07-19 14:10:44
-->
<template>
<div class='该组件名称'>
<el-form :model="ruleForm">
<el-row>
<el-col :span="5">
<el-form-item label="登记业务编码">
{{ ruleForm.djywbm }}
</el-form-item>
</el-col>
<el-col :span="12">
<el-form-item label="登记业务名称">
{{ ruleForm.djywmc }}
</el-form-item>
</el-col>
</el-row>
</el-form>
<div v-if="ruleForm.sfsxql != '0'">
<div class="dyztsd-title">
<b>请勾选需要查询的权利信息</b>
<div>
<el-button type="text" @click="handleSelectall">选择全部 </el-button>
<el-button type="text" @click="handleInvert">清除全部</el-button>
</div>
</div>
<el-divider></el-divider>
<ul class="qlxx-list">
<li v-for="(item, index) in dataList.sxql" :key="index">
<el-checkbox v-model="item.checked">{{ item.sxzdmc }}</el-checkbox>
</li>
</ul>
</div>
<b>限制办理状态</b>
<ul class="screen-list">
<li v-for="(item, index) in dataList.sxzt" :key="index">
<div class="screen-list-left">
<el-switch v-model="item.checked" @change="handleSelect(item)">
</el-switch>
{{ item.sxzdmc }}
</div>
<el-radio-group v-model="item.selected" :disabled="!item.checked">
<el-radio :label="obj.sxzdz" v-for="(obj, index) in item.children" :key="index">{{ obj.sxzdmc }}</el-radio>
</el-radio-group>
</li>
</ul>
</div>
</template>
<script>
export default {
props: {
ruleForm: {
type: Object, default: {}
},
subData: {
type: Object, default: () => {
return {}
}
}
},
data () {
return {
dataList: {
sxql: [],
sxzt: []
}
}
},
watch: {
dataList: {
handler (newValue, oldValue) {
this.$emit('updateValue', newValue)
},
deep: true
},
subData: {
handler (newValue, oldValue) {
if (!_.isEqual(newValue.sxql, this.dataList.sxql)) {
this.dataList.sxql = _.cloneDeep(newValue.sxql)
}
if (!_.isEqual(newValue.sxzt, this.dataList.sxzt)) {
this.dataList.sxzt = _.cloneDeep(newValue.sxzt)
}
},
deep: true
},
},
methods: {
/**
* @description: handleSelect
* @param {*} item
* @author: renchao
*/
handleSelect (item) {
if (item.checked) {
item.selected = '0'
}
},
/**
* @description: handleSelectall
* @author: renchao
*/
handleSelectall () {
this.dataList.sxql.forEach(item => {
item.checked = true
})
},
/**
* @description: handleInvert
* @author: renchao
*/
handleInvert () {
this.dataList.sxql.forEach(item => {
item.checked = false
})
}
}
}
</script>
<style scoped lang='scss'>
@import "~@/styles/mixin.scss";
.dyztsd-title {
@include flex;
align-items: center;
justify-content: space-between;
padding-left: 20px;
}
.qlxx-list {
@include flex;
flex-wrap: wrap;
padding-left: 20px;
li {
width: 33%;
margin-bottom: 15px;
}
}
.screen-list {
@include flex;
align-items: center;
flex-wrap: wrap;
border: 1px solid $borderColor;
border-bottom: none;
li {
@include flex;
align-items: center;
width: 50%;
line-height: 50px;
border-bottom: 1px solid $borderColor;
padding-left: 20px;
}
&-left {
margin-right: 20px;
width: 160px;
white-space: nowrap;
}
li:nth-child(odd) {
border-right: 1px solid $borderColor;
}
}
</style>