|
@ -61,10 +61,10 @@ |
|
|
type="primary">导入</el-button> |
|
|
type="primary">导入</el-button> |
|
|
</el-upload> |
|
|
</el-upload> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
<!-- <el-form-item>--> |
|
|
|
|
|
<!-- <el-button type="primary"--> |
|
|
<el-form-item> |
|
|
<!-- @click="updateMa">更新数据码</el-button>--> |
|
|
<el-button type="primary" @click="exports()">一户一码</el-button> |
|
|
<!-- </el-form-item>--> |
|
|
</el-form-item> |
|
|
</el-form> |
|
|
</el-form> |
|
|
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|
|
<el-table v-loading="dataListLoading" :data="dataList" border @selection-change="dataListSelectionChangeHandle" style="width: 100%;"> |
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> |
|
|
<el-table-column type="selection" header-align="center" align="center" width="50"></el-table-column> |
|
@ -135,6 +135,27 @@ |
|
|
@click="exportError">导出错误数据</el-button> |
|
|
@click="exportError">导出错误数据</el-button> |
|
|
</template> |
|
|
</template> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
<el-dialog title="一户一码" :visible.sync="dialogVisibleExcel" width="30%"> |
|
|
|
|
|
<div style="text-align: center"> |
|
|
|
|
|
<el-form class="but-sty" inline label-width="90px"> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
@click="updateMa">数据初始化</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" |
|
|
|
|
|
@click="updateMaUrl">一户一码生成</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
<el-form-item> |
|
|
|
|
|
<el-button type="primary" v-loading="zLoading" |
|
|
|
|
|
@click="downloadUrl">一户一码下载</el-button> |
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
</el-form> |
|
|
|
|
|
</div> |
|
|
|
|
|
<span slot="footer" class="dialog-footer"> |
|
|
|
|
|
<el-button @click="dialogVisibleExcel = false">取 消</el-button> |
|
|
|
|
|
</span> |
|
|
|
|
|
</el-dialog> |
|
|
</div> |
|
|
</div> |
|
|
</el-card> |
|
|
</el-card> |
|
|
</template> |
|
|
</template> |
|
@ -155,7 +176,9 @@ export default { |
|
|
deleteIsBatch: true, |
|
|
deleteIsBatch: true, |
|
|
exportErrorInfoURL: '/custom/epidemicusererror/export' |
|
|
exportErrorInfoURL: '/custom/epidemicusererror/export' |
|
|
}, |
|
|
}, |
|
|
|
|
|
uploadUrl: '', |
|
|
options: [], |
|
|
options: [], |
|
|
|
|
|
zLoading: false, |
|
|
faultDataVisible: false, |
|
|
faultDataVisible: false, |
|
|
errordataList: [], |
|
|
errordataList: [], |
|
|
deptIdListUpload: [], |
|
|
deptIdListUpload: [], |
|
@ -164,7 +187,8 @@ export default { |
|
|
dataForm: { |
|
|
dataForm: { |
|
|
id: '' |
|
|
id: '' |
|
|
}, |
|
|
}, |
|
|
uploadUrl: '' |
|
|
exportTemplate: false, |
|
|
|
|
|
dialogVisibleExcel: false, |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
components: { |
|
|
components: { |
|
@ -185,6 +209,11 @@ export default { |
|
|
this.getOptions() |
|
|
this.getOptions() |
|
|
}, |
|
|
}, |
|
|
methods: { |
|
|
methods: { |
|
|
|
|
|
// 打开导出弹框 |
|
|
|
|
|
exports () { |
|
|
|
|
|
this.exportDisable = false |
|
|
|
|
|
this.dialogVisibleExcel = true |
|
|
|
|
|
}, |
|
|
getOptions () { |
|
|
getOptions () { |
|
|
this.$http |
|
|
this.$http |
|
|
.get(`/sys/user/deptOptions/getByLoginUser`) |
|
|
.get(`/sys/user/deptOptions/getByLoginUser`) |
|
@ -271,6 +300,54 @@ export default { |
|
|
} |
|
|
} |
|
|
}).catch(() => {}) |
|
|
}).catch(() => {}) |
|
|
}, |
|
|
}, |
|
|
|
|
|
updateMaUrl () { |
|
|
|
|
|
this.$http.post(`/custom/epidemicbuildingunit/createBatchHouseCodeAndUrl`).then(({ data: res }) => { |
|
|
|
|
|
if (res.code !== 0) { |
|
|
|
|
|
return this.$message.error(res.msg) |
|
|
|
|
|
} |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
downloadUrl () { |
|
|
|
|
|
this.zLoading = true |
|
|
|
|
|
this.$http( |
|
|
|
|
|
{ method: 'post', |
|
|
|
|
|
url: '/custom/epidemicbuildingunit/downloadZip', |
|
|
|
|
|
responseType: 'blob'}).then(({ data: res }) => { |
|
|
|
|
|
if (!res) { |
|
|
|
|
|
this.zLoading = false |
|
|
|
|
|
return this.$message.error("下载失败,请联系关系管理员") |
|
|
|
|
|
} |
|
|
|
|
|
let title = '一户一码' |
|
|
|
|
|
this.download(res, title + '.Zip') |
|
|
|
|
|
}).catch(() => {}) |
|
|
|
|
|
}, |
|
|
|
|
|
// 下载文件 |
|
|
|
|
|
download (data, downFileName) { |
|
|
|
|
|
if (!data) { |
|
|
|
|
|
this.zLoading = false |
|
|
|
|
|
return |
|
|
|
|
|
} |
|
|
|
|
|
console.log('一户一码下载中...') |
|
|
|
|
|
var csvData = new Blob([data]) |
|
|
|
|
|
|
|
|
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|
|
|
|
|
window.navigator.msSaveOrOpenBlob(csvData, downFileName); |
|
|
|
|
|
} |
|
|
|
|
|
// for Non-IE (chrome, firefox etc.) |
|
|
|
|
|
else { |
|
|
|
|
|
var a = document.createElement('a'); |
|
|
|
|
|
document.body.appendChild(a); |
|
|
|
|
|
a.style = 'display: none'; |
|
|
|
|
|
var url = window.URL.createObjectURL(csvData); |
|
|
|
|
|
a.href = url; |
|
|
|
|
|
a.download = downFileName; |
|
|
|
|
|
a.click(); |
|
|
|
|
|
a.remove(); |
|
|
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
|
|
} |
|
|
|
|
|
this.zLoading = false |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
downloadMa (id) { |
|
|
downloadMa (id) { |
|
|
this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}, { responseType: 'blob' }).then(res => { |
|
|
this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}, { responseType: 'blob' }).then(res => { |
|
|
let fileName = '房屋二维码.png' |
|
|
let fileName = '房屋二维码.png' |
|
|