diff --git a/erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js b/erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js index a202d0489a84c2f4b207c436ae545dd79960a494..12974d83ab58c4ac1e124c73d3562eaa8f4a84b1 100644 --- a/erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js +++ b/erp-produce/src/main/resources/template/js/erpBom/erpBomAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //bom表商品选择必备参数 var productMationList = [];//选择的商品列表 @@ -33,7 +30,6 @@ layui.config({ matchingLanguage(); form.render(); form.on('submit(formAddBean)', function (data) { - if (winui.verifyForm(data.elem)) { if(ztreeNode.length == 0){ winui.window.msg('请选择子件清单。', {icon: 2,time: 2000}); @@ -47,7 +43,7 @@ layui.config({ item.wastagePrice = $("#wastage" + item.productId).val(); item.remark = $("#remark" + item.productId).val(); childObject.push(item); - if(item.productId == productMation.productId){ + if(item.productId == erpOrderUtil.chooseProductMation.productId){ winui.window.msg('子件清单中不能包含父件信息。', {icon: 2,time: 2000}); wheatherError = true; return false; @@ -65,10 +61,10 @@ layui.config({ var params = { bomTitle: $("#bomTitle").val(), - materialId: isNull(productMation.productId) ? '' : productMation.productId,//商品id + materialId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//商品id normsId: $("#unitList").val(), remark: $("#remark").val(), - sealPrice: getSealPrice(productMation.unitList, $("#unitList").val()), + sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()), childStr: JSON.stringify(childObject) }; @@ -333,23 +329,14 @@ layui.config({ } }); - //商品选择 + // 商品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); - $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: productMation.unitList})); - form.render("select"); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productModel").val(chooseProductMation.productModel); + $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); + form.render("select"); + }); }); /** diff --git a/erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js b/erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js index 5c2d305aef586d70edd63884d3eaec8c5a948f74..77c10e254241cad996a52f7756ebf56f113db644 100644 --- a/erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js +++ b/erp-produce/src/main/resources/template/js/erpBom/erpBomEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //bom表商品选择必备参数 var productMationList = [];//选择的商品列表 @@ -36,7 +33,7 @@ layui.config({ }); //初始化父件商品信息 - productMation = { + erpOrderUtil.chooseProductMation = { productId: json.bean.productId, productName: json.bean.productName, productModel: json.bean.productModel, @@ -72,7 +69,7 @@ layui.config({ item.wastagePrice = $("#wastage" + item.productId).val(); item.remark = $("#remark" + item.productId).val(); childObject.push(item); - if(item.productId == productMation.productId){ + if(item.productId == erpOrderUtil.chooseProductMation.productId){ winui.window.msg('子件清单中不能包含父件信息。', {icon: 2,time: 2000}); wheatherError = true; return false; @@ -90,10 +87,10 @@ layui.config({ var params = { bomTitle: $("#bomTitle").val(), - materialId: isNull(productMation.productId) ? '' : productMation.productId,//商品id + materialId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//商品id normsId: $("#unitList").val(), remark: $("#remark").val(), - sealPrice: getSealPrice(productMation.unitList, $("#unitList").val()), + sealPrice: getSealPrice(erpOrderUtil.chooseProductMation.unitList, $("#unitList").val()), childStr: JSON.stringify(childObject), rowId: parent.rowId }; @@ -355,23 +352,14 @@ layui.config({ } }); - //商品选择 + // 商品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); - $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: productMation.unitList})); - form.render("select"); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productModel").val(chooseProductMation.productModel); + $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); + form.render("select"); + }); }); /** diff --git a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinAdd.js b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinAdd.js index 06bfa97bd9068437789b618b071c759f712ac3a9..ff34f9ecc4cc1b9895298e1635f093c0bf9530d9 100644 --- a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinAdd.js +++ b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //工序选择必备参数 var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList var procedureMationList = new Array(); @@ -184,46 +181,36 @@ layui.config({ // 加工成品选择 $("body").on("click", "#productNameSel", function(e){ - productMation = machinPro; - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - machinPro = productMation; - //工序重置 - $("#procedureChoose").show(); - procedureMationList = []; - $("#procedureBody").html(""); - //重置成品信息 - $("#productName").val(machinPro.productName); - $("#productModel").val(machinPro.productModel); - $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); - $("#number").val(1); - //重置单据信息 - productionMation = {}; - $("#productionOrder").val(""); - - //部门 - $("#departmentId").val(""); - - //移除之前填写的所有行 - var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']"); - $.each(checkRow, function(i, item) { - //删除allChooseProduct已选择的商品信息 - var trId = $(item).parent().parent().attr("trcusid"); - allChooseProduct[trId] = undefined; - //移除界面上的信息 - $(item).parent().parent().remove(); - }); - - form.render(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + machinPro = chooseProductMation; + //工序重置 + $("#procedureChoose").show(); + procedureMationList = []; + $("#procedureBody").html(""); + //重置成品信息 + $("#productName").val(machinPro.productName); + $("#productModel").val(machinPro.productModel); + $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); + $("#number").val(1); + //重置单据信息 + productionMation = {}; + $("#productionOrder").val(""); + + //部门 + $("#departmentId").val(""); + + //移除之前填写的所有行 + var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']"); + $.each(checkRow, function(i, item) { + //删除allChooseProduct已选择的商品信息 + var trId = $(item).parent().parent().attr("trcusid"); + allChooseProduct[trId] = undefined; + //移除界面上的信息 + $(item).parent().parent().remove(); + }); + + form.render(); + }); }); //新增行 @@ -278,28 +265,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); //计划加工单选择 diff --git a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinEdit.js b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinEdit.js index 6ae9b3a5dd2959ba17eca9d5f41b885ed7daae4e..adf92e67c6980253b8a3438640f91b8586c50a45 100644 --- a/erp-produce/src/main/resources/template/js/erpMachin/erpMachinEdit.js +++ b/erp-produce/src/main/resources/template/js/erpMachin/erpMachinEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //工序选择必备参数 var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList var procedureMationList = new Array(); @@ -256,46 +253,36 @@ layui.config({ //加工成品选择 $("body").on("click", "#productNameSel", function(e){ - productMation = machinPro; - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - machinPro = productMation; - //工序重置 - $("#procedureChoose").show(); - procedureMationList = []; - $("#procedureBody").html(""); - //重置成品信息 - $("#productName").val(machinPro.productName); - $("#productModel").val(machinPro.productModel); - $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); - $("#number").val(1); - //重置单据信息 - productionMation = {}; - $("#productionOrder").val(""); - - //部门 - $("#departmentId").val(""); - - //移除之前填写的所有行 - var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']"); - $.each(checkRow, function(i, item) { - //删除allChooseProduct已选择的商品信息 - var trId = $(item).parent().parent().attr("trcusid"); - allChooseProduct[trId] = undefined; - //移除界面上的信息 - $(item).parent().parent().remove(); - }); - - form.render(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + machinPro = chooseProductMation; + //工序重置 + $("#procedureChoose").show(); + procedureMationList = []; + $("#procedureBody").html(""); + //重置成品信息 + $("#productName").val(machinPro.productName); + $("#productModel").val(machinPro.productModel); + $("#unitList").html(getDataUseHandlebars(selOption, {rows: machinPro.unitList})); + $("#number").val(1); + //重置单据信息 + productionMation = {}; + $("#productionOrder").val(""); + + //部门 + $("#departmentId").val(""); + + //移除之前填写的所有行 + var checkRow = $("#useTable input[type='checkbox'][name='tableCheckRow']"); + $.each(checkRow, function(i, item) { + //删除allChooseProduct已选择的商品信息 + var trId = $(item).parent().parent().attr("trcusid"); + allChooseProduct[trId] = undefined; + //移除界面上的信息 + $(item).parent().parent().remove(); + }); + + form.render(); + }); }); //新增行 @@ -346,33 +333,24 @@ layui.config({ winui.window.msg('请选择要删除的行', {icon: 2, time: 2000}); } } - + //商品选择 - $("body").on("click", ".chooseProductBtn", function(e){ - var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); - }); + $("body").on("click", ".chooseProductBtn", function (e) { + var trId = $(this).parent().parent().attr("trcusid"); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); + }); //计划加工单选择 $("body").on("click", "#productionOrderSel", function(e){ diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpPatchAdd.js b/erp-produce/src/main/resources/template/js/erpPick/erpPatchAdd.js index ac214b0acba0856acb4cb697ceb681ac57676ff5..1015ef7d1497d346dd8ad2a15b25ad3213692c06 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpPatchAdd.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpPatchAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //加工单信息 var machinMation = {}; @@ -190,28 +187,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 加工单选择 diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpPatchEdit.js b/erp-produce/src/main/resources/template/js/erpPick/erpPatchEdit.js index 1c702b1a6fc66645401588619e6b2c8d3d5d6a1d..17a5ea6650e53b899fb477831e5c46a88c70d3de 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpPatchEdit.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpPatchEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //加工单信息 var machinMation = {}; @@ -229,28 +226,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 加工单选择 diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionAdd.js b/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionAdd.js index c510b005d7331dd4b9a18caab6b28ff90d5d410f..9280eb8cc1dcdf38fe39b79c9728b2de377a00da 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionAdd.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //加工单信息 var machinMation = {}; @@ -192,28 +189,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 加工单选择 diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionEdit.js b/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionEdit.js index d5caaa704cb2aef050bf0fa6a1d42982ce4a02de..6dd46e1deaa809db5557cfa5083aee8da3090a6d 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionEdit.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpRequisitionEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //加工单信息 var machinMation = {}; @@ -241,28 +238,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 加工单选择 diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpReturnAdd.js b/erp-produce/src/main/resources/template/js/erpPick/erpReturnAdd.js index 813f03c69d2e5057b7804a5dfb46c2db53a7e87c..7f84151097275bb5152af91bb8b045fa68488942 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpReturnAdd.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpReturnAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -184,28 +181,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); //取消 diff --git a/erp-produce/src/main/resources/template/js/erpPick/erpReturnEdit.js b/erp-produce/src/main/resources/template/js/erpPick/erpReturnEdit.js index b4b48c926bd3cfe53b8f8ed06588a74faf593295..b688a2892bcf33be85ded39cbefc4c78249425f1 100644 --- a/erp-produce/src/main/resources/template/js/erpPick/erpReturnEdit.js +++ b/erp-produce/src/main/resources/template/js/erpPick/erpReturnEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -218,28 +215,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); //取消 diff --git a/erp-produce/src/main/resources/template/js/erpProduction/erpProductionAdd.js b/erp-produce/src/main/resources/template/js/erpProduction/erpProductionAdd.js index 76d185926542308390b42169b40a8afb20d4aaf5..ccaf1bc1388f07a1bc8ec537e4255826e809860a 100644 --- a/erp-produce/src/main/resources/template/js/erpProduction/erpProductionAdd.js +++ b/erp-produce/src/main/resources/template/js/erpProduction/erpProductionAdd.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //工序选择必备参数 var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList var procedureMationList = new Array(); @@ -146,7 +143,7 @@ layui.config({ } var params = { orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId, - materialId: productMation.productId, + materialId: erpOrderUtil.chooseProductMation.productId, normsId: $("#unitList").val(), number: $("#number").val(), planStartDate: $("#planStartDate").val(), @@ -235,26 +232,17 @@ layui.config({ // 商品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); - $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: productMation.unitList})); - //重置单据信息 - salesOrder = {}; - $("#salesOrder").val(""); - //加载bom方案列表 - loadBomList(productMation.unitList[0].id); - form.render("select"); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productModel").val(chooseProductMation.productModel); + $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); + //重置单据信息 + salesOrder = {}; + $("#salesOrder").val(""); + //加载bom方案列表 + loadBomList(chooseProductMation.unitList[0].id); + form.render("select"); + }); }); //销售单选择 @@ -266,13 +254,13 @@ layui.config({ area: ['90vw', '90vh'], callBack: function(refreshCode){ if (refreshCode == '0') { - productMation = { + erpOrderUtil.chooseProductMation = { productName: salesOrder.materialName, productModel: salesOrder.materialModel, productId: salesOrder.materialId }; - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); + $("#productName").val(erpOrderUtil.chooseProductMation.productName); + $("#productModel").val(erpOrderUtil.chooseProductMation.productModel); //加载数量 $("#number").val(salesOrder.operNum); //单号 diff --git a/erp-produce/src/main/resources/template/js/erpProduction/erpProductionEdit.js b/erp-produce/src/main/resources/template/js/erpProduction/erpProductionEdit.js index adc6a690defafe7a62249fbf526149e45245927a..ff350112e0e4ea1aa412e5d869a1f4e740d5fdcd 100644 --- a/erp-produce/src/main/resources/template/js/erpProduction/erpProductionEdit.js +++ b/erp-produce/src/main/resources/template/js/erpProduction/erpProductionEdit.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - //工序选择必备参数 var procedureCheckType = 2;//工序选择类型:1.单选procedureMation;2.多选procedureMationList var procedureMationList = new Array(); @@ -66,7 +63,7 @@ layui.config({ AjaxPostUtil.request({url: flowableBasePath + "erpproduction003", params: {orderId: parent.rowId}, type: 'json', method: "GET", callback: function(json){ if(json.returnCode == 0){ //商品信息 - productMation = { + erpOrderUtil.chooseProductMation = { productId: json.bean.productId, productName: json.bean.materialName, productModel: json.bean.materialModel @@ -199,7 +196,7 @@ layui.config({ } var params = { orderId: isNull(salesOrder.orderHeaderId) ? '' : salesOrder.orderHeaderId, - materialId: productMation.productId, + materialId: erpOrderUtil.chooseProductMation.productId, normsId: $("#unitList").val(), number: $("#number").val(), planStartDate: $("#planStartDate").val(), @@ -289,26 +286,17 @@ layui.config({ //商品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); - $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: productMation.unitList})); - //重置单据信息 - salesOrder = {}; - $("#salesOrder").val(""); - //加载bom方案列表 - loadBomList(productMation.unitList[0].id); - form.render("select"); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productModel").val(chooseProductMation.productModel); + $("#unitList").html(getDataUseHandlebars(selTemplate, {rows: chooseProductMation.unitList})); + //重置单据信息 + salesOrder = {}; + $("#salesOrder").val(""); + //加载bom方案列表 + loadBomList(chooseProductMation.unitList[0].id); + form.render("select"); + }); }); //销售单选择 @@ -320,13 +308,13 @@ layui.config({ area: ['90vw', '90vh'], callBack: function(refreshCode){ if (refreshCode == '0') { - productMation = { + erpOrderUtil.chooseProductMation = { productName: salesOrder.materialName, productModel: salesOrder.materialModel, productId: salesOrder.materialId }; - $("#productName").val(productMation.productName); - $("#productModel").val(productMation.productModel); + $("#productName").val(erpOrderUtil.chooseProductMation.productName); + $("#productModel").val(erpOrderUtil.chooseProductMation.productModel); //加载数量 $("#number").val(salesOrder.operNum); //单号 diff --git a/erp/src/main/resources/template/js/allocation/allocationadd.js b/erp/src/main/resources/template/js/allocation/allocationadd.js index 656b6abf7f2a268209cfcefbe09075adf66bdbbe..e3c1122e125b683af202acdfae352c2eb7415f11 100644 --- a/erp/src/main/resources/template/js/allocation/allocationadd.js +++ b/erp/src/main/resources/template/js/allocation/allocationadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 调拨单 layui.config({ @@ -254,28 +252,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/allocation/allocationedit.js b/erp/src/main/resources/template/js/allocation/allocationedit.js index 682614a3ed1360907abfbf023d1ddf9792264b56..88f5c2912ed9bfbbe1373c26d7b39c2033202de8 100644 --- a/erp/src/main/resources/template/js/allocation/allocationedit.js +++ b/erp/src/main/resources/template/js/allocation/allocationedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 调拨单 layui.config({ @@ -298,28 +296,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/assemblysheet/assemblysheetadd.js b/erp/src/main/resources/template/js/assemblysheet/assemblysheetadd.js index 252a2174d4ad6706b0d5abc86dac16c5cade79a0..d765563175622297804073e2ad8d15c86d365812 100644 --- a/erp/src/main/resources/template/js/assemblysheet/assemblysheetadd.js +++ b/erp/src/main/resources/template/js/assemblysheet/assemblysheetadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 组装单 layui.config({ @@ -274,28 +272,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/assemblysheet/assemblysheetedit.js b/erp/src/main/resources/template/js/assemblysheet/assemblysheetedit.js index 048d78766e8e25f126c944ce106b1de11b515917..40a51e1385aca082433af9bf06c68696dde81b2e 100644 --- a/erp/src/main/resources/template/js/assemblysheet/assemblysheetedit.js +++ b/erp/src/main/resources/template/js/assemblysheet/assemblysheetedit.js @@ -1,6 +1,3 @@ -//商品信息 -var productMation = {}; - // 组装单 layui.config({ base: basePath, @@ -319,28 +316,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/material/materialChoose.js b/erp/src/main/resources/template/js/material/materialChoose.js index f3d80bf56d4472f23852c23bb4c7024bf4148316..7baf32def91918181a81c8fee695e4f2e5205414 100644 --- a/erp/src/main/resources/template/js/material/materialChoose.js +++ b/erp/src/main/resources/template/js/material/materialChoose.js @@ -14,11 +14,11 @@ layui.config({ fsTree = layui.fsTree, fsCommon = layui.fsCommon, tableCheckBoxUtil = layui.tableCheckBoxUtil; - + var checkType = '1';//商品选择类型:1.单选;2.多选 - if(!isNull(parent.productCheckType)){ - checkType = parent.productCheckType; + if(!isNull(parent.erpOrderUtil.productCheckType)){ + checkType = parent.erpOrderUtil.productCheckType; } //设置提示信息 @@ -85,7 +85,7 @@ layui.config({ if(checkType == '2'){ //初始化值 var ids = []; - $.each(parent.productMationList, function(i, item){ + $.each(parent.erpOrderUtil.chooseProductMation, function(i, item){ ids.push(item.productId); }); tableCheckBoxUtil.setIds({ @@ -130,7 +130,7 @@ layui.config({ form.render(); var chooseIndex = JSON.stringify(dubClick.data('index')); var obj = res.rows[chooseIndex]; - parent.productMation = obj; + parent.erpOrderUtil.chooseProductMation = obj; parent.refreshCode = '0'; parent.layer.close(index); @@ -142,8 +142,7 @@ layui.config({ form.render(); }) }else{ - //多选 - //设置选中 + // 多选,设置选中 tableCheckBoxUtil.checkedDefault({ gridId: 'messageTable', fieldName: 'productId' @@ -182,7 +181,7 @@ layui.config({ }); AjaxPostUtil.request({url: flowableBasePath + "material013", params: {ids: selectedData.toString()}, type: 'json', callback: function(json){ if(json.returnCode == 0){ - parent.productMationList = [].concat(json.rows); + parent.erpOrderUtil.chooseProductMation = [].concat(json.rows); parent.layer.close(index); parent.refreshCode = '0'; }else{ diff --git a/erp/src/main/resources/template/js/otheroutlets/otheroutletsadd.js b/erp/src/main/resources/template/js/otheroutlets/otheroutletsadd.js index bece265b393e55104ddddcf0106cd1de9a94ff08..a48ccd5565988b8c565a02b17ef477c9a31abfd0 100644 --- a/erp/src/main/resources/template/js/otheroutlets/otheroutletsadd.js +++ b/erp/src/main/resources/template/js/otheroutlets/otheroutletsadd.js @@ -1,9 +1,6 @@ //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -273,28 +270,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/otheroutlets/otheroutletsedit.js b/erp/src/main/resources/template/js/otheroutlets/otheroutletsedit.js index e0a9a7f4e2e2d7ca1dbfdcb64f811459e609df89..87efa14e11f08afd3b9f4921e4600642c9d7c2f7 100644 --- a/erp/src/main/resources/template/js/otheroutlets/otheroutletsedit.js +++ b/erp/src/main/resources/template/js/otheroutlets/otheroutletsedit.js @@ -1,9 +1,6 @@ //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -344,28 +341,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/otherwarehous/otherwarehousadd.js b/erp/src/main/resources/template/js/otherwarehous/otherwarehousadd.js index 1f5ee30b2f7bb53d579da22547a1e5c224c8a9a2..cbe6643ea262612dc510901ae32725d849d4a109 100644 --- a/erp/src/main/resources/template/js/otherwarehous/otherwarehousadd.js +++ b/erp/src/main/resources/template/js/otherwarehous/otherwarehousadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -250,31 +248,18 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function (e) { var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function (refreshCode) { - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], { - icon: 2, - time: 2000 - }); - } - } + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); }); }); diff --git a/erp/src/main/resources/template/js/otherwarehous/otherwarehousedit.js b/erp/src/main/resources/template/js/otherwarehous/otherwarehousedit.js index b0c09fa49a0ca85bb376d63b846489a8d6f13f1c..4b3871949c2acee145ee0cbe23d66ed15ecf889e 100644 --- a/erp/src/main/resources/template/js/otherwarehous/otherwarehousedit.js +++ b/erp/src/main/resources/template/js/otherwarehous/otherwarehousedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -320,28 +318,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/purchaseorder/purchaseorderadd.js b/erp/src/main/resources/template/js/purchaseorder/purchaseorderadd.js index 820fb80898baecb3fd035f505dc2981bc48cfa6c..a2ca6e94b468bb6cf027469c0c4150473844baf4 100644 --- a/erp/src/main/resources/template/js/purchaseorder/purchaseorderadd.js +++ b/erp/src/main/resources/template/js/purchaseorder/purchaseorderadd.js @@ -1,5 +1,3 @@ -// 商品信息 -var productMation = {}; // 生产订单信息 var productionMation = {}; @@ -255,28 +253,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); //生产计划单选择 diff --git a/erp/src/main/resources/template/js/purchaseorder/purchaseorderedit.js b/erp/src/main/resources/template/js/purchaseorder/purchaseorderedit.js index 10fb555fe51071ebdd809485f29e2484f25ecfa1..b76902302cc24efe4260c6c5c615bd457ec48e52 100644 --- a/erp/src/main/resources/template/js/purchaseorder/purchaseorderedit.js +++ b/erp/src/main/resources/template/js/purchaseorder/purchaseorderedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //生产订单信息 var productionMation = {}; @@ -328,28 +326,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); //生产计划单选择 diff --git a/erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js b/erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js index 8538e9aa40168ef95eb82829d95d5d4d28f3702b..d19f8616a057fc7bb498b9c04a53e6df8d75d599 100644 --- a/erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js +++ b/erp/src/main/resources/template/js/purchaseorder/purchaseorderpurchase.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -362,28 +360,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/purchaseput/purchaseputadd.js b/erp/src/main/resources/template/js/purchaseput/purchaseputadd.js index af00eeea03c252825cc8ecd4e2fe4ee3ba259d77..90dc8fe88d844814eb67e43be7cb03993e5492ca 100644 --- a/erp/src/main/resources/template/js/purchaseput/purchaseputadd.js +++ b/erp/src/main/resources/template/js/purchaseput/purchaseputadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -279,28 +277,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/purchaseput/purchaseputedit.js b/erp/src/main/resources/template/js/purchaseput/purchaseputedit.js index abc0990a83161b78ed5bd66f7a2e1ca8896cde06..2db6f5c3cc5ecce97b68c83d0b8937c68eed1448 100644 --- a/erp/src/main/resources/template/js/purchaseput/purchaseputedit.js +++ b/erp/src/main/resources/template/js/purchaseput/purchaseputedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -362,28 +360,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/purchasereturns/purchasereturnsadd.js b/erp/src/main/resources/template/js/purchasereturns/purchasereturnsadd.js index 02f9d96746cc4d78dbe2bdb0b8660dc469c6cc69..57f2a40ed06b302f382adfc93f5be0bf61b3cdc9 100644 --- a/erp/src/main/resources/template/js/purchasereturns/purchasereturnsadd.js +++ b/erp/src/main/resources/template/js/purchasereturns/purchasereturnsadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -281,28 +279,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/purchasereturns/purchasereturnsedit.js b/erp/src/main/resources/template/js/purchasereturns/purchasereturnsedit.js index 8f0e9922923fc80ec7c8b213be918196cd902bbf..9b72486ca3227c0a06a4c42b85d230e8a117a01f 100644 --- a/erp/src/main/resources/template/js/purchasereturns/purchasereturnsedit.js +++ b/erp/src/main/resources/template/js/purchasereturns/purchasereturnsedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; @@ -357,28 +355,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js b/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js index e4ea05e146c10c7ad05186ce2eea0e303b20018f..ffd3812c3e1d067017b8c56abfbfef38850dfa4a 100644 --- a/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js +++ b/erp/src/main/resources/template/js/retailoutlet/retailoutletadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 兼容动态表单 var layedit, form; @@ -307,28 +305,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 会员选择 diff --git a/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js b/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js index aacd85ab13d416ab288aad34ba11b0b01a856df2..a66e7900d4a1c43e95eb9938273352ae79f66bd3 100644 --- a/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js +++ b/erp/src/main/resources/template/js/retailoutlet/retailoutletedit.js @@ -1,5 +1,3 @@ -// 商品信息 -var productMation = {}; // 兼容动态表单 var layedit, form; @@ -368,28 +366,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 会员选择 diff --git a/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js b/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js index a767dfb6329f0878383dcaf0ba0e1c6dd7266d12..73999369ca2678df1470a60fea7f508fc14e443b 100644 --- a/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js +++ b/erp/src/main/resources/template/js/retailreturns/retailreturnsadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 兼容动态表单 var layedit, form; @@ -305,28 +303,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 会员选择 diff --git a/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js b/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js index 17dbcf89d18c0251471c68106f3b21491f3fba02..2f0bfb460791b5f42123c317d4e13e9ffd648eb8 100644 --- a/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js +++ b/erp/src/main/resources/template/js/retailreturns/retailreturnsedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 兼容动态表单 var layedit, form; @@ -366,28 +364,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); // 会员选择 diff --git a/erp/src/main/resources/template/js/salesorder/salesorderadd.js b/erp/src/main/resources/template/js/salesorder/salesorderadd.js index b2c41f664d67070fae436ed9bb914eae5b058cf4..02bf03b66cd099179d983acee152d395711e5418 100644 --- a/erp/src/main/resources/template/js/salesorder/salesorderadd.js +++ b/erp/src/main/resources/template/js/salesorder/salesorderadd.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 // 已经选择的客户信息 var customerMation = {}; -// 商品信息 -var productMation = {}; - // 根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; // 表格的序号 @@ -341,28 +338,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - // 获取表格行号 - var thisRowNum = trId.replace("tr", ""); - // 商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + // 商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 其他费用表格操作 start ****************************/ diff --git a/erp/src/main/resources/template/js/salesorder/salesorderedit.js b/erp/src/main/resources/template/js/salesorder/salesorderedit.js index 076553d175dcd90f682cab81799ad95c02f7deb2..18ff3a627d1d4ef5d784167d3e839a57146e612f 100644 --- a/erp/src/main/resources/template/js/salesorder/salesorderedit.js +++ b/erp/src/main/resources/template/js/salesorder/salesorderedit.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 // 已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -422,28 +419,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 其他费用表格操作 start ****************************/ diff --git a/erp/src/main/resources/template/js/salesorder/salesorderpurchase.js b/erp/src/main/resources/template/js/salesorder/salesorderpurchase.js index c2207c4cc50d005a9e1a301a4990e95df595e0a3..0c604d7be67617c29baae81ab22fad994ebc18d9 100644 --- a/erp/src/main/resources/template/js/salesorder/salesorderpurchase.js +++ b/erp/src/main/resources/template/js/salesorder/salesorderpurchase.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -443,28 +440,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js b/erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js index 3f22ca3e4e6d067f9e4fc61890c9f1ff94b4705e..c9f56eb3f0776a1a06fb427bcf7a5b6e048020d0 100644 --- a/erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js +++ b/erp/src/main/resources/template/js/salesoutlet/salesoutletadd.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -350,28 +347,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/salesoutlet/salesoutletedit.js b/erp/src/main/resources/template/js/salesoutlet/salesoutletedit.js index 94f452a600fad4e128f5b346269819f910464c49..a42442e549aff23d22bae694104291a85f29a3e7 100644 --- a/erp/src/main/resources/template/js/salesoutlet/salesoutletedit.js +++ b/erp/src/main/resources/template/js/salesoutlet/salesoutletedit.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -434,28 +431,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/salesreturns/salesreturnsadd.js b/erp/src/main/resources/template/js/salesreturns/salesreturnsadd.js index 46c9c5d6140bcab8ea871f43834b098de49e0731..9fa4e580b4041a729a26747a8ff31cda233b0003 100644 --- a/erp/src/main/resources/template/js/salesreturns/salesreturnsadd.js +++ b/erp/src/main/resources/template/js/salesreturns/salesreturnsadd.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -352,28 +349,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/salesreturns/salesreturnsedit.js b/erp/src/main/resources/template/js/salesreturns/salesreturnsedit.js index 22bcefa5b0c5f77d8e576abf300abf3ba3a2a2ef..6ae81c14580a4fd37192beabe4b66537e4cbced8 100644 --- a/erp/src/main/resources/template/js/salesreturns/salesreturnsedit.js +++ b/erp/src/main/resources/template/js/salesreturns/salesreturnsedit.js @@ -6,9 +6,6 @@ var checkType = "1";//人员选择类型,1.多选;其他。单选 //已经选择的客户信息 var customerMation = {}; -//商品信息 -var productMation = {}; - //根据那一列的值进行变化,默认根据数量 var showTdByEdit = 'rkNum'; //表格的序号 @@ -434,28 +431,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); /*********************** 商品表格操作 end ****************************/ diff --git a/erp/src/main/resources/template/js/splitlist/splitlistadd.js b/erp/src/main/resources/template/js/splitlist/splitlistadd.js index 44a5d515cb8db2e3cd42ee888224d3e5665bc641..52231a936f7da4bf658471b2f7771a17621c026b 100644 --- a/erp/src/main/resources/template/js/splitlist/splitlistadd.js +++ b/erp/src/main/resources/template/js/splitlist/splitlistadd.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 拆分单 layui.config({ @@ -274,28 +272,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/erp/src/main/resources/template/js/splitlist/splitlistedit.js b/erp/src/main/resources/template/js/splitlist/splitlistedit.js index 2227c634a276edd1df6c8e7c98b8f6c420267793..d9d8ffd814456dc3bd4c309ed8edad96aafba681 100644 --- a/erp/src/main/resources/template/js/splitlist/splitlistedit.js +++ b/erp/src/main/resources/template/js/splitlist/splitlistedit.js @@ -1,5 +1,3 @@ -//商品信息 -var productMation = {}; // 拆分单 layui.config({ @@ -320,28 +318,19 @@ layui.config({ //商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/seal-service/src/main/resources/template/js/partsclaim/partsclaimadd.js b/seal-service/src/main/resources/template/js/partsclaim/partsclaimadd.js index ba7143898bd90917ac0ae1bae9fabfdf5ae5afe7..665e38681ce9f8d839a888f7885c0eaa9668fd1c 100644 --- a/seal-service/src/main/resources/template/js/partsclaim/partsclaimadd.js +++ b/seal-service/src/main/resources/template/js/partsclaim/partsclaimadd.js @@ -6,9 +6,6 @@ var chooseOrderId = ""; // 已经选择的客户信息 var customerMation = {}; -// 商品信息 -var productMation = {}; - // 配件申领单 layui.config({ base: basePath, @@ -276,28 +273,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/seal-service/src/main/resources/template/js/partsclaim/partsclaimedit.js b/seal-service/src/main/resources/template/js/partsclaim/partsclaimedit.js index 56eee648ba2e7b71596618948db7ddce343c4f59..a1c2ee850d539704f3123323657e675e6d93a27a 100644 --- a/seal-service/src/main/resources/template/js/partsclaim/partsclaimedit.js +++ b/seal-service/src/main/resources/template/js/partsclaim/partsclaimedit.js @@ -6,9 +6,6 @@ var chooseOrderId = ""; // 已经选择的客户信息 var customerMation = {}; -// 商品信息 -var productMation = {}; - // 配件申领单 layui.config({ base: basePath, @@ -334,28 +331,19 @@ layui.config({ // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - //获取表格行号 - var thisRowNum = trId.replace("tr", ""); - //商品赋值 - allChooseProduct[trId] = productMation; - //表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - //表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - //计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + //获取表格行号 + var thisRowNum = trId.replace("tr", ""); + //商品赋值 + allChooseProduct[trId] = chooseProductMation; + //表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + //表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + //计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function() { diff --git a/seal-service/src/main/resources/template/js/sealseservice/sealseserviceadd.js b/seal-service/src/main/resources/template/js/sealseservice/sealseserviceadd.js index c6f1459a832035710701bce4b46f603e119fa700..f5ab89172927cb4110040e5e87295cbc100c6e1f 100644 --- a/seal-service/src/main/resources/template/js/sealseservice/sealseserviceadd.js +++ b/seal-service/src/main/resources/template/js/sealseservice/sealseserviceadd.js @@ -4,8 +4,6 @@ var chooseOrNotMy = "1";//人员列表中是否包含自己--1.包含;其他 var chooseOrNotEmail = "2";//人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 var checkType = "1";//人员选择类型,1.多选;其他。单选 -var productMation = {};//产品信息 - //工单接收人信息 var serviceUser = {}; @@ -148,7 +146,7 @@ layui.config({ areaId: areaId,//区县,可为空 townshipId: townshipId,//乡镇,可为空 addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空 - productId: isNull(productMation.productId) ? '' : productMation.productId,//产品id,可为空 + productId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//产品id,可为空 productName: $("#productName").val(),//产品名称,可为空 productNorms: $("#productNorms").val(),//规格型号,可为空 productSerialNum: $("#productSerialNum").val(),//序列号,可为空 @@ -338,19 +336,10 @@ layui.config({ //产品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productNorms").val(productMation.productModel); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productNorms").val(chooseProductMation.productModel); + }); }); //客户选择 diff --git a/seal-service/src/main/resources/template/js/sealseservice/sealseserviceedit.js b/seal-service/src/main/resources/template/js/sealseservice/sealseserviceedit.js index f8b39046a714a27875867b6d2d6c982b4bf2bb82..943ef6d2ecde0a78f473b5bd95b0b08397ab3fb8 100644 --- a/seal-service/src/main/resources/template/js/sealseservice/sealseserviceedit.js +++ b/seal-service/src/main/resources/template/js/sealseservice/sealseserviceedit.js @@ -3,8 +3,6 @@ var chooseOrNotMy = "1";//人员列表中是否包含自己--1.包含;其他 var chooseOrNotEmail = "2";//人员列表中是否必须绑定邮箱--1.必须;其他参数没必要 var checkType = "1";//人员选择类型,1.多选;其他。单选 -var productMation = {};//产品信息 - //工单接收人信息 var serviceUser = {}; @@ -36,7 +34,7 @@ layui.config({ ajaxSendLoadBefore: function(hdb){ }, ajaxSendAfter: function(json){ - productMation.productId = json.bean.productId; + erpOrderUtil.chooseProductMation.productId = json.bean.productId; textool.init({ eleId: 'content', @@ -151,7 +149,7 @@ layui.config({ areaId: areaId,//区县,可为空 townshipId: townshipId,//乡镇,可为空 addressDetailed: $("#addressDetailed").val(),//详细地址,不可为空 - productId: isNull(productMation.productId) ? '' : productMation.productId,//产品id,可为空 + productId: isNull(erpOrderUtil.chooseProductMation.productId) ? '' : erpOrderUtil.chooseProductMation.productId,//产品id,可为空 productName: $("#productName").val(),//产品名称,可为空 productNorms: $("#productNorms").val(),//规格型号,可为空 productSerialNum: $("#productSerialNum").val(),//序列号,可为空 @@ -461,19 +459,10 @@ layui.config({ //产品选择 $("body").on("click", "#productNameSel", function(e){ - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - $("#productName").val(productMation.productName); - $("#productNorms").val(productMation.productModel); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + $("#productName").val(chooseProductMation.productName); + $("#productNorms").val(chooseProductMation.productModel); + }); }); //客户选择 diff --git a/seal-service/src/main/resources/template/js/stateisstayfinishedpro/stateisstayfinished.js b/seal-service/src/main/resources/template/js/stateisstayfinishedpro/stateisstayfinished.js index 941f6228c4c2cb2fbf6bc7f9af9db0a6fc48ca8e..14e46e9bd248eedaf6ac2a368892d81d470c6e82 100644 --- a/seal-service/src/main/resources/template/js/stateisstayfinishedpro/stateisstayfinished.js +++ b/seal-service/src/main/resources/template/js/stateisstayfinishedpro/stateisstayfinished.js @@ -1,7 +1,4 @@ -//商品信息 -var productMation = {}; - // 工单完工 layui.config({ base: basePath, @@ -346,50 +343,31 @@ layui.config({ // 故障组件选择 $("body").on("click", "#faultKeyPartsIdSel", function(e){ - productMation = faultKeyParts; - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - faultKeyParts = productMation; - // 重置故障组件信息 - $("#faultKeyPartsId").val(faultKeyParts.productName); - - form.render(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + faultKeyParts = chooseProductMation; + // 重置故障组件信息 + $("#faultKeyPartsId").val(faultKeyParts.productName); + + form.render(); + }); }); // 商品选择 $("body").on("click", ".chooseProductBtn", function(e){ var trId = $(this).parent().parent().attr("trcusid"); - _openNewWindows({ - url: "../../tpl/material/materialChoose.html", - title: "选择商品", - pageId: "productlist", - area: ['90vw', '90vh'], - callBack: function(refreshCode){ - if (refreshCode == '0') { - // 获取表格行号 - var thisRowNum = trId.replace("tr", ""); - // 商品赋值 - allChooseProduct[trId] = productMation; - // 表格商品名称赋值 - $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); - // 表格单位赋值 - $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); - form.render('select'); - // 计算价格 - calculatedTotalPrice(); - } else if (refreshCode == '-9999') { - winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2,time: 2000}); - } - }}); + erpOrderUtil.openMaterialChooseChoosePage(function (chooseProductMation) { + // 获取表格行号 + var thisRowNum = trId.replace("tr", ""); + // 商品赋值 + allChooseProduct[trId] = chooseProductMation; + // 表格商品名称赋值 + $("#materialId" + thisRowNum.toString()).val(allChooseProduct[trId].productName + "(" + allChooseProduct[trId].productModel + ")"); + // 表格单位赋值 + $("#unitId" + thisRowNum.toString()).html(getDataUseHandlebars(selOption, {rows: allChooseProduct[trId].unitList})); + form.render('select'); + // 计算价格 + calculatedTotalPrice(); + }); }); $("body").on("click", "#cancle", function(){ diff --git a/web/src/main/resources/template/assets/lib/layui/customer/erpOrderUtil.js b/web/src/main/resources/template/assets/lib/layui/customer/erpOrderUtil.js index f2b5299708bc6e6caff2d9924186f1894f567f51..956035c894f43b48bb079df112d755c48e8ed5bf 100644 --- a/web/src/main/resources/template/assets/lib/layui/customer/erpOrderUtil.js +++ b/web/src/main/resources/template/assets/lib/layui/customer/erpOrderUtil.js @@ -222,4 +222,27 @@ var erpOrderUtil = { }, async: false}); }, + /** + * ERP商品选择对象以及工具函数 + */ + productCheckType: 1, // 商品选择类型:1.单选;2.多选 + chooseProductMation: {}, // 如果productCheckType=1,则为对象;如果productCheckType=2,则为集合 + openMaterialChooseChoosePage: function (callback) { + _openNewWindows({ + url: "../../tpl/material/materialChoose.html", + title: "选择商品", + pageId: "productlist", + area: ['90vw', '90vh'], + callBack: function (refreshCode) { + if (refreshCode == '0') { + if (typeof (callback) == "function") { + callback(erpOrderUtil.chooseProductMation); + } + } else if (refreshCode == '-9999') { + winui.window.msg(systemLanguage["com.skyeye.operationFailed"][languageType], {icon: 2, time: 2000}); + } + } + }); + }, + }; \ No newline at end of file