<!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">
|
<select name="HDeptName" id="HDeptName" lay-verify="required" lay-search class="layui-input">
|
<!--动态渲染车间-->
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">规格型号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HModel" id="HModel">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">生产订单号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HWorkBillNo" id="HWorkBillNo">
|
</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" style="padding: 0px; margin-left: 6%;">
|
<div class="layui-row" style="margin-top:10px;">
|
<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 class="layui-inline">
|
<label class="layui-form-label">单据号</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="HBillNo" id="HBillNo">
|
</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>
|
</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="set_Issue"><i class="layui-icon layui-icon-file-b"></i>下达</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_CancelIssue"><i class="layui-icon layui-icon-file-b"></i>反下达</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_PlanDate"><i class="layui-icon layui-icon-file-b"></i>指派日期</button>-->
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_SendWork"><i class="layui-icon layui-icon-file-b"></i>工序派工</button>-->
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_BatchReport"><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-file-b"></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="set_Print_Convenient"><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>
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="set_StationOut"><i class="layui-icon layui-icon-form"></i>工序出站汇报单</button>-->
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="get_StationIn"><i class="layui-icon layui-icon-form"></i>工序进站接收单</button>-->
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="get_HideColumn1"><i class="layui-icon layui-icon-file-b"></i>列设置</button>
|
<!--<button type="button" class="layui-btn layui-btn-sm" lay-event="get_HideColumn2"><i class="layui-icon layui-icon-file-b"></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 HBillNo = "";
|
var wybj = false;
|
var HDeptID = 0;
|
//#endregion
|
|
//#region 进入页面即加载
|
|
//
|
var HModName = "Sc_ProcessExchangeIssueBillList";
|
//初始化界面
|
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_Issue': set_Issue();
|
break;
|
//反下达
|
case 'set_CancelIssue': set_CancelIssue();
|
break;
|
//工序派工
|
case 'set_SendWork': set_SendWork();
|
break;
|
//批量汇报
|
case 'set_BatchReport': set_BatchReport();
|
break;
|
//指派日期
|
case 'set_PlanDate': set_PlanDate();
|
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;
|
//一键打印
|
case 'set_Print_Convenient': set_Print_Convenient();
|
break;
|
//工序出站汇报单
|
case 'set_StationOut': set_StationOut();
|
break;
|
//工序进站接收单
|
case 'get_StationIn': get_StationIn();
|
break;
|
//列设置
|
case 'get_HideColumn1': get_HideColumn1();
|
break;
|
//明细列设置
|
case 'get_HideColumn2': get_HideColumn2();
|
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();
|
//查询
|
get_FastQuery();
|
//车间列表
|
getDept();
|
}
|
|
//获取车间列表
|
function getDept() {
|
var HDeptName = '<option value="0" style="color:red;" selected>全部车间</option>';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Sc_ICMOBill/GetHDeptList",
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
HDeptName += '<option style="color:blue;" value="' + data[i].HItemID + '">' + data[i].HName + '</option>';
|
}
|
$("#HDeptName").append(HDeptName);
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//#region 重置过滤条件方法
|
function set_ClearQuery() {
|
$("#SHPrintQty").val("");//打印状态
|
$("input[type='checkbox'][name='wybj']").prop('checked', false);
|
form.render("checkbox");//委外标记
|
$("#HDate").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//开始日期
|
$("#HDate1").val(Format(new Date(), "yyyy-MM-dd"));//结束日期
|
$("#HOrderProcNO").val("");//订单跟踪号
|
$("#SHname").val("");//物料|子件名称|子件规格
|
$("#HBillNo").val("");//单据号
|
$("#HModel").val("");//规格型号
|
$("#HDeptName").val("0");//车间
|
form.render('select');
|
//$("#btnSearch").click();
|
get_FastQuery() ;
|
sWhere = "";
|
}
|
//#endregion
|
|
//#region 快速过滤
|
function get_FastQuery() {
|
var SHPrintQty = $("#SHPrintQty").val();//打印状态
|
var HDate = $("#HDate").val();//开始日期
|
var HDate1 = $("#HDate1").val();//结束日期
|
var HOrderProcNO = $("#HOrderProcNO").val();//订单跟踪号
|
var HWorkBillNo = $("#HWorkBillNo").val();
|
var SHname = $("#SHname").val();//物料|子件名称|子件规格
|
var HBillNo = $("#HBillNo").val();//单据号
|
var HModel = $("#HModel").val();//规格型号
|
var HDeptName = $("#HDeptName").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 (HWorkBillNo) {
|
sWhere += " and 任务单号 like '%" + HWorkBillNo + "%'";
|
}
|
if (HOrderProcNO) {
|
sWhere += " and 订单跟踪号 like '%" + HOrderProcNO + "%'";
|
}
|
if (SHname) {
|
sWhere += " and 子件名称 like '%" + SHname + "%' or 子件规格 like '%" + SHname + "%'"
|
}
|
if (HBillNo) {
|
sWhere += " and 单据号 like '%" + HBillNo + "%'"
|
}
|
if (HDeptName && HDeptName != "0") {
|
sWhere += " and HWorkShopID = '" + HDeptName + "'";
|
}
|
if (HModel) {
|
sWhere += " and 子件规格 like '%" + HModel + "%'";
|
}
|
get_Display(sWhere);
|
sWhere = "";//调用接口后清空sWhere缓存
|
}
|
//#endregion
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
|
//选中判断
|
form.on('checkbox(wybj)', function (data) {
|
wybj = data.elem.checked; //是否被选中,true或者false
|
});
|
//#endregion
|
|
//初始化主表列表
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: true
|
, height: 'full-50'
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'hmainid', title: 'hmainid', width: 90, hide: true }
|
, { field: 'HEntryID', title: 'HEntryID', width: 90, hide: true }
|
, { field: '下达状态', title: '下达状态' }
|
, { field: 'HDeptID', title: 'HDeptID', width: 80, hide: true }
|
, { field: '生产车间', title: '生产车间' }
|
, { field: 'HMaterID2', title: 'HMaterID2', width: 80, hide: true }
|
, { field: '子件名称', title: '产品名称' }
|
, { field: '子件规格', title: '规格型号' }
|
, { field: 'HUnitID', title: 'HUnitID', width: 80, hide: true }
|
, { field: '流水号', title: '流水号' }
|
, { field: 'HProcID', title: 'HProcID', hide: true }
|
, { field: '工序代码', title: '工序代码' }
|
, { field: '工序名称', title: '工序名称' }
|
, { field: '流转卡数量', title: '派工单数量', width: 100 }
|
, { field: '任务单号', title: '生产订单号', width: 140 }
|
, {
|
field: '日期', title: '日期', width: 120, sort: true, templet: "<div>{{d.日期 ==null ?'':layui.util.toDateString(d.日期, 'yyyy-MM-dd')}}</div>"
|
}
|
, {
|
field: '计划开工日期', title: '计划开工日期', width: 120, sort: true, templet: "<div>{{d.计划开工日期 ==null ?'':layui.util.toDateString(d.计划开工日期, 'yyyy-MM-dd')}}</div>"
|
}
|
, {
|
field: '计划完工日期', title: '计划完工日期', width: 120, sort: true, templet: "<div>{{d.计划完工日期 ==null ?'':layui.util.toDateString(d.计划完工日期, 'yyyy-MM-dd')}}</div>"
|
}
|
, { field: '生产车间代码', title: '生产车间代码', width: 115 }
|
, { field: '产品代码', title: '产品代码' }
|
, { field: '单位代码', title: '单位代码' }
|
, { field: '单位', title: '单位' }
|
|
|
, { field: '打印次数', title: '打印次数' }
|
, { field: '订单跟踪号', title: '订单跟踪号', width: 120 }
|
, { field: '单据号', title: '单据号', width: 190 }
|
, { field: 'hicmointerid', title: 'hicmointerid', width: 80, hide: true }
|
, { field: 'HWorkShopID', title: 'HWorkShopID', width: 80, hide: true }
|
, { field: '委外标记', title: '委外标记' }
|
, { field: 'HMaterID', title: 'HMaterID', 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: '拆分数量' }
|
, { field: '源单客户编码', title: '源单客户编码', width: 80 }
|
, { field: '包装标识', title: '包装标识', width: 80 }
|
, { field: '包装标识编码', title: '包装标识编码', width: 80 }
|
]]
|
};
|
table.render(option);
|
}
|
//#region 查询
|
function get_Display(sWhere) {
|
sWhere += " and HPRDORGID=" + sessionStorage["OrganizationID"] + " and 工序名称 != '转工序'";
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/LEMS/MES_Sc_ProcessExchangeIssueBillList_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 });
|
}
|
});
|
DisPlay_HideColumn();
|
}
|
|
|
//隐藏列设置
|
function get_HideColumn1() {
|
var colName = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["hmainid", "HEntryID", "hicmointerid", "HWorkShopID", "HDeptID", "HProcID", "HMaterID", "HMaterID2", "HUnitID", "HBillType", "hsubid"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option.cols[0].length - 2; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
|
switch (option.cols[0][i + 1]["field"]) {
|
case '日期':
|
option.cols[0][i + 1]["width"] = 115;
|
break;
|
case '单据号':
|
option.cols[0][i + 1]["width"] = 140;
|
break;
|
case '产品代码':
|
option.cols[0][i + 1]["width"] = 150;
|
break;
|
case '产品名称':
|
option.cols[0][i + 1]["width"] = 250;
|
break;
|
case '规格型号':
|
option.cols[0][i + 1]["width"] = 190;
|
break;
|
case '生产车间':
|
option.cols[0][i + 1]["width"] = 145;
|
break;
|
case '工序名称':
|
option.cols[0][i + 1]["width"] = 135;
|
break;
|
}
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["title"], titleData) == -1) {
|
option.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
if (option.cols[0][i]["fixed"] != null) {
|
option.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option);
|
} else {
|
table.render(option);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
})
|
}
|
|
//显示列数据
|
function DisPlay_HideColumn_Sec() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
type: "GET",
|
data: { "HModName": HModName + "_Sec", "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
|
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["HMaterID", "HUnitID", "HICMOEmpID"];//不需要显示的字段 可扩展
|
|
dataCol = data1.data[0].HGridString.split(',');
|
|
for (var i = 0; i < option2.cols[0].length - 2; i++) {
|
var dataCols = dataCol[i].split('|');
|
//隐藏列
|
if (dataCols[1] == 1) {
|
option2.cols[0][i + 1]["hide"] = true;
|
}
|
//设置列宽
|
if (dataCols[3] > 0) {
|
option2.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//设置内容字体大小
|
if (data1.data[0].HFontSize != 0) {
|
option2.cols[0][i + 1]["style"] = "font-size:" + data1.data[0].HFontSize + "px;";
|
} else {
|
option2.cols[0][i + 1]["style"] = "font-size:100%";
|
}
|
//设置列宽
|
//if (data1.data[0].HColumnWidth != 0) {
|
// option2.cols[0][i + 1]["width"] = data1.data[0].HColumnWidth + "px;";
|
//} else {
|
// option2.cols[0][i + 1]["width"] = "";
|
//}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option2.cols[0][i + 1]["title"], titleData) == -1) {
|
option2.cols[0][i + 1]["hide"] = false;
|
}
|
//字体所在位置(左 居中 右)
|
switch (dataCols[2]) {
|
case "L":
|
option2.cols[0][i + 1]["align"] = "left";
|
break;
|
case "M":
|
option2.cols[0][i + 1]["align"] = "center";
|
break;
|
case "R":
|
option2.cols[0][i + 1]["align"] = "right";
|
break;
|
}
|
}
|
|
//取消冻结列
|
for (var i = 1; i < option2.cols[0].length - 1; i++) {
|
if (option2.cols[0][i]["fixed"] != null) {
|
option2.cols[0][i]["fixed"] = null;
|
}
|
else {
|
break;
|
}
|
}
|
//冻结列
|
if (data1.data[0].HFixCols != 0) {
|
for (var i = 0; i < data1.data[0].HFixCols; i++) {
|
if ($.inArray(option2.cols[0][i + 1]["title"], titleData) != -1) {
|
data1.data[0].HFixCols += 1;
|
}
|
option2.cols[0][i + 1]["fixed"] = "left";
|
}
|
}
|
table.render(option2);
|
} else {
|
table.render(option2);
|
}
|
}, error: function () {
|
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
|
|
//#region 下达
|
function set_Issue() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 0) {
|
layer.msg('请选择需要下达的数据!');
|
return;
|
}
|
var linterid = "";
|
for (var i = 0; i < data.length; i++) {
|
linterid += data[i].hmainid + "-" + data[i].HEntryID + ",";
|
}
|
linterid = linterid.substring(0, linterid.length - 1);
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
//, area: ['30%', '40%']
|
, area: ['100%', '100%']
|
, title: '工序流转卡-下达'
|
, shift: 0//弹出动画
|
, content: '../工序流转卡/Sc_ProcessExchangeIssue.html?linterid=' + linterid
|
, end: function () {
|
//刷新页面,
|
get_FastQuery(table, option);
|
},
|
success: function (layero, index) {
|
|
}
|
})
|
}
|
//#endregion
|
|
//#region 反下达
|
function set_CancelIssue() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 0) {
|
layer.msg('请选择需要操作的数据!');
|
return;
|
}
|
var linterid = "";
|
for (var i = 0; i < data.length; i++) {
|
linterid += data[i].hmainid + "-" + data[i].HEntryID + ",";
|
}
|
linterid = linterid.substring(0, linterid.length - 1);
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/LEMS/MES_Sc_ProcessExchangeCancelIssue", //方法所在页面和方法名
|
data: { "HEntryId": linterid },
|
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);
|
//刷新页面,
|
get_FastQuery(table, option);
|
});
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//工序派工
|
function set_SendWork() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
var array = [];
|
var interid = [];
|
var ieid = [];
|
for (let i = 0; i < data.length; i++) {
|
array.push(checkStatus.data[i]["HEntryID"]); //获取流转卡子表ID
|
interid.push(checkStatus.data[i]["hmainid"]);
|
ieid.push(checkStatus.data[i]["hmainid"].toString() + checkStatus.data[i]["HEntryID"].toString());
|
//判断单据号是否相同
|
//if (checkStatus.data[0]["单据号"] != checkStatus.data[i]["单据号"]) {
|
// layer.msg("勾选了不同流转卡号,请确认");
|
// return;
|
//}
|
}
|
var HEntryID = array.join(",");//用逗号分割数组
|
var HInterID = interid.join(",");
|
var HIeID = ieid.join(",");
|
if (checkStatus.data.length >= 1) {
|
if (checkStatus.data[0]["流水号"] != "9999") {
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "工序派工单编辑" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["100%", "100%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../车间管理/工序流转卡/Sc_ProcessSendWorkEdit.html?OperationType=1&linterid=' + HInterID.toString() + '&HEntryID=' + HEntryID.toString() + '&HIeID=' + HIeID, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
} else {
|
layer.msg('派工工序不能是转工序!');
|
}
|
} else {
|
layer.msg('请选择数据编辑!');
|
}
|
}
|
|
//批量汇报
|
function set_BatchReport() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
var array = [];
|
var interid = [];
|
var ieid = [];
|
for (let i = 0; i < data.length; i++) {
|
array.push(checkStatus.data[i]["HEntryID"]); //获取流转卡子表ID
|
interid.push(checkStatus.data[i]["hmainid"]);
|
ieid.push(checkStatus.data[i]["hmainid"].toString() + checkStatus.data[i]["HEntryID"].toString());
|
}
|
var HEntryID = array.join(",");//用逗号分割数组
|
var HInterID = interid.join(",");
|
var HIeID = ieid.join(",");
|
var HReportNum = checkStatus.data.length;//选择批量汇报数量
|
if (checkStatus.data.length >= 1) {
|
if (checkStatus.data[0]["流水号"] != "9999") {
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "批量汇报" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["100%", "100%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ['../../车间管理/工序流转卡/Gy_ProcessBatchReport.html?OperationType=1&linterid=' + HInterID.toString() + '&HEntryID=' + HEntryID.toString() + '&HIeID=' + HIeID + '&HReportNum=' + HReportNum, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
} else {
|
layer.msg('汇报工序不能是转工序!');
|
}
|
} else {
|
layer.msg('请选择数据编辑!');
|
}
|
}
|
|
//#region 指派日期
|
function set_PlanDate() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 0) {
|
layer.msg('请选择需要操作的数据!');
|
return;
|
}
|
var linterid = "";
|
for (var i = 0; i < data.length; i++) {
|
linterid += data[i].hmainid + "-" + data[i].HEntryID + ",";
|
}
|
linterid = linterid.substring(0, linterid.length - 1);
|
//if (AllowLoadData(sSubStr) != false) {//非空验证
|
layer.open({
|
type: 2
|
//, area: ['30%', '40%']
|
, area: ['40%', '60%']
|
, title: '工序流转卡-指派日期'
|
, shift: 0//弹出动画
|
, content: '../工序流转卡/Sc_ProcessExchangePlanDate.html?linterid=' + linterid
|
, end: function () {
|
//刷新页面,
|
get_FastQuery(table, option);
|
},
|
success: function (layero, index) {
|
|
}
|
})
|
}
|
//#endregion
|
//#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) {
|
var rows = [];
|
var arr = [];
|
var ieid = [];
|
for (var i = 0; i < data.length; i++) {
|
rows.push(data[i].hmainid.toString());
|
arr.push(data[i].HEntryID.toString());
|
ieid.push(data[i].hmainid.toString() + data[i].HEntryID.toString())
|
}
|
|
layer.open({
|
type: 2
|
, area: ['85%', '85%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList_GXPG.html?linterid=' + rows.toString() + '&MyMsg=' + rows.toString() + '&Type=HProcSendWork' + '&ieid=' + ieid.toString(), 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
|
//一键打印
|
function set_Print_Convenient() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length >= 1) {
|
var rows = [];
|
var arr = [];
|
var ieid = [];
|
for (var i = 0; i < data.length; i++) {
|
rows.push(data[i].hmainid.toString());
|
arr.push(data[i].HEntryID.toString());
|
ieid.push(data[i].hmainid.toString() + data[i].HEntryID.toString())
|
}
|
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Open_PrintTem/GetDefaultOpenTmp_Json",
|
async: true,
|
data: { "HNumber": 'HProcSendWork' },
|
//data: { "Value": Value },
|
success: function (result) {
|
if (result.count == 1) {
|
var OpenTmp = result.data[0].模板名称
|
window.open("../../基础资料/公用基础资料/HBarPlanPrint_GXPG.html?linterid=" + rows.toString() + "&Type=" + 'HProcSendWork' + "&OpenTmp=" + OpenTmp.toString() + "&ieid=" + ieid.toString());
|
} else {
|
layer.msg(result.Message);
|
}
|
},
|
error: function (result) {
|
console.log(result);
|
//layer.msg('获取采购订单出现异常', { icon: 2, time: 2000 });
|
}
|
});
|
}
|
else {
|
layer.msg('请选择一行数据打印!');
|
}
|
}
|
|
//工序出站汇报单
|
function set_StationOut() {
|
var checkStatus = table.checkStatus('mainTable2')
|
, data = checkStatus.data;
|
if (data.length === 1) {
|
var HProcNo = data[0].流水号.toString();
|
|
if (HProcNo == "9999") {
|
return layer.msg("流水号不能为转工序流水号,请重新选择!");
|
}
|
else {
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工序流转卡-编辑'
|
, shift: 0//弹出动画
|
, content: '../../车间管理/工序出站汇报单/Cj_StationOutBill.html?OperationType=2&HBillNo=' + HBillNo + '&HProcNo=' + HProcNo
|
})
|
}
|
|
} else {
|
layer.msg('请选择一行数据下推!');
|
}
|
}
|
|
//工序进站接收单
|
function get_StationIn() {
|
var checkStatus = table.checkStatus('mainTable2')
|
, data = checkStatus.data;
|
if (data.length === 1) {
|
var HProcNo = data[0].流水号.toString();
|
|
if (HProcNo == "9999") {
|
return layer.msg("流水号不能为转工序流水号,请重新选择!");
|
}
|
else {
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工序流转卡-编辑'
|
, shift: 0//弹出动画
|
, content: '../../车间管理/工序进站接收单/Cj_StationInBill.html?OperationType=2&HBillNo=' + HBillNo + '&HProcNo=' + HProcNo
|
})
|
}
|
|
} else {
|
layer.msg('请选择一行数据下推!');
|
}
|
}
|
|
//#region 刷新
|
function get_Refresh() {
|
set_ClearQuery();
|
get_Display(sWhere);
|
}
|
//#endregion
|
//以上是layui模块
|
});
|
|
|
|
|
</script>
|
|
</body>
|
</html>
|