Ver código fonte

新增药品追溯码

hsh 11 meses atrás
pai
commit
a811dda01a
26 arquivos alterados com 1134 adições e 73 exclusões
  1. 38 9
      src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java
  2. 29 0
      src/main/java/cn/hnthyy/thmz/controller/mz/YpZdDictController.java
  3. 37 0
      src/main/java/cn/hnthyy/thmz/controller/yk/YpBaseController.java
  4. 19 1
      src/main/java/cn/hnthyy/thmz/entity/his/yp/SelinfoSold.java
  5. 39 0
      src/main/java/cn/hnthyy/thmz/entity/his/yp/YpBarInfo.java
  6. 1 0
      src/main/java/cn/hnthyy/thmz/entity/his/yp/YpBase.java
  7. 30 7
      src/main/java/cn/hnthyy/thmz/entity/his/yp/YpManuBarCode.java
  8. 2 0
      src/main/java/cn/hnthyy/thmz/entity/his/yp/YpZdDict.java
  9. 4 3
      src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpManuBarCodeMapper.java
  10. 32 5
      src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpZdDictMapper.java
  11. 1 1
      src/main/java/cn/hnthyy/thmz/mapper/his/yz/YzActOrderMapper.java
  12. 9 0
      src/main/java/cn/hnthyy/thmz/service/his/mz/MzDrugTracCodgService.java
  13. 7 0
      src/main/java/cn/hnthyy/thmz/service/his/yp/YpBaseService.java
  14. 2 2
      src/main/java/cn/hnthyy/thmz/service/his/yp/YpInDetlService.java
  15. 10 0
      src/main/java/cn/hnthyy/thmz/service/his/yp/YpZdDictService.java
  16. 71 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzDrugTracCodgServiceImpl.java
  17. 28 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseServiceImpl.java
  18. 20 2
      src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpInDetlServiceImpl.java
  19. 36 0
      src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpZdDictServiceImpl.java
  20. 2 0
      src/main/java/cn/hnthyy/thmz/vo/YpZdDictVo.java
  21. 96 0
      src/main/resources/static/js/common/pharmacy-com.js
  22. 27 0
      src/main/resources/static/js/yk/drug_info.js
  23. 378 36
      src/main/resources/static/js/yk/drug_storage.js
  24. 4 4
      src/main/resources/templates/mz/west_pharmacy_send.html
  25. 10 0
      src/main/resources/templates/yk/drug_info.html
  26. 202 3
      src/main/resources/templates/yk/drug_storage.html

+ 38 - 9
src/main/java/cn/hnthyy/thmz/controller/mz/MzPharmacyController.java

@@ -4,7 +4,15 @@ import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.Utils.TokenUtil;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.entity.MzException;
-import cn.hnthyy.thmz.entity.his.mz.*;
+import cn.hnthyy.thmz.entity.his.mz.Employee;
+import cn.hnthyy.thmz.entity.his.mz.MzBlRecord;
+import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
+import cn.hnthyy.thmz.entity.his.mz.MzDrugTracCodg;
+import cn.hnthyy.thmz.entity.his.mz.MzOrderFrequency;
+import cn.hnthyy.thmz.entity.his.mz.MzPatientMi;
+import cn.hnthyy.thmz.entity.his.mz.MzVisitTable;
+import cn.hnthyy.thmz.entity.his.mz.MzZdSupplyType;
+import cn.hnthyy.thmz.entity.his.mz.PatientAllergenInfo;
 import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
 import cn.hnthyy.thmz.entity.his.yp.YpPdQueue;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
@@ -14,8 +22,16 @@ import cn.hnthyy.thmz.entity.thmz.RadSendRecord;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.enums.ConfirmFlagEnum;
 import cn.hnthyy.thmz.enums.SocketSenderTypeEnum;
-import cn.hnthyy.thmz.mapper.his.zd.ZdAllergenMapper;
-import cn.hnthyy.thmz.service.his.mz.*;
+import cn.hnthyy.thmz.service.his.mz.EmployeeService;
+import cn.hnthyy.thmz.service.his.mz.MzBlRecordService;
+import cn.hnthyy.thmz.service.his.mz.MzChargeDetailService;
+import cn.hnthyy.thmz.service.his.mz.MzDrugTracCodgService;
+import cn.hnthyy.thmz.service.his.mz.MzOrderFrequencyService;
+import cn.hnthyy.thmz.service.his.mz.MzPatientMiService;
+import cn.hnthyy.thmz.service.his.mz.MzPharmacyService;
+import cn.hnthyy.thmz.service.his.mz.MzVisitTableService;
+import cn.hnthyy.thmz.service.his.mz.MzZdSupplyTypeService;
+import cn.hnthyy.thmz.service.his.mz.PatientAllergenInfoService;
 import cn.hnthyy.thmz.service.his.yp.YpBaseYfService;
 import cn.hnthyy.thmz.service.his.yp.YpPdQueueService;
 import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
@@ -25,18 +41,33 @@ import cn.hnthyy.thmz.service.his.zd.ZdAllergenService;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
 import cn.hnthyy.thmz.service.thmz.DispensingSocketService;
 import cn.hnthyy.thmz.service.thmz.DispensingWindowsService;
-import cn.hnthyy.thmz.vo.*;
-import cn.hutool.core.convert.Convert;
+import cn.hnthyy.thmz.vo.ChargeDetailInfoVo;
+import cn.hnthyy.thmz.vo.ChargeDetailPharmacyVo;
+import cn.hnthyy.thmz.vo.ChargeFeeParamsVo;
+import cn.hnthyy.thmz.vo.MzRefundMedicineVo;
+import cn.hnthyy.thmz.vo.MzSendMedicineVo;
+import cn.hnthyy.thmz.vo.PharmacyCellVo;
+import cn.hnthyy.thmz.vo.YpMzFytjVo;
 import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateUtils;
 import org.json.JSONObject;
 import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.web.bind.annotation.*;
+import org.springframework.web.bind.annotation.RequestBody;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
 
 import javax.servlet.http.HttpServletRequest;
 import java.math.BigDecimal;
-import java.util.*;
+import java.util.ArrayList;
+import java.util.Comparator;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Map;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -74,8 +105,6 @@ public class MzPharmacyController {
     private MzBlRecordService mzBlRecordService;
     @Autowired
     private MzYshZdFysmService mzYshZdFysmService;
-    @Autowired
-    private MzDrugWinService mzDrugWinService;
 
     @Autowired
     private YpPdQueueService ypPdQueueService;

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

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.controller.mz;
 
 import cn.hnthyy.thmz.Utils.HttpUtil;
+import cn.hnthyy.thmz.Utils.R;
 import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.his.yp.YpBaseYf;
@@ -251,4 +252,32 @@ public class YpZdDictController {
             return resultMap;
         }
     }
+
+    /**
+     * 保存药品商品码
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/saveDrugBarCodeByBarCode", method = {RequestMethod.GET})
+    public R saveDrugBarCodeByBarCode(@RequestParam("chargeCode") String chargeCode, @RequestParam("barCode") String barCode){
+        if(null == chargeCode || StringUtils.isBlank(chargeCode)){
+            R.error().put("code", -1);
+            R.error().put("message", "保存药品商品码失败, 药品编码缺失!");
+            return R.error();
+        }
+        if(null == barCode || StringUtils.isBlank(barCode)){
+            R.error().put("code", -1);
+            R.error().put("message", "保存药品商品码失败, 药品商品码缺失!");
+            return R.error();
+        }
+        int count = ypZdDictService.saveDrugBarCodeByBarCode(chargeCode, barCode);
+        if(count > 0){
+            R.ok().put("code", "0");
+            R.ok().put("message", "保存药品商品码成功!");
+            return R.ok();
+        }
+        R.error().put("code", -1);
+        R.error().put("message", "保存药品商品码失败!");
+        return R.error();
+    }
+
 }

+ 37 - 0
src/main/java/cn/hnthyy/thmz/controller/yk/YpBaseController.java

@@ -123,4 +123,41 @@ public class YpBaseController {
             return resultMap;
         }
     }
+
+    /**
+     * @Description 根据商品码检索药品信息
+     * @Author hsh
+     * @param
+     * @return
+     * @Date 2024/11/11 9:04
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getYpZdDictBaseByBarCode",method = {RequestMethod.POST})
+    public Map<String,Object> getYpZdDictBaseByBarCode(@RequestBody YpZdDictVo ypZdDictVo){
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(null == ypZdDictVo || StringUtils.isBlank(ypZdDictVo.getSearchText())){
+                resultMap.put("code", 0);
+                resultMap.put("message", "查询药品成功");
+                resultMap.put("data", "");
+                return resultMap;
+            }
+
+            // 替换因拼音隔音符号导致的问题
+            if(null != ypZdDictVo.getSearchText()){
+                ypZdDictVo.setSearchText(ypZdDictVo.getSearchText().replace("'", ""));
+            }
+            //根据药品条形码
+            List<YpZdDictVo> list = ypBaseService.queryYpZdBaseByBarCodeLike(ypZdDictVo);
+            resultMap.put("code", 0);
+            resultMap.put("message", "查询药品成功");
+            resultMap.put("data", list);
+            return resultMap;
+        } catch (Exception e) {
+            log.error("查询药品失败,错误信息{}", e);
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询药品失败");
+            return resultMap;
+        }
+    }
 }

+ 19 - 1
src/main/java/cn/hnthyy/thmz/entity/his/yp/SelinfoSold.java

@@ -2,6 +2,9 @@ package cn.hnthyy.thmz.entity.his.yp;
 
 import lombok.Data;
 
+import java.util.Date;
+import java.util.List;
+
 /**
  * @ClassName SelinfoSold
  * @Author hsh
@@ -237,9 +240,24 @@ public class SelinfoSold {
      * */
     private String pharNo;
 
