From 4056ec422a7e3b1ad68a41fc0fdf96dab6034343 Mon Sep 17 00:00:00 2001 From: weizhiqiang <> Date: Tue, 21 Jun 2022 18:52:27 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90ERP=E3=80=91=20=E4=BA=A7=E5=93=81?= =?UTF-8?q?=E9=80=89=E6=8B=A9=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../resources/template/js/erpBom/erpBomAdd.js | 33 ++--- .../template/js/erpBom/erpBomEdit.js | 34 ++--- .../template/js/erpMachin/erpMachinAdd.js | 108 +++++++--------- .../template/js/erpMachin/erpMachinEdit.js | 116 +++++++----------- .../template/js/erpPick/erpPatchAdd.js | 38 ++---- .../template/js/erpPick/erpPatchEdit.js | 38 ++---- .../template/js/erpPick/erpRequisitionAdd.js | 38 ++---- .../template/js/erpPick/erpRequisitionEdit.js | 38 ++---- .../template/js/erpPick/erpReturnAdd.js | 38 ++---- .../template/js/erpPick/erpReturnEdit.js | 38 ++---- .../js/erpProduction/erpProductionAdd.js | 42 +++---- .../js/erpProduction/erpProductionEdit.js | 44 +++---- .../template/js/allocation/allocationadd.js | 37 ++---- .../template/js/allocation/allocationedit.js | 37 ++---- .../js/assemblysheet/assemblysheetadd.js | 37 ++---- .../js/assemblysheet/assemblysheetedit.js | 38 ++---- .../template/js/material/materialChoose.js | 15 ++- .../js/otheroutlets/otheroutletsadd.js | 38 ++---- .../js/otheroutlets/otheroutletsedit.js | 38 ++---- .../js/otherwarehous/otherwarehousadd.js | 39 ++---- .../js/otherwarehous/otherwarehousedit.js | 37 ++---- .../js/purchaseorder/purchaseorderadd.js | 37 ++---- .../js/purchaseorder/purchaseorderedit.js | 37 ++---- .../js/purchaseorder/purchaseorderpurchase.js | 37 ++---- .../template/js/purchaseput/purchaseputadd.js | 37 ++---- .../js/purchaseput/purchaseputedit.js | 37 ++---- .../js/purchasereturns/purchasereturnsadd.js | 37 ++---- .../js/purchasereturns/purchasereturnsedit.js | 37 ++---- .../js/retailoutlet/retailoutletadd.js | 37 ++---- .../js/retailoutlet/retailoutletedit.js | 37 ++---- .../js/retailreturns/retailreturnsadd.js | 37 ++---- .../js/retailreturns/retailreturnsedit.js | 37 ++---- .../template/js/salesorder/salesorderadd.js | 38 ++---- .../template/js/salesorder/salesorderedit.js | 38 ++---- .../js/salesorder/salesorderpurchase.js | 38 ++---- .../template/js/salesoutlet/salesoutletadd.js | 38 ++---- .../js/salesoutlet/salesoutletedit.js | 38 ++---- .../js/salesreturns/salesreturnsadd.js | 38 ++---- .../js/salesreturns/salesreturnsedit.js | 38 ++---- .../template/js/splitlist/splitlistadd.js | 37 ++---- .../template/js/splitlist/splitlistedit.js | 37 ++---- .../template/js/partsclaim/partsclaimadd.js | 38 ++---- .../template/js/partsclaim/partsclaimedit.js | 38 ++---- .../js/sealseservice/sealseserviceadd.js | 21 +--- .../js/sealseservice/sealseserviceedit.js | 23 +--- .../stateisstayfinished.js | 62 +++------- .../assets/lib/layui/customer/erpOrderUtil.js | 23 ++++ 47 files changed, 670 insertions(+), 1203 deletions(-) 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 a202d0489..12974d83a 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 5c2d305ae..77c10e254 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 06bfa97bd..ff34f9ecc 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 6ae9b3a5d..adf92e67c 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 ac214b0ac..1015ef7d1 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 1c702b1a6..17a5ea665 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 c510b005d..9280eb8cc 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 d5caaa704..6dd46e1de 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 813f03c69..7f8415109 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 b4b48c926..b688a2892 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 76d185926..ccaf1bc13 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 adc6a690d..ff350112e 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 656b6abf7..e3c1122e1 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 682614a3e..88f5c2912 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 252a2174d..d76556317 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 048d78766..40a51e138 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 f3d80bf56..7baf32def 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 bece265b3..a48ccd556 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 e0a9a7f4e..87efa14e1 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 1f5ee30b2..cbe6643ea 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 b0c09fa49..4b3871949 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 820fb8089..a2ca6e94b 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 10fb555fe..b76902302 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 8538e9aa4..d19f8616a 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 af00eeea0..90dc8fe88 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 abc0990a8..2db6f5c3c 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 02f9d9674..57f2a40ed 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 8f0e99229..9b72486ca 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 e4ea05e14..ffd3812c3 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 aacd85ab1..a66e7900d 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 a767dfb63..73999369c 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 17dbcf89d..2f0bfb460 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 b2c41f664..02bf03b66 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 076553d17..18ff3a627 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 c2207c4cc..0c604d7be 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 3f22ca3e4..c9f56eb3f 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 94f452a60..a42442e54 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 46c9c5d61..9fa4e580b 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 22bcefa5b..6ae81c145 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 44a5d515c..52231a936 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 2227c634a..d9d8ffd81 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 ba7143898..665e38681 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 56eee648b..a1c2ee850 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 c6f1459a8..f5ab89172 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 f8b39046a..943ef6d2e 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 941f6228c..14e46e9bd 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 f2b529970..956035c89 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 -- GitLab