<!DOCTYPE html>
|
<html>
|
<head>
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
|
<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">
|
<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>-->
|
<script src="../../CreateControl.js"></script>
|
</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;">
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">打印</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">新增</button>
|
<button class="layui-btn layui-btn-normal" style="margin-left: 0px" type="button" lay-submit="" lay-filter="btnSave" id="btnSave">退出</button>
|
</div>
|
<div class="layui-tab" lay-filter="tab-POStockInBill">
|
<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" style="width: 85px;">条形码:</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HBarCode" lay-verify="HBarCode" autocomplete="off" placeholder="请键入后回车" id="HBarCode" style="width: 500px;">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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" lay-verify="HBillNo" id="HBillNo" style="background-color:#efefef4d;" readonly>
|
<input type="hidden" name="HInterID" id="HInterID" lay-verify="HInterID">
|
</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" name="HEmpName" lay-verify="HEmpName" id="HEmpName" style="background-color: #efefef4d; width: 60%; display: inline-block;" readonly>
|
<input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
|
<button class="layui-btn layuiadmin-btn-order" type="button" lay-submit="" lay-filter="btnHEmp" id="btnHEmp" 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="HProcName" lay-verify="HProcName" id="HProcName" style="background-color: #efefef4d;" readonly>
|
<input type="hidden" name="HProcID" id="HProcID" lay-verify="HProcID" value="0">
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品MAC</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HProdMac" lay-verify="HProdMac" id="HProdMac">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<label class="layui-form-label" style="width: 85px;">产品SN</label>
|
<div class="layui-input-block" style="margin-left: 120px;">
|
<input type="text" class="layui-input" name="HMaterSN" lay-verify="HMaterSN" id="HMaterSN" style="background-color: #efefef4d; display: inline-block;" readonly>
|
</div>
|
</div>
|
</div>
|
<div class="layui-row">
|
<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="HRemark" id="HRemark" lay-verify="HRemark" placeholder="请输入内容" onmouseover="this.title=this.value" style=" width: 500px;">
|
</div>
|
</div>
|
<div class="layui-inline">
|
<div class="layui-input-block" style="margin-left: 120px; width: 501px;">
|
<input type="hidden" name="HSourceInterID" id="HSourceInterID" lay-verify="HSourceInterID" value="0">
|
<input type="hidden" name="HSourceEntryID" id="HSourceEntryID" lay-verify="HSourceEntryID" value="0">
|
<input type="hidden" name="HSourceBillNo" id="HSourceBillNo" lay-verify="HSourceBillNo" value="">
|
<input type="hidden" name="HSourceBillType" id="HSourceBillType" lay-verify="HSourceBillType" value="">
|
<input type="hidden" name="HRelationQty" id="HRelationQty" lay-verify="HRelationQty" value="0">
|
<input type="hidden" name="HRelationMoney" id="HRelationMoney" lay-verify="HRelationMoney" value="0">
|
|
<input type="hidden" name="HMaterID" id="HMaterID" lay-verify="HMaterID" value="0">
|
<input type="hidden" name="HMaterNumber" id="HMaterNumber" lay-verify="HMaterNumber" value="">
|
<input type="hidden" name="HMaterName" id="HMaterName" lay-verify="HMaterName" value="">
|
<input type="hidden" name="HUnitID" id="HUnitID" lay-verify="HUnitID" value="0">
|
<input type="hidden" name="HQty" id="HQty" lay-verify="HQty" value="0">
|
<input type="hidden" name="HSupID" id="HSupID" lay-verify="HSupID" value="0">
|
<input type="hidden" name="HBatchNo" id="HBatchNo" lay-verify="HBatchNo">
|
<input type="hidden" name="HProcExchBillNo" id="HProcExchBillNo" lay-verify="HProcExchBillNo">
|
<input type="hidden" name="HProcExchEntryID" id="HProcExchEntryID" lay-verify="HProcExchEntryID">
|
<input type="hidden" name="HProcExchInterID" id="HProcExchInterID" lay-verify="HProcExchInterID">
|
<input type="hidden" name="HProcess" id="HProcess" lay-verify="HProcess">
|
<input type="hidden" name="HICMOInterID" id="HICMOInterID" lay-verify="HICMOInterID">
|
<input type="hidden" name="HICMOBillNo" id="HICMOBillNo" lay-verify="HICMOBillNo">
|
<input type="hidden" name="HICMOEntryID" id="HICMOEntryID" lay-verify="HICMOEntryID">
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
</div>
|
<div class="layui-tab layui-tab-card">
|
<ul class="layui-tab-title">
|
<li class="layui-this">配件更换记录</li>
|
<li>关键件清单</li>
|
</ul>
|
<div class="layui-tab-content">
|
<div class="layui-tab-item layui-show">
|
<!--配件更换记录-->
|
<table class="layui-hide" id="mainTable1" lay-filter="mainTable1"></table>
|
</div>
|
<div class="layui-tab-item">
|
<!--关键件清单-->
|
<table class="layui-hide" id="mainTable2" lay-filter="mainTable2"></table>
|
</div>
|
</div>
|
</div>
|
|
<script type="text/html" id="toolbarDemo">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine"><i class="layui-icon layui-icon-form"></i>增加一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine"><i class="layui-icon layui-icon-form"></i>复制一行</button>
|
</div>
|
</script>
|
<script type="text/html" id="toolbarDemo2">
|
<div class="layui-btn-container">
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-AddLine2"><i class="layui-icon layui-icon-form"></i>增加一行</button>
|
<button type="button" class="layui-btn layui-btn-sm" lay-event="btn-CopyLine2"><i class="layui-icon layui-icon-form"></i>复制一行</button>
|
</div>
|
</script>
|
<input type="hidden" id="HProdOrgID" name="HProdOrgID" value="0" />
|
</form>
|
</div>
|
</div>
|
</div>
|
</body>
|
</html>
|
<script type="text/html" id="barDemo">
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
|
</script>
|
<script type="text/html" id="barDemo2">
|
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del2">删除</a>
|
</script>
|
<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 = "Cj_CollectionOfSingleProductDefects";
|
var option2 = [];
|
//#endregion
|
|
//#region 进入页面即加载
|
|
var params = getUrlVars();
|
var OperationType = params[params[0]]; //从参数中获取 数据类型 1添加 保存 2复制 3 编辑 4添加子工艺路线
|
var datajson = params[params[1]]; //从参数中获取 单据内码
|
|
//制单人
|
$("#HMaker").val(sessionStorage["HUserName"]);
|
$("#hmakedate").val(Format(new Date(), "yyyy-MM-dd"));
|
|
//判断是否新增
|
if (OperationType == 1) {
|
datajson = decodeURI(datajson);
|
datajson = $.parseJSON(datajson);
|
OperationType = 1;
|
$("#HMaterSN").val(datajson.HMaterSN);
|
$("#HInterID").val(datajson.HInterID);
|
$("#HBillNo").val(datajson.HBillNo);
|
$("#HBillNo_bak").val(datajson.HBillNo);
|
$("#HProcExchBillNo").val(datajson.HProcExchBillNo);
|
$("#HProcExchInterID").val(datajson.HProcExchInterID);
|
$("#HProcExchEntryID").val(datajson.HProcExchEntryID);
|
$("#HICMOInterID").val(datajson.HICMOInterID);
|
$("#HICMOBillNo").val(datajson.HICMOBillNo);
|
$("#HICMOEntryID").val(datajson.HICMOEntryID);
|
$("#HProcess").val(datajson.HProcess);
|
//初始化界面
|
set_ClearBill();
|
}
|
|
|
|
//#endregion
|
|
//#region 触发事件:包括form.on(){}格式的所有点击事件、选择事件等
|
|
//条形码回车方法
|
$('#HBarCode').on('keydown', function (event) {
|
var HBarCode = $('#HBarCode').val();
|
if (event.keyCode == 13) {
|
if (!HBarCode) {
|
layer.msg("条形码不能为空!")
|
return;
|
}
|
get_Accessory(HBarCode);
|
}
|
});
|
|
//配件更换记录子表行内事件
|
table.on('tool(mainTable1)', function (obj) {
|
set_GridDelete1(obj); //行内删除
|
});
|
|
//物料清单子表行内事件
|
table.on('tool(mainTable2)', function (obj) {
|
set_GridDelete2(obj); //行内删除
|
});
|
|
//选择质检员
|
form.on('submit(btnHEmp)', function () {
|
btnHEmp();
|
});
|
|
//新增
|
form.on('submit(set_AddNew)', function () {
|
layer.confirm('新增后页面数据将消失?', { icon: 3, title: '提示' }, function (index) {
|
location.replace('Cj_CollectionOfSingleProductDefects.html?OperationType=1&linterid=0');
|
});
|
});
|
|
|
//退出
|
form.on('submit(btnEdit)', function (data) {
|
if (params[1] != null) {
|
Pub_Close(1);
|
} else if (params[1] == null) {
|
Pub_Close(2);
|
}
|
});
|
|
|
//#endregion
|
|
//#region 此页面所有的方法
|
|
//初始化界面
|
function set_ClearBill() {
|
//光标跳转到配件文本框上
|
$("#HBarCode").focus();
|
//查询绑定用户
|
get_Display();
|
//查询条码绑定的返修记录
|
get_RepairRecord();
|
//查询物料清单数据
|
get_BomList();
|
}
|
|
//查询
|
function get_Display() {
|
var sWhere = " and 编码='" + sessionStorage["Czybm"] + "'";
|
var ajaxLoad = layer.load();
|
//进入页面显示的缓存列表
|
$.ajax({
|
url: GetWEBURL() + '/Cj_SingleStation/Cj_CollectionOfSingleProductDefectsUserList',
|
type: "GET",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
success: function (data1) {
|
if (data1.count == 1) {
|
|
$("#HEmpID").val(data1.data[0]["HEmpID"]);
|
$("#HEmpName").val(data1.data[0]["质检员"]);
|
layer.close(ajaxLoad);
|
|
//layer.alert("查询成功", { icon: 1 });
|
} else {
|
layer.close(ajaxLoad);
|
layer.alert(data1.code + data1.Message, { icon: 5 });
|
}
|
}, error: function () {
|
layer.close(ajaxLoad);
|
layer.alert("接口请求失败!", { icon: 5 });
|
}
|
|
});
|
}
|
|
//条码回车查询更换配件
|
var KNum = 0;
|
function get_Accessory(HBarCode) {
|
var index = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/HBardCodeAccessoryList",
|
async: false,
|
data: { "HBarCode": HBarCode, "user": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
|
for (var i = 0; i < option2.data.length; i++) {
|
if (data1.data[0]["HMaterNumber"] == option2.data[i]["配件代码"] && option2.data[i]["HBatchNo"] == data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") {
|
return layer.msg("当前批次已扫入,请不要重复扫入!");
|
}
|
if (data1.data[0]["HMaterNumber"] == option2.data[i]["配件代码"] && option2.data[i]["HBatchNo"] != data1.data[0]["HBatchNo"] && option2.data[i]["HBatchNo"] != "") {
|
layer.confirm('是否要把当前批次:' + option2.data[i]["HBatchNo"] + '替换成批次:' + data1.data[0]["HBatchNo"], function (index) {
|
layer.close(index);
|
$('#HProcName').val(HBarCode);
|
option2.data[i]["HBatchNo"] = data1.data[0]["HBatchNo"];
|
option2.data[i]["HBarCode"] = HBarCode;
|
table.render(option2);
|
//保存配件更改记录
|
set_AddNew();
|
});
|
break;
|
}
|
KNum += 1;
|
}
|
|
$('#HBarCode').val("");
|
|
|
}
|
else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//质检员选择页面
|
function btnHEmp() {
|
layer.open({
|
type: 2//弹窗类型
|
, skin: 'layui-layer-rim' //加上边框
|
, area: ['90%', '90%']//大小
|
, title: '维修员列表'//标题
|
, shift: 2//弹出动画
|
, content: ['../../基础资料/公用基础资料/Gy_EmployeeList.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('请选择数据');
|
}
|
//获取数据
|
$("#HEmpID").val(checkStatus.data[0].HItemID);
|
$("#HEmpName").val(checkStatus.data[0].职员名称);
|
|
layer.close(index); //它获取的始终是最新弹出的某个层,值是由layer内部动态递增计算的
|
}
|
})
|
}
|
|
//查询条码绑定的返修记录
|
function get_RepairRecord() {
|
var sWhere = " and HBarCodeSN='" + $("#HMaterSN").val() + "' and HBarCode is not null";
|
var index = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/Sc_SourceLineRepairBillSub_MaterList",
|
async: false,
|
data: { "sWhere": sWhere, "user": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
|
var option = {
|
elem: '#mainTable1'
|
//, toolbar: '#toolbarDemo'
|
, page: false
|
, totalRow: true
|
, data: data1.data
|
, cellMinWidth: 120
|
, height: 400
|
, cols: [[
|
{ type: 'checkbox', fixed: 'left' }
|
, { type: 'numbers', title: '序号' }
|
, { field: 'HInterID', title: 'HInterID', hide: true }
|
, { field: 'HEntryID', title: 'HEntryID', hide: true }
|
, { field: 'HBillNo_bak', title: 'HBillNo_bak', hide: true }
|
, { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
|
, { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
|
, { field: 'HICMOBillType', title: 'HICMOBillType', hide: true }
|
, { field: 'HICMOBillNo', title: '生产订单' }
|
, { field: 'HDate', title: '日期' }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true }
|
, { field: 'HMaterNumber', title: '配件物料编码' }
|
, { field: 'HMaterName', title: '配件物料名称' }
|
, { field: 'HUnitID', title: 'HUnitID', hide: true }
|
, { field: 'HQty', title: '配件数量', hide: true }
|
, { field: 'HSupID', title: 'HSupID', hide: true }
|
, { field: 'HBatchNo', title: '更换匹配批次', hide: true }
|
, { field: 'HBarCode', title: '配件SN码' }
|
, { field: 'HMaterSN', title: '产品SN码' }
|
, { field: 'HSourceInterID', title: '源单主内码', hide: true }
|
, { field: 'HSourceEntryID', title: '源单子内码', hide: true }
|
, { field: 'HSourceBillNo', title: '源单单号', hide: true }
|
, { field: 'HSourceBillType', title: '源单类型', hide: true }
|
, { fixed: 'right', title: '操作', toolbar: '#barDemo' }
|
]]
|
}
|
|
table.render(option);
|
|
}
|
else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//配件记录删除方法
|
function set_GridDelete1(obj) {
|
if (obj.event === 'del') {
|
layer.confirm('真的删除行吗?', function (index) {
|
var HInterID = obj.data.HInterID;
|
var HEntryID = obj.data.HEntryID;
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_SingleStation/ProcessItemRepairDel",
|
type: "GET",
|
async: false,
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"], "HBill": "PJ"},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg("删除成功!");
|
layer.close(ajaxLoad);
|
//查询条码绑定的返修记录
|
get_RepairRecord();
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
})
|
});
|
}
|
}
|
|
//物料清单删除方法
|
function set_GridDelete2(obj) {
|
if (obj.event === 'del2') {
|
layer.confirm('真的删除行吗?', function (index) {
|
var HInterID = obj.data.BomHInterID;
|
var HEntryID = obj.data.BomHEntryID;
|
|
var ajaxLoad = layer.load();
|
$.ajax({
|
url: GetWEBURL() + "/Cj_SingleStation/DelBomTempList",
|
type: "GET",
|
async: false,
|
data: { "HInterID": HInterID, "HEntryID": HEntryID, "user": sessionStorage["HUserName"]},
|
success: function (result) {
|
if (result.count == 1) {
|
layer.msg("删除成功!");
|
layer.close(ajaxLoad);
|
//查询清单
|
get_BomList($("#HProcExchBillNo").val());
|
} else {
|
layer.alert(result.code + result.Message, { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
}, error: function () {
|
layer.alert("接口请求失败!", { icon: 5 });
|
layer.close(ajaxLoad);
|
}
|
})
|
});
|
}
|
}
|
|
//流转卡查询关键件清单
|
function get_BomList() {
|
var index = layer.load();
|
$.ajax({
|
type: "GET",
|
url: GetWEBURL() + "/Cj_SingleStation/AssemHBardCodeBomList",
|
async: false,
|
data: { "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HMaterSN": $("#HMaterSN").val(), "user": sessionStorage["HUserName"] },
|
dataType: "json",
|
success: function (data1) {
|
if (data1.count == 1) {
|
layer.close(index);
|
|
$("#HMaterNumber").val(data1.data[0]["HMainMaterNumber"]);
|
$("#HMaterID").val(data1.data[0]["HMainMaterID"]);
|
$("#HMaterName").val(data1.data[0]["HMainMaterName"]);
|
//$("#HProcExchInterID").val(data1.data[0]["HProcExchInterID"]);
|
//$("#HProcExchEntryID").val(data1.data[0]["HProcExchEntryID"]);
|
//$("#HProcExchBillNo").val(data1.data[0]["HProcExchBillNo"]);
|
//$("#HICMOBillNo").val(data1.data[0]["HICMOBillNo"]);
|
//$("#HICMOInterID").val(data1.data[0]["HICMOInterID"]);
|
//$("#HICMOEntryID").val(data1.data[0]["HICMOEntryID"]);
|
//$("#HProcNo").val(data1.data[0]["HProcNo"]);
|
//$("#HPieceQty").val(data1.data[0]["HPieceQty"]);
|
//$("#HICMOQty").val(data1.data[0]["HICMOQty"]);
|
|
option2 = {
|
elem: '#mainTable2'
|
//, toolbar: '#toolbarDemo'
|
, async: true
|
, page: false
|
//, totalRow: true
|
, cellMinWidth: 120
|
, data: data1.data
|
, height: 185
|
, cols: [[
|
{ type: 'numbers', title: '序号' }
|
, { field: '日期', title: '日期' }
|
, { field: '配件代码', title: '配件代码' }
|
, { field: '配件名称', title: '配件名称' }
|
, { field: '配件规格', title: '配件规格' }
|
, { field: '配件数量', title: '配件数量' }
|
, { field: 'HBarCode', title: '当前配件码' }
|
, { field: 'HBatchNo', title: '当前批次' }
|
, { field: 'HICMOInterID', title: 'HICMOInterID', hide: true }
|
, { field: 'HICMOEntryID', title: 'HICMOEntryID', hide: true }
|
, { field: 'HICMOBillNo', title: 'HICMOBillNo', hide: true }
|
, { field: 'HProcExchInterID', title: 'HProcExchInterID', hide: true }
|
, { field: 'HProcExchEntryID', title: 'HProcExchEntryID', hide: true }
|
, { field: 'HProcExchBillNo', title: 'HProcExchBillNo', hide: true }
|
, { field: 'HMaterID', title: 'HMaterID', hide: true }
|
//, { field: 'HBarCode', title: 'HBarCode', hide: true }
|
, { fixed: 'right', title: '操作', toolbar: '#barDemo2' }
|
]]
|
}
|
table.render(option2)
|
}
|
else {
|
layer.close(index);
|
layer.msg(data1.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
$("#HBarCodeSN").val("");
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//获取参数
|
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;
|
}
|
|
//保存HMaker
|
function set_AddNew() {
|
var data1 = { "field": { "HInterID": $("#HInterID").val(), "HBillNo": $("#HBillNo").val(), "HProcExchBillNo": $("#HProcExchBillNo").val(), "HProcExchInterID": $("#HProcExchInterID").val(), "HProcExchEntryID": $("#HProcExchEntryID").val(), "HProcess": $("#HProcess").val(), "HICMOInterID": $("#HICMOInterID").val(), "HICMOEntryID": $("#HICMOEntryID").val(), "HICMOBillNo": $("#HICMOBillNo").val(), "HBarCode": $("#HMaterSN").val(), "HProdOrgID": sessionStorage["OrganizationID"] } };
|
|
var HResult = "配件";
|
var sMainStr = JSON.stringify(data1.field);
|
var sSubStr = JSON.stringify(table.cache["mainTable2"][KNum]);
|
var sMainSub = sMainStr + ';' + sSubStr + ";" + sessionStorage["HUserName"] + ";" + HResult;
|
|
var index = layer.load();
|
$.ajax({
|
type: "POST",
|
url: GetWEBURL() + "/Cj_SingleStation/HFXAddRepairBill",
|
async: false,
|
data: { "sMainSub": sMainSub },
|
dataType: "json",
|
success: function (data) {
|
if (data.count == 1) {
|
//$('#btnSave').addClass("layui-btn-disabled").attr("disabled", true);
|
layer.close(index);
|
layer.msg("提交成功");
|
//查询更换记录
|
get_RepairRecord();
|
}
|
else {
|
layer.close(index);
|
layer.msg(data.Message, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
},
|
error: function (err) {
|
layer.close(index);
|
layer.msg("错误:" + err, { icon: 5, btn: ['确认'], time: 100000, offset: 't', skin: 'layui-layer-lan', title: "温馨提示" });
|
}
|
});
|
}
|
|
//非空验证
|
function AllowLoadData(data) {
|
|
var HBarCode = $("#HBarCode").val();
|
if (HBarCode == "") {
|
layer.msg("产品SN不能为空!")
|
return false;
|
}
|
|
var HBadReasonID = $("#HBadReasonID").val();
|
if (HBadReasonID == 0) {
|
layer.msg("不良原因不能为空!")
|
return false;
|
}
|
return true;
|
}
|
|
//#endregion
|
|
});
|
</script>
|