Browse Source

111

feature/welfareImport
jiangyy 3 years ago
parent
commit
8effface87
  1. 530
      src/views/modules/shujuduibi/shenfenyizhi.vue

530
src/views/modules/shujuduibi/shenfenyizhi.vue

@ -0,0 +1,530 @@
<template>
<div class="div_main">
<div class="div_search">
<el-form :inline="true"
:model="formData"
ref="ref_searchform"
:label-width="'100px'">
<el-form-item label="状态"
prop="identical">
<el-select class="item_width_1"
v-model="formData.identical"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in identicalList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="信息一致"
prop="type">
<el-select class="item_width_1"
v-model="formData.type"
placeholder="请选择"
size="small"
clearable>
<el-option v-for="item in typeList"
:key="item.value"
:label="item.label"
:value="item.value">
</el-option>
</el-select>
</el-form-item>
<el-form-item label="身份证号"
prop="unitName">
<el-input v-model="formData.idCard"
class="item_width_1"
clearable
size="small"
placeholder="请输入内容">
</el-input>
</el-form-item>
<el-button style="margin-left:10px"
class="diy-button--search"
size="small"
@click="handleSearch">查询</el-button>
<el-button style="margin-left:10px"
class="diy-button--reset"
size="small"
@click="resetSearch">重置</el-button>
</el-form>
</div>
<div class="div_table">
<div class="div_btn">
<el-button class="diy-button--reset"
size="small"
@click="handleExport">导出</el-button>
<el-button class="diy-button--add"
size="small"
@click="handleBatchCompare">批量对比</el-button>
</div>
<el-table class="table"
:data="tableData"
border
:height="tableHeight"
v-loading="tableLoading"
:header-cell-style="{background:'#2195FE',color:'#FFFFFF'}"
style="width: 100%"
@select-all="selectAll"
@selection-change="selectionChange">
<el-table-column type="selection"
fixed="left"
align="center"
width="55" />
<el-table-column label="序号"
header-align="center"
align="center"
type="index"
width="50"></el-table-column>
<el-table-column prop="resiName"
header-align="center"
align="center"
label="居民库-姓名"
min-width="100">
</el-table-column>
<el-table-column prop="resiIdCard"
header-align="center"
align="center"
label="居民库-证件号"
min-width="120">
</el-table-column>
<el-table-column prop="policeName"
header-align="center"
align="center"
label="公安-姓名"
min-width="100">
</el-table-column>
<el-table-column prop="policeIdCard"
header-align="center"
align="center"
label="公安-证件号"
show-overflow-tooltip
min-width="120">
</el-table-column>
<el-table-column prop="typeName"
header-align="center"
align="center"
label="状态"
width="100">
</el-table-column>
<el-table-column prop="identicalName"
header-align="center"
align="center"
label="信息一致"
width="140">
</el-table-column>
<el-table-column label="操作"
fixed="right"
width="150"
header-align="center"
align="center"
class="operate">
<template slot-scope="scope">
<el-button v-if="scope.row.type==='0' && scope.row.identical==='0'"
type="text"
class="div-table-button--detail"
size="small"
@click="handleUpdate(scope.row)">更新</el-button>
<el-button v-if="scope.row.type==='0' && scope.row.identical==='2'"
type="text"
class="div-table-button--edit"
size="small"
@click="handleCompare(scope.row)">对比</el-button>
</template>
</el-table-column>
</el-table>
<div>
<el-pagination @size-change="handleSizeChange"
@current-change="handleCurrentChange"
:current-page.sync="pageNo"
:page-sizes="[10, 20, 50]"
:page-size="pageSize"
layout="sizes, prev, pager, next, total"
:total="total">
</el-pagination>
</div>
</div>
</div>
</template>
<script>
import { requestPost } from "@/js/dai/request";
import { mapGetters } from 'vuex'
import { Loading } from 'element-ui' // Loading
let loading //
export default {
data () {
return {
loading: false,
total: 0,
pageSize: 20,
pageNo: 0,
tableLoading: false,
agencyId: '',
identicalList: [
{
value: '0',
label: '否'
},
{
value: '1',
label: '是'
},
{
value: '2',
label: '空'
}
],//list
typeList: [
{
value: '0',
label: '未处理'
},
{
value: '1',
label: '已处理'
},
],//list
formData: {
identical: '',
type: '',
idCard: '',
},
tableData: [],
selection: [],
}
},
components: {
},
async created () {
},
async mounted () {
const { user } = this.$store.state
this.agencyId = user.agencyId
await this.loadTable()
},
methods: {
selectAll (selection) {
this.selection = selection;
},
selectionChange (selection) {
this.selection = selection;
},
handleSearch () {
this.loadTable()
},
async loadTable () {
this.tableLoading = true
// const url = "/epmetuser/icResiComparisonRecord/resiComparisonList"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icResiComparisonRecord/resiComparisonList"
let params = {
pageSize: this.pageSize,
pageNo: this.pageNo,
...this.formData
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
this.total = data.total
this.tableData = data.list
} else {
this.$message.error(msg)
}
this.tableLoading = false
},
async handleUpdate (row) {
this.$confirm("确认更新?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
this.updateRow(row)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async updateRow (row) {
// const url = "/epmetuser/icResiComparisonRecord/comparisonUpdate"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icResiComparisonRecord/comparisonUpdate"
let params = {
comparisonRecordId: row.comparisonRecordId,
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (data.type) {
this.$message({
type: "success",
message: data.msg || "更新成功"
});
this.loadTable()
} else {
this.$message.error(data.msg)
}
} else {
this.$message.error(msg)
}
},
async handleCompare (row) {
this.$confirm("确认对比?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let array = [row.resiId]
this.compareRow(array)
})
.catch(err => {
if (err == "cancel") {
}
});
},
async compareRow (array) {
// const url = "/epmetuser/icResiComparisonRecord/comparison"
const url = "http://yapi.elinkservice.cn/mock/245/epmetuser/icResiComparisonRecord/comparison"
let params = {}
if (array.length > 0) {
params.userIdList = array
} else {
params = {}
}
const { data, code, msg } = await requestPost(url, params)
if (code === 0) {
if (data.type) {
this.$message({
type: "success",
message: "对比成功"
});
this.loadTable()
} else {
this.$message.error(data.msg)
}
} else {
this.$message.error(msg)
}
},
async handleBatchCompare () {
this.$confirm("确认批量对比?", "提示", {
confirmButtonText: "确定",
cancelButtonText: "取消",
type: "warning"
})
.then(() => {
let array = this.selection.map((item) => item.resiId);
this.compareRow(array)
})
.catch(err => {
if (err == "cancel") {
}
});
},
//
resetSearch () {
this.formData = {
identical: '',
type: '',
idCard: '',
}
// this.pageSize = 10
this.pageNo = 0
// this.loadTable()
},
//
async handleExport () {
let title = '身份一致性验证表格'
const url = "/epmetuser/icResiComparisonRecord/export"
let params = {
...this.formData
}
app.ajax.exportFilePost(
url,
params,
(data, rspMsg) => {
this.download(data, title + '.xls')
},
(rspMsg, data) => {
this.$message.error(rspMsg);
}
);
},
//
download (data, fileName) {
if (!data) {
return
}
var csvData = new Blob([data])
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);
}
},
handleSizeChange (val) {
this.pageSize = val
this.pageNo = 1
this.loadTable()
},
handleCurrentChange (val) {
this.pageNo = val
this.loadTable()
},
//
startLoading () {
loading = Loading.service({
lock: true, //
text: '正在加载……', //
background: 'rgba(0,0,0,.7)' //
})
},
//
endLoading () {
// clearTimeout(timer);
if (loading) {
loading.close()
}
}
},
computed: {
tableHeight () {
return this.$store.state.inIframe ? this.clientHeight - 370 + this.iframeHeight : this.clientHeight - 370
},
...mapGetters(['clientHeight', 'iframeHeight'])
},
watch: {
},
props: {
}
}
</script>
<style lang="scss" scoped >
.div_main {
width: 100%;
}
.div_search {
background: #ffffff;
border-radius: 4px;
padding: 30px 20px 5px;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
}
.item_width_1 {
width: 260px;
}
.item_width_2 {
width: 620px;
}
.div_table {
background: #ffffff;
box-shadow: 0px 2px 12px 0px rgba(0, 0, 0, 0.1);
border-radius: 4px;
margin-top: 15px;
padding: 23px 30px 10px;
.table {
margin-top: 20px;
}
}
.el-row {
/* margin-bottom: 20px; */
display: flex;
flex-wrap: wrap;
margin-top: 10px;
margin-right: 50px;
}
</style>
Loading…
Cancel
Save