Sfoglia il codice sorgente

添加维护宣教内容

hsh 6 mesi fa
parent
commit
e48d17ce2e

+ 2 - 2
src/main/java/cn/hnthyy/thmz/controller/mz/YpZdDictController.java

@@ -312,13 +312,13 @@ public class YpZdDictController {
      */
     @UserLoginToken
     @RequestMapping(value = "/saveDrugHealthFlag", method = {RequestMethod.GET})
-    public R saveDrugHealthFlag(@RequestParam("chargeCode") String chargeCode, @RequestParam("healthFlag") String healthFlag){
+    public R saveDrugHealthFlag(@RequestParam("chargeCode") String chargeCode, @RequestParam("healthFlag") String healthFlag, @RequestParam("healthContent") String healthContent){
         if(null == chargeCode || StringUtils.isBlank(chargeCode)){
             R.error().put("code", -1);
             R.error().put("message", "保存药品健康宣教失败, 药品编码缺失!");
             return R.error();
         }
-        int count = ypZdDictService.saveDrugHealthFlag(chargeCode, healthFlag);
+        int count = ypZdDictService.saveDrugHealthFlag(chargeCode, healthFlag, healthContent);
         if(count > 0){
             R.ok().put("code", "0");
             R.ok().put("message", "保存药品健康宣教成功!");

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpZdDict.java

@@ -298,4 +298,6 @@ public class YpZdDict {
     private String buyFlag;
     // 药品健康宣教 1: 是健康宣教
     private String healthFlag;
+    // 药品健康宣教内容
+    private String healthContent;
 }

+ 6 - 6
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDictMapper.java

@@ -30,7 +30,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
             "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
             "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag,health_content" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
     YpZdDict selectYpZdDictByCodeAndSerial(@Param("code") String code, @Param("serial") String serial);
 
@@ -54,7 +54,7 @@ public interface YpZdDictMapper {
                     "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
                     "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
                     "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-                    "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
+                    "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag,health_content" +
                     " from yp_zd_dict WITH(NOLOCK)",
             "<when test='codes!=null'>",
             " where code in",
@@ -85,7 +85,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, yb_comment_city, yb_comment_xnh, ddd_unit, wg_type, fh_name, yb_flag_new, yb_comment_new, rtrim(yb_bl_new)yb_bl_new," +
             "       wjw_ypid, yjj_ypid, rsb_ypid, mz_restrict, isnull(byj_flag,0) byj_flag, national_code, national_name, national_status, match_oper," +
             "       match_date, cancel_match_oper, cancel_match_date, new_name, oper_id, oper_date, uploaded_flag, prescription_limit_days," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code,buy_flag,health_flag,health_content" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} ")
     List<YpZdDict> selectYpZdDictByCode(@Param("code") String code);
 
@@ -138,7 +138,7 @@ public interface YpZdDictMapper {
             "       yb_code_xnh, d.yb_comment_city, d.yb_comment_xnh, d.ddd_unit, d.wg_type, d.fh_name, d.yb_flag_new, d.yb_comment_new, rtrim(d.yb_bl_new)yb_bl_new," +
             "       wjw_ypid, d.yjj_ypid, d.rsb_ypid, d.mz_restrict, isnull(byj_flag,0) byj_flag, d.national_code, d.national_name, d.national_status, d.match_oper," +
             "       match_date, d.cancel_match_oper, d.cancel_match_date, d.new_name, d.oper_id, d.oper_date, d.uploaded_flag, d.prescription_limit_days,d.antitumor_level," +
-            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,d.bar_code,d.buy_flag,d.health_flag " +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,d.bar_code,d.buy_flag,d.health_flag,d.health_content " +
             " from " +
             " (select a.code, max(a.serial)serial" +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) " +
@@ -323,7 +323,7 @@ public interface YpZdDictMapper {
     @Update(" update yp_zd_dict set buy_flag = #{buyFlag} where code = #{code} ")
     int updateYpBuyFlag(@Param("code") String code, @Param("buyFlag") String buyFlag);
 
-    @Update(" update yp_zd_dict set health_flag = #{healthFlag} where code = #{code} ")
-    int saveDrugHealthFlag(@Param("code") String code, @Param("healthFlag") String healthFlag);
+    @Update(" update yp_zd_dict set health_flag = #{healthFlag}, health_content = #{healthContent} where code = #{code} ")
+    int saveDrugHealthFlag(@Param("code") String code, @Param("healthFlag") String healthFlag, @Param("healthContent") String healthContent);
 
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/service/his/yp/YpZdDictService.java

@@ -114,6 +114,6 @@ public interface YpZdDictService {
      * @return
      * @Date 2025/2/18 10:50
      */
-    int saveDrugHealthFlag(String code, String healthFlag);
+    int saveDrugHealthFlag(String code, String healthFlag, String healthContent);
 
 }

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpZdDictServiceImpl.java

@@ -260,7 +260,7 @@ public class YpZdDictServiceImpl implements YpZdDictService {
     }
 
     @Override
-    public int saveDrugHealthFlag(String code, String healthFlag) {
-        return ypZdDictMapper.saveDrugHealthFlag(code, healthFlag);
+    public int saveDrugHealthFlag(String code, String healthFlag, String healthContent) {
+        return ypZdDictMapper.saveDrugHealthFlag(code, healthFlag, healthContent);
     }
 }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/YpZdDictVo.java

@@ -225,4 +225,6 @@ public class YpZdDictVo {
     private String buyFlag;
     // 药品健康宣教 1: 是健康宣教
     private String healthFlag;
+    // 药品健康宣教内容
+    private String healthContent;
 }

+ 12 - 3
src/main/resources/static/js/yk/drug_info.js

@@ -453,7 +453,6 @@ function saveDrugBarCode(){
             barCode: barCode,
         },
     }).then((res) =>{
-        initTable();
         successMesage(res);
     })
 }
@@ -468,25 +467,35 @@ function saveDrugBuyOptions(){
             buyFlag: buyFlag,
         },
     }).then((res) =>{
-        initTable();
         successMesage(res);
     })
 }
 
 function saveDrugHealthFlag(){
     let healthFlag = ''
+    let healthContent = $("#healthContent").val()
     $('input[name="healthFlag"]:checked').each(function (i) {
         healthFlag = $(this).val()
     })
+    if('1' === healthFlag){
+        if(isEmpty(healthContent)){
+            errorMesage({message:'药品健康宣教内容为空,请确认!'});
+            return false;
+        }
+    } else {
+        healthContent = ''
+    }
+
     request({
         method:'GET',
         url: '/saveDrugHealthFlag',
         data: {
             chargeCode: $("#code").val(),
             healthFlag: healthFlag,
+            healthContent: healthContent
         },
     }).then((res) =>{
-        initTable();
+        $("#healthContent").val(healthContent)
         successMesage(res);
     })
 }

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

@@ -653,6 +653,13 @@
                         <input class="form-check-input" type="checkbox" id="healthFlag" name="healthFlag" value="1" >
                         <label class="form-check-label" for="healthFlag">健康宣教</label>
                     </div>
+                    <div class="col-md-4 col-sm-2 col-xs-12 item">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="healthContent">宣教内容
+                        </label>
+                        <div class="col-md-8 col-sm-8 col-xs-12">
+                            <input id="healthContent" name="healthContent" class="form-control col-md-7 col-xs-12" type="text">
+                        </div>
+                    </div>
                 </div>
 
                 <div class="item form-group thmz_alert">