<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8" />
|
<title>日计划工单列表</title>
|
<link rel="stylesheet" href="../../../layuiadmin/layui/css/layui.css" media="all">
|
<link rel="stylesheet" href="../../../layuiadmin/style/admin.css" media="all">
|
<script src="../../../layuiadmin/zgqCustom/zgqCustom.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>
|
</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" style="width: 85px;">单据号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBillNo" id="HBillNo">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">生产组织</label>
|
<div class="layui-input-block" style="margin-left: 120px; width: 185px;">
|
<select name="Organization" id="Organization" lay-verify="Organization">
|
<!--动态渲染组织-->
|
</select>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;padding: 9px 18px;">生产车间</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="hidden" class="layui-input" lay-verify="HWorkShopID" name="HWorkShopID" id="HWorkShopID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="text" class="layui-input" lay-verify="HWorkShopIDName" name="HWorkShopIDName" id="HWorkShopIDName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHWorkShopID" id="btnHWorkShopID" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</div>
|
</div>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnSearch" id="btnSearch">查询</button>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnReSearch" id="btnReSearch">重置</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" style="width: 85px;">日期</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="date" class="layui-input" lay-verify="HBTimes" name="HBTimes" id="HBTimes" style="padding-left: 78px;">
|
</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="date" class="layui-input" lay-verify="HETimes" name="HETimes" id="HETimes" style="padding-left: 78px;">
|
</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="HMaterName" id="HMaterName">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row" style="margin: 10px 0 10px;">
|
<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="HMaterNumber" id="HMaterNumber">
|
</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="HSeOrderBillNo" id="HSeOrderBillNo">
|
</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_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="set_CloseBill"><i class="layui-icon layui-icon-logout"></i>关闭</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="set_TuiBill"><i class="layui-icon layui-icon-form"></i>下推</button>
|
</div>
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<script>
|
var treeCkData = { id: 0 };
|
var TagId = "";
|
var TagParentId = "";
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index', //主入口模块
|
}).use(['tree', 'index', 'form', 'table', 'element', 'laypage', 'laydate', 'util'], 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
|
, tree = layui.tree
|
, util = layui.util
|
var sWhere = "";
|
var option = [];
|
//#endregion
|
|
//#region 进入页面即加载
|
|
//初始化界面
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//#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 'set_CloseBill': set_CloseBill();
|
break;
|
//下推
|
case 'set_TuiBill': set_TuiBill();
|
break;
|
};
|
});
|
//#endregion
|
|
//#region 生产车间
|
form.on('submit(btnHWorkShopID)', function (data) {
|
btnHWorkShopID();
|
});
|
//#endregion
|
|
//#region 重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
//#endregion
|
|
//#region 查询按钮
|
form.on('submit(btnSearch)', function (data) {
|
get_FastQuery();
|
});
|
//#endregion
|
|
//#endregion
|
|
//#region 本页面被调用的所有方法
|
|
//#region 初始化界面
|
function set_ClearBill() {
|
//初始化日期
|
$("#HBTimes").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//日期
|
$("#HETimes").val(Format(new Date(), "yyyy-MM-dd"));//至
|
//生产组织加载
|
Organ();
|
//初始化表格
|
set_InitGrid();
|
//查询
|
get_Display(sWhere);
|
}
|
//#endregion
|
|
//#region 初始化表格方法
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, height: 'full-50'
|
, page: true
|
, cellMinWidth: 90
|
, limit: 50
|
, limits: [50, 500, 5000, 20000]
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { field: 'hmainid', title: 'hmainid', hide: true }
|
, { field: '单据号', title: '单据号', width: 200 }
|
, { field: '单据类型', title: '单据类型', width: 120 }
|
, { 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: '关闭数量', 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: '作废日期' }
|
]]
|
};
|
}
|
//#endregion
|
|
//获取组织
|
function Organ() {
|
//获取登录页组织列
|
var Organization = '<option style="color:blue;" value="">组织</option>';
|
$.ajax({
|
type: "get",
|
url: GetWEBURL() + "/Web/GetOrganizations",
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
var data = result.data;
|
for (var i = 0; i < data.length; i++) {
|
Organization += '<option style="color:blue;" value="' + data[i].ID + '">' + data[i].Name + '</option>';
|
}
|
$("#Organization").append(Organization);
|
form.render('select');
|
}
|
layer.closeAll("loading");
|
}
|
})
|
}
|
|
//#region 查询
|
function get_Display(sWhere) {
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Sc_WorkBillSortBill/Sc_WorkBillSortBillList',
|
type: "GET",
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (result) {
|
if (result.count == 1) {
|
option.data = result.data;
|
table.render(option);
|
layer.close(ajaxLoad);
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//#endregion
|
|
//#region 快速过滤
|
function get_FastQuery() {
|
var HBillNo = $("#HBillNo").val();
|
var Organization = $("#Organization").val();//采购组织
|
var HWorkShopIDName = $("#HWorkShopIDName").val();//生产车间
|
var HBTimes = $("#HBTimes").val();//日期
|
var HETimes = $("#HETimes").val();//至
|
var HMaterName = $("#HMaterName").val();//物料名称
|
var HMaterNumber = $("#HMaterNumber").val();//物料编码
|
var HSeOrderBillNo = $("#HSeOrderBillNo").val();//销售订单号
|
|
if (HBillNo) {
|
sWhere += " and 单据号 like '%" + HBillNo + "%'";
|
}
|
if (Organization) {
|
sWhere += " and 生产组织 = '" + Organization + "'";
|
}
|
if (HWorkShopIDName) {
|
sWhere += " and 生产车间 = '" + HWorkShopIDName + "'";
|
}
|
if (HBTimes != "" && HETimes!="") {
|
sWhere += " and 日期 between '" + HBTimes + "' and '" + HETimes+"' ";
|
}
|
if (HMaterName) {
|
sWhere += " and 物料名称 like'%" + HMaterName + "%'";
|
}
|
if (HMaterNumber) {
|
sWhere += " and 物料代码 like'%" + HMaterNumber + "%'";
|
}
|
if (HSeOrderBillNo) {
|
sWhere += " and 销售订单号 like'%" + HSeOrderBillNo + "%'";
|
}
|
get_Display(sWhere);
|
sWhere = "";//调用接口后清空sWhere缓存
|
}
|
//#endregion
|
|
//#region 重置过滤条件方法
|
function set_ClearQuery() {
|
$("#HBillNo").val("");
|
$("#Organization").val("");//采购组织
|
$("#HWorkShopIDName").val("");//生产车间
|
$("#HWorkShopID").val("");//生产车间
|
$("#HBTimes").val(Format(new Date(new Date() - 1000 * 60 * 60 * 24 * 30), "yyyy-MM-dd"));//日期
|
$("#HETimes").val(Format(new Date(), "yyyy-MM-dd"));//至
|
$("#HMaterName").val("");//物料名称
|
$("#HMaterNumber").val("");//物料编码
|
$("#HSeOrderBillNo").val("");//销售订单号
|
sWhere = "";
|
}
|
//#endregion
|
|
//生产车间列表
|
function btnHWorkShopID() {
|
layer.open({
|
type: 2 //类型
|
, skin: 'layui-layer-rim'//加上边框
|
, area: ['90%', '90%']//大小
|
, title: '生产车间列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_DepartmentList.html', 'yes']
|
, btn: ['确定', '取消']
|
, btn1: function (index, layero) {//按钮【按钮一】的回调
|
var iframeWindow = window['layui-layer-iframe' + index] //获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus('mainTable');//获取table的elem:"#test"
|
if (checkStatus.data.length === 0) {
|
return layer.msg('请选择数据');
|
}
|
//获取数据
|
$("#HWorkShopID").val(checkStatus.data[0].HItemID);//车间id
|
$("#HWorkShopIDName").val(checkStatus.data[0].HName);//车间名称
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
|
}
|
|
//删除
|
function set_DeleteBill() {
|
var CheckStatus = table.checkStatus("mainTable");
|
|
if (CheckStatus.data.length != 1) {
|
return layer.msg("请选择一条数据!")
|
} else {
|
layer.confirm('您确定要删除吗?', {
|
btn: ['确定', '取消'] //按钮
|
, btn1: function () {
|
var HInterID = CheckStatus.data[0].hmainid; //获取编号
|
var HEntryID = CheckStatus.data[0].hsubid; //获取第几条子数据
|
|
$.ajax({
|
url: GetWEBURL() + '/Sc_WorkBillSortBill/DelWorkBillSortBillList'
|
, type: "GET"
|
, data: { "HInterID": HInterID, "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();
|
////重载tree
|
//tree.reload('treeDepartment', {});
|
});
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}
|
})
|
}
|
})
|
}
|
}
|
|
//关闭
|
function set_CloseBill() {
|
var CheckStatus = table.checkStatus("mainTable");
|
|
if (CheckStatus.data.length != 1) {
|
return layer.msg("请选择一条数据!")
|
} else {
|
layer.confirm('您确定要关闭吗?', {
|
btn: ['确定', '取消'] //按钮
|
, btn1: function () {
|
var HInterID = CheckStatus.data[0].hmainid; //获取编号
|
|
$.ajax({
|
url: GetWEBURL() + '/Sc_WorkBillSortBill/CloseWorkBillSortBillList'
|
, type: "GET"
|
, data: { "HInterID": HInterID, "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();
|
////重载tree
|
//tree.reload('treeDepartment', {});
|
});
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
}
|
}
|
})
|
}
|
})
|
}
|
}
|
|
//#region 新增
|
function set_AddNew() {
|
layer.open({
|
type: 2
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']
|
, title: '日计划工单列表-新增'
|
, shift: 0//弹出动画
|
, content: '../生产日计划工单/JIT_DayPlanBillEdit.html?OperationType=1&linterid=-1&HSouceBillType='
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
}
|
//#endregion
|
|
//#region 编辑
|
function set_ShowBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var linterid = data[0].hmainid;
|
|
layer.open({
|
type: 2
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['100%', '100%']
|
, title: '日计划工单列表-编辑'
|
, shift: 0//弹出动画
|
, content: '../生产日计划工单/JIT_DayPlanBillEdit.html?OperationType=3&linterid=' + linterid + '&HSouceBillType='
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据编辑!');
|
}
|
}
|
//#endregion
|
|
//编辑单据 下推
|
function set_TuiBill() {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
if (data.length === 1) {
|
var linterid = data[0].源单主内码.toString();
|
var HEntryID = data[0].源单子内码.toString();
|
layer.open({
|
type: 2
|
, area: ['100%', '100%']
|
, title: '工序流转卡-编辑'
|
, shift: 0//弹出动画
|
, content: '../../车间管理/工序流转卡/Sc_ProcessExchangeBill.html?OperationType=2&linterid=' + linterid + '&HEntryID=' + HEntryID + '&HSouceBillType=3772'
|
, end: function () {
|
//刷新页面,
|
location.reload();
|
}
|
})
|
} else {
|
layer.msg('请选择一行数据下推!');
|
}
|
}
|
|
//#endregion
|
//以上是layui模块
|
});
|
</script>
|