Browse Source

药品分装、组合开发

WANGJIALIANG 4 years ago
parent
commit
a0812db37a

+ 13 - 0
src/main/java/cn/hnthyy/thmz/controller/NavigationController.java

@@ -800,4 +800,17 @@ public class NavigationController {
         }
         return "yf/yf_inventory_list";
     }
+
+    /**
+     * 药品分装组合
+     * @return
+     */
+    @RequestMapping("/yf-divide")
+    public String yfDivide(HttpServletRequest httpServletRequest) throws Exception {
+        List<String> urls = getRoleUrls(httpServletRequest);
+        if (!urls.contains("/thmz/yf-divide")) {
+            throw new Exception("您没有此模块的权限,请联系管理员开通!");
+        }
+        return "yf/yf_divide";
+    }
 }

+ 95 - 0
src/main/java/cn/hnthyy/thmz/controller/yf/YfDivideController.java

@@ -0,0 +1,95 @@
+package cn.hnthyy.thmz.controller.yf;
+
+import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.entity.his.YpBaseYf;
+import cn.hnthyy.thmz.service.his.YpBaseYfService;
+import cn.hnthyy.thmz.vo.YpBaseYfVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+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 java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:药品分装、组合
+ * @author: WANGJIALIANG
+ * @time: 2021/8/27 16:35
+ */
+@RestController
+@Slf4j
+public class YfDivideController {
+
+    @Autowired
+    private YpBaseYfService ypBaseYfService;
+
+    /**
+     * 模糊查询药房药品信息
+     * @param searchText
+     * @param groupNo
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getYpBaseYfLike",method = {RequestMethod.GET})
+    public Map<String,Object> getYpBaseYfLike(@RequestParam("searchText") String searchText, @RequestParam("groupNo") String groupNo){
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(StringUtils.isBlank(groupNo)){
+                resultMap.put("code", 0);
+                resultMap.put("message", "查询药品成功");
+                resultMap.put("data", "");
+                return resultMap;
+            }
+            if(searchText.matches("[a-zA-Z]+")){
+                searchText = searchText.toUpperCase();
+            }
+            List<YpBaseYfVo> list = ypBaseYfService.queryYpBaseYfLike(searchText, groupNo);
+            resultMap.put("code", 0);
+            resultMap.put("message", "查询药品成功");
+            resultMap.put("data", list);
+            return resultMap;
+        } catch (Exception e) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询药品失败");
+            return resultMap;
+        }
+    }
+
+    /**
+     * 根据编码查询药房药品信息
+     * @param chargeCode
+     * @param groupNo
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getYpByChargeCodeAndGroupNo",method = {RequestMethod.GET})
+    public Map<String,Object> getYpByChargeCodeAndGroupNo(@RequestParam("chargeCode") String chargeCode, @RequestParam("groupNo") String groupNo){
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(StringUtils.isBlank(groupNo)){
+                resultMap.put("code", -1);
+                resultMap.put("message", "查询药品失败,");
+                return resultMap;
+            }
+            if(StringUtils.isBlank(groupNo)){
+                resultMap.put("code", -1);
+                resultMap.put("message", "查询药品失败,");
+                return resultMap;
+            }
+            List<YpBaseYfVo> list = ypBaseYfService.queryYpByChargeCodeAndGroupNo(chargeCode, groupNo);
+            resultMap.put("code", 0);
+            resultMap.put("message", "查询药品成功");
+            resultMap.put("data", list);
+            return resultMap;
+        } catch (Exception e) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询药品失败");
+            return resultMap;
+        }
+    }
+}

+ 49 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/YpBaseYfMapper.java

@@ -2,6 +2,7 @@ package cn.hnthyy.thmz.mapper.his;
 
 import cn.hnthyy.thmz.entity.his.YpBaseYf;
 import cn.hnthyy.thmz.pageDto.PageBean;
+import cn.hnthyy.thmz.vo.YpBaseYfVo;
 import cn.hnthyy.thmz.vo.YpZdBaseYfVo;
 import org.apache.ibatis.annotations.Insert;
 import org.apache.ibatis.annotations.Param;
@@ -95,4 +96,52 @@ public interface YpBaseYfMapper {
      */
     @Update("update yp_base_yf set stock_amount =stock_amount + #{stockAmount,jdbcType=DECIMAL} , stock_value =stock_value + #{stockValue,jdbcType=DECIMAL} , stock_amount_virtual =stock_amount_virtual + #{stockAmount,jdbcType=DECIMAL} where charge_code =#{chargeCode} and serial =#{serial} and group_no =#{groupNo}")
     int updateStockAmount(@Param("chargeCode") String chargeCode, @Param("serial") String serial, @Param("groupNo") String groupNo, @Param("stockAmount") Double stockAmount, @Param("stockValue") BigDecimal stockValue);
+
+    /**
+     *  模糊查询药品信息
+     * @param searchText
+     * @param groupNo
+     * @return
+     */
+    @Select("  SELECT top 10 a.charge_code,   " +
+            "         a.serial,   " +
+            "         a.stock_amount,   " +
+            "         a.pack_retprice,   " +
+            "         b.name,   " +
+            "         b.specification,   " +
+            "         b.pack_size,   " +
+            "         b.py_code,   " +
+            "         b.d_code  " +
+            "    FROM yp_base_yf a,   " +
+            "         yp_zd_dict b " +
+            "   WHERE ( a.serial = b.serial )  and" +
+            "          a.charge_code = b.code  and" +
+            "          (isnull(b.py_code,'') like '${searchText}%' or" +
+            "          isnull(b.d_code,'') like '${searchText}%' or" +
+            "          a.charge_code like '${searchText}%' or" +
+            "          b.name like '${searchText}%') and" +
+            "          a.group_no = #{groupNo}" )
+    List<YpBaseYfVo> selectYpBaseYfLike(@Param("searchText") String searchText, @Param("groupNo") String groupNo);
+
+    /**
+     *  根据编码查询药房药品信息
+     * @param chargeCode
+     * @return
+     */
+    @Select("  SELECT a.charge_code,   " +
+            "         a.serial,   " +
+            "         a.stock_amount,   " +
+            "         a.pack_retprice,   " +
+            "         b.name,   " +
+            "         b.specification,   " +
+            "         b.pack_size,   " +
+            "         b.py_code,   " +
+            "         b.d_code  " +
+            "    FROM yp_base_yf a,   " +
+            "         yp_zd_dict b " +
+            "   WHERE ( a.serial = b.serial )  and" +
+            "          a.charge_code = b.code  and" +
+            "          a.charge_code = #{chargeCode} and" +
+            "          a.group_no = #{groupNo}" )
+    List<YpBaseYfVo> selectYpByChargeCodeAndGroupNo(@Param("chargeCode") String chargeCode,@Param("groupNo") String groupNo);
 }

