Browse Source

挂号费自动获取

lihong 4 tháng trước cách đây
mục cha
commit
5007b90a85

+ 11 - 0
src/main/java/cn/hnthyy/thmz/controller/CommonController.java

@@ -1233,4 +1233,15 @@ public class CommonController {
         String hospitalName = dictDataService.queryHospitalName();
         return R.ok().put("data", hospitalName);
     }
+    /**
+     * @description: 挂号费 只读标识 0可编辑 1只读
+     * @author: lihong
+     * @date: 2025/5/15 10:24
+     * @return: cn.hnthyy.thmz.Utils.R
+     **/
+    @GetMapping("/getGuaHaoFeeReadonly")
+    public R getGuaHaoFeeReadonly(){
+        String ghReadonly = dictDataService.getGuaHaoFeeReadonly();
+        return R.ok().put("data", ghReadonly);
+    }
 }

+ 7 - 0
src/main/java/cn/hnthyy/thmz/service/his/zd/DictDataService.java

@@ -60,4 +60,11 @@ public interface DictDataService {
    * @return: java.lang.String
    **/
   String queryHospitalName();
+  /**
+   * @description: 获取挂号费 只读标识 0可编辑 1只读
+   * @author: lihong
+   * @date: 2025/5/15 10:18
+   * @return: java.lang.String
+   **/
+  String getGuaHaoFeeReadonly();
 }

+ 15 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/DictDataServiceImpl.java

@@ -162,4 +162,19 @@ public class DictDataServiceImpl implements DictDataService {
         }
         return value;
     }
+
+    /**
+     * @description: 获取挂号费 只读标识 0可编辑 1只读
+     * @author: lihong
+     * @date: 2025/5/15 10:18
+     * @return: java.lang.String
+     **/
+    @Override
+    public String getGuaHaoFeeReadonly() {
+        String ghReadonly = queryDictValueNotCach("4.3", "gh_readonly", "");
+        if(StrUtil.isBlank(ghReadonly)){
+            return "0";
+        }
+        return ghReadonly;
+    }
 }

+ 22 - 2
src/main/resources/static/js/mz/request_type.js

@@ -6,7 +6,7 @@ $(function () {
     initMzyZdChargeTypeList();
     initReqTypeSelect();
     initChargeItemSelect();
-
+    intitReqFeeReadonly();
     //新增号段
     $('#btn_add_work_time').click(function () {
         $("#editWorkTimeModalTitle").html("新增号段");
@@ -753,7 +753,7 @@ sortNum = function (a, b) {
     var a = a ? a : -1, b = b ? b : -1
     return a - b
 }
-
+var zdChargeMap;
 // 初始化收费类别
 function initChargeItemSelect(){
     //初始化收费类别
@@ -768,12 +768,32 @@ function initChargeItemSelect(){
                 return;
             }
             var html = '';
+            zdChargeMap = new MyMap();
             $.each(res.data, function (commentIndex, comment) {
+                zdChargeMap.put(comment.code,comment.chargeAmount)
                 html += '<option value="' + comment.code + '">' + comment.name + '[' + comment.chargeAmount + '¥]' + '</option>';
             });
+
             $('#chargeCodeSelect').empty();
             $('#chargeCodeSelect').html(html);
             $('#chargeCodeSelect').selectpicker('destroy').selectpicker('refresh');
         }
     });
+}
+//设置挂号费
+function guaHaoFeeChange() {
+    if(zdChargeMap){
+      let chargeAmount = zdChargeMap.get($("#chargeCodeSelect").val())
+      $("#reqFee").val(chargeAmount)
+    }
+}
+
+function intitReqFeeReadonly() {
+  getAjaxRequst("/thmz/getGuaHaoFeeReadonly",{},true,function (res) {
+    if(res.data =='0'){
+        $("#reqFee").attr("readonly", false);
+    }else {
+        $("#reqFee").attr("readonly", true);
+    }
+  })
 }

+ 4 - 3
src/main/resources/templates/mz/request_type.html

@@ -4,6 +4,7 @@
 <link rel="stylesheet" href="/thmz/css/toll_administration.css">
 <script src="/thmz/js/dependent/bootstrap-select.js"></script>
 <script src="/thmz/js/dependent/daterangepicker.js"></script>
+<script src="/thmz/js/common/map-util.js"></script>
 <script src="/thmz/js/mz/request_type.js"></script>
 <title>号别类型</title>
 <div class="row" style="height: calc(100% - 60px);overflow-y: auto;">
@@ -125,10 +126,10 @@
                     </div>
                     <div class="item form-group thmz_alert">
                         <label class="control-label col-md-4 col-sm-4 col-xs-12" for="reqFee">挂号费 <span
-                                class="required">*</span>
+                                  class="required">*</span>
                         </label>
                         <div class="col-md-6 col-sm-6 col-xs-12">
-                            <input id="reqFee" class="form-control optional" type="number"
+                            <input id="reqFee" class="form-control optional" type="number" readonly
                                    data-validate-length-range="0,10"
                                    placeholder="请输入">
                         </div>
@@ -168,7 +169,7 @@
                         <label class="control-label col-md-4 col-sm-4 col-xs-12" for="chargeCodeSelect">收费类别
                         </label>
                         <div class="col-md-6 col-sm-6 col-xs-12">
-                            <select class="form-control selectpicker show-tick" title="请选择" id="chargeCodeSelect">
+                            <select class="form-control selectpicker show-tick" title="请选择" id="chargeCodeSelect" onchange="guaHaoFeeChange()">
                             </select>
                         </div>
                     </div>