4406e25a by 任超

style:登记情形设

1 parent fc4eaed2
...@@ -103,7 +103,7 @@ export default { ...@@ -103,7 +103,7 @@ export default {
103 label: '是否禁用', 103 label: '是否禁用',
104 render: (h, scope) => { 104 render: (h, scope) => {
105 return ( 105 return (
106 <el-radio-group v-model={scope.row.isenable}> 106 <el-radio-group disabled={this.details.isenable == 2} v-model={scope.row.isenable}>
107 <el-radio label="1">启用</el-radio> 107 <el-radio label="1">启用</el-radio>
108 <el-radio label="0">禁用</el-radio> 108 <el-radio label="0">禁用</el-radio>
109 </el-radio-group> 109 </el-radio-group>
...@@ -181,7 +181,7 @@ export default { ...@@ -181,7 +181,7 @@ export default {
181 handler: function (newValue) { 181 handler: function (newValue) {
182 this.tableData = judgeSort(_.cloneDeep(newValue.dataList)) 182 this.tableData = judgeSort(_.cloneDeep(newValue.dataList))
183 if (newValue.isenable == 2) { 183 if (newValue.isenable == 2) {
184 this.column = this.columns.slice(0, 3) 184 this.column = this.columns.slice(0, 6)
185 } else { 185 } else {
186 this.column = this.columns 186 this.column = this.columns
187 } 187 }
......
...@@ -2,8 +2,8 @@ ...@@ -2,8 +2,8 @@
2 功能:登记情形设定 2 功能:登记情形设定
3 --> 3 -->
4 <template> 4 <template>
5 <div class='该组件名称'> 5 <div>
6 <el-form :model="ruleForm" :rules="rules"> 6 <el-form :model="ruleForm">
7 <el-row> 7 <el-row>
8 <el-col :span="5"> 8 <el-col :span="5">
9 <el-form-item label="登记业务编码"> 9 <el-form-item label="登记业务编码">
...@@ -23,34 +23,25 @@ ...@@ -23,34 +23,25 @@
23 </div> 23 </div>
24 </template> 24 </template>
25 <script> 25 <script>
26 import { upward, down } from '@/utils/operation' 26 import { mapGetters } from 'vuex'
27 import { judgeSort, realMove, findParents } from '@/utils/operation'
27 export default { 28 export default {
28 props: { 29 props: {
29 ruleForm: { 30 ruleForm: {
30 type: Object, default: {} 31 type: Object, default: {}
32 },
33 subData: {
34 type: Object, default: () => {
35 return {}
31 } 36 }
37 }
38 },
39 computed: {
40 ...mapGetters(['dictData'])
32 }, 41 },
33 data () { 42 data () {
34 return { 43 return {
35 key: 0, 44 key: 0,
36 cllxOptions: [
37 {
38 name: '买卖',
39 value: '1'
40 },
41 {
42 name: '买卖继承',
43 value: '2'
44 }
45 ],
46 rules: {
47 djywbm: [
48 { required: true, message: '登记业务编码', trigger: 'blur' },
49 ],
50 djywmc: [
51 { required: true, message: '登记业务名称', trigger: 'blur' },
52 ],
53 },
54 column: [ 45 column: [
55 { 46 {
56 width: '60', 47 width: '60',
...@@ -69,23 +60,14 @@ export default { ...@@ -69,23 +60,14 @@ export default {
69 type: 'index' 60 type: 'index'
70 }, 61 },
71 { 62 {
72 prop: 'sfbx', 63 label: '是否必填',
73 label: '是否必须', 64 width: '100',
74 width: '80',
75 render: (h, scope) => { 65 render: (h, scope) => {
76 return ( 66 return (
77 <el-input value={scope.row[scope.column.property]} 67 <el-radio-group v-model={scope.row.isrequired} onChange={(val) => { scope.row[scope.column.property] = val }}>
78 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 68 <el-radio label={'1'}></el-radio>
79 ) 69 <el-radio label={'0'}></el-radio>
80 } 70 </el-radio-group>
81 },
82 {
83 prop: 'djqx',
84 label: '登记情形',
85 render: (h, scope) => {
86 return (
87 <el-input placeholder="登记情形" value={scope.row[scope.column.property]}
88 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input>
89 ) 71 )
90 } 72 }
91 }, 73 },
...@@ -115,11 +97,42 @@ export default { ...@@ -115,11 +97,42 @@ export default {
115 render: (h, scope) => { 97 render: (h, scope) => {
116 return ( 98 return (
117 <el-select value={scope.row[scope.column.property]} 99 <el-select value={scope.row[scope.column.property]}
118 onChange={(val) => { scope.row[scope.column.property] = val }}> 100 onChange={(val) => { scope.row[scope.column.property] = val }} clearable>
119 { 101 {
120 this.cllxOptions.map(option => { 102 this.dictData['A40'].map(option => {
121 return ( 103 return (
122 <el-option label={option.name} value={option.value}></el-option> 104 <el-option label={option.dname} value={option.dcode}></el-option>
105 )
106 })
107 }
108 </el-select>
109 )
110 }
111 },
112 {
113 label: '是否公共材料',
114 width: '100',
115 render: (h, scope) => {
116 return (
117 <el-radio-group v-model={scope.row.sfggcl} onChange={(val) => { scope.row[scope.column.property] = val; this.handleSelectGgcl(scope.row) }}>
118 <el-radio label={'1'}></el-radio>
119 <el-radio label={'0'}></el-radio>
120 </el-radio-group>
121 )
122 }
123 },
124 {
125 prop: 'djqxbm',
126 label: '登记情形',
127 width: '180',
128 render: (h, scope) => {
129 return (
130 <el-select disabled={scope.row.sfggcl == '1'} value={scope.row[scope.column.property]}
131 onChange={(val) => { scope.row[scope.column.property] = val }} clearable>
132 {
133 this.subData['djqx'].map(option => {
134 return (
135 <el-option label={option.nodename} value={option.nodecode}></el-option>
123 ) 136 )
124 }) 137 })
125 } 138 }
...@@ -133,22 +146,14 @@ export default { ...@@ -133,22 +146,14 @@ export default {
133 render: (h, scope) => { 146 render: (h, scope) => {
134 return ( 147 return (
135 <div> 148 <div>
136 <i class="el-icon-top pointer move" disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}></i> 149 <el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button>
137 <i class="el-icon-bottom pointer move" disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}></i> 150 <el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button >
138 </div> 151 </div>
139 ) 152 )
140 } 153 }
141 } 154 }
142 ], 155 ],
143 tableData: [ 156 tableData: []
144 {
145 sfbx: '',
146 djqx: '',
147 clbm: '',
148 clmc: '',
149 cllx: ''
150 }
151 ]
152 } 157 }
153 }, 158 },
154 watch: { 159 watch: {
...@@ -157,33 +162,49 @@ export default { ...@@ -157,33 +162,49 @@ export default {
157 this.$emit('updateValue', newValue) 162 this.$emit('updateValue', newValue)
158 }, 163 },
159 deep: true 164 deep: true
160 } 165 },
166 subData: {
167 handler: function (newValue) {
168 this.tableData = judgeSort(newValue.clxx)
169 },
170 deep: true
171 },
161 }, 172 },
162 methods: { 173 methods: {
163 handleAdd () { 174 handleAdd () {
164 this.tableData.push( 175 this.tableData.push(
165 { 176 {
166 sfbx: '', 177 isrequired: '1',
167 djqx: '', 178 djqxbm: '',
168 clbm: '', 179 clbm: '',
169 clmc: '', 180 clmc: '',
170 cllx: '' 181 cllx: '',
182 sfggcl: '1'
171 } 183 }
172 ) 184 )
173 this.key++ 185 this.key++
174 }, 186 },
187 handleSelectGgcl (item) {
188 if (item.sfggcl == '1') {
189 item.djqxbm = ''
190 }
191 },
175 handleMinus (index, row) { 192 handleMinus (index, row) {
176 this.tableData.splice(index, 1) 193 this.tableData.splice(index, 1)
177 }, 194 },
178 // 上移下移 195 // 上移下移
179 moveUpward (index, row) { 196 moveUpward (index, row) {
180 upward(index, this.tableData) 197 realMove(row.bsmClxx, 'UP', this.tableData)
181 this.key++ 198 this.key++
199 let id = findParents(this.tableData, row.bsmClxx)
200 this.keyList = id
182 }, 201 },
183 moveDown (index, row) { 202 moveDown (index, row) {
184 down(index, this.tableData) 203 realMove(row.bsmClxx, 'DOWN', this.tableData)
185 this.key++ 204 this.key++
186 }, 205 let id = findParents(this.tableData, row.bsmClxx)
206 this.keyList = id
207 }
187 } 208 }
188 } 209 }
189 </script> 210 </script>
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
2 功能:登记情形设定 2 功能:登记情形设定
3 --> 3 -->
4 <template> 4 <template>
5 <div class='该组件名称'> 5 <div class='djqxsd'>
6 <el-form :model="ruleForm"> 6 <el-form :model="ruleForm">
7 <el-row> 7 <el-row>
8 <el-col :span="5"> 8 <el-col :span="5">
...@@ -23,7 +23,7 @@ ...@@ -23,7 +23,7 @@
23 </div> 23 </div>
24 </template> 24 </template>
25 <script> 25 <script>
26 import { upward, down } from '@/utils/operation' 26 import { judgeSort, realMove, findParents } from '@/utils/operation'
27 export default { 27 export default {
28 props: { 28 props: {
29 djqxList: { 29 djqxList: {
...@@ -67,12 +67,12 @@ export default { ...@@ -67,12 +67,12 @@ export default {
67 }, 67 },
68 { 68 {
69 prop: 'nodecode', 69 prop: 'nodecode',
70 width: '100', 70 width: '105',
71 label: '登记情形编码', 71 label: '登记情形编码',
72 render: (h, scope) => { 72 render: (h, scope) => {
73 return ( 73 return (
74 <el-input placeholder="登记情形编码" disabled={scope.row.sftsdjqx == '1'} value={scope.row[scope.column.property]} 74 <el-input placeholder="登记情形编码" class={{ repeat: scope.row.repeat }} disabled={scope.row.sftsdjqx == '1'} value={scope.row[scope.column.property]}
75 onInput={(val) => { scope.row[scope.column.property] = val }}></el-input> 75 onInput={(val) => { scope.row[scope.column.property] = val }} onBlur={() => { this.nodecodeBlur(scope.$index, scope.row) }} maxlength="8"></el-input>
76 ) 76 )
77 } 77 }
78 }, 78 },
...@@ -122,12 +122,12 @@ export default { ...@@ -122,12 +122,12 @@ export default {
122 }, 122 },
123 { 123 {
124 label: '移动', 124 label: '移动',
125 width: '80', 125 width: '100',
126 render: (h, scope) => { 126 render: (h, scope) => {
127 return ( 127 return (
128 <div> 128 <div>
129 <i class="el-icon-top pointer move" disabled={scope.$index == 0} onClick={() => { this.moveUpward(scope.$index, scope.row) }}></i> 129 <el-button type='text' disabled={scope.row.isTop} onClick={() => { this.moveUpward(scope.$index, scope.row) }}>上移</el-button>
130 <i class="el-icon-bottom pointer move" disabled={(scope.$index + 1) == this.tableData.length} onClick={() => { this.moveDown(scope.$index, scope.row) }}></i> 130 <el-button type='text' disabled={scope.row.isBottom} onClick={() => { this.moveDown(scope.$index, scope.row) }}>下移</el-button >
131 </div> 131 </div>
132 ) 132 )
133 } 133 }
...@@ -139,7 +139,7 @@ export default { ...@@ -139,7 +139,7 @@ export default {
139 watch: { 139 watch: {
140 djqxList: { 140 djqxList: {
141 handler: function (newValue) { 141 handler: function (newValue) {
142 this.tableData = newValue 142 this.tableData = judgeSort(newValue)
143 }, 143 },
144 deep: true, 144 deep: true,
145 immediate: true 145 immediate: true
...@@ -153,13 +153,22 @@ export default { ...@@ -153,13 +153,22 @@ export default {
153 }, 153 },
154 methods: { 154 methods: {
155 handleAdd () { 155 handleAdd () {
156 let code = this.tableData.slice(-1)[0].nodecode
157 let codeQ = code.slice(0, 6)
158 let len = ''
159 if (this.tableData.length + 1 < 9) {
160 len = 0 + String(this.tableData.length + 1)
161 } else {
162 len = this.tableData.length + 1
163 }
164
156 this.tableData.push( 165 this.tableData.push(
157 { 166 {
158 nodecode: '', 167 nodecode: codeQ + len,
159 nodename: '', 168 nodename: '',
160 enabled: '1', 169 enabled: '1',
161 djyy: '', 170 djyy: '',
162 sfqydjyymb: '1' 171 sfqydjyymb: '0'
163 } 172 }
164 ) 173 )
165 this.key++ 174 this.key++
...@@ -167,20 +176,38 @@ export default { ...@@ -167,20 +176,38 @@ export default {
167 handleMinus (index, row) { 176 handleMinus (index, row) {
168 this.tableData.splice(index, 1) 177 this.tableData.splice(index, 1)
169 }, 178 },
179 nodecodeBlur (index, row) {
180 let list = _.cloneDeep(this.tableData).filter(item => item.bsmSqyw != row.bsmSqyw)
181 let arr = list.map(item => item.nodecode)
182 if (arr.includes(row.nodecode)) {
183 this.$set(row, 'repeat', true)
184 this.$message.error('登记情形编码不能重复');
185 } else {
186 this.$set(row, 'repeat', false)
187 }
188 },
170 // 上移下移 189 // 上移下移
171 moveUpward (index, row) { 190 moveUpward (index, row) {
172 upward(index, this.tableData) 191 realMove(row.bsmDict, 'UP', this.tableData)
173 this.key++ 192 this.key++
193 let id = findParents(this.tableData, row.bsmDict)
194 this.keyList = id
174 }, 195 },
175 moveDown (index, row) { 196 moveDown (index, row) {
176 down(index, this.tableData) 197 realMove(row.bsmDict, 'DOWN', this.tableData)
177 this.key++ 198 this.key++
178 }, 199 let id = findParents(this.tableData, row.bsmDict)
200 this.keyList = id
201 }
179 } 202 }
180 } 203 }
181 </script> 204 </script>
182 <style scoped lang='scss'> 205 <style lang='scss'>
183 /deep/.el-radio { 206 .djqxsd {
184 margin-right: 5px; 207 .repeat {
208 .el-input__inner {
209 border-color: red !important;
210 }
211 }
185 } 212 }
186 </style> 213 </style>
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -114,7 +114,7 @@ ...@@ -114,7 +114,7 @@
114 </el-row> 114 </el-row>
115 </el-form> 115 </el-form>
116 <djqxsd v-show="n == 1" :djqxList="subData.djqx" :ruleForm="ruleForm" @updateValue="getDjqxValue" /> 116 <djqxsd v-show="n == 1" :djqxList="subData.djqx" :ruleForm="ruleForm" @updateValue="getDjqxValue" />
117 <clgzsd v-show="n == 2" :ruleForm="ruleForm" @updateValue="getClValue" /> 117 <clgzsd v-show="n == 2" :ruleForm="ruleForm" :subData="subData" @updateValue="getClValue" />
118 <dyztsd :ruleForm="ruleForm" :subData="subData" v-show="n == 3" @updateValue="getDyztsdValue" /> 118 <dyztsd :ruleForm="ruleForm" :subData="subData" v-show="n == 3" @updateValue="getDyztsdValue" />
119 </div> 119 </div>
120 </div> 120 </div>
...@@ -231,7 +231,7 @@ export default { ...@@ -231,7 +231,7 @@ export default {
231 this.subData.djqx = val 231 this.subData.djqx = val
232 }, 232 },
233 getClValue (val) { 233 getClValue (val) {
234 console.log(val); 234 this.subData.clxx = val
235 }, 235 },
236 // 单元状态设定 236 // 单元状态设定
237 getDyztsdValue (val) { 237 getDyztsdValue (val) {
...@@ -293,6 +293,14 @@ export default { ...@@ -293,6 +293,14 @@ export default {
293 <style scoped lang="scss"> 293 <style scoped lang="scss">
294 @import "~@/styles/mixin.scss"; 294 @import "~@/styles/mixin.scss";
295 295
296 /deep/.el-radio {
297 margin-right: 8px;
298 }
299
300 /deep/.el-radio__label {
301 padding-left: 2px;
302 }
303
296 .active { 304 .active {
297 background: $light-blue !important; 305 background: $light-blue !important;
298 color: #fff; 306 color: #fff;
......