批量删除功能
Showing
4 changed files
with
65 additions
and
68 deletions
... | @@ -3,65 +3,71 @@ | ... | @@ -3,65 +3,71 @@ |
3 | <lb-table :column="columns" :data="formData.dataList" :maxHeight="460" :heightNumSetting="true" :pagination="false" | 3 | <lb-table :column="columns" :data="formData.dataList" :maxHeight="460" :heightNumSetting="true" :pagination="false" |
4 | @selection-change="handleSelectionChange"> | 4 | @selection-change="handleSelectionChange"> |
5 | </lb-table> | 5 | </lb-table> |
6 | <div class="text-center"> | ||
7 | <el-button @click="$popupCacel">取消</el-button> | ||
8 | <el-button type="primary" @click="childFn" plain>确定</el-button> | ||
9 | </div> | ||
6 | </div> | 10 | </div> |
7 | </template> | 11 | </template> |
8 | <script> | 12 | <script> |
9 | import { deleteFlow } from "@/api/ywbl.js" | 13 | import { deleteFlow } from "@/api/ywbl.js" |
10 | export default { | 14 | export default { |
11 | components: {}, | 15 | components: {}, |
12 | props: { | 16 | props: { |
13 | formData: { | 17 | formData: { |
14 | type: Object, | 18 | type: Object, |
15 | default: {} | 19 | default: {} |
16 | } | 20 | } |
17 | }, | 21 | }, |
18 | data () { | 22 | data () { |
19 | return { | 23 | return { |
20 | columns: [ | 24 | columns: [ |
21 | { | 25 | { |
22 | type: 'selection', | 26 | type: 'selection', |
23 | label: '全选' | 27 | label: '全选' |
24 | }, | 28 | }, |
25 | { | 29 | { |
26 | label: '序号', | 30 | label: '序号', |
27 | type: 'index', | 31 | type: 'index', |
28 | width: '50', | 32 | width: '50', |
29 | }, | 33 | }, |
30 | { | 34 | { |
31 | prop: "bdcdyh", | 35 | prop: "bdcdyh", |
32 | label: "不动产单元号", | 36 | label: "不动产单元号", |
33 | }, | 37 | }, |
34 | { | 38 | { |
35 | prop: "zl", | 39 | prop: "zl", |
36 | label: "坐落", | 40 | label: "坐落", |
37 | }, | 41 | }, |
38 | ], | 42 | ], |
39 | dataList: [], | 43 | dataList: [], |
40 | selectBdcdy: [], | 44 | selectBdcdy: [], |
41 | } | 45 | } |
42 | }, | ||
43 | methods: { | ||
44 | childFn () { | ||
45 | var formdata = new FormData(); | ||
46 | formdata.append("bsmSldyList", this.selectBdcdy); | ||
47 | formdata.append("bsmSlsq",this.formData.bsmSlsq); | ||
48 | deleteFlow(formdata).then(res => { | ||
49 | if (res.code == 200) { | ||
50 | this.$message.success("删除成功"); | ||
51 | } else { | ||
52 | this.$message.error(res.message) | ||
53 | } | ||
54 | }) | ||
55 | }, | 46 | }, |
56 | handleSelectionChange (e) { | 47 | methods: { |
57 | this.selectBdcdy = []; | 48 | childFn () { |
58 | e.forEach((item, index) => { | 49 | var formdata = new FormData(); |
59 | this.selectBdcdy.push(item.bsmSldy) | 50 | formdata.append("bsmSldyList", this.selectBdcdy); |
60 | }) | 51 | formdata.append("bsmSlsq", this.formData.bsmSlsq); |
52 | deleteFlow(formdata).then(res => { | ||
53 | if (res.code == 200) { | ||
54 | this.$popupCacel(); | ||
55 | location.reload() | ||
56 | console.log("走i了"); | ||
57 | this.$message.success("删除成功"); | ||
58 | } else { | ||
59 | this.$message.error(res.message) | ||
60 | } | ||
61 | }) | ||
62 | }, | ||
63 | handleSelectionChange (e) { | ||
64 | this.selectBdcdy = []; | ||
65 | e.forEach((item, index) => { | ||
66 | this.selectBdcdy.push(item.bsmSldy) | ||
67 | }) | ||
68 | } | ||
61 | } | 69 | } |
62 | } | 70 | } |
63 | } | ||
64 | </script> | 71 | </script> |
65 | <style scoped lang='scss'> | 72 | <style scoped lang='scss'> |
66 | |||
67 | </style> | ||
... | \ No newline at end of file | ... | \ No newline at end of file |
73 | </style> | ... | ... |
... | @@ -167,7 +167,6 @@ | ... | @@ -167,7 +167,6 @@ |
167 | }, | 167 | }, |
168 | // 下拉列表切换 | 168 | // 下拉列表切换 |
169 | handleSelect (val) { | 169 | handleSelect (val) { |
170 | |||
171 | this.taskCommentList = (this.formData.allCommentList || []).filter(item => { | 170 | this.taskCommentList = (this.formData.allCommentList || []).filter(item => { |
172 | return item.taskDefKey === val | 171 | return item.taskDefKey === val |
173 | }) | 172 | }) |
... | @@ -235,7 +234,6 @@ | ... | @@ -235,7 +234,6 @@ |
235 | } | 234 | } |
236 | if (Array.isArray(finishedTaskSet)) { | 235 | if (Array.isArray(finishedTaskSet)) { |
237 | finishedTaskSet.forEach(item => canvas.addMarker(item, 'success')) | 236 | finishedTaskSet.forEach(item => canvas.addMarker(item, 'success')) |
238 | console.log(finishedTaskSet, 'finishedTaskSet'); | ||
239 | } | 237 | } |
240 | if (Array.isArray(unfinishedTaskSet)) { | 238 | if (Array.isArray(unfinishedTaskSet)) { |
241 | unfinishedTaskSet.forEach(item => canvas.addMarker(item, 'primary')) | 239 | unfinishedTaskSet.forEach(item => canvas.addMarker(item, 'primary')) | ... | ... |
... | @@ -361,18 +361,12 @@ export default { | ... | @@ -361,18 +361,12 @@ export default { |
361 | }, | 361 | }, |
362 | //批量操作 | 362 | //批量操作 |
363 | handleBatchDel () { | 363 | handleBatchDel () { |
364 | let that = this; | 364 | this.$popupDialog("批量删除", "workflow/components/batchDel", { |
365 | this.$popup("批量删除", "workflow/components/batchDel", { | ||
366 | width: "50%", | 365 | width: "50%", |
367 | btnShow: true, | 366 | btnShow: false, |
368 | height: "600px", | 367 | bsmSlsq: this.bsmSlsq, |
369 | formData: { | 368 | dataList: this.unitData, |
370 | bsmSlsq: this.bsmSlsq, | 369 | |
371 | dataList: this.unitData, | ||
372 | }, | ||
373 | confirm: function () { | ||
374 | that.loadBdcdylist(); | ||
375 | } | ||
376 | }) | 370 | }) |
377 | }, | 371 | }, |
378 | handleChange (file) { | 372 | handleChange (file) { | ... | ... |
-
Please register or sign in to post a comment