提交 9cc540bd 编写于 作者: Skyeye云's avatar Skyeye云

ERP商品名称属性修改

上级 e6bf3556
...@@ -57,7 +57,7 @@ layui.config({ ...@@ -57,7 +57,7 @@ layui.config({
var params = { var params = {
bomTitle: $("#bomTitle").val(), bomTitle: $("#bomTitle").val(),
materialId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//商品id materialId: isNull(erpOrderUtil.chooseProductMation.materialId) ? '' : erpOrderUtil.chooseProductMation.materialId,//商品id
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
remark: $("#remark").val(), remark: $("#remark").val(),
sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()), sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()),
...@@ -316,8 +316,8 @@ layui.config({ ...@@ -316,8 +316,8 @@ layui.config({
// 商品选择 // 商品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#productName").val(chooseProductMation.productName); $("#productName").val(chooseProductMation.materialName);
$("#productModel").val(chooseProductMation.productModel); $("#productModel").val(chooseProductMation.materialModel);
$("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList}));
form.render("select"); form.render("select");
}); });
......
...@@ -20,18 +20,17 @@ layui.config({ ...@@ -20,18 +20,17 @@ layui.config({
var ztreeNode = new Array(); var ztreeNode = new Array();
//下拉框模板
var selTemplate = getFileContent('tpl/template/select-option-must.tpl'); var selTemplate = getFileContent('tpl/template/select-option-must.tpl');
AjaxPostUtil.request({url: flowableBasePath + "erpbom005", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) { AjaxPostUtil.request({url: flowableBasePath + "erpbom005", params: {rowId: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
$("#showForm").html(getDataUseHandlebars($("#mainHtml").html(), json)); $("#showForm").html(getDataUseHandlebars($("#mainHtml").html(), json));
textool.init({eleId: 'remark', maxlength: 200}); textool.init({eleId: 'remark', maxlength: 200});
//初始化父件商品信息 // 初始化父件商品信息
erpOrderUtil.chooseProductMation = { erpOrderUtil.chooseProductMation = {
productId: json.bean.productId, materialId: json.bean.productId,
productName: json.bean.productName, materialName: json.bean.productName,
productModel: json.bean.productModel, materialModel: json.bean.productModel,
unitList: json.bean.unitList unitList: json.bean.unitList
}; };
...@@ -79,7 +78,7 @@ layui.config({ ...@@ -79,7 +78,7 @@ layui.config({
var params = { var params = {
bomTitle: $("#bomTitle").val(), bomTitle: $("#bomTitle").val(),
materialId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//商品id materialId: isNull(erpOrderUtil.chooseProductMation.materialId) ? '' : erpOrderUtil.chooseProductMation.materialId,//商品id
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
remark: $("#remark").val(), remark: $("#remark").val(),
sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()), sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()),
...@@ -335,8 +334,8 @@ layui.config({ ...@@ -335,8 +334,8 @@ layui.config({
// 商品选择 // 商品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#productName").val(chooseProductMation.productName); $("#productName").val(chooseProductMation.materialName);
$("#productModel").val(chooseProductMation.productModel); $("#productModel").val(chooseProductMation.materialModel);
$("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList}));
form.render("select"); form.render("select");
}); });
......
...@@ -103,14 +103,14 @@ layui.config({ ...@@ -103,14 +103,14 @@ layui.config({
return false; return false;
} }
// 商品对象 // 商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#mUnitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#mUnitId" + rowNum).val(), mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -123,7 +123,7 @@ layui.config({ ...@@ -123,7 +123,7 @@ layui.config({
var params = { var params = {
orderId: isNull(productionMation.id) ? '' : productionMation.id, orderId: isNull(productionMation.id) ? '' : productionMation.id,
materialId: machinPro.productId, materialId: machinPro.materialId,
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
departmentId: $("#departmentId").val(), departmentId: $("#departmentId").val(),
number: $("#number").val(), number: $("#number").val(),
...@@ -166,8 +166,8 @@ layui.config({ ...@@ -166,8 +166,8 @@ layui.config({
procedureMationList = []; procedureMationList = [];
$("#procedureBody").html(""); $("#procedureBody").html("");
//重置成品信息 //重置成品信息
$("#productName").val(machinPro.productName); $("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.productModel); $("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#number").val(1); $("#number").val(1);
//重置单据信息 //重置单据信息
...@@ -249,7 +249,7 @@ layui.config({ ...@@ -249,7 +249,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
...@@ -267,15 +267,15 @@ layui.config({ ...@@ -267,15 +267,15 @@ layui.config({
area: ['90vw', '90vh'], area: ['90vw', '90vh'],
callBack: function (refreshCode) { callBack: function (refreshCode) {
$("#productionOrder").val(productionMation.defaultNumber); $("#productionOrder").val(productionMation.defaultNumber);
//加工产品信息 // 加工产品信息
machinPro = { machinPro = {
productId: productionMation.materialId, materialId: productionMation.materialId,
productName: productionMation.materialName, materialName: productionMation.materialName,
productModel: productionMation.materialModel, materialModel: productionMation.materialModel,
unitList: productionMation.unitList unitList: productionMation.unitList
}; };
$("#productName").val(machinPro.productName); $("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.productModel); $("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(productionMation.normsId); $("#unitList").val(productionMation.normsId);
$("#number").val(productionMation.number); $("#number").val(productionMation.number);
...@@ -309,7 +309,7 @@ layui.config({ ...@@ -309,7 +309,7 @@ layui.config({
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList})); $("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId); $("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显 //商品回显
$("#materialId" + (rowNum - 1)).val(item.product.productName + "(" + item.product.productModel + ")"); $("#materialId" + (rowNum - 1)).val(item.product.materialName + "(" + item.product.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显 $("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
//所需总数量 //所需总数量
$("#productionNum" + (rowNum - 1)).html(item.productionNum); $("#productionNum" + (rowNum - 1)).html(item.productionNum);
......
...@@ -59,13 +59,13 @@ layui.config({ ...@@ -59,13 +59,13 @@ layui.config({
} }
//加工产品信息 //加工产品信息
machinPro = { machinPro = {
productId: data.materialId, materialId: data.materialId,
productName: data.materialName, materialName: data.materialName,
productModel: data.materialModel, materialModel: data.materialModel,
unitList: data.unitList unitList: data.unitList
}; };
$("#productName").val(machinPro.productName); $("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.productModel); $("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(data.normsId); $("#unitList").val(data.normsId);
$("#number").val(data.needNum); $("#number").val(data.needNum);
...@@ -170,14 +170,14 @@ layui.config({ ...@@ -170,14 +170,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#mUnitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#mUnitId" + rowNum).val(), mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -190,7 +190,7 @@ layui.config({ ...@@ -190,7 +190,7 @@ layui.config({
var params = { var params = {
orderId: isNull(productionMation.id) ? '' : productionMation.id, orderId: isNull(productionMation.id) ? '' : productionMation.id,
materialId: machinPro.productId, materialId: machinPro.materialId,
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
departmentId: $("#departmentId").val(), departmentId: $("#departmentId").val(),
number: $("#number").val(), number: $("#number").val(),
...@@ -234,8 +234,8 @@ layui.config({ ...@@ -234,8 +234,8 @@ layui.config({
procedureMationList = []; procedureMationList = [];
$("#procedureBody").html(""); $("#procedureBody").html("");
//重置成品信息 //重置成品信息
$("#productName").val(machinPro.productName); $("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.productModel); $("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#number").val(1); $("#number").val(1);
//重置单据信息 //重置单据信息
...@@ -317,7 +317,7 @@ layui.config({ ...@@ -317,7 +317,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
...@@ -337,13 +337,13 @@ layui.config({ ...@@ -337,13 +337,13 @@ layui.config({
$("#productionOrder").val(productionMation.defaultNumber); $("#productionOrder").val(productionMation.defaultNumber);
//加工产品信息 //加工产品信息
machinPro = { machinPro = {
productId: productionMation.materialId, materialId: productionMation.materialId,
productName: productionMation.materialName, materialName: productionMation.materialName,
productModel: productionMation.materialModel, materialModel: productionMation.materialModel,
unitList: productionMation.unitList unitList: productionMation.unitList
}; };
$("#productName").val(machinPro.productName); $("#productName").val(machinPro.materialName);
$("#productModel").val(machinPro.productModel); $("#productModel").val(machinPro.materialModel);
$("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList}));
$("#unitList").val(productionMation.normsId); $("#unitList").val(productionMation.normsId);
$("#number").val(productionMation.number); $("#number").val(productionMation.number);
...@@ -377,7 +377,7 @@ layui.config({ ...@@ -377,7 +377,7 @@ layui.config({
$("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList})); $("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.product.unitList}));
$("#mUnitId" + (rowNum - 1)).val(item.normsId); $("#mUnitId" + (rowNum - 1)).val(item.normsId);
//商品回显 //商品回显
$("#materialId" + (rowNum - 1)).val(item.product.productName + "(" + item.product.productModel + ")"); $("#materialId" + (rowNum - 1)).val(item.product.materialName + "(" + item.product.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显 $("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
//所需总数量 //所需总数量
$("#productionNum" + (rowNum - 1)).html(item.productionNum); $("#productionNum" + (rowNum - 1)).html(item.productionNum);
......
...@@ -90,14 +90,14 @@ layui.config({ ...@@ -90,14 +90,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -180,7 +180,7 @@ layui.config({ ...@@ -180,7 +180,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -124,14 +124,14 @@ layui.config({ ...@@ -124,14 +124,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -215,7 +215,7 @@ layui.config({ ...@@ -215,7 +215,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -90,14 +90,14 @@ layui.config({ ...@@ -90,14 +90,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -182,7 +182,7 @@ layui.config({ ...@@ -182,7 +182,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -39,7 +39,7 @@ layui.config({ ...@@ -39,7 +39,7 @@ layui.config({
}); });
function loadData(){ function loadData(){
AjaxPostUtil.request({url:flowableBasePath + "erppick007", params: {id: parent.rowId}, type: 'json', method: 'GET', callback: function (json) { AjaxPostUtil.request({url: flowableBasePath + "erppick007", params: {id: parent.rowId}, type: 'json', method: 'GET', callback: function (json) {
var data = json.bean; var data = json.bean;
if (!isNull(data.machinId)){ if (!isNull(data.machinId)){
$("#machinOrder").val(data.machinNum); $("#machinOrder").val(data.machinNum);
...@@ -134,14 +134,14 @@ layui.config({ ...@@ -134,14 +134,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -227,7 +227,7 @@ layui.config({ ...@@ -227,7 +227,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -86,14 +86,14 @@ layui.config({ ...@@ -86,14 +86,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -174,7 +174,7 @@ layui.config({ ...@@ -174,7 +174,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -115,14 +115,14 @@ layui.config({ ...@@ -115,14 +115,14 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
unitPrice: $("#unitPrice" + rowNum).val() unitPrice: $("#unitPrice" + rowNum).val()
...@@ -204,7 +204,7 @@ layui.config({ ...@@ -204,7 +204,7 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -96,9 +96,9 @@ layui.config({ ...@@ -96,9 +96,9 @@ layui.config({
$.each(childProList, function(i, item) { $.each(childProList, function(i, item) {
//单位所需数量*生产数量-库存抵扣数量 //单位所需数量*生产数量-库存抵扣数量
var proposal = number * parseInt(item.needNum) - parseInt(item.currentTock); var proposal = number * parseInt(item.needNum) - parseInt(item.currentTock);
$("#proposal" + item.productId).val(proposal < 0 ? 0 : proposal); $("#proposal" + item.materialId).val(proposal < 0 ? 0 : proposal);
//需求数量=单位所需数量*生产数量 //需求数量=单位所需数量*生产数量
$("#needNum" + item.productId).html(number * parseInt(item.needNum)); $("#needNum" + item.materialId).html(number * parseInt(item.needNum));
}); });
} }
...@@ -116,7 +116,7 @@ layui.config({ ...@@ -116,7 +116,7 @@ layui.config({
} }
var params = { var params = {
orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId, orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId,
materialId: erpOrderUtil.chooseProductMation.productId, materialId: erpOrderUtil.chooseProductMation.materialId,
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
number: $("#number").val(), number: $("#number").val(),
planStartDate: $("#planStartDate").val(), planStartDate: $("#planStartDate").val(),
...@@ -132,9 +132,9 @@ layui.config({ ...@@ -132,9 +132,9 @@ layui.config({
var childList = []; var childList = [];
$.each(childProList, function(i, item) { $.each(childProList, function(i, item) {
childList.push({ childList.push({
materialId: item.productId, materialId: item.materialId,
normsId: item.normsId, normsId: item.normsId,
number: $("#proposal" + item.productId).val(), number: $("#proposal" + item.materialId).val(),
unitNumber: item.needNum, unitNumber: item.needNum,
unitPrice: item.unitPrice unitPrice: item.unitPrice
}); });
...@@ -190,8 +190,8 @@ layui.config({ ...@@ -190,8 +190,8 @@ layui.config({
// 商品选择 // 商品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#materialName").val(chooseProductMation.productName); $("#materialName").val(chooseProductMation.materialName);
$("#materialModel").val(chooseProductMation.productModel); $("#materialModel").val(chooseProductMation.materialModel);
$("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList}));
//重置单据信息 //重置单据信息
salesOrder = {}; salesOrder = {};
...@@ -211,12 +211,12 @@ layui.config({ ...@@ -211,12 +211,12 @@ layui.config({
area: ['90vw', '90vh'], area: ['90vw', '90vh'],
callBack: function (refreshCode) { callBack: function (refreshCode) {
erpOrderUtil.chooseProductMation = { erpOrderUtil.chooseProductMation = {
productName: salesOrder.materialName, materialName: salesOrder.materialName,
productModel: salesOrder.materialModel, materialModel: salesOrder.materialModel,
productId: salesOrder.materialId materialId: salesOrder.materialId
}; };
$("#materialName").val(erpOrderUtil.chooseProductMation.productName); $("#materialName").val(erpOrderUtil.chooseProductMation.materialName);
$("#materialModel").val(erpOrderUtil.chooseProductMation.productModel); $("#materialModel").val(erpOrderUtil.chooseProductMation.materialModel);
//加载数量 //加载数量
$("#number").val(salesOrder.operNum); $("#number").val(salesOrder.operNum);
//单号 //单号
......
...@@ -43,9 +43,9 @@ layui.config({ ...@@ -43,9 +43,9 @@ layui.config({
AjaxPostUtil.request({url: flowableBasePath + "erpproduction003", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) { AjaxPostUtil.request({url: flowableBasePath + "erpproduction003", params: {id: parent.rowId}, type: 'json', method: "GET", callback: function (json) {
// 商品信息 // 商品信息
erpOrderUtil.chooseProductMation = { erpOrderUtil.chooseProductMation = {
productId: json.bean.productId, materialId: json.bean.materialId,
productName: json.bean.materialName, materialName: json.bean.materialName,
productModel: json.bean.materialModel materialModel: json.bean.materialModel
}; };
$("#materialName").val(json.bean.materialName); $("#materialName").val(json.bean.materialName);
$("#materialModel").val(json.bean.materialModel); $("#materialModel").val(json.bean.materialModel);
...@@ -80,9 +80,9 @@ layui.config({ ...@@ -80,9 +80,9 @@ layui.config({
childProList = [].concat(json.bean.childList); childProList = [].concat(json.bean.childList);
$("#tBody").html(getDataUseHandlebars($("#tableBody").html(), {rows: childProList})); $("#tBody").html(getDataUseHandlebars($("#tableBody").html(), {rows: childProList}));
$.each(childProList, function(i, item) { $.each(childProList, function(i, item) {
$("#proposal" + item.productId).val(item.number); $("#proposal" + item.materialId).val(item.number);
//需求数量=生产数量*单位所需数量 //需求数量=生产数量*单位所需数量
$("#needNum" + item.productId).html(parseInt(json.bean.number) * parseInt(item.needNum)); $("#needNum" + item.materialId).html(parseInt(json.bean.number) * parseInt(item.needNum));
}); });
// 工艺路线赋值 // 工艺路线赋值
wayProcedureMation.id = json.bean.wayProcedureId; wayProcedureMation.id = json.bean.wayProcedureId;
...@@ -147,9 +147,9 @@ layui.config({ ...@@ -147,9 +147,9 @@ layui.config({
$.each(childProList, function(i, item) { $.each(childProList, function(i, item) {
//单位所需数量*生产数量-库存抵扣数量 //单位所需数量*生产数量-库存抵扣数量
var proposal = number * parseInt(item.needNum) - parseInt(item.currentTock); var proposal = number * parseInt(item.needNum) - parseInt(item.currentTock);
$("#proposal" + item.productId).val(proposal < 0 ? 0 : proposal); $("#proposal" + item.materialId).val(proposal < 0 ? 0 : proposal);
//需求数量=单位所需数量*生产数量 //需求数量=单位所需数量*生产数量
$("#needNum" + item.productId).html(number * parseInt(item.needNum)); $("#needNum" + item.materialId).html(number * parseInt(item.needNum));
}); });
} }
...@@ -165,7 +165,7 @@ layui.config({ ...@@ -165,7 +165,7 @@ layui.config({
} }
var params = { var params = {
orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId, orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId,
materialId: erpOrderUtil.chooseProductMation.productId, materialId: erpOrderUtil.chooseProductMation.materialId,
normsId: $("#unitList").val(), normsId: $("#unitList").val(),
number: $("#number").val(), number: $("#number").val(),
planStartDate: $("#planStartDate").val(), planStartDate: $("#planStartDate").val(),
...@@ -182,9 +182,9 @@ layui.config({ ...@@ -182,9 +182,9 @@ layui.config({
var childList = []; var childList = [];
$.each(childProList, function(i, item) { $.each(childProList, function(i, item) {
childList.push({ childList.push({
materialId: item.productId, materialId: item.materialId,
normsId: item.normsId, normsId: item.normsId,
number: $("#proposal" + item.productId).val(), number: $("#proposal" + item.materialId).val(),
unitNumber: item.needNum, unitNumber: item.needNum,
unitPrice: item.normsPurchasePrice unitPrice: item.normsPurchasePrice
}); });
...@@ -240,8 +240,8 @@ layui.config({ ...@@ -240,8 +240,8 @@ layui.config({
//商品选择 //商品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#materialName").val(chooseProductMation.productName); $("#materialName").val(chooseProductMation.materialName);
$("#materialModel").val(chooseProductMation.productModel); $("#materialModel").val(chooseProductMation.materialModel);
$("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList}));
//重置单据信息 //重置单据信息
salesOrder = {}; salesOrder = {};
...@@ -261,12 +261,12 @@ layui.config({ ...@@ -261,12 +261,12 @@ layui.config({
area: ['90vw', '90vh'], area: ['90vw', '90vh'],
callBack: function (refreshCode) { callBack: function (refreshCode) {
erpOrderUtil.chooseProductMation = { erpOrderUtil.chooseProductMation = {
productName: salesOrder.materialName, materialName: salesOrder.materialName,
productModel: salesOrder.materialModel, materialModel: salesOrder.materialModel,
productId: salesOrder.materialId materialId: salesOrder.materialId
}; };
$("#materialName").val(erpOrderUtil.chooseProductMation.productName); $("#materialName").val(erpOrderUtil.chooseProductMation.materialName);
$("#materialModel").val(erpOrderUtil.chooseProductMation.productModel); $("#materialModel").val(erpOrderUtil.chooseProductMation.materialModel);
//加载数量 //加载数量
$("#number").val(salesOrder.operNum); $("#number").val(salesOrder.operNum);
//单号 //单号
......
...@@ -141,9 +141,9 @@ ...@@ -141,9 +141,9 @@
<script type="text/html" id="tableBody"> <script type="text/html" id="tableBody">
{{#each rows}} {{#each rows}}
<tr rowid="{{productId}}"> <tr rowid="{{materialId}}">
<td id="name{{productId}}">{{materialName}}</td> <td id="name{{materialId}}">{{materialName}}</td>
<td id="model{{productId}}">{{materialModel}}</td> <td id="model{{materialId}}">{{materialModel}}</td>
<td>{{categoryName}}</td> <td>{{categoryName}}</td>
<td>{{typeName}}</td> <td>{{typeName}}</td>
<td> <td>
...@@ -152,11 +152,11 @@ ...@@ -152,11 +152,11 @@
{{/each}} {{/each}}
</td> </td>
<td style="text-align: center;">{{needNum}}{{unitName}}</td> <td style="text-align: center;">{{needNum}}{{unitName}}</td>
<td style="text-align: center;" id="needNum{{productId}}">{{needNum}}</td> <td style="text-align: center;" id="needNum{{materialId}}">{{needNum}}</td>
<td>{{currentTock}}</td> <td>{{currentTock}}</td>
<td>{{beWarehousedNum}}</td> <td>{{beWarehousedNum}}</td>
<td> <td>
<input type="text" id="proposal{{productId}}" name="proposal{{productId}}" win-verify="required|number" placeholder="请输入采购或生产数量" class="layui-input"/> <input type="text" id="proposal{{materialId}}" name="proposal{{materialId}}" win-verify="required|number" placeholder="请输入采购或生产数量" class="layui-input"/>
</td> </td>
</tr> </tr>
{{/each}} {{/each}}
......
...@@ -129,13 +129,13 @@ layui.config({ ...@@ -129,13 +129,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
item["anotherDepotId"] = $("#inDepotId").val(), item["anotherDepotId"] = $("#inDepotId").val(),
tableData.push(item); tableData.push(item);
......
...@@ -59,7 +59,7 @@ layui.config({ ...@@ -59,7 +59,7 @@ layui.config({
"materialType": { "materialType": {
"value": item.mType "value": item.mType
}, },
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -181,13 +181,13 @@ layui.config({ ...@@ -181,13 +181,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
item["anotherDepotId"] = $("#inDepotId").val(), item["anotherDepotId"] = $("#inDepotId").val(),
tableData.push(item); tableData.push(item);
......
...@@ -146,13 +146,13 @@ layui.config({ ...@@ -146,13 +146,13 @@ layui.config({
hasSplit = true; hasSplit = true;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -57,7 +57,7 @@ layui.config({ ...@@ -57,7 +57,7 @@ layui.config({
"materialType": { "materialType": {
"value": item.mType "value": item.mType
}, },
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -199,13 +199,13 @@ layui.config({ ...@@ -199,13 +199,13 @@ layui.config({
hasSplit = true; hasSplit = true;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -136,7 +136,7 @@ function initChooseProductBtnEnent (form, callback, calcPriceCallback) { ...@@ -136,7 +136,7 @@ function initChooseProductBtnEnent (form, callback, calcPriceCallback) {
// 获取表格行号 // 获取表格行号
var thisRowKey = trId.replace("tr", ""); var thisRowKey = trId.replace("tr", "");
// 表格商品名称赋值 // 表格商品名称赋值
$("#materialId" + thisRowKey.toString()).val(chooseProductMation.productName + "(" + chooseProductMation.productModel + ")"); $("#materialId" + thisRowKey.toString()).val(chooseProductMation.materialName + "(" + chooseProductMation.materialModel + ")");
// 表格单位赋值 // 表格单位赋值
$("#mUnitId" + thisRowKey.toString()).html(getDataUseHandlebars(selOptionHtml, {rows: chooseProductMation.unitList})); $("#mUnitId" + thisRowKey.toString()).html(getDataUseHandlebars(selOptionHtml, {rows: chooseProductMation.unitList}));
form.render('select'); form.render('select');
......
...@@ -86,17 +86,17 @@ layui.config({ ...@@ -86,17 +86,17 @@ layui.config({
//初始化值 //初始化值
var ids = []; var ids = [];
$.each(parent.erpOrderUtil.chooseProductMation, function(i, item) { $.each(parent.erpOrderUtil.chooseProductMation, function(i, item) {
ids.push(item.productId); ids.push(item.materialId);
}); });
tableCheckBoxUtil.setIds({ tableCheckBoxUtil.setIds({
gridId: 'messageTable', gridId: 'messageTable',
fieldName: 'productId', fieldName: 'materialId',
ids: ids ids: ids
}); });
tableCheckBoxUtil.init({ tableCheckBoxUtil.init({
gridId: 'messageTable', gridId: 'messageTable',
filterId: 'messageTable', filterId: 'messageTable',
fieldName: 'productId' fieldName: 'materialId'
}); });
} }
...@@ -113,10 +113,10 @@ layui.config({ ...@@ -113,10 +113,10 @@ layui.config({
cols: [[ cols: [[
{ type: checkType == '1' ? 'radio' : 'checkbox'}, { type: checkType == '1' ? 'radio' : 'checkbox'},
{ title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' }, { title: systemLanguage["com.skyeye.serialNumber"][languageType], type: 'numbers' },
{ field: 'productName', title: '商品名称', align: 'left', width: 150, templet: function (d) { { field: 'materialName', title: '商品名称', align: 'left', width: 150, templet: function (d) {
return '<a lay-event="details" class="notice-title-click">' + d.productName + '</a>'; return '<a lay-event="details" class="notice-title-click">' + d.materialName + '</a>';
}}, }},
{ field: 'productModel', title: '型号', align: 'left', width: 150 }, { field: 'materialModel', title: '型号', align: 'left', width: 150 },
{ field: 'categoryName', title: '所属类型', align: 'left', width: 100 }, { field: 'categoryName', title: '所属类型', align: 'left', width: 100 },
{ field: 'typeName', title: '商品来源', align: 'left', width: 100 }, { field: 'typeName', title: '商品来源', align: 'left', width: 100 },
{ field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 } { field: 'createTime', title: systemLanguage["com.skyeye.createTime"][languageType], align: 'center', width: 150 }
...@@ -145,7 +145,7 @@ layui.config({ ...@@ -145,7 +145,7 @@ layui.config({
// 多选,设置选中 // 多选,设置选中
tableCheckBoxUtil.checkedDefault({ tableCheckBoxUtil.checkedDefault({
gridId: 'messageTable', gridId: 'messageTable',
fieldName: 'productId' fieldName: 'materialId'
}); });
} }
...@@ -169,7 +169,7 @@ layui.config({ ...@@ -169,7 +169,7 @@ layui.config({
// 详情 // 详情
function details(data) { function details(data) {
rowId = data.productId; rowId = data.materialId;
_openNewWindows({ _openNewWindows({
url: "../../tpl/material/materialdetails.html", url: "../../tpl/material/materialdetails.html",
title: systemLanguage["com.skyeye.detailsPageTitle"][languageType], title: systemLanguage["com.skyeye.detailsPageTitle"][languageType],
......
...@@ -137,13 +137,13 @@ layui.config({ ...@@ -137,13 +137,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -78,7 +78,7 @@ layui.config({ ...@@ -78,7 +78,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -209,13 +209,13 @@ layui.config({ ...@@ -209,13 +209,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -130,13 +130,13 @@ layui.config({ ...@@ -130,13 +130,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -77,7 +77,7 @@ layui.config({ ...@@ -77,7 +77,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -201,13 +201,13 @@ layui.config({ ...@@ -201,13 +201,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -124,13 +124,13 @@ layui.config({ ...@@ -124,13 +124,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
tableData.push(item); tableData.push(item);
}); });
if (noError) { if (noError) {
...@@ -184,7 +184,7 @@ layui.config({ ...@@ -184,7 +184,7 @@ layui.config({
initTableChooseUtil.deleteAllRow('productList'); initTableChooseUtil.deleteAllRow('productList');
$.each(productionMation.norms, function(i, item) { $.each(productionMation.norms, function(i, item) {
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.normsId "value": item.normsId
......
...@@ -80,7 +80,7 @@ layui.config({ ...@@ -80,7 +80,7 @@ layui.config({
initTableChooseUtil.deleteAllRow('productList'); initTableChooseUtil.deleteAllRow('productList');
$.each(json.bean.norms, function(i, item) { $.each(json.bean.norms, function(i, item) {
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -197,13 +197,13 @@ layui.config({ ...@@ -197,13 +197,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
tableData.push(item); tableData.push(item);
}); });
if (noError) { if (noError) {
...@@ -258,7 +258,7 @@ layui.config({ ...@@ -258,7 +258,7 @@ layui.config({
initTableChooseUtil.deleteAllRow('productList'); initTableChooseUtil.deleteAllRow('productList');
$.each(productionMation.norms, function(i, item) { $.each(productionMation.norms, function(i, item) {
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.normsId "value": item.normsId
......
...@@ -93,7 +93,7 @@ layui.config({ ...@@ -93,7 +93,7 @@ layui.config({
initTableChooseUtil.deleteAllRow('productList'); initTableChooseUtil.deleteAllRow('productList');
$.each(json.bean.items, function(i, item) { $.each(json.bean.items, function(i, item) {
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -239,13 +239,13 @@ layui.config({ ...@@ -239,13 +239,13 @@ layui.config({
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -151,13 +151,13 @@ layui.config({ ...@@ -151,13 +151,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -82,7 +82,7 @@ layui.config({ ...@@ -82,7 +82,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -234,13 +234,13 @@ layui.config({ ...@@ -234,13 +234,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -155,13 +155,13 @@ layui.config({ ...@@ -155,13 +155,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -87,7 +87,7 @@ layui.config({ ...@@ -87,7 +87,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -239,13 +239,13 @@ layui.config({ ...@@ -239,13 +239,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -179,13 +179,13 @@ layui.config({ ...@@ -179,13 +179,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -79,7 +79,7 @@ layui.config({ ...@@ -79,7 +79,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -254,13 +254,13 @@ layui.config({ ...@@ -254,13 +254,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -179,13 +179,13 @@ layui.config({ ...@@ -179,13 +179,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -79,7 +79,7 @@ layui.config({ ...@@ -79,7 +79,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -254,13 +254,13 @@ layui.config({ ...@@ -254,13 +254,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -148,13 +148,13 @@ layui.config({ ...@@ -148,13 +148,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
tableData.push(item); tableData.push(item);
}); });
if (noError) { if (noError) {
......
...@@ -85,7 +85,7 @@ layui.config({ ...@@ -85,7 +85,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -246,13 +246,13 @@ layui.config({ ...@@ -246,13 +246,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
tableData.push(item); tableData.push(item);
}); });
if (noError) { if (noError) {
......
...@@ -259,13 +259,13 @@ layui.config({ ...@@ -259,13 +259,13 @@ layui.config({
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -159,13 +159,13 @@ layui.config({ ...@@ -159,13 +159,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -89,7 +89,7 @@ layui.config({ ...@@ -89,7 +89,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -255,13 +255,13 @@ layui.config({ ...@@ -255,13 +255,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -161,13 +161,13 @@ layui.config({ ...@@ -161,13 +161,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -89,7 +89,7 @@ layui.config({ ...@@ -89,7 +89,7 @@ layui.config({
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
} }
var params = { var params = {
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -256,13 +256,13 @@ layui.config({ ...@@ -256,13 +256,13 @@ layui.config({
return false; return false;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -146,13 +146,13 @@ layui.config({ ...@@ -146,13 +146,13 @@ layui.config({
hasSplit = true; hasSplit = true;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -58,7 +58,7 @@ layui.config({ ...@@ -58,7 +58,7 @@ layui.config({
"materialType": { "materialType": {
"value": item.mType "value": item.mType
}, },
"materialId": item.product.productName + "(" + item.product.productModel + ")", "materialId": item.product.materialName + "(" + item.product.materialModel + ")",
"mUnitId": { "mUnitId": {
"html": getDataUseHandlebars(selOption, {rows: item.product.unitList}), "html": getDataUseHandlebars(selOption, {rows: item.product.unitList}),
"value": item.mUnitId "value": item.mUnitId
...@@ -200,13 +200,13 @@ layui.config({ ...@@ -200,13 +200,13 @@ layui.config({
hasSplit = true; hasSplit = true;
} }
//商品对象 //商品对象
var product = allChooseProduct["tr" + thisRowKey]; var material = allChooseProduct["tr" + thisRowKey];
if (inTableDataArrayByAssetarId(product.productId, item.mUnitId, tableData)) { if (inTableDataArrayByAssetarId(material.materialId, item.mUnitId, tableData)) {
winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的商品信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
item["materialId"] = product.productId; item["materialId"] = material.materialId;
item["depotId"] = $("#depotId").val(); item["depotId"] = $("#depotId").val();
tableData.push(item); tableData.push(item);
}); });
......
...@@ -45,11 +45,11 @@ layui.config({ ...@@ -45,11 +45,11 @@ layui.config({
// 备件规格加载变化事件 // 备件规格加载变化事件
form.on('select(selectUnitProperty)', function(data) { form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value; var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");// 获取当前行 var thisRowNum = data.elem.id.replace("mUnitId", "");
// 当前当前行选中的商品信息 // 当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') { if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()]; var material = allChooseProduct["tr" + thisRowNum.toString()];
$.each(product.unitList, function(j, bean) { $.each(material.unitList, function(j, bean) {
if(thisRowValue == bean.id){// 获取规格 if(thisRowValue == bean.id){// 获取规格
// 获取当前行数量 // 获取当前行数量
var rkNum = parseInt($("#rkNum" + thisRowNum).val()); var rkNum = parseInt($("#rkNum" + thisRowNum).val());
...@@ -132,16 +132,16 @@ layui.config({ ...@@ -132,16 +132,16 @@ layui.config({
return false; return false;
} }
// 商品对象 // 商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
depotId: $("#depotId").val(), depotId: $("#depotId").val(),
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val() remark: $("#remark" + rowNum).val()
}; };
...@@ -168,10 +168,10 @@ layui.config({ ...@@ -168,10 +168,10 @@ layui.config({
}); });
// 判断选中的备件是否也在数组中 // 判断选中的备件是否也在数组中
function inTableDataArrayByAssetarId(materialId, unitId, array) { function inTableDataArrayByAssetarId(materialId, mUnitId, array) {
var isIn = false; var isIn = false;
$.each(array, function(i, item) { $.each(array, function(i, item) {
if(item.mUnitId === unitId && item.materialId === materialId) { if(item.mUnitId === mUnitId && item.materialId === materialId) {
isIn = true; isIn = true;
return false; return false;
} }
...@@ -209,7 +209,7 @@ layui.config({ ...@@ -209,7 +209,7 @@ layui.config({
id: "row" + rowNum.toString(), // checkbox的id id: "row" + rowNum.toString(), // checkbox的id
trId: "tr" + rowNum.toString(), // 行的id trId: "tr" + rowNum.toString(), // 行的id
materialId: "materialId" + rowNum.toString(), // 商品id materialId: "materialId" + rowNum.toString(), // 商品id
unitId: "unitId" + rowNum.toString(), // 规格id mUnitId: "mUnitId" + rowNum.toString(), // 规格id
currentTock: "currentTock" + rowNum.toString(), // 库存id currentTock: "currentTock" + rowNum.toString(), // 库存id
rkNum: "rkNum" + rowNum.toString(), // 数量id rkNum: "rkNum" + rowNum.toString(), // 数量id
unitPrice: "unitPrice" + rowNum.toString(), // 单价id unitPrice: "unitPrice" + rowNum.toString(), // 单价id
...@@ -258,9 +258,9 @@ layui.config({ ...@@ -258,9 +258,9 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
//计算价格 //计算价格
calculatedTotalPrice(); calculatedTotalPrice();
......
...@@ -33,7 +33,8 @@ layui.config({ ...@@ -33,7 +33,8 @@ layui.config({
showGrid({ showGrid({
id: "showForm", id: "showForm",
url: flowableBasePath + "sealseservice026", url: flowableBasePath + "sealseservice026",
params: {rowId: parent.rowId}, params: {id: parent.rowId},
method: 'GET',
pagination: false, pagination: false,
template: beanTemplate, template: beanTemplate,
ajaxSendAfter:function (json) { ajaxSendAfter:function (json) {
...@@ -73,8 +74,8 @@ layui.config({ ...@@ -73,8 +74,8 @@ layui.config({
$("#serviceId").val(orderObject.bean.orderNum);//工单单号 $("#serviceId").val(orderObject.bean.orderNum);//工单单号
$("#remark").val(orderObject.bean.remark);//备注 $("#remark").val(orderObject.bean.remark);//备注
$("#allPrice").html(orderObject.bean.allPrice.toFixed(2));//总金额 $("#allPrice").html(orderObject.bean.allPrice.toFixed(2));//总金额
//渲染列表项 // 渲染列表项
$.each(orderObject.bean.materials, function(i, item) { $.each(orderObject.bean.materialList, function(i, item) {
addRow(); addRow();
if(i == 0){ if(i == 0){
$("#depotId").val(item.depotId); $("#depotId").val(item.depotId);
...@@ -82,10 +83,10 @@ layui.config({ ...@@ -82,10 +83,10 @@ layui.config({
//将规格所属的商品信息加入到对象中存储 //将规格所属的商品信息加入到对象中存储
allChooseProduct["tr" + (rowNum - 1)] = item; allChooseProduct["tr" + (rowNum - 1)] = item;
// 单位回显 // 单位回显
$("#unitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList})); $("#mUnitId" + (rowNum - 1)).html(getDataUseHandlebars(selOption, {rows: item.unitList}));
$("#unitId" + (rowNum - 1)).val(item.normsId); $("#mUnitId" + (rowNum - 1)).val(item.normsId);
// 商品回显 // 商品回显
$("#materialId" + (rowNum - 1)).val(item.productName + "(" + item.productModel + ")"); $("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显 $("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
$("#rkNum" + (rowNum - 1)).val(item.operNum);//数量回显 $("#rkNum" + (rowNum - 1)).val(item.operNum);//数量回显
$("#unitPrice" + (rowNum - 1)).html(item.unitPrice.toFixed(2));//单价回显 $("#unitPrice" + (rowNum - 1)).html(item.unitPrice.toFixed(2));//单价回显
...@@ -95,7 +96,7 @@ layui.config({ ...@@ -95,7 +96,7 @@ layui.config({
$("tr[trcusid='tr" + (rowNum - 1) + "']").attr("thisid", item.id); $("tr[trcusid='tr" + (rowNum - 1) + "']").attr("thisid", item.id);
}); });
// 附件回显 // 附件回显
skyeyeEnclosure.initTypeISData({'enclosureUpload': json.bean.enclosureInfo}); skyeyeEnclosure.initTypeISData({'enclosureUpload': orderObject.bean.enclosureInfo});
//渲染 //渲染
form.render(); form.render();
} }
...@@ -103,11 +104,11 @@ layui.config({ ...@@ -103,11 +104,11 @@ layui.config({
// 备件规格加载变化事件 // 备件规格加载变化事件
form.on('select(selectUnitProperty)', function(data) { form.on('select(selectUnitProperty)', function(data) {
var thisRowValue = data.value; var thisRowValue = data.value;
var thisRowNum = data.elem.id.replace("unitId", "");// 获取当前行 var thisRowNum = data.elem.id.replace("mUnitId", "");
// 当前当前行选中的商品信息 // 当前当前行选中的商品信息
if (!isNull(thisRowValue) && thisRowValue != '请选择') { if (!isNull(thisRowValue) && thisRowValue != '请选择') {
var product = allChooseProduct["tr" + thisRowNum.toString()]; var material = allChooseProduct["tr" + thisRowNum.toString()];
$.each(product.unitList, function(j, bean) { $.each(material.unitList, function(j, bean) {
if(thisRowValue == bean.id){// 获取规格 if(thisRowValue == bean.id){// 获取规格
// 获取当前行数量 // 获取当前行数量
var rkNum = parseInt($("#rkNum" + thisRowNum).val()); var rkNum = parseInt($("#rkNum" + thisRowNum).val());
...@@ -189,16 +190,16 @@ layui.config({ ...@@ -189,16 +190,16 @@ layui.config({
return false; return false;
} }
// 商品对象 // 商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#mUnitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
depotId: $("#depotId").val(), depotId: $("#depotId").val(),
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#mUnitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val() remark: $("#remark" + rowNum).val()
}; };
...@@ -226,10 +227,10 @@ layui.config({ ...@@ -226,10 +227,10 @@ layui.config({
}); });
// 判断选中的备件是否也在数组中 // 判断选中的备件是否也在数组中
function inTableDataArrayByAssetarId(materialId, unitId, array) { function inTableDataArrayByAssetarId(materialId, mUnitId, array) {
var isIn = false; var isIn = false;
$.each(array, function(i, item) { $.each(array, function(i, item) {
if(item.mUnitId === unitId && item.materialId === materialId) { if(item.mUnitId === mUnitId && item.materialId === materialId) {
isIn = true; isIn = true;
return false; return false;
} }
...@@ -267,7 +268,7 @@ layui.config({ ...@@ -267,7 +268,7 @@ layui.config({
id: "row" + rowNum.toString(), // checkbox的id id: "row" + rowNum.toString(), // checkbox的id
trId: "tr" + rowNum.toString(), // 行的id trId: "tr" + rowNum.toString(), // 行的id
materialId: "materialId" + rowNum.toString(), //商品id materialId: "materialId" + rowNum.toString(), //商品id
unitId: "unitId" + rowNum.toString(), // 规格id mUnitId: "mUnitId" + rowNum.toString(), // 规格id
currentTock: "currentTock" + rowNum.toString(), // 库存id currentTock: "currentTock" + rowNum.toString(), // 库存id
rkNum: "rkNum" + rowNum.toString(), // 数量id rkNum: "rkNum" + rowNum.toString(), // 数量id
unitPrice: "unitPrice" + rowNum.toString(), // 单价id unitPrice: "unitPrice" + rowNum.toString(), // 单价id
...@@ -316,9 +317,9 @@ layui.config({ ...@@ -316,9 +317,9 @@ layui.config({
//商品赋值 //商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
//表格商品名称赋值 //表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
//表格单位赋值 //表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#mUnitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
//计算价格 //计算价格
calculatedTotalPrice(); calculatedTotalPrice();
......
...@@ -81,7 +81,7 @@ layui.config({ ...@@ -81,7 +81,7 @@ layui.config({
areaId: areaId,//区县,可为空 areaId: areaId,//区县,可为空
townshipId: townshipId,//乡镇,可为空 townshipId: townshipId,//乡镇,可为空
addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空 addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空
productId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//产品id,可为空 productId: isNull(erpOrderUtil.chooseProductMation.materialId) ? '' : erpOrderUtil.chooseProductMation.materialId,//产品id,可为空
productName: $("#productName").val(),//产品名称,可为空 productName: $("#productName").val(),//产品名称,可为空
productNorms: $("#productNorms").val(),//规格型号,可为空 productNorms: $("#productNorms").val(),//规格型号,可为空
productSerialNum: $("#productSerialNum").val(),//序列号,可为空 productSerialNum: $("#productSerialNum").val(),//序列号,可为空
...@@ -214,8 +214,8 @@ layui.config({ ...@@ -214,8 +214,8 @@ layui.config({
//产品选择 //产品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#productName").val(chooseProductMation.productName); $("#productName").val(chooseProductMation.materialName);
$("#productNorms").val(chooseProductMation.productModel); $("#productNorms").val(chooseProductMation.materialModel);
}); });
}); });
......
...@@ -30,7 +30,7 @@ layui.config({ ...@@ -30,7 +30,7 @@ layui.config({
ajaxSendLoadBefore: function(hdb) { ajaxSendLoadBefore: function(hdb) {
}, },
ajaxSendAfter: function (json) { ajaxSendAfter: function (json) {
erpOrderUtil.chooseProductMation.productId = json.bean.productId; erpOrderUtil.chooseProductMation.materialId = json.bean.materialId;
textool.init({eleId: 'content', maxlength: 200}); textool.init({eleId: 'content', maxlength: 200});
// 报单时间 // 报单时间
...@@ -125,7 +125,7 @@ layui.config({ ...@@ -125,7 +125,7 @@ layui.config({
areaId: areaId,//区县,可为空 areaId: areaId,//区县,可为空
townshipId: townshipId,//乡镇,可为空 townshipId: townshipId,//乡镇,可为空
addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空 addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空
productId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//产品id,可为空 productId: isNull(erpOrderUtil.chooseProductMation.materialId) ? '' : erpOrderUtil.chooseProductMation.materialId,//产品id,可为空
productName: $("#productName").val(),//产品名称,可为空 productName: $("#productName").val(),//产品名称,可为空
productNorms: $("#productNorms").val(),//规格型号,可为空 productNorms: $("#productNorms").val(),//规格型号,可为空
productSerialNum: $("#productSerialNum").val(),//序列号,可为空 productSerialNum: $("#productSerialNum").val(),//序列号,可为空
...@@ -318,8 +318,8 @@ layui.config({ ...@@ -318,8 +318,8 @@ layui.config({
//产品选择 //产品选择
$("body").on("click", "#productNameSel", function (e) { $("body").on("click", "#productNameSel", function (e) {
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
$("#productName").val(chooseProductMation.productName); $("#productName").val(chooseProductMation.materialName);
$("#productNorms").val(chooseProductMation.productModel); $("#productNorms").val(chooseProductMation.materialModel);
}); });
}); });
......
...@@ -43,10 +43,10 @@ layui.config({ ...@@ -43,10 +43,10 @@ layui.config({
// 故障关键组件 // 故障关键组件
if (!isNull(json.bean.faultKeyPartsId)){ if (!isNull(json.bean.faultKeyPartsId)){
faultKeyParts = { faultKeyParts = {
productId: json.bean.faultKeyPartsId, materialId: json.bean.faultKeyPartsId,
productName: json.bean.faultKeyPartsName materialName: json.bean.faultKeyPartsName
}; };
$("#faultKeyPartsId").val(faultKeyParts.productName); $("#faultKeyPartsId").val(faultKeyParts.materialName);
} }
// 加载配件使用明细 // 加载配件使用明细
...@@ -128,14 +128,14 @@ layui.config({ ...@@ -128,14 +128,14 @@ layui.config({
return false; return false;
} }
// 商品对象 // 商品对象
var product = allChooseProduct["tr" + rowNum.toString()]; var material = allChooseProduct["tr" + rowNum.toString()];
if(inTableDataArrayByAssetarId(product.productId, $("#unitId" + rowNum).val(), tableData)) { if(inTableDataArrayByAssetarId(material.materialId, $("#unitId" + rowNum).val(), tableData)) {
winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000}); winui.window.msg('一张单中不允许出现相同单位的配件信息.', {icon: 2, time: 2000});
noError = true; noError = true;
return false; return false;
} }
var row = { var row = {
materialId: product.productId, materialId: material.materialId,
mUnitId: $("#unitId" + rowNum).val(), mUnitId: $("#unitId" + rowNum).val(),
rkNum: rkNum.val(), rkNum: rkNum.val(),
remark: $("#remark" + rowNum).val() remark: $("#remark" + rowNum).val()
...@@ -158,7 +158,7 @@ layui.config({ ...@@ -158,7 +158,7 @@ layui.config({
coverCost: $("#coverCost").val(), coverCost: $("#coverCost").val(),
otherCost: $("#otherCost").val(), otherCost: $("#otherCost").val(),
comStarTime: $("#comStarTime").val(), comStarTime: $("#comStarTime").val(),
faultKeyPartsId: isNull(faultKeyParts.productId) ? "" : faultKeyParts.productId, faultKeyPartsId: isNull(faultKeyParts.materialId) ? "" : faultKeyParts.materialId,
actualFailure: $("#actualFailure").val(), actualFailure: $("#actualFailure").val(),
solution: $("#solution").val(), solution: $("#solution").val(),
useStr: JSON.stringify(tableData), useStr: JSON.stringify(tableData),
...@@ -194,7 +194,7 @@ layui.config({ ...@@ -194,7 +194,7 @@ layui.config({
$("#unitId" + (rowNum - 1)).val(item.normsId); $("#unitId" + (rowNum - 1)).val(item.normsId);
// 商品回显 // 商品回显
$("#materialId" + (rowNum - 1)).val(item.productName + "(" + item.productModel + ")"); $("#materialId" + (rowNum - 1)).val(item.materialName + "(" + item.materialModel + ")");
$("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显 $("#currentTock" + (rowNum - 1)).html(item.currentTock);//库存回显
$("#rkNum" + (rowNum - 1)).val(item.operNumber);//数量回显 $("#rkNum" + (rowNum - 1)).val(item.operNumber);//数量回显
$("#unitPrice" + (rowNum - 1)).html(item.unitPrice.toFixed(2));//单价回显 $("#unitPrice" + (rowNum - 1)).html(item.unitPrice.toFixed(2));//单价回显
...@@ -307,7 +307,7 @@ layui.config({ ...@@ -307,7 +307,7 @@ layui.config({
erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) {
faultKeyParts = chooseProductMation; faultKeyParts = chooseProductMation;
// 重置故障组件信息 // 重置故障组件信息
$("#faultKeyPartsId").val(faultKeyParts.productName); $("#faultKeyPartsId").val(faultKeyParts.materialName);
form.render(); form.render();
}); });
...@@ -322,7 +322,7 @@ layui.config({ ...@@ -322,7 +322,7 @@ layui.config({
// 商品赋值 // 商品赋值
allChooseProduct[trId] = chooseProductMation; allChooseProduct[trId] = chooseProductMation;
// 表格商品名称赋值 // 表格商品名称赋值
$("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].materialName + "(" + allChooseProduct[trId].materialModel + ")");
// 表格单位赋值 // 表格单位赋值
$("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList}));
form.render('select'); form.render('select');
......
...@@ -97,7 +97,7 @@ ...@@ -97,7 +97,7 @@
<input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/> <input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i> <i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i>
</td> </td>
<td><select id="{{unitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td> <td><select id="{{mUnitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{currentTock}}"></td> <td id="{{currentTock}}"></td>
<td><input type="text" class="layui-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td> <td><input type="text" class="layui-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td>
<td id="{{unitPrice}}"></td> <td id="{{unitPrice}}"></td>
......
...@@ -21,7 +21,7 @@ ...@@ -21,7 +21,7 @@
<input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/> <input type="text" id="{{materialId}}" name="{{materialId}}" placeholder="请选择商品" class="layui-input" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i> <i class="fa fa-plus-circle input-icon chooseProductBtn" style="top: 12px;"></i>
</td> </td>
<td><select id="{{unitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td> <td><select id="{{mUnitId}}" lay-filter="selectUnitProperty" lay-search win-verify="required"></select></td>
<td id="{{currentTock}}"></td> <td id="{{currentTock}}"></td>
<td><input type="text" class="layui-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td> <td><input type="text" class="layui-input rkNum" value="1" id="{{rkNum}}" win-verify="required|number"/></td>
<td id="{{unitPrice}}"></td> <td id="{{unitPrice}}"></td>
......
...@@ -65,14 +65,14 @@ ...@@ -65,14 +65,14 @@
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">产品名称</label> <label class="layui-form-label">产品名称</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="productName" name="productName" placeholder="请输入产品名称" class="layui-input" maxlength="50" value="{{productName}}" readonly="readonly"/> <input type="text" id="productName" name="productName" placeholder="请输入产品名称" class="layui-input" maxlength="50" value="{{materialName}}" readonly="readonly"/>
<i class="fa fa-plus-circle input-icon" id="productNameSel"></i> <i class="fa fa-plus-circle input-icon" id="productNameSel"></i>
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
<label class="layui-form-label">规格型号</label> <label class="layui-form-label">规格型号</label>
<div class="layui-input-block"> <div class="layui-input-block">
<input type="text" id="productNorms" name="productNorms" placeholder="请输入规格型号" class="layui-input" maxlength="50" value="{{productNorms}}"/> <input type="text" id="productNorms" name="productNorms" placeholder="请输入规格型号" class="layui-input" maxlength="50" value="{{materialModel}}"/>
</div> </div>
</div> </div>
<div class="layui-form-item layui-col-xs6"> <div class="layui-form-item layui-col-xs6">
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册