+ 16 - 0
src/main/java/cn/hnthyy/thmz/service/his/YpBaseYfService.java

@@ -3,6 +3,7 @@ package cn.hnthyy.thmz.service.his;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.his.YpBaseYf;
 import cn.hnthyy.thmz.entity.thmz.User;
+import cn.hnthyy.thmz.vo.YpBaseYfVo;
 import cn.hnthyy.thmz.vo.YpOutDetlVo;
 import java.util.List;
 
@@ -44,4 +45,19 @@ public interface YpBaseYfService {
      * @return
      */
     int saveYpBaseYf(List<YpOutDetlVo> ypOutDetlVos, User user)throws MzException;
+
+    /**
+     *  模糊查询药品信息
+     * @param searchText
+     * @param groupNo
+     * @return
+     */
+    List<YpBaseYfVo> queryYpBaseYfLike(String searchText, String groupNo);
+
+    /**
+     *  根据编码查询药品信息
+     * @param chargeCode
+     * @return
+     */
+    List<YpBaseYfVo> queryYpByChargeCodeAndGroupNo(String chargeCode,String groupNo);
 }

+ 11 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/YpBaseYfServiceImpl.java

@@ -12,6 +12,7 @@ import cn.hnthyy.thmz.mapper.his.YpInDetlYfMapper;
 import cn.hnthyy.thmz.mapper.his.YpOutDetlMapper;
 import cn.hnthyy.thmz.service.his.YpBaseYfService;
 import cn.hnthyy.thmz.service.his.YpZdDictService;
