|
|
@ -1,9 +1,12 @@ |
|
|
|
<template> |
|
|
|
<div class="dialog-h-content scroll-h"> |
|
|
|
<div class="div_table"> |
|
|
|
<div class="div_dialog_table"> |
|
|
|
<el-button size="small" |
|
|
|
class="diy-button--add" |
|
|
|
@click="handleAdd">新增</el-button> |
|
|
|
<el-button size="small" |
|
|
|
class="diy-button--reset" |
|
|
|
@click="handleExport">导出</el-button> |
|
|
|
|
|
|
|
<el-table class="table" |
|
|
|
:data="tableData" |
|
|
@ -19,120 +22,85 @@ |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column prop="reviewTime" |
|
|
|
<el-table-column prop="visitTime" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="复查时间" |
|
|
|
width="250"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.isEdit"> |
|
|
|
<el-date-picker v-model="scope.row.reviewTime" |
|
|
|
value-format="yyyy-MM-dd" |
|
|
|
type="date" |
|
|
|
placeholder="选择日期"> |
|
|
|
</el-date-picker> |
|
|
|
</div> |
|
|
|
<span v-else>{{scope.row.reviewTime}}</span> |
|
|
|
</template> |
|
|
|
label="随访时间" |
|
|
|
width="150"> |
|
|
|
|
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="ninePlaceName" |
|
|
|
<el-table-column prop="content" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="分队名称" |
|
|
|
width="280"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.isEdit"> |
|
|
|
<el-select class="item_width_1" |
|
|
|
v-model="scope.row.placePatrolTeamId" |
|
|
|
placeholder="请选择" |
|
|
|
clearable> |
|
|
|
<el-option v-for="(item,index) in teamsList" |
|
|
|
@click.native="hancleChangeTeam(scope.row,index,scope.$index)" |
|
|
|
:key="item.teamId" |
|
|
|
:label="item.teamName" |
|
|
|
:value="item.teamId"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<span v-else>{{scope.row.placePatrolTeamName}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
label="随访内容" |
|
|
|
min-width="280"> |
|
|
|
|
|
|
|
<el-table-column prop="inspectorsNames" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="检查人员" |
|
|
|
min-width="380"> |
|
|
|
|
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.isEdit"> |
|
|
|
<el-checkbox-group style="display:flex;flex-wrap:wrap" |
|
|
|
v-model="scope.row.inspectorArray"> |
|
|
|
<el-checkbox v-for="item in scope.row.inspectorsList" |
|
|
|
:key="item.id" |
|
|
|
:label="item.id">{{item.name}}</el-checkbox> |
|
|
|
|
|
|
|
</el-checkbox-group> |
|
|
|
</div> |
|
|
|
<span v-else>{{scope.row.inspectorsNames}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column prop="reviewResult" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
label="复查结论" |
|
|
|
width="120"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<div v-if="scope.row.isEdit"> |
|
|
|
<el-select class="item_width_2" |
|
|
|
v-model="scope.row.reviewResult" |
|
|
|
placeholder="全部" |
|
|
|
clearable> |
|
|
|
<el-option v-for="item in resultList" |
|
|
|
:key="item.value" |
|
|
|
:label="item.label" |
|
|
|
:value="item.value"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</div> |
|
|
|
<span v-else>{{scope.row.reviewResult==='0'?'合格':'不合格'}}</span> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
|
|
|
|
<el-table-column label="操作" |
|
|
|
fixed="right" |
|
|
|
width="180" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
class="operate"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-button v-if="scope.row.isEdit" |
|
|
|
type="text" |
|
|
|
style="color:#00A7A9;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleComfirm(scope.row,scope.$index)">保存</el-button> |
|
|
|
<el-button v-if="!scope.row.isEdit" |
|
|
|
type="text" |
|
|
|
style="color:#1C6AFD;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleEdit(scope.row,scope.$index)">修改</el-button> |
|
|
|
|
|
|
|
<el-button type="text" |
|
|
|
style="color:#D51010;text-decoration: underline;" |
|
|
|
size="small" |
|
|
|
@click="handleDelete(scope.row,scope.$index)">删除</el-button> |
|
|
|
|
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<div> |
|
|
|
<el-pagination @size-change="handleSizeChange" |
|
|
|
@current-change="handleCurrentChange" |
|
|
|
:current-page.sync="pageNo" |
|
|
|
:page-sizes="[20, 50, 100, 200]" |
|
|
|
:page-size="pageSize" |
|
|
|
layout="sizes, prev, pager, next, total" |
|
|
|
:total="total"> |
|
|
|
</el-pagination> |
|
|
|
</div> |
|
|
|
<!-- <div class="div_btn"> |
|
|
|
<el-button @click="handleCancle">取 消</el-button> |
|
|
|
|
|
|
|
</div> --> |
|
|
|
</div> |
|
|
|
<el-dialog :visible.sync="dialogVisible" |
|
|
|
width="550px" |
|
|
|
top="5vh" |
|
|
|
title="新增" |
|
|
|
append-to-body |
|
|
|
@closed="handleCancle"> |
|
|
|
<div class="epidemic-form"> |
|
|
|
<el-form ref="ref_form" |
|
|
|
:inline="true" |
|
|
|
:model="formData" |
|
|
|
:rules="dataRule" |
|
|
|
class="form"> |
|
|
|
|
|
|
|
<el-form-item label="随访时间" |
|
|
|
style="display: block" |
|
|
|
prop="visitTime" |
|
|
|
label-width="150px"> |
|
|
|
<el-date-picker class="item_width_2" |
|
|
|
v-model="formData.visitTime" |
|
|
|
format="yyyy-MM-dd HH:mm:ss" |
|
|
|
value-format="yyyy-MM-dd HH:mm:ss" |
|
|
|
type="datetime" |
|
|
|
clearable |
|
|
|
placeholder="选择时间"> |
|
|
|
</el-date-picker> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
<el-form-item label="随访内容" |
|
|
|
prop="content" |
|
|
|
label-width="150px" |
|
|
|
style="display: block"> |
|
|
|
<el-input class="item_width_1" |
|
|
|
type="textarea" |
|
|
|
maxlength="1000" |
|
|
|
show-word-limit |
|
|
|
:autosize="{ minRows: 4, maxRows: 10 }" |
|
|
|
clearable |
|
|
|
placeholder="请输入通知内容" |
|
|
|
v-model="formData.content"></el-input> |
|
|
|
</el-form-item> |
|
|
|
|
|
|
|
</el-form> |
|
|
|
|
|
|
|
<div class="form_div_btn"> |
|
|
|
<el-button size="small" |
|
|
|
@click="handleCancle">取 消</el-button> |
|
|
|
<el-button size="small" |
|
|
|
type="primary" |
|
|
|
@click="handleComfirm">确 定</el-button> |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</el-dialog> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
|
|
|
@ -146,9 +114,22 @@ export default { |
|
|
|
data () { |
|
|
|
return { |
|
|
|
tableLoading: false, |
|
|
|
placePatrolRecordId: '', |
|
|
|
|
|
|
|
tableData: [], |
|
|
|
total: 0, |
|
|
|
pageSize: 20, |
|
|
|
pageNo: 1, |
|
|
|
|
|
|
|
formData: { |
|
|
|
visitTime: '',//随访时间 |
|
|
|
content: '',//内容 |
|
|
|
idCard: '', |
|
|
|
name: '', |
|
|
|
mobile: '', |
|
|
|
origin: '1' |
|
|
|
}, |
|
|
|
|
|
|
|
dialogVisible: false, |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
@ -159,91 +140,33 @@ export default { |
|
|
|
|
|
|
|
methods: { |
|
|
|
|
|
|
|
async initTable (placePatrolRecordId) { |
|
|
|
this.placePatrolRecordId = placePatrolRecordId |
|
|
|
await this.loadTeams() |
|
|
|
async initTable (row) { |
|
|
|
this.formData.idCard = row.idCard |
|
|
|
this.formData.name = row.name |
|
|
|
this.formData.mobile = row.mobile |
|
|
|
|
|
|
|
await this.loadTable() |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
//加载分队 |
|
|
|
async loadTeams () { |
|
|
|
const url = '/gov/org/placepatrolteam/getlist' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteam/getlist' |
|
|
|
let params = { |
|
|
|
isPage: false |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
this.teamsList = data.list |
|
|
|
|
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
//点击分队切换人员 |
|
|
|
async hancleChangeTeam (row, index, tableIndex) { |
|
|
|
this.tableData[tableIndex].inspectorArray = [...[]] |
|
|
|
let teamId = this.teamsList[index].teamId |
|
|
|
await this.loadInspectors(teamId, tableIndex) |
|
|
|
}, |
|
|
|
|
|
|
|
//加载分队下人员 |
|
|
|
async loadInspectors (teamId, tableIndex) { |
|
|
|
|
|
|
|
const url = '/gov/org/placepatrolteamstaff/getlist' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolteamstaff/getlist' |
|
|
|
let params = { |
|
|
|
teamId: teamId |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
// let obj = this.tableData[tableIndex] |
|
|
|
this.tableData[tableIndex].inspectorsList = [...data] |
|
|
|
// this.tableData[tableIndex]= |
|
|
|
// obj.inspectorsList = data |
|
|
|
// this.$set(this.tableData, tableIndex, obj) |
|
|
|
console.log(this.tableData) |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
}, |
|
|
|
//加载form |
|
|
|
async loadTable () { |
|
|
|
this.tableLoading = true |
|
|
|
const url = '/gov/org/placepatrolreviewrecord/getlist' |
|
|
|
// const url = 'http://yapi.elinkservice.cn/mock/245/gov/org/placepatrolreviewrecord/getlist' |
|
|
|
// const url = '/epmetuser/followup/page' |
|
|
|
const url = 'http://yapi.elinkservice.cn/mock/245/epmetuser/followup/page' |
|
|
|
let params = { |
|
|
|
placePatrolRecordId: this.placePatrolRecordId |
|
|
|
idCard: this.formData.idCard, |
|
|
|
pageNo: this.pageNo, |
|
|
|
pageSize: this.pageSize, |
|
|
|
origin: '1' |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
this.tableLoading = false |
|
|
|
if (code === 0) { |
|
|
|
this.total = data.total |
|
|
|
this.tableData = data.list |
|
|
|
|
|
|
|
if (data.list && data.list.length > 0) { |
|
|
|
data.list.forEach(item => { |
|
|
|
item.isEdit = false |
|
|
|
item.isNew = false |
|
|
|
let arrayInspectors = item.inspectors.split(',') |
|
|
|
item.inspectorArray = [...arrayInspectors] |
|
|
|
|
|
|
|
let arrayReviewTime = item.reviewTime.split(' ') |
|
|
|
item.reviewTime = arrayReviewTime[0] |
|
|
|
}); |
|
|
|
|
|
|
|
this.tableData = [...data.list] |
|
|
|
} else { |
|
|
|
this.tableData = [] |
|
|
|
} |
|
|
|
|
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
@ -251,139 +174,90 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
handleAdd () { |
|
|
|
let obj = { |
|
|
|
isNew: true,//是否新增 |
|
|
|
isEdit: true,//是否编辑 |
|
|
|
placePatrolRecordId: this.placePatrolRecordId, |
|
|
|
reviewTime: '', |
|
|
|
placePatrolTeamId: '', |
|
|
|
inspectors: '', |
|
|
|
inspectorArray: [], |
|
|
|
inspectorsList: [], |
|
|
|
reviewResult: '', |
|
|
|
} |
|
|
|
this.tableData.push(obj) |
|
|
|
this.dialogVisible = true |
|
|
|
}, |
|
|
|
|
|
|
|
async handleEdit (row, tableIndex) { |
|
|
|
let teamId = row.placePatrolTeamId |
|
|
|
await this.loadInspectors(teamId, tableIndex) |
|
|
|
|
|
|
|
let rowData = JSON.parse(JSON.stringify(row)) |
|
|
|
rowData.isEdit = true |
|
|
|
rowData.isNew = false |
|
|
|
rowData.inspectorArray = rowData.inspectors.split(',') |
|
|
|
|
|
|
|
console.log(rowData) |
|
|
|
this.$set(this.tableData, tableIndex, rowData) |
|
|
|
}, |
|
|
|
async handleComfirm () { |
|
|
|
|
|
|
|
async handleComfirm (row, tableIndex) { |
|
|
|
let valiMsg = this.validata(row) |
|
|
|
if (valiMsg) { |
|
|
|
this.$message({ |
|
|
|
type: 'warning', |
|
|
|
message: valiMsg |
|
|
|
}) |
|
|
|
return false |
|
|
|
} |
|
|
|
|
|
|
|
this.addReview(row, tableIndex) |
|
|
|
|
|
|
|
}, |
|
|
|
async addReview (row, tableIndex) { |
|
|
|
|
|
|
|
let url = "/gov/org/placepatrolreviewrecord/add" |
|
|
|
if (row.placePatrolReviewRecordId) { |
|
|
|
url = "/gov/org/placepatrolreviewrecord/edit" |
|
|
|
} |
|
|
|
// let url = "/epmetuser/followup/save" |
|
|
|
let url = "http://yapi.elinkservice.cn/mock/245/epmetuser/followup/save" |
|
|
|
|
|
|
|
let params = JSON.parse(JSON.stringify(row)) |
|
|
|
params.inspectors = params.inspectorArray.join(',') |
|
|
|
params.reviewTime = params.reviewTime + ' 00:00:00' |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
const { data, code, msg } = await requestPost(url, this.formData) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
let array = data.reviewTime.split(' ') |
|
|
|
data.reviewTime = array[0] |
|
|
|
data.isEdit = false |
|
|
|
data.isNew = false |
|
|
|
|
|
|
|
this.$set(this.tableData, tableIndex, data) |
|
|
|
|
|
|
|
this.loadTable() |
|
|
|
this.handleCancle() |
|
|
|
} else { |
|
|
|
|
|
|
|
this.$message.error(msg) |
|
|
|
} |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
validata (row) { |
|
|
|
let message = '' |
|
|
|
if (row.reviewTime === '') { |
|
|
|
message = message + '复查时间不能为空;' |
|
|
|
} |
|
|
|
if (row.placePatrolTeamId === '') { |
|
|
|
message = message + '分队名称不能为空;' |
|
|
|
} |
|
|
|
if (row.inspectorArray.length === 0) { |
|
|
|
message = message + '检查人员不能为空;' |
|
|
|
} |
|
|
|
if (row.reviewResult === '') { |
|
|
|
message = message + '复查结论不能为空;' |
|
|
|
} |
|
|
|
return message |
|
|
|
handleCancle () { |
|
|
|
this.dialogVisible = false |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
async handleDelete (row, tableIndex) { |
|
|
|
//导出表格 |
|
|
|
async handleExport () { |
|
|
|
let title = this.formData.name + '—随访记录' |
|
|
|
|
|
|
|
this.$confirm("确认删除?", "提示", { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
}) |
|
|
|
.then(() => { |
|
|
|
if (row.placePatrolReviewRecordId) {//存在id,调用服务删除 |
|
|
|
this.deleteRecord(row, tableIndex) |
|
|
|
} else {//不存在id,直接删除数组数据 |
|
|
|
this.tableData.splice(tableIndex, 1); |
|
|
|
const url = "/gov/org/house/exporthouseinfo" |
|
|
|
let params = { |
|
|
|
ownerName: this.ownerName, |
|
|
|
ownerPhone: this.ownerPhone, |
|
|
|
buildingId: this.agencyObj.id |
|
|
|
} |
|
|
|
|
|
|
|
}) |
|
|
|
.catch(err => { |
|
|
|
if (err == "cancel") { |
|
|
|
app.ajax.exportFilePost( |
|
|
|
url, |
|
|
|
params, |
|
|
|
(data, rspMsg) => { |
|
|
|
|
|
|
|
this.download(data, title + '.xlsx') |
|
|
|
}, |
|
|
|
(rspMsg, data) => { |
|
|
|
this.$message.error(rspMsg); |
|
|
|
} |
|
|
|
); |
|
|
|
|
|
|
|
}); |
|
|
|
}, |
|
|
|
|
|
|
|
async deleteRecord (row, tableIndex) { |
|
|
|
|
|
|
|
const url = "/gov/org/placepatrolreviewrecord/del" |
|
|
|
|
|
|
|
let params = { |
|
|
|
placePatrolReviewRecordId: row.placePatrolReviewRecordId |
|
|
|
// 下载文件 |
|
|
|
download (data, fileName) { |
|
|
|
if (!data) { |
|
|
|
return |
|
|
|
} |
|
|
|
|
|
|
|
const { data, code, msg } = await requestPost(url, params) |
|
|
|
|
|
|
|
if (code === 0) { |
|
|
|
// this.$message({ |
|
|
|
// type: "success", |
|
|
|
// message: "删除成功" |
|
|
|
// }); |
|
|
|
var csvData = new Blob([data]) |
|
|
|
|
|
|
|
this.tableData.splice(tableIndex, 1); |
|
|
|
} else { |
|
|
|
this.$message.error(msg) |
|
|
|
if (window.navigator && window.navigator.msSaveOrOpenBlob) { |
|
|
|
window.navigator.msSaveOrOpenBlob(csvData, fileName); |
|
|
|
} |
|
|
|
// 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 = fileName; |
|
|
|
a.click(); |
|
|
|
a.remove(); |
|
|
|
window.URL.revokeObjectURL(url); |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
handleCancle () { |
|
|
|
this.$emit('dialogCancle') |
|
|
|
}, |
|
|
|
|
|
|
|
handleSizeChange (val) { |
|
|
|
this.pageSize = val |
|
|
|
this.pageNo = 1 |
|
|
|
this.loadTable() |
|
|
|
}, |
|
|
|
handleCurrentChange (val) { |
|
|
|
this.pageNo = val |
|
|
|
this.loadTable() |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
@ -405,46 +279,30 @@ export default { |
|
|
|
}, |
|
|
|
computed: { |
|
|
|
tableHeight () { |
|
|
|
|
|
|
|
return (this.clientHeight - 360) |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
...mapGetters(['clientHeight']) |
|
|
|
...mapGetters(['clientHeight']), |
|
|
|
dataRule () { |
|
|
|
return { |
|
|
|
visitTime: [ |
|
|
|
{ required: true, message: '随访时间不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
content: [ |
|
|
|
{ required: true, message: '随访内容不能为空', trigger: 'blur' } |
|
|
|
], |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
props: { |
|
|
|
|
|
|
|
|
|
|
|
resultList: { |
|
|
|
type: Array, |
|
|
|
default: [] |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
</script> |
|
|
|
|
|
|
|
|
|
|
|
<style lang="scss" scoped > |
|
|
|
@import "@/assets/scss/buttonstyle.scss"; |
|
|
|
.item_width_1 { |
|
|
|
width: 250px; |
|
|
|
} |
|
|
|
.item_width_2 { |
|
|
|
width: 100px; |
|
|
|
} |
|
|
|
.div_table { |
|
|
|
// background: #ffffff; |
|
|
|
// box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1); |
|
|
|
// border-radius: 4px; |
|
|
|
|
|
|
|
.table { |
|
|
|
margin-top: 20px; |
|
|
|
} |
|
|
|
} |
|
|
|
.div_btn { |
|
|
|
margin-top: 10px; |
|
|
|
display: flex; |
|
|
|
justify-content: flex-end; |
|
|
|
} |
|
|
|
@import "@/assets/scss/modules/management/epidemic.scss"; |
|
|
|
</style> |