|
|
@ -38,13 +38,10 @@ |
|
|
|
<el-form-item> |
|
|
|
<el-button v-if="$hasPermission(':epidemicbuildingunit:delete')" type="danger" @click="deleteHandle()">{{ $t('deleteBatch') }}</el-button> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary"> |
|
|
|
<a :href="`https://epdc-yushan.elinkservice.cn/epdc-admin/fang.xlsx`" |
|
|
|
target="_blank" |
|
|
|
download="人房信息表.xlsx" |
|
|
|
style="color: #ffffff">{{ $t('exportTemplate') }}</a> |
|
|
|
</el-button> |
|
|
|
<el-button type="primary" |
|
|
|
@click="templateSelect">导入模板</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="导入网格" |
|
|
|
label-width="90px"> |
|
|
@ -57,7 +54,11 @@ |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" |
|
|
|
@click="beforeImportUser">导入</el-button> |
|
|
|
@click="beforeImportUser">人房导入</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" |
|
|
|
@click="beforeImportHouse">房屋导入</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-upload ref="upload" |
|
|
@ -67,10 +68,20 @@ |
|
|
|
:on-error='errorExceed'> |
|
|
|
<el-button id="importBut" |
|
|
|
style="display: none" |
|
|
|
type="primary">导入</el-button> |
|
|
|
type="primary">人房导入</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-upload ref="uploadHouse" |
|
|
|
:action="uploadHouseUrl" |
|
|
|
:limit="1" |
|
|
|
:on-success='uploadHouseSuccess' |
|
|
|
:on-error='errorHouseExceed'> |
|
|
|
<el-button id="importHouseBut" |
|
|
|
style="display: none" |
|
|
|
type="primary">房屋导入</el-button> |
|
|
|
</el-upload> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="exports()">一户一码</el-button> |
|
|
|
</el-form-item> |
|
|
@ -144,7 +155,7 @@ |
|
|
|
@click="exportError">导出错误数据</el-button> |
|
|
|
</template> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="一户一码" :visible.sync="dialogVisibleExcel" width="30%"> |
|
|
|
<el-dialog title="一户一码" :visible.sync="dialogVisibleExcel" width="35%"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<el-form class="but-sty" inline label-width="90px"> |
|
|
|
<el-form-item> |
|
|
@ -179,6 +190,31 @@ |
|
|
|
<el-button @click="dialogVisibleExcel = false">取 消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="导出选择" :visible.sync="dialogVisibleTemplate" width="30%"> |
|
|
|
<div style="text-align: center"> |
|
|
|
<el-form class="but-sty" inline label-width="90px"> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary"> |
|
|
|
<a :href="`https://epdc-yushan.elinkservice.cn/epdc-admin/renfang.xlsx`" |
|
|
|
target="_blank" |
|
|
|
download="人房信息表.xlsx" |
|
|
|
style="color: #ffffff">人房信息模板</a> |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary"> |
|
|
|
<a :href="`https://epdc-yushan.elinkservice.cn/epdc-admin/fangwu.xlsx`" |
|
|
|
target="_blank" |
|
|
|
download="房屋信息表.xlsx" |
|
|
|
style="color: #ffffff">房屋信息模板</a> |
|
|
|
</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
<el-button @click="dialogVisibleTemplate = false">取 消</el-button> |
|
|
|
</span> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</el-card> |
|
|
|
</template> |
|
|
@ -200,6 +236,7 @@ export default { |
|
|
|
exportErrorInfoURL: '/custom/epidemicusererror/export4Room' |
|
|
|
}, |
|
|
|
uploadUrl: '', |
|
|
|
uploadHouseUrl: '', |
|
|
|
options: [], |
|
|
|
zLoading: false, |
|
|
|
faultDataVisible: false, |
|
|
@ -213,6 +250,7 @@ export default { |
|
|
|
id: '' |
|
|
|
}, |
|
|
|
exportTemplate: false, |
|
|
|
dialogVisibleTemplate: false, |
|
|
|
dialogVisibleExcel: false, |
|
|
|
} |
|
|
|
}, |
|
|
@ -225,6 +263,8 @@ export default { |
|
|
|
this.gridIdImport = val[val.length - 1] |
|
|
|
this.uploadUrl = `${window.SITE_CONFIG['apiURL']}/custom/epidemicbuildingunit/importHouse?token= |
|
|
|
${Cookies.get('token')}&gridId=` + val[val.length - 1] |
|
|
|
this.uploadHouseUrl = `${window.SITE_CONFIG['apiURL']}/custom/epidemicbuildingunit/importHouseSimple?token= |
|
|
|
${Cookies.get('token')}&gridId=` + val[val.length - 1] |
|
|
|
} else { |
|
|
|
this.gridIdImport = '' |
|
|
|
} |
|
|
@ -316,10 +356,31 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
uploadHouseSuccess (response, file, fileList) { |
|
|
|
this.uploeadLoeading = false |
|
|
|
this.$refs.uploadHouse.clearFiles() |
|
|
|
if (response.code === 0) { |
|
|
|
this.$message({ |
|
|
|
message: response.data, |
|
|
|
type: 'success', |
|
|
|
duration: 5000, |
|
|
|
onClose: () => { |
|
|
|
this.getDataList() |
|
|
|
} |
|
|
|
}) |
|
|
|
this.getDataList() |
|
|
|
return |
|
|
|
} |
|
|
|
this.$message.error('上传失败请重试') |
|
|
|
}, |
|
|
|
errorExceed (file, fileList) { |
|
|
|
this.uploeadLoeading = false |
|
|
|
this.$message.error('上传失败请重试') |
|
|
|
}, |
|
|
|
errorHouseExceed (file, fileList) { |
|
|
|
this.uploeadLoeading = false |
|
|
|
this.$message.error('上传失败请重试') |
|
|
|
}, |
|
|
|
updateMa () { |
|
|
|
this.$http.post(`/custom/epidemicbuildingunit/updateMaCode`).then(({ data: res }) => { |
|
|
|
if (res.code !== 0) { |
|
|
@ -412,7 +473,9 @@ export default { |
|
|
|
} |
|
|
|
this.zLoading = false |
|
|
|
}, |
|
|
|
|
|
|
|
templateSelect () { |
|
|
|
this.dialogVisibleTemplate = true |
|
|
|
}, |
|
|
|
downloadMa (id) { |
|
|
|
this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}, { responseType: 'blob' }).then(res => { |
|
|
|
let fileName = '房屋二维码.png' |
|
|
@ -455,6 +518,26 @@ export default { |
|
|
|
}).then(() => { |
|
|
|
document.getElementById('importBut').click() |
|
|
|
}).catch(() => { }) |
|
|
|
}, |
|
|
|
beforeImportHouse () { |
|
|
|
//所属组织全都不选,直接上传 |
|
|
|
if (this.gridIdImport === '' || this.gridIdImport === undefined) { |
|
|
|
this.$message({ |
|
|
|
type: 'warning', |
|
|
|
message: '请先选择网格' |
|
|
|
}); |
|
|
|
return false |
|
|
|
} |
|
|
|
//选中网格 |
|
|
|
let selectGird = this.$refs['deptTree'].getCheckedNodes()[0].label |
|
|
|
|
|
|
|
this.$confirm(`确定将房屋导入到${selectGird}?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
document.getElementById('importHouseBut').click() |
|
|
|
}).catch(() => { }) |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|