<!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/Scripts/json2.js"></script>
|
<script src="../../../layuiadmin/Scripts/jquery-1.4.1.js"></script>
|
<script src="../../../layuiadmin/Scripts/webConfig.js"></script>
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.js"></script>
|
<script src="../../../layuiadmin/PubCustom.js"></script>
|
|
</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" style="width:100px">
|
<select name="city" lay-verify="required" id="SHPrintQty">
|
<option value="全部">全部</option>
|
<option value="未打印">未打印</option>
|
<option value="已打印">已打印</option>
|
</select>
|
</div>
|
</div>
|
<input type="checkbox" id="wybj" name="wybj" title="只显示委外" lay-filter="wybj" lay-skin="primary">
|
<div class="layui-inline">
|
<label class="layui-form-label">开始日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input" id="HDate">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">结束日期</label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input" id="HDate1">
|
</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="HOrderProcNO" id="HOrderProcNO">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HProcExchBillNo" id="SHname">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
<table class="" id="mainTable2" lay-filter="mainTable2"></table>
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_AddNew"><i class="layui-icon layui-icon-file-b"></i>新增</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_ShowBill"><i class="layui-icon layui-icon-form"></i>编辑</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_DeleteBill"><i class="layui-icon layui-icon-delete"></i>删除</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_view"><i class="layui-icon layui-icon-tips"></i>预览</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn_print"><i class="layui-icon layui-icon-print"></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>
|
|
<style>
|
.layui-table-cell {
|
height: 22px;
|
}
|
</style>
|
<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 = " 产品代码 = 'BX0002'";
|
var sWhere = "";
|
var option = "";
|
var option2 = "";
|
var wybj = false;
|
//#endregion
|
|
//#region 进入页面即加载
|
|
//初始化界面
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
switch (obj.event) {
|
//新增
|
case 'set_AddNew': set_AddNew();
|
break;
|
//编辑
|
case 'set_ShowBill': set_ShowBill();
|
break;
|
//删除
|
case 'set_DeleteBill': set_DeleteBill();
|
break;
|
//刷新
|
case 'get_Refresh': get_Refresh();
|
break;
|
//退出按钮
|
case 'get_Exit': Pub_Close(2);
|
break;
|
//预览
|
case 'btn_view': get_view();
|
break;
|
//打印
|
case 'btn_print': get_print();
|
break;
|
};
|
});
|
|
//#endregion
|
|
//#region 重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
//#endregion
|
|
//#region 查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery();
|
});
|
//#endregion
|
|
|
//#region 本页面所有被调用的方法
|
function set_ClearBill() {
|
$("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//开始日期
|
$("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));//结束日期
|
//初始化主表列表
|
set_InitGrid();
|
//初始化从表列表
|
set_InitGrid2();
|
//查询
|
get_Display(sWhere);
|
}
|
|
|
//#region 重置过滤条件方法
|
function set_ClearQuery() {
|
$("#SHPrintQty").val("");//打印状态
|
$("input[type='checkbox'][name='wybj']").prop('checked', false);
|
form.render("checkbox");//委外标记
|
$("#HDate").val("");//开始日期
|
$("#HDate1").val("");//结束日期
|
$("#HOrderProcNO").val("");//订单跟踪号
|
$("#SHname").val("");//物料|子件名称|子件规格
|
//$("#btnSearch").click();
|
sWhere = "";
|
get_Display(sWhere);
|
}
|
//#endregion
|
|
//#region 快速过滤
|
function get_FastQuery() {
|
var SHPrintQty = $("#SHPrintQty").val();//打印状态
|
var HDate = $("#HDate").val();//开始日期
|
var HDate1 = $("#HDate1").val();//结束日期
|
var HOrderProcNO = $("#HOrderProcNO").val();//订单跟踪号
|
var SHname = $("#SHname").val();//物料|子件名称|子件规格
|
if (SHPrintQty) {//判断打印状态
|
if (SHPrintQty == "全部") {
|
sWhere = " and 打印次数 >= 0 ";
|
}
|
if (SHPrintQty == "已打印") {
|
sWhere = " and 打印次数 > 0 ";
|
}
|
if (SHPrintQty == "未打印") {
|
sWhere = " and 打印次数 = 0 ";
|
}
|
}
|
if (wybj) {
|
sWhere += " and 委外标记 = 'Y'";
|
}
|
if (HDate) {
|
sWhere += " and 日期 >= '" + HDate + "'";
|
}
|
if (HDate1) {
|
sWhere += " and 日期 <= '" + HDate1 + "'";
|
}
|
if (HOrderProcNO) {
|
sWhere += " and 订单跟踪号 like '%" + HOrderProcNO + "%'";
|
}
|
if (SHname) {
|
sWhere += " and 子件名称 like '%" + SHname + "%' or 子件规格 like '%" + SHname + "%'"
|
}
|
get_Display(sWhere);
|
sWhere = "";//调用接口后清空sWhere缓存
|
}
|
//#endregion
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
|
//选中判断
|
form.on('checkbox(wybj)', function (data) {
|
wybj = data.elem.checked; //是否被选中,true或者false
|
});
|
|
//点击主表带出从表数据
|
table.on('row(mainTable)', function (obj) { //注:tool 是工具条事件名,test 是 table 原始容器的属性 lay-filter="对应的值"
|
var datas = obj.data; //获得当前行数据
|
var HMainID = datas.hmainid;
|
var wait = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/LEMS/MES_Sc_ProcessExchangeBillQuerySub_Json',
|
type: "GET",
|
data: { "sWhere": HMainID },
|
success: function (data1) {
|
if (data1.count == 1) {
|
option2.data = data1.data;
|
table.render(option2);
|
layer.close(wait);
|
} else {
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
layer.close(wait);
|
}
|
}, error: function () {
|
layer.close(wait);
|
layer.alert("接口失效!", { icon: 5 });
|
}
|
});
|
});
|
|
//#endregion
|
|
|
//初始化主表列表
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: true
|
, height: 300
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'hmainid', title: 'hmainid', width: 90, hide: true}
|
, { field: '打印次数', title: '打印次数' }
|
, { field: '类型', title: '类型' }
|
, {
|
field: '日期', title: '日期', width: 120, sort: true, templet: function (d) {
|
if (d.日期 == null) {
|
return "";
|
}
|
return util.toDateString(d.日期, "yyyy-MM-dd");
|
}
|
}
|
, { field: '订单跟踪号', title: '订单跟踪号', width: 120 }
|
, { field: '单据号', title: '单据号', width: 190 }
|
, { field: 'hicmointerid', title: 'hicmointerid', width: 80, hide: true}
|
, { field: '任务单号', title: '任务单号', width: 140 }
|
, { field: 'HWorkShopID', title: 'HWorkShopID', width: 80, hide: true}
|
, { field: 'HDeptID', title: 'HDeptID', width: 80, hide: true}
|
, { field: '生产车间代码', title: '生产车间代码', width: 115 }
|
, { field: '生产车间', title: '生产车间' }
|
, { field: '委外标记', title: '委外标记' }
|
, { field: 'HMaterID', title: 'HMaterID', width: 80, hide: true}
|
, { field: '子件代码', title: '子件代码' }
|
, { field: '子件名称', title: '子件名称' }
|
, { field: '子件规格', title: '子件规格' }
|
, { field: '批号', title: '批号' }
|
, { field: '原料批次号', title: '原料批次号' }
|
, { field: 'HMaterID2', title: 'HMaterID2', width: 80, hide: true}
|
, { field: '产品代码', title: '产品代码' }
|
, { field: '产品名称', title: '产品名称' }
|
, { field: '规格型号', title: '规格型号' }
|
, { field: 'HUnitID', title: 'HUnitID', width: 80, hide: true}
|
, { field: '单位代码', title: '单位代码' }
|
, { field: '单位', title: '单位' }
|
, { field: '设备模具代码', title: '设备模具代码' }
|
, { field: '设备模具', title: '设备模具' }
|
, { field: '生产数量', title: '生产数量' }
|
, { field: '流转卡数量', title: '流转卡数量' }
|
, { field: '计划开工日期', title: '计划开工日期' }
|
, { field: '计划完工日期', title: '计划完工日期' }
|
, { field: '摘要', title: '摘要' }
|
, { field: '内部单据号', title: '内部单据号' }
|
, { field: '表头备注', title: '表头备注' }
|
, { field: '制单人', title: '制单人' }
|
, { field: '制单日期', title: '制单日期' }
|
, { field: '审核人', title: '审核人' }
|
, { field: '审核日期', title: '审核日期' }
|
, { field: '修改人', title: '修改人' }
|
, { field: '修改日期', title: '修改日期' }
|
, { field: '关闭人', title: '关闭人' }
|
, { field: '关闭日期', title: '关闭日期' }
|
, { field: '作废人', title: '作废人' }
|
, { field: '作废日期', title: '作废日期' }
|
, { field: 'HBillType', title: 'HBillType', width: 80, hide: true}
|
, { field: 'hsubid', title: 'hsubid', width: 80, hide: true}
|
, { field: '拆分数量', title: '拆分数量' }
|
]]
|
};
|
table.render(option);
|
}
|
|
//初始化从表列表
|
function set_InitGrid2() {
|
option2 = {
|
elem: '#mainTable2'
|
//, toolbar: '#toolbarDemo'
|
, page: false
|
, height: 500
|
, cellMinWidth: 90
|
, limit: Number.MAX_VALUE//默认显示全部
|
, cols: [[
|
|
{ field: 'hsubid', title: 'hsubid', hide: true}
|
,{ field: '流水号', title: '流水号' }
|
, { field: 'HProcID', title: 'HProcID', hide: true}
|
, { field: '工序代码', title: '工序代码' }
|
, { field: '工序名称', title: '工序名称' }
|
, { field: '返工标记', title: '返工标记' }
|
, { field: '加工说明', title: '加工说明' }
|
, { field: '工作中心代码', title: '工作中心代码', width: 115 }
|
, { field: '工作中心', title: '工作中心' }
|
, { field: '计划数量', title: '计划数量' }
|
, { field: 'hmainid', title: 'hmainid', hide: true}
|
, { field: '日期', title: '日期', sort: true }
|
, { field: '单据号', title: '单据号' }
|
, { field: 'hicmointerid', title: 'hicmointerid', hide: true}
|
, { field: '任务单号', title: '任务单号' }
|
, { field: 'HWorkShopID', title: 'HWorkShopID', hide: true}
|
, { field: '生产车间代码', title: '生产车间代码', width: 115 }
|
, { field: '生产车间', title: '生产车间' }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true}
|
, { field: '产品代码', title: '产品代码' }
|
, { field: '产品名称', title: '产品名称' }
|
, { field: '规格型号', title: '规格型号' }
|
, { field: '批号', title: '批号' }
|
, { field: 'HUnitID', title: 'HUnitID', hide: true}
|
, { field: '单位代码', title: '单位代码' }
|
, { field: '单位', title: '单位' }
|
, { field: '生产数量', title: '生产数量' }
|
, { field: '计划开工日期', title: '计划开工日期' }
|
, { field: '计划完工日期', title: '计划完工日期' }
|
, { field: '摘要', title: '摘要' }
|
, { field: '内部单据号', title: '内部单据号' }
|
, { field: 'HSupID', title: 'HSupID', hide: true}
|
, { field: '委外加工单位代码', title: '委外加工单位代码' }
|
, { field: '委外加工单位', title: '委外加工单位' }
|
, { field: '表头备注', title: '表头备注' }
|
, { field: 'HBillType', title: 'HBillType', hide: true}
|
, { field: '流转卡数量', title: '流转卡数量' }
|
, { field: '进站关联数量', title: '进站关联数量' }
|
, { field: '出站关联数量', title: '出站关联数量' }
|
, { field: '出站报废关联数量', title: '出站报废关联数量' }
|
, { field: '行关闭人', title: '行关闭人' }
|
, { field: '关闭类型', title: '关闭类型' }
|
, { field: '表体备注', title: '表体备注' }
|
, { field: '源单主内码', title: '源单主内码' }
|
, { field: '源单子内码', title: '源单子内码' }
|
, { field: '源单单号', title: '源单单号' }
|
, { field: '源单类型', title: '源单类型' }
|
, { field: '汇报数量', title: '汇报数量' }
|
, { field: '流转工序', title: '流转工序' }
|
, { field: '出站流转工序', title: '出站流转工序' }
|
, { field: '首道工序', title: '首道工序' }
|
, { field: '末道工序', title: '末道工序' }
|
, { field: '下道工序号', title: '下道工序号' }
|
, { field: '不良品关联数量', title: '不良品关联数量' }
|
]]
|
};
|
table.render(option2);
|
}
|
//#region 查询
|
function get_Display(sWhere) {
|
sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " ";
|
var ajaxLoad = layer.load();
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
|
url: GetWEBURL() + '/LEMS/MES_Sc_ProcessExchangeBillQuery_Json',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"]},
|
success: function (data1) {
|
if (data1.count == 1) {
|
option.data = data1.data;
|
table.render(option);
|
layer.close(ajaxLoad);
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 新增
|
function set_AddNew() {
|
layer.open({
|
type: 2
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']
|
, title: '生产资源-新增'
|
, shift: 0//弹出动画
|
, content: '../工序流转卡/Sc_ProcessExchangeBill.html?OperationType=1&linterid=&HEntryID=&HSouceBillType='
|
})
|
}
|
//#endregion
|
|
//#region 编辑
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].hmainid;
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工序列表-编辑'
|
, shift: 0//弹出动画
|
, content: '../工序流转卡/Sc_ProcessExchangeBill.html?OperationType=3&linterid=' + linterid + '&HEntryID=&HSouceBillType='
|
})
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
//#endregion
|
|
//删除
|
function set_DeleteBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var HInterID = data[0].hmainid.toString();
|
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Sc_ProcessExchangeBill/DeltetProcessExchangeBillByID", //方法所在页面和方法名
|
data: { "HInterID": HInterID, "HPRDORGID": sessionStorage["OrganizationID"], "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 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
})
|
}
|
else {
|
layer.msg('请选择一行数据删除!');
|
}
|
}
|
|
//预览
|
function get_view() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HProcessExchange', 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
//打印
|
function get_print() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + data[0].hmainid.toString() + '&MyMsg=' + data[0].hmainid.toString() + '&Type=HProcessExchange', 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
|
//#region 刷新
|
function get_Refresh() {
|
set_ClearQuery();
|
get_Display(sWhere);
|
}
|
//#endregion
|
//以上是layui模块
|
});
|
|
|
|
|
</script>
|
|
</body>
|
</html>
|