+    /**
+     * 就诊结算类型(1-医保结算 2-自费结算)
+     * */
+    private String mdtrtSetlType;
+
+    /**
+     * 药品追溯码集合
+     * */
+    private List<String> drugtracinfo;
+
+    /**
+     * 上传标志(0: 未上传  1:已上传  -1: 上传失败)
+     * */
+    private String upFlag;
+
     /**
      * 创建时间
      * */
-    private String createTime;
+    private Date createTime;
 
 }

+ 39 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpBarInfo.java

@@ -0,0 +1,39 @@
+package cn.hnthyy.thmz.entity.his.yp;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+import java.util.Date;
+
+/**
+ * @ClassName YpBarInfo
+ * @Author hsh
+ * @Date 2024/11/6 15:45
+ * @Version 1.0
+ * @Description 药品商品码信息
+ **/
+@Data
+public class YpBarInfo {
+
+    // 药品编码
+    private String chargeCode;
+    // 药品商品码
+    private String barCode;
+    // 品名
+    private String chargeName;
+    // 规格
+    private String specification;
+    // 厂家编码
+    private String manuCode;
+    // 厂家名称
+    private String manuName;
+    // 零售价
+    private BigDecimal packRetprice;
+    // 批准文号
+    private String pzwh;
+    // 标志(1:默认值; -1:无效)
+    private String barFlag;
+    // 创建时间
+    private Date createDate;
+
+}

+ 1 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpBase.java

@@ -1,6 +1,7 @@
 package cn.hnthyy.thmz.entity.his.yp;
 
 
+import cn.hnthyy.thmz.annotation.NotColumn;
 import lombok.Data;
 
 import java.math.BigDecimal;

+ 30 - 7
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpManuBarCode.java

@@ -2,6 +2,8 @@ package cn.hnthyy.thmz.entity.his.yp;
 
 import lombok.Data;
 
+import java.util.Date;
+
 /**
  * 入库药品批号和条码关系实体类
  */
@@ -9,19 +11,40 @@ import lombok.Data;
 public class YpManuBarCode {
 
 	/**
-	 * 入库单号
+	 * 药品编码
 	 */
-  private String inDocuNo;
+  	private String chargeCode;
 	/**
-	 * 药品编码
+	 * 药品追溯码
+	 */
+	private String drugTracCodg;
+	/**
+	 * 药品条形码
+	 */
+	private String barCode;
+	/**
+	 * 入库单号
 	 */
-  private String chargeCode;
+	private String inDocuNo;
 	/**
 	 * 批次编码
 	 */
-  private String manuNo;
+  	private String manuNo;
+	/**
+	 * 拆零标志(0:默认值,未拆零, 整箱;1:拆零)
+	 */
+  	private String clFlag;
+	/**
+	 * 创建人id
+	 */
+	private String createId;
+	/**
+	 * 创建时间
+	 */
+	private Date createDate;
 	/**
-	 * 条码号
+	 * 追溯码条目数
 	 */
-  private String barCode;
+	private Integer quantity;
+
 }

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

@@ -292,4 +292,6 @@ public class YpZdDict {
 
     @NotColumn
     private String groupNo;
+    // 药品商品码
+    private String barCode;
 }

+ 4 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpManuBarCodeMapper.java

