Browse Source

药品购入情况报表开发完成

WANGJIALIANG 2 years ago
parent
commit
86a15d9baa

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

@@ -365,16 +365,19 @@ public interface YpInDetlMapper {
     List<YpInDetl> selectCurrentStockGreaterZero(YpInDetl ypInDetl);
 
     /**
-     * 统计供应商、制药厂的药品购入
+     * 统计供应商药品购入汇总
      * @param map
      * @return
      */
     @Select("<script>"+
-            "SELECT charge_code as chargeCode,serial,buyAmt = sum(buy_amt)," +
-            "       packRetpriceSum = sum(a.buy_amt *convert(decimal(18,4), a.pack_retprice))," +
-            "       buyPriceSum = sum(a.buy_amt * convert(decimal(18,4),a.buy_price))," +
-            "       reptNoSum=count(distinct rept_no)," +
-            "       in_docu_no as inDocuNo" +
+            "SELECT " +
+            "       buyAmt = sum(buy_amt),\n" +
+            "       packRetpriceSum = sum(buy_amt *convert(decimal(18,4), pack_retprice)),\n" +
+            "       buyPriceSum = sum(buy_amt * convert(decimal(18,4),buy_price)),\n" +
+            "       reptNoSum=count(distinct rept_no),\n" +
+            "       manuCode=max(manu_code),\n" +
+            "       supplyCode=max(supply_code),\n" +
+            "       in_docu_no AS inDocuNo" +
             " FROM yp_in_detl" +
             "<where>" +
             "   <if test=\"beginDate != null and beginDate != ''\">" +
@@ -386,28 +389,109 @@ public interface YpInDetlMapper {
             "   <if test=\"groupNo != null and groupNo != ''\">" +
             "        AND group_no = #{groupNo}" +
             "   </if>" +
-            "   <if test=\"manuCode != null and manuCode != ''\">" +
-            "        AND manu_code=#{manuCode}" +
-            "   </if>" +
-            "   <if test=\"supplyCode != null and supplyCode != ''\">" +
-            "        AND supply_code=#{supplyCode}" +
-            "   </if>" +
-            "   <if test=\"flag == 0\">" +
-            "        GROUP BY manu_code" +
-            "        ORDER BY sum(buy_amt * buy_price)   DESC" +
-            "   </if>" +
-            "   <if test=\"flag == 1\">" +
-            "        GROUP BY supply_code,in_docu_no" +
+            "       GROUP BY supply_code,in_docu_no" +
+            "       ORDER BY supply_code,sum(buy_amt * buy_price) DESC" +
+            "</where>" +
+            "</script>")
+    List<Map<String,Object>> selectDrugSupplySum(Map map);
+
+    /**
+     * 统计供应商药品购入明细
+     * @param map
+     * @return
+     */
+    @Select("<script>"+
+            "SELECT chargeCode=charge_code," +
+            "       serial," +
+            "       buyAmt = sum(buy_amt),\n" +
+            "       packRetpriceSum = sum(buy_amt *convert(decimal(18,4), pack_retprice)),\n" +
+            "       buyPriceSum = sum(buy_amt * convert(decimal(18,4),buy_price)),\n" +
+            "       reptNoSum=count(distinct rept_no),\n" +
+            "       manuCode=max(manu_code),\n" +
+            "       supplyCode=max(supply_code)" +
+            " FROM yp_in_detl" +
+            "<where>" +
+            "   <if test=\"beginDate != null and beginDate != ''\">" +
+            "       and in_date <![CDATA[>=]]> #{beginDate}"+
+            "   </if>"+
+            "   <if test=\"endDate != null and endDate != ''\">" +
+            "       and in_date <![CDATA[<=]]> #{endDate}"+
+            "   </if>"+
+            "   <if test=\"groupNo != null and groupNo != ''\">" +
+            "        AND group_no = #{groupNo}" +
             "   </if>" +
-            "   <if test=\"flag == 2\">" +
-            "       GROUP BY charge_code,\n" +
-            "         serial     ,\n" +
+            "       GROUP BY charge_code," +
+            "         serial     ," +
             "         supply_code" +
-            "         order by supply_code,sum(buy_amt * buy_price) desc" +
+            "       order by supply_code,sum(buy_amt * buy_price) desc" +
+            "</where>" +
+            "</script>")
+    List<Map<String,Object>> selectDrugSupplyDetailed(Map map);
+
+    /**
+     * 统计生产厂家药品购入汇总
+     * @param map
+     * @return
+     */
+    @Select("<script>"+
+            "SELECT " +
+            "       buyAmt = sum(buy_amt),\n" +
+            "       packRetpriceSum = sum(buy_amt *convert(decimal(18,4), pack_retprice)),\n" +
+            "       buyPriceSum = sum(buy_amt * convert(decimal(18,4),buy_price)),\n" +
+            "       reptNoSum=count(distinct rept_no),\n" +
+            "       manuCode=max(manu_code),\n" +
+            "       supplyCode=max(supply_code)" +
+            " FROM yp_in_detl" +
+            "<where>" +
+            "   <if test=\"beginDate != null and beginDate != ''\">" +
+            "       and in_date <![CDATA[>=]]> #{beginDate}"+
+            "   </if>"+
+            "   <if test=\"endDate != null and endDate != ''\">" +
+            "       and in_date <![CDATA[<=]]> #{endDate}"+
+            "   </if>"+
+            "   <if test=\"groupNo != null and groupNo != ''\">" +
+            "        AND group_no = #{groupNo}" +
+            "   </if>" +
+            "       GROUP BY manu_code" +
+            "       ORDER BY manu_code,sum(buy_amt * buy_price) DESC" +
+            "</where>" +
+            "</script>")
+    List<Map<String,Object>> selectDrugManuSum(Map map);
+
+    /**
+     * 统计生产厂家药品购入明细
+     * @param map
+     * @return
+     */
+    @Select("<script>"+
+            "SELECT chargeCode=charge_code," +
+            "       serial," +
+            "       buyAmt = sum(buy_amt),\n" +
+            "       packRetpriceSum = sum(buy_amt *convert(decimal(18,4), pack_retprice)),\n" +
+            "       buyPriceSum = sum(buy_amt * convert(decimal(18,4),buy_price)),\n" +
+            "       reptNoSum=count(distinct rept_no),\n" +
+            "       manuCode=max(manu_code),\n" +
+            "       supplyCode=max(supply_code)" +
+            " FROM yp_in_detl" +
+            "<where>" +
+            "   <if test=\"beginDate != null and beginDate != ''\">" +
+            "       and in_date <![CDATA[>=]]> #{beginDate}"+
+            "   </if>"+
+            "   <if test=\"endDate != null and endDate != ''\">" +
+            "       and in_date <![CDATA[<=]]> #{endDate}"+
+            "   </if>"+
+            "   <if test=\"groupNo != null and groupNo != ''\">" +
+            "        AND group_no = #{groupNo}" +
             "   </if>" +
+            "       GROUP BY charge_code," +
+            "         serial     ," +
+            "         manu_code" +
+            "       order by manu_code,sum(buy_amt * buy_price) desc" +
             "</where>" +
             "</script>")
-    List<Map<String,Object>> selectDrugPurchaseSituation(Map map);
+    List<Map<String,Object>> selectDrugManuDetailed(Map map);
+
+
 
 
 }

+ 24 - 4
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpInDetlServiceImpl.java

@@ -311,12 +311,32 @@ public class YpInDetlServiceImpl implements YpInDetlService {
 
     @Override
     public List<Map<String, Object>> queryDrugPurchaseSituation(Map map) {
-        List<Map<String, Object>> list = ypInDetlMapper.selectDrugPurchaseSituation(map);
+        String flag = map.get("flag").toString();
+        List<Map<String, Object>> list = new ArrayList<>();
+        if(flag.equals("0")){
+            list = ypInDetlMapper.selectDrugSupplySum(map);
+        }else if(flag.equals("1")){
+            list = ypInDetlMapper.selectDrugManuSum(map);
+        }else if(flag.equals("2")){
+            list = ypInDetlMapper.selectDrugSupplyDetailed(map);
+        }else{
+            list = ypInDetlMapper.selectDrugManuDetailed(map);
+        }
         for (int i = 0; i < list.size(); i++) {
             Map<String, Object> stringObjectMap = list.get(i);
-            YpZdDict ypZdDict = ypZdDictMapper.selectYpZdDictByCodeAndSerial(stringObjectMap.get("chargeCode").toString(),stringObjectMap.get("serial").toString());
-            stringObjectMap.put("drugName",ypZdDict.getName());
-            stringObjectMap.put("specification",ypZdDict.getSpecification());
+            if(stringObjectMap.get("chargeCode") != null){
+                YpZdDict ypZdDict = ypZdDictMapper.selectYpZdDictByCodeAndSerial(stringObjectMap.get("chargeCode").toString(),stringObjectMap.get("serial").toString());
+                stringObjectMap.put("drugName",ypZdDict.getName());
+                stringObjectMap.put("specification",ypZdDict.getSpecification());
+            }
+            if(stringObjectMap.get("supplyCode") != null){
+                String supplyName = ypZdSupplyMapper.selectNameByCode(stringObjectMap.get("supplyCode").toString());
+                stringObjectMap.put("supplyName",supplyName);
+            }
+            if(stringObjectMap.get("manuCode") != null){
+                String manuName = ypZdManufactoryMapper.selectYpZdManufactoryByCode(stringObjectMap.get("manuCode").toString());
+                stringObjectMap.put("manuName",manuName);
+            }
         }
         return list;
     }

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

@@ -878,6 +878,7 @@ function saveData(index, field, value,id) {
         value: value        //cell值
     })
 }
