Jelajahi Sumber

出入库金额统计查询日期修改,金额小数位修改

WANGJIALIANG 2 tahun lalu
induk
melakukan
85053a475a

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpInDetlMapper.java

@@ -613,8 +613,8 @@ public interface YpInDetlMapper {
             "        sum(round(convert(decimal(18,3),(convert(decimal(18,3),a.pack_retprice )* a.buy_amt)),2)) as inMoneyRet,\n" +
             "        outMoneyRet=0\n" +
             "   from yp_in_detl a WITH(NOLOCK)\n" +
-            "   where  datediff(day,in_date,#{beginDate}) <![CDATA[<=]]> 0 and\n" +
-            "   datediff(day,in_date,#{endDate}) <![CDATA[>]]> 0 and\n" +
+            "   where  in_date <![CDATA[>=]]> #{beginDate} and\n" +
+            "   in_date <![CDATA[<=]]> #{endDate} and\n" +
             "   a.group_no =#{groupNo}" +
             "   group by a.group_no,\n" +
             "         left(convert(varchar(12),in_date,111),7)" +

+ 2 - 2
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpOutDetlMapper.java

@@ -315,8 +315,8 @@ public interface YpOutDetlMapper {
             "        inMoneyBuy=0," +
             "        inMoneyRet=0" +
             "   from yp_out_detl a" +
-            "   where  datediff(day,in_date,#{beginDate}) <![CDATA[<=]]> 0 and" +
-            "   datediff(day,in_date,#{endDate}) <![CDATA[>]]> 0 and" +
+            "   where  in_date <![CDATA[>=]]> #{beginDate} and\n" +
+            "   in_date <![CDATA[<=]]> #{endDate} and\n" +
             "   a.group_no =#{groupNo}" +
             "   group by a.group_no_out," +
             "         left(convert(varchar(12),out_date,111),7)" +

+ 1 - 1
src/main/resources/static/js/common/pharmacy-com.js

@@ -842,7 +842,7 @@ function getYpTypeName(ypType) {
 
 //判断字符是否为空的方法
 function isEmpty(obj) {
-    if (typeof obj == "undefined" || obj == null || obj == "") {
+    if (typeof obj === "undefined" || obj === null || obj === "") {
         return true;
     } else {
         return false;

+ 0 - 9
src/main/resources/static/js/yk/drug_in_out_count.js

@@ -170,15 +170,6 @@ function getRecordData() {
     });
 }
 
-/**
- * 获取时间选择器的时间数组
- * @returns {string[]}
- */
-function getRePortRangeArr() {
-    var rePortRange = $('#reportrange span').html();
-    var rePortRangeArr = rePortRange.split(" - ");
-    return rePortRangeArr;
-}
 
 /**
  * 清空查询条件

+ 10 - 10
src/main/resources/static/js/yk/drug_purchase_situation.js

@@ -128,8 +128,8 @@ function getRecordData() {
                     if (i > 0 && ((flag === 2 || flag === 0) ? data.supplyName : data.manuName) !== ((flag === 2 || flag === 0) ? res.data[i - 1].supplyName : res.data[i - 1].manuName)) {
                         html += '<tr class="sjh">';
                         html += '<td colspan="4" style="text-align: right;font-weight: 700;">小计:</td>';
-                        html += '<td style="text-align: center;">' + packRetpriceSum + '</td>';
-                        html += '<td style="text-align: center;">' + buyPriceSum + '</td>';
+                        html += '<td style="text-align: center;">' + keepTwoDecimal(packRetpriceSum) + '</td>';
+                        html += '<td style="text-align: center;">' + keepTwoDecimal(buyPriceSum) + '</td>';
                         html += '</tr>';
                         totalPackRetpriceSum += packRetpriceSum;
                         totalBuyPriceSum += buyPriceSum;
@@ -144,8 +144,8 @@ function getRecordData() {
                         html += '<td class="xtd" style="text-align: center;">' + (flag === 0 ? data.supplyName : data.manuName) + '</td>';
                         html += '<td class="xtd" style="text-align: center;">' + data.reptNoSum + '</td>';
                         html += '<td class="xtd" style="text-align: center;">' + (isEmpty(data.inDocuNo)?'-':data.inDocuNo) + '</td>';
-                        html += '<td class="xtd" style="text-align: center;">' + data.packRetpriceSum + '</td>';
-                        html += '<td class="xtd" style="text-align: center;">' + data.buyPriceSum + '</td>';
+                        html += '<td class="xtd" style="text-align: center;">' + keepTwoDecimal(data.packRetpriceSum) + '</td>';
+                        html += '<td class="xtd" style="text-align: center;">' + keepTwoDecimal(data.buyPriceSum) + '</td>';
                         html += '</tr>';
                     } else {
                         html += '<tr class="sjh">';
@@ -153,15 +153,15 @@ function getRecordData() {
                         html += '<td class="xtd" style="text-align: center;">' + data.drugName + '</td>';
                         html += '<td class="xtd" style="text-align: center;">' + data.specification + '</td>';
                         html += '<td class="xtd" style="text-align: center;">' + data.buyAmt + '</td>';
-                        html += '<td class="xtd" style="text-align: center;">' + data.packRetpriceSum + '</td>';
-                        html += '<td class="xtd" style="text-align: center;">' + data.buyPriceSum + '</td>';
+                        html += '<td class="xtd" style="text-align: center;">' + keepTwoDecimal(data.packRetpriceSum) + '</td>';
+                        html += '<td class="xtd" style="text-align: center;">' + keepTwoDecimal(data.buyPriceSum) + '</td>';
                         flag === 2 ? $(".mainName").html("供应商") : $(".mainName").html("生产厂家");
                     }
                     if (i + 1 === res.data.length) {
                         html += '<tr class="sjh">';
                         html += '<td colspan="4" style="text-align: right;font-weight: 700;">小计:</td>';
-                        html += '<td style="text-align: center;">' + packRetpriceSum + '</td>';
-                        html += '<td style="text-align: center;">' + buyPriceSum + '</td>';
+                        html += '<td style="text-align: center;">' + keepTwoDecimal(packRetpriceSum) + '</td>';
+                        html += '<td style="text-align: center;">' + keepTwoDecimal(buyPriceSum) + '</td>';
                         html += '</tr>';
                         totalPackRetpriceSum += packRetpriceSum;
                         totalBuyPriceSum += buyPriceSum;
@@ -169,8 +169,8 @@ function getRecordData() {
                 }
                 html += '<tr class="sjh">';
                 html += '<td colspan="4" style="text-align: right;font-weight: 700;">总计:</td>';
-                html += '<td style="text-align: center;">' + totalPackRetpriceSum + '</td>';
-                html += '<td style="text-align: center;">' + totalBuyPriceSum + '</td>';
+                html += '<td style="text-align: center;">' + keepTwoDecimal(totalPackRetpriceSum) + '</td>';
+                html += '<td style="text-align: center;">' + keepTwoDecimal(totalBuyPriceSum) + '</td>';
                 html += '</tr>';
                 if (flag === 0 || flag === 1) {
                     $("#sum_table").append(html);

+ 14 - 11
src/main/resources/static/js/yk/drug_storage.js

@@ -593,7 +593,6 @@ function loadBar(inDocuNo, chargeCode, manuNo) {
  * 初始化入库药品条码表格数据
  */
 function initBar() {
-    let selectRowId;//选中的行号
     $.jgrid.gridUnload("tb_bar_code");
     $("#tb_bar_code").jqGrid({
         datatype: 'local',
@@ -624,11 +623,13 @@ function initBar() {
         cellsubmit: "clientArray",
         caption: '入库药品关联条码',
         rownumbers: true,//是否显示序号
-        colNames: ['入库单号','批号','药品编码','条码'],
+        multiselect: true,
+        multiboxonly:true,
+        colNames: ['入库单号','批号','药品编码','追溯码'],
         colModel: [
-            {name: 'inDocuNo', index: 'inDocuNo', align: 'center', width: 160,sortable: false},
-            {name: 'manuNo', index: 'manuNo', align: 'center', width: 160},
-            {name: 'chargeCode', index: 'chargeCode', align: 'center', width: 160},
+            {name: 'inDocuNo', index: 'inDocuNo', align: 'center', width: 150,sortable: false},
+            {name: 'manuNo', index: 'manuNo', align: 'center', width: 150},
+            {name: 'chargeCode', index: 'chargeCode', align: 'center', width: 120},
             {name: 'barCode', index: 'barCode', align: 'left', width: 160,editable : true,edittype:'text'}
         ],
         jsonReader: {
@@ -642,10 +643,9 @@ function initBar() {
             $("#tb_bar_code").setCell(rowid, iCol, value);
         },
         onCellSelect: function (rowid, iCol, cellcontent, e) {
-            selectRowId = rowid;
+            $("#tb_bar_code #jqg_tb_bar_code_" + rowid).prop("checked", true);//打钩
         },
         beforeEditCell: function(rowid,iCol,cellcontent,e){
-            selectRowId = rowid;
         },
         loadComplete: function (res) { //加载完成(初始加载),回调函数
             /*$("#barCode").focus();*/
@@ -680,13 +680,13 @@ function initBar() {
         let data= {inDocuNo:$("#inDocuNoLabel").val(),manuNo:$("#manuNo").val(),chargeCode:$("#chargeCode").val(),barCode:""};
         $("#tb_bar_code").addRowData(rowid+1, data,'first');
         $("#tb_bar_code").jqGrid('editRow', rowid+1);
-        selectRowId =  rowid+1;
     });
     $("#removeBarCode").on('click', function () {
-        if (selectRowId == null) {
-            return errorMesageSimaple('请选择一行进行删除!');
+        let ids = $("#tb_bar_code").jqGrid("getDataIDs");
+        console.log(ids);
+        for (let i = 0; i < ids.length; i++) {
+            $("#tb_bar_code").jqGrid("delRowData", ids[i]);
         }
-        $("#tb_bar_code").jqGrid("delRowData", selectRowId);
     });
 
     /**
@@ -696,6 +696,9 @@ function initBar() {
     function autoBar(value){
         var ids = $("#tb_bar_code").jqGrid("getDataIDs");//得到jqgrid当前行数
         var rowid = Math.max.apply(Math,ids);//获得当前最大行号
+        if(rowid == "-Infinity"){
+            rowid = 0;
+        }
         $("#tb_bar_code").saveRow(rowid);//取消最后一行的编辑状态
         let rowDatas = $("#tb_bar_code").getRowData();
         for (let i = 0; i < rowDatas.length; i++) {