@@ -18,7 +18,7 @@ public interface YpManuBarCodeMapper {
      * @return
      */
     @Select("<script>"+
-            "  SELECT charge_code, manu_no, bar_code, in_docu_no FROM yp_manu_bar_code WITH(NOLOCK)"+
+            "  SELECT * FROM yp_manu_bar_code WITH(NOLOCK)"+
             "<where>" +
             "<when test='chargeCode != null'>" +
             " and charge_code = #{chargeCode}" +
@@ -43,9 +43,10 @@ public interface YpManuBarCodeMapper {
      */
     @Insert({
         "<script>",
-        "insert into yp_manu_bar_code (charge_code, manu_no, bar_code, in_docu_no) VALUES ",
+        "insert into yp_manu_bar_code (charge_code, drug_trac_codg, bar_code, in_docu_no, manu_no, cl_flag, create_id, create_date, quantity) VALUES ",
         "<foreach collection='ypManuBarCodes' item='item' index='index' separator=','>",
-        " (#{item.chargeCode,jdbcType=VARCHAR}, #{item.manuNo,jdbcType=VARCHAR}, #{item.barCode,jdbcType=VARCHAR}, #{item.inDocuNo,jdbcType=VARCHAR}) ",
+        " (#{item.chargeCode,jdbcType=VARCHAR}, #{item.drugTracCodg,jdbcType=VARCHAR}, #{item.barCode,jdbcType=VARCHAR}, #{item.inDocuNo,jdbcType=VARCHAR}, #{item.manuNo,jdbcType=VARCHAR}, ",
+        " #{item.clFlag,jdbcType=VARCHAR}, #{item.createId,jdbcType=VARCHAR}, #{item.createDate,jdbcType=TIMESTAMP}, #{item.quantity,jdbcType=SMALLINT}) ",
         "</foreach>",
         "</script>"
     })

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

@@ -1,6 +1,8 @@
 package cn.hnthyy.thmz.mapper.his.yp;
 
+import cn.hnthyy.thmz.entity.his.yp.YpBarInfo;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
+import cn.hnthyy.thmz.vo.YpZdDictVo;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
 import org.apache.ibatis.annotations.Select;
@@ -28,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" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
     YpZdDict selectYpZdDictByCodeAndSerial(@Param("code") String code, @Param("serial") String serial);
 
@@ -52,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" +
+                    "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code" +
                     " from yp_zd_dict WITH(NOLOCK)",
             "<when test='codes!=null'>",
             " where code in",
@@ -83,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" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,bar_code" +
             " from yp_zd_dict WITH(NOLOCK) where code = #{code,jdbcType=VARCHAR} ")
     List<YpZdDict> selectYpZdDictByCode(@Param("code") String code);
 
@@ -102,6 +104,7 @@ public interface YpZdDictMapper {
             "                a.drug_flag  ," +
             "                a.fix_price," +
             "                a.manu_code," +
+            "                a.bar_code," +
             "                a.del_flag," +
             "                a.class_code," +
             "                a.prescription_limit_days," +
@@ -135,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" +
+            "       isnull(fz_flag,0)fz_flag,isnull(is_central_purchase,0)is_central_purchase,purchase_code,drug_control_code,selfpay_prop,d.bar_code " +
             " from " +
             " (select a.code, max(a.serial)serial" +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) " +
@@ -291,6 +294,30 @@ public interface YpZdDictMapper {
      * @Date 2024/1/29 15:15
      */
     @Select(" select count(1) from yz_zd_order_item_confirm where yz_zd_order_item_confirm.order_code = #{code} ")
-    int selectYzOrderItemByCode(String code);
+    int selectYzOrderItemByCode(@Param("code") String code);
+
+    /**
+     * @Description 更新药品商品码
+     * @Author hsh
+     * @param drugBarCode 药品商品码
+     * @return 
+     * @Date 2024/11/6 11:19
+     */
+    @Update(" update yp_zd_dict set bar_code = #{barCode} where code = #{code} ")
+    int updateYpZdDictByBarCode(@Param("code") String code, @Param("barCode") String barCode);
+
+    @Insert(" insert into yp_bar_info (charge_code, bar_code, charge_name, specification, manu_code, manu_name, pack_retprice, pzwh, bar_flag, create_date) " +
+            " values (#{chargeCode}, #{barCode}, #{chargeName}, #{specification}, #{manuCode}, #{manuName}, #{packRetprice}, #{pzwh}, #{barFlag}, #{createDate}" +
+            " ) ")
+    void insertDrugBarInfo(YpBarInfo bar);
+
+    @Select(" select * from yp_bar_info where charge_code = #{chargeCode} and bar_flag = #{barFlag} ")
+    YpBarInfo selectDrugBarCodeByCode(@Param("chargeCode") String chargeCode, @Param("barFlag") String barFlag);
+
+    @Update(" update yp_bar_info set bar_code = #{barCode} where charge_code = #{chargeCode} and bar_flag = #{barFlag} ")
+    void updateDrugBarCodeByCode(@Param("chargeCode") String chargeCode, @Param("barCode") String barCode, @Param("barFlag") String barFlag);
+
+    @Select(" select * from yp_zd_dict where bar_code = #{barCode} ")
+    List<YpZdDictVo> selectYpZdDictListByBarCode(@Param("barCode") String barCode);
 
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yz/YzActOrderMapper.java

@@ -154,7 +154,7 @@ public interface YzActOrderMapper {
             "start_time,end_time,performance_time , confirm_time , drug_flag , status_flag , drug_specification , frequ_code , supply_code , infant_flag ," +
             "physician, signer, serial, ward_code, dept_code, act_order_no) " +
             "VALUES (#{orderName,jdbcType=CHAR},#{enterOper,jdbcType=CHAR},#{drugQuan,jdbcType=FLOAT},#{execUnit,jdbcType=CHAR}," +
-            "#{inpatientNo,jdbcType=CHAR},#{admissTimes,jdbcType=SMALLINT}#{orderCode,jdbcType=CHAR},#{orderTime,jdbcType=TIMESTAMP},#{enterTime,jdbcType=TIMESTAMP}," +
+            "#{inpatientNo,jdbcType=CHAR},#{admissTimes,jdbcType=SMALLINT},#{orderCode,jdbcType=CHAR},#{orderTime,jdbcType=TIMESTAMP},#{enterTime,jdbcType=TIMESTAMP}," +
             "#{startTime,jdbcType=TIMESTAMP},#{endTime,jdbcType=TIMESTAMP},#{performanceTime,jdbcType=TIMESTAMP},#{confirmTime,jdbcType=TIMESTAMP},#{drugFlag,jdbcType=CHAR}," +
             "#{statusFlag,jdbcType=CHAR},#{drugSpecification,jdbcType=CHAR},#{frequCode,jdbcType=CHAR},#{supplyCode,jdbcType=CHAR},#{infantFlag,jdbcType=CHAR}," +
             "#{physician,jdbcType=CHAR},#{signer,jdbcType=CHAR},#{serial,jdbcType=CHAR},#{wardCode,jdbcType=CHAR},#{deptCode,jdbcType=CHAR},#{actOrderNo,jdbcType=FLOAT}")

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/mz/MzDrugTracCodgService.java

@@ -55,4 +55,13 @@ public interface MzDrugTracCodgService {
      * @Date 2024/10/29 15:12
      */
     void changeDrugCodgDataFormTy(MzDrugTracCodg drugTracCodg);
+
+    /**
+     * @Description 存储门诊追溯码药品信息至上传表
+     * @Author hsh
+     * @param
+     * @return
+     * @Date 2024/11/4 16:17
+     */
+    void saveSelinfoSoldLst(MzChargeDetail mzChargeDetail, User user);
 }

+ 7 - 0
src/main/java/cn/hnthyy/thmz/service/his/yp/YpBaseService.java

@@ -83,4 +83,11 @@ public interface YpBaseService {
      * @return
      */
     List<YpZdBaseVo> queryYpZdBase(String groupNo);
+
+    /**
+     * 模糊查询药库药品信息
+     * @param ypZdDictVo
+     * @return
+     */
+    List<YpZdDictVo> queryYpZdBaseByBarCodeLike(YpZdDictVo ypZdDictVo);
 }

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

@@ -147,8 +147,8 @@ public interface YpInDetlService {
 
     /**
      * 新增药品入库批号条码号关联信息
-     * @param ypManuBarCodes
+     * @param ypInDetlVoList
      * @return
      */
-    int saveYpManuBarCodes(List<YpManuBarCode> ypManuBarCodes);
+    int saveYpManuBarCodes(List<YpInDetlVo> ypInDetlVoList, String userId);
 }

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

@@ -88,4 +88,14 @@ public interface YpZdDictService {
      * @return
      */
     List<YpZdDict> queryYpZdDictList(String code);
+
+    /**
+     * @Description 保存药品商品码
+     * @Author hsh
+     * @param drugBarCode 药品商品码
+     * @return
+     * @Date 2024/11/6 11:13
+     */
+    int saveDrugBarCodeByBarCode(String code, String drugBarCode);
+
 }

+ 71 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzDrugTracCodgServiceImpl.java

@@ -1,9 +1,14 @@
 package cn.hnthyy.thmz.service.impl.his.mz;
 
 import cn.hnthyy.thmz.entity.MzException;
+import cn.hnthyy.thmz.entity.his.mz.MzChargeDetail;
 import cn.hnthyy.thmz.entity.his.mz.MzDrugTracCodg;
+import cn.hnthyy.thmz.entity.his.yp.SelinfoSold;
+import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.mapper.his.mz.MzDrugTracCodgMapper;
+import cn.hnthyy.thmz.mapper.his.mz.MzPharmacyMapper;
+import cn.hnthyy.thmz.mapper.his.yp.YpZdDictMapper;
 import cn.hnthyy.thmz.service.his.mz.MzDrugTracCodgService;
 import cn.hnthyy.thmz.vo.MzRefundMedicineVo;
 import cn.hnthyy.thmz.vo.MzSendMedicineVo;
@@ -31,6 +36,12 @@ public class MzDrugTracCodgServiceImpl implements MzDrugTracCodgService {
     @SuppressWarnings("all")
     @Autowired
     private MzDrugTracCodgMapper mzDrugTracCodgMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private MzPharmacyMapper mzPharmacyMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    YpZdDictMapper ypZdDictMapper;
 
     @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     @Override
@@ -122,4 +133,64 @@ public class MzDrugTracCodgServiceImpl implements MzDrugTracCodgService {
             }
         }
     }
+
+    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
+    @Override
+    public void saveSelinfoSoldLst(MzChargeDetail mzChargeDetail, User user) {
+        List<MzSendMedicineVo> cfxxList = mzPharmacyMapper.selectFyclPrescriptionDetail(mzChargeDetail);
+        List<SelinfoSold> soldList = new ArrayList<>();
+        for(MzSendMedicineVo vo : cfxxList){
+            if (Double.parseDouble(vo.getQuantity()) > 0 && !vo.getPaySelf().equals("1")) {
+                SelinfoSold sold = new SelinfoSold();
+                // 上传标志初始化: 0 未/待上传
+                sold.setUpFlag("0");
+                sold.setCreateTime(new Date());
+                // 定点医药机构信息
+                sold.setMedListCodg("NMLC999");
+                sold.setFixmedinsHilistId("");
+                sold.setFixmedinsHilistName("");
+                sold.setFixmedinsBchno("");
+                // 开方医生以及发药医师信息
+                sold.setPrscDrCertType("");
+                sold.setPrscDrCertno("");
+                sold.setPrscDrName(vo.getEmployeeName());
+                sold.setPrscDrNo("");
+                sold.setPharCertType("");
+                sold.setPharCertno("");
+                sold.setPharName(user.getUserName());
+                sold.setPharPracCertNo("");
+                sold.setPharNo("");
+                // 结算信息
+                sold.setHiFeesetlType("");
+                sold.setSetlId("");
+                sold.setMdtrtSn("");
+                sold.setPsnNo("");
+                sold.setPsnCertType("");
+                sold.setCertno("");
+                sold.setPsnName("");
+                sold.setMdtrtSetlType("");
+                // 药品信息
+                YpZdDict yp = ypZdDictMapper.selectYpZdDictByCodeAndSerial(vo.getChargeItemCode(), vo.getSerial());
+                sold.setManuLotnum(yp.getManuCode());
+                sold.setManuDate("");
+                sold.setExpyEnd("");
+                sold.setRxFlag("");
+                sold.setTrdnFlag("");
+                sold.setFinlTrnsPric("");
+                sold.setRxno("");
+                sold.setRxCircFlag("");
+                sold.setRtalDocno("");
+                sold.setStooutNo("");
+                sold.setBchno("");
+                sold.setDrugProdBarc("");
+                sold.setShelfPosi("");
+                sold.setSelRetnCnt("");
+                sold.setSelRetnTime("");
+                sold.setSelRetnOpterName("");
+                sold.setMemo("");
+                sold.setDrugtracinfo(null);
+                soldList.add(sold);
+            }
+        }
+    }
 }

+ 28 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpBaseServiceImpl.java

@@ -76,6 +76,7 @@ public class YpBaseServiceImpl implements YpBaseService {
             BeanUtils.copyProperties(yp, vo);
             YpZdDict ypZdDict = ypZdDictMapper.selectYpZdDictByCodeAndSerial(yp.getChargeCode(), yp.getSerial());
             if(null != ypZdDict){
+                vo.setSpecification(ypZdDict.getSpecification());
                 vo.setPzwh(StringUtils.isBlank(ypZdDict.getPzwh())?"":ypZdDict.getPzwh());
                 vo.setManuCode(ypZdDict.getManuCode());
                 vo.setBuyPrice(ypZdDict.getBuyPrice());
@@ -87,6 +88,7 @@ public class YpBaseServiceImpl implements YpBaseService {
                 vo.setJbFlag(ypZdDict.getJbFlag());
                 vo.setDelFlag(ypZdDict.getDelFlag());
                 vo.setNationalCode(ypZdDict.getNationalCode());
+                vo.setBarCode(ypZdDict.getBarCode());
                 if (StringUtils.isNotBlank(ypZdDict.getManuCode())) {
                     String manufactoryName = ypZdManufactoryService.queryYpZdManufactoryByCode(ypZdDict.getManuCode());
                     vo.setManufactoryName(manufactoryName);//生产厂家
@@ -173,4 +175,30 @@ public class YpBaseServiceImpl implements YpBaseService {
     public List<YpZdBaseVo> queryYpZdBase(String groupNo) {
         return ypBaseMapper.selectYpZdBase(groupNo);
     }
+
+    public List<YpZdDictVo> queryYpZdBaseByBarCodeLike(YpZdDictVo ypZdDictVo) {
+        List<YpZdDictVo> ypZdDictVos = ypZdDictMapper.selectYpZdDictListByBarCode(ypZdDictVo.getSearchText());
+        List<YpZdDictVo> vL = new ArrayList<>();
+        if(null != ypZdDictVos){
+            YpZdDictVo v = new YpZdDictVo();
+            if(ypZdDictVos.size() == 1){
+                if (StringUtils.isNotBlank(ypZdDictVos.get(0).getManuCode())) {
+                    String manufactoryName = ypZdManufactoryService.queryYpZdManufactoryByCode(ypZdDictVos.get(0).getManuCode());
+                    ypZdDictVos.get(0).setManufactoryName(manufactoryName);//生产厂家
+                }
+                BeanUtils.copyProperties(ypZdDictVos.get(0), v);
+            } else {
+                ypZdDictVos.forEach(yp -> {
+                    if("99".equals(yp.getSerial())){
+                        String manufactoryName = ypZdManufactoryService.queryYpZdManufactoryByCode(yp.getManuCode());
+                        yp.setManufactoryName(manufactoryName);//生产厂家
+                        BeanUtils.copyProperties(yp, v);
+                    }
+                });
+            }
+            vL.add(v);
+        }
+        return vL;
+    }
+
 }

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

@@ -160,6 +160,8 @@ public class YpInDetlServiceImpl implements YpInDetlService {
         } else {
             ypInDetlMapper.deleteYpInDetlByInDocuNo(ypInDetlVoList.get(0).getInDocuNo());
         }
+        // 存储药品追溯码信息数据
+        saveYpManuBarCodes(ypInDetlVoList, userId);
         return saveYpInDetlList(ypInDetlVoList, userId,false);
     }
 
@@ -455,8 +457,24 @@ public class YpInDetlServiceImpl implements YpInDetlService {
     }
 
     @Override
-    public int saveYpManuBarCodes(List<YpManuBarCode> ypManuBarCodes) {
-        return ypManuBarCodeMapper.insertYpManuBarCodes(ypManuBarCodes);
+    public int saveYpManuBarCodes(List<YpInDetlVo> ypInDetlVoList, String userId) {
+        if(null == ypInDetlVoList || ypInDetlVoList.isEmpty()){
+            return 0;
+        }
+        List<YpManuBarCode> r = new ArrayList<>();
+        for(YpInDetlVo vo : ypInDetlVoList){
+            List<YpManuBarCode> ypManuBarCodes = vo.getYpManuBarCodes();
+            if(null == ypManuBarCodes || ypManuBarCodes.isEmpty()){
+                continue;
+            }
+            for(YpManuBarCode barCode : ypManuBarCodes){
+                barCode.setInDocuNo(ypInDetlVoList.get(0).getInDocuNo());
+                barCode.setCreateId(userId);
+                barCode.setCreateDate(new Date());
+            }
+            r.addAll(ypManuBarCodes);
+        }
+        return ypManuBarCodeMapper.insertYpManuBarCodes(r);
     }
 
     private List<YpInDetlVo> ypInDetlsToVo(List<YpInDetl> ypInDetls) {

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

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.Utils.ColumnSqlUtil;
 import cn.hnthyy.thmz.Utils.PyWbUtil;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.mz.Employee;
+import cn.hnthyy.thmz.entity.his.yp.YpBarInfo;
 import cn.hnthyy.thmz.entity.his.yp.YpBase;
 import cn.hnthyy.thmz.entity.his.yp.YpPrintName;
 import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
@@ -22,6 +23,7 @@ import org.springframework.transaction.annotation.Propagation;
 import org.springframework.transaction.annotation.Transactional;
 
 import java.util.ArrayList;
+import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 import java.util.Map;
@@ -217,4 +219,38 @@ public class YpZdDictServiceImpl implements YpZdDictService {
         }
         return ypZdDictMapper.selectYpZdDictList(code);
     }
+
+    @Override
+    public int saveDrugBarCodeByBarCode(String chargeCode, String barCode) {
+        YpBarInfo info = ypZdDictMapper.selectDrugBarCodeByCode(chargeCode, "0");
+        if(null == info){
+            List<YpZdDict> yp = ypZdDictMapper.selectYpZdDictByCode(chargeCode);
+            if(null != yp && !yp.isEmpty()){
+                YpBarInfo bar = new YpBarInfo();
+                YpZdDict dict = new YpZdDict();
+                if(yp.size() > 1){
+                    BeanUtils.copyProperties(yp.get(0).getSerial().equals("99") ? yp.get(0) : yp.get(1), dict);
+                } else {
+                    BeanUtils.copyProperties(yp.get(0), dict);
+                }
+                bar.setChargeCode(dict.getCode());
+                bar.setBarCode(barCode);
+                bar.setChargeName(dict.getName());
+                bar.setSpecification(dict.getSpecification());
+                bar.setManuCode(dict.getManuCode());
+                if(StringUtils.isNotBlank(dict.getManuCode())){
+                    String manuName = ypZdManufactoryMapper.selectYpZdManufactoryByCode(dict.getManuCode());
+                    bar.setManuName(manuName);
+                }
+                bar.setPackRetprice(dict.getPackRetprice());
+                bar.setPzwh(dict.getPzwh());
+                bar.setBarFlag("0");
+                bar.setCreateDate(new Date());
+                ypZdDictMapper.insertDrugBarInfo(bar);
+            }
+        } else {
+            ypZdDictMapper.updateDrugBarCodeByCode(chargeCode, barCode, "0");
+        }
+        return ypZdDictMapper.updateYpZdDictByBarCode(chargeCode, barCode);
+    }
 }

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

@@ -219,4 +219,6 @@ public class YpZdDictVo {
      * 抗肿瘤药物级别:1、普通使用级;2、限制使用级
      **/
     private Integer antitumorLevel;
+    // 药品商品码
+    private String barCode;
 }

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

@@ -1111,4 +1111,100 @@ function initSysParametersByCode(code) {
     });
     console.log(result)
     return result;
+}
+
+/**
+ * 优化药品检索下拉框
+ * @param data 数据
+ * @param tableId table的id
+ */
+function showDrugPopoverNew(data, tableId) {
+    let columns = [
+        {
+            field: 'code',
+            title: '编码',
+            align: "center",
+            valign: 'middle'
+        }, {
+            field: 'name',
+            title: '药品名',
+            align: "center",
+            valign: 'middle'
+        }, {
+            field: 'manufactoryName',
+            title: '厂家',
+            align: "center",
+            valign: 'middle'
+        },
+        {
+            field: 'specification',
+            title: '规格',
+            align: "center",
+            valign: 'middle'
+        },
+        {
+            field: 'packRetprice',
+            title: '零售价',
+            align: "center",
+            valign: 'middle'
+        }
+    ];
+    columns = columns.concat(data.columns);
+    $('#' + tableId).bootstrapTable('destroy');
+    $('#' + tableId).bootstrapTable({
+        url: data.url==null?'/thmz/getYp':data.url,         //请求后台的URL(*)
+        method: data.method==null?'GET':data.method,                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: true,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: false,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams: data.data,
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 5,                       //每页的记录行数(*)
+        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: columns,
+        onClickRow: data.onClickRow==null?function (row, $element) {
+            $('#searchTextDrug').webuiPopover('hide');
+            $('#codeSearch').val(row.code);
+            $('#serialSearch').val(row.serial);
+            $('#searchTextDrug').val(row.name);
+        }:data.onClickRow,
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                errorMesage(res);
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": typeof(ress.data) == 'undefined' ? 0 : ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        }
+    });
 }

+ 27 - 0
src/main/resources/static/js/yk/drug_info.js

@@ -27,6 +27,14 @@ $(function () {
         }
         $('#editModal').modal();
     });
+    //商品码按钮点击事件
+    $("#btn_bar").click(function (t) {
+        if(isEmpty($("#code").val())){
+            warningMesageSimaple("请先选择药品!");
+            return;
+        }
+        saveDrugBarCode();
+    });
     $('#editModal').on('shown.bs.modal', function () {
         initTable();
     });
@@ -413,4 +421,23 @@ function formValidator(data) {
         return false;
     }
     return true;
+}
+
+function saveDrugBarCode(){
+    let barCode = $("#barCode").val();
+    if(isEmpty(barCode)){
+        errorMesage({message:'药品商品码为空,请确认!'});
+        return false;
+    }
+    request({
+        method:'GET',
+        url: '/saveDrugBarCodeByBarCode',
+        data: {
+            chargeCode: $("#code").val(),
+            barCode: barCode,
+        },
+    }).then((res) =>{
+        initTable();
+        successMesage(res);
+    })
 }

