Browse Source

Merge branch 'feature/dev_sunjiatan'

shibei_master
YUJT 3 years ago
parent
commit
f7552ed28e
  1. 125
      src/views/modules/base/community/communityTable.vue
  2. 18
      src/views/modules/base/community/roomForm.vue

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

@ -2,6 +2,12 @@
<div>
<div class="div_btn">
<el-button v-if="showYhymInfo"
style=""
class="diy-button--reset"
size="small"
:loading="yhymLoading"
@click="handleYhymInfo">补全一户一码信息</el-button>
<el-button style=""
class="diy-button--add"
size="small"
@ -66,7 +72,7 @@
<el-button style="margin-left:10px"
class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>
@click="handleExportOpen">导出</el-button>
<el-button v-if="agencyObj.level == 'community'"
style="margin-left:10px"
class="diy-button--qrcode"
@ -76,11 +82,11 @@
class="diy-button--more"
size="small"
@click="deleteBatch">批量删除</el-button>
<el-button style=";margin-left:10px"
<!-- <el-button style=";margin-left:10px"
class="diy-button--export"
size="small"
:disabled="yihuyidangDisabled"
@click="handleExportYihuyidang()">导出一户一档</el-button>
@click="handleExportYihuyidang()">导出一户一档</el-button> -->
</div>
@ -183,6 +189,31 @@
@dialogOk="addFormOk"></community-form>
</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>
</template>
@ -208,6 +239,9 @@ export default {
tableLoading: true,
showImportBtn: false,//
roleList: [],//
showYhymInfo: false, //
yhymLoading: false,
agencyObj: {},//
@ -225,7 +259,9 @@ export default {
fileName: "",
uploadUlr: window.SITE_CONFIG['apiURL'] + '/gov/org/neighborhood/import',
yihuyidangDisabled: false,
yihuyimaDisabled: false,
exportBtn: false,
dialogVisible: false //
}
},
components: {
@ -246,7 +282,13 @@ export default {
async loadTable (fromTree, treeObj) {
console.log(111, this.staffAgencyId)
//
this.roleList = localStorage.getItem('roleList')
if (this.roleList.indexOf('root_manager') > -1 || this.roleList.indexOf('manager') > -1) {
this.showYhymInfo = true
} else {
this.showYhymInfo = false
}
this.tableLoading = true
if (fromTree) {
this.agencyObj = treeObj
@ -330,6 +372,34 @@ export default {
})
},
//
async handleYhymInfo () {
this.yhymLoading = true
const url = "/gov/org/house/createBatchHouseCodeAndUrl"
let params = {}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.yhymLoading = false
this.$message({
type: "success",
message: "批量生成成功"
});
} else if (code > 8000) {
this.yhymLoading = false
this.$message({
showClose: true,
message: msg,
duration: 0
})
} else {
this.yhymLoading = false
this.$message.error(msg)
}
},
handleEdit (row) {
this.formTitle = '修改小区'
this.formShow = true
@ -486,7 +556,11 @@ export default {
// this.download(res.data, '1.png')
})
},
//
//
handleExportOpen () {
this.dialogVisible = true
},
//
async handleExport () {
let title = this.agencyObj.label
title = title + '—小区列表'
@ -512,6 +586,10 @@ export default {
},
handleClose(done) {
this.dialogVisible = false
},
//
download (data, downFileName) {
if (!data) {
@ -613,6 +691,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) {

18
src/views/modules/base/community/roomForm.vue

@ -40,6 +40,21 @@
</el-input>
</el-form-item>
<div v-if="formType === 'detail'">
<el-form-item label="房屋编码"
prop="houseCode"
label-width="150px"
style="display: block">
<el-input class="item_width_1"
maxlength="30"
v-model="dataForm.houseCode">
</el-input>
</el-form-item>
<div v-if="dataForm.houseQrcodeUrl" style="display: flex;flex-direction: column;">
<img style="margin-left: 70px;width: 200px;" :src="dataForm.houseQrcodeUrl">
<a style="margin-left: 80px" :href="dataForm.houseQrcodeUrl" target="_blank">下载</a>
</div>
</div>
<el-form-item label="房屋类型"
prop="houseType"
label-width="150px"
@ -351,6 +366,9 @@
if (loading) {
loading.close()
}
},
clickQrcodeUrl (url) {
window.URL.revokeObjectURL(url);
}
},
computed: {

Loading…
Cancel
Save