+import cn.hnthyy.thmz.vo.YpBaseYfVo;
 import cn.hnthyy.thmz.vo.YpOutDetlVo;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
@@ -165,4 +166,14 @@ public class YpBaseYfServiceImpl implements YpBaseYfService {
         }
         return num;
     }
+
+    @Override
+    public List<YpBaseYfVo> queryYpBaseYfLike(String searchText, String groupNo) {
+        return ypBaseYfMapper.selectYpBaseYfLike(searchText, groupNo);
+    }
+
+    @Override
+    public List<YpBaseYfVo> queryYpByChargeCodeAndGroupNo(String chargeCode, String groupNo) {
+        return ypBaseYfMapper.selectYpByChargeCodeAndGroupNo(chargeCode, groupNo);
+    }
 }

+ 54 - 0
src/main/java/cn/hnthyy/thmz/vo/YpBaseYfVo.java

@@ -0,0 +1,54 @@
+package cn.hnthyy.thmz.vo;
+
+import lombok.Data;
+
+import java.math.BigDecimal;
+
+/**
+ * @description:药房药品信息视图层
+ * @author: WANGJIALIANG
+ * @time: 2021/8/24 16:25
+ */
+@Data
+public class YpBaseYfVo {
+    //药品编码
+    private String chargeCode;
+    //规格
+    private String serial;
+    //当前库存
+    private Double stockAmount;
+    private BigDecimal stockValue;
+    private Double maxStock;
+    private Double miniStock;
+    //门诊是否停用 0:未停用 1:已停用
+    private String visibleFlagMz;
+    //住院是否停用 0:未停用 1:已停用
+    private String visibleFlagZy;
+    //药房
+    private String groupNo;
+    private Integer outWithLimit;
+    //货位号
+    private String location;
+    private String jsyFlag;
+    //单价
+    private BigDecimal packRetprice;
+    //拆零价
+    private BigDecimal retprice;
+    private Double stockAmountVirtual;
+    private String jzyfFlag;
+    //拆零比例
+    private Double splitPercent;
+    private Double stockAmountVirtual2;
+    private String openVirtual2;
+    private String yppc;
+    private String visibleFlagStop;
+    private Double maxStockAmount;
+    private Double miniStockAmount;
+
+    //药品名称
+    private String name;
+    //规格
+    private String specification;
+    //包装体积
+    private BigDecimal packSize;
+}

+ 16 - 1
src/main/resources/static/js/common/pharmacy-com.js

@@ -20,4 +20,19 @@ function initDrugSearchList() {
     //药品弹窗
     settings.content = '<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>';
     $('#searchText').webuiPopover('destroy').webuiPopover(settings);
-}
+}
+
+/**
+ * 修改列数据
+ * @param $table 表格元素
+ * @param index 行索引
+ * @param field 列名
+ * @param value cell值
+ */
+function saveCellData($table, index, field, value) {
+    $table.bootstrapTable('updateCell', {
+        index: index,
+        field: field,
+        value: value
+    })
+}

+ 1 - 14
src/main/resources/static/js/yf/drug_apply.js

@@ -604,7 +604,7 @@ function initAddDrugTable(drawNo) {
                     var index = $element.parent().data('index');
                     var tdValue = $element.html();
                     if(parseFloat(tdValue).toString() != "NaN"){
-                        saveData(index, field, tdValue);
+                        saveCellData($('#add_drug_table'),index, field, tdValue);
                     }else{
                         $element.html(null);
                     }
@@ -626,19 +626,6 @@ function initAddDrugTable(drawNo) {
     }
 }
 
