<!DOCTYPE html>
|
<html>
|
|
<head>
|
<meta charset="utf-8">
|
<title>抽检流水列表</title>
|
<meta name="renderer" content="webkit">
|
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
|
<meta name="viewport"
|
content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
</head>
|
|
<body>
|
|
<div class="layui-fluid" style="padding-bottom: 0;">
|
<div class="layui-card">
|
<div class="layui-form layui-card-header layuiadmin-card-header-auto">
|
<div class="layui-form-item">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">抽检单据</label>
|
<div class="layui-input-inline">
|
<input type="text" id="SpotCheckNotify" name="SpotCheckNotify" placeholder="抽检单据" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">批次</label>
|
<div class="layui-input-inline">
|
<input type="text" id="LotNo" name="LotNo" placeholder="批次" autocomplete="off"
|
class="layui-input">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">抽检结果</label>
|
<div class="layui-input-inline">
|
<select name="SpotCheckResults" id="SpotCheckResults" lay-filter="State" lay-search>
|
<option value=""></option>
|
<option value="1">合格</option>
|
<option value="0">不合格</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">开始时间</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="StartTime" id="StartTime" class="layui-input"
|
placeholder="开始时间">
|
</div>
|
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 60px;">结束时间</label>
|
<div class="layui-input-inline">
|
<input type="text" autocomplete="off" name="EndTime" id="EndTime" class="layui-input"
|
placeholder="结束时间">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<button class="layui-btn layui-btn-sm layuiadmin-btn-list" lay-submit
|
lay-filter="LAY-app-contlist-search">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>搜索
|
</button>
|
</div>
|
</div>
|
</div>
|
|
<div class="layui-card-body">
|
<div style="padding-bottom: 5px; display: flex; flex-direction: row-reverse;">
|
|
<button style="margin-right: 10px;" id="addBtn" class="layui-btn layui-btn-sm layuiadmin-btn-list"
|
data-type="add" id="approvalBtn"><i class="layui-icon"></i>添加</button>
|
</div>
|
<table id="LAY-app-content-list" lay-filter="LAY-app-content-list"></table>
|
<script type="text/html" id="results">
|
{{# if(d.SpotCheckResults=='0'){ }}
|
<button class="layui-btn layui-btn-radius layui-btn-danger layui-btn-xs">不合格</button>
|
{{# } else { }}
|
<button class="layui-btn layui-btn-radius layui-btn-xs">合格</button>
|
{{# } }}
|
</script>
|
</div>
|
</div>
|
</div>
|
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../js/public.js"></script>
|
<script src="../../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../../js/jquery.cookie.js"></script>
|
<script type="text/javascript">
|
|
</script>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table', 'laypage', 'layer','laydate'], function () {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer;
|
laydate = layui.laydate;
|
|
laydate.render({
|
elem: '#StartTime'
|
, format: 'dd-MM-yyyy' //可任意组合
|
});
|
laydate.render({
|
elem: '#EndTime'
|
, format: 'dd-MM-yyyy' //可任意组合
|
});
|
|
var param = {
|
Id: $.cookie('userId')
|
}
|
var time = "/Date(1641810689570)/".substring(6, 19);
|
|
|
var url = IP + "/SpotCheck/GetSpotCheckList"
|
var where = {
|
// msg: $("#ComCode").val() + '-' + $("#ComName").val(),
|
SpotCheckNotify: $("#SpotCheckNotify").val(),
|
LotNo:$("#LotNo").val(),
|
SpotCheckResults: $("#SpotCheckResults").val(),
|
StartTime:$("#StartTime").val().split("-").reverse().join("-"),
|
EndTime:$("#EndTime").val().split("-").reverse().join("-")
|
};
|
var tableIns = table.render({
|
elem: '#LAY-app-content-list',
|
height: 'full-130',
|
id: 'LAY-app-content-list',
|
url: url,
|
method: 'post',
|
where: where,
|
contentType: 'application/json',
|
page: true,
|
limit: pageCnt, //默认多少页
|
limits: pageLimits, //默认数组[10,20,30,40,50]
|
cellMinWidth: 80, //全局定义常规单元格的最小宽度,layui 2.2.1 新增
|
// even: true,
|
|
cols: [
|
[{
|
type: 'numbers',
|
title: '序号',
|
width: 60,
|
fixed: 'left'
|
}, {
|
field: 'SpotCheckNotify',
|
title: '抽检单据',
|
align: 'center',
|
}, {
|
field: 'LotNo',
|
title: '批次',
|
width: 200,
|
align: 'center',
|
}, {
|
field: 'SpotCheckResults',
|
title: '抽检结果',
|
width: 150,
|
align: 'center',
|
templet:'#results'
|
}, {
|
field: 'Sender',
|
title: '来源',
|
width: 150,
|
align: 'center',
|
},{
|
field: 'Remarks',
|
title: '备注',
|
width: 360,
|
align: 'center',
|
}, {
|
field: 'AddName',
|
title: '创建人',
|
width: 200,
|
align: 'center',
|
}, {
|
field: 'CreateTime',
|
title: '创建时间',
|
align: 'center',
|
width: 200,
|
templet: function(d) {
|
return formatDate(d.CreateTime);
|
},
|
}, ]
|
],
|
|
});
|
|
|
//监听搜索
|
form.on('submit(LAY-app-contlist-search)', function (data) {
|
// var code = data.field.ComCode;//计量编码
|
// var name = data.field.ComName;//计量名称
|
// refreshTable();
|
// console.log($("#StartTime").val().split("-").reverse().join("-"));
|
tableIns.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
SpotCheckNotify: $("#SpotCheckNotify").val(),
|
LotNo:$("#LotNo").val(),
|
SpotCheckResults: $("#SpotCheckResults").val(),
|
StartTime:$("#StartTime").val().split("-").reverse().join("-"),
|
EndTime:$("#EndTime").val().split("-").reverse().join("-")
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
});
|
// ------------------------------------多删除、新增---------------------------------------------------
|
// var $ = layui.$,
|
active = {
|
add: function () {
|
layer.open({
|
type: 2,
|
title: '抽检信息',
|
content: 'SpotCheckOrderForm.html',
|
maxmin: true,
|
area: ['450px', '400px'],
|
btn: ['确定', '取消'],
|
yes: function (index, layero) {
|
var iframeWindow = window['layui-layer-iframe' + index],
|
submitID = 'layuiadmin-app-form-submit',
|
submit = layero.find('iframe').contents().find('#' + submitID);
|
//监听提交
|
iframeWindow.layui.form.on('submit(' + submitID + ')', function (
|
data) {
|
var field = data.field; //获取提交的字段
|
console.log(field);
|
|
if (!$.cookie('userId')) {
|
layer.msg('登陆失效,请重新登陆', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
window.parent.location.href =
|
"../Login.html";
|
});
|
}
|
//提交 Ajax 成功后,静态更新表格中的数据
|
var param = {
|
SpotCheckNotify: field.SpotCheckNotify,
|
LotNo: field.LotNo,
|
Results: field.Results,
|
Remark:field.Remark,
|
UserId: $.cookie('userId') //当前登录人
|
};
|
sendData(IP + "/SpotCheck/SpotCheckResult", param, 'post',
|
function (res) {
|
console.log(res);
|
if (res.code == 1) { //成功
|
layer.msg(res.msg, {
|
icon: 1,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
tableIns.reload({
|
where: { //设定异步数据接口的额外参数,任意设
|
SpotCheckNotify: $("#SpotCheckNotify").val(),
|
LotNo:$("#LotNo").val(),
|
SpotCheckResults: $("#SpotCheckResults").val(),
|
StartTime:$("#StartTime").val().split("-").reverse().join("-"),
|
EndTime:$("#EndTime").val().split("-").reverse().join("-")
|
},
|
page: {
|
curr: 1 //重新从第 1 页开始
|
}
|
});
|
layer.close(index); //关闭弹层
|
});
|
} else { //不成功
|
layer.msg(res.msg, {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
});
|
}
|
});
|
//$.ajax({});
|
});
|
submit.trigger('click');
|
}
|
});
|
}
|
};
|
$('.layui-btn.layuiadmin-btn-list').on('click', function () {
|
var type = $(this).data('type');
|
active[type] ? active[type].call(this) : '';
|
});
|
|
//判断是否有按钮权限
|
$(function () {
|
$("#addBtn").hide();
|
});
|
sendData(IP + "/Menu/GetPermission", param, 'post', function (res) {
|
|
|
if (res.code == 1) { //成功
|
|
for (var k = 0; k < res.data.length; k++) {
|
if (res.data[k].ModuleId == "3d9343985f2643b9a0ea4b63165f994f") {
|
$(function () {
|
$("#addBtn").show();
|
});
|
}
|
}
|
} else { //不成功
|
layer.msg('获取信息失败', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function () {
|
//回调
|
});
|
}
|
});
|
|
|
|
|
|
// ------------------------------------删除、编辑---------------------------------------------------
|
//#region
|
// table.on('tool(LAY-app-content-list)', function (obj) {
|
// var data = obj.data;
|
// // console.log(obj.event);
|
// if (obj.event === 'del') {
|
// layer.confirm('确定删除选中的单位?', function (index) {
|
// // console.log(data);
|
// cusid = data.UnitId;
|
// var param = {
|
// msg: cusid,
|
// };
|
// sendData(IP + "/Company/DelUnit", param, 'post', function (res) {
|
// console.log(res);
|
// if (res.code == 1) { //成功
|
// layer.msg(res.msg, {
|
// icon: 1,
|
// time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () {
|
// tableIns.reload({
|
// where: { //设定异步数据接口的额外参数,任意设
|
// Code: $("#ComCode").val(),
|
// Name: $("#ComName").val(),
|
// },
|
// page: {
|
// curr: 1 //重新从第 1 页开始
|
// }
|
// });
|
// });
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// });
|
// }
|
// });
|
// });
|
// } else if (obj.event === 'edit') {
|
// cusId = data.UnitId;
|
// layer.open({
|
// type: 2,
|
// title: '编辑单位信息',
|
// content: 'companylistform.html?id=' + cusId,
|
// maxmin: true,
|
// area: ['450px', '350px'],
|
// btn: ['确定', '取消'],
|
// yes: function (index, layero) {
|
// var iframeWindow = window['layui-layer-iframe' + index],
|
// submitID = 'layuiadmin-app-form-edit',
|
// submit = layero.find('iframe').contents().find('#' + submitID);
|
// //监听提交
|
// iframeWindow.layui.form.on('submit(' + submitID + ')', function (
|
// data) {
|
// var field = data.field; //获取提交的字段
|
// console.log(field);
|
// if (!$.cookie('userId')) {
|
// layer.msg('登陆失效,请重新登陆', {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () {
|
// window.parent.location.href =
|
// "../Login.html";
|
// });
|
// }
|
// //提交 Ajax 成功后,静态更新表格中的数据
|
// var param = {
|
// UnitId: cusId,
|
// UnitCode: field.UnitCode,
|
// UnitName: field.UnitName,
|
// UnitAbbrevName: field.UnitAbbrevName,
|
// UnitRemark: field.UnitRemark,
|
// CreateUser: $.cookie('userId') //当前登录人
|
// };
|
// sendData(IP + "/Company/SaveUnit", param, 'post',
|
// function (res) {
|
// console.log(res);
|
// if (res.code == 1) { //成功
|
// layer.msg("修改成功", {
|
// icon: 1,
|
// time: 1000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () {
|
// tableIns.reload({
|
// where: { //设定异步数据接口的额外参数,任意设
|
// Code: $(
|
// "#ComCode")
|
// .val(),
|
// Name: $(
|
// "#ComName")
|
// .val(),
|
// },
|
// page: {
|
// curr: 1
|
// }
|
// });
|
// layer.close(index); //关闭弹层
|
// });
|
// } else { //不成功
|
// layer.msg(res.msg, {
|
// icon: 2,
|
// time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
// }, function () { });
|
// }
|
// });
|
// //$.ajax({});
|
// });
|
// submit.trigger('click');
|
// }
|
// });
|
// }
|
// });
|
//#endregion
|
});
|
</script>
|
|
</body>
|
|
</html>
|