+
 //将checkbox未选中将设置为指定值并系列化
 jQuery.fn.extend({
     serializeWithCheckbox: function (uncheckedValue) {
@@ -889,21 +890,17 @@ jQuery.fn.extend({
             rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i,
             rsubmittable = /^(?:input|select|textarea|keygen)/i,
             rcheckableType = (/^(?:radio)$/i);  //仅将radio设置为不发送未选中项
-
         //未指定的转换为false
         if (uncheckedValue == undefined)
             uncheckedValue = 'false'
         uncheckedValue = uncheckedValue + '';//转字符串
-
         return this.map(function () {
-
             // Can add propHook for "elements" to filter or add form elements
             var elements = jQuery.prop(this, "elements");
             return elements ? jQuery.makeArray(elements) : this;
         })
             .filter(function () {
                 var type = this.type;
-
                 // Use .is( ":disabled" ) so that fieldset[disabled] works
                 return this.name && !jQuery(this).is(":disabled") &&
                     rsubmittable.test(this.nodeName) && !rsubmitterTypes.test(type) &&
@@ -911,21 +908,70 @@ jQuery.fn.extend({
             })
             .map(function (_i, elem) {
                 var val = jQuery(this).val();
-
                 if (val == null) {
                     return null;
                 }
                 //将未勾选的checkbox值设置为指定值
                 if (this.type == 'checkbox' && this.checked == false)
                     val = uncheckedValue;
-
                 if (Array.isArray(val)) {
                     return jQuery.map(val, function (val) {
                         return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
                     });
                 }
-
                 return { name: elem.name, value: val.replace(rCRLF, "\r\n") };
             }).get();
     }
-});
+});
+
+/**
+ * 初始化日期时间范围选择
+ */
+function init_daterangepickertime() {
+    if (typeof ($.fn.daterangepicker) === 'undefined') {
+        return;
+    }
+    var optionSet1 = {
+        startDate: moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00"),
+        endDate: moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"),
+        minDate: '2012-01-01',
+        maxDate: nowString() + ' 23:59:59',
+        /*dateLimit: {
+            days: 1200
+        },//起止时间的最大间隔*/
+        showDropdowns: true,
+        showWeekNumbers: true,
+        ranges: {
+            '今天': [moment(), moment()],
+            '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
+            '最近7天': [moment().subtract(6, 'days'), moment()],
+            '最近30天': [moment().subtract(29, 'days'), moment()],
+            '当月': [moment().startOf('month'), moment().endOf('month')],
+            '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
+        },
+        opens: 'right',
+        buttonClasses: ['btn btn-default'],
+        applyClass: 'btn-small btn-primary',
+        cancelClass: 'btn-small',
+        timePicker: true, //显示时间
+        timePicker24Hour: true, //时间制
+        timePickerSeconds: true, //时间显示到秒
+        timePickerIncrement: 1,
+        format: 'YYYY-MM-DD HH:mm:ss',
+        separator: ' to ',
+        locale: {
+            applyLabel: '确定',
+            cancelLabel: '取消',
+            fromLabel: 'From',
+            toLabel: 'To',
+            customRangeLabel: '自定义',
+            daysOfWeek: ['天', '一', '二', '三', '四', '五', '六'],
+            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+            firstDay: 1
+        }
+    };
+    $('#reportrange').daterangepicker(optionSet1, function (start, end, label) {
+        $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'));
+    });
+    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00") + ' - ' + moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"));
+}

