style:配置登记簿打印字段
Showing
4 changed files
with
71 additions
and
109 deletions
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-07-19 16:04:58 | 4 | * @LastEditTime: 2023-09-14 10:53:42 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div> | 7 | <div> |
... | @@ -12,61 +12,48 @@ | ... | @@ -12,61 +12,48 @@ |
12 | class="check" | 12 | class="check" |
13 | :indeterminate="isIndeterminate" | 13 | :indeterminate="isIndeterminate" |
14 | v-model="checkAll" | 14 | v-model="checkAll" |
15 | @change="handleCheckAllChange" | 15 | @change="handleCheckAllChange">待选合集</el-checkbox> |
16 | >待选合集</el-checkbox | ||
17 | > | ||
18 | <div class="num">/</div> | 16 | <div class="num">/</div> |
19 | </div> | 17 | </div> |
20 | <el-checkbox-group | 18 | <el-checkbox-group |
21 | class="concent" | 19 | class="concent" |
22 | v-model="checkedCities" | 20 | v-model="checkedCities" |
23 | @change="handleCheckedCitiesChange" | 21 | @change="handleCheckedCitiesChange"> |
24 | > | ||
25 | <el-checkbox | 22 | <el-checkbox |
26 | v-for="city in cities" | 23 | v-for="city in cities" |
27 | :label="city.name" | 24 | :label="city.name" |
28 | :key="city.name" | 25 | :key="city.name">{{ city.despriction }}({{ city.name }})</el-checkbox> |
29 | >{{ city.despriction }}({{ city.name }})</el-checkbox | ||
30 | > | ||
31 | </el-checkbox-group> | 26 | </el-checkbox-group> |
32 | </div> | 27 | </div> |
33 | <div class="right"> | 28 | <div class="right"> |
34 | <div class="header"> | ||
35 | <el-button> 置顶 </el-button> | ||
36 | <el-button> 上移 </el-button> | ||
37 | <el-button> 下移 </el-button> | ||
38 | <el-button> 置底 </el-button> | ||
39 | </div> | ||
40 | <el-table | 29 | <el-table |
41 | class="tablelist" | 30 | class="tablelist" |
42 | :data="datalist" | 31 | :data="datalist" |
43 | ref="listTable" | 32 | ref="listTable" |
44 | row-key="zd" | 33 | |
34 | :key="key" | ||
35 | row-key="bsmMb" | ||
45 | :pagination="false" | 36 | :pagination="false" |
46 | :header-cell-style="{ 'text-align': 'center' }" | 37 | :header-cell-style="{ 'text-align': 'center' }" |
47 | :heightNumSetting="true" | 38 | :heightNumSetting="true" |
48 | :minHeight="150" | 39 | :minHeight="150" |
49 | height="590" | 40 | height="590" |
50 | style="width: 100%" | 41 | style="width: 100%"> |
51 | > | ||
52 | <el-table-column label="字段" prop="name" min-width="100"> | 42 | <el-table-column label="字段" prop="name" min-width="100"> |
53 | </el-table-column> | 43 | </el-table-column> |
54 | 44 | ||
55 | <el-table-column | 45 | <el-table-column |
56 | label="字段名称" | 46 | label="字段名称" |
57 | prop="desprictionor" | 47 | prop="desprictionor" |
58 | min-width="100" | 48 | min-width="100"> |
59 | > | ||
60 | </el-table-column> | 49 | </el-table-column> |
61 | <el-table-column label="字段别名" min-width="100"> | 50 | <el-table-column label="字段别名" min-width="100"> |
62 | <template slot-scope="scope"> | 51 | <template slot-scope="scope"> |
63 | <el-input | 52 | <el-input |
64 | v-model="scope.row.despriction" | 53 | v-model="scope.row.despriction" |
65 | placeholder="请输入内容" | 54 | placeholder="请输入内容" |
66 | @input="sumTime(scope.$index, scope.row.tdsyqx)" | 55 | @input="sumTime(scope.$index, scope.row.tdsyqx)"> |
67 | > | 56 | ></el-input> |
68 | ></el-input | ||
69 | > | ||
70 | </template> | 57 | </template> |
71 | </el-table-column> | 58 | </el-table-column> |
72 | </el-table> | 59 | </el-table> |
... | @@ -80,18 +67,19 @@ | ... | @@ -80,18 +67,19 @@ |
80 | </template> | 67 | </template> |
81 | 68 | ||
82 | <script> | 69 | <script> |
83 | import Sortable from "sortablejs"; | 70 | import Sortable from 'sortablejs' |
84 | import { getFieldList, getFieldListByQlxx, save } from "@/api/SysDjbFieldDO"; | 71 | import { getFieldList, getFieldListByQlxx, save } from "@/api/SysDjbFieldDO"; |
85 | export default { | 72 | export default { |
86 | props: { | 73 | props: { |
87 | formData: { | 74 | formData: { |
88 | type: Object, | 75 | type: Object, |
89 | default: () => {}, | 76 | default: () => { }, |
90 | }, | 77 | }, |
91 | }, | 78 | }, |
92 | data() { | 79 | data () { |
93 | return { | 80 | return { |
94 | checkAll: false, | 81 | checkAll: false, |
82 | sortable: null, | ||
95 | checkedCities: [], | 83 | checkedCities: [], |
96 | cities: [], | 84 | cities: [], |
97 | datalist: [], | 85 | datalist: [], |
... | @@ -100,82 +88,53 @@ export default { | ... | @@ -100,82 +88,53 @@ export default { |
100 | isIndeterminate: true, | 88 | isIndeterminate: true, |
101 | }; | 89 | }; |
102 | }, | 90 | }, |
103 | mounted() { | 91 | mounted () { |
104 | this.generateData(); | 92 | this.generateData() |
105 | this.initSort(); | ||
106 | }, | 93 | }, |
107 | beforeDestroy() { | 94 | beforeDestroy () { |
108 | if (this.sortable) { | 95 | if (this.sortable) { |
109 | this.sortable.destroy(); | 96 | this.sortable.destroy(); |
110 | } | 97 | } |
111 | }, | 98 | }, |
99 | watch: { | ||
100 | key: { | ||
101 | handler (newName, oldName) { | ||
102 | this.initSort() | ||
103 | } | ||
104 | } | ||
105 | }, | ||
112 | methods: { | 106 | methods: { |
113 | changeIndex(array, index1, index2) { | 107 | changeIndex (array, index1, index2) { |
114 | array[index1] = array.splice(index2, 1, array[index1])[0]; | 108 | array[index1] = array.splice(index2, 1, array[index1])[0]; |
115 | /** splice 会修改原来的数组 slice 不会 返回的是删除后的数据 所以 index2要删除的位置,删除1个数据 返回是index2的数据 然后最后一个参数是新增的数据为index的数据 */ | ||
116 | }, | 109 | }, |
117 | initSort() { | 110 | initSort () { |
118 | this.datalist=[] | ||
119 | this.datalist =this.tablelist | ||
120 | const el = this.$refs.listTable.$el.querySelectorAll( | 111 | const el = this.$refs.listTable.$el.querySelectorAll( |
121 | ".el-table__body-wrapper > table > tbody" | 112 | ".el-table__body-wrapper > table > tbody" |
122 | )[0]; | 113 | )[0]; |
123 | this.sortable = Sortable.create(el, { | 114 | |
115 | this.sortable = new Sortable(el, { | ||
124 | ghostClass: "sortable-ghost", | 116 | ghostClass: "sortable-ghost", |
125 | setData: function (dataTransfer) { | 117 | setData: function (dataTransfer) { |
126 | dataTransfer.setData("Text", ""); | 118 | dataTransfer.setData("Text", ""); |
127 | }, | 119 | }, |
128 | onEnd: (evt) => { | 120 | onEnd: (evt) => { |
129 | console.log("evt.oldIndex", evt.oldIndex); | 121 | // 其他排序逻辑 |
130 | console.log("evt.newIndex", evt.newIndex); | 122 | // const targetRow = this.datalist.splice(evt.oldIndex, 1)[0] |
131 | const targetRow = this.tablelist.splice(evt.oldIndex, 1)[0]; | 123 | // this.datalist.splice(evt.newIndex, 0, targetRow); |
132 | console.log("targetRow", targetRow); | 124 | } |
133 | // this.changeIndex(this.datalist,evt.newIndex,evt.oldIndex) | 125 | }) |
134 | // console.log("this.datalist", this.datalist); | ||
135 | this.datalist.splice(evt.newIndex, 0, targetRow); | ||
136 | console.log(); | ||
137 | this.$set(this.datalist,targetRow); | ||
138 | |||
139 | }, | ||
140 | }); | ||
141 | }, | 126 | }, |
142 | // initSort () { | ||
143 | // const el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] | ||
144 | // this.sortable =new Sortable(el, { | ||
145 | // onEnd: (evt) => { // 监听拖动结束事件 | ||
146 | // console.log(this) // this是当前vue上下文 | ||
147 | // console.log(evt.oldIndex) // 当前行的被拖拽前的顺序 | ||
148 | // console.log(evt.newIndex) | ||
149 | // const currRow = this.tableData.splice(evt.oldIndex, 1)[0] | ||
150 | // this.datalist.splice(evt.newIndex, 0, currRow) | ||
151 | // } | ||
152 | // }) | ||
153 | // }, | ||
154 | // initSort(){ | ||
155 | // let el = this.$refs.listTable.$el.querySelectorAll('.el-table__body-wrapper > table > tbody')[0] | ||
156 | // //设置配置 | ||
157 | // let _this = this | ||
158 | // Sortable.create(el, { | ||
159 | // animation: 150, | ||
160 | // sort: true, | ||
161 | // // draggable: '.el-table__row', // 设置可拖拽行的类名(el-table自带的类名) | ||
162 | // forceFallback: true, | ||
163 | // onEnd({newIndex, oldIndex}) { | ||
164 | // let currRow = _this.datalist.splice(oldIndex, 1)[0]; | ||
165 | // _this.datalist.splice(newIndex, 0, currRow); | ||
166 | // } | ||
167 | // }) | ||
168 | // }, | ||
169 | /** | 127 | /** |
170 | * @description: 初始数据集 | 128 | * @description: 初始数据集 |
171 | * @author: renchao | 129 | * @author: renchao |
172 | */ | 130 | */ |
173 | generateData() { | 131 | generateData () { |
132 | let that = this | ||
174 | getFieldList({ qllx: this.formData.qllx }).then((res) => { | 133 | getFieldList({ qllx: this.formData.qllx }).then((res) => { |
175 | if (res.code === 200) { | 134 | if (res.code === 200) { |
176 | let listss = res.result; | 135 | let listss = res.result; |
177 | listss.forEach((item, index) => { | 136 | listss.forEach((item, index) => { |
178 | this.cities.push({ | 137 | that.cities.push({ |
179 | name: item.name, | 138 | name: item.name, |
180 | despriction: item.despriction, | 139 | despriction: item.despriction, |
181 | desprictionor: item.despriction, | 140 | desprictionor: item.despriction, |
... | @@ -186,22 +145,25 @@ export default { | ... | @@ -186,22 +145,25 @@ export default { |
186 | if (res.code === 200) { | 145 | if (res.code === 200) { |
187 | let listss = res.result; | 146 | let listss = res.result; |
188 | listss.forEach((item, index) => { | 147 | listss.forEach((item, index) => { |
189 | this.tablelist.push({ | 148 | that.tablelist.push({ |
190 | name: item.name, | 149 | name: item.name, |
191 | despriction: item.despriction, | 150 | despriction: item.despriction, |
192 | desprictionor: item.despriction, | 151 | desprictionor: item.despriction, |
193 | }); | 152 | }); |
194 | this.datalist =this.tablelist | 153 | that.$nextTick(() => { |
195 | this.checkedCities.push(item.name); | 154 | that.datalist = this.tablelist |
196 | }); | 155 | that.checkedCities.push(item.name); |
156 | }) | ||
157 | }) | ||
158 | that.initSort() | ||
197 | } | 159 | } |
198 | }); | 160 | }); |
199 | } | 161 | } |
200 | }); | 162 | }); |
201 | }, | 163 | }, |
202 | handleCheckAllChange(val) { | 164 | handleCheckAllChange (val) { |
203 | let checkedlist=[] | 165 | let checkedlist = [] |
204 | let orlist=[] | 166 | let orlist = [] |
205 | checkedlist = val ? this.cities : []; | 167 | checkedlist = val ? this.cities : []; |
206 | this.isIndeterminate = false; | 168 | this.isIndeterminate = false; |
207 | console.log("this.checkedCities", this.checkedCities); | 169 | console.log("this.checkedCities", this.checkedCities); |
... | @@ -215,12 +177,13 @@ export default { | ... | @@ -215,12 +177,13 @@ export default { |
215 | } | 177 | } |
216 | }); | 178 | }); |
217 | }); | 179 | }); |
218 | console.log("orlist",orlist); | 180 | this.checkedCities = orlist |
219 | this.checkedCities=orlist | ||
220 | this.tablelist = lists; | 181 | this.tablelist = lists; |
221 | this.datalist =this.tablelist | 182 | this.datalist = this.tablelist |
183 | // 其他排序逻辑 | ||
184 | this.initSort() | ||
222 | }, | 185 | }, |
223 | handleCheckedCitiesChange(value) { | 186 | handleCheckedCitiesChange (value) { |
224 | console.log("value", value, this.checkedCities); | 187 | console.log("value", value, this.checkedCities); |
225 | let checkedCount = value.length; | 188 | let checkedCount = value.length; |
226 | this.checkAll = checkedCount === this.cities.length; | 189 | this.checkAll = checkedCount === this.cities.length; |
... | @@ -236,10 +199,11 @@ export default { | ... | @@ -236,10 +199,11 @@ export default { |
236 | }); | 199 | }); |
237 | }); | 200 | }); |
238 | this.tablelist = lists; | 201 | this.tablelist = lists; |
239 | this.datalist =this.tablelist | 202 | this.datalist = this.tablelist |
203 | // 其他排序逻辑 | ||
204 | this.initSort() | ||
240 | }, | 205 | }, |
241 | submitForm() { | 206 | submitForm () { |
242 | console.log("this.datalistdss", this.datalist); | ||
243 | save(this.formData.bsmMb, this.datalist).then((res) => { | 207 | save(this.formData.bsmMb, this.datalist).then((res) => { |
244 | if (res.code == 200) { | 208 | if (res.code == 200) { |
245 | this.$popupCacel(); | 209 | this.$popupCacel(); |
... | @@ -256,12 +220,12 @@ export default { | ... | @@ -256,12 +220,12 @@ export default { |
256 | }); | 220 | }); |
257 | }, | 221 | }, |
258 | }, | 222 | }, |
259 | }; | 223 | }; |
260 | </script> | 224 | </script> |
261 | <style scoped lang="scss"> | 225 | <style scoped lang="scss"> |
262 | @import "~@/styles/mixin.scss"; | 226 | @import "~@/styles/mixin.scss"; |
263 | @import "~@/styles/dialogBoxheader.scss"; | 227 | @import "~@/styles/dialogBoxheader.scss"; |
264 | .fieldcheck { | 228 | .fieldcheck { |
265 | width: 100%; | 229 | width: 100%; |
266 | height: 650px; | 230 | height: 650px; |
267 | display: flex; | 231 | display: flex; |
... | @@ -317,10 +281,10 @@ export default { | ... | @@ -317,10 +281,10 @@ export default { |
317 | height: 680px; | 281 | height: 680px; |
318 | } | 282 | } |
319 | } | 283 | } |
320 | } | 284 | } |
321 | .btn { | 285 | .btn { |
322 | margin-top: 10px; | 286 | margin-top: 10px; |
323 | width: 100%; | 287 | width: 100%; |
324 | text-align: center; | 288 | text-align: center; |
325 | } | 289 | } |
326 | </style> | 290 | </style> | ... | ... |
1 | /* | 1 | /* |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-04-11 13:53:12 | 4 | * @LastEditTime: 2023-09-14 10:51:36 |
5 | */ | 5 | */ |
6 | import filter from '@/utils/filter.js' | 6 | import filter from '@/utils/filter.js' |
7 | let vm = null | 7 | let vm = null |
... | @@ -61,7 +61,7 @@ class data extends filter { | ... | @@ -61,7 +61,7 @@ class data extends filter { |
61 | }, | 61 | }, |
62 | { | 62 | { |
63 | label: '操作', | 63 | label: '操作', |
64 | width: '160', | 64 | width: '130', |
65 | render: (h, scope) => { | 65 | render: (h, scope) => { |
66 | return ( | 66 | return ( |
67 | <div> | 67 | <div> | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-08-09 10:09:12 | 4 | * @LastEditTime: 2023-09-14 10:02:08 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="from-clues"> | 7 | <div class="from-clues"> |
... | @@ -89,8 +89,8 @@ | ... | @@ -89,8 +89,8 @@ |
89 | editClick (row) { | 89 | editClick (row) { |
90 | this.$popupDialog("其他及附记模板", "system/qtjfjmb/components/editDialog", row, '60%') | 90 | this.$popupDialog("其他及附记模板", "system/qtjfjmb/components/editDialog", row, '60%') |
91 | }, | 91 | }, |
92 | djbdisposition(row){ | 92 | djbdisposition (row) { |
93 | this.$popupDialog("配置登记簿打印字段", "system/qtjfjmb/components/djbdispositions", row, '60%') | 93 | this.$popupDialog("配置登记簿打印字段", "system/qtjfjmb/components/djbdispositions", row, '70%') |
94 | } | 94 | } |
95 | } | 95 | } |
96 | } | 96 | } | ... | ... |
1 | <!-- | 1 | <!-- |
2 | * @Description: | 2 | * @Description: |
3 | * @Autor: renchao | 3 | * @Autor: renchao |
4 | * @LastEditTime: 2023-09-13 17:08:53 | 4 | * @LastEditTime: 2023-09-14 10:12:23 |
5 | --> | 5 | --> |
6 | <template> | 6 | <template> |
7 | <div class="clmlmx-box"> | 7 | <div class="clmlmx-box"> |
... | @@ -141,7 +141,6 @@ | ... | @@ -141,7 +141,6 @@ |
141 | mounted () { | 141 | mounted () { |
142 | this.initSort() | 142 | this.initSort() |
143 | this.tableData = _.cloneDeep(this.formData.data) | 143 | this.tableData = _.cloneDeep(this.formData.data) |
144 | console.log(this.formData.bsmCompany); | ||
145 | }, | 144 | }, |
146 | beforeDestroy () { | 145 | beforeDestroy () { |
147 | if (this.sortable) { | 146 | if (this.sortable) { |
... | @@ -185,7 +184,6 @@ | ... | @@ -185,7 +184,6 @@ |
185 | * @author: renchao | 184 | * @author: renchao |
186 | */ | 185 | */ |
187 | handleDelete (index, row) { | 186 | handleDelete (index, row) { |
188 | let that = this | ||
189 | this.$confirm('此操作将永久删除该 是否继续?', '提示', { | 187 | this.$confirm('此操作将永久删除该 是否继续?', '提示', { |
190 | confirmButtonText: '确定', | 188 | confirmButtonText: '确定', |
191 | cancelButtonText: '取消', | 189 | cancelButtonText: '取消', | ... | ... |
-
Please register or sign in to post a comment