+ 378 - 36
src/main/resources/static/js/yk/drug_storage.js

@@ -1,5 +1,5 @@
 //@ sourceURL=drug_storage.js
-var groupNo = window.localStorage["groupYk"];//药库编码
+let groupNo = window.localStorage["groupYk"];//药库编码
 $(function () {
     init_daterangepicker();
     $('.datetime').datetimepicker({
@@ -11,6 +11,10 @@ $(function () {
     });
     initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>',
         'drugName', 600, 250);
+    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_drug1"></table></div>',
+        'drugName1', 600, 250);
+    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_bar1"></table></div>',
+        'barCode1', 600, 250);
     initSearchList('<div id="employeePopoverContent"><table id="tb_table_employee"></table></div>',
         'purchaserNameLabel', 300, 250);
     initSearchList('<div id="supplyPopoverContent"><table id="tb_table_supply"></table></div>',
@@ -18,6 +22,13 @@ $(function () {
     $('#drugName').on('input', debounce(e=>{
         inputDrugName()
     },500));
+    $('#drugName1').on('input', debounce(e=>{
+        inputDrugName1()
+    },500));
+    //商品码检索药品
+    $('#barCode1').on('input', debounce(e=>{
+        inputBarCode()
+    },500));
     function inputDrugName() {
         showDrugPopover({
             method: 'POST',
@@ -52,6 +63,101 @@ $(function () {
             }
         });
     };
+    function inputDrugName1() {
+        showDrugPopoverNew({
+            method: 'POST',
+            data: JSON.stringify({
+                searchText: $("#drugName1").val() == "" ? null : $("#drugName1").val(),
+                groupNo: groupNo,
+                delFlag: 0
+            }),
+            url: '/thmz/getYpZdDictBase',
+            columns: [
+                {
+                    field: 'barCode',
+                    title: '商品码',
+                    align: "center",
+                    valign: 'middle'
+                },{
+                    field: 'stockAmount',
+                    title: '库存',
+                    align: "center",
+                    valign: 'middle',
+                    formatter: function (value, row, index) {
+                        return value.toFixed(0);
+                    }
+                }],
+            onClickRow: function (row, $element) {
+                $('#drugName1').webuiPopover('hide');
+                $('#chargeCode1').val(row['code']);
+                $('#serial1').val(row['serial']);
+                $('#drugName1').val(row['name']);
+                $('#barCode1').val(row['barCode']);
+                $('#specification1').val(row['specification']);
+                $('#packRetprice1').val(row['packRetprice']);
+                $('#buyPrice1').val(row['buyPrice']);
+                $('#manufactoryName1').val(row['manufactoryName']);
+                $('#manuCode1').val(row['manuCode']);
+                $('#licenseNo1').val(row['pzwh']);
+                $('#nationalCode1').val(row['nationalCode']);
+                $('#buyAmt1').val(null);
+                $('#buyValue1').val(null);
+                $('#manuNo1').val('');
+                $('#producingDate1').val(null);
+                $('#effDate1').val(null);
+            }
+        }, 'tb_table_drug1');
+    };
+    //商品码检索药品明细
+    function inputBarCode() {
+        showDrugPopoverNew({
+            method: 'POST',
+            data: JSON.stringify({
+                searchText: $("#barCode1").val() == "" ? null : $("#barCode1").val(),
+                groupNo: groupNo,
+                delFlag: 0
+            }),
+            url: '/thmz/getYpZdDictBaseByBarCode',
+            columns: [
+                {
+                    field: 'barCode',
+                    title: '商品码',
+                    align: "center",
+                    valign: 'middle'
+                },{
+                    field: 'stockAmount',
+                    title: '库存',
+                    align: "center",
+                    valign: 'middle',
+                    formatter: function (value, row, index) {
+                        if(!isEmpty(value)){
+                            return value.toFixed(0);
+                        } else {
+                           return value;
+                        }
+                    }
+                }],
+            onClickRow: function (row, $element) {
+                $('#barCode1').webuiPopover('hide');
+                $('#chargeCode1').val(row['code']);
+                $('#serial1').val(row['serial']);
+                $('#drugName1').val(row['name']);
+                $('#barCode1').val(row['barCode']);
+                $('#specification1').val(row['specification']);
+                $('#packRetprice1').val(row['packRetprice']);
+                $('#buyPrice1').val(row['buyPrice']);
+                $('#manufactoryName1').val(row['manufactoryName']);
+                $('#manuCode1').val(row['manuCode']);
+                $('#licenseNo1').val(row['pzwh']);
+                $('#nationalCode1').val(row['nationalCode']);
+                $('#buyAmt1').val(null);
+                $('#buyValue1').val(null);
+                $('#manuNo1').val('');
+                $('#producingDate1').val(null);
+                $('#effDate1').val(null);
+            }
+        }, 'tb_table_bar1');
+    };
     $('#purchaserNameLabel').on('input focus', function (e) {
         showEmployeePopover({
             data: {
@@ -94,6 +200,12 @@ $(function () {
     $('#buyPrice').on('input focus', function (e) {
         $("#buyValue").val((e.target.value * $("#buyAmt").val()).toFixed(2));
     });
+    $('#buyAmt1').on('input focus', function (e) {
+        $("#buyValue1").val((e.target.value * $("#buyPrice1").val()).toFixed(2));
+    });
+    $('#buyPrice1').on('input focus', function (e) {
+        $("#buyValue1").val((e.target.value * $("#buyAmt1").val()).toFixed(2));
+    });
     $('#reportrange span').html(moment().subtract(29, 'days').format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
     $(".selectpicker").selectpicker();
     if (groupNo == null) {
@@ -156,6 +268,7 @@ $(function () {
         ypInDetlVoList[0].supplyCode = $("#supplyCode").val();
         ypInDetlVoList[0].inDocuNo = $("#inDocuNoLabel").val();
         ypInDetlVoList[0].groupNo = groupNo;
+        ypInDetlVoList[0].ypManuBarCodes = $("#tb_bar_code").getRowData();
         request({
             url: '/saveYpInDetlList',
             method: 'POST',
@@ -196,6 +309,78 @@ $(function () {
     $("#btn_daily").click(function (t) {
         setPrintHtml();
     });
+    // 确认药品追溯码集合
+    $("#saveBarList").click(function () {
+        if(barC === 1){
+            return errorMesageSimaple('当前扫码未进行追溯码检查,请检查!');
+        }
+        // 有重复错误追溯码信息
+        if(barFor){
+            return errorMesageSimaple('当前扫码有重复或者错误追溯码信息,请检查!');
+        }
+        let barList = $("#drugTracCodgStr").val();
+        let rowid = $('#rowid2').val();
+        let buyAmt2 = $("#buyAmt2").val();
+        if(!isEmpty(barList)){
+            let str = removeLastComma(barList.replaceAll('\n', ','), ',');
+            let clFlag = $('#clFlag').val()
+            if(clFlag === '1'){
+                if(Number.parseInt(buyAmt2) !== str.split(',').length){
+                    return errorMesageSimaple('当前入库单数量与扫码数量不一致,请检查!');
+                }
+            } else if(clFlag === '0'){
+                if(1 !== str.split(',').length){
+                    return errorMesageSimaple('当前入库单数量与扫码数量不一致,请检查!');
+                }
+            }
+            // 更新追溯码内容
+            $("#tb_bar_code").setCell(rowid, 'drugTracCodg', str);
+            // 更新追溯码扫码数量
+            $("#tb_bar_code").setCell(rowid, 'quantity', str.split(',').length);
+            $("#tb_bar_code").setCell(rowid, 'clFlag', clFlag);
+            $("#tb_bar_code").setCell(rowid, 'clFlagName', clFlag);
+            $("#tb_bar_code").saveRow(rowid);
+        }
+        $("#barListModal").modal('hide');
+    })
+    // 添加药品追溯码入库信息
+    $("#addDetailedForBar").click(function () {
+        if ($("#checkerName1").val() === '') {//新增
+            let formData = $("#tb_bar_code").jqGrid("getRowData");
+            formData.forEach(function (item, index, arr) {
+                $("#tb_table_detailed").jqGrid('addRowData', index + 1, item);
+                $("#tb_table_detailed").jqGrid('editRow', index + 1);
+            })
+        } else {//修改
+            let ids = $("#tb_bar_code1").jqGrid("getDataIDs");//得到jqgrid当前行数
+            let rowid = Math.max.apply(Math,ids);//获得当前最大行号
+            if(rowid == "-Infinity"){
+                rowid = 0;
+            }
+            $("#tb_bar_code1").saveRow(rowid);//取消最后一行的编辑状态
+            let form = $("#barForm").serializeObject();
+            form.inDocuNo = $("#inDocuNoLabel").val();
+            form.purchaser = $("#purchaser").val();
+            form.supplyCode = $("#supplyCode").val();
+            form.groupNo = groupNo;
+            form.ypManuBarCodes = $("#tb_bar_code").getRowData();
+            request({
+                url: '/modifYpInDetl',
+                method: 'POST',
+                data: JSON.stringify(form)
+            }).then((res) => {
+                successMesage(res);
+                loadDetailed(form.inDocuNo);
+            });
+        }
+        $("#barFormModal").modal("hide");
+    });
+
+    // 追溯码检查
+    $("#checkBarList").click(function () {
+        drugBarStat();
+    });
+
 });
 
 /**
@@ -572,6 +757,7 @@ function initDetailed() {
         }
     });
     $("#t_tb_table_detailed").append("<button class='registration-no-color-foot-button' title='新增药品' id='showDetailed' style='color: #35D082;margin-left: 10px;'><i class='fa fa-plus'></i></button>");
+    $("#t_tb_table_detailed").append("<button class='registration-no-color-foot-button' title='新增入库信息' id='showDrugBarDetailed' style='color: #35D082;margin-left: 10px;'><i class='fa fa-plus-square'></i></button>");
     $("#t_tb_table_detailed").append("<button class='registration-no-color-foot-button' title='删除药品' id='removeDetailed'  style='color: red;margin-left: 10px;'><i class='fa fa-trash-o'></i></button>");
     $("#showDetailed").on('click', function () {
         $("#detailedForm")[0].reset();
@@ -588,6 +774,24 @@ function initDetailed() {
             $("#reptDate").val(null);
         }
     });
+    // 增加入库信息扫入
+    $("#showDrugBarDetailed").on('click', function () {
+        $("#barForm")[0].reset();
+        $("#barFormModal").modal("show");
+        $("#div_bar_code").show();
+        $("#chargeCode1").val('');
+        $("#manuNo1").attr("disabled",false);
+        $("#confirmFlag").val()===1 ? $("#addDetailed").attr("disabled",true) : $("#addDetailed").attr("disabled",false);
+        let rowData = $("#tb_table_detailed").jqGrid("getRowData")[0];
+        if(rowData){
+            $("#reptNo1").val(rowData['reptNo']);
+            $("#reptDate1").val(rowData['reptDate']);
+        }else{
+            $("#reptNo1").val(null);
+            $("#reptDate1").val(null);
+        }
+        $("#tb_bar_code").jqGrid('clearGridData');
+    });
     $("#removeDetailed").on('click', function () {
         if($("#confirmFlag").val() == 1){
             return errorMesageSimaple('已审核,禁止操作!');
@@ -640,34 +844,88 @@ function initBar() {
         autoScroll: true,
         shrinkToFit: true,
         rowNum: -1,//取消分页
-        caption: '',
         cellEdit: true,
+        classes: {
+            // 为选中行添加的CSS类
+            "ui-state-highlight": "your-custom-class"
+        },
         sortable: false,
         loadonce: true, //一次加载全部数据到客户端,由客户端进行排序。
         cellsubmit: "clientArray",
         caption: '入库药品关联条码',
         rownumbers: true,//是否显示序号
-        multiselect: true,
-        multiboxonly:true,
-        colNames: ['入库单号','批号','药品编码','追溯码'],
+        // multiselect: true,
+        // multiboxonly: true,
+        // multiselectWidth: 60,
+        colNames: ['药品编码','药品名称','商品码','追溯码','追溯码数量','批号','入库单号','1','是否拆零','2','3','4','5','6','7','8','9','10','11','12','13','14','15','16','17','18'],
         colModel: [
+            {name: 'chargeCode', index: 'chargeCode', align: 'center', width: 120,sortable: false},
+            {name: 'drugName', index: 'drugName', align: 'left', width: 160,sortable: false},
+            {name: 'barCode', index: 'barCode', align: 'center', width: 120,sortable: false},
+            {name: 'drugTracCodg', index: 'drugTracCodg', align: 'left', width: 200,sortable: false},
+            {name: 'quantity', index: 'quantity', align: 'center', width: 120,sortable: false},
+            {name: 'manuNo', index: 'manuNo', align: 'center', width: 150,sortable: false},
             {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'}
+            {name: 'clFlag', index: 'clFlag',align: 'center', width: 100,hidden: true},
+            {name: 'clFlagName', index: 'clFlagName',align: 'center', width: 100,sortable: false,
+                formatter: function (cellvalue, options, rowObject) {
+                    if(isEmpty(cellvalue)){
+                        return '';
+                    } else {
+                        return cellvalue === '0' ? '否' : '是';
+                    }
+                }
+            },
+            {name: 'manufactoryName', index: 'manufactoryName',hidden: true},
+            {name: 'specification', index: 'specification',hidden: true},
+            {name: 'packRetprice', index: 'packRetprice',hidden: true},
+            {name: 'buyAmt', index: 'buyAmt',hidden: true},
+            {name: 'buyPrice', index: 'buyPrice',hidden: true},
+            {name: 'effDate', index: 'effDate',hidden: true},
+            {name: 'producingDate', index: 'producingDate',hidden: true},
+            {name: 'manuNo', index: 'manuNo',hidden: true},
+            {name: 'reptNo', index: 'reptNo',hidden: true},
+            {name: 'reptDate', index: 'reptDate',hidden: true},
+            {name: 'licenseNo', index: 'licenseNo',hidden: true},
+            {name: 'nationalCode', index: 'nationalCode',hidden: true},
+            {name: 'serial', index: 'serial',hidden: true},
+            {name: 'manuCode', index: 'manuCode',hidden: true},
+            {name: 'inSeri', index: 'inSeri',hidden: true},
+            {name: 'inType', index: 'inType',hidden: true},
+            {name: 'fpDate', index: 'fpDate',hidden: true},
         ],
         jsonReader: {
             root: "data", repeatitems: false
         },
-        afterSubmitCell: function() {
+        afterSubmitCell: function(rowid, cellname, value, iRow, iCol) {
             $("#tb_bar_code").setCell(rowid, iCol, value);
             return true; // 必须返回 ture  or false,否则 下面的  afterSaveCell 方法执行不了的
         },
         afterSaveCell: function (rowid, celname, value, iRow, iCol) {
             $("#tb_bar_code").setCell(rowid, iCol, value);
+            return true;
         },
         onCellSelect: function (rowid, iCol, cellcontent, e) {
             $("#tb_bar_code #jqg_tb_bar_code_" + rowid).prop("checked", true);//打钩
+            if(iCol === 4){
+                let rowData = $("#tb_bar_code").jqGrid("getRowData", rowid);
+                $("#barListForm")[0].reset();
+                $("#barListModal").modal("show");
+                $('#chargeCode2').val(rowData['chargeCode']);
+                $('#buyAmt2').val(rowData['buyAmt']);
+                $('#quantity2').val(rowData['quantity']);
+                $('#drugName2').val(rowData['drugName']);
+                $('#barCode2').val(rowData['barCode']);
+                if(!isEmpty(rowData['drugTracCodg'])){
+                    let str = (rowData['drugTracCodg'] + ',').replaceAll(',', '\n');
+                    $('#drugTracCodgStr').val(str);
+                }
+                $('#rowid2').val(rowid);
+            }
+        },
+        beforeSelectRow: function(rowid, e) {
+            // 阻止行选择
+            return true;
         },
         beforeEditCell: function(rowid,iCol,cellcontent,e){
         },
@@ -688,29 +946,39 @@ function initBar() {
             }
         }
     });
-    $("#t_tb_bar_code").append("<button class='registration-no-color-foot-button' title='新增条码' id='addBarCode' style='color: #35D082;margin-left: 10px;'><i class='fa fa-plus'></i></button>");
+    $("#t_tb_bar_code").append("<button class='registration-no-color-foot-button' title='添加药品' id='addBarCode' style='color: #35D082;margin-left: 10px;'><i class='fa fa-plus'></i></button>");
     $("#t_tb_bar_code").append("<button class='registration-no-color-foot-button' title='删除条码' id='removeBarCode'  style='color: red;margin-left: 10px;'><i class='fa fa-trash-o'></i></button>");
-    $("#t_tb_bar_code").append("<input id='barCode' name='barCode' type='text' style='margin-left: 10px;' autocomplete='off' placeholder='扫描条码...'>");
+    // $("#t_tb_bar_code").append("<input id='barCode' name='barCode' type='text' style='margin-left: 10px;' autocomplete='off' placeholder='扫描条码...'>");
     $("#addBarCode").on('click', function () {
-        if(isEmpty($("#chargeCode").val())){
+        if(isEmpty($("#chargeCode1").val())){
             return errorMesageSimaple('药品编码为空,请重新设置药品!');
         }
-        var ids = $("#tb_bar_code").jqGrid("getDataIDs");//得到jqgrid当前行数
-        var rowid = Math.max.apply(Math,ids);//获得当前最大行号
-        if(rowid == "-Infinity"){
-            rowid = 0;
+        let barDataList = $("#tb_bar_code").jqGrid("getGridParam").data;//得到jqgrid当前行数
+        let rowid = barDataList.length
+        if(barDataList.length !== 0 ){
+            // 因为新增的数据都是放在首行,所以id最大的是第一行数据
+            rowid = Number.parseInt(barDataList[0].id) + 1
         }
         $("#tb_bar_code").saveRow(rowid);
-        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);
+        let formData = {}
+        let t = $("#barForm").serializeArray();
+        $.each(t, function () {
+            formData[this.name.replace('1', '')] = this.value
+        });
+        formData['inDocuNo'] = $("#inDocuNoLabel").val();
+        formData['drugTracCodg'] = '';
+        $("#tb_bar_code").addRowData(rowid, formData,'first');
+        // $("#tb_bar_code").jqGrid('editRow', rowid+1);
     });
     $("#removeBarCode").on('click', function () {
-        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]);
+        if (!confirm("确定删除该条药品追溯码吗?")) {
+            return;
+        }
+        let selectRowId = $("#tb_bar_code").jqGrid("getGridParam", "selrow");
+        if(isEmpty(selectRowId)){
+            return errorMesageSimaple('请选择一行数据!');
         }
+        $("#tb_bar_code").jqGrid("delRowData", selectRowId);
     });
 
     /**
@@ -718,21 +986,21 @@ function initBar() {
      * @param value
      */
     function autoBar(value){
-        var ids = $("#tb_bar_code").jqGrid("getDataIDs");//得到jqgrid当前行数
-        var rowid = Math.max.apply(Math,ids);//获得当前最大行号
-        if(rowid == "-Infinity"){
-            rowid = 0;
+        let selectRowId = $("#tb_bar_code").jqGrid("getGridParam", "selrow");
+        if(isEmpty(selectRowId)){
+            return errorMesageSimaple('请选择一个药品!');
         }
-        $("#tb_bar_code").saveRow(rowid);//取消最后一行的编辑状态
-        let rowDatas = $("#tb_bar_code").getRowData();
-        for (let i = 0; i < rowDatas.length; i++) {
-            if(rowDatas[i]["barCode"] === value){
-                $("#barCode").val("");
-                return warningMesageSimaple("该条码已存在");
-            }
+        // 获取当前追溯码信息
+        let ypTracCodg = $("#tb_bar_code").getCell(selectRowId, 'drugTracCodg')
+        if(!isEmpty(ypTracCodg)){
+            // 更新追溯码内容
+            $("#tb_bar_code").setCell(selectRowId, 'drugTracCodg', ypTracCodg + ',' + value);
+            // 更新追溯码扫码数量(这里不需要加1,因为最后会多一个",")
+            $("#tb_bar_code").setCell(selectRowId, 'quantity', ypTracCodg.split(',').length);
+        } else {
+            $("#tb_bar_code").setCell(selectRowId, 'drugTracCodg', value);
+            $("#tb_bar_code").setCell(selectRowId, 'quantity', 1);
         }
-        let data= {inDocuNo:$("#inDocuNoLabel").val(),manuNo:$("#manuNo").val(),chargeCode:$("#chargeCode").val(),barCode:value};
-        $("#tb_bar_code").addRowData(rowid+1, data,'first');
         $("#barCode").val("");
     }
 
@@ -813,4 +1081,78 @@ function print() {
     LODOP.ADD_PRINT_HTM("0mm", "0mm", "RightMargin:0mm", "BottomMargin:0mm", strStyle + document.getElementById("report_table_1").innerHTML);
     //LODOP.PRINT();
     LODOP.PREVIEW();
+}
+
+// 追溯码扫码计数统计
+let barFor = false
+let barC = 1
+function drugBarStat(){
+    barFor = false
+    barC = 0
+    $('#quantity2').val(null)
+    $('#drugTracCodgAt').val(null);
+
+    let sum = 0;
+    let str = $("#drugTracCodgStr").val();
+    let infoErr = '错误:\n';
+    let infoRep = '重复:\n';
+    if(!isEmpty(str)){
+        let barInfo = str.replaceAll('\n', ',').split(',')
+        if(barInfo.length > 0) {
+            for(let i in barInfo){
+                if(barInfo[i].length === 20){
+                    sum++;
+                } else {
+                    if(barInfo[i] > 0 && barInfo[i].length !== 20){
+                        sum++;
+                        barFor = true
+                        infoErr += barInfo[i] + '\n';
+                    }
+                }
+            }
+            let barInfoCp = [...barInfo]
+            let repStr = ''
+            for(let i in barInfo){
+                let rep = 1;
+                // 不能用index的序号去比,因为它已经比过了
+                let index = 0;
+                if(!(isEmpty(repStr) || repStr.indexOf(barInfo[i]) === -1)){
+                    continue
+                }
+                for(let j in barInfoCp){
+                    if(j > i && barInfo[i] === barInfoCp[j]){
+                        rep++;
+                        barFor = true
+                        if(isEmpty(repStr)){
+                            repStr = barInfo[i]
+                        } else if(repStr.indexOf(barInfo[i]) === -1){
+                            repStr += ',' + barInfo[i]
+                        }
+                        index = j
+                    }
+                }
+                if(rep > 1){
+                    infoRep  = infoRep + barInfo[i] + '重复出现:' + rep + '次。 \n'
+                    rep = 1
+                }
+            }
+        }
+    }
+    let info = infoErr + '\n' + infoRep
+    $('#quantity2').val(sum)
+    $('#drugTracCodgAt').val(info);
+
+}
+
+/**
+ * 去掉最后一个字符
+ * @param str 字符串
+ * @param char 去掉的字符
+ * @returns {string}
+ */
+function removeLastComma(str, char) {
+    if (str.endsWith(char)) {
+        str = str.substring(0, str.length - 1);
+    }
+    return str;
 }

+ 4 - 4
src/main/resources/templates/mz/west_pharmacy_send.html

@@ -239,15 +239,15 @@
                                    disabled value="" id="ypbq_age"/>
                             <br/>
                             <span style="margin-bottom:3px;">药品名称:</span>
-                            <input style="margin-bottom:3px;border: 0px;width: 180px;background-color: white;color: black;"
+                            <input style="margin-bottom:3px;border: 0;width: 180px;background-color: white;color: black;font-weight: bold !important; font-size: 14px !important;"
                                    disabled value="" id="ypbq_drugname"/>
                             <br/>
                             <span style="margin-bottom:3px;">规格数量:</span>
-                            <input style="margin-bottom:3px;border: 0px;width: 120px;background-color: white;color: black;"
+                            <input style="margin-bottom:3px;border: 0;width: 120px;background-color: white;color: black;font-weight: bold !important; font-size: 14px !important;"
                                    disabled value="" id="ypbq_specification"/>
-                            <input style="margin-bottom:3px;border: 0px;width: 20px;background-color: white;color: black;text-align: right"
+                            <input style="margin-bottom:3px;border: 0;width: 40px;background-color: white;color: black;text-align: right;font-weight: bold !important; font-size: 14px !important;"
                                    disabled value="" id="ypbq_quantity"/>
-                            <input style="margin-bottom:3px;border: 0px;width: 20px;background-color: white;color: black;"
+                            <input style="margin-bottom:3px;border: 0;width: 20px;background-color: white;color: black;font-weight: bold !important; font-size: 14px !important;"
                                    disabled value="" id="ypbq_ypUnitName"/>
                             <br/>
                             <span style="margin-bottom:3px;">用法用量:</span>

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

@@ -68,6 +68,9 @@
                         <button type="button" style="margin-left:3px" id="btn_alias" class="btn btn-primary"
                                 title="别名管理">别名管理
                         </button>
+                        <button type="button" style="margin-left:3px" id="btn_bar" class="btn btn-primary"
+                                title="商品码维护">商品码维护
+                        </button>
                     </div>
                 </div>
             </form>
@@ -102,6 +105,13 @@
                                 <input id="location" name="location" class="form-control col-md-7 col-xs-12" type="text">
                             </div>
                         </div>
+                        <div class="col-md-3 col-sm-3 col-xs-12 item">
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12" for="barCode">药品商品码
+                            </label>
+                            <div class="col-md-8 col-sm-8 col-xs-12">
+                                <input id="barCode" name="barCode" class="form-control col-md-7 col-xs-12" type="text">
+                            </div>
+                        </div>
                     </div>
                 </div>
                 <div class="item form-group thmz_alert">

+ 202 - 3
src/main/resources/templates/yk/drug_storage.html

@@ -276,7 +276,7 @@
                                         </select>
                                     </div>
                                 </div>
-                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="manuNo">追溯码:
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="drugTracCodg">追溯码:
                                 </label>
                                 <div class="col-md-2 col-sm-2 col-xs-12">
                                     <input id="drugTracCodg" name="drugTracCodg" class="form-control optional" type="text">
@@ -318,8 +318,8 @@
                             </div>
                         </form>
                     </div>
-                    <div id="div_bar_code" class="col-md-12 col-sm-12 col-xs-12">
-                        <table id="tb_bar_code"></table>
+                    <div id="div_bar_code1" class="col-md-12 col-sm-12 col-xs-12">
+                        <table id="tb_bar_code1"></table>
                     </div>
                 </div>
             </div>
@@ -331,6 +331,205 @@
     </div>
 </div>
 <!--调药品弹窗结尾-->
+
+<!--药品追溯码信息弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="barFormModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 1350px;margin-left: -240px; margin-top: 50px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title">添加/编辑药品追溯码信息</h4>
+            </div>
+            <div class="modal-body">
+                <div class="row">
+                    <div class="col-md-12 col-sm-12 col-xs-12">
+                        <form id="barForm" class="form-horizontal" autocomplete="off">
+                            <input id="chargeCode1" name="chargeCode1" type="hidden">
+                            <input id="serial1" name="serial1" type="hidden">
+                            <input id="manuCode1" name="manuCode1" type="hidden">
+                            <input id="fixPrice1" name="fixPrice1" type="hidden">
+                            <input id="inSeri1" name="inSeri1" type="hidden">
+                            <input id="checkerName1" name="checkerName1" type="hidden">
+                            <input id="nationalCode1" name="nationalCode1" type="hidden">
+                            <div class="form-group">
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="barCode1">商品码:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="barCode1" name="barCode1" class="form-control optional" type="text">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="drugName1">药品名称:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="drugName1" name="drugName1" class="form-control optional" type="text">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="specification1">规格:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="specification1" name="specification1" class="form-control optional" type="text" readonly>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="packRetprice1">零售价:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="packRetprice1" name="packRetprice1" class="form-control optional" type="text" readonly>
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="manufactoryName1">厂家:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="manufactoryName1" name="manufactoryName1" class="form-control optional" type="text" readonly>
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="buyAmt1">进货量:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="buyAmt1" name="buyAmt1" class="form-control optional" type="number">
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="buyPrice1">进价:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="buyPrice1" name="buyPrice1" class="form-control optional" type="number">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="buyValue1">进货总价:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="buyValue1" name="buyValue1" class="form-control optional" type="number">
+                                </div>
+                                <div class="col-md-4 col-sm-4 col-xs-12 item">
+                                    <label class="control-label col-md-6 col-sm-6 col-xs-12"
+                                           for="inType1">入库类型</label>
+                                    <div class="col-md-6 col-sm-6 col-xs-12">
+                                        <select class="form-control selectpicker show-tick" required="required" title="请选择" id="inType1" name="inType1">
+                                            <option value="0" selected>入库</option>
+                                            <option value="1">退库</option>
+                                            <option value="2">赠药</option>
+                                            <option value="3">紧急入库</option>
+                                        </select>
+                                    </div>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="manuNo1">批号:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="manuNo1" name="manuNo1" class="form-control optional" type="text">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="reptNo1">传票号:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="reptNo1" name="reptNo1" class="form-control optional" type="text">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="reptDate1">传票日期:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="reptDate1" name="reptDate1" class="form-control optional date datetime" type="text">
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="producingDate1">生产日期:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="producingDate1" name="producingDate1" class="form-control optional datetime" type="text" >
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="effDate1">有效期:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="effDate1" name="effDate1" class="form-control optional datetime" type="text">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="licenseNo1">批准文号:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="licenseNo1" name="licenseNo1" class="form-control optional" type="text">
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                    <div id="div_bar_code" class="col-md-12 col-sm-12 col-xs-12">
+                        <table id="tb_bar_code"></table>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="addDetailedForBar">确定</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--药品追溯码信息弹窗结尾-->
+
+<!--药品追溯码集合弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="barListModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 1350px;margin-left: -240px; margin-top: 50px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title">药品追溯码集合</h4>
+            </div>
+            <div class="modal-body">
+                <div class="row">
+                    <div class="col-md-12 col-sm-12 col-xs-12">
+                        <form id="barListForm" class="form-horizontal" autocomplete="off">
+                            <input id="chargeCode2" name="chargeCode2" type="hidden">
+                            <input id="rowid2" name="rowid2" type="hidden">
+                            <div class="form-group">
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="barCode2">商品码:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="barCode2" name="barCode2" class="form-control optional" type="text" readonly>
+                                </div>
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="drugName2">药品名称:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="drugName2" name="drugName2" class="form-control optional" type="text" readonly>
+                                </div>
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="buyAmt2">进货量:
+                                </label>
+                                <div class="col-md-1 col-sm-1 col-xs-12">
+                                    <input id="buyAmt2" name="buyAmt2" class="form-control optional" type="text" readonly>
+                                </div>
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="quantity2">扫码计数:
+                                </label>
+                                <div class="col-md-1 col-sm-1 col-xs-12">
+                                    <input id="quantity2" name="quantity2" class="form-control optional" type="text">
+                                </div>
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="clFlag">是否拆零</label>
+                                <div class="col-md-1 col-sm-1 col-xs-12">
+                                    <select class="form-control selectpicker show-tick" required="required" title="请选择" id="clFlag" name="clFlag">
+                                        <option value="0" selected>否</option>
+                                        <option value="1">是</option>
+                                    </select>
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="drugTracCodgStr">追溯码集合:
+                                </label>
+                                <div class="col-sm-4">
+                                    <textarea id="drugTracCodgStr" name="drugTracCodgStr" class="form-control optional" rows="36"></textarea>
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="drugTracCodgAt">检验信息:
+                                </label>
+                                <div class="col-sm-4">
+                                    <textarea id="drugTracCodgAt" name="drugTracCodgAt" class="form-control optional" rows="36"></textarea>
+                                </div>
+                            </div>
+                        </form>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="checkBarList">追溯码检查</button>
+                <button type="button" class="btn btn-primary" id="saveBarList">确定</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--药品追溯码集合弹窗结尾-->
+
 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
 </object>