+
+
+
+ 数据初始化
+
+
+ 一户一码生成
+
+
+ 一户一码下载
+
+
+
+
+
@@ -155,7 +176,9 @@ export default {
deleteIsBatch: true,
exportErrorInfoURL: '/custom/epidemicusererror/export'
},
+ uploadUrl: '',
options: [],
+ zLoading: false,
faultDataVisible: false,
errordataList: [],
deptIdListUpload: [],
@@ -164,7 +187,8 @@ export default {
dataForm: {
id: ''
},
- uploadUrl: ''
+ exportTemplate: false,
+ dialogVisibleExcel: false,
}
},
components: {
@@ -185,6 +209,11 @@ export default {
this.getOptions()
},
methods: {
+ // 打开导出弹框
+ exports () {
+ this.exportDisable = false
+ this.dialogVisibleExcel = true
+ },
getOptions () {
this.$http
.get(`/sys/user/deptOptions/getByLoginUser`)
@@ -271,6 +300,54 @@ export default {
}
}).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) {
this.$http.post(`/custom/epidemicbuildingunit/createHouseQrcode`, {id: id}, { responseType: 'blob' }).then(res => {
let fileName = '房屋二维码.png'