+ 0 - 49
src/main/resources/static/js/yf/spirit_anesthetic_print.js

@@ -378,52 +378,3 @@ function queryParams() {
     };
     return temp;
 }
-
-function init_daterangepickertime() {
-    if (typeof ($.fn.daterangepicker) === 'undefined') {
-        return;
-    }
-    var optionSet1 = {
-        startDate: moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00"),
-        endDate: moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"),
-        minDate: '2012-01-01',
-        maxDate: nowString() + ' 23:59:59',
-        /*dateLimit: {
-            days: 1200
-        },//起止时间的最大间隔*/
-        showDropdowns: true,
-        showWeekNumbers: true,
-        ranges: {
-            '今天': [moment(), moment()],
-            '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
-            '最近7天': [moment().subtract(6, 'days'), moment()],
-            '最近30天': [moment().subtract(29, 'days'), moment()],
-            '当月': [moment().startOf('month'), moment().endOf('month')],
-            '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
-        },
-        opens: 'right',
-        buttonClasses: ['btn btn-default'],
-        applyClass: 'btn-small btn-primary',
-        cancelClass: 'btn-small',
-        timePicker: true, //显示时间
-        timePicker24Hour: true, //时间制
-        timePickerSeconds: true, //时间显示到秒
-        timePickerIncrement: 1,
-        format: 'YYYY-MM-DD HH:mm:ss',
-        separator: ' to ',
-        locale: {
-            applyLabel: '确定',
-            cancelLabel: '取消',
-            fromLabel: 'From',
-            toLabel: 'To',
-            customRangeLabel: '自定义',
-            daysOfWeek: ['天', '一', '二', '三', '四', '五', '六'],
-            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
-            firstDay: 1
-        }
-    };
-    $('#reportrange').daterangepicker(optionSet1, function (start, end, label) {
-        $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'));
-    });
-    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00") + ' - ' + moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"));
-}

+ 123 - 295
src/main/resources/static/js/yk/drug_purchase_situation.js

@@ -1,12 +1,15 @@
 //@ sourceURL=drug_purchase_situation.js
 var LODOP; //声明为全局变量
