<!DOCTYPE html>
|
<html xmlns="http://www.w3.org/1999/xhtml" style="background-color:white;">
|
<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">
|
<style>
|
.layui-form-label {
|
font-size: 14px;
|
width: 85px;
|
text-align: inherit;
|
}
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-card">
|
<div class="layui-card-header"></div>
|
<div class="layui-card-body" style="padding: 15px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-form-item" style="margin-bottom: 20px;">
|
<button type="button" lay-submit="" class="layui-btn layui-btn-radius">查询</button>
|
<button type="button" lay-submit="" class="layui-btn layui-btn-radius">删除</button>
|
<button type="button" lay-submit="" class="layui-btn layui-btn-radius" style="margin-left:5%;">退出</button>
|
</div>
|
<fieldset class="layui-elem-field layui-field-title" style="text-align:center;">
|
<legend>生产汇报单列表</legend>
|
</fieldset>
|
<div class="layui-form-item">
|
<div class="layui-row">
|
<div class="">
|
<label class="layui-form-label">汇报日期</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HDate1" id="HDate1" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="">
|
<div>
|
<label class="" style="padding: 9px 15px;font-size: 14px;text-align: inherit;float: left;">——</label>
|
</div>
|
<div class="layui-input-inline">
|
<input type="text" name="HDate2" id="HDate2" lay-verify="date" placeholder="yyyy-MM-dd" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="">
|
<label class="layui-form-label">物料编码</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" placeholder="请输入生产订单号" class="layui-input">
|
<input type="hidden" name="HDeptID" id="HDeptID" value="0" lay-verify="HDeptID" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="">
|
<label class="layui-form-label">物料名称</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" placeholder="请输入生产订单号" class="layui-input">
|
<input type="hidden" name="HDeptID" id="HDeptID" value="0" lay-verify="HDeptID" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<div class="layui-card">
|
<div class="layui-card-body">
|
<div class="layui-tab">
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show" style="height:370px;">
|
<table class="layui-hide" id="zx-table-schb" lay-filter="zx-table-schb"></table>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
|
|
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../layuiadmin/Scripts/json2.js" type="text/javascript"></script>
|
<script src="../../layuiadmin/Scripts/jquery-1.4.1.js" type="text/javascript"></script>
|
<script>
|
function getUrlVars() {
|
var vars = [], hash;
|
var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
|
for (var i = 0; i < hashes.length; i++) {
|
hash = hashes[i].split('=');
|
vars.push(hash[0]);
|
vars[hash[0]] = hash[1];
|
}
|
return vars;
|
}
|
var params = getUrlVars();
|
var BillStatusjson = params[params[0]];
|
var InterID = params[params[1]];
|
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, element = layui.element
|
, layer = layui.layer
|
, laydate = layui.laydate
|
, table = layui.table
|
, form = layui.form;
|
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
|
$('#HBarCode').on('keydown', function (event) { //扫条码
|
var sSubStr = table.cache['wl-table'];
|
var sBarCode = $('#HBarCode').val()
|
var sInterID = $("#HInterID").val()
|
var sBillNo = $("#HBillNo").val()
|
var sQty = $("#HQty").val()
|
var sHBillType = $("#HBillType").val() //源单类型
|
var sBillType = '3711'
|
var sHWHID = $("#HWHID").val()
|
var sHSPID = $("#HStockPlaceID").val()
|
var sSourceBillNo = $("#HSourceBillNo").val()
|
if (sQty == "") {
|
sQty = 0;
|
}
|
if (event.keyCode == 13) {
|
//判断条码是否为空 new
|
if (sBarCode == '') {
|
layer.msg("条码为空,不能扫描!", { icon: 5, btn: ['确定'], time: 100000, offset: 't' });
|
return false;
|
}
|
if (sBarCode != "") {
|
$('#HBarCode').val("");
|
}
|
if (sQty != "") {
|
$('#HQty').val("");
|
}
|
|
//if (AllowLoadData(sSubStr, 'HBarCode') != false) {//非空验证
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///ProductIn/get_CheckTypeByBarCode_Json",
|
url: GetWEBURL() + "/ProductIn/get_CheckTypeByBarCode_Json",
|
type: "GET",
|
data: { "sCode": sBarCode, "sInterID": sInterID, "sBillNo": sBillNo, "sBillType": sBillType, "sMaker": sessionStorage["HUserName"], "WhID": sHWHID, "SPID": sHSPID, "sQty": sQty, "sRedBlue": false, "SourceFlag": sessionStorage["SourceFlag"], "sSourceBillNo": sSourceBillNo, "sSourceType": sHBillType, "HOWNERID": 0 },
|
success: function (result) {
|
if (result.count == 1) {
|
if (result.data.HBarType == '仓库条码') {
|
$("#HWHNAME").val(result.data.HWhName);
|
$("#HWHID").val(result.data.HWhID);
|
$("#HStockPlaceName").val("");
|
$("#HNote").val(";一键扫码仓库条码");
|
element.tabChange('tab-ProductlnBill', '2'); //跳转页签
|
}
|
else if (result.data.HBarType == '仓位条码') {
|
$("#HStockPlaceName").val(result.data.HSPName);
|
$("#HStockPlaceID").val(result.data.HSPID);
|
$("#HWHNAME").val(result.data.HWhName);
|
$("#HWHID").val(result.data.HWhID);
|
$("#HNote").val(";一键扫码仓位条码");
|
element.tabChange('tab-ProductlnBill', '2');//跳转页签
|
}
|
else if (result.data.HBarType == '部门条码') {
|
$("#HDeptName").val(result.data.HDeptName);
|
$("#HDeptID").val(result.data.HDeptID);
|
$("#HNote").val(";一键扫码部门条码");
|
element.tabChange('tab-ProductlnBill', '2');//跳转页签
|
}
|
else if (result.data.HBarType == '源单条码') {
|
$("#HWorkReport").focus();//跳转光标到本次报工
|
$("#HSupName").val(result.data.HSupName);
|
$("#HSupID").val(result.data.HSupID);
|
$("#HDeptName").val(result.data.HDeptName);
|
$("#HDeptID").val(result.data.HDeptID);
|
$("#HSourceBillNo").val(result.data.HSourceBillNo);
|
sessionStorage["SourceFlag"] = true;
|
//获取源单类型、源单单号
|
if (result.data.HSourceBillType == "3710") {
|
$("#HBillType").val("3710");
|
|
}
|
else {
|
$("#HBillType").val("-1");
|
}
|
$("#HNote").val(";一键扫码源单条码");
|
element.tabChange('tab-ProductlnBill', '3');
|
}
|
else {
|
if (sessionStorage["SourceFlag"] == "true") {
|
element.tabChange('tab-ProductlnBill', '3');
|
}
|
else {
|
$("#HSupName").val(result.data.HSupName);
|
$("#HSupID").val(result.data.HSupID);
|
$("#HDeptName").val(result.data.HDeptName);
|
$("#HDeptID").val(result.data.HDeptID);
|
$("#HSourceBillNo").val(result.data.HSourceBillNo);
|
sessionStorage["SourceFlag"] = true;
|
//获取源单类型、源单单号
|
if (result.data.HSourceBillType == "3710") {
|
$("#HBillType").val("3710");
|
|
}
|
|
else {
|
$("#HBillType").val("-1");
|
}
|
$("#HNote").val(";物料条码");
|
element.tabChange('tab-ProductlnBill', '3');
|
}
|
}
|
//$("#HSupID").val(result.data.HSupID);
|
//$("#HSupName").val(result.data.HSupName);
|
//$("#HDeptID").val(result.data.HDeptID);
|
//$("#HDeptName").val(result.data.HDeptName);
|
layer.load(3)
|
table.render({
|
elem: '#wl-table'
|
//, url: 'http://61.130.49.162:9090/WMSAPI///ProductIn/DisBillEntryList_Webs_Json'
|
, url: GetWEBURL1() + '/ProductIn/DisBillEntryList_Webs_Json'
|
, toolbar: '#toolbarDemo'
|
, where: { HBillID: sInterID, HBillType: '1202', sWhere: '' }
|
, cols: [[
|
{ type: 'radio' }
|
, { field: 'HQty', title: '数量', width: 150 }
|
, { field: 'HQtyMust', title: '应收数量', width: 150 }
|
, { field: 'HMaterNumber', title: '物料代码', width: 150 }
|
, { field: 'HMaterName', title: '物料名称', width: 150 }
|
, { field: 'HMaterModel', title: '规格型号', width: 150 }
|
, { field: 'HSourceInterID', title: '源单主内码', width: 150 }
|
, { field: 'HSourceEntryID', title: '源单子内码', width: 150 }
|
, { field: 'HSourceBillNo', title: '源单单号', width: 150 }
|
, { field: 'HBatchNo', title: '批次', width: 150 }
|
]]
|
// , data: [linterid]
|
// , page: true
|
, height: 500
|
, done: function () {
|
layer.closeAll("loading");
|
}
|
});
|
}
|
else {
|
// $("#verifycode").click();
|
//layer.msg(result.Message, { icon: 5 });
|
layer.msg(result.Message, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
layer.closeAll("loading");
|
}
|
});
|
}
|
//else
|
//{
|
// layer.msg(result.Message, { icon: 5 });
|
//}
|
//layer.closeAll("loading");
|
//}
|
});
|
|
|
//获取生产汇报单最大单据号
|
$("#HInterID").val("");
|
$("#HBillNo").val("");
|
$.ajax({
|
//url: "http://61.130.49.162:9090/WMSAPI///Web/GetMAXNum",
|
//url: GetWEBURL() + "/Web/GetMAXNum",
|
type: "GET",
|
data: { "HBillType": '3711' },
|
success: function (d) {
|
//console.log(d.data);
|
//$("#HInterID").val(d.data[0].HInterID);
|
//$("#HBillNo").val(d.data[0].HBillNo);
|
}
|
});
|
|
|
|
form.on('submit(Saver)', function (data) {
|
var sMainStr = JSON.stringify(data.field)
|
var sSubStr1 = JSON.stringify(table.cache['zx-table-schb'])
|
var sSubStr2 = JSON.stringify(table.cache['zx-table-bg'])
|
var sSubStr3 = JSON.stringify(table.cache['zx-table-sm'])
|
var sBill = sMainStr + ';' + sSubStr1 + ';' + sSubStr2 + ';' + sSubStr3 + ';' + sSubStr4
|
layer.load(3)
|
$.ajax(
|
{
|
type: "POST",
|
url: "http://localhost:8091/Web/ServerLoadReadyUseBookBill",
|
async: true,
|
data: { "msg": sBill },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { icon: 1 });
|
}
|
else {
|
layer.msg(data.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
}
|
})
|
|
})
|
|
element.on('tab(tab-all)', function (data) {
|
var status = $(this).attr('data-status')
|
console.log(status)
|
})
|
|
//form.render(null, 'component-form-group');
|
|
laydate.render({
|
elem: '#HDate1'
|
});
|
laydate.render({
|
elem: '#HDate2'
|
});
|
laydate.render({
|
elem: '#PreparationDate'
|
});
|
laydate.render({
|
elem: '#ModificationDate'
|
});
|
laydate.render({
|
elem: '#AuditDate'
|
});
|
//监听提交
|
form.verify({
|
numberOrEmpty: function (value, item) {
|
// if (value != '') {
|
if (!/^\d+$/.test(value)) {
|
return '不能为空或数字或者0';
|
}
|
//}
|
}
|
});
|
//生产汇报列表
|
table.render({
|
elem: '#zx-table-schb'
|
// , url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
|
, toolbar: '#toolbarDemo'
|
, data: [
|
|
]
|
// , where: { sMsg: linterid, sMsg2: lentryid }
|
, cols: [[
|
// , { field: 'HMTONO', title: '计划跟踪单号', width: 100,, sort: true, fixed: true edit: 'text', hide: true }
|
{ type: 'checkbox' }
|
, { field: 'HCostProject', title: '序号' }
|
, { field: 'HPDescription', title: '生产订单号' }
|
, { field: 'HAmount', title: '产品代码' }
|
, { field: 'HAccountedFor', title: '产品名称' }
|
, { field: 'HERDate', title: '规格型号' }
|
, { field: 'HTPayment', title: '汇报数量' }
|
]]
|
// , data: [linterid]
|
, page: true
|
, height: 500
|
, done: function () {
|
//layer.closeAll("loading");
|
}
|
});
|
|
|
});
|
|
function GetHEmpValue(obj) //返回职员
|
{
|
$("#HEmpName").val(obj[0].HName);
|
$("#HEmpID").val(obj[0].HItemID);
|
}
|
function GetHDeptNameValue(obj) //返回部门
|
{
|
$("#HDeptName").val(obj[0].HName);
|
$("#HDeptID").val(obj[0].HItemID);
|
}
|
</script>
|
</body>
|
</html>
|