-/**
- * 修改列数据
- * @param index
- * @param field
- * @param value
- */
-function saveData(index, field, value) {
-    $addDrugTable.bootstrapTable('updateCell', {
-        index: index,       //行索引
-        field: field,       //列名
-        value: value        //cell值
-    })
-}
 /**
  * 删除行数据
  * @param field

+ 407 - 0
src/main/resources/static/js/yf/yf_divide.js

@@ -0,0 +1,407 @@
+//@ sourceURL=yf_divide.js
+var pharmacyGroupNo;//药房编码
+$(function () {
+    $(".selectpicker").selectpicker();
+    $("#pharmacyModal").modal("show");
+    //初始化药品查询弹出框
+    initDrugSearchList();
+    $('#searchText').on('input focus',function(e){
+        showDrugPopover();
+    });
+});
+
+//显示查询的药品悬浮窗
+function showDrugPopover() {
+    $('#tb_table_medicine').bootstrapTable('destroy');
+    $('#tb_table_medicine').bootstrapTable({
+        url: '/thmz/getYpBaseYfLike',         //请求后台的URL(*)
+        method: 'GET',                      //请求方式(*)
+        //toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: true,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: false,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams:queryParamsDrugTable,           //传递参数(*)
+        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,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                field: 'chargeCode',
+                title: '编码',
+                align: "center",
+                valign: 'middle'
+            },{
+                field: 'name',
+                title: '药品名',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'specification',
+                title: '规格',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'packRetprice',
+                title: '单价',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'stockAmount',
+                title: '药房库存',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return value<1?'<span style="color: red">'+value+'</span>':value;
+                }
+
+            }
+        ],
+        onClickRow: function (row, $element) {
+            $('#searchText').webuiPopover('hide');
+            var data= $('#add_drug_table').bootstrapTable('getData',true);
+            for (let i = 0; i <data.length; i++) {
+                if(data[i].chargeCode == row.chargeCode){
+                    return errorMesageSimaple('该药品已存在');
+                }
+            }
+            $('#tb_table').bootstrapTable('prepend', row);
+        },
+        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": ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        }
+    });
+}
+
+/**
+ * 药品列表查询参数
+ */
+function queryParamsDrugTable() {
+    var temp = {
+        groupNo: pharmacyGroupNo,
+        searchText: $("#searchText").val() == "" ? null : $("#searchText").val(),
+    };
+    return temp;
+}
+
+/**
+ * 初始化参数
+ */
+function init() {
+    pharmacyGroupNo = $("#pharmacyGroupNo").val();
+    $("#pharmacyModal").modal("hide");
+    initTable();
+    initDivide();
+}
+
+/**
+ * 查询列表
+ */
+function initTable() {
+    $('#tb_table').bootstrapTable('destroy');
+    $('#tb_table').bootstrapTable({
+        method: 'GET',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        singleSelect: true,           // 单选checkbox
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 20, 40, 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: [
+            {
+                field: 'checked',
+                checkbox: true,
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    if(index == 0){
+                        return {
+                            checked: true//设置选中
+                        };
+                    }
+                }
+            },{
+                field: 'chargeCode',
+                title: '药品编码',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'serial',
+                title: '序号',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'name',
+                title: '药品名',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'specification',
+                title: '规格',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'packSize',
+                title: '包装量',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'packRetprice',
+                title: '零售价',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return value.toFixed(2);
+                }
+            },
+            {
+                field: 'stockAmount',
+                title: '药房库存',
+                align: "center",
+                valign: 'middle'
+            }
+        ],
+        onClickRow: function (row) {
+            var data= $('#tb_table_divide').bootstrapTable('getData',true);
+            if(data.length == 0){
+                loadDrugDivide(row.chargeCode);
+            }else if(data.length > 0 && data[0].chargeCode != row.chargeCode){
+                loadDrugDivide(row.chargeCode);
+            }
+        },
+        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": ress.total,//总页数
+                "rows": ress.data   //数据
+            };
+        }
+    });
+}
+
+/**
+ * 初始化分装表格
+ */
+function initDivide() {
+    $('#tb_table_divide').bootstrapTable('destroy');
+    $('#tb_table_divide').bootstrapTable({
+        method: 'GET',                      //请求方式(*)
+        toolbar: '#toolbar_divide',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        singleSelect: true,           // 单选checkbox
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 20, 40, 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: [
+            {
+                field: 'chargeCode',
+                title: '药品编码',
+                align: "center",
+                visible:false,
+                valign: 'middle'
+            }, {
+                field: 'serial',
+                title: '序号',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'name',
+                title: '药品名',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'specification',
+                title: '新包装规格',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'packSize',
+                title: '新包装量',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'amount',
+                title: '分装量',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'oldAmount',
+                title: '参与原包装数量',
+                align: "center",
+                valign: 'middle'
+            }
+        ],
+        /**
+         * @param {点击列的 field 名称} field
+         * @param {点击列的 value 值} value
+         * @param {点击列的整行数据} row
+         * @param {td 元素} $element
+         */
+        onClickCell: function(field, value, row, $element) {
+            if(field == 'oldAmount'){
+                $element.attr('contenteditable', true);
+                $element.html(null);
+                $element.focus();
+                $element.blur(function() {
+                    var index = $element.parent().data('index');
+                    var tdValue = $element.html();
+                    if(parseFloat(tdValue).toString() != "NaN"){
+                        saveCellData($('#tb_table_divide'), index, field, tdValue);
+                        let amount = 0;
+                        if(row.serial == '01'){
+                            amount = parseFloat(tdValue)*row.packSize;
+                        }else{
+                            amount = parseFloat(tdValue)/row.packSize;
+                        }
+                        saveCellData($('#tb_table_divide'), index,'amount', amount);
+                    }else{
+                        $element.html(null);
+                    }
+                })
+            }
+        },
+        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": ress.total,//总页数
+                "rows": ress.data   //数据
+            };
+        }
+    });
+}
+
+/**
+ * 加载药品编码所有规格信息
+ * @param chargeCode
+ */
+function loadDrugDivide(chargeCode) {
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getYpByChargeCodeAndGroupNo',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        data: {
+            chargeCode:chargeCode,
+            groupNo:pharmacyGroupNo
+        },
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                $('#tb_table_divide').bootstrapTable('prepend', res.data);
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
+}

