|
@ -122,9 +122,10 @@ |
|
|
style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
|
size="small" |
|
|
size="small" |
|
|
class="diy-button--white" |
|
|
class="diy-button--white" |
|
|
@click="diyExport" |
|
|
@click="handleExport" |
|
|
|
|
|
:loading="exportLoading" |
|
|
plain |
|
|
plain |
|
|
>导出</el-button |
|
|
>{{exportBtnTitle}}</el-button |
|
|
> |
|
|
> |
|
|
<!-- <el-button v-if="btnAuths.ic_resi_export" |
|
|
<!-- <el-button v-if="btnAuths.ic_resi_export" |
|
|
style="margin-left: 10px" |
|
|
style="margin-left: 10px" |
|
@ -347,22 +348,6 @@ |
|
|
<resi-change-record ref="ref_changerecord"></resi-change-record> |
|
|
<resi-change-record ref="ref_changerecord"></resi-change-record> |
|
|
</el-dialog> |
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
<el-dialog |
|
|
|
|
|
:visible.sync="diyDialog" |
|
|
|
|
|
:close-on-click-modal="false" |
|
|
|
|
|
:close-on-press-escape="false" |
|
|
|
|
|
width="1150px" |
|
|
|
|
|
top="5vh" |
|
|
|
|
|
class="dialog-h" |
|
|
|
|
|
> |
|
|
|
|
|
<diy-info |
|
|
|
|
|
v-if="diyDialog" |
|
|
|
|
|
ref="ref_diy" |
|
|
|
|
|
:list="exportList" |
|
|
|
|
|
:search="searchForm" |
|
|
|
|
|
@close="handleDiyClose" |
|
|
|
|
|
></diy-info> |
|
|
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
|
|
|
|
<baobiao ref="baobiao" /> |
|
|
<baobiao ref="baobiao" /> |
|
|
|
|
|
|
|
@ -433,7 +418,6 @@ import resiTransfer from "../../components/resiTransfer.vue"; |
|
|
import resiChangeRecord from "../../components/resiChangeRecord.vue"; |
|
|
import resiChangeRecord from "../../components/resiChangeRecord.vue"; |
|
|
|
|
|
|
|
|
import baobiao from "@/views/modules/cpts/baobiao"; |
|
|
import baobiao from "@/views/modules/cpts/baobiao"; |
|
|
import diyInfo from "./diyInfo.vue"; |
|
|
|
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
import { requestPost, requestGet } from "@/js/dai/request"; |
|
|
import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
import { Loading } from "element-ui"; // 引入Loading服务 |
|
|
|
|
|
|
|
@ -448,14 +432,13 @@ export default { |
|
|
resiInfo, |
|
|
resiInfo, |
|
|
resiTransfer, |
|
|
resiTransfer, |
|
|
resiChangeRecord, |
|
|
resiChangeRecord, |
|
|
diyInfo, |
|
|
|
|
|
resiChangeTransfer, |
|
|
resiChangeTransfer, |
|
|
resideathAdd, |
|
|
resideathAdd, |
|
|
}, |
|
|
}, |
|
|
data() { |
|
|
data() { |
|
|
return { |
|
|
return { |
|
|
showSercahStatus: false, |
|
|
showSercahStatus: false, |
|
|
diyDialog: false, |
|
|
exportLoading:false, |
|
|
exportBtn: false, |
|
|
exportBtn: false, |
|
|
exportBtnTitle: "导出", |
|
|
exportBtnTitle: "导出", |
|
|
importBtnTitle: "导入", |
|
|
importBtnTitle: "导入", |
|
@ -495,7 +478,6 @@ export default { |
|
|
activeName: "", |
|
|
activeName: "", |
|
|
tableData: [], |
|
|
tableData: [], |
|
|
searchList: [], |
|
|
searchList: [], |
|
|
exportList: [], |
|
|
|
|
|
|
|
|
|
|
|
treeData: [], |
|
|
treeData: [], |
|
|
autoOpenArr: [], |
|
|
autoOpenArr: [], |
|
@ -735,14 +717,7 @@ export default { |
|
|
this.deathShow = false; |
|
|
this.deathShow = false; |
|
|
this.handleSearchFrom(); |
|
|
this.handleSearchFrom(); |
|
|
}, |
|
|
}, |
|
|
handleDiyClose() { |
|
|
|
|
|
this.diyDialog = false; |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async diyExport() { |
|
|
|
|
|
await this.getExportList(); |
|
|
|
|
|
console.log(this.$refs[""]); |
|
|
|
|
|
}, |
|
|
|
|
|
computedWidth(label, type) { |
|
|
computedWidth(label, type) { |
|
|
let wd = ""; |
|
|
let wd = ""; |
|
|
if (type == "input" || type == "select") wd = 40 * label.length; |
|
|
if (type == "input" || type == "select") wd = 40 * label.length; |
|
@ -842,15 +817,36 @@ export default { |
|
|
this.$refs.myResiSearch.level = ""; |
|
|
this.$refs.myResiSearch.level = ""; |
|
|
this.getTableData(); |
|
|
this.getTableData(); |
|
|
}, |
|
|
}, |
|
|
async handleExportModule() { |
|
|
async handleExport() { |
|
|
let url = "/epmetuser/icresiuser/import/download-template"; |
|
|
this.exportLoading = true; |
|
|
|
|
|
this.exportBtnTitle = '正在导出中' |
|
|
|
|
|
let url = "/actual/base/residentBaseInfo/fixedExport "; |
|
|
|
|
|
// 使用解构赋值获取需要的属性 |
|
|
|
|
|
const { categoryKey, agencyId, level } = this.$refs.myResiSearch.form; |
|
|
|
|
|
// 深复制对象 |
|
|
|
|
|
let _obj = JSON.parse(JSON.stringify(this.$refs.myResiSearch.form)); |
|
|
|
|
|
// 处理 categoryKey |
|
|
|
|
|
if (Array.isArray(categoryKey) && categoryKey.length) { |
|
|
|
|
|
_obj.categoryKey = categoryKey.join(","); |
|
|
|
|
|
} else { |
|
|
|
|
|
_obj.categoryKey = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 处理 agencyId |
|
|
|
|
|
if (Array.isArray(agencyId) && agencyId.length) { |
|
|
|
|
|
_obj.agencyId = agencyId[agencyId.length - 1]; |
|
|
|
|
|
} else { |
|
|
|
|
|
_obj.agencyId = ""; |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
let params = {}; |
|
|
_obj.level = level || ""; |
|
|
|
|
|
_obj.orgType = level || ""; |
|
|
|
|
|
_obj = { ..._obj, ...this.searchAgencyObj }; |
|
|
await this.$http({ |
|
|
await this.$http({ |
|
|
method: "POST", |
|
|
method: "POST", |
|
|
url, |
|
|
url, |
|
|
responseType: "blob", |
|
|
responseType: "blob", |
|
|
data: params, |
|
|
data: _obj, |
|
|
}) |
|
|
}) |
|
|
.then((res) => { |
|
|
.then((res) => { |
|
|
console.log("res----dddd", res); |
|
|
console.log("res----dddd", res); |
|
@ -873,9 +869,14 @@ export default { |
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
} else this.$message.error("下载失败"); |
|
|
} else this.$message.error("下载失败"); |
|
|
|
|
|
this.exportLoading = false; |
|
|
|
|
|
this.exportBtnTitle = '导出' |
|
|
}) |
|
|
}) |
|
|
.catch((err) => { |
|
|
.catch((err) => { |
|
|
console.log("err", err); |
|
|
console.log("err", err); |
|
|
|
|
|
this.exportLoading = false; |
|
|
|
|
|
this.exportBtnTitle = '导出' |
|
|
|
|
|
|
|
|
return this.$message.error("网络错误"); |
|
|
return this.$message.error("网络错误"); |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
@ -902,47 +903,7 @@ export default { |
|
|
window.URL.revokeObjectURL(url); |
|
|
window.URL.revokeObjectURL(url); |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
async handleExport() { |
|
|
|
|
|
this.exportBtn = true; |
|
|
|
|
|
this.exportBtnTitle = "正在导出..."; |
|
|
|
|
|
let params = { |
|
|
|
|
|
formCode: "resident_base_info", |
|
|
|
|
|
conditions: this.conditions, |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
// .post('epmetuser/icresiuser/exportExcel', params) |
|
|
|
|
|
await axios({ |
|
|
|
|
|
url: window.SITE_CONFIG["apiURL"] + "/epmetuser/icresiuser/exportExcel", |
|
|
|
|
|
method: "post", |
|
|
|
|
|
data: params, |
|
|
|
|
|
responseType: "blob", |
|
|
|
|
|
}) |
|
|
|
|
|
.then((res) => { |
|
|
|
|
|
console.log("resllll", res); |
|
|
|
|
|
let fileName = window.decodeURI( |
|
|
|
|
|
res.headers["content-disposition"].split(";")[1].split("=")[1] |
|
|
|
|
|
); |
|
|
|
|
|
console.log("filename", fileName); |
|
|
|
|
|
let blob = new Blob([res.data], { |
|
|
|
|
|
type: "application/vnd.ms-excel", |
|
|
|
|
|
}); |
|
|
|
|
|
var url = window.URL.createObjectURL(blob); |
|
|
|
|
|
var aLink = document.createElement("a"); |
|
|
|
|
|
aLink.style.display = "none"; |
|
|
|
|
|
aLink.href = url; |
|
|
|
|
|
aLink.setAttribute("download", fileName); |
|
|
|
|
|
document.body.appendChild(aLink); |
|
|
|
|
|
aLink.click(); |
|
|
|
|
|
document.body.removeChild(aLink); //下载完成移除元素 |
|
|
|
|
|
window.URL.revokeObjectURL(url); //释放掉blob对象 |
|
|
|
|
|
}) |
|
|
|
|
|
.catch((err) => { |
|
|
|
|
|
console.log("获取导出情失败", err); |
|
|
|
|
|
this.$message.error("获取导出失败"); |
|
|
|
|
|
}); |
|
|
|
|
|
this.exportBtnTitle = "导出"; |
|
|
|
|
|
this.exportBtn = false; |
|
|
|
|
|
}, |
|
|
|
|
|
// 上传大图标成功 |
|
|
// 上传大图标成功 |
|
|
handleExcelSuccess(res, file) { |
|
|
handleExcelSuccess(res, file) { |
|
|
if (res.code === 0 && res.msg === "success") { |
|
|
if (res.code === 0 && res.msg === "success") { |
|
@ -1069,7 +1030,7 @@ export default { |
|
|
}); |
|
|
}); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async handleAdd() { |
|
|
handleAdd() { |
|
|
this.$router.push({ name: "add-resi" }); |
|
|
this.$router.push({ name: "add-resi" }); |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
@ -1131,29 +1092,6 @@ export default { |
|
|
return options; |
|
|
return options; |
|
|
}, |
|
|
}, |
|
|
|
|
|
|
|
|
async getExportList(type) { |
|
|
|
|
|
const url = "/oper/customize/icformitemgroup/list"; |
|
|
|
|
|
let params = { |
|
|
|
|
|
formCode: "resident_base_info", |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params); |
|
|
|
|
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
|
|
data.forEach((item) => { |
|
|
|
|
|
(async (id) => { |
|
|
|
|
|
item.queryItemList = []; |
|
|
|
|
|
})(item.id); |
|
|
|
|
|
}); |
|
|
|
|
|
this.exportList = [...data]; |
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
|
|
this.diyDialog = true; |
|
|
|
|
|
}); |
|
|
|
|
|
console.log("获取详情成功getExportList----", this.exportList); |
|
|
|
|
|
} else { |
|
|
|
|
|
this.$message.error(msg); |
|
|
|
|
|
} |
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
async deleteresiBatch() { |
|
|
async deleteresiBatch() { |
|
|
if (this.selection.length === 0) |
|
|
if (this.selection.length === 0) |
|
|