楼盘表户批量上传功能
Showing
3 changed files
with
102 additions
and
6 deletions
| ... | @@ -69,6 +69,10 @@ | ... | @@ -69,6 +69,10 @@ |
| 69 | isDisabled:{ | 69 | isDisabled:{ |
| 70 | type:Boolean, | 70 | type:Boolean, |
| 71 | default:false | 71 | default:false |
| 72 | }, | ||
| 73 | lpbParent:{ | ||
| 74 | type:Boolean, | ||
| 75 | default:false | ||
| 72 | } | 76 | } |
| 73 | }, | 77 | }, |
| 74 | methods: { | 78 | methods: { |
| ... | @@ -128,7 +132,7 @@ | ... | @@ -128,7 +132,7 @@ |
| 128 | default: | 132 | default: |
| 129 | break | 133 | break |
| 130 | } | 134 | } |
| 131 | getFileLis(this.fileData.glbsm).then(res => { | 135 | getFileLis(this.lpbParent ? this.$store.state.hbsm : this.fileData.glbsm).then(res => { |
| 132 | if (res.success) { | 136 | if (res.success) { |
| 133 | this.list = res.result; | 137 | this.list = res.result; |
| 134 | } else { | 138 | } else { | ... | ... |
| ... | @@ -7,7 +7,7 @@ | ... | @@ -7,7 +7,7 @@ |
| 7 | <djb v-if="djbVisible" :style="{'height' : formHeight+'px'}"></djb> | 7 | <djb v-if="djbVisible" :style="{'height' : formHeight+'px'}"></djb> |
| 8 | </el-tab-pane> | 8 | </el-tab-pane> |
| 9 | <el-tab-pane label="附件材料" name="fjcl"> | 9 | <el-tab-pane label="附件材料" name="fjcl"> |
| 10 | <fjcl v-if="fjclVisible" ref="fjcl" :style="{'height' : formHeight+'px'}" :is-disabled="isDisabled"></fjcl> | 10 | <fjcl v-if="fjclVisible" ref="fjcl" :lpbParent="true" :style="{'height' : formHeight+'px'}" :is-disabled="isDisabled"></fjcl> |
| 11 | </el-tab-pane> | 11 | </el-tab-pane> |
| 12 | </el-tabs> | 12 | </el-tabs> |
| 13 | </template> | 13 | </template> |
| ... | @@ -22,6 +22,9 @@ | ... | @@ -22,6 +22,9 @@ |
| 22 | components: { | 22 | components: { |
| 23 | hbj, djb, fjcl | 23 | hbj, djb, fjcl |
| 24 | }, | 24 | }, |
| 25 | props:{ | ||
| 26 | bsm:String, //户标识码 | ||
| 27 | }, | ||
| 25 | data() { | 28 | data() { |
| 26 | return { | 29 | return { |
| 27 | isDisabled:false, | 30 | isDisabled:false, |
| ... | @@ -37,7 +40,6 @@ | ... | @@ -37,7 +40,6 @@ |
| 37 | }, | 40 | }, |
| 38 | methods: { | 41 | methods: { |
| 39 | loadingStatus() { | 42 | loadingStatus() { |
| 40 | debugger | ||
| 41 | let bsm=this.$store.state.hbsm; | 43 | let bsm=this.$store.state.hbsm; |
| 42 | queryStatus(bsm).then(res => { | 44 | queryStatus(bsm).then(res => { |
| 43 | if (res.success) { | 45 | if (res.success) { | ... | ... |
| ... | @@ -83,14 +83,14 @@ | ... | @@ -83,14 +83,14 @@ |
| 83 | label="7" | 83 | label="7" |
| 84 | border | 84 | border |
| 85 | @click="batchDelete" | 85 | @click="batchDelete" |
| 86 | ><i class="iconfont iconhuzhongxinlazong"></i>批量删除</el-button | 86 | ><i class="iconfont iconshanchu"></i>批量删除</el-button |
| 87 | > | 87 | > |
| 88 | <el-button | 88 | <el-button |
| 89 | class="radioBtn" | 89 | class="radioBtn" |
| 90 | label="7" | 90 | label="7" |
| 91 | border | 91 | border |
| 92 | @click="batchUpload" | 92 | @click="batchUpload" |
| 93 | ><i class="iconfont iconhuzhongxinlazong"></i>批量上传</el-button | 93 | ><i class="iconfont iconshangchuan"></i>批量上传</el-button |
| 94 | > | 94 | > |
| 95 | </div> | 95 | </div> |
| 96 | </el-col> | 96 | </el-col> |
| ... | @@ -276,6 +276,33 @@ | ... | @@ -276,6 +276,33 @@ |
| 276 | <pl-zl :pl-zl-visible="plzlVisible" :bsms="bsms" @close="plZlClose" @lodding="lodding"></pl-zl> | 276 | <pl-zl :pl-zl-visible="plzlVisible" :bsms="bsms" @close="plZlClose" @lodding="lodding"></pl-zl> |
| 277 | <pl-c :plc-visible="plcVisible" :bsms="cbsmList" @close="plcClose" @lodding="lodding"></pl-c> | 277 | <pl-c :plc-visible="plcVisible" :bsms="cbsmList" @close="plcClose" @lodding="lodding"></pl-c> |
| 278 | <pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose" @lodding="lodding"></pl-sh> | 278 | <pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose" @lodding="lodding"></pl-sh> |
| 279 | <el-dialog v-dialogDrag :close-on-click-modal="false" title="批量上传" :visible.sync="uploadVisible" width="30%" > | ||
| 280 | <div class="wrap"> | ||
| 281 | <div class="main-button"> | ||
| 282 | <el-upload | ||
| 283 | class="upload-demo" | ||
| 284 | action="/api/file/uploadListByGlbsm" | ||
| 285 | :data="fileData" | ||
| 286 | :on-preview="handlePreview" | ||
| 287 | :on-remove="handleRemove" | ||
| 288 | :before-remove="beforeRemove" | ||
| 289 | :on-success="uploadSuccess" | ||
| 290 | :on-error="uploadError" | ||
| 291 | :show-file-list="false" | ||
| 292 | multiple | ||
| 293 | :limit="1" | ||
| 294 | :on-exceed="handleExceed" | ||
| 295 | > | ||
| 296 | <el-button type="primary" icon="iconfont iconshangchuan">上传附件</el-button> | ||
| 297 | </el-upload> | ||
| 298 | </div> | ||
| 299 | <el-button type="primary" class="download" @click="uploadVisible = false" | ||
| 300 | >取消</el-button> | ||
| 301 | |||
| 302 | </div> | ||
| 303 | <span slot="footer" class="dialog-footer"> | ||
| 304 | </span> | ||
| 305 | </el-dialog> | ||
| 279 | </div> | 306 | </div> |
| 280 | </template> | 307 | </template> |
| 281 | 308 | ||
| ... | @@ -398,6 +425,11 @@ export default { | ... | @@ -398,6 +425,11 @@ export default { |
| 398 | taskTitle:'添加', | 425 | taskTitle:'添加', |
| 399 | curBsm:'', | 426 | curBsm:'', |
| 400 | qsztList:[], | 427 | qsztList:[], |
| 428 | uploadVisible:false, //批量上传弹框 | ||
| 429 | fileData:{ | ||
| 430 | glbsmList:[], | ||
| 431 | dylx:'h' | ||
| 432 | } | ||
| 401 | }; | 433 | }; |
| 402 | }, | 434 | }, |
| 403 | created() { | 435 | created() { |
| ... | @@ -438,7 +470,8 @@ export default { | ... | @@ -438,7 +470,8 @@ export default { |
| 438 | } | 470 | } |
| 439 | }, | 471 | }, |
| 440 | //批量删除 | 472 | //批量删除 |
| 441 | batchDelete(){ if (this.bsms.length <= 0) { | 473 | batchDelete(){ |
| 474 | if (this.bsms.length <= 0) { | ||
| 442 | Message.warning("请选择操作户") | 475 | Message.warning("请选择操作户") |
| 443 | return | 476 | return |
| 444 | }else{ | 477 | }else{ |
| ... | @@ -456,6 +489,39 @@ export default { | ... | @@ -456,6 +489,39 @@ export default { |
| 456 | } | 489 | } |
| 457 | } | 490 | } |
| 458 | }, | 491 | }, |
| 492 | //批量上传 start | ||
| 493 | batchUpload(){ | ||
| 494 | if (this.bsms.length < 1 ) { | ||
| 495 | Message.warning("请选择操作户") | ||
| 496 | return | ||
| 497 | }else{ | ||
| 498 | this.uploadVisible = true | ||
| 499 | } | ||
| 500 | }, | ||
| 501 | uploadError(err, file, fileList) { | ||
| 502 | Message.error("上传文件失败") | ||
| 503 | console.log("上传文件失败", err) | ||
| 504 | }, | ||
| 505 | uploadSuccess(res, file, fileList) { | ||
| 506 | Message.success("上传成功") | ||
| 507 | this.uploadVisible = false; | ||
| 508 | }, | ||
| 509 | handleRemove(file, fileList) { | ||
| 510 | console.log(file, fileList); | ||
| 511 | }, | ||
| 512 | handlePreview(file) { | ||
| 513 | console.log(file); | ||
| 514 | }, | ||
| 515 | handleExceed(files, fileList) { | ||
| 516 | console.log(fileList) | ||
| 517 | // this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`); | ||
| 518 | this.$message.warning("上传失败") | ||
| 519 | }, | ||
| 520 | beforeRemove(file, fileList) { | ||
| 521 | return this.$confirm(`确定移除 ${ file.name }?`); | ||
| 522 | }, | ||
| 523 | //批量上传 end | ||
| 524 | |||
| 459 | loading(){ | 525 | loading(){ |
| 460 | this.getLpbMenuTree(this.$store.state.zrzbsm); | 526 | this.getLpbMenuTree(this.$store.state.zrzbsm); |
| 461 | }, | 527 | }, |
| ... | @@ -859,6 +925,10 @@ export default { | ... | @@ -859,6 +925,10 @@ export default { |
| 859 | selectedZt(n){ | 925 | selectedZt(n){ |
| 860 | this.legendToggleFlag = true; | 926 | this.legendToggleFlag = true; |
| 861 | }, | 927 | }, |
| 928 | bsms(n){ | ||
| 929 | this.fileData.glbsmList = n; | ||
| 930 | console.log(this.fileData,'filedata'); | ||
| 931 | } | ||
| 862 | }, | 932 | }, |
| 863 | }; | 933 | }; |
| 864 | </script> | 934 | </script> |
| ... | @@ -1033,5 +1103,25 @@ export default { | ... | @@ -1033,5 +1103,25 @@ export default { |
| 1033 | .fa{ | 1103 | .fa{ |
| 1034 | padding-right: 4px; | 1104 | padding-right: 4px; |
| 1035 | } | 1105 | } |
| 1106 | |||
| 1107 | .wrap{ | ||
| 1108 | width: 100%; | ||
| 1109 | height: 30px; | ||
| 1110 | position: relative; | ||
| 1111 | .main-button { | ||
| 1112 | display: -webkit-flex; | ||
| 1113 | display: flex; | ||
| 1114 | flex-direction: column-reverse; | ||
| 1115 | flex-wrap: nowrap; | ||
| 1116 | position: absolute; | ||
| 1117 | left: 165px; | ||
| 1118 | top: 18px; | ||
| 1119 | } | ||
| 1120 | .download{ | ||
| 1121 | position: absolute; | ||
| 1122 | left: 312px; | ||
| 1123 | top: 19px; | ||
| 1124 | } | ||
| 1125 | } | ||
| 1036 | } | 1126 | } |
| 1037 | </style> | 1127 | </style> | ... | ... |
-
Please register or sign in to post a comment