<!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.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">
|
</head>
|
<body>
|
<div class="layui-fluid">
|
<div class="layui-card" style="padding: 1%">
|
<div class="layui-card-body" style="padding: 15px;">
|
<form class="layui-form" action="" lay-filter="component-form-group">
|
<div class="layui-form-item">
|
<label class="layui-form-label">数量</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HQty" id="HQty" lay-verify="HQty" autocomplete="off" style="width:100%" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-tab">
|
<ul class="layui-tab-title" lay-filter="tab-all">
|
<li lay-id="1">条码明细</li>
|
<li lay-id="2">条码档案</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<table class="layui-hide" id="mx-table" lay-filter="mx-table"></table>
|
<div class="layui-card-header"></div>
|
<div class="layui-form-item">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdChange">调整</button>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdDel">删除</button>
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="cmdCancel">退出</button>
|
</div>
|
</div>
|
<div class="layui-tab-item">
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">条形码</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HBarcode" id="HBarcode" lay-verify="HBarcode" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">物料档案</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HM" id="HM" lay-verify="HM" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">往来单位</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HSupName" id="HSupName" lay-verify="HSupName" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" autocomplete="off" class="layui-input">
|
</div>
|
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">部门</label>
|
<div class="layui-input-inline">
|
<input type="text" name="HDeptName" id="HDeptName" lay-verify="HDeptName" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HDeptID" id="HDeptID" lay-verify="HDeptID" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">仓库</label>
|
<div class="layui-input-inline mobile">
|
<input type="text" name="HWHNAME" id="HWHNAME" lay-verify="HWHNAME" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HWHID" id="HWHID" lay-verify="HWHID" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item">
|
<label class="layui-form-label" style="width:60px;padding-left:0px;">仓位</label>
|
<div class="layui-input-inline mobile">
|
<input type="text" name="HSCWHNAME" id="HSCWHNAME" lay-verify="HSCWHNAME" autocomplete="off" class="layui-input">
|
<input type="hidden" name="HSCWID" id="HSCWID" lay-verify="HSCWID" autocomplete="off" class="layui-input">
|
</div>
|
</div>
|
<div class="layui-form-item" style="margin-bottom: 20px;">
|
<button type="button" lay-submit="" class="layui-btn" lay-filter="button1">返回</button>
|
</div>
|
</div>
|
</div>
|
</div>
|
</form>
|
</div>
|
</div>
|
</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 src="../../layuiadmin/Scripts/webConfig.js"></script>
|
<script>
|
|
|
//layui.config({
|
// base: '../../layuiadmin/' //静态资源所在路径
|
//}).extend({
|
// index: 'lib/index' //主入口模块
|
//}).use(['index', 'form', 'table'], function () {
|
// var $ = layui.$
|
// , admin = layui.admin
|
// , layer = layui.layer
|
// , table = layui.table
|
// , form = layui.form;
|
|
layui.config({
|
base: '../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'form', 'laydate', 'table', 'element'], function () {
|
var $ = layui.$
|
, admin = layui.admin
|
, layer = layui.layer
|
, table = layui.table
|
, form = layui.form
|
, element = layui.element;
|
|
|
|
//获取页面跳转参数
|
var HMTONo = ''
|
var HSourceInterID = 0
|
var HSourceEntryID = 0
|
var HQty = 0
|
var HAuxPropID = 0
|
var HBatchNo = ''
|
|
var params = getUrlVars();
|
if (typeof (params[params[0]]) == "undefined") {
|
var OperationType = 1;//操作类型
|
} else {
|
var HInterID = params[params[0]];//单据ID
|
var HMaterID = params[params[1]];//物料ID
|
//var HAuxPropID = params[params[2]];//辅助属性
|
//var HMTONo = params[params[3]];//计划跟踪号
|
//var HWhID = params[params[4]];//仓库ID
|
//var HSPID = params[params[5]];//仓位ID
|
//var HSCWHID = params[params[6]];//调出仓库ID
|
//var HSCSPID = params[params[7]];//调出仓位ID
|
//var HBatchNo = params[params[8]];//批次
|
//var HSourceInterID = params[params[2]];//源单主ID
|
//var HSourceEntryID = params[params[3]];//源单子ID
|
//var HBillType = params[params[6]];//单据类型
|
//var HQty = params[params[6]];//条码
|
var sBillType = params[params[2]];//单据类型
|
|
|
//var HBillType = ''
|
|
//var sBillType = '';//单据类型
|
|
var sWhere = " and HInterID=" + HInterID + " and HMaterID=" + HMaterID + "";
|
$.ajax({
|
url: GetWEBURL() + "/Kf_BarCodeEditDlg/Kf_BarCodeEditDlg_Json",
|
type: "GET",
|
data: { "sWhere": sWhere },
|
success: function (d) {
|
HMTONo = d.data[0].HMTONo
|
HSourceInterID = d.data[0].HSourceInterID
|
HSourceEntryID = d.data[0].HSourceEntryID
|
HBatchNo = d.data[0].HBatchNo
|
//HSourceInterID = 11
|
//HSourceEntryID = 11
|
HQty = d.data[0].HQty
|
HAuxPropID = d.data[0].HAuxPropID
|
//sBillType = d.data[0].HBillType
|
tableRender();
|
}
|
})
|
|
|
}
|
function tableRender() {
|
table.render({
|
elem: '#mx-table'
|
//, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
|
, url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
|
, where: {
|
"HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": 0, "HSPID": 0, "HSCWhID": 0
|
, "HSCSPID": 0, "HBatchNo": HBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "sBillType": sBillType, sWhere: ''
|
},
|
cols: [[
|
{ type: 'radio' }
|
, { field: 'HSonNo', title: '序号', width: 100 }
|
, { field: 'HBarCode', title: '条形码', width: 200 }
|
, { field: 'HQty', title: '数量', width: 100 }
|
, { field: 'HBatchNo', title: '批次', width: 150 }
|
, { field: 'HMTONo', title: '计划跟踪单号', width: 150 }
|
]]
|
// , data: [linterid]
|
});
|
}
|
|
|
|
form.on('submit(cmdCancel)', function () {
|
var index = parent.layer.getFrameIndex(window.name);
|
parent.layer.close(index);
|
})
|
//function Pub_Close(closeType) {
|
// if (closeType == 1) {
|
// //关闭弹窗
|
// var index = parent.layer.getFrameIndex(window.name);
|
// parent.layer.close(index);
|
// } else if (closeType == 2) {
|
// //关闭页签
|
// parent.layui.admin.events.closeThisTabs();
|
// }
|
//}
|
|
|
//#region 删除
|
form.on('submit(cmdDel)', function () {
|
var checkStatus = table.checkStatus('mx-table')
|
, data = checkStatus.data;
|
if (checkStatus.data.length === 1) {
|
var HBarCode = data[0].HBarCode.toString();
|
//逻辑删除方法
|
layer.confirm("确认要删除吗,删除后不能恢复", { title: "删除确认" }, function (index) {
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "Kf_BarCodeEditDlg/DeltetBill", //方法所在页面和方法名
|
data: { "HInterID": HInterID, "HBarCode": HBarCode, "HBillType": sBillType },
|
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('请选择一行数据删除!');
|
}
|
})
|
|
|
//调整
|
form.on('submit(cmdChange)', function () {//编辑
|
var checkStatus = table.checkStatus('mx-table')
|
, data = checkStatus.data;
|
var sQty = data[0].HQty.toString();
|
var iQty = $('#HQty').val();
|
var HBarCode = data[0].HBarCode.toString();
|
var sWhID = data[0].HWHID;
|
var sSPID = data[0].HStockPlaceID;
|
var sBatchNo = data[0].HBatchNo;
|
var HMTONo = data[0].HMTONo;
|
//if (iQty > sQty)
|
//{
|
var EndQty = iQty - sQty;
|
//}
|
|
$.ajax(
|
{
|
type: "Get",
|
//url: "http://61.130.49.162:9090/WMSAPI///ProductIn/Delete_Json", //方法所在页面和方法名
|
url: GetWEBURL() + "/Kf_BarCodeEditDlg/GetCheckQtyByBarCodeBill",
|
async: true,
|
data: {
|
"HInterID": HInterID, "HBillType": sBillType, "sBatchNo": sBatchNo, "sBarCode": HBarCode, "sSCWhID": 0
|
, "sSCSPID": 0, "sAuxPropID": HAuxPropID, "sMTONo": HMTONo, "iQty": iQty
|
, "HMaterID": HMaterID, "sWhID": sWhID, "sSPID": sSPID, "HSourceInterID": HSourceInterID
|
, "HSourceEntryID": HSourceEntryID, "EndQty": EndQty, "sQty": sQty
|
},
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) { // 说明验证成功了
|
table.render({
|
elem: '#mx-table'
|
//, url: 'http://localhost:8083/Web/GetHBarCodeShowBillSub'
|
, url: GetWEBURL() + "/Web/GetHBarCodeShowBillSub"
|
, where: {
|
"HInterID": HInterID, "HMaterID": HMaterID, "HAuxPropID": HAuxPropID, "HMTONo": HMTONo, "HWhID": sWhID, "HSPID": sSPID, "HSCWHID": 0
|
, "HSCSPID": 0, "HBatchNo": sBatchNo, "HSourceInterID": HSourceInterID, "HSourceEntryID": HSourceEntryID, "sBillType": sBillType, sWhere: ''
|
|
},
|
cols: [[
|
{ type: 'radio' }
|
, { field: 'HSonNo', title: '序号', width: 100 }
|
, { field: 'HBarCode', title: '条形码', width: 200 }
|
, { field: 'HQty', title: '数量', width: 100 }
|
, { field: 'HBatchNo', title: '批次', width: 150 }
|
, { field: 'HMTONo', title: '计划跟踪单号', width: 150 }
|
]]
|
// , data: [linterid]
|
});
|
alert("编辑成功!");
|
}
|
else {
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.msg('错误' + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
|
// layer.open({
|
// type: 2
|
// , area: ['100%', '100%']
|
// , title: '明细列表'
|
// , shade: 0.6 //遮罩透明度
|
// , maxmin: true //允许全屏最小化
|
// , anim: 0 //0-6的动画形式,-1不开启
|
// , content: ['../../../views/公共页面/Kf_BarCodeEditDlg.html?HInterID=' + HInterID + '&HMaterID = ' + HMaterID + '&HAuxPropID = ' + HAuxPropID + '& HMTONo = ' + HMTONo + '&HWhID = ' + HWhID + '&HSPID = ' + HSPID + '&HSCWHID = ' + HSCWHID + '&HSCSPID= ' + HSCSPID + '&HBatchNo= ' + HBatchNo + '&HSourceInterID= ' + HSourceInterID + '&HSourceEntryID= ' + HSourceEntryID + '&HBillType= ' + HBillType + '&HBarCode= ' + HBarCode + ''
|
// , 'yes']
|
// , resize: false
|
// , cancel: function () {
|
// //$(".layui-btn").removeClass("layui-btn-disabled");
|
// }
|
// })
|
//} else {
|
// layer.msg('请选择一行数据编辑!');
|
//}
|
})
|
function getUrlVars() {
|
var vars = [], hash;
|
//var hashes = decodeURIComponent(window.location.href.slice(window.location.href.indexOf('?') + 1).split('&'));
|
//var hashes1 = decodeURIComponent(window.location.href);
|
//var hashes = hashes1.indexOf('?') + 1.split('&');
|
|
var hashes = window.location.href.slice(decodeURIComponent(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;
|
}
|
})
|
|
|
</script>
|
</body>
|
</html>
|