From c6880e0e3b5b9f0d2dc5c3ee11abad4ce674c653 Mon Sep 17 00:00:00 2001 From: double <768903061@qq.com> Date: Fri, 14 Jun 2019 10:48:50 +0800 Subject: [PATCH 1/3] =?UTF-8?q?=E5=8D=95=E6=8D=AE=E6=98=8E=E7=BB=86?= =?UTF-8?q?=E6=89=93=E5=8D=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/js/pages/materials/bill_detail.js | 77 +++++++++++++++++++++++ erp_web/pages/materials/bill_detail.html | 11 +++- 2 files changed, 85 insertions(+), 3 deletions(-) diff --git a/erp_web/js/pages/materials/bill_detail.js b/erp_web/js/pages/materials/bill_detail.js index 77f4892fc0..8f07e54626 100644 --- a/erp_web/js/pages/materials/bill_detail.js +++ b/erp_web/js/pages/materials/bill_detail.js @@ -7,12 +7,17 @@ var payTypeTitle = "";//收入 支出 var itemType = true; //隐藏当前列 var moneyType = true; //隐藏当前列 + $(function() { initSystemData_account(); //获取账户信息 initMProperty(); //初始化商品属性 initOutItemList(); //初始化支出项目 initialize();//初始化系统基础信息 + }); + + + //获取账户信息 function initSystemData_account(){ $.ajax({ @@ -95,38 +100,47 @@ if(listSubType == "采购入库") { billType = "material"; $("#bill .purchase_in").show(); + tableString = $(".purchase_in").html(); } else if(listSubType == "采购退货出库") { billType = "material"; $("#bill .purchase_back").show(); + tableString = $(".purchase_back").html(); } else if(listSubType == "销售出库") { billType = "material"; $("#bill .sale_out").show(); + tableString = $(".sale_out").html(); } else if(listSubType == "销售退货入库") { billType = "material"; $("#bill .sale_back").show(); + tableString = $(".sale_back").html(); } else if(listSubType == "零售出库") { billType = "material"; $("#bill .retail_out").show(); + tableString = $(".retail_out").html(); } else if(listSubType == "零售退货入库") { billType = "material"; $("#bill .retail_back").show(); + tableString = $(".retail_back").html(); } else if(listSubType == "其它入库") { billType = "material"; $("#bill .other_in").show(); + tableString = $(".other_in").html(); } else if(listSubType == "其它出库") { billType = "material"; $("#bill .other_out").show(); + tableString = $(".other_out").html(); } else if(listSubType == "调拨出库") { billType = "material"; $("#bill .allocation_out").show(); + tableString = $(".allocation_out").html(); } else if(listSubType == "收入") { billType = "account"; @@ -134,6 +148,7 @@ itemType = false; //显示当前列 moneyType = true; //隐藏当前列 $("#bill .item_in").show(); + tableString = $(".item_in").html(); } else if(listSubType == "支出") { billType = "account"; @@ -141,6 +156,7 @@ itemType = false; //显示当前列 moneyType = true; //隐藏当前列 $("#bill .item_out").show(); + tableString = $(".item_out").html(); } else if(listSubType == "收款") { billType = "account"; @@ -148,6 +164,7 @@ itemType = true; //隐藏当前列 moneyType = false; //显示当前列 $("#bill .money_in").show(); + tableString = $(".money_in").html(); } else if(listSubType == "付款") { billType = "account"; @@ -155,6 +172,7 @@ itemType = true; //隐藏当前列 moneyType = false; //显示当前列 $("#bill .money_out").show(); + tableString = $(".money_out").html(); } else if(listSubType == "转账") { billType = "account"; @@ -162,6 +180,7 @@ itemType = true; //隐藏当前列 moneyType = false; //显示当前列 $("#bill .giro").show(); + tableString = $(".giro").html(); } else if(listSubType == "收预付款") { billType = "account"; @@ -169,8 +188,12 @@ itemType = true; //隐藏当前列 moneyType = false; //显示当前列 $("#bill .advance_in").show(); + tableString = $(".advance_in").html(); } + + + //如果是进货、销售 if(billType == "material"){ $.ajax({ @@ -317,6 +340,57 @@ } }); } + //打印table + $("#print_bill_detail").off("click").on("click",function(){ + var tableString = "";//打印table + if(listSubType == "采购入库") { + tableString = $(".purchase_in").html(); + } + else if(listSubType == "采购退货出库") { + tableString = $(".purchase_back").html(); + } + else if(listSubType == "销售出库") { + tableString = $(".sale_out").html(); + } + else if(listSubType == "销售退货入库") { + tableString = $(".sale_back").html(); + } + else if(listSubType == "零售出库") { + tableString = $(".retail_out").html(); + } + else if(listSubType == "零售退货入库") { + tableString = $(".retail_back").html(); + } + else if(listSubType == "其它入库") { + tableString = $(".other_in").html(); + } + else if(listSubType == "其它出库") { + tableString = $(".other_out").html(); + } + else if(listSubType == "调拨出库") { + tableString = $(".allocation_out").html(); + } + else if(listSubType == "收入") { + tableString = $(".item_in").html(); + } + else if(listSubType == "支出") { + tableString = $(".item_out").html(); + } + else if(listSubType == "收款") { + tableString = $(".money_in").html(); + } + else if(listSubType == "付款") { + tableString = $(".money_out").html(); + } + else if(listSubType == "转账") { + tableString = $(".giro").html(); + } + else if(listSubType == "收预付款") { + tableString = $(".advance_in").html(); + } + localStorage.setItem("tableString",tableString); + window.open("../../js/print/print_form.html","location:No;status:No;help:No;dialogWidth:800px;dialogHeight:600px;scroll:auto;"); + }); } //初始化表格数据-商品列表-查看状态 @@ -459,3 +533,6 @@ }); } + function print(){ + alert(listSubType); + } diff --git a/erp_web/pages/materials/bill_detail.html b/erp_web/pages/materials/bill_detail.html index a33c9da614..165351dbe1 100644 --- a/erp_web/pages/materials/bill_detail.html +++ b/erp_web/pages/materials/bill_detail.html @@ -15,6 +15,7 @@ +
- + @@ -93,7 +94,7 @@ closed="true" modal="true" cache="false" collapsible="false" closable="true">
会员卡号:会员卡号:
- + @@ -304,7 +305,7 @@
会员卡号:会员卡号:
-
@@ -379,6 +380,7 @@
+
@@ -823,5 +825,8 @@
+
+ 打印 +
-- Gitee From 5b2c539acc75a067e7b3c714011b6140e67a4017 Mon Sep 17 00:00:00 2001 From: double <768903061@qq.com> Date: Fri, 14 Jun 2019 10:49:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E6=B7=BB=E5=8A=A0=E9=94=80=E5=94=AE=E6=80=BB?= =?UTF-8?q?=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- erp_web/pages/reports/sale_out_report.html | 29 ++++++++++++++-------- 1 file changed, 19 insertions(+), 10 deletions(-) diff --git a/erp_web/pages/reports/sale_out_report.html b/erp_web/pages/reports/sale_out_report.html index f3bcb9ae70..e7d8039fff 100644 --- a/erp_web/pages/reports/sale_out_report.html +++ b/erp_web/pages/reports/sale_out_report.html @@ -34,7 +34,7 @@    打印 - 注:此处包含零售+批发销售 + 当前销售总额:0  注:此处包含零售+批发销售 @@ -110,14 +110,16 @@ pageSize: 10, pageList: [10, 50, 100], columns: [[ - {title: '名称', field: 'MaterialName', width: 60}, - {title: '型号', field: 'MaterialModel', width: 80}, - {title: '扩展信息', field: 'MaterialOther', width: 150}, - {title: '单位', field: 'MaterialUnit', width: 80}, - {title: '销售数量', field: 'OutSum', width: 60}, - {title: '销售金额', field: 'OutSumPrice', width: 60}, - {title: '退货数量', field: 'InSum', width: 60}, - {title: '退货金额', field: 'InSumPrice', width: 60} + {title: '名称', field: 'MaterialName', width: 60, align: "center"}, + {title: '型号', field: 'MaterialModel', width: 80, align: "center"}, + {title: '扩展信息', field: 'MaterialOther', width: 150, align: "center"}, + {title: '单位', field: 'MaterialUnit', width: 80, align: "center"}, + {title: '销售数量', field: 'OutSum', width: 60, align: "center"}, + {title: '销售金额', field: 'OutSumPrice', width: 60, align: "center"}, + {title: '退货数量', field: 'InSum', width: 60, align: "center"}, + {title: '退货金额', field: 'InSumPrice', width: 60, align: "center"}, + {title: '实际销售金额', field: 'OutInSumPrice', width: 80, align: "center"} + ]], onLoadError: function () { $.messager.alert('页面加载提示', '页面加载异常,请稍后再试!', 'error'); @@ -219,6 +221,13 @@ if (res && res.code === 200 && res.data) { $("#tableData").datagrid('loadData', res.data.rows); } + var total = 0; + res.data.rows.forEach(function(value, index, array){ + //执行某些操作 + total += value.OutInSumPrice; + }) + + $(".first-total").text(total); //当前总余额 }, //此处添加错误处理 error: function () { @@ -260,4 +269,4 @@ } - \ No newline at end of file + -- Gitee From 137c01ef6483284f4fbb32c5656daccdbdc52931 Mon Sep 17 00:00:00 2001 From: double <768903061@qq.com> Date: Fri, 14 Jun 2019 10:54:54 +0800 Subject: [PATCH 3/3] =?UTF-8?q?=E9=94=80=E5=94=AE=E7=BB=9F=E8=AE=A1?= =?UTF-8?q?=E6=8A=A5=E8=A1=A8=E4=B8=AD=E6=80=BB=E9=94=80=E5=94=AE=E9=A2=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/java/com/jsh/erp/controller/DepotItemController.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/main/java/com/jsh/erp/controller/DepotItemController.java b/src/main/java/com/jsh/erp/controller/DepotItemController.java index f78f0f8639..dca9edd12e 100644 --- a/src/main/java/com/jsh/erp/controller/DepotItemController.java +++ b/src/main/java/com/jsh/erp/controller/DepotItemController.java @@ -584,6 +584,7 @@ public class DepotItemController { BigDecimal OutSumPrice = sumPriceBuyOrSale("出库", "销售", diEx.getMId(), monthTime); BigDecimal InSumRetailPrice = sumPriceBuyOrSale("入库", "零售退货", diEx.getMId(), monthTime); BigDecimal InSumPrice = sumPriceBuyOrSale("入库", "销售退货", diEx.getMId(), monthTime); + BigDecimal OutInSumPrice = (OutSumRetailPrice.add(OutSumPrice)).subtract(InSumRetailPrice.add(InSumPrice)); item.put("MaterialName", diEx.getMName()); item.put("MaterialModel", diEx.getMModel()); //扩展信息 @@ -595,6 +596,7 @@ public class DepotItemController { item.put("InSum", InSumRetail.add(InSum)); item.put("OutSumPrice", OutSumRetailPrice.add(OutSumPrice)); item.put("InSumPrice", InSumRetailPrice.add(InSumPrice)); + item.put("OutInSumPrice",OutInSumPrice);//实际销售金额 dataArray.add(item); } } -- Gitee