浏览代码

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

优化发药历史处方查看

See merge request lihong/thmz_system!44
huangshuhua 1 年之前
父节点
当前提交
7d6f778c7d

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

@@ -1075,6 +1075,7 @@ function getPageName(pageClass) {
  * code: 编码
  */
 function initSysParametersByCode(code) {
+    let result = '';
     $.ajax({
         type: "get",
         url: '/thmz/getSysParametersByCode',
@@ -1084,6 +1085,7 @@ function initSysParametersByCode(code) {
         data: {
             code: code,
         },
+        async: false,
         success: function (res) {
             if (res === '401' || res === 401) {
                 window.location.href = '/thmz/login/view'
@@ -1091,12 +1093,13 @@ function initSysParametersByCode(code) {
             }
             if (res.code === 0) {
                 if(res.data){
-                    timesLong = res.data;
-                    console.log(res.data)
+                    result = res.data
                 }
             } else {
                 errorMesage(res);
             }
         }
     });
+    console.log(result)
+    return result;
 }

+ 2 - 2
src/main/resources/static/js/mz/west_pharmacy_dispensing.js

@@ -13,7 +13,7 @@ var timer="";
 var printTimer = "";
 var timesLong = 5000;
 $(function () {
-    initSysParametersByCode("mzCfPrintTime")
+    timesLong = parseInt(!initSysParametersByCode('mzCfPrintTime') ? '5000' : initSysParametersByCode('mzCfPrintTime'))
     init_daterangepicker();
     if (groupNo == null || windowsNoYf == null) {
         return errorMesageSimaple('药房参数未设置,请在发药参数设置中设置');
@@ -687,7 +687,7 @@ let count = 0;
  * @param chkValue 1:处方打印 2:药单打印
  */
 function printPrescriptions(chkValue) {
-    if (mzCfPrintIndex == null || ekCfPrintIndex == null || jzCfPrintIndex == null || mzydPrintIndex == null) {
+    if (mzCfPrintIndex == null || ekCfPrintIndex == null || jzCfPrintIndex == null || xtsPrint == null) {
         return errorMesageSimaple('打印机参数未设置,请在发药参数设置中设置');
     }
     $.ajax({

+ 24 - 17
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -6,8 +6,11 @@ var fskPrintIndex = window.localStorage["fskPrintIndex"];
 var winNo = window.localStorage["winNo"];
 var groupNo = window.localStorage["groupNo"];
 let coreId // 病人id
+let mzHistoryDays = 30 // 门诊历史处方前置天数
 $(function () {
     init_daterangepicker();
+    // 查看门诊历史处方前置天数
+    mzHistoryDays = parseInt(!initSysParametersByCode('mzHistoryDays') ? '30' : initSysParametersByCode('mzHistoryDays'))
     $(".selectpicker").selectpicker({
         dropuAuto: false
     });
@@ -35,7 +38,7 @@ $(function () {
     });
 
     $('#btn_clean_history').click(function () {
-        $('#reportRangeList span').html(moment().subtract(30, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
+        $('#reportRangeList span').html(moment().subtract(mzHistoryDays, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
     });
     $("#btn_query_history").click(function (t) {
         callHistoryDetail();
@@ -356,15 +359,15 @@ function initTbTable(pageIndex) {
                 formatter: function (value, row, index) {
                     var str = "";
                     if (sendRefundGroup == 0) {
-                        str = '<button type="button" class="registration-no-color-foot-button" title="打印" onclick="printInjectionOralMedicine(\'' + row.patientId + '\',\'' + row.orderNo + '\',\'' + row.realNo + '\',\'' + row.times + '\',\'' + row.receiptNo + '\',\'' + row.confirmFlag + '\');" style="color: #35D082;"><i class="fa fa-print"></i></button>';
+                        str = '<button type="button" class="btn btn-primary btn-sm" title="打印" onclick="printInjectionOralMedicine(\'' + row.patientId + '\',\'' + row.orderNo + '\',\'' + row.realNo + '\',\'' + row.times + '\',\'' + row.receiptNo + '\',\'' + row.confirmFlag + '\');" style="color: #35D082;">打印 <i class="fa fa-print"></i></button>';
                         if (groupNo === '71' || groupNo === '83') {
-                            str += '<button type="button" class="registration-no-color-foot-button" title="叫号" onclick="callNumber(\'' + row.patientId + '\',\'' + row.name + '\')"><i class="glyphicon glyphicon-bullhorn"></i></button>';
+                            str += '<button type="button" class="btn btn-primary btn-sm" title="叫号" onclick="callNumber(\'' + row.patientId + '\',\'' + row.name + '\')">叫号 <i class="glyphicon glyphicon-bullhorn"></i></button>';
                         }
                         if (row.confirmFlag == 5 || row.confirmFlag == 0) {
-                            str += '<button type="button" class="registration-no-color-foot-button" title="发药" id="sendDrug" onclick="sendMedicineProcessing(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.name + '\')"><i class="fa fa-check-square-o"></i></button>';
+                            str += '<button type="button" class="btn btn-primary btn-sm" title="发药" id="sendDrug" onclick="sendMedicineProcessing(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.name + '\')">发药 <i class="fa fa-check-square-o"></i></button>';
                         }
-                        str += '<button type="button" class="registration-no-color-foot-button" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.confirmFlag + '\')"><i class="fa fa-plus"></i></button>';
-                        str += '<button type="button" class="registration-no-color-foot-button" title="历史处方" onclick="prescriptionHistoryDetail(\'' + row.patientId + '\',\'' + 0 +'\')"><i class="fa fa-eye"></i></button>';
+                        str += '<button type="button" class="btn btn-primary btn-sm" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\',\'' + row.confirmFlag + '\')">详细 <i class="fa fa-plus"></i></button>';
+                        str += '<button type="button" class="btn btn-primary btn-sm" title="历史处方" onclick="prescriptionHistoryDetail(\'' + row.patientId + '\',\'' + 0 +'\')">历史处方 <i class="fa fa-eye"></i></button>';
                     }
                     return str;
                 }
@@ -1743,14 +1746,6 @@ function prescriptionHistoryDetail(patientId, type){
         daterangepickerNew('reportRangeList', 'center');
         initSelectHistory();
     }
-    let rePortRangeArr = getRePortRangeArr1();
-    let temp = {   //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
-        patientId: patientId,
-        beginTime: rePortRangeArr[0],
-        endTime: rePortRangeArr[1],
-        // pageSize: params.limit,   //页面大小
-        // pageIndex: params.offset / params.limit,  //页码
-    };
     $('#tb_table_history').bootstrapTable("destroy");
     $historyTable = $('#tb_table_history').bootstrapTable({
         url: '/thmz/getMzBlRecordList',         //请求后台的URL(*)
@@ -1761,11 +1756,11 @@ function prescriptionHistoryDetail(patientId, type){
         pagination: true,                   //是否显示分页(*)
         sortable: true,                     //是否启用排序
         sortOrder: "desc",                   //排序方式
-        queryParams: temp,           //传递参数(*)
+        queryParams: queryDataS,           //传递参数(*)
         sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*)
         pageNumber: 1,                       //初始化加载第一页,默认第一页
         pageSize: 5,                       //每页的记录行数(*)
-        pageList: [10, 15, 25, 50, 100],        //可供选择的每页的行数(*)
+        pageList: [5, 10, 15, 25, 30],        //可供选择的每页的行数(*)
         search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
         strictSearch: true,
         showColumns: false,                  //是否显示所有的列
@@ -1996,6 +1991,18 @@ function showMzBlRecordModal(patientId, times, type) {
     });
 }
 
+function queryDataS(params) {
+    var rePortRangeArr = getRePortRangeArr1();
+    var temp = {   //这里的键的名字和控制器的变量名必须一直,这边改动,控制器也需要改成一样的
+        patientId: coreId,
+        beginTime: rePortRangeArr[0],
+        endTime: rePortRangeArr[1],
+        pageSize: params.limit,   //页面大小
+        pageIndex: params.offset / params.limit,  //页码
+    };
+    return temp;
+}
+
 function getRePortRangeArr1() {
     var rePortRange = $('#reportRangeList span').html();
     var rePortRangeArr = rePortRange.split(" - ");
@@ -2035,7 +2042,7 @@ function clearInput() {
 }
 
 function initSelectHistory() {
-    $('#reportRangeList span').html(moment().subtract(30, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
+    $('#reportRangeList span').html(moment().subtract(mzHistoryDays, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
     //select 从后台加载数据,并保留之前选择的内容
     dynamicSelectWithOri("editZd", '/thmz/getAllZdIcdCommonParams?commonParams=',false);
     //过敏源