+var groupYk = window.localStorage["groupYk"];
 $(function () {
-    initDynamicSelect("allUnitCode", "unitCodeSearch");
+    if (groupYk == null) {
+        return errorMesageSimaple('药库参数未设置,请在发药参数设置中设置');
+    }
     init_daterangepickertime();
     setTimeout(function () {
         getLodop();
     }, 800);
-    $("#jmtj_table").hide();
+    $("#detailed_table").hide();
     $(".selectpicker").selectpicker({
         dropuAuto: false
     });
@@ -14,11 +17,7 @@ $(function () {
     //初始化页面上面的按钮事件
     $("#btn_search").click(function (t) {
         $('.sjh').remove();
-        if ($('#drugFlagSearch').val() == 0) {
-            getSendDrugRecordData();
-        } else {
-            getSpiritAnestheticPrintData();
-        }
+        getRecordData();
     });
     $('#btn_clean').click(function () {
         cleanParams();
@@ -27,179 +26,91 @@ $(function () {
         print();
     });
     $("#btn_excel").click(function (t) {
-        let id = "qbtj_table";
-        let name = "药品发药明细统计表";
-        if ($("#qbtj_table").is(':hidden')) {
-            id = "jmtj_table";
-            let drugFlag = $("#drugFlagSearch").val();
-            if (drugFlag == 1) {
-                name = "麻、精一及麻黄碱类药品使用登记";
-            } else if (drugFlag == 2) {
-                name = "终止妊娠药统计";
-            } else if (drugFlag == 3) {
-                name = "精二类统计";
+        let classMethod = $("#classMethod").val();
+        let statisticalMethod = $("#statisticalMethod").val();
+        let id = "";
+        let title = "药品发药明细统计表";
+        if (classMethod === "0") {
+            id = 'sum_table';
+            if (statisticalMethod === "0") {
+                title = "药品供应商商情报告";
+            } else {
+                title = "药品购入统计表(供应商)";
+            }
+        } else {
+            id = 'detailed_table';
+            if (statisticalMethod === "0") {
+                title = "药品生产厂家商情报告";
+            } else {
+                title = "药品购入统计表(生产厂家)";
             }
         }
         $("#" + id).table2excel({
             exclude: ".exclHide",
-            filename: name + "(" + getRePortRangeArr()[0].substring(0, getRePortRangeArr()[0].indexOf(" ") + 1) + ").xls"
+            filename: title + "(" + getRePortRangeArr()[0].substring(0, getRePortRangeArr()[0].indexOf(" ") + 1) + ").xls"
         })
     });
-    $("#drugFlagSearch").change(function (t, d, e) {
-        let drugFlag = $("#drugFlagSearch").val();
+    $("#classMethod,#statisticalMethod").change(function (t, d, e) {
+        let classMethod = $("#classMethod").val();
+        let statisticalMethod = $("#statisticalMethod").val();
         let title = "";
-        if (drugFlag == 1) {
-            title = "麻、精一及麻黄碱类药品使用登记";
-            $("#jmtj_table").show();
-            $("#qbtj_table").hide();
-        } else if (drugFlag == 2) {
-            title = "终止妊娠药统计";
-            $("#jmtj_table").show();
-            $("#qbtj_table").hide();
-        } else if (drugFlag == 3) {
-            title = "精二类统计";
-            $("#jmtj_table").show();
-            $("#qbtj_table").hide();
-        } else if (drugFlag == 0) {
-            title = "药品发药明细统计表";
-            $("#qbtj_table").show();
-            $("#jmtj_table").hide();
+        if (classMethod === "0") {
+            if (statisticalMethod === "0") {
+                title = "药品供应商商情报告";
+                $("#sum_table").show();
+                $("#detailed_table").hide();
+            } else {
+                title = "药品购入统计表(供应商)";
+                $("#sum_table").hide();
+                $("#detailed_table").show();
+            }
+        } else {
+            if (statisticalMethod === "0") {
+                title = "药品生产厂家商情报告";
+                $("#sum_table").show();
+                $("#detailed_table").hide();
+            } else {
+                title = "药品购入统计表(生产厂家)";
+                $("#sum_table").hide();
+                $("#detailed_table").show();
+            }
         }
         $(".title").html(title);
         $(".dateRange").html($('#reportrange span').html());
         $(".printDate").html(format(new Date(), "yyyy-MM-dd HH:mm"));
     });
-
-    //初始化药品查询弹出框
-    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>',
-        'searchTextDrug', 700, 250);
-    $('#searchTextDrug').on('input focus', function (e) {
-        showDrugPopover({
-            data: {
-                searchTextDrug: $("#searchTextDrug").val() == "" ? null : $("#searchTextDrug").val()
-            },
-            columns: [
-                {
-                    field: 'delFlag',
-                    title: '已作废',
-                    align: "center",
-                    valign: 'middle',
-                    formatter: function (value, row, index) {
-                        return value == 1 ? '<span style="color: red">是</span>' : '否';
-                    }
-                }]
-        });
-        if ($('#searchTextDrug').val() == '') {
-            $('#codeSearch').val("");
-            $('#serialSearch').val("");
-        }
-    });
 });
 
 
 /**
- * 获取精麻药统计报表
+ * 获取汇总药品统计报表
  */
-function getSpiritAnestheticPrintData() {
-    $(".dateRange").html($('#reportrange span').html());
-    $(".printDate").html(format(new Date(), "yyyy-MM-dd HH:mm"));
-    $.ajax({
-        type: "GET",
-        url: '/thmz/getSpiritAnestheticPrint',
-        contentType: "application/json;charset=UTF-8",
-        dataType: "json",
-        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-        data: queryParams(),
-        success: function (res) {
-            if (res == '401' || res == 401) {
-                window.location.href = '/thmz/login/view'
-                return;
-            }
-            if (res.code == 0) {
-                let html = '';
-                let code = '';
-                let number = 0;
-                let sex;
-                let drugFlag = $("#drugFlagSearch").val();
-                for (var i = 0; i < res.data.length; i++) {
-                    let data = res.data[i];
-                    if (code == '') {
-                        code = data.chargeItemCode;
-                        number += parseFloat(data.quantity);
-                    } else if (code == data.chargeItemCode) {
-                        number += parseFloat(data.quantity);
-                    } else {
-                        html += '<tr class="sjh">';
-                        html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>';
-                        html += '</tr>';
-                        code = data.chargeItemCode;
-                        number = parseFloat(data.quantity);
-                    }
-                    if (data.sex == 1) {
-                        sex = "男"
-                    } else if (data.sex == 2) {
-                        sex = "女"
-                    } else {
-                        sex = "未知"
-                    }
-                    html += '<tr class="sjh">';
-                    html += '<td class="xtd" style="text-align: center;mso-number-format: \'\\@\';">' + data.chargeDate.substring(5, 11) + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.patientId + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.name + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + sex + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.age + '</td>';
-                    html += '<td style="mso-number-format: \'\\@\';">' + data.socialNo + '</td>';
-                    html += '<td>' + data.icdText + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.chargeItemCode + '</td>';
-                    html += '<td>' + data.drugname + '</td>';
-                    html += '<td>' + data.specification + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>';
-                    html += '<td style="text-align: center;">' + data.chargeDate + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.employeeName + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>';
-                    html += '<td class="xtd" ></td>';
-                    html += '<td class="xtd" ></td>';
-                    html += '</tr>';
-                }
-                html += '<tr class="sjh">';
-                html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>';
-                html += '</tr>';
-                $("#jmtj_table").append(html);
-            } else if (res.code == -1) {
-                new PNotify({
-                    title: '错误提示',
-                    text: res.message,
-                    type: 'error',
-                    hide: true,
-                    styling: 'bootstrap3'
-                });
-            }
-        }
-    });
-}
-
-/**
- * 获取所有药品类型统计报表
- */
-function getSendDrugRecordData() {
+function getRecordData() {
+    let classMethod = $('#classMethod').val();
+    let statisticalMethod = $('#statisticalMethod').val();
+    let flag = '';
+    if (classMethod === "0") {
+        flag = (statisticalMethod === "0" ? 0 : 2)
+    } else {
+        flag = (statisticalMethod === "0" ? 1 : 3)
+    }
+    let data = {
+        'beginDate': getRePortRangeArr()[0],
+        'endDate': getRePortRangeArr()[1],
+        'flag': flag,
+    };
     $('#YWaitDialog').css('top', $('.xtd').offset().top);
     $('#YWaitDialog').show();
     $(".dateRange").html($('#reportrange span').html());
+    $(".groupName").html(getGroupName(groupYk));
     $(".printDate").html(format(new Date(), "yyyy-MM-dd HH:mm"));
     $.ajax({
         type: "POST",
-        url: '/thmz/getSendDrugRecord',
+        url: '/thmz/getDrugPurchaseSituation',
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-        data: JSON.stringify({
-            'beginDate': getRePortRangeArr()[0],
-            'endDate': getRePortRangeArr()[1],
-            'chargeCode': $('#codeSearch').val() == '' ? null : $('#codeSearch').val(),
-            'serial': $('#serialSearch').val() == '' ? null : $('#serialSearch').val(),
-            'warnDept': $('#unitCodeSearch').val() != null ? $('#unitCodeSearch').val()[0] : null,
-            'queryScope': $("#queryScopeSearch").val()
-        }),
+        data: JSON.stringify(data),
         success: function (res) {
             $('#YWaitDialog').hide();
             if (res == '401' || res == 401) {
@@ -207,68 +118,66 @@ function getSendDrugRecordData() {
                 return;
             }
             if (res.code == 0) {
+                console.log(res.data);
                 let html = '';
-                let flag = '';//区分门诊住院 -1住院 其它门诊
-                let number = 0;
-                let totalNumber = 0;
-                let sex;
+                let packRetpriceSum = 0;
+                let buyPriceSum = 0;
+                let totalPackRetpriceSum = 0;
+                let totalBuyPriceSum = 0;
                 for (var i = 0; i < res.data.length; i++) {
                     let data = res.data[i];
-                    if (flag == '') {
-                        flag = data.id.indexOf("-") != -1 ? '0' : '1';
-                        number += parseFloat(data.quantity);
-                    } else if (flag == (data.id.indexOf("-") != -1 ? '0' : '1')) {
-                        number += parseFloat(data.quantity);
-                    } else {
+                    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="11" style="text-align: right;font-weight: 700;">小计:' + number + '</td>';
-                        html += '<td colspan="5"></td>';
+                        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 += '</tr>';
-                        flag = data.id.indexOf("-") != -1 ? '0' : '1';
-                        totalNumber += number;
-                        number = parseFloat(data.quantity);
+                        totalPackRetpriceSum += packRetpriceSum;
+                        totalBuyPriceSum += buyPriceSum;
+                        packRetpriceSum = 0;
+                        buyPriceSum = 0;
                     }
-                    if (data.sex == 1) {
-                        sex = "男"
-                    } else if (data.sex == 2) {
-                        sex = "女"
+                    packRetpriceSum += data.packRetpriceSum;
+                    buyPriceSum += data.buyPriceSum;
+                    if (flag === 0 || flag === 1) {
+                        html += '<tr class="sjh">';
+                        html += '<td class="xtd" style="text-align: center;">' + (i + 1) + '</td>';
+                        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 += '</tr>';
                     } else {
-                        sex = "未知"
+                        html += '<tr class="sjh">';
+                        html += '<td class="xtd" style="text-align: center;">' + (flag === 2 ? data.supplyName : data.manuName) + '</td>';
+                        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>';
+                        flag === 2 ? $(".mainName").html("供应商") : $(".mainName").html("生产厂家");
                     }
-                    let queryScope = data.id.indexOf("-") != -1 ? '门诊' : '住院';
-                    let age = data.birthDay != null ? getBirthSlot(data.birthDay, new Date()) : '';
-                    html += '<tr class="sjh">';
-                    html += '<td class="xtd" style="text-align: center;">' + data.id + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.name + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + sex + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + age.substring(0, age.indexOf('岁')) + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.warnDeptName + '</td>';
-                    html += '<td>' + data.icdText + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.chargeCode + '</td>';
-                    html += '<td>' + data.drugName + '</td>';
-                    html += '<td>' + data.specification + '</td>';
-                    html += '<td>' + data.abbrName + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.quantity + '</td>';
-                    html += '<td style="text-align: center;">' + data.chargeDate + '</td>';
-                    let doctorName ='';
-                    if(data.employeeName!=null){
-                        doctorName = data.employeeName.trim().substring(0, 1) + new Array(data.employeeName.trim().length).join('*');
+                    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 += '</tr>';
+                        totalPackRetpriceSum += packRetpriceSum;
+                        totalBuyPriceSum += buyPriceSum;
                     }
-                    html += '<td class="xtd" style="text-align: center;">' + doctorName + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.supplyName + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + data.frequency + '</td>';
-                    html += '<td class="xtd" style="text-align: center;">' + queryScope + '</td>';
-                    html += '</tr>';
                 }
                 html += '<tr class="sjh">';
-                html += '<td colspan="11" style="text-align: right;font-weight: 700;">小计:' + number + '</td>';
-                html += '<td colspan="5"></td>';
+                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 += '</tr>';
-                html += '<tr class="sjh">';
-                html += '<td colspan="11" style="text-align: right;font-weight: 700;">总计:' + parseFloat(totalNumber + number) + '</td>';
-                html += '<td colspan="5"></td>';
-                html += '</tr>';
-                $("#qbtj_table").append(html);
+                if (flag === 0 || flag === 1) {
+                    $("#sum_table").append(html);
+                } else {
+                    $("#detailed_table").append(html);
+                }
             } else if (res.code == -1) {
                 new PNotify({
                     title: '错误提示',
@@ -313,20 +222,15 @@ function getRePortRangeArr() {
  * 清空查询条件
  */
 function cleanParams() {
-    $("#queryScopeSearch").val(0);
-    $('#queryScopeSearch').selectpicker('refresh');
-    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00") + ' - ' + moment().format("YYYY-MM-DD 13:59:59"));
-    $('#unitCodeSearch').empty();
-    $('#drugFlagSearch').val(0);
-    $('#qbtj_table').show();
-    $('#jmtj_table').hide();
+    $("#classMethod").val(0);
+    $('#classMethod').selectpicker('refresh');
+    $("#statisticalMethod").val(0);
+    $('#statisticalMethod').selectpicker('refresh');
+    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00") + ' - ' + moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"));
+    $('#sum_table').show();
+    $('#detailed_table').hide();
     $('.sjh').remove();
-    $('#drugFlagSearch').selectpicker('refresh');
-    $("#unitCodeSearch").html('');
-    $("#unitCodeSearch").selectpicker('refresh');
-    $('#searchTextDrug').empty();
-    $('#codeSearch').empty();
-    $('#serialSearch').empty();
+    $('.title').html('药品购入统计表(供应商)');
 }
 
 /**
@@ -336,14 +240,14 @@ function print() {
     setDefaultPrint();
     LODOP = getLodop();
     LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "药品发放统计表");
-    LODOP.SET_PRINT_PAGESIZE(2, 0, 0, "A4");
+    LODOP.SET_PRINT_PAGESIZE(1, 0, 0, "A4");
     //设置默认打印机
     LODOP.SET_PRINTER_INDEX(defaultPrintIndex);
     LODOP.SET_PRINT_STYLE("FontSize", 10); //字体大小
     LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
     //设置默认打印机
     LODOP.SET_PRINTER_INDEX(defaultPrintIndex);
-    LODOP.ADD_PRINT_TEXT('200mm', '140mm', '40mm', '40mm', '第#页/共&页');
+    LODOP.ADD_PRINT_TEXT('280mm', '100mm', '40mm', '40mm', '第#页/共&页');
     LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
     var strStyle = "<style>table,td,th {border-width: 1px;" +
         "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 14px}</style>";
@@ -351,79 +255,3 @@ function print() {
     LODOP.PRINT();
     //LODOP.PREVIEW();
 }
-
-/**
- * 统计列表查询参数
- */
-function queryParams() {
-    let drugFlags = new Array();
-    let flag = $("#drugFlagSearch").val();
-    if (flag == 1) {
-        drugFlags[0] = 2;
-        drugFlags[1] = 3;
-        drugFlags[2] = 5;
-    } else if (flag == 2) {
-        drugFlags[0] = 6;
-    } else if (flag == 3) {
-        drugFlags[0] = 1;
-        drugFlags[1] = 4;
-    }
-    var temp = {
-        beginDate: getRePortRangeArr()[0],
-        endDate: getRePortRangeArr()[1],
-        chargeItemCode: $('#codeSearch').val(),
-        unitCode: $('#unitCodeSearch').val() != null ? $('#unitCodeSearch').val()[0] : '',
-        drugFlags: drugFlags,
-        queryScope: $("#queryScopeSearch").val()
-    };
-    return temp;
-}
-
-function init_daterangepickertime() {
-    if (typeof ($.fn.daterangepicker) === 'undefined') {
-        return;
-    }
-    var optionSet1 = {
-        startDate: moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00"),
-        endDate: moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"),
-        minDate: '2012-01-01',
-        maxDate: nowString() + ' 23:59:59',
-        /*dateLimit: {
-            days: 1200
-        },//起止时间的最大间隔*/
-        showDropdowns: true,
-        showWeekNumbers: true,
-        ranges: {
-            '今天': [moment(), moment()],
-            '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
-            '最近7天': [moment().subtract(6, 'days'), moment()],
-            '最近30天': [moment().subtract(29, 'days'), moment()],
-            '当月': [moment().startOf('month'), moment().endOf('month')],
-            '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
-        },
-        opens: 'right',
-        buttonClasses: ['btn btn-default'],
-        applyClass: 'btn-small btn-primary',
-        cancelClass: 'btn-small',
-        timePicker: true, //显示时间
-        timePicker24Hour: true, //时间制
-        timePickerSeconds: true, //时间显示到秒
-        timePickerIncrement: 1,
-        format: 'YYYY-MM-DD HH:mm:ss',
-        separator: ' to ',
-        locale: {
-            applyLabel: '确定',
-            cancelLabel: '取消',
-            fromLabel: 'From',
-            toLabel: 'To',
-            customRangeLabel: '自定义',
-            daysOfWeek: ['天', '一', '二', '三', '四', '五', '六'],
-            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
-            firstDay: 1
-        }
-    };
-    $('#reportrange').daterangepicker(optionSet1, function (start, end, label) {
-        $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'));
-    });
-    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 00:00:00") + ' - ' + moment().subtract(1, 'days').format("YYYY-MM-DD 23:59:59"));
-}

+ 41 - 76
src/main/resources/templates/yk/drug_purchase_situation.html

@@ -8,10 +8,10 @@
 <script src="/thmz/js/common/date-util.js"></script>
 <script src="/thmz/js/dependent/jquery.webui-popover.min.js"></script>
 <script src="/thmz/js/common/pharmacy-com.js"></script>
-<script src="/thmz/js/yf/drug_purchase_situation.js"></script>
+<script src="/thmz/js/yk/drug_purchase_situation.js"></script>
 <script src="/thmz/js/dependent/jquery.table2excel.min.js"></script>
 <script src="/thmz/js/dependent/LodopFuncs.js"></script>
-<title>精麻药查询统计</title>
+<title>药品购入情况分析</title>
 <!-- 打印的样式-->
 <style media="print">
     @page {
@@ -27,21 +27,9 @@
                     <input type="hidden" id="codeSearch">
                     <input type="hidden" id="serialSearch">
                     <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-3 col-sm-3 col-xs-12">
-                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
-                                   for="queryScopeSearch">查询范围</label>
-                            <div class="col-md-8 col-sm-8 col-xs-12">
-                                <select class="form-control selectpicker show-tick" required="required" title="请选择"
-                                        id="queryScopeSearch">
-                                    <option value="0" selected>全部</option>
-                                    <option value="1">门诊</option>
-                                    <option value="2">住院</option>
-                                </select>
-                            </div>
-                        </div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="reportrange"
                                style="width: 105px;">
-                            出库时间
+                            日期范围
                         </label>
                         <div class="col-md-4 col-sm-4 col-xs-12 " style="width: 325px;">
                             <div id="reportrange" class="pull-left"
@@ -50,32 +38,27 @@
                                 <span>December 30, 2014 - January 28, 2015</span> <b class="caret"></b>
                             </div>
                         </div>
-                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="unitCodeSearch">领药科室
-                        </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
-                            <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择" multiple data-max-options="1"
-                                    id="unitCodeSearch">
-                            </select>
-                        </div>
-                    </div>
-                    <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-3 col-sm-3 col-xs-12">
-                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
-                                   for="drugFlagSearch">药品类型</label>
-                            <div class="col-md-8 col-sm-8 col-xs-12">
+                            <label class="control-label col-md-5 col-sm-5 col-xs-12"
+                                   for="classMethod">分类方式</label>
+                            <div class="col-md-7 col-sm-7 col-xs-12">
                                 <select class="form-control selectpicker show-tick" required="required" title="请选择"
-                                        id="drugFlagSearch">
-                                    <option value="0" selected>全部</option>
-                                    <option value="1">麻、精一及麻黄碱类</option>
-                                    <option value="2">终止妊娠药</option>
-                                    <option value="3">精二</option>
+                                        id="classMethod">
+                                    <option value="0" selected>按供应商</option>
+                                    <option value="1">按制药厂</option>
                                 </select>
                             </div>
                         </div>
-                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="searchTextDrug">药品
-                        </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
-                            <input id="searchTextDrug" class="form-control optional" type="text">
+                            <label class="control-label col-md-5 col-sm-5 col-xs-12"
+                                   for="statisticalMethod">统计方式</label>
+                            <div class="col-md-7 col-sm-7 col-xs-12">
+                                <select class="form-control selectpicker show-tick" required="required" title="请选择"
+                                        id="statisticalMethod">
+                                    <option value="0" selected>汇总</option>
+                                    <option value="1">明细</option>
+                                </select>
+                            </div>
                         </div>
                         <button type="button" id="btn_search" class="btn btn-primary"
                                 title="查询"><i class="glyphicon glyphicon-search"></i>
@@ -93,60 +76,42 @@
                 </form>
             </div>
             <div id="report_table"
-                 style="width:1300px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 14px;padding: 40px 10px 40px 10px;overflow: scroll">
+                 style="width:920px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 14px;padding: 40px 10px 40px 10px;overflow: scroll">
                 <div id="report_table_1">
-                    <table id="qbtj_table" class="table table-striped table-bordered" style="margin-top: 0px;">
+                    <table id="sum_table" class="table table-striped table-bordered" style="margin-top: 0px;">
                         <tr style="font-weight: 700;background-color: #EBEBE4">
-                            <td colspan="16" style="font-size: 21px;text-align: center;border: transparent !important;"><span class="title">药品发药明细统计表</span></td>
+                            <td colspan="6" style="font-size: 21px;text-align: center;border: transparent !important;"><span class="title">药品供应商商情报告</span></td>
                         </tr>
                         <tr style="font-weight: 700;background-color: #EBEBE4">
-                            <td colspan="8" style="text-align: left;border: transparent !important;">日期范围:<span class="dateRange"></span></td>
-                            <td colspan="8" style="text-align: right;border: transparent !important;">打印日期:<span class="printDate"></span></td>
+                            <td colspan="2" style="text-align: left;border: transparent !important;">统计日期:<span class="dateRange"></span></td>
+                            <td colspan="2" style="text-align: right;border: transparent !important;">库房名称:<span class="groupName"></span></td>
+                            <td colspan="2" style="text-align: right;border: transparent !important;">打印日期:<span class="printDate"></span></td>
                         </tr>
                         <tr>
-                            <td class="xtd" style="text-align: center;width: 50px;">病人ID</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">姓名</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">性别</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">年龄</td>
-                            <td class="xtd" style="text-align: center;width: 65px;">科室</td>
-                            <td style="text-align: center;width: 120px;">诊断</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">编码</td>
-                            <td style="text-align: center;width: 80px;">药名</td>
-                            <td style="text-align: center;width: 70px;">规格</td>
-                            <td style="text-align: center;width: 80px;">厂商</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">数量</td>
-                            <td style="text-align: center;width: 45px;">发药日期</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">医师</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">给药方式</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">频率</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">来源</td>
+                            <td class="xtd " style="text-align: center;width: 100px;">序号</td>
+                            <td class="xtd" style="text-align: center;width: 300px;">供应商</td>
+                            <td class="xtd" style="text-align: center;width: 100px;">传票张数</td>
+                            <td class="xtd" style="text-align: center;width: 150px;">采购单号</td>
+                            <td class="xtd" style="text-align: center;width: 125px;">零售金额</td>
+                            <td class="xtd" style="text-align: center;width: 125px;">购入金额</td>
                         </tr>
                     </table>
-                    <table id="jmtj_table" class="table table-striped table-bordered" style="margin-top: 0px;">
+                    <table id="detailed_table" class="table table-striped table-bordered" style="margin-top: 0px;">
                         <tr style="font-weight: 700;background-color: #EBEBE4">
-                            <td colspan="15" style="font-size: 21px;text-align: center;border: transparent !important;"><span class="title">药品发药明细统计表</span></td>
+                            <td colspan="6" style="font-size: 21px;text-align: center;border: transparent !important;"><span class="title">药品购入统计表(生产厂家)</span></td>
                         </tr>
                         <tr style="font-weight: 700;background-color: #EBEBE4">
-                            <td colspan="8" style="text-align: left;border: transparent !important;">日期范围:<span class="dateRange"></span></td>
-                            <td colspan="7" style="text-align: right;border: transparent !important;">打印日期:<span class="printDate"></span></td>
+                            <td colspan="2" style="text-align: left;border: transparent !important;">统计日期:<span class="dateRange"></span></td>
+                            <td colspan="2" style="text-align: right;border: transparent !important;">库房名称:<span class="groupName"></span></td>
+                            <td colspan="2" style="text-align: right;border: transparent !important;">打印日期:<span class="printDate"></span></td>
                         </tr>
                         <tr>
-                            <td class="xtd" style="text-align: center;width: 45px;">日期</td>
-                            <td class="xtd" style="text-align: center;width: 55px;">病人ID</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">姓名</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">性别</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">年龄</td>
-                            <td style="text-align: center;width: 115px;">身份证号</td>
-                            <td style="text-align: center;width: 120px;">诊断</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">编码</td>
-                            <td style="text-align: center;width: 80px;">药名</td>
-                            <td style="text-align: center;width: 70px;">规格</td>
-                            <td class="xtd" style="text-align: center;width: 30px;">数量
-                            <td style="text-align: center;width: 45px;">发药日期</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">医师</td>
-                            <td class="xtd" style="text-align: center;width: 70px;">科室</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">复核人</td>
-                            <td class="xtd" style="text-align: center;width: 45px;">发药人</td>
+                            <td class="xtd mainName" style="text-align: center;width: 200px;">生产厂家</td>
+                            <td class="xtd" style="text-align: center;width: 200px;">药品名</td>
+                            <td class="xtd" style="text-align: center;width: 150px;">规格</td>
+                            <td class="xtd" style="text-align: center;width: 100px;">购入量</td>
+                            <td class="xtd" style="text-align: center;width: 125px;">零售金额</td>
+                            <td class="xtd" style="text-align: center;width: 125px;">购入金额</td>
                         </tr>
                     </table>
                 </div>