+ 75 - 0
src/main/resources/templates/yf/yf_divide.html

@@ -0,0 +1,75 @@
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-select.css"/>
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/daterangepicker.css"/>
+<link rel="stylesheet" href="/thmz/css/jquery.webui-popover.min.css">
+<link rel="stylesheet" href="/thmz/css/custom.min.css">
+<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/dependent/jquery.webui-popover.min.js"></script>
+<script src="/thmz/js/common/pharmacy-com.js"></script>
+<script src="/thmz/js/yf/yf_divide.js"></script>
+<title>药品分装、组合</title>
+<div class="row" style="height: calc(100% - 60px);overflow-y: auto;">
+    <div class="col-md-12 col-sm-12 col-xs-12">
+        <div class="x_panel" style="background: #EBEBE4;">
+            <div class="panel-body">
+                <form id="formSearch" class="form-horizontal" autocomplete="off">
+                    <label class="control-label col-md-1 col-sm-1 col-xs-12" for="searchText">药品
+                    </label>
+                    <div class="col-md-2 col-sm-2 col-xs-12">
+                        <input id="searchText" class="form-control optional" type="text">
+                    </div>
+                    <div class="form-group">
+                        <button type="button" id="btn_save" class="btn btn-primary"
+                                title="确认分装组合"><i class="fa fa-check-square-o"></i>
+                        </button>
+                    </div>
+                </form>
+            </div>
+            <div id="tb_table_div">
+                <div class="col-md-7 col-sm-7 col-xs-12">
+                        <div id="toolbar">选择分装药品</div>
+                        <table id="tb_table"></table>
+                </div>
+                <div class="col-md-5 col-sm-5 col-xs-12">
+                        <div id="toolbar_divide">分装</div>
+                        <table id="tb_table_divide"></table>
+                </div>
+            </div>
+        </div>
+    </div>
+</div>
+
+<!--选择展示药房弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="pharmacyModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 420px;margin-left: 250px;margin-top: 300px;">
+            <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">
+                <form class="form-horizontal form-label-left" novalidate  autocomplete="off">
+                    <div class="item form-group thmz_alert">
+                        <label class="control-label col-md-4 col-sm-4 col-xs-12" for="pharmacyGroupNo">药房 <span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-6 col-sm-6 col-xs-12">
+                            <select class="form-control selectpicker show-tick" required="required" title="请选择"
+                                    id="pharmacyGroupNo">
+                                <option value="71" selected>门诊西药房</option>
+                                <option value="73">住院药房</option>
+                            </select>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary"  onclick="init()" id="btn_init">确定</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--选择展示药房弹窗结尾-->