浏览代码

Merge branch 'dev-1.1.4' into 'dev-1.1.4'

药品出库显示购入金额总额

See merge request hurugang/thmz_system!22
huangshuhua 2 年之前
父节点
当前提交
406c033917

+ 1 - 0
src/main/java/cn/hnthyy/thmz/controller/yk/YpOutDetlController.java

@@ -130,6 +130,7 @@ public class YpOutDetlController {
                 ypOutDetlVo.setBuyPrice(ypZdDict.getBuyPrice());
                 ypOutDetlVo.setSpecification(ypZdDict.getSpecification());
                 ypOutDetlVo.setJbFlag(ypZdDict.getJbFlag());
+                ypOutDetlVo.setNationalCode(ypZdDict.getNationalCode());
                 ypOutDetlVo.setManufactoryName(ypZdManufactoryService.queryYpZdManufactoryByCode(ypZdDict.getManuCode()));
                 YpBase ypBase = ypBaseService.queryYpBase(ypOutDetlVo.getChargeCode(), ypOutDetlVo.getSerial(), ypOutDetlVo.getGroupNo());
                 ypOutDetlVo.setLocation(ypBase.getLocation() == null ? "" : ypBase.getLocation());

+ 25 - 2
src/main/resources/static/js/yk/drug_delivery.js

@@ -53,9 +53,11 @@ $(function () {
                     name: row['name'],
                     specification: row['specification'],
                     packRetprice: row['packRetprice'],
+                    buyPrice: row['buyPrice'],
                     amount: 0,
                     amountOut: 0,
                     amountOutMoney: 0,
+                    buyInMoney: 0,
                     jbFlag: row['jbFlag'],
                     nationalCode: row['nationalCode'],
                     serial: row['serial']
@@ -485,7 +487,17 @@ function initInDetlDetailed() {
             }
             $("#tb_table_detailed").jqGrid('setCell', rowId, "amountOut", amountOut);
             $("#tb_table_detailed").jqGrid('setCell', rowId, "amountOutMoney", keepTwoDecimal(amountOut * parseFloat(rowData.packRetprice)));
+            $("#tb_table_detailed").jqGrid('setCell', rowId, "buyInMoney", keepTwoDecimal(amountOut * parseFloat(rowData.buyPrice)));
             $("#tb_table_detailed").jqGrid('setCell', rowId, "inSeri", rowData.inSeri);
+            var rowNum=parseInt($("#tb_table_detailed").getGridParam("records"),20);//获取行数
+            if(rowNum>0){
+                $(".ui-jqgrid-sdiv").show();
+                let amountOutMoney=$("#tb_table_detailed").getCol("amountOutMoney",false,"sum");//需要统计的列
+                let buyInMoney=$("#tb_table_detailed").getCol("buyInMoney",false,"sum");
+                $("#tb_table_detailed").footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney),"buyInMoney":keepTwoDecimal(buyInMoney)}); //将合计值显示出来
+            }else{
+                $(".ui-jqgrid-sdiv").hide();
+            }
         },
         loadComplete: function (res) { //加载完成(初始加载),回调函数
             if (res == '401' || res == 401) {
@@ -531,13 +543,14 @@ function initDetailed() {
         loadonce: false, //一次加载全部数据到客户端,由客户端进行排序。
         footerrow:true,//设置属性,显示统计行
         cellsubmit: "remote",
-        colNames: ['单号', '药品编码', '药品名称', '规格', '零售价', '请领数量', '出库量', '金额', '基本药物', '药品国家医保编码', 'serial'],
+        colNames: ['单号', '药品编码', '药品名称', '规格', '零售价', '购入价', '请领数量', '出库量', '金额', '购入金额', '基本药物', '药品国家医保编码', 'serial'],
         colModel: [
             {name: 'drawNo', index: 'drawNo', align: 'center'},
             {name: 'chargeCode', index: 'chargeCode', align: 'center'},
             {name: 'name', index: 'name', align: 'left'},
             {name: 'specification', index: 'specification', align: 'left'},
             {name: 'packRetprice', index: 'packRetprice', align: 'center'},
+            {name: 'buyPrice', index: 'buyPrice', align: 'center'},
             {name: 'amount', index: 'amount', align: 'center'},
             {
                 name: 'amountOut', index: 'amountOut', align: 'center',
@@ -554,6 +567,15 @@ function initDetailed() {
                      return keepTwoDecimal((isEmpty(rowObject.amount) ? rowObject.outAmt : rowObject.amountOut) * rowObject.packRetprice);
                  }
             },
+            {
+                name: 'buyInMoney', index: 'buyInMoney', align: 'center',
+                formatter: function (cellvalue, options, rowObject) {
+                    if(!isEmpty(cellvalue) && cellvalue+"".indexOf("span") != -1){
+                        return cellvalue;
+                    }
+                     return keepTwoDecimal((isEmpty(rowObject.amount) ? rowObject.outAmt : rowObject.amountOut) * rowObject.buyPrice);
+                 }
+            },
             {
                 name: 'jbFlag', index: 'jbFlag', align: 'center',
                 formatter: function (cellvalue, options, rowObject) {
@@ -575,7 +597,8 @@ function initDetailed() {
             if(rowNum>0){
                 $(".ui-jqgrid-sdiv").show();
                 let amountOutMoney=$(this).getCol("amountOutMoney",false,"sum");//需要统计的列
-                $(this).footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney)}); //将合计值显示出来
+                let buyInMoney=$(this).getCol("buyInMoney",false,"sum");
+                $(this).footerData("set",{"amountOut":"合计","amountOutMoney":keepTwoDecimal(amountOutMoney),"buyInMoney":keepTwoDecimal(buyInMoney)}); //将合计值显示出来
             }else{
                 $(".ui-jqgrid-sdiv").hide();
             }

+ 7 - 0
src/main/resources/templates/yk/drug_info.html

@@ -720,6 +720,13 @@
                             <input id="drugControlCode" name="drugControlCode" class="form-control col-md-7 col-xs-12" type="text" data-validate-length-range="1,17">
                         </div>
                     </div>
+                    <div class="col-md-2 col-sm-2 col-xs-12 item">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="drugControlCode">国家医保编码
+                        </label>
+                        <div class="col-md-8 col-sm-8 col-xs-12">
+                            <input id="nationalCode" name="nationalCode" class="form-control col-md-7 col-xs-12" type="text" data-validate-length-range="1,17" readonly>
+                        </div>
+                    </div>
                 </div>
             </form>
         </div>