e63e1a61 by 杨威

楼盘表户批量上传功能

1 parent 4f4225ff
......@@ -69,6 +69,10 @@
isDisabled:{
type:Boolean,
default:false
},
lpbParent:{
type:Boolean,
default:false
}
},
methods: {
......@@ -128,7 +132,7 @@
default:
break
}
getFileLis(this.fileData.glbsm).then(res => {
getFileLis(this.lpbParent ? this.$store.state.hbsm : this.fileData.glbsm).then(res => {
if (res.success) {
this.list = res.result;
} else {
......
......@@ -7,7 +7,7 @@
<djb v-if="djbVisible" :style="{'height' : formHeight+'px'}"></djb>
</el-tab-pane>
<el-tab-pane label="附件材料" name="fjcl">
<fjcl v-if="fjclVisible" ref="fjcl" :style="{'height' : formHeight+'px'}" :is-disabled="isDisabled"></fjcl>
<fjcl v-if="fjclVisible" ref="fjcl" :lpbParent="true" :style="{'height' : formHeight+'px'}" :is-disabled="isDisabled"></fjcl>
</el-tab-pane>
</el-tabs>
</template>
......@@ -22,6 +22,9 @@
components: {
hbj, djb, fjcl
},
props:{
bsm:String, //户标识码
},
data() {
return {
isDisabled:false,
......@@ -37,7 +40,6 @@
},
methods: {
loadingStatus() {
debugger
let bsm=this.$store.state.hbsm;
queryStatus(bsm).then(res => {
if (res.success) {
......
......@@ -83,14 +83,14 @@
label="7"
border
@click="batchDelete"
><i class="iconfont iconhuzhongxinlazong"></i>批量删除</el-button
><i class="iconfont iconshanchu"></i>批量删除</el-button
>
<el-button
class="radioBtn"
label="7"
border
@click="batchUpload"
><i class="iconfont iconhuzhongxinlazong"></i>批量上传</el-button
><i class="iconfont iconshangchuan"></i>批量上传</el-button
>
</div>
</el-col>
......@@ -276,6 +276,33 @@
<pl-zl :pl-zl-visible="plzlVisible" :bsms="bsms" @close="plZlClose" @lodding="lodding"></pl-zl>
<pl-c :plc-visible="plcVisible" :bsms="cbsmList" @close="plcClose" @lodding="lodding"></pl-c>
<pl-sh :plShVisible="plShVisible" :bsms="bsms" @close="plshClose" @lodding="lodding"></pl-sh>
<el-dialog v-dialogDrag :close-on-click-modal="false" title="批量上传" :visible.sync="uploadVisible" width="30%" >
<div class="wrap">
<div class="main-button">
<el-upload
class="upload-demo"
action="/api/file/uploadListByGlbsm"
:data="fileData"
:on-preview="handlePreview"
:on-remove="handleRemove"
:before-remove="beforeRemove"
:on-success="uploadSuccess"
:on-error="uploadError"
:show-file-list="false"
multiple
:limit="1"
:on-exceed="handleExceed"
>
<el-button type="primary" icon="iconfont iconshangchuan">上传附件</el-button>
</el-upload>
</div>
<el-button type="primary" class="download" @click="uploadVisible = false"
>取消</el-button>
</div>
<span slot="footer" class="dialog-footer">
</span>
</el-dialog>
</div>
</template>
......@@ -398,6 +425,11 @@ export default {
taskTitle:'添加',
curBsm:'',
qsztList:[],
uploadVisible:false, //批量上传弹框
fileData:{
glbsmList:[],
dylx:'h'
}
};
},
created() {
......@@ -438,7 +470,8 @@ export default {
}
},
//批量删除
batchDelete(){ if (this.bsms.length <= 0) {
batchDelete(){
if (this.bsms.length <= 0) {
Message.warning("请选择操作户")
return
}else{
......@@ -456,6 +489,39 @@ export default {
}
}
},
//批量上传 start
batchUpload(){
if (this.bsms.length < 1 ) {
Message.warning("请选择操作户")
return
}else{
this.uploadVisible = true
}
},
uploadError(err, file, fileList) {
Message.error("上传文件失败")
console.log("上传文件失败", err)
},
uploadSuccess(res, file, fileList) {
Message.success("上传成功")
this.uploadVisible = false;
},
handleRemove(file, fileList) {
console.log(file, fileList);
},
handlePreview(file) {
console.log(file);
},
handleExceed(files, fileList) {
console.log(fileList)
// this.$message.warning(`当前限制选择 3 个文件,本次选择了 ${files.length} 个文件,共选择了 ${files.length + fileList.length} 个文件`);
this.$message.warning("上传失败")
},
beforeRemove(file, fileList) {
return this.$confirm(`确定移除 ${ file.name }?`);
},
//批量上传 end
loading(){
this.getLpbMenuTree(this.$store.state.zrzbsm);
},
......@@ -859,6 +925,10 @@ export default {
selectedZt(n){
this.legendToggleFlag = true;
},
bsms(n){
this.fileData.glbsmList = n;
console.log(this.fileData,'filedata');
}
},
};
</script>
......@@ -1033,5 +1103,25 @@ export default {
.fa{
padding-right: 4px;
}
.wrap{
width: 100%;
height: 30px;
position: relative;
.main-button {
display: -webkit-flex;
display: flex;
flex-direction: column-reverse;
flex-wrap: nowrap;
position: absolute;
left: 165px;
top: 18px;
}
.download{
position: absolute;
left: 312px;
top: 19px;
}
}
}
</style>
......