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.

249 lines
8.3 KiB

<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title></title>
<link rel="stylesheet" href="../../../component/layui/css/layui.css" />
<style>
th {
color: #303133;
background-color: #f5f7fa;
}
.layui-card {
box-shadow: 0 0 0 0 rgba(0, 0, 0, 0) !important;
margin-bottom: 0 !important;
}
.layui-form-item {
margin-bottom: 0;
}
.layui-table td,
.layui-table th {
font-size: 12px;
}
.bp {
background-color: rgba(23, 179, 163, .1);
padding: 5px 10px;
height: 32px;
line-height: 30px;
font-size: 12px;
color: #17b3a3;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid rgba(23, 179, 163, .2);
white-space: nowrap;
}
.xp {
background-color: rgba(144, 147, 153, .1);
padding: 5px 10px;
height: 32px;
line-height: 30px;
font-size: 12px;
color: #909399;
border-radius: 4px;
-webkit-box-sizing: border-box;
box-sizing: border-box;
border: 1px solid rgba(144, 147, 153, .2);
white-space: nowrap;
}
.woo-tool-text-delimiter {
width: 1px;
height: 12px;
background: #EEEEEE;
display: inline-block;
margin: 0 6px 0 4px;
}
.woo-theme-color {
color: #2d8cf0 !important;
}
.woo-tool-span {
margin: 0 3px;
position: relative;
top: -1px;
cursor: pointer;
}
</style>
</head>
<body class="layui-form">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-form-item layui-inline">
<button class="layui-btn layui-btn-sm" lay-submit lay-filter="add">
<i class="layui-icon layui-icon-add-1"></i>
新 增
</button>
</div>
<div class="layui-form-item layui-inline" style="float: right;">
<button class="layui-btn layui-btn-sm layui-btn-primary layui-border" lay-submit lay-filter="back">
<i class="layui-icon layui-icon-return"></i>
返回
</button>
</div>
<table class="layui-table" id="myTable"></table>
<script type="text/html" id="hlwdkTpl">
{{ d.hlwdk == 0 ? '' : d.hlwdk }}
</script>
<script type="text/html" id="htnjfyTpl">
{{ d.htnjfy == 0 ? '' : d.htnjfy }}
</script>
<script type="text/html" id="bjsTpl">
{{ d.bjs == 0 ? '' : d.bjs }}
</script>
<script type="text/html" id="dkTpl">
{{ d.dk == 0 ? '' : d.dk }}
</script>
<script type="text/html" id="table-bar">
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="edit"><a
class="woo-theme-color">编辑</a></span>
<i class="woo-tool-text-delimiter"></i>
<span class="woo-tool-span woo-tool-text-span" data-tool-sort="120" lay-event="remove"><a
class="woo-theme-color">删除</a></span>
</script>
</div>
</div>
<script src="../../../component/layui/layui.js"></script>
<script src="../../../component/pear/xm-select.js"></script>
<script>
layui.extend({
toast: '../../../component/pear/module/toast' // {/}的意思即代表采用自有路径,即不跟随 base 路径
}).use(['toast'], function () {
var $ = layui.jquery;
var table = layui.table;
var form = layui.form;
table.render({
elem: '#myTable',
url: '/QingLong/zbdc/getXxzbdcList?dcb_id=8',
height: 'full-70',
cols: [
[
{ title: '序号', align: 'center', width: "5%", type: 'numbers' },
{ title: '互联网带宽(MB)', align: 'center', width: "10%", templet: '#hlwdkTpl' },
{ title: '接入IP', field: 'jrip', align: 'center', width: "10%" },
{ title: '服务商(联通,电信,移动等)', field: 'wfs', align: 'center', width: "15%" },
{ title: '合同年均费用(万元)', align: 'center', width: "10%", templet: '#htnjfyTpl' },
{ title: '合同服务期', field: 'htfwq', align: 'center', width: "10%" },
{ title: '班级数', align: 'center', width: "10%", templet: '#bjsTpl' },
{ title: '是否有防火墙', field: 'fhq', align: 'center', width: "10%", },
{ title: '内部主干网络是否为光纤', field: 'zgwgx', align: 'center', width: "10%" },
// { title: '带宽(MB)', align: 'center', width: "5%", templet: '#dkTpl' },
{ title: '操作', align: 'center', width: "10%", rowspan: 2, toolbar: '#table-bar' }
]
],
defaultToolbar: []
});
form.on('submit(add)', function () {
layer.open({
type: 2,
title: '新增',
shade: 0.1,
area: ['930px', '320px'],
content: './xxjszb_wlaq_add.html'
});
// 阻止表单的默认提交行为
return false;
});
form.on('submit(back)', function () {
window.location.href = "./xxjszb.html";
// 阻止表单的默认提交行为
return false;
});
table.on('tool(myTable)', function (obj) {
if (obj.event === 'remove') {
layer.confirm('确定要删除该数据吗?', {
icon: 3,
title: '提示'
}, function (index) {
layer.close(index);
let loading = layer.load();
$.ajax({
url: "/QingLong/zbdc/delXxzbdcSingle",
data: { dcb_id: 8, "id": obj.data.id },
type: 'post',
success: function (result) {
layer.close(loading);
if (result.success) {
layer.msg('删除成功!', {
icon: 1,
time: 1000
}, function () {
table.reload('myTable');
});
} else {
layer.msg(result.message, {
icon: 2,
time: 1000
});
}
},
error: function (xhr, status, error) {
layer.close(loading);
console.log('请求出错:' + error + ',' + status);
}
})
});
} else if (obj.event === 'edit') {
layer.open({
type: 2,
title: '编辑',
shade: 0.1,
area: ['930px', '320px'],
content: './xxjszb_wlaq_update.html?id=' + obj.data.id
});
}
});
});
</script>
</body>
</html>