<!DOCTYPE html>
|
<html>
|
<head>
|
<meta 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.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
<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>
|
<script src="../../../layuiadmin/PageTitle.js"></script>
|
<script src="../../../layuiadmin/MESLanguage.js"></script>
|
<style type="text/css">
|
.layui-form-item .layui-inline {
|
margin-right: 0;
|
}
|
|
html {
|
background-color: white;
|
color: white;
|
}
|
|
.layui-table-cell {
|
overflow: visible !important;
|
}
|
|
td .layui-form-select {
|
margin-top: -10px;
|
margin-left: -15px;
|
margin-right: -15px;
|
}
|
</style>
|
</head>
|
<body>
|
|
<div class="layui-fluid" style="padding: 0;">
|
<div class="layui-card" style="padding: 15px;">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" lay-filter="component-form-group" action="">
|
<div class="layui-card-header">
|
<div class="layui-btn-group">
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" id="set_SaveBill" lay-filter="set_SaveBill">生成</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" id="set_Export" lay-filter="set_Export">导出</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" id="btn-print" lay-filter="btn-print">打印</button>
|
<button type="button" class="layui-btn layui-btn-normal layui-btn-radius" lay-submit="" id="Exit" lay-filter="Exit">退出</button>
|
</div>
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill">
|
<h1 style="text-align: center; padding: 10px 0;"><b>条码生成</b></h1>
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1" style="padding:1px;" class="layui-this">基本信息</li>
|
</ul>
|
<div class="layui-tab-content">
|
<!--基本信息-->
|
<div class="layui-tab-item layui-show">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">日期<label style="color:red"> * </label></label>
|
<div class="layui-input-block">
|
<input type="date" class="layui-input" lay-verify="HDate" name="HDate" id="HDate" style="width:190px;">
|
</div>
|
</div>
|
<div class="layui-inline" style="margin-left:10px;">
|
<label class="layui-form-label">源单号</label>
|
<div class="layui-input-inline">
|
<input type="hidden" name="HMainSourceInterID" id="HMainSourceInterID" class="layui-input" value="0" style="background-color:#efefef4d;">
|
<input type="hidden" name="HMainSourceEntryID" id="HMainSourceEntryID" class="layui-input" value="0" style="background-color:#efefef4d;">
|
<input type="hidden" name="HMainSourceBillType" id="HMainSourceBillType" class="layui-input" value="" style="background-color:#efefef4d;">
|
<input type="text" name="HMainSourceBillNo" id="HMainSourceBillNo" class="layui-input" value="" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">采购订单</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" name="HPOOrderBillNo" id="HPOOrderBillNo" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">条码类型</label>
|
<div class="layui-input-inline">
|
<select name="HBarCodeType" id="HBarCodeType" lay-filter="HBarCodeType" style="width: 180px; ">
|
<option style="color:blue;" value="BarCode" selected="selected">包条码</option>
|
<option style="color:blue;" value="BarCode_Box">内箱条码</option>
|
<option style="color:blue;" value="BarCode_Pack">托盘条码</option>
|
</select>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">物料编码</label>
|
<div class="layui-input-inline">
|
<input type="hidden" name="HMaterID" id="HMaterID" class="layui-input" value="0" style="float:left;width:150px;">
|
<input type="text" class="layui-input" name="HMaterNumber" id="HMaterNumber" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">物料名称</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" name="HMaterName" id="HMaterName" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">规格型号</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" name="HMaterModel" id="HMaterModel" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">计量单位</label>
|
<div class="layui-input-inline">
|
<input type="hidden" name="HUnitID" id="HUnitID" class="layui-input" value="0" style="float:left;width:150px;">
|
<input type="text" class="layui-input" name="HUnitName" id="HUnitName" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">辅助属性代码</label>
|
<div class="layui-input-inline">
|
<input type="hidden" name="HAuxPropID" id="HAuxPropID" class="layui-input" value="0" style="float:left;width:150px;">
|
<input type="text" name="HAuxPropNumber" id="HAuxPropNumber" class="layui-input" value="" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">辅助属性</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HAuxPropName" id="HAuxPropName" class="layui-input" value="" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">批号</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HBatchNo" id="HBatchNo" class="layui-input" value="" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label">供应商代码</label>
|
<div class="layui-input-inline">
|
<input type="hidden" name="HSupID" id="HSupID" class="layui-input" value="0" style="float:left;width:150px;">
|
<input type="text" class="layui-input" name="HSupNumber" id="HSupNumber" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label">供应商名称</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" name="HSupName" id="HSupName" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline" id="HQty_SourceElement">
|
<label class="layui-form-label">源单数量</label>
|
<div class="layui-input-inline">
|
<input type="text" class="layui-input" name="HQty_SourceBill" id="HQty_SourceBill" style="background-color:#efefef4d;">
|
</div>
|
</div>
|
<div class="layui-inline" id="HBarCodeQtyElement">
|
<label class="layui-form-label">条码张数</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HBarCodeQty" id="HBarCodeQty" class="layui-input" value="0">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline" id="HMinQtyElement">
|
<label class="layui-form-label">每包数量</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HMinQty" id="HMinQty" class="layui-input" value="0" style="background-color:#efefef4d;">
|
</div>
|
</div>
|
<div class="layui-inline" id="HBQtyElement">
|
<label class="layui-form-label">包数</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HBQty" id="HBQty" class="layui-input" value="0" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline" id="HEndQtyElement">
|
<label class="layui-form-label">尾包数量</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HEndQty" id="HEndQty" class="layui-input" value="0" style="background-color:#efefef4d;" readonly>
|
</div>
|
</div>
|
<div class="layui-inline" id="HEndQty_SureElement">
|
<label class="layui-form-label">尾包确认</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HEndQty_Sure" id="HEndQty_Sure" class="layui-input" value="0">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
|
<table class="layui-hide" 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_HideColumn"><i class="layui-icon layui-icon-form"></i>列设置</button>
|
</div>
|
</script>
|
<script type="text/html" id="xuhao">
|
{{d.LAY_TABLE_INDEX+1}}
|
</script>
|
</form>
|
</div>
|
</div>
|
</div>
|
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
|
//#region 公用变量
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
|
var HModName = "Gy_BarCodeBill_JiaNan";
|
var option = {}; //子表渲染参数
|
var ins; //导出对象
|
|
//#region 获取页面跳转参数
|
var params = get_UrlVars();
|
var OperationType = params[params[0]]; //操作类型
|
var HBarCodeType = params[params[1]]; //条码类型
|
var HSourceInterID = params[params[2]]; //源单主id
|
var HSourceEntryID = params[params[3]]; //源单子id
|
var HSourceBillType = params[params[4]]; //源单类型
|
var HSourceBillNo = params[params[5]];
|
|
var HZZRQ = ""; //制造日期
|
|
var HQty_waitProduce = 0; //可生成条码数量
|
//源单单号
|
//#endregion
|
//#endregion
|
|
|
//#region 页面加载
|
//#region 判断是否登录 未登录则跳到登录页
|
get_LoginIs();
|
//#endregion
|
|
//#region 初始化子表
|
set_InitGrid();
|
//#endregion
|
|
//#region 判断操作类型并初始化界面
|
if (OperationType == "1") { //包条码
|
|
}
|
else if (OperationType == "4") { //下推
|
var temp = getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
if (dataArray[0].条码同步标记.trim() != "") {
|
layer.alert("该单据明细记录条码已经同步,不允许生成条码,请撤销同步后再进行生成!!", { icon: 5 });
|
return;
|
}
|
|
setInit_PushBill();
|
}
|
else {
|
layer.alert("未知操作类型!", { icon: 5 });
|
}
|
//#endregion
|
//#endregion
|
|
//#region 表头操作按钮监听
|
//#region 生成按钮
|
form.on('submit(set_SaveBill)', function (data) {
|
$('#set_SaveBill').addClass("layui-btn-disabled").attr("disabled", true); //生成按钮禁用
|
|
var sMainData = data.field;
|
if (sMainData.HMaterName != null && (sMainData.HMaterName.indexOf("\"") != -1 || sMainData.HMaterName.indexOf(";") != -1)) {
|
sMainData.HMaterName = sMainData.HMaterName.replaceAll("\"", "”").replaceAll(";", ";")
|
}
|
if (sMainData.HMaterModel != null && (sMainData.HMaterModel.indexOf("\"") != -1 || sMainData.HMaterModel.indexOf(";") != -1)) {
|
sMainData.HMaterModel = sMainData.HMaterModel.replaceAll("\"", "”").replaceAll(";", ";")
|
}
|
|
var sMainData_temp = [];
|
|
if (sMainData.HBarCodeType == "BarCode") {
|
//判断生成条码数量是否超过可生成条码数量
|
var temp = getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
var HQty_SourceBill = $("#HQty_SourceBill").val() * 1;
|
if (HQty_SourceBill > ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1))) {
|
layer.msg("条码生成数量大于最大可生成数量【" + ((dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1)) + "】!!");
|
return false;
|
}
|
|
sMainData_temp = [
|
{
|
"HMainID": sMainData.HMainSourceInterID
|
, "HSubID": sMainData.HMainSourceEntryID
|
, "HBillNo": sMainData.HMainSourceBillNo
|
, "HBillType": sMainData.HMainSourceBillType
|
, "HMaterID": sMainData.HMaterID
|
, "HMaterNumber": sMainData.HMaterNumber
|
, "HMaterName": sMainData.HMaterName
|
, "HMaterModel": sMainData.HMaterModel
|
, "HCusModel": ""
|
, "HCusMaterName": ""
|
, "HEmpID": 0
|
, "HEmpNumber": ""
|
, "HEmpName": ""
|
, "HGroupID": 0
|
, "HGroupNumber": ""
|
, "HGroupName": ""
|
, "HCheckEmpName": ""
|
, "HBatchNo": sMainData.HBatchNo
|
, "HQty": sMainData.HQty_SourceBill
|
, "HMinQty": sMainData.HMinQty
|
, "HBQty": sMainData.HBQty
|
, "HPackQty": 0
|
, "HCoilNO": ""
|
, "HFurnaceNO": ""
|
, "HFactory": ""
|
, "HCusID": 0
|
, "HCusNumber": ""
|
, "HCusName": ""
|
, "HSeOrderBillNo": ""
|
, "HRemark": ""
|
, "HProduceDate": sMainData.HDate
|
, "HExpiryDate": sMainData.HDate
|
, "HheatNO": ""
|
, "HAuxPropID": sMainData.HAuxPropID
|
, "HAuxPropNumber": sMainData.HAuxPropNumber
|
, "HAuxPropName": sMainData.HAuxPropName
|
, "HUnitID": sMainData.HUnitID
|
, "HUnitNumber": ""
|
, "HUnitName": sMainData.HUnitName
|
, "HAuxQty": 0
|
, "HExpirationDateFlag": 0
|
, "HGiveAwayFlag": 0
|
, "HDate": sMainData.HDate
|
, "HMTONo": ""
|
, "HBarCodeType": sMainData.HBarCodeType
|
, "HSupID": sMainData.HSupID
|
, "HSupNumber": sMainData.HSupNumber
|
, "HSupName": sMainData.HSupName
|
, "HInnerBillNo": sMainData.HPOOrderBillNo
|
, "HZZRQ": HZZRQ
|
}
|
]
|
} else if(sMainData.HBarCodeType == "BarCode_Box") {
|
sMainData_temp = [
|
{
|
"HMainID": sMainData.HMainSourceInterID
|
, "HSubID": sMainData.HMainSourceEntryID
|
, "HBillNo": sMainData.HMainSourceBillNo
|
, "HBillType": sMainData.HMainSourceBillType
|
, "HMaterID": sMainData.HMaterID
|
, "HMaterNumber": sMainData.HMaterNumber
|
, "HMaterName": sMainData.HMaterName
|
, "HMaterModel": sMainData.HMaterModel
|
, "HCusModel": ""
|
, "HCusMaterName": ""
|
, "HEmpID": 0
|
, "HEmpNumber": ""
|
, "HEmpName": ""
|
, "HGroupID": 0
|
, "HGroupNumber": ""
|
, "HGroupName": ""
|
, "HCheckEmpName": ""
|
, "HBatchNo": sMainData.HBatchNo
|
, "HQty": 1
|
, "HMinQty": 1
|
, "HBQty": sMainData.HBarCodeQty
|
, "HPackQty": 0
|
, "HCoilNO": ""
|
, "HFurnaceNO": ""
|
, "HFactory": ""
|
, "HCusID": 0
|
, "HCusNumber": ""
|
, "HCusName": ""
|
, "HSeOrderBillNo": ""
|
, "HRemark": ""
|
, "HProduceDate": sMainData.HDate
|
, "HExpiryDate": sMainData.HDate
|
, "HheatNO": ""
|
, "HAuxPropID": sMainData.HAuxPropID
|
, "HAuxPropNumber": sMainData.HAuxPropNumber
|
, "HAuxPropName": sMainData.HAuxPropName
|
, "HUnitID": sMainData.HUnitID
|
, "HUnitNumber": ""
|
, "HUnitName": sMainData.HUnitName
|
, "HAuxQty": 0
|
, "HExpirationDateFlag": 0
|
, "HGiveAwayFlag": 0
|
, "HDate": sMainData.HDate
|
, "HMTONo": ""
|
, "HBarCodeType": sMainData.HBarCodeType
|
, "HSupID": sMainData.HSupID
|
, "HSupNumber": sMainData.HSupNumber
|
, "HSupName": sMainData.HSupName
|
, "HInnerBillNo": sMainData.HPOOrderBillNo
|
, "HZZRQ": HZZRQ
|
}
|
]
|
}else if (sMainData.HBarCodeType == "BarCode_Pack") {
|
sMainData_temp = [
|
{
|
"HMainID": sMainData.HMainSourceInterID
|
, "HSubID": sMainData.HMainSourceEntryID
|
, "HBillNo": sMainData.HMainSourceBillNo
|
, "HBillType": sMainData.HMainSourceBillType
|
, "HMaterID": sMainData.HMaterID
|
, "HMaterNumber": sMainData.HMaterNumber
|
, "HMaterName": sMainData.HMaterName
|
, "HMaterModel": sMainData.HMaterModel
|
, "HCusModel": ""
|
, "HCusMaterName": ""
|
, "HEmpID": 0
|
, "HEmpNumber": ""
|
, "HEmpName": ""
|
, "HGroupID": 0
|
, "HGroupNumber": ""
|
, "HGroupName": ""
|
, "HCheckEmpName": ""
|
, "HBatchNo": sMainData.HBatchNo
|
, "HQty": 1
|
, "HMinQty": 1
|
, "HBQty": sMainData.HBarCodeQty
|
, "HPackQty": 0
|
, "HCoilNO": ""
|
, "HFurnaceNO": ""
|
, "HFactory": ""
|
, "HCusID": 0
|
, "HCusNumber": ""
|
, "HCusName": ""
|
, "HSeOrderBillNo": ""
|
, "HRemark": ""
|
, "HProduceDate": sMainData.HDate
|
, "HExpiryDate": sMainData.HDate
|
, "HheatNO": ""
|
, "HAuxPropID": sMainData.HAuxPropID
|
, "HAuxPropNumber": sMainData.HAuxPropNumber
|
, "HAuxPropName": sMainData.HAuxPropName
|
, "HUnitID": sMainData.HUnitID
|
, "HUnitNumber": ""
|
, "HUnitName": sMainData.HUnitName
|
, "HAuxQty": 0
|
, "HExpirationDateFlag": 0
|
, "HGiveAwayFlag": 0
|
, "HDate": sMainData.HDate
|
, "HMTONo": ""
|
, "HBarCodeType": sMainData.HBarCodeType
|
, "HSupID": sMainData.HSupID
|
, "HSupNumber": sMainData.HSupNumber
|
, "HSupName": sMainData.HSupName
|
, "HInnerBillNo": sMainData.HPOOrderBillNo
|
, "HZZRQ": HZZRQ
|
}
|
]
|
} else {
|
layer.msg("条码类型不存在!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return;
|
}
|
|
|
var sSubStr = JSON.stringify(sMainData_temp);
|
//物料明细信息不为空判断
|
if (!AllowLoadData(sSubStr))//数据验证
|
{
|
$('#set_SaveBill').removeClass("layui-btn-disabled").attr("disabled", false);//生成按钮启用
|
return false;
|
}
|
//获取选择的组织
|
var HOrgType = sessionStorage["Organization"];
|
//获取选择的工厂代码
|
var CampanyName = "xxx";
|
//获取选择的源单类型
|
var HSourceBillType = $("#HMainSourceBillType").val();
|
//获取选择的条码类型
|
var HSelectBarCodeType = $("#HBarCodeType").val();
|
//获取当前登录人员
|
var UserName = sessionStorage["HUserName"];
|
//var UserName = "Admin";
|
var sMainSub = sSubStr + ';' + HOrgType + ';' + HSourceBillType + ';' + HSelectBarCodeType + ';' + CampanyName + ';' + UserName;
|
SaveBarCodeCreate(sMainSub);
|
});
|
|
//#region 条码生成
|
//条码生成
|
function SaveBarCodeCreate(sMainSub, CampanyName) {
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "/Sc_BarCode/Sub_SaveBill_JiaNan", //方法所在页面和方法名
|
async: false,
|
data: { "msg": sMainSub},
|
dataType: "json",
|
success: function (result) {
|
if (result.count == 1) { // 说明验证成功了,
|
option.data = result.data;
|
ins = table.render(option);
|
}
|
else {
|
$('#ToolCreate').removeClass("layui-btn-disabled").attr("disabled", false);//生成按钮启用
|
layer.alert(get_MessageError(result.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
layer.alert(get_MessageError(err.Message, sessionStorage["HTranSlate"]), { icon: 5 });
|
}
|
});
|
}
|
//#endregion
|
|
//#region 数据校验
|
function AllowLoadData(sSubStr) {
|
var Result = true;
|
//数值格式校验工具
|
var ref = /^\d+(\.\d+)?$/; //非负数正则表达式
|
var ref1 = /^[1-9]\d*$/; //正整数正则表达式
|
var temp = "";
|
sSubStr = JSON.parse(sSubStr);
|
|
if (sSubStr[0].HDate == "") {
|
layer.msg("日期未设置!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
if (sSubStr[0].HBarCodeType == "") {
|
layer.msg("条码类型未设置!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
if (sSubStr[0].HSourceInterID == "0" || sSubStr[0].HSourceEntryID == "0" || sSubStr[0].HSourceBillNo == "") {
|
layer.msg("源单信息有误!!【主内码:" + sSubStr[0].HSourceInterID + ";子内码:" + sSubStr[0].HSourceEntryID + ";源单号:" + sSubStr[0].HSourceBillNo + ";】", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
if (sSubStr[0].HMaterID == "0") {
|
layer.msg("物料信息有误!!【物料ID:" + sSubStr[0].HMaterID + ";物料代码:" + sSubStr[0].HMaterNumber + ";物料名称:" + sSubStr[0].HMaterName + ";规格型号:" + sSubStr[0].HMaterModel + ";】", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
if (sSubStr[0].HSupID == "0") {
|
layer.msg("供应商信息有误!!【供应商ID:" + sSubStr[0].HMaterID + ";供应商代码:" + sSubStr[0].HMaterNumber + ";供应商名称:" + sSubStr[0].HMaterName + ";】", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
|
if (sSubStr[0].HBarCodeType == "BarCode") {
|
temp = sSubStr[0].HQty + "";
|
if (temp == "0" || temp == "") {
|
layer.msg("源单数量不能为0或空!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
} else if (!ref.test(temp)) {
|
layer.msg("源单数量请输入大于0的数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
|
temp = sSubStr[0].HMinQty + "";
|
if (temp == "0" || temp == "") {
|
layer.msg("每包数量不能为0或空!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
} else if (!ref.test(temp)) {
|
layer.msg("每包数量请输入大于0的数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
|
temp = sSubStr[0].HBQty + "";
|
if (!ref1.test(temp)) {
|
layer.msg("包数请输入大于0的整数数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
|
var HEndQty = $("#HEndQty").val();
|
if (HEndQty == "") {
|
layer.msg("尾包数量不能为空!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
} else if (!ref.test(HEndQty)) {
|
layer.msg("尾包数量请输入不小于0的数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
|
var HEndQty_Sure = $("#HEndQty_Sure").val();
|
if (HEndQty != HEndQty_Sure) {
|
layer.msg("尾包数量与尾包确认不一致!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
}
|
else if (sSubStr[0].HBarCodeType == "BarCode_Box") {
|
temp = sSubStr[0].HBQty + "";
|
if (!ref1.test(temp)) {
|
layer.msg("条码张数请输入大于0的数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
}
|
else if (sSubStr[0].HBarCodeType == "BarCode_Box") {
|
temp = sSubStr[0].HBQty + "";
|
if (!ref1.test(temp)) {
|
layer.msg("条码张数请输入大于0的数字!!", { icon: 5, btn: [get_MessageError('[0000-2-008]确认', sessionStorage["HTranSlate"])], time: 2000, offset: 't', skin: 'layui-layer-lan', title: get_MessageError("[0000-2-009]温馨提示", sessionStorage["HTranSlate"]) });
|
return Result = false;
|
}
|
}
|
return Result;
|
}
|
//#endregion
|
//#endregion
|
|
//#region 导出按钮
|
form.on('submit(set_Export)', function (data) {
|
get_Export();
|
});
|
|
//#region 导出Execel
|
function get_Export() {
|
//var ModRightNameCheck = "Gy_BarCodeBill_JiaNan_ExportExcel";
|
|
////逻辑审核方法
|
//$.ajax({
|
// type: "GET",
|
// url: GetWEBURL() + "/LMES/getReportByModRightNameCheck", //方法所在页面和方法名
|
// data: { "ModRightNameCheck": ModRightNameCheck, "user": sessionStorage["HUserName"] },
|
// success: function (result) {
|
// if (result.count == 1) {
|
var data = option.data;
|
data.forEach((item) => {
|
for (let itemobj in item) {
|
if (item[itemobj] == null) {
|
item[itemobj] = "";
|
}
|
if (item[itemobj].length > 0) { // 假设字段名为field
|
item[itemobj] = item[itemobj].toString().replaceAll(/[\r\n]+/g, ''); // 将换行符替换为空字符串
|
item[itemobj] = item[itemobj].toString().replaceAll(/[,]+/g, ','); // 将换分号替换为空字符串
|
}
|
}
|
});
|
table.exportFile(ins.config.id, data, "xls");
|
// } else {
|
// layer.alert("当前模块没有导出权限!", { icon: 5 });
|
// }
|
// }, error: function () {
|
// layer.alert("接口请求失败!", { icon: 5 });
|
// }
|
//});
|
}
|
//#endregion
|
//#endregion
|
|
//#region 打印按钮
|
form.on('submit(btn-print)', function (data) {
|
get_PrintReport();
|
});
|
|
//#region 打印
|
function get_PrintReport() {
|
var checkStatus = table.checkStatus('mainTable')
|
, dataArr = checkStatus.data;
|
|
//由于条码信息列表中没有 HItemID 字段,所以采取了用 条码编号 去获取 HItemID 的方式
|
if (checkStatus.data.length > 0) {
|
var rows = [];
|
for (var i = 0; i < dataArr.length; i++) {
|
rows.push(dataArr[i].HItemID.toString());
|
}
|
//rows = rows.substring(rows.length - 1, 0);
|
layer.open({
|
type: 2
|
, area: ['50%', '50%']
|
, title: '打印模版选择'
|
, shade: 0.6 //遮罩透明度
|
, maxmin: false //允许全屏最小化
|
, anim: 0 //0-6的动画形式,-1不开启
|
, content: ['../../BaseSet/SRM_OpenTmpList.html?linterid=' + rows.toString() + '&MyMsg=' + rows.toString() + '&Type=HGy_BarCodeBill_JiaNan', 'yes']
|
, resize: false
|
})
|
}
|
else {
|
layer.msg(get_MessageError('[0000-1-016]请选择要打印的条码数据!', sessionStorage["HTranSlate"]));
|
}
|
}
|
//#endregion
|
//#endregion
|
|
//#region 退出按钮
|
form.on('submit(Exit)', function () {
|
if (params[1] != null) {
|
Pub_Close(1);
|
} else if (params[1] == null) {
|
Pub_Close(2);
|
}
|
})
|
//#endregion
|
//#endregion
|
|
//#region 文本框监听
|
$(document).ready(function () {
|
if (HBarCodeType == "BarCode") {
|
//#region 源单数量失焦事件
|
var oldHQty_SourceBill = ""; //修改前的值
|
var newHQty_SourceBill = ""; //修改后的值
|
$("#HQty_SourceBill").on('focus', function (data) {
|
oldHQty_SourceBill = $("#HQty_SourceBill").val() * 1; //金额文本框获取焦点时获取修改前的值
|
}).on('blur', function (data) {
|
newHQty_SourceBill = $("#HQty_SourceBill").val(); //金额文本框失焦时获取修改后的值
|
|
//判断输入的金额是否合法
|
var ref = /^\d+(\.\d+)?$/; //非负数正则表达式
|
if (!ref.test(newHQty_SourceBill)) {
|
layer.msg("源单数量请输入不小于0的数字!");
|
$("#HQty_SourceBill").val(oldHQty_SourceBill);
|
return false;
|
}
|
|
if (newHQty_SourceBill > HQty_waitProduce) {
|
layer.msg("条码生成数量大于最大可生成数量【" + HQty_waitProduce + "】!!");
|
$("#HQty_SourceBill").val(oldHQty_SourceBill);
|
return false;
|
}
|
|
//输入的源单数量合法,重算相关数据
|
var HQty_SourceBill = newHQty_SourceBill * 1; //源单数量
|
var HMinQty = $("#HMinQty").val() * 1; //每包数量
|
if (!ref.test(HMinQty) || HMinQty == "0") {
|
layer.msg("每包数量请输入不小于0的数字!");
|
$("#HQty_SourceBill").val(oldHQty_SourceBill);
|
return false;
|
}
|
|
|
var HEndQty = HQty_SourceBill % HMinQty; //尾包数量
|
var HBQty = (HQty_SourceBill - HEndQty) / HMinQty + ((HEndQty > 0) ? 1 : 0); //包数
|
|
$("#HQty_SourceBill").val(newHQty_SourceBill);
|
$("#HBQty").val(HBQty);
|
$("#HEndQty").val(HEndQty);
|
});
|
//#endregion
|
|
//#region 每包数量失焦事件
|
var oldHMinQty = ""; //修改前的值
|
var newHMinQty = ""; //修改后的值
|
$("#HMinQty").on('focus', function (data) {
|
oldHMinQty = $("#HMinQty").val() * 1; //每包数量文本框获取焦点时获取修改前的值
|
}).on('blur', function (data) {
|
newHMinQty = $("#HMinQty").val(); //金额文本框失焦时获取修改后的值
|
|
//判断输入的数据是否合法
|
var ref = /^\d+(\.\d+)?$/; //非负数正则表达式
|
if (!ref.test(newHMinQty) || newHMinQty == "0") {
|
layer.msg("每包数量请输入大于0的数字!");
|
$("#HMinQty").val(oldHMinQty);
|
return false;
|
}
|
|
//输入的源单数量合法,重算相关数据
|
var HMinQty = newHMinQty * 1; //每包数量
|
var HQty_SourceBill = $("#HQty_SourceBill").val() * 1; //源单数量
|
var HEndQty = HQty_SourceBill % HMinQty; //尾包数量
|
var HBQty = (HQty_SourceBill - HEndQty) / HMinQty + ((HEndQty > 0) ? 1 : 0); //包数
|
|
$("#HMinQty").val(HMinQty);
|
$("#HBQty").val(HBQty);
|
$("#HEndQty").val(HEndQty);
|
});
|
//#endregion
|
}
|
});
|
//#endregion
|
|
//#region 子表相关监听
|
//#region 头工具栏事件
|
table.on('toolbar(mainTable)', function (obj) {
|
var checkStatus = table.checkStatus('mainTable')
|
, data = checkStatus.data;
|
|
switch (obj.event) {
|
//列设置
|
case 'set_HideColumn':
|
get_HideColumn();
|
break;
|
}
|
});
|
//#endregion
|
|
//#region 子表1:隐藏列设置
|
function get_HideColumn() {
|
var colName = "";
|
var contentUrl = "";
|
for (var i = 1; i < option.cols[0].length - 1; i++) {
|
colName += option.cols[0][i]["title"] + ",";
|
}
|
var urlStr = window.document.location.pathname;//获取文件路径
|
var urlLen = urlStr.split('/');
|
for (var i = 0; i < urlLen.length - 4; i++) {
|
contentUrl += "../";
|
}
|
colName = encodeURI(colName.substring(0, colName.length - 1));//对 URI 进行编码
|
|
contentUrl += '基础资料/隐藏列设置/Gy_GridView_Hide.html?HModName=' + HModName + '&colName=' + colName;
|
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "隐藏列设置" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["50%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: [contentUrl, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//刷新表格数据
|
DisPlay_HideColumn();
|
//更新表格缓存的数据
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
//#endregion
|
//#region 子表1:显示列数据
|
function DisPlay_HideColumn() {
|
$.ajax({
|
url: GetWEBURL() + '/Xt_grdAlignment_WMES/grdAlignmentWMESList',
|
async: false,
|
type: "GET",
|
data: { "HModName": HModName, "user": sessionStorage["HUserName"] },
|
async: false,
|
success: function (data1) {
|
if (data1.data.length != 0) {
|
var dataCol = [];//数据库查询出的列数据
|
var titleData = ["HMaterID", "HUnitID", "源单内码", "源单子内码", "源单号", "源单类型", "关联数量", "关联金额", "HQty_Old", "HQty_New"];//不需要显示的字段 可扩展
|
//titleData = [];
|
|
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];
|
}
|
//设置内容字体大小
|
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;
|
}
|
//设置表格title属性显示别名
|
if (dataCols[4] != null && dataCols[4] != "") {
|
option.cols[0][i + 1]["title"] = dataCols[4];
|
}
|
}
|
|
//取消冻结列
|
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 });
|
}
|
})
|
}
|
//#endregion
|
//#endregion
|
|
//#region 页面初始化方法
|
//#region 子表初始化
|
function set_InitGrid() {
|
//表头
|
var columns = [
|
{ type: 'checkbox', fixed: 'left' }
|
, { templet: '#xuhao', title: '序号', sort: true, fixed: 'left', event: "qwe", width: 100 }
|
, { field: 'HItemID', title: 'HItemID', width: 100, hide: true }
|
, { field: 'hmainid', title: 'hmainid', width: 100, hide: true }
|
, { field: 'hsubid', title: 'hsubid', width: 100, hide: true }
|
, { field: 'HinterID', title: 'HinterID', width: 100, hide: true }
|
, { field: '条码类型', title: '条码类型', width: 100 }
|
, { field: '条码编号', title: '条码编号', width: 120 }
|
, { field: 'HMaterID', title: '物料ID', width: 100, hide: true }
|
, { field: '物料代码', title: '物料代码', width: 120 }
|
, { field: '物料名称', title: '物料名称', width: 120 }
|
, { field: '规格型号', title: '规格型号', width: 120 }
|
, { field: 'HUnitID', title: '计量单位ID', width: 100, hide: true }
|
, { field: '计量单位代码', title: '计量单位代码', width: 120 }
|
, { field: '计量单位', title: '计量单位', width: 120 }
|
, { field: 'HAuxPropID', title: '辅助属性ID', width: 100, hide: true }
|
, { field: '辅助属性代码', title: '辅助属性代码', width: 120 }
|
, { field: '辅助属性', title: '辅助属性', width: 120 }
|
, { field: '批号', title: '批号', width: 120 }
|
, { field: '数量', title: '数量', width: 100 }
|
, { field: '源单单号', title: '源单单号', width: 120 }
|
, { field: '计划跟踪号', title: '计划跟踪号', width: 120 }
|
, { field: '是否赠品', title: '是否赠品', width: 100 }
|
, { field: 'DeptID', title: '车间ID', width: 100, hide: true }
|
, { field: '车间', title: '车间', width: 120 }
|
, { field: 'HSupID', title: '供应商ID', width: 100, hide: true }
|
, { field: '供应商代码', title: '供应商代码', width: 120 }
|
, { field: '供应商', title: '供应商', width: 120 }
|
, { field: '客户条码编号', title: '客户条码编号', width: 120 }
|
, { field: '客户型号', title: '客户型号', width: 120 }
|
, { field: '往来单位', title: '往来单位', width: 120 }
|
, { field: '销售订单号', title: '销售订单号', width: 120 }
|
, { field: '销售订单行号', title: '销售订单行号', width: 120 }
|
, { field: '托号', title: '托号', width: 120 }
|
, { field: '总托数', title: '总托数', width: 100 }
|
, { field: '条码日期', title: '条码日期', width: 120 }
|
, { field: '生产入库日期', title: '生产入库日期', width: 120 }
|
, { field: '生产入库单号', title: '生产入库单号', width: 120 }
|
, { field: '生产入库次数', title: '生产入库次数', width: 100 }
|
, { field: '销售出库日期', title: '销售出库日期', width: 120 }
|
, { field: '销售出库单号', title: '销售出库单号', width: 120 }
|
, { field: '销售出库次数', title: '销售出库次数', width: 100 }
|
, { field: '作废标记', title: '作废标记', width: 100 }
|
, { field: '作废人', title: '作废人', width: 100 }
|
, { field: '备注', title: '备注', width: 120 }
|
, { field: '制作人', title: '制作人', width: 100 }
|
, { field: '日期', title: '日期', width: 120 }
|
, { field: '计划完工日期', title: '计划完工日期', width: 120 }
|
, { field: '打印次数', title: '打印次数', width: 100 }
|
, { field: 'HSTOCKORGID', title: 'HSTOCKORGID', width: 100, hide: true }
|
, { field: '生成组织', title: '生成组织', width: 120 }
|
];
|
option = {
|
id: 'mainTable'
|
, elem: '#mainTable'
|
, toolbar: '#toolbarDemo'
|
, page: false
|
, limit: 50000
|
, cellMinWidth: 120
|
, height: 'full-325'
|
, cols: [columns]
|
, data: []
|
, done: function (res, curr, count) {
|
}
|
};
|
table.render(option);
|
}
|
//#endregion
|
|
//#region 下推页面初始化
|
function setInit_PushBill() {
|
//初始化日期、制单人、制单日期
|
$("#HDate").val(Format(new Date(), "yyyy-MM-dd"));
|
$("#HBarCodeType").val(HBarCodeType);
|
$("#HMainSourceInterID").val(HSourceInterID);
|
$("#HMainSourceEntryID").val(HSourceEntryID);
|
$("#HMainSourceBillNo").val(HSourceBillNo);
|
$("#HMainSourceBillType").val(HSourceBillType);
|
|
//禁用条码类型
|
$("#HBarCodeType").attr("disabled", true);
|
|
if (HBarCodeType == "BarCode") {
|
var HBarCodeQtyElement = document.getElementById("HBarCodeQtyElement");
|
HBarCodeQtyElement.style.display = "none";
|
|
var temp = getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HPOOrderBillNo": dataArray[0].源单单号
|
, "HSupID": dataArray[0].HSupID
|
, "HSupNumber": dataArray[0].供应商代码
|
, "HSupName": dataArray[0].供应商
|
, "HMaterID": dataArray[0].HMaterID
|
, "HMaterNumber": dataArray[0].物料代码
|
, "HMaterName": dataArray[0].物料名称
|
, "HMaterModel": dataArray[0].规格型号
|
, "HUnitID": dataArray[0].HUnitID
|
, "HUnitName": dataArray[0].计量单位
|
, "HQty_SourceBill": (dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1)
|
, "HBatchNo": dataArray[0].批号
|
, "HAuxPropID": dataArray[0].HAuxPropID
|
, "HAuxPropNumber": dataArray[0].辅助属性代码
|
, "HAuxPropName": dataArray[0].辅助属性
|
});
|
HZZRQ = dataArray[0].制造日期;
|
|
HQty_waitProduce = (dataArray[0].数量 * 1) - (dataArray[0].已生成条码数量 * 1);
|
}
|
else if (HBarCodeType == "BarCode_Box") {
|
var HQty_SourceElement = document.getElementById("HQty_SourceElement");
|
HQty_SourceElement.style.display = "none";
|
var HMinQtyElement = document.getElementById("HMinQtyElement");
|
HMinQtyElement.style.display = "none";
|
var HBQtyElement = document.getElementById("HBQtyElement");
|
HBQtyElement.style.display = "none";
|
var HEndQtyElement = document.getElementById("HEndQtyElement");
|
HEndQtyElement.style.display = "none";
|
var HEndQty_SureElement = document.getElementById("HEndQty_SureElement");
|
HEndQty_SureElement.style.display = "none";
|
|
|
var temp = getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HPOOrderBillNo": dataArray[0].源单单号
|
, "HSupID": dataArray[0].HSupID
|
, "HSupNumber": dataArray[0].供应商代码
|
, "HSupName": dataArray[0].供应商
|
, "HMaterID": dataArray[0].HMaterID
|
, "HMaterNumber": dataArray[0].物料代码
|
, "HMaterName": dataArray[0].物料名称
|
, "HMaterModel": dataArray[0].规格型号
|
, "HUnitID": dataArray[0].HUnitID
|
, "HUnitName": dataArray[0].计量单位
|
, "HQty_SourceBill": dataArray[0].数量
|
, "HBatchNo": dataArray[0].批号
|
, "HAuxPropID": dataArray[0].HAuxPropID
|
, "HAuxPropNumber": dataArray[0].辅助属性代码
|
, "HAuxPropName": dataArray[0].辅助属性
|
});
|
HZZRQ = dataArray[0].制造日期;
|
}
|
else if (HBarCodeType == "BarCode_Pack") {
|
var HQty_SourceElement = document.getElementById("HQty_SourceElement");
|
HQty_SourceElement.style.display = "none";
|
var HMinQtyElement = document.getElementById("HMinQtyElement");
|
HMinQtyElement.style.display = "none";
|
var HBQtyElement = document.getElementById("HBQtyElement");
|
HBQtyElement.style.display = "none";
|
var HEndQtyElement = document.getElementById("HEndQtyElement");
|
HEndQtyElement.style.display = "none";
|
var HEndQty_SureElement = document.getElementById("HEndQty_SureElement");
|
HEndQty_SureElement.style.display = "none";
|
|
|
var temp = getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID);
|
var dataArray = [];
|
dataArray.push(temp);
|
|
form.val("component-form-group", { //formTest 即 class="layui-form" 所在元素属性 lay-filter="" 对应的值
|
"HPOOrderBillNo": dataArray[0].源单单号
|
, "HSupID": dataArray[0].HSupID
|
, "HSupNumber": dataArray[0].供应商代码
|
, "HSupName": dataArray[0].供应商
|
, "HMaterID": dataArray[0].HMaterID
|
, "HMaterNumber": dataArray[0].物料代码
|
, "HMaterName": dataArray[0].物料名称
|
, "HMaterModel": dataArray[0].规格型号
|
, "HUnitID": dataArray[0].HUnitID
|
, "HUnitName": dataArray[0].计量单位
|
, "HQty_SourceBill": dataArray[0].数量
|
, "HBatchNo": dataArray[0].批号
|
, "HAuxPropID": dataArray[0].HAuxPropID
|
, "HAuxPropNumber": dataArray[0].辅助属性代码
|
, "HAuxPropName": dataArray[0].辅助属性
|
});
|
HZZRQ = dataArray[0].制造日期;
|
}
|
else {
|
return layer.msg('当前不支持该源单下推!!');
|
}
|
}
|
|
//#endregion
|
|
//#region 根据主内码与子内码获取源单收料通知单数据
|
function getPushSource_POInStockBillInit(HSourceInterID, HSourceEntryID) {
|
var res = "none";
|
var sql = "select * from h_v_IF_POInStockBillList_Source where 1=1 and HMainID = " + HSourceInterID + " and HSubID = " + HSourceEntryID;
|
var ModRightNameCheck = "";
|
$.ajax({
|
url: GetWEBURL() + "/CommonModel/searchMethod",
|
async: false,
|
type: "GET",
|
data: {
|
"sql": sql
|
, "user": sessionStorage["HUserName"]
|
, "ModRightNameCheck": ModRightNameCheck
|
},
|
success: function (result) {
|
if (result.code == 1) { // 说明验证成功了,
|
res = result.data[0];
|
} else {
|
res = result.data;
|
//layer.alert(result.msg, { icon: 5, btn: ['退出'], time: 100000, offset: 't' });
|
}
|
}, error: function (err) {
|
res = "none";
|
layer.alert("发生错误!" + err, { icon: 5 });
|
}
|
});
|
return res;
|
}
|
//#endregion
|
//#endregion
|
|
//#region 页面通用方法
|
//#region 判断是否登录 未登录则跳到登录页
|
function get_LoginIs() {
|
if (sessionStorage.login != "login") {
|
layer.confirm("登录失效,请重新登录!", {
|
icon: 4, skin: 'layui-layer-lan', title: "温馨提示", closeBtn: 0, btn: ['重新登录']
|
}, function () { window.location.href = "../../user/login.html"; });
|
}
|
}
|
//#endregion
|
|
//#region 获取参数_传递的JSON格式参数
|
function getUrlVars_JSON() {
|
var datajson;
|
var str = window.location.search; //获取链接中传递的参数
|
var arr = str.substring(str.lastIndexOf("=")+1);
|
datajson = $.parseJSON(decodeURI(arr));
|
return datajson;
|
}
|
//#endregion
|
|
//#region 时间转换
|
function formatDate(date) {
|
var d = new Date(date),
|
month = '' + (d.getMonth() + 1),
|
day = '' + d.getDate(),
|
year = d.getFullYear();
|
|
if (month.length < 2) {
|
month = '0' + month;
|
}
|
if (day.length < 2) {
|
day = '0' + day;
|
}
|
|
return [year, month, day].join('-');
|
}
|
//#endregion
|
//#endregion
|
//#endregion
|
});
|
</script>
|
</body>
|
</html>
|