Browse Source

导出

shibei_master
zhaoyongnian 3 years ago
parent
commit
6ad7505d2a
  1. 80
      src/views/modules/base/community/communityTable.vue

80
src/views/modules/base/community/communityTable.vue

@ -66,7 +66,7 @@
<el-button style="margin-left:10px" <el-button style="margin-left:10px"
class="diy-button--reset" class="diy-button--reset"
size="small" size="small"
@click="handleExport">导出</el-button> @click="handleExportOpen">导出</el-button>
<el-button v-if="agencyObj.level == 'community'" <el-button v-if="agencyObj.level == 'community'"
style="margin-left:10px" style="margin-left:10px"
class="diy-button--qrcode" class="diy-button--qrcode"
@ -76,11 +76,11 @@
class="diy-button--more" class="diy-button--more"
size="small" size="small"
@click="deleteBatch">批量删除</el-button> @click="deleteBatch">批量删除</el-button>
<el-button style=";margin-left:10px" <!-- <el-button style=";margin-left:10px"
class="diy-button--export" class="diy-button--export"
size="small" size="small"
:disabled="yihuyidangDisabled" :disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button> @click="handleExportYihuyidang()">导出一户一档</el-button> -->
</div> </div>
@ -183,6 +183,31 @@
@dialogOk="addFormOk"></community-form> @dialogOk="addFormOk"></community-form>
</el-dialog> </el-dialog>
<el-dialog
title="导出"
:visible.sync="dialogVisible"
width="30%"
:before-close="handleClose">
<div>
<el-button class="diy-button--reset"
size="small"
@click="handleExport">导出房屋数据</el-button>
<el-button class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
<el-button class="diy-button--qrcode"
size="small"
:disabled="yihuyimaDisabled"
:loading="exportBtn"
@click="handleExportYihuyima()">导出一户一码</el-button>
</div>
<span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible = false"> </el-button>
<el-button type="primary" @click="dialogVisible = false"> </el-button>
</span>
</el-dialog>
</div> </div>
</template> </template>
@ -225,7 +250,9 @@ export default {
fileName: "", fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import', uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import',
yihuyidangDisabled: false, yihuyidangDisabled: false,
yihuyimaDisabled: false,
exportBtn: false,
dialogVisible: false //
} }
}, },
components: { components: {
@ -486,7 +513,11 @@ export default {
// this.download(res.data, '1.png') // this.download(res.data, '1.png')
}) })
}, },
// //
handleExportOpen () {
this.dialogVisible = true
},
//
async handleExport () { async handleExport () {
let title = this.agencyObj.label let title = this.agencyObj.label
title = title + '—小区列表' title = title + '—小区列表'
@ -512,6 +543,10 @@ export default {
}, },
handleClose(done) {
this.dialogVisible = false
},
// //
download (data, downFileName) { download (data, downFileName) {
if (!data) { if (!data) {
@ -609,6 +644,41 @@ export default {
}, },
//
handleExportYihuyima () {
this.exportBtn = true
this.yihuyimaDisabled = true
let title = this.agencyObj.label
title = title + '-一户一码'
let url = "/gov/org/house/downloadZip"
let params = {
level: this.agencyObj.level,
id: this.agencyObj.id
}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.Zip')
this.exportBtn = false
this.yihuyimaDisabled = false
},
(rspMsg, data) => {
this.exportBtn = false
this.yihuyimaDisabled = false
this.$message.error(rspMsg);
}
);
},
// //
beforeUpload (file, type) { beforeUpload (file, type) {

Loading…
Cancel
Save