|
|
@ -1,41 +1,47 @@ |
|
|
|
<template> |
|
|
|
<div class="div_main"> |
|
|
|
<div ref="div_search" class="div_search"> |
|
|
|
<div class="div_search"> |
|
|
|
<el-form :inline="true" |
|
|
|
:model="formData" |
|
|
|
ref="ref_searchform" |
|
|
|
:label-width="'90px'"> |
|
|
|
<div> |
|
|
|
|
|
|
|
<el-form-item label="姓名" |
|
|
|
prop="personInCharge"> |
|
|
|
<el-input v-model="formData.personInCharge" |
|
|
|
size="small" |
|
|
|
class="list_item_width_1" |
|
|
|
clearable |
|
|
|
placeholder="请输入姓名"> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
<el-form-item label="信息范围"> |
|
|
|
<el-select class="list_item_width_1" |
|
|
|
size="small" |
|
|
|
v-model.trim="formData.searchType" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in orgTypeList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="身份证" |
|
|
|
prop="mobile"> |
|
|
|
<el-input v-model="formData.mobile" |
|
|
|
size="small" |
|
|
|
class="list_item_width_1" |
|
|
|
clearable |
|
|
|
placeholder="请输入身份证"> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
<el-form-item label="本辖区居民"> |
|
|
|
<el-select class="list_item_width_1" |
|
|
|
size="small" |
|
|
|
:disabled="formData.searchType!='current'" |
|
|
|
v-model.trim="formData.isResiUser" |
|
|
|
placeholder="请选择"> |
|
|
|
<el-option v-for="item in isResiUserList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="接种时间" |
|
|
|
prop="scheduledStartTime"> |
|
|
|
label-width="110px" |
|
|
|
prop="startTime"> |
|
|
|
<el-date-picker v-model="timeRange" |
|
|
|
size="small" |
|
|
|
type="daterange" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
@change="handleScheduledTimeChange" |
|
|
|
type="datetimerange" |
|
|
|
@change="handleTimeChange" |
|
|
|
format="yyyy-MM-dd HH:mm" |
|
|
|
value-format="yyyy-MM-dd HH:mm" |
|
|
|
range-separator="至" |
|
|
|
start-placeholder="开始时间" |
|
|
|
end-placeholder="结束时间"> |
|
|
@ -43,22 +49,56 @@ |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-button style="margin-left:30px" |
|
|
|
size="small" |
|
|
|
class="diy-button--search" |
|
|
|
@click="handleSearch">查询</el-button> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
class="diy-button--reset" |
|
|
|
@click="resetSearch">重置</el-button> |
|
|
|
<div> |
|
|
|
<el-form-item label="姓名" |
|
|
|
prop="name"> |
|
|
|
<el-input v-model="formData.name" |
|
|
|
size="small" |
|
|
|
class="list_item_width_1" |
|
|
|
clearable |
|
|
|
placeholder="请输入姓名"> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="手机号" |
|
|
|
prop="mobile"> |
|
|
|
<el-input v-model="formData.mobile" |
|
|
|
size="small" |
|
|
|
class="list_item_width_1" |
|
|
|
clearable |
|
|
|
placeholder="请输入手机号"> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="身份证" |
|
|
|
prop="idCard"> |
|
|
|
<el-input v-model="formData.idCard" |
|
|
|
size="small" |
|
|
|
class="list_item_width_1" |
|
|
|
clearable |
|
|
|
placeholder="请输入身份证"> |
|
|
|
</el-input> |
|
|
|
|
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-button style="margin-left:30px" |
|
|
|
size="small" |
|
|
|
class="diy-button--search" |
|
|
|
@click="handleSearch">查询</el-button> |
|
|
|
<el-button style="margin-left:10px" |
|
|
|
size="small" |
|
|
|
class="diy-button--reset" |
|
|
|
@click="resetSearch">重置</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div class="div_table"> |
|
|
|
<div class="div_btn"> |
|
|
|
<el-button class="diy-button--add" |
|
|
|
<!-- <el-button class="diy-button--add" |
|
|
|
size="small" |
|
|
|
@click="handleAdd">新增</el-button> |
|
|
|
@click="handleAdd">新增</el-button> --> |
|
|
|
|
|
|
|
<el-button style="float:left" |
|
|
|
class="diy-button--export" |
|
|
@ -69,7 +109,7 @@ |
|
|
|
:show-file-list='false' |
|
|
|
:before-upload="beforeUpload" |
|
|
|
action="" |
|
|
|
accept=".xls,.xlsx" |
|
|
|
accept=".xlsx,.xls" |
|
|
|
:limit="1" |
|
|
|
:on-exceed="handleExceed" |
|
|
|
:http-request="uploadFile"> |
|
|
@ -85,6 +125,7 @@ |
|
|
|
</div> |
|
|
|
|
|
|
|
<el-table class="table" |
|
|
|
ref="ref_table" |
|
|
|
:data="tableData" |
|
|
|
border |
|
|
|
:height="tableHeight" |
|
|
@ -97,44 +138,52 @@ |
|
|
|
type="index" |
|
|
|
width="50"></el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="personInCharge" |
|
|
|
<el-table-column prop="name" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="姓名" |
|
|
|
width="90"> |
|
|
|
width="180"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="mobile" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="手机号" |
|
|
|
width="110"> |
|
|
|
width="180"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="gridNames" |
|
|
|
<el-table-column prop="idCard" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="身份证" |
|
|
|
width="170"> |
|
|
|
width="180"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="time" |
|
|
|
<el-table-column prop="inoculateTime" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="接种时间" |
|
|
|
width="120"> |
|
|
|
width="180"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="ninePlaceNames" |
|
|
|
<el-table-column prop="inoculateAddress" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
show-overflow-tooltip |
|
|
|
label="接种地点" |
|
|
|
min-width="230"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="ninePlaceNames" |
|
|
|
<el-table-column prop="manufacturer" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
show-overflow-tooltip |
|
|
|
label="疫苗厂家" |
|
|
|
min-width="180"> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column v-if="isResiUser" |
|
|
|
prop="isResiUserShow" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
show-overflow-tooltip |
|
|
|
label="本辖区居民" |
|
|
|
width="120"> |
|
|
|
</el-table-column> --> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
fixed="right" |
|
|
@ -148,15 +197,18 @@ |
|
|
|
class="div-table-button--detail" |
|
|
|
size="small" |
|
|
|
@click="handleDetail(scope.row)">查看</el-button> |
|
|
|
<!-- <el-button type="text" |
|
|
|
|
|
|
|
<el-button v-if="!isResiUser" |
|
|
|
type="text" |
|
|
|
class="div-table-button--edit" |
|
|
|
size="small" |
|
|
|
@click="handleEdit(scope.row)">修改</el-button> |
|
|
|
@click="handleAttention(scope.row)">同步</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
class="div-table-button--delete--noline " |
|
|
|
<el-button v-if="isResiUser&&scope.row.userType==='synchro'&&scope.row.agencyId===agencyId" |
|
|
|
type="text" |
|
|
|
class="div-table-button--delete " |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.row)">删除</el-button> --> |
|
|
|
@click="handleCancelAttention(scope.row)">取消同步</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
@ -183,7 +235,7 @@ |
|
|
|
class="dialog-h" |
|
|
|
@closed="diaClose"> |
|
|
|
<nat-form ref="ref_form" |
|
|
|
@dialogCancle="addFormCancle" |
|
|
|
@dialogCancle="diaClose" |
|
|
|
@dialogOk="addFormOk"></nat-form> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
@ -196,6 +248,7 @@ import natForm from './natInfo/natForm' |
|
|
|
|
|
|
|
import { requestPost } from "@/js/dai/request"; |
|
|
|
import { mapGetters } from 'vuex' |
|
|
|
import { Loading } from 'element-ui' // 引入Loading服务 |
|
|
|
|
|
|
|
let loading // 加载动画 |
|
|
|
export default { |
|
|
@ -203,19 +256,43 @@ export default { |
|
|
|
return { |
|
|
|
loading: false, |
|
|
|
total: 0, |
|
|
|
pageSize: 10, |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 0, |
|
|
|
tableLoading: false, |
|
|
|
sHeight: 0, |
|
|
|
isResiUser: true, |
|
|
|
|
|
|
|
agencyId: '', |
|
|
|
orgTypeList: [ |
|
|
|
{ |
|
|
|
value: 'current', |
|
|
|
label: '本辖区居民检测记录' |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: 'all', |
|
|
|
label: '全部检测记录' |
|
|
|
}, |
|
|
|
], |
|
|
|
isResiUserList: [ |
|
|
|
{ |
|
|
|
value: '0', |
|
|
|
label: '否' |
|
|
|
}, |
|
|
|
{ |
|
|
|
value: '1', |
|
|
|
label: '是' |
|
|
|
}, |
|
|
|
], |
|
|
|
|
|
|
|
timeRange: [], |
|
|
|
formData: { |
|
|
|
personInCharge: '',//负责人 |
|
|
|
mobile: '',//联系电话 |
|
|
|
gridId: '',//负责区域【网格Id】 |
|
|
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
|
|
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
|
|
|
searchType: 'current',//当前组织:current 根组织:all |
|
|
|
name: '',//姓名 |
|
|
|
mobile: '',//手机号 |
|
|
|
idCard: '',//身份证号码 |
|
|
|
startTime: '',//检测开始时间yyyy-MM-dd HH:mm |
|
|
|
endTime: '',//检测结束时间yyyy-MM-dd HH:mm |
|
|
|
isResiUser: ''//0:否 1:是 |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
tableData: [], |
|
|
@ -241,22 +318,26 @@ export default { |
|
|
|
|
|
|
|
|
|
|
|
await this.loadTable() |
|
|
|
this.sHeight = this.$refs.div_search.offsetHeight + 270 |
|
|
|
}, |
|
|
|
|
|
|
|
methods: { |
|
|
|
handleSearch () { |
|
|
|
this.loadTable() |
|
|
|
}, |
|
|
|
|
|
|
|
async handleSearch () { |
|
|
|
this.isResiUser = this.formData.searchType === 'current' |
|
|
|
|
|
|
|
await this.loadTable() |
|
|
|
|
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.ref_table.doLayout() // 解决表格错位 |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async loadTable () { |
|
|
|
this.tableLoading = true |
|
|
|
|
|
|
|
const url = "/gov/org/placepatrolteam/getlist" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placeorg/getlist" |
|
|
|
const url = "/epmetuser/icVaccine/vaccine-list" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/natlist" |
|
|
|
let params = { |
|
|
|
pageSize: this.pageSize, |
|
|
|
pageNo: this.pageNo, |
|
|
@ -270,26 +351,35 @@ export default { |
|
|
|
this.tableData = data.list |
|
|
|
|
|
|
|
this.tableData.forEach(item => { |
|
|
|
if (item.time) { |
|
|
|
let timeArray = item.time.split(' ') |
|
|
|
item.time = timeArray[0] |
|
|
|
|
|
|
|
item.isResiUserShow = item.isResiUser === '0' ? '否' : '是' |
|
|
|
if (item.natResult === '1') { |
|
|
|
item.natResultShow = '阳性' |
|
|
|
} else if (item.natResult === '0') { |
|
|
|
item.natResultShow = '阴性' |
|
|
|
} else { |
|
|
|
item.natResultShow = '' |
|
|
|
} |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
this.tableLoading = false |
|
|
|
}, |
|
|
|
|
|
|
|
handleScheduledTimeChange (time) { |
|
|
|
handleTimeChange (time) { |
|
|
|
if (time) { |
|
|
|
this.formData.scheduledStartTime = time[0] |
|
|
|
this.formData.scheduledEndTime = time[1] |
|
|
|
this.formData.startTime = time[0] |
|
|
|
this.formData.endTime = time[1] |
|
|
|
|
|
|
|
} else { |
|
|
|
this.formData.scheduledStartTime = '' |
|
|
|
this.formData.scheduledEndTime = '' |
|
|
|
this.formData.startTime = '' |
|
|
|
this.formData.endTime = '' |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
@ -298,13 +388,14 @@ export default { |
|
|
|
diaClose () { |
|
|
|
this.$refs.ref_form.resetData() |
|
|
|
this.formShow = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleDetail (row) { |
|
|
|
this.formTitle = '详情' |
|
|
|
this.formShow = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.ref_form.initForm('detail', row.natId, this.agencyId) |
|
|
|
this.$refs.ref_form.initForm('detail', row.icNatId) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
@ -312,7 +403,7 @@ export default { |
|
|
|
this.formTitle = '新增' |
|
|
|
this.formShow = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.ref_form.initForm('add', null, this.agencyId) |
|
|
|
this.$refs.ref_form.initForm('add', null) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
@ -320,13 +411,10 @@ export default { |
|
|
|
this.formTitle = '修改' |
|
|
|
this.formShow = true |
|
|
|
this.$nextTick(() => { |
|
|
|
this.$refs.ref_form.initForm('edit', row.natId, this.agencyId) |
|
|
|
this.$refs.ref_form.initForm('edit', row.icNatId) |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
addFormCancle () { |
|
|
|
this.formShow = false |
|
|
|
}, |
|
|
|
addFormOk () { |
|
|
|
this.formShow = false |
|
|
|
this.loadTable() |
|
|
@ -334,8 +422,9 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
async handleDelete (row) { |
|
|
|
let message = '确认删除?' |
|
|
|
|
|
|
|
this.$confirm("确认删除?", "提示", { |
|
|
|
this.$confirm(message, "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
@ -343,6 +432,80 @@ export default { |
|
|
|
.then(() => { |
|
|
|
this.deleteNat(row) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async deleteNat (row) { |
|
|
|
const url = "/epmetuser/icNat/del" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/del" |
|
|
|
|
|
|
|
let params = { |
|
|
|
icNatId: row.icNatId |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "操作成功" |
|
|
|
}); |
|
|
|
|
|
|
|
this.loadTable() |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleCancelAttention (row) { |
|
|
|
let message = '取消同步后将不能在本辖区居民检测记录中查看,确认取消同步?' |
|
|
|
|
|
|
|
this.$confirm(message, "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.cancelAttention(row) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async cancelAttention (row) { |
|
|
|
const url = "/epmetuser/icVaccine/cancelsynchro" |
|
|
|
|
|
|
|
let params = { |
|
|
|
vaccineId: row.vaccineId |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "操作成功" |
|
|
|
}); |
|
|
|
|
|
|
|
this.loadTable() |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
async handleAttention (row) { |
|
|
|
|
|
|
|
this.$confirm("确认将信息同步到本辖区核酸检测信息中心?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
this.attentionNat(row) |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
if (err == "cancel") { |
|
|
|
|
|
|
@ -351,12 +514,12 @@ export default { |
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async deleteNat (row) { |
|
|
|
const url = "/gov/org/placepatrolteam/del" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/del" |
|
|
|
async attentionNat (row) { |
|
|
|
const url = "/epmetuser/icVaccine/synchro" |
|
|
|
// const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icNat/synchro" |
|
|
|
|
|
|
|
let params = { |
|
|
|
natId: row.natId |
|
|
|
vaccineId: row.vaccineId |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
@ -364,7 +527,7 @@ export default { |
|
|
|
if (code === 0) { |
|
|
|
this.$message({ |
|
|
|
type: "success", |
|
|
|
message: "删除成功" |
|
|
|
message: "操作成功" |
|
|
|
}); |
|
|
|
|
|
|
|
this.loadTable() |
|
|
@ -373,21 +536,23 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//重置搜索条件 |
|
|
|
resetSearch () { |
|
|
|
this.formData = { |
|
|
|
personInCharge: '',//负责人 |
|
|
|
mobile: '',//联系电话 |
|
|
|
gridId: '',//负责区域【网格Id】 |
|
|
|
ninePlaceVal: '',//场所类型【九小场所Value值】 |
|
|
|
isPage: true,//是否分页(是:true 否:false) 有这个参数是给新增巡查记录时用的,默认是 |
|
|
|
searchType: 'current',//当前组织:current 根组织:all |
|
|
|
name: '',//姓名 |
|
|
|
mobile: '',//手机号 |
|
|
|
idCard: '',//身份证号码 |
|
|
|
startTime: '',//检测开始时间yyyy-MM-dd HH:mm |
|
|
|
endTime: '',//检测结束时间yyyy-MM-dd HH:mm |
|
|
|
} |
|
|
|
this.pageSize = 10 |
|
|
|
this.timeRange = [] |
|
|
|
|
|
|
|
this.pageNo = 0 |
|
|
|
this.loadTable() |
|
|
|
// this.loadTable() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
handleSizeChange (val) { |
|
|
|
this.pageSize = val |
|
|
|
this.pageNo = 1 |
|
|
@ -400,27 +565,37 @@ export default { |
|
|
|
|
|
|
|
//导出表格 |
|
|
|
async handleExport () { |
|
|
|
let title = this.agencyObj.label |
|
|
|
title = title + '—房屋列表' |
|
|
|
let title = '核酸检测信息' |
|
|
|
|
|
|
|
const url = "/gov/org/house/exporthouseinfo" |
|
|
|
let params = { |
|
|
|
ownerName: this.ownerName, |
|
|
|
ownerPhone: this.ownerPhone, |
|
|
|
buildingId: this.agencyObj.id |
|
|
|
} |
|
|
|
const url = "/epmetuser/icVaccine/export" |
|
|
|
|
|
|
|
app.ajax.exportFilePost( |
|
|
|
await this.$http({ |
|
|
|
method: 'POST', |
|
|
|
url, |
|
|
|
params, |
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
|
|
this.download(data, title + '.xls') |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.$message.error(rspMsg); |
|
|
|
} |
|
|
|
); |
|
|
|
responseType: 'blob' |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log('res----dddd', res) |
|
|
|
// this.download(res.data, title + '.xls') |
|
|
|
if (res.headers["content-disposition"]) { |
|
|
|
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对象 |
|
|
|
} else this.$message.error('下载失败') |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
@ -450,37 +625,53 @@ export default { |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
handleExportModule () { |
|
|
|
let title = '' |
|
|
|
title = '房屋模板' |
|
|
|
async handleExportModule () { |
|
|
|
let title = '核酸检测信息导入模板' |
|
|
|
|
|
|
|
const url = "/gov/org/house/exporttemplate" |
|
|
|
const url = "/epmetuser/icVaccine/import-template-download" |
|
|
|
let params = {} |
|
|
|
|
|
|
|
app.ajax.exportFilePost( |
|
|
|
await this.$http({ |
|
|
|
method: 'POST', |
|
|
|
url, |
|
|
|
params, |
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
|
|
this.download(data, title + '.xls') |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.$message.error(rspMsg); |
|
|
|
} |
|
|
|
); |
|
|
|
responseType: 'blob', |
|
|
|
data: params |
|
|
|
}) |
|
|
|
.then(res => { |
|
|
|
console.log('res----dddd', res) |
|
|
|
// this.download(res.data, title + '.xls') |
|
|
|
if (res.headers["content-disposition"]) { |
|
|
|
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对象 |
|
|
|
} else this.$message.error('下载失败') |
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
console.log('err', err) |
|
|
|
return this.$message.error('网络错误') |
|
|
|
}) |
|
|
|
this.$refs.upload.clearFiles() |
|
|
|
}, |
|
|
|
|
|
|
|
// 上传文件之前的钩子 |
|
|
|
beforeUpload (file) { |
|
|
|
this.files = file; |
|
|
|
|
|
|
|
const isText = file.type === 'application/vnd.ms-excel' |
|
|
|
const isTextComputer = file.type === 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' |
|
|
|
|
|
|
|
if (!isText && !isTextComputer) { |
|
|
|
this.$message.error('请选择正确格式的文件') |
|
|
|
const array = file.name.split('.') |
|
|
|
const extension = array[array.length - 1] |
|
|
|
// const isLt1M = (file.size / 1024 / 1024) < 5 |
|
|
|
if (extension !== 'xlsx') { |
|
|
|
this.$message.error('只能上传xlsx文件!') |
|
|
|
return false |
|
|
|
} else { |
|
|
|
this.files = file; |
|
|
|
this.fileName = file.name; |
|
|
|
return true |
|
|
|
} |
|
|
@ -506,19 +697,17 @@ export default { |
|
|
|
//清空上传列表 |
|
|
|
this.$refs['upload'].clearFiles() |
|
|
|
|
|
|
|
var url = '/gov/org/house/houseimport' |
|
|
|
var url = '/epmetuser/icVaccine/import' |
|
|
|
|
|
|
|
let fileFormData = new FormData(); |
|
|
|
fileFormData.append('file', this.files);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
fileFormData.append('orgId', this.agencyObj.id);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
fileFormData.append('orgType', this.agencyObj.level);//filename是键,file是值,就是要传的文件,test.zip是要传的文件名 |
|
|
|
|
|
|
|
this.importRoomLoading = true |
|
|
|
window.app.ajax.post2(url, fileFormData, |
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
|
|
if (data.code === 0 && data.msg == 'success') { |
|
|
|
// this.$message.success('导入成功') |
|
|
|
this.loadTable() |
|
|
|
} else { |
|
|
|
// this.$message({ |
|
|
|
// showClose: true, |
|
|
@ -526,24 +715,40 @@ export default { |
|
|
|
// duration: 0, |
|
|
|
// type: "error" |
|
|
|
// }) |
|
|
|
// this.$message.error(rspMsg) |
|
|
|
this.$message.error(rspMsg) |
|
|
|
} |
|
|
|
this.$emit('refreshTree') |
|
|
|
this.loadTable() |
|
|
|
this.importRoomLoading = false |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.importRoomLoading = false |
|
|
|
|
|
|
|
}, { headers: { 'Content-Type': 'multipart/form-data' } }) |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
// 开启加载动画 |
|
|
|
startLoading () { |
|
|
|
loading = Loading.service({ |
|
|
|
lock: true, // 是否锁定 |
|
|
|
text: '正在加载……', // 加载中需要显示的文字 |
|
|
|
background: 'rgba(0,0,0,.7)' // 背景颜色 |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 结束加载动画 |
|
|
|
endLoading () { |
|
|
|
// clearTimeout(timer); |
|
|
|
if (loading) { |
|
|
|
loading.close() |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
tableHeight () { |
|
|
|
const h = this.clientHeight - this.sHeight + this.iframeHeigh |
|
|
|
const _h = this.clientHeight - this.sHeight |
|
|
|
return this.$store.state.inIframe ? h : _h |
|
|
|
|
|
|
|
return this.$store.state.inIframe ? this.clientHeight - 420 + this.iframeHeight : this.clientHeight - 420 |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|