<!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>
|
<style>
|
.layui-row .layui-btn layui-btn-normal {
|
margin: 0px 10px;
|
}
|
/* .layui-inline {
|
margin: 0px 80px;
|
}*/
|
</style>
|
</head>
|
<body>
|
<div class="layui-fluid" style="padding: 0;">
|
<div class="layui-card" style="padding: 2px;background-color: #efefef;">
|
<div class="layui-card-body" style="padding: 1px;">
|
<form class="layui-form" action="" lay-filter="formData" style="background-color:white;">
|
<div style="padding: 10px; ">
|
<div class="layui-inline">
|
<label class="layui-form-label">配套数量</label>
|
<div class="layui-input-block">
|
<input type="text" class="layui-input" name="PTCount" lay-verify="PTCount" id="PTCount" placeholder="请键入后回车">
|
</div>
|
</div>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="ptjl" id="ptjl">配套叫料</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="HideColumn" id="HideColumn">隐藏列设置</button>
|
<button class="layui-btn layui-btn-normal" type="button" lay-submit="" style="margin-left: 0px;" lay-filter="btnReSearch" id="btnReSearch">重置</button>
|
<div class="layui-inline">
|
<div style="padding-left: 10px;">
|
<input type="checkbox" name="checkZXBZ" id="checkZXBZ" lay-skin="primary" lay-filter="checkZXBZ" title="最小包装">
|
</div>
|
</div>
|
</div>
|
<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;padding: 9px 18px;">产品代码</label>
|
<div class="layui-input-block" style="margin-left: 77px;">
|
<input type="text" class="layui-input" lay-verify="MaterialNumber" name="MaterialNumber" id="MaterialNumber" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnMaterial" id="btnMaterial" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</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="MaterialName" lay-verify="MaterialName" id="MaterialName" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="MaterialID" id="MaterialID" lay-verify="MaterialID" value="0">
|
</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="MaterialModel" id="MaterialModel" readonly>
|
</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" 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" style="width: 85px;">销售订单号</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HSeOrderBillNo" lay-verify="HSeOrderBillNo" id="HSeOrderBillNo">
|
</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="DepartmentID" name="DepartmentID" id="DepartmentID" value="0" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<input type="text" class="layui-input" lay-verify="DepartmentName" name="DepartmentName" id="DepartmentName" value="" style="background-color:#efefef4d;width: 60%;display: inline-block;" readonly>
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnDepartment" id="btnDepartment" style="padding: 0 10px;float: right;margin-right: 3px;">
|
<i class="layui-icon layui-icon-search layuiadmin-button-btn"></i>
|
</button>
|
</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="HICMOBillNo" lay-verify="HICMOBillNo" id="HICMOBillNo" value="">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-collapse">
|
<div class="layui-colla-item">
|
<div class="layui-form-item" style="padding-top: 10px;">
|
<table class="" id="mainTable" lay-filter="mainTable"></table>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<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 sWhere = "";
|
var option = [];
|
var HModName = "JIT_ComplementGoodPT";
|
var HICMOInterID = 0;
|
var HICMOEntryID = 0;
|
var HDeptID = 0;
|
var HOrgID = 0;
|
//#endregion
|
|
//#region 进入页面即加载
|
|
var params = getUrlVars();
|
var OperationType = params[params[0]];
|
|
//判断是否有参数传递
|
if (!isNaN(OperationType)) {
|
HICMOInterID = params[params[1]];
|
HICMOEntryID = params[params[2]];
|
HDeptID = params[params[3]];
|
HOrgID = params[params[4]];
|
}
|
|
//初始化界面
|
set_ClearBill();
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//过滤查询
|
form.on('submit(btnSearch)', function () {
|
get_FastQuery();
|
})
|
|
//选择生产车间
|
form.on('submit(btnDepartment)', function () {
|
btnDepartment();
|
})
|
|
//选择物料
|
form.on('submit(btnMaterial)', function () {
|
btnMaterial();
|
})
|
|
//重置按钮
|
form.on('submit(btnReSearch)', function (data) {
|
set_ClearQuery();
|
});
|
|
//行内事件
|
table.on('tool(mainTable)', function (obj) {
|
set_GridCellCheck(obj); //行内快捷键筛选
|
})
|
|
//配套叫料
|
form.on('submit(ptjl)', function (data) {
|
set_ptjl();
|
});
|
|
//配套数量
|
$('#PTCount').on('keydown', function (event) {
|
if (event.keyCode == 13) {
|
PTTable();
|
}
|
});
|
|
//隐藏列设置
|
form.on('submit(HideColumn)', function () {
|
get_HideColumn();
|
})
|
|
//最小包装
|
form.on('checkbox(checkZXBZ)', function (data) {
|
var checkZXBZ = $("input[name='checkZXBZ']").prop("checked");//复选框
|
|
if (checkZXBZ) {
|
for (var i = 0; i < option.cols[0].length; i++) {
|
if (option.cols[0][i]["field"] == "包数") {
|
option.cols[0][i]["edit"] = "text";
|
}
|
if (option.cols[0][i]["field"] == "配套数量") {
|
option.cols[0][i]["edit"] = "";
|
}
|
}
|
} else {
|
for (var i = 0; i < option.cols[0].length; i++) {
|
if (option.cols[0][i]["field"] == "包数") {
|
option.cols[0][i]["edit"] = "";
|
}
|
if (option.cols[0][i]["field"] == "配套数量") {
|
option.cols[0][i]["edit"] = "text";
|
}
|
}
|
}
|
table.render(option);
|
})
|
|
//行内鼠标离开事件
|
table.on('edit(mainTable)', function (obj) {
|
var HQty = 0.0;
|
|
if (obj.field == "包数") {
|
HQty = parseFloat(obj.data["包数"]) * parseFloat(obj.data["最小包装"])
|
//修改数据
|
obj.update({
|
"配套数量": HQty
|
});
|
}
|
})
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//初始化界面
|
function set_ClearBill()
|
{
|
set_InitGrid();
|
get_FastQuery();
|
DisPlay_HideColumn();
|
}
|
|
//表格数据
|
function set_InitGrid() {
|
option = {
|
elem: '#mainTable'
|
//, toolbar: '#toolbarDemo'
|
, height: 'full-130'
|
, cellMinWidth: 90
|
, limit: 500
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
//, { field: '销售订单号', title: '销售订单号',width: 150 }
|
, { field: '生产订单号', title: '生产订单号', width: 120}
|
, { field: '生产车间', title: '生产车间', width: 120 }
|
//, { field: '计划开工日期', title: '计划开工日期', width: 160, templet: "<div>{{d.计划开工日期 ==null ?'':layui.util.toDateString(d.计划开工日期, 'yyyy-MM-dd')}}</div>" }
|
, { field: '物料代码', title: '物料代码', width: 160 }
|
, { field: '物料名称', title: '物料名称', width: 160 }
|
, { field: '规格型号', title: '规格型号' }
|
, { field: '计划发料数量', title: '计划发料数量', width: 160 }
|
//, { field: '叫料数量', title: '叫料数量', width: 160, edit: 'text'}
|
//, { field: '退料数量', title: '退料数量', width: 160, edit: 'text'}
|
//, { field: '退料原因', title: '退料原因', width: 160, edit: 'text'}
|
, { field: '调出仓库', title: '调出仓库', width: 120, edit: 'text', event: 'OutWarehouse' }
|
, { field: '调出仓库id', title: '调出仓库id', width: 120, hide: true }
|
, { field: '调入仓库', title: '调入仓库', width: 120, edit: 'text', event: 'InWarehouse' }
|
, { field: '调入仓库id', title: '调入仓库id', width: 120, hide: true }
|
, { field: '最小包装', title: '最小包装', width: 160 }
|
, { field: '包数', title: '包数', width: 160 }
|
, { field: '配套数量', title: '配套数量', width: 120, edit: 'text' }
|
, { field: '调出仓库可用库存数量', title: '调出仓库可用库存数量', width: 120 }
|
, { field: '调出仓库库存数量', title: '调出仓库库存数量', width: 120 }
|
, { field: '已叫料数量', title: '已叫料数量', width: 160}
|
, { field: '已配送数量', title: '已配送数量', width: 160 }
|
, { field: '库存数量', title: '库存数量', width: 120 }
|
, { field: '子项单位', title: '子项单位' }
|
, { field: '单位用量', title: '单位用量' }
|
, { field: '可用库存', title: '可用库存', width: 120 }
|
, { field: '产品代码', title: '产品代码', width: 170 }
|
, { field: '产品名称', title: '产品名称', width: 260, }
|
, { field: '产品规格型号', title: '产品规格型号' }
|
, { field: '调出组织', title: '调出组织', width: 120}
|
, { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
|
, { field: '源单主内码', title: '源单主内码', hide: true }
|
, { field: '源单子内码', title: '源单子内码', hide: true }
|
, { field: 'HDeptID', title: 'HDeptID', hide: true }
|
, { field: 'HDeptNumber', title: 'HDeptNumber', hide: true }
|
, { field: 'HMaterialID', title: 'HMaterialID', hide: true }
|
, { field: 'HWHID', title: 'HWHID', hide: true }
|
, { field: 'HOutOrgID', title: 'HOutOrgID', hide: true }
|
, { field: 'HSouceInterID', title: 'HSouceInterID', hide: true }
|
, { field: 'HSourceEntryID', title: 'HSourceEntryID', hide: true }
|
, { field: 'HSourceBillNo', title: 'HSourceBillNo', hide: true }
|
, { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
|
, { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
|
, { field: 'HSTOCKID', title: 'HSTOCKID', hide: true }
|
]]
|
, done: function (res, curr, count) {
|
for (var i in res.data) {
|
var item = res.data[i];
|
|
if (item["配套数量"] > item["调出仓库可用库存数量"]) {
|
$("tr[data-index='" + i + "']").attr({ "style": "background:red;color:black;" });
|
}
|
}
|
}
|
};
|
}
|
|
//查询加载数据
|
function get_Display(sWhere) {
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + '/Sc_ComplementGoodBill/JIT_ComplementGoodPT',
|
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);
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
});
|
}
|
|
//生产车间
|
function btnDepartment() {
|
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('请选择数据');
|
}
|
//获取数据
|
$("#DepartmentID").val(checkStatus.data[0].HItemID);//部门id
|
$("#DepartmentName").val(checkStatus.data[0].HName);//部门名称
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//产品
|
function btnMaterial() {
|
layer.open({
|
type: 2 //类型
|
, skin: 'layui-layer-rim'//加上边框
|
, area: ['90%', '90%']//大小
|
, title: '物料列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../Baseset/基础资料/Gy_MaterialList.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('请选择数据');
|
}
|
//获取数据
|
$("#MaterialID").val(checkStatus.data[0].HItemID);//物料id
|
$("#MaterialName").val(checkStatus.data[0].HName);//物料名称
|
$("#MaterialModel").val(checkStatus.data[0].HModel);//物料规格型号
|
$("#MaterialNumber").val(checkStatus.data[0].HNumber);//物料代码
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
, btn2: function (index, layero) { }
|
})
|
}
|
|
//快速过滤
|
function get_FastQuery() {
|
var HSeOrderBillNo = $("#HSeOrderBillNo").val(); //销售订单号
|
var DepartmentID = $("#DepartmentID").val(); //生产车间
|
var HICMOBillNo = $("#HICMOBillNo").val(); //生产订单号
|
var MaterialNumber = $("#MaterialNumber").val(); //物料代码
|
var MaterialName = $("#MaterialName").val(); //物料名称
|
var MaterialModel = $("#MaterialModel").val(); //物料规格型号
|
var User = sessionStorage["HUserName"]; //制单人
|
var HORGID = sessionStorage["OrganizationID"]; //组织
|
|
if (DepartmentID==0) {
|
DepartmentID = HDeptID;
|
}
|
sWhere = "'" + HSeOrderBillNo + "','" + HICMOBillNo + "','" + DepartmentID + "','" + MaterialNumber + "','" + MaterialName + "','" + MaterialModel + "','" + HORGID + "','" + HICMOInterID + "','" + HICMOEntryID + "','" + User + "'";
|
get_Display(sWhere);
|
sWhere = "";
|
}
|
|
//隐藏列设置
|
function get_HideColumn() {
|
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 = ["调出仓库id", "调入仓库id", "HDeptID", "HDeptNumber", "HMaterialID", "HWHID", "HOutOrgID", "HSouceInterID", "HSourceEntryID", "HSourceBillNo", "HICMOInterID", "HICMOEntryID","HSTOCKID"];//不需要显示的字段 可扩展
|
|
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 (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 (dataCols[3] > 0) {
|
option.cols[0][i + 1]["width"] = dataCols[3];
|
}
|
//显示列
|
if (dataCols[1] == 0 && $.inArray(option.cols[0][i + 1]["field"], 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 set_ClearQuery() {
|
$("#HSeOrderBillNo").val("");
|
$("#DepartmentID").val("");
|
$("#DepartmentName").val("");
|
$("#HICMOBillNo").val("");
|
$("#MaterialNumber").val("");
|
$("#MaterialName").val("");
|
$("#MaterialModel").val("");
|
$("#MaterialID").val("");
|
sWhere = "";
|
}
|
|
//行内快捷键
|
function set_GridCellCheck(obj) {
|
$(document).off('keydown', ".layui-table-edit").on('keydown', '.layui-table-edit', function (e) {
|
if (event.key == "F7") {
|
if (obj.event == "OutWarehouse") {
|
var MaterNum = obj.data["物料代码"];
|
//打开维修项目小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "仓库列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_WarehouseList_JIT.html?MaterNum=" + MaterNum + "&HOrgID=" + HOrgID, "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"调出仓库": checkStatus.data[0].仓库名称
|
, "调出仓库id": checkStatus.data[0].仓库ID
|
, "调出仓库库存数量": checkStatus.data[0].调出仓库库存数量
|
, "调出仓库可用库存数量": checkStatus.data[0].调出仓库可用库存数量
|
, "HOutOrgID": checkStatus.data[0].库存组织
|
, "调出组织": checkStatus.data[0].组织名称
|
|
})
|
table.render(option);
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
|
if (obj.event == "InWarehouse") {
|
//打开维修项目小窗体
|
layer.open({
|
type: 2
|
, skin: "layui-layer-rim" //加上边框
|
, title: "仓库列表" //标题
|
, closeBtn: 1 //窗体右上角关闭 的 样式
|
, shift: 2 //弹出动画
|
, area: ["90%", "90%"] //窗体大小
|
, maxmin: true //设置最大最小按钮是否显示
|
, content: ["../../Baseset/基础资料/Gy_WarehouseList.html", "yes"]
|
, btn: ["确定", "取消"]
|
, btn1: function (index, laero) {
|
//按钮一 的回调
|
var iframeWindow = window["layui-layer-iframe" + index];//获取弹框页面
|
var checkStatus = iframeWindow.layui.table.checkStatus("mainTable");//获取选中的数据
|
|
if (checkStatus.data.length != 1) {
|
return layer.msg("请选择一条数据");
|
}
|
//更新表格缓存的数据
|
obj.update({
|
"调入仓库": checkStatus.data[0].HName
|
, "调入仓库id": checkStatus.data[0].HItemID
|
})
|
layer.close(index);//关闭弹窗
|
}
|
})
|
}
|
}
|
})
|
}
|
|
//配套数量 修改表格
|
//最小包装数量 修改表格
|
function PTTable() {
|
if ($('#PTCount').val() % 1 != 0) {
|
return layer.msg("请输入整数数量!");
|
}
|
if ($('#PTCount').val() <= 0) {
|
return layer.msg("请输入数量大于0!");
|
}
|
var checkZXBZ = $("input[name='checkZXBZ']").prop("checked");//复选框
|
|
if (checkZXBZ) {
|
for (var i = 0; i < option.data.length; i++) {
|
var num = $('#PTCount').val() * option.data[i]["最小包装"];
|
option.data[i]["配套数量"] = num;
|
option.data[i]["包数"] = $('#PTCount').val();
|
}
|
}
|
else {
|
for (var i = 0; i < option.data.length; i++) {
|
var num = $('#PTCount').val() * option.data[i]["单位用量"];
|
option.data[i]["配套数量"] = num;
|
}
|
}
|
table.render(option);
|
}
|
|
//配套数量 新增
|
function set_ptjl() {
|
for (var item in table.cache["mainTable"]) {
|
if (table.cache["mainTable"][item]["配套数量"] > table.cache["mainTable"][item]["调出仓库可用库存数量"] || table.cache["mainTable"][item]["配套数量"] == 0) {
|
return layer.msg("第" + (parseInt(item) + 1) + "行的配套数量大于调出仓库可用库存数量!或者配套数量为0!");
|
}
|
|
}
|
|
var sMainStr = JSON.stringify(table.cache['mainTable']) + ";" + sessionStorage["HUserName"] + ";" + sessionStorage["OrganizationID"];
|
$.ajax(
|
{
|
type: "POST",
|
url: GetWEBURL() + "/Sc_ComplementGoodBill/InsertCallGoodsBill_PTJL", //方法所在页面和方法名
|
async: true,
|
data: { "msg": sMainStr },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了,
|
layer.msg(data.Message, { icon: 1 });
|
//刷新页面
|
get_FastQuery();
|
}
|
else {
|
layer.alert(data.Message, { icon: 5 });
|
}
|
layer.closeAll("loading");
|
},
|
error: function (err) {
|
layer.alert("错误:" + err, { icon: 5 });
|
}
|
});
|
}
|
|
//获取参数
|
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;
|
}
|
|
//#endregion
|
|
});
|
|
|
</script>
|