1 Star 0 Fork 1

邹大大sir/AssetsSysHtml

forked from 天辰/AssetsSysHtml 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
DepartmentAssets.html 7.88 KB
一键复制 编辑 原始数据 按行查看 历史
天辰 提交于 2020-04-30 00:12 . 修改
<!DOCTYPE html>
<html class="x-admin-sm">
<head>
<meta charset="UTF-8">
<title>学校固定资产管理系统</title>
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<link rel="stylesheet" href="./css/font.css">
<link rel="stylesheet" href="./css/xadmin.css">
<script src="./lib/layui/layui.js" charset="utf-8"></script>
<script type="text/javascript" src="./js/xadmin.js"></script>
<!--[if lt IE 9]>
<script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
<script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
<![endif]-->
</head>
<body>
<div class="x-nav">
<span class="layui-breadcrumb">
<a>首页</a>
<a>资产信息</a>
<a>
<cite>部门资产</cite>
</a>
</span>
<a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
<i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
</a>
</div>
<div class="layui-fluid">
<div class="layui-row layui-col-space15">
<div class="layui-col-md12">
<div class="layui-card">
<div class="layui-card-body">
<div class="layui-inline layui-show-xs-block">
<input type="text" name="assetsNum" id="assetsNum" placeholder="资产编号" autocomplete="off" class="layui-input">
</div>
<div class="layui-inline layui-show-xs-block">
<input type="text" name="assetsName" id="assetsName" placeholder="资产名称" autocomplete="off" class="layui-input">
</div>
<div class="layui-inline layui-show-xs-block">
<button class="layui-btn" id="searchBtn">
<i class="layui-icon">&#xe615;</i>
</button>
</div>
</div>
<div class="layui-card-header">
<button class="layui-btn" onclick="xadmin.open('资产入库','./assets-add.html',451,500)">
<i class="layui-icon"></i>添加</button>
</div>
<div class="layui-card-body layui-form">
<table id="assets"></table>
</div>
</div>
</div>
</div>
</div>
</body>
<script>
//初始状态
var status = ["正常", "闲置", "故障", "内部转移"]
layui.use('table', function () {
var table = layui.table;
var from = layui.from;
//表格实例化
table.render({
elem: '#assets'
, height: 500
, headers: { 'token': sessionStorage.getItem("token") }
, url: sessionStorage.getItem("api") + 'department/assets/list'
, where: { StatusStr: status }
, page: true
, request: {
pageName: 'PageIndex'
, limitName: 'PageSize'
}
, parseData: function (res) {
return {
"code": res.Data.Code,
"msg": res.Data.Msg,
"count": res.Data.Count,
"data": res.Data.Data
};
}
, cols: [
[
{ type: 'numbers', title: '序号', width: 80 }
, { field: 'AssetsNum', title: '编号', width: 100 }
, { field: 'AssetsName', title: '名称', width: 140 }
, { field: 'AssetsDescribe', title: '描述' }
, { field: 'DecimalStr', title: '价值', width: 150 }
, { field: 'Type', title: '类型', width: 80 }
, { field: 'AgeLimitStr', title: '使用年限', width: 80 }
, { field: 'Source', title: '来源', width: 80 }
, { field: 'Status', title: '状况', width: 80 }
, {
title: '负责人', width: 80,
templet: function (d) {
return d.PrincipalUser
//return d.PrincipalDepartment + " " + d.PrincipalUser
}
}
// , {
// title: '入库人',
// templet: function (d) {
// return d.StorageDepartment + " " + d.StorageUser
// }
// }
, {
title: '操作',
templet: '#button'
}
]
]
});
//查询实现
$('#searchBtn').on('click', function () {
var assetsNum = $("#assetsNum").val();
var assetsName = $("#assetsName").val();
table.reload('assets', {
where: { //设定异步数据接口的额外参数,任意设
StatusStr: status,
AssetsName: assetsName,
AssetsNum: assetsNum
}
, page: {
curr: 1 //重新从第 1 页开始
}
});
});
});
var pid = "";
layui.use('form', function () {
var form = layui.form;
form.on('submit(modify)', function (data) {
console.log(data.elem.attributes.id.nodeValue) //获取当前元素的ID
pid = data.elem.attributes.id.nodeValue
layer.open({
type: 2,
area: ['451px', '300px'],
fix: false,
maxmin: true,
shadeClose: true,
shade: 0.4,
title: "资产变动",
content: 'assets-modify.html'
});
});
form.on('submit(fixup)', function (data) {
console.log(data.elem.attributes.id.nodeValue) //获取当前元素的ID
pid = data.elem.attributes.id.nodeValue
layer.open({
type: 2,
area: ['451px', '300px'],
fix: false,
maxmin: true,
shadeClose: true,
shade: 0.4,
title: "损坏报修",
content: 'assets-fixup.html'
});
});
var form = layui.form;
form.on('submit(edit)', function (data) {
console.log(data.elem.attributes.id.nodeValue) //获取当前元素的ID
pid = data.elem.attributes.id.nodeValue
layer.open({
type: 2,
area: ['451px', '400px'],
fix: false,
maxmin: true,
shadeClose: true,
shade: 0.4,
title: "编辑资产",
content: 'assets-edit.html'
});
});
});
</script>
<script type="text/html" id="button">
<input type="button" class="{{(d.Status=='内部转移'||d.Status=='故障')?'layui-btn layui-btn-radius layui-btn-disabled':'layui-btn layui-btn-radius layui-btn-normal'}}" lay-submit lay-filter = "{{(d.Status=='内部转移'||d.Status=='内部转移')?'':'modify'}}" id="{{d.Id}}" value="资产变动">
<input type="button" class="{{(d.Status=='内部转移'||d.Status=='故障')?'layui-btn layui-btn-radius layui-btn-disabled':'layui-btn layui-btn-radius layui-btn-normal'}}" lay-submit lay-filter = "{{(d.Status=='内部转移'||d.Status=='内部转移')?'':'fixup'}}" id="{{d.Id}}" value="损坏报修">
<input type="button" class="layui-btn layui-btn-radius layui-btn-normal" lay-submit lay-filter = "edit" id="{{d.Id}}" value="修改信息">
</script>
</html>
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
HTML
1
https://gitee.com/zou-dada-sir/AssetsSysHtml.git
git@gitee.com:zou-dada-sir/AssetsSysHtml.git
zou-dada-sir
AssetsSysHtml
AssetsSysHtml
master

搜索帮助