<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml">
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; 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, maximum-scale=1">
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../layuiadmin/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<style type="text/css">
|
input.layui-input.layui-unselect {
|
padding-right: 0;
|
}
|
|
.layui-body {
|
overflow-y: scroll;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-col-md12">
|
<div class="layui-card" style="padding: 1px">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-colla-title layui-inline">
|
<div class="layui-inline">
|
<span>更多</span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">阅读状态</label>
|
<div class="layui-input-block">
|
<select name="HReadFlag" lay-filter="HReadFlag" style="width:190px;">
|
<option value="-1" selected="selected">全部</option>
|
<option value="0">未阅</option>
|
<option value="1">已阅</option>
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">开始日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input" id="HBeginDate" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">结束日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input" id="HEndDate" style="width:190px;">
|
</div>
|
</div>
|
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch" style="padding:0 5px">重置</button>
|
<div class="layui-colla-content">
|
<div class="layui-inline">
|
<div class="layui-inline">
|
<span>其他条件></span>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">发送人</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HSendMan" id="HSendMan" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">紧急程度</label>
|
<div class="layui-input-block">
|
<select name="HLevel" lay-filter="HLevel" style="width:190px;">
|
<option value="-1" selected="selected">全部</option>
|
<option value="0">普通</option>
|
<option value="1">紧急</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Add"><i class="layui-icon layui-icon-file-b"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Edit"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Delete"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Audit" id="btn-Audit"><i class="layui-icon layui-icon-radio"></i>审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-DeAudit" id="btn-DeAudit"><i class="layui-icon layui-icon-circle"></i>反审核</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Case" id="btn-Case" style="display:none;"><i class="layui-icon layui-icon-note"></i>结案</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-Test" id="btn-Test" style="display:none;"><i class="layui-icon layui-icon-circle"></i>验证</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Refresh"><i class="layui-icon layui-icon-refresh-3"></i>刷新</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_Exit"><i class="layui-icon layui-icon-logout"></i>退出</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['index', 'form', 'table', 'element', 'laypage', 'laydate'], function () {
|
|
//#region 公共变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element
|
, laypage = layui.laypage
|
, laydate = layui.laydate
|
, util = layui.util
|
//查询条件
|
var sWhere = "";
|
var option = [];
|
//#endregion
|
|
//#region 进入页面既加载
|
//初始化表格
|
set_InitGrid();
|
//加载数据到网格
|
get_Display(sWhere);
|
//#endregion
|
|
//#region 点击事件包括on form事件等
|
//头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增按钮
|
case 'btn-Add':set_AddNew();
|
break;
|
//编辑按钮
|
case 'btn-Edit':set_ShowBill();
|
break;
|
//删除按钮
|
case 'btn-Delete':set_DeleteBill();
|
break;
|
//审核按钮
|
case 'btn-Audit': set_CheckBill();
|
break;
|
//反审核按钮
|
case 'btn-DeAudit': set_AbandonCheck();
|
break;
|
//刷新
|
case 'get_Refresh': set_Refresh();
|
break;
|
//退出
|
case 'get_Exit': Pub_Close(2);
|
break;
|
};
|
});
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
|
//查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery();
|
});
|
//#endregion
|
|
|
//#region 此页面所有方法
|
//初始化表格
|
function set_InitGrid() {
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
var columns = [
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'HInterID', title: '主内码', width: 200, hide: true }
|
, { field: 'HEntryID', title: '子内码', width: 200, hide: true }
|
, { field: 'HBillNo', title: '单据号', width: 200 }
|
, { field: 'HDate', title: '单据日期', width: 200, templet: "<div>{{d.HDate ==null ?'':layui.util.toDateString(d.HDate, 'yyyy-MM-dd')}}</div>" }
|
, { field: 'HBillStatus', title: '单据状态', width: 200, hide: true }
|
, { field: 'HMaterName', title: '产品名称', width: 200 }
|
, { field: 'HMaterModel', title: '规格型号', width: 200 }
|
, { field: 'HContext', title: '主题', width: 200 }
|
, { field: 'HDescription', title: '详细内容', width: 200 }
|
, { field: 'HRemark', title: '备注', width: 200 }
|
, { field: 'HQty', title: '数量', width: 100 }
|
, { field: 'HSendType', title: '发送类型', width: 100 }
|
, { field: 'HDeptName', title: '发送部门', width: 200 }
|
, { field: 'HSendMan', title: '发送人', width: 110 }
|
, { field: 'HReceiveMan', title: '接收人', width: 200 }
|
, { field: 'HCopyMan', title: '抄送人', width: 200 }
|
, { field: 'HHasten', title: '催促次数', width: 200 ,hide: true}
|
, { field: 'HLevel', title: '紧急程度', width: 200 }
|
, { field: 'HReadFlag', title: '阅读标记', width: 200 }
|
, { field: 'HMaker', title: '制单人', width: 200 }
|
, { field: 'HMakeDate', title: '制单日期', width: 200, templet: "<div>{{d.HMakeDate ==null ?'':layui.util.toDateString(d.HMakeDate, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
, { field: 'HUpDater', title: '修改人', width: 200 }
|
, { field: 'HUpDateDate', title: '修改日期', width: 200, templet: "<div>{{d.HUpDateDate ==null ?'':layui.util.toDateString(d.HUpDateDate, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
, { field: 'HChecker', title: '审核人', width: 200 }
|
, { field: 'HCheckDate', title: '审核日期', width: 200, templet: "<div>{{d.HCheckDate ==null ?'':layui.util.toDateString(d.HCheckDate, 'yyyy-MM-dd HH:mm:ss')}}</div>" }
|
];
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: true
|
, cellMinWidth: 120
|
, height: 'full-50'
|
, cols: [columns]
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, done: function (res, curr, count) {
|
|
}
|
};
|
}
|
//加载网格
|
function get_Display(sWhere) {
|
var wait = layer.load();//遮罩
|
|
$.ajax({
|
url: GetWEBURL() + '/Sc_MESTransFerWorkBill/Get_TransFerBillList',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
DataList = data1.data;
|
option.data = data1.data;
|
table.render(option);
|
layer.close(wait);
|
} else {
|
layer.close(wait);
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//新增
|
function set_AddNew() {
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '新增器具报废入库单',
|
closeBtn: 1,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: 'Sc_Add_MESExecptFeedBackBillList.html?OperationType=1&linterid=&HEntryID=&HSouceBillType=',
|
end: function () {
|
//刷新页面,
|
get_FastQuery(table, option);
|
},
|
success: function (layero, index) {
|
|
}
|
});
|
}
|
|
//编辑单据
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var HInterID = data[0].HInterID.toString();
|
var HEntryID = data[0].HEntryID.toString();
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '编辑异常反馈单'
|
, closeBtn: 1
|
, shade: 0.6 //遮罩透明度
|
, maxmin: true //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: 'Sc_Add_MESExecptFeedBackBillList.html?OperationType=3&linterid=' + HInterID + '&HEntryID=' + HEntryID+'&HSouceBillType='
|
, resize: false,
|
end: function () {
|
get_FastQuery(table, option);
|
}
|
, cancel: function () {
|
//$(".layui-btn").removeClass("layui-btn-disabled");
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
|
//删除
|
function set_DeleteBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var InterID = data[0].hmainid.toString();
|
var HEntryID = data[0].HEntryID.toString();
|
var HReadFlag = data[0].HReadFlag.toString();
|
if (HReadFlag == "未阅") {
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
var wait = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "Sc_MESTransFerWorkBill/Get_DeleteTransFerBill", //方法所在页面和方法名
|
data: { "HInterID": InterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
layer.close(wait);
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
}
|
else {
|
layer.msg('已阅公告不允许删除!');
|
}
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
}
|
|
//刷新
|
function set_Refresh() {
|
$("#btnSearch").click();
|
}
|
|
function get_FastQuery() {
|
var HStatus = $("select[name='HReadFlag']").val();//状态
|
var HBeginDate = $("#HBeginDate").val();//开始日期
|
var HEndDate = $("#HEndDate").val();//结束日期
|
var HSendMan = $("#HSendMan").val();//发送人
|
var HLevel = $("select[name='HLevel']").val();//紧急程度
|
if (HStatus) {
|
switch (HStatus) {
|
case '-1': //全部
|
sWhere += "";
|
break;
|
case '0': //未阅
|
sWhere += " and B.HReadFlag='0'";
|
break;
|
case '1': //已阅
|
sWhere += " and B.HReadFlag='1'";
|
break;
|
default:
|
}
|
}
|
if (HBeginDate) {
|
sWhere += " and CONVERT(varchar(100),A.HDate, 23) >= '" + HBeginDate + "'";
|
}
|
if (HEndDate) {
|
sWhere += " and CONVERT(varchar(100),A.HDate, 23) <= '" + HEndDate + "'";
|
}
|
if (HSendMan) {
|
sWhere += " and A.HSendMan like '%" + HSendMan + "%'";
|
}
|
if (HLevel) {
|
switch (HLevel) {
|
case '-1': //全部
|
sWhere += "";
|
break;
|
case '0': //普通
|
sWhere += " and A.HLevel='0'";
|
break;
|
case '1': //紧急
|
sWhere += " and A.HLevel='1'";
|
break;
|
default:
|
}
|
}
|
get_Display(sWhere);
|
//调用接口后清空sWhere缓存
|
sWhere = "";
|
}
|
|
//重置过滤条件
|
function set_ClearQuery() {
|
$('#HReadFlag').find("option[value='-1']").attr("selected", true);
|
$("#HBeginDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));
|
$("#HEndDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HSendMan").val("");
|
$('#HLevel').find("option[value='-1']").attr("selected", true);
|
sWhere = "";
|
get_Display(sWhere);
|
}
|
//#endregion
|
|
//审核
|
function set_AuditBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var HBillStatus = data[0].HBillStatus.toString(); //单据状态
|
var InterID = data[0].hmainid.toString();
|
if (HBillStatus > 0) {
|
layer.msg('单据不为未审核状态,不能再次审核!');
|
return false;
|
}
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESTransFerWorkBill/AuditTransFerReportList", //方法所在页面和方法名
|
data: { "HInterID": InterID, "IsAudit": 0, "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
|
}
|
else {
|
layer.msg('请选择一行数据审核!');
|
}
|
}
|
|
//反审核
|
function set_DeAuditBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var HBillStatus = data[0].HBillStatus.toString(); //单据状态
|
var InterID = data[0].hmainid.toString();
|
if (HBillStatus=0) {
|
layer.msg('单据未审核状态,无需反审核!');
|
return false;
|
}
|
//逻辑审核方法
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Sc_MESTransFerWorkBill/AuditTransFerReportList", //方法所在页面和方法名
|
data: { "HInterID": InterID, "IsAudit": 1, "CurUserName": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg(result.Message, { time: 1 * 1000, icon: 1 }, function () {
|
// 得到frame索引
|
var index = layer.getFrameIndex(window.name);
|
//关闭当前frame
|
layer.close(index);
|
//修改为功后刷新界面
|
window.location.reload();
|
});
|
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
|
}
|
else {
|
layer.msg('请选择一行数据反审核!');
|
}
|
}
|
|
//点击表格数据阅读
|
table.on('rowDouble(mainTable)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
var datas = obj.data; //获得当前行数据
|
console.log(datas);
|
layer.open({
|
type: 2,
|
skin: 'layui-layer-rim', //加上边框
|
title: '阅读明细 ',
|
closeBtn: false,
|
shift: 2,
|
area: ['100%', '100%'],
|
maxmin: true,
|
content: '../../生产管理/异常反馈单/EXecptFeedMessage.html',
|
end: function () {
|
//刷新页面,
|
location.reload();
|
},
|
success: function (dom) {
|
var a = $(dom[0]).find("iframe").eq(0).contents();
|
a.find("h1").html(datas.HContext);
|
a.find("span").html(datas.HDate);
|
a.find(".layadmin-text").html(datas.HDescription);
|
UpdateMessage(datas.HInterID, datas.HEntryID);
|
},
|
});
|
});
|
|
//更新异常反馈单阅读状态
|
function UpdateMessage(HInterID, HEntryID) {
|
$.ajax({
|
url: GetWEBURL() + 'Sc_MESTransFerWorkBill/Get_UpdateTransFerMessage',
|
type: "GET",
|
data: { "HInterID": HInterID, "HEntryID": HEntryID },
|
success: function (data1) {
|
if (data1.count == 1) {
|
|
} else {
|
|
}
|
}, error: function () {
|
layer.close(index);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
|
//以上是layui模块
|
});
|
</script>
|
|
</body>
|
</html>
|