You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

196 lines
6.9 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../../component/pear/css/pear.css" />
<style>
.woo-tool-text-delimiter {
width: 1px;
height: 12px;
background: #EEEEEE;
display: inline-block;
margin: 0 6px 0 4px;
}
.woo-theme-color {
color: #2d8cf0 !important;
}
/* .not-equal-color {
color: #FFB800 !important;
} */
.woo-tool-span {
margin: 0 3px;
position: relative;
top: -1px;
cursor: pointer;
}
.layui-table-tool-temp {
padding-right: 0;
}
</style>
</head>
<body class="pear-container layui-form">
<div class="layui-card">
<div class="layui-card-body">
<table id="data-table"></table>
<script type="text/html" id="org_name_tpl">
{{# if(d.org_name != d.ty_org_name){ }}
<span class="not-equal-color">{{d.org_name}}</span>
{{# } else { }}
{{d.org_name}}
{{# } }}
</script>
<script type="text/html" id="ty_org_name_tpl">
{{# if(d.org_name != d.ty_org_name){ }}
<span class="not-equal-color">{{d.ty_org_name}}</span>
{{# } else { }}
{{d.ty_org_name}}
{{# } }}
</script>
<script type="text/html" id="match_tpl">
{{# if(d.org_name != d.ty_org_name){ }}
<span class="not-equal-color">手工匹配</span>
{{# } else { }}
智能匹配
{{# } }}
</script>
</div>
</div>
<script type="text/html" id="table-bar">
<span class="woo-tool-span woo-tool-text-span" lay-event="unMatch"><a
class="woo-theme-color">取消匹配</a></span>
</script>
<script src="../../../../component/layui/layui.js"></script>
<script src="../../../../component/pear/pear.js"></script>
<script>
layui.use(['table', 'form', 'jquery', 'common'], function () {
var table = layui.table;
var form = layui.form;
var $ = layui.jquery;
var common = layui.common;
tableRender();
function tableRender() {
table.render({
elem: '#data-table',
url: '/QingLong/collect/getAllBureau',
where: {
is_match: 1
},
height: 'full-60',
page: {
limit: 15
, layout: ['count', 'prev', 'page', 'next', 'skip']
, prev: "上一页"
, next: "下一页"
},
cols: [[
{ title: '序号', unresize: true, align: 'center', width: "5%", type: 'numbers' },
{ title: '单位名称', unresize: true, align: 'center', templet: '#org_name_tpl' },
{ title: '第三方系统单位名称', unresize: true, align: 'center', templet: '#ty_org_name_tpl' },
{ title: '单位类型', unresize: true, align: 'center', field: 'bureau_type_name', width: "15%" },
{ title: '匹配类型', unresize: true, align: 'center', width: "15%", templet: '#match_tpl' },
{ title: '操作', unresize: true, align: 'center', width: "10%", toolbar: '#table-bar' }
]],
skin: 'line',
toolbar: true,
defaultToolbar: [{
title: '刷新',
layEvent: 'refresh',
icon: 'layui-icon-refresh',
}]
, parseData: function (res) {
for (var i = 0; i < res.data.length; i++) {
if (res.data[i].org_name != res.data[i].ty_org_name) {
res.data[i].LAY_CHECKED = true;
}
}
return res;
}
});
}
table.on('tool(data-table)', function (obj) {
if (obj.event === 'unMatch') {
window.unMatch(obj);
}
});
table.on('toolbar(data-table)', function (obj) {
if (obj.event === 'refresh') {
window.refresh();
}
});
window.unMatch = function (obj) {
var orgId = obj.data.org_id;
layer.confirm('确定要取消匹配吗?', {
icon: 3,
title: '提示'
}, function (index) {
$.ajax({
url: "/QingLong/collect/disMatchBureau",
async: false,
type: 'POST',
data: { "org_id": orgId },
success: function (res) {
if (res.success) {
layer.msg("取消匹配成功!", {
icon: 1,
time: 1300
}, function () {
refresh();
});
} else {
layer.msg(res.message, {
icon: 2,
time: 2000
});
}
},
error: function (xhr, status, error) {
layer.msg("出现异常!", {
icon: 2,
time: 1000
});
}
});
});
}
window.refresh = function (param) {
table.reload('data-table');
}
function GetQueryString(name, istop) {
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
var r = window.location.search.substr(1).match(reg);
if (typeof (istop) != "undefined") r = top.location.search.substr(1).match(reg);
if (r != null) return unescape(r[2]);
return null;
}
});
</script>
</body>
</html>