WANGJIALIANG 2 vuotta sitten
vanhempi
commit
186bdc8b31

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

@@ -1341,4 +1341,18 @@ public class NavigationController {
         }
         return "yk/drug_use_quantity_count";
     }
+
+    /**
+     * 药品大类字典维护
+     *
+     * @return
+     */
+    @RequestMapping("/categories-manage")
+    public String categoriesManage(HttpServletRequest httpServletRequest) throws Exception {
+        List<String> urls = getRoleUrls(httpServletRequest);
+        if (!urls.contains("/thmz/categories-manage")) {
+            throw new Exception("您没有此模块的权限,请联系管理员开通!");
+        }
+        return "yk/categories_manage";
+    }
 }

+ 111 - 0
src/main/java/cn/hnthyy/thmz/controller/zd/YpZdCategoriesController.java

@@ -0,0 +1,111 @@
+package cn.hnthyy.thmz.controller.zd;
+
+import cn.hnthyy.thmz.Utils.PyWbUtil;
+import cn.hnthyy.thmz.Utils.TokenUtil;
+import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.entity.his.zd.YpZdCategories;
+import cn.hnthyy.thmz.entity.thmz.User;
+import cn.hnthyy.thmz.service.his.zd.YpZdCategoriesService;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.*;
+
+import javax.servlet.http.HttpServletRequest;
+import java.util.Date;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * 药品大类
+ */
+@Slf4j
+@RestController
+public class YpZdCategoriesController {
+    @Autowired
+    private YpZdCategoriesService ypZdCategoriesService;
+
+
+    /**
+     * 模糊查询药品大类字典列表
+     *
+     * @param textSearch 大类查询条件
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/listYpZdCategoriesLike", method = {RequestMethod.GET, RequestMethod.POST})
+    public Map<String, Object> listYpZdCategories(@RequestParam("textSearch") String textSearch) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            List<YpZdCategories> list = ypZdCategoriesService.queryYpZdCategoriesLike(textSearch);
+            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;
+        }
+    }
+
+    /**
+     * 查询药品大类字典列表
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/queryAllCategories", method = {RequestMethod.GET})
+    public Map<String, Object> queryAllCategories() {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            List<YpZdCategories> list = ypZdCategoriesService.queryYpZdCategories();
+            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;
+        }
+    }
+
+    /**
+     * 保存药品大类字典
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/saveCategories", method = {RequestMethod.POST})
+    public Map<String, Object> saveCategories(@RequestBody YpZdCategories ypZdCategories, HttpServletRequest httpServletRequest) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            User tokenUser = TokenUtil.getUser(httpServletRequest);
+            if (ypZdCategories == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "参数不能为空");
+                return resultMap;
+            }
+            if (StringUtils.isBlank(ypZdCategories.getName())) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "药房名称不能为空");
+                return resultMap;
+            }
+            ypZdCategories.setPyCode(PyWbUtil.toBigFirstChar(ypZdCategories.getName()));
+            ypZdCategories.setInputTime(new Date());
+            ypZdCategories.setInputId(tokenUser.getUserIdCode());
+            ypZdCategoriesService.saveYpZdCategories(ypZdCategories);
+            resultMap.put("code", 0);
+            resultMap.put("message", "保存药品大类成功");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            log.error("保存药品大类失败,错误信息{}", e);
+            resultMap.put("code", -1);
+            resultMap.put("message", "保存药品大类失败");
+            return resultMap;
+        }
+    }
+}

+ 37 - 0
src/main/java/cn/hnthyy/thmz/entity/his/zd/YpZdCategories.java

@@ -0,0 +1,37 @@
+package cn.hnthyy.thmz.entity.his.zd;
+
+import lombok.Data;
+
+import java.util.Date;
+
+/**
+ * 药品大类字典
+ */
+@Data
+public class YpZdCategories {
+
+	/**
+	 * 编码
+	 */
+  private Integer code;
+	/**
+	 * 名称
+	 */
+  private String name;
+	/**
+	 * 拼音码
+	 */
+  private String pyCode;
+	/**
+	 * 是否停用
+	 */
+  private Integer isDel;
+	/**
+	 * 操作人
+	 */
+  private String inputId;
+	/**
+	 * 操作时间
+	 */
+  private Date inputTime;
+}

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

@@ -22,7 +22,7 @@ public interface YpZdDictMapper {
             "       zb_flag, zb_supplyer, n_code as yn_code, bill_item_mz, bill_item_zy, supply_type, rtrim(frequency)frequency, ps_flag, ex_code, kss_flag," +
             "       zj_flag, spec_b, yb_code, yb_type, yb_code_zf, init_flag, yp_level, drug_id, serial_old, spec_pack, xnh_flag," +
             "       buy_price, self_flag_yb, order_dosage, dosage_unit, yb_comment, isnull(rtrim(jb_flag),0) jb_flag, location, zs_flag, rtrim(audit_code)audit_code, comment," +
-            "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, kjyw_flag, ygyyjc_type," +
+            "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, rtrim(kjyw_flag)kjyw_flag, ygyyjc_type," +
             "       ddd_value, kj_limit_flag, yp_id, xtpp_name, sp_name, qj_flag, js_flag, rtrim(pzwh)pzwh, xnh_code, xnh_name, xnh_ratio," +
             "       xnh_quotamoney, xnh_status, xnh_bl, city_bl, syb_bl, cl_flag, avg_price, yb_flag_city, yb_flag_xnh, yb_code_city," +
             "       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," +
@@ -46,7 +46,7 @@ public interface YpZdDictMapper {
                     "       zb_flag, zb_supplyer, n_code as yn_code, bill_item_mz, bill_item_zy, supply_type, rtrim(frequency)frequency, ps_flag, ex_code, kss_flag," +
                     "       zj_flag, spec_b, yb_code, yb_type, yb_code_zf, init_flag, yp_level, drug_id, serial_old, spec_pack, xnh_flag," +
                     "       buy_price, self_flag_yb, order_dosage, dosage_unit, yb_comment, isnull(rtrim(jb_flag),0) jb_flag, location, zs_flag, rtrim(audit_code)audit_code, comment," +
-                    "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, kjyw_flag, ygyyjc_type," +
+                    "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, rtrim(kjyw_flag)kjyw_flag, ygyyjc_type," +
                     "       ddd_value, kj_limit_flag, yp_id, xtpp_name, sp_name, qj_flag, js_flag, rtrim(pzwh)pzwh, xnh_code, xnh_name, xnh_ratio," +
                     "       xnh_quotamoney, xnh_status, xnh_bl, city_bl, syb_bl, cl_flag, avg_price, yb_flag_city, yb_flag_xnh, yb_code_city," +
                     "       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," +
@@ -77,7 +77,7 @@ public interface YpZdDictMapper {
             "       zb_flag, zb_supplyer, n_code as yn_code, bill_item_mz, bill_item_zy, supply_type, rtrim(frequency)frequency, ps_flag, ex_code, kss_flag," +
             "       zj_flag, spec_b, yb_code, yb_type, yb_code_zf, init_flag, yp_level, drug_id, serial_old, spec_pack, xnh_flag," +
             "       buy_price, self_flag_yb, order_dosage, dosage_unit, yb_comment, isnull(rtrim(jb_flag),0) jb_flag, location, zs_flag, rtrim(audit_code)audit_code, comment," +
-            "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, kjyw_flag, ygyyjc_type," +
+            "       categories_flag, father_flag, ybxj_price, ym_flag, dpym_flag, yb_comment2, yb_code2, rtrim(kjyw_flag)kjyw_flag, ygyyjc_type," +
             "       ddd_value, kj_limit_flag, yp_id, xtpp_name, sp_name, qj_flag, js_flag, rtrim(pzwh)pzwh, xnh_code, xnh_name, xnh_ratio," +
             "       xnh_quotamoney, xnh_status, xnh_bl, city_bl, syb_bl, cl_flag, avg_price, yb_flag_city, yb_flag_xnh, yb_code_city," +
             "       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," +
@@ -128,7 +128,7 @@ public interface YpZdDictMapper {
             "       zb_flag, d.zb_supplyer, d.n_code as yn_code, d.bill_item_mz, d.bill_item_zy, d.supply_type, rtrim(d.frequency)frequency, d.ps_flag, d.ex_code, d.kss_flag," +
             "       zj_flag, d.spec_b, d.yb_code, d.yb_type, d.yb_code_zf, d.init_flag, d.yp_level, d.drug_id, d.serial_old, d.spec_pack, d.xnh_flag," +
             "       buy_price, d.self_flag_yb, d.order_dosage, d.dosage_unit, d.yb_comment, isnull(rtrim(jb_flag),0) jb_flag, d.location, d.zs_flag, rtrim(d.audit_code)audit_code, d.comment," +
-            "       categories_flag, d.father_flag, d.ybxj_price, d.ym_flag, d.dpym_flag, d.yb_comment2, d.yb_code2, d.kjyw_flag, d.ygyyjc_type," +
+            "       categories_flag, d.father_flag, d.ybxj_price, d.ym_flag, d.dpym_flag, d.yb_comment2, d.yb_code2, rtrim(d.kjyw_flag)kjyw_flag, d.ygyyjc_type," +
             "       ddd_value, d.kj_limit_flag, d.yp_id, d.xtpp_name, d.sp_name, d.qj_flag, d.js_flag, rtrim(d.pzwh)pzwh, d.xnh_code, d.xnh_name, d.xnh_ratio," +
             "       xnh_quotamoney, d.xnh_status, d.xnh_bl, d.city_bl, d.syb_bl, d.cl_flag, d.avg_price, d.yb_flag_city, d.yb_flag_xnh, d.yb_code_city," +
             "       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," +
@@ -224,7 +224,7 @@ public interface YpZdDictMapper {
                     "  zb_supplyer =b.zb_supplyer , ps_flag =b.ps_flag , ex_code =b.ex_code , supply_type =b.supply_type , frequency =rtrim(b.frequency) ," +
                     "  kss_flag =b.kss_flag , yp_level =b.yp_level , drug_id =b.drug_id , yb_code =b.yb_code, yb_comment =b.yb_comment , xnh_flag =b.xnh_flag , jb_flag =b.jb_flag ," +
                     "  audit_code =b.audit_code , comment =b.comment , categories_flag =b.categories_flag , ym_flag =b.ym_flag , dpym_flag =b.dpym_flag ," +
-                    "  father_flag =b.father_flag , yb_code2 =b.yb_code2 , yb_comment2 =b.yb_comment2 , kjyw_flag =b.kjyw_flag , ygyyjc_type =b.ygyyjc_type ," +
+                    "  father_flag =b.father_flag , yb_code2 =b.yb_code2 , yb_comment2 =b.yb_comment2 , kjyw_flag =rtrim(b.kjyw_flag) , ygyyjc_type =b.ygyyjc_type ," +
                     "  ddd_value =b.ddd_value , yp_id =b.yp_id , xtpp_name =b.xtpp_name , sp_name =b.sp_name , yb_comment_new =b.yb_comment_new ," +
                     "  yb_bl_new =b.yb_bl_new , yb_flag_new =b.yb_flag_new , byj_flag =b.byj_flag,drug_control_code =b.drug_control_code" +
                     " from ( select *from yp_zd_dict ) as b" +

+ 110 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/zd/YpZdCategoriesMapper.java

@@ -0,0 +1,110 @@
+package cn.hnthyy.thmz.mapper.his.zd;
+
+import cn.hnthyy.thmz.entity.his.zd.YpZdCategories;
+import org.apache.ibatis.annotations.*;
+
+import java.util.List;
+
+public interface YpZdCategoriesMapper {
+
+    /**
+     * 根据编码查询大类
+     *
+     * @param code
+     * @return
+     */
+    @Select("select code,name,py_code,is_del from yp_zd_categories WITH(NOLOCK) where code=#{code}")
+    YpZdCategories selectByCode(@Param("code") Integer code);
+
+    /**
+     * 获取最大编码
+     *
+     * @return
+     */
+    @Select("select isnull(max(code),0) from yp_zd_categories WITH(NOLOCK)")
+    int selectMaxCode();
+
+    /**
+     * 查询药品大类字典列表
+     *
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT code,name,py_code,is_del " +
+                    "from yp_zd_categories WITH(NOLOCK) where 1=1 " +
+                    "<when test='ypZdCategories.code!=null'>" +
+                    " and code =#{ypZdCategories.code}" +
+                    "</when>" +
+                    "<when test='ypZdCategories.name!=null'>" +
+                    " and name like '%${ypZdCategories.name}%'" +
+                    "</when>" +
+                    "<when test='ypZdCategories.isDel!=null'>" +
+                    " and is_del =#{ypZdCategories.isDel}" +
+                    "</when>" +
+            "</script>"})
+    List<YpZdCategories> selectYpZdCategoriesList(@Param("ypZdCategories") YpZdCategories ypZdCategories);
+
+    /**
+     * 模糊查询药品大类字典列表
+     *
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT code,name,py_code,is_del " +
+                    "from yp_zd_categories WITH(NOLOCK) where 1=1 " +
+                    " and (name like '%${textSearch}%' or py_code like '%${textSearch}%')" +
+            "</script>"})
+    List<YpZdCategories> selectYpZdCategoriesLike(@Param("textSearch") String textSearch);
+
+    /**
+     * 查询所有药品大类字典列表
+     *
+     * @return
+     */
+    @Select({"<script>",
+            "SELECT code,name,py_code,is_del" +
+            " FROM  yp_zd_categories WITH(NOLOCK) ",
+            " order by code,is_del ASC",
+            "</script>"})
+    List<YpZdCategories> selectYpZdCategories();
+
+    /**
+     * 保存药品大类
+     *
+     * @param ypZdCategories
+     * @return
+     */
+    @Insert("insert into yp_zd_categories(code,name,py_code,input_id,input_time)" +
+            " values(#{code,jdbcType=VARCHAR},#{name,jdbcType=VARCHAR},#{pyCode,jdbcType=VARCHAR},#{inputId,jdbcType=VARCHAR}" +
+            ",#{inputTime,jdbcType=TIMESTAMP})")
+    int insertYpZdCategories(YpZdCategories ypZdCategories);
+
+    /**
+     * 修改大类字典
+     *
+     * @param ypZdCategories
+     * @return
+     */
+    @Update({"<script>",
+            "update yp_zd_categories ",
+            "<trim prefix='set' prefixOverrides=',' suffix=' where code =#{code,jdbcType=VARCHAR} ' >",
+            "<when test='name!=null'>",
+            ",name =#{name,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='pyCode!=null'>",
+            ",py_code =#{pyCode,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='isDel!=null'>",
+            ",is_del =#{isDel,jdbcType=INTEGER}",
+            "</when>",
+            "<when test='inputId!=null'>",
+            ",input_id =#{inputId,jdbcType=VARCHAR}",
+            "</when>",
+            "<when test='inputTime!=null'>",
+            ",input_time =#{inputTime,jdbcType=TIMESTAMP}",
+            "</when>",
+            "</trim>"
+            , "</script>"})
+    int updateYpZdCategories(YpZdCategories ypZdCategories);
+
+}

+ 45 - 0
src/main/java/cn/hnthyy/thmz/service/his/zd/YpZdCategoriesService.java

@@ -0,0 +1,45 @@
+package cn.hnthyy.thmz.service.his.zd;
+
+import cn.hnthyy.thmz.entity.his.zd.YpZdCategories;
+
+import java.util.List;
+
+public interface YpZdCategoriesService {
+
+    /**
+     * 根据编码查询大类
+     *
+     * @param code
+     * @return
+     */
+    YpZdCategories queryByCode(Integer code);
+
+    /**
+     * 查询药品大类字典列表
+     *
+     * @return
+     */
+    List<YpZdCategories> queryYpZdCategoriesList(YpZdCategories ypZdCategories);
+
+    /**
+     * 模糊查询药品大类字典列表
+     *
+     * @return
+     */
+    List<YpZdCategories> queryYpZdCategoriesLike(String textSearch);
+
+    /**
+     * 查询所有药品大类字典列表
+     *
+     * @return
+     */
+    List<YpZdCategories> queryYpZdCategories();
+
+    /**
+     * 保存药品大类
+     *
+     * @param ypZdCategories
+     * @return
+     */
+    int saveYpZdCategories(YpZdCategories ypZdCategories);
+}

+ 51 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/zd/YpZdCategoriesServiceImpl.java

@@ -0,0 +1,51 @@
+package cn.hnthyy.thmz.service.impl.his.zd;
+
+import cn.hnthyy.thmz.entity.his.zd.YpZdCategories;
+import cn.hnthyy.thmz.mapper.his.zd.YpZdCategoriesMapper;
+import cn.hnthyy.thmz.service.his.zd.YpZdCategoriesService;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+import org.springframework.transaction.annotation.Isolation;
+import org.springframework.transaction.annotation.Propagation;
+import org.springframework.transaction.annotation.Transactional;
+
+import java.util.List;
+
+@Service
+public class YpZdCategoriesServiceImpl implements YpZdCategoriesService {
+    @SuppressWarnings("all")
+    @Autowired
+    private YpZdCategoriesMapper ypZdCategoriesMapper;
+
+    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
+    @Override
+    public int saveYpZdCategories(YpZdCategories ypZdCategories) {
+        if(ypZdCategories.getCode() != null){//修改
+            ypZdCategoriesMapper.updateYpZdCategories(ypZdCategories);
+        }else{//新增
+            ypZdCategories.setCode(1+ypZdCategoriesMapper.selectMaxCode());
+            ypZdCategoriesMapper.insertYpZdCategories(ypZdCategories);
+        }
+        return 0;
+    }
+
+    @Override
+    public YpZdCategories queryByCode(Integer code) {
+        return ypZdCategoriesMapper.selectByCode(code);
+    }
+
+    @Override
+    public List<YpZdCategories> queryYpZdCategoriesList(YpZdCategories ypZdCategories) {
+        return ypZdCategoriesMapper.selectYpZdCategoriesList(ypZdCategories);
+    }
+
+    @Override
+    public List<YpZdCategories> queryYpZdCategoriesLike(String textSearch) {
+        return ypZdCategoriesMapper.selectYpZdCategoriesLike(textSearch);
+    }
+
+    @Override
+    public List<YpZdCategories> queryYpZdCategories() {
+        return ypZdCategoriesMapper.selectYpZdCategories();
+    }
+}

+ 199 - 0
src/main/resources/static/js/yk/categories_manage.js

@@ -0,0 +1,199 @@
+//@ sourceURL=categories_manage.js
+$(function () {
+    $("input").each(function (){
+        this.onkeydown = function (e) { // 监听键盘事件
+            let theEvent = window.event || e;
+            let code = theEvent.keyCode || theEvent.which;
+            if (code == 13) {//回车事件
+                $("#btn_search").click(); //触发搜索按钮点击事件
+            }
+        }
+    });
+    //新增按钮点击事件
+    $("#btn_add").click(function (t) {
+        $("#editModal").modal();
+        $("#classTitle").text("新增");
+        clearInput();
+    });
+    //保存按钮点击事件
+    $("#btn_save").click(function (t) {
+        var validatorResult = validator.checkAll($("#editCategoriesForm"));
+        if (validatorResult) {
+            saveCategories();
+        }
+    });
+    //初始化表格数据
+    getAllCategories();
+});
+
+/**
+ * 保存药房数据
+ */
+function saveCategories() {
+    var data = JSON.stringify({
+        code: $("#code").val(),
+        name: $("#name").val(),
+        isDel: parseInt($("#isDel").val())
+    });
+    $.ajax({
+        type: "POST",
+        url: '/thmz/saveCategories',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        data: data,
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                $("#editModal").modal("hide");
+                clearInput();
+                $('#tb_table').bootstrapTable('refresh');
+                successMesage(res);
+            } else {
+                errorMesage(res);
+            }
+        }
+    });
+}
+
+
+/**
+ * 清空输入框
+ */
+function clearInput() {
+    $("#code").val(null);
+    $("#name").val(null);
+    $("#isDel").val(0);
+    $("#isDel").selectpicker('refresh');
+}
+
+/**
+ * 重置查询表单
+ */
+function resetSearch() {
+    $("#groupNoSearch").val(null);
+    $("#groupNameSearch").val(null);
+}
+
+
+/**
+ * 查询药房库列表
+ */
+function getAllCategories() {
+    $('#tb_table').bootstrapTable("destroy");
+    $('#tb_table').bootstrapTable({
+        url: '/thmz/listYpZdCategoriesLike',         //请求后台的URL(*)
+        method: 'GET',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "desc",                   //排序方式
+        queryParams: {
+            "textSearch": $("#textSearch").val() == "" ? null : $("#textSearch").val(),
+        },           //传递参数(*)
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [10, 15, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "code",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                title: '操作',
+                field: 'op',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    row = JSON.stringify(row);
+                    var str = '<button type="button" class="btn btn-primary  btn-sm" onclick=updateYpZdCategories(' + row + ')>编辑</button>';
+                    return [str].join('');
+            }
+            },
+            {
+                field: 'code',
+                title: '编码',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'name',
+                title: '大类名称',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'pyCode',
+                title: '拼音编码',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'isDel',
+                title: '是否停用',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return value == 0 ? '<span style="color: green">否</span>' : '<span style="color: red">是</span>';
+                }
+            }
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                if (ress.message != null && ress.message != '') {
+                    new PNotify({
+                        title: '错误提示',
+                        text: ress.message,
+                        type: 'error',
+                        hide: true,
+                        styling: 'bootstrap3'
+                    });
+                }
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": ress.total,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+    });
+}
+
+/**
+ * 打开编辑窗口
+ * @param row
+ */
+function updateYpZdCategories(row) {
+    clearInput();
+    $("#groupNo").attr("readonly", true);
+    $("#classTitle").text("修改");
+    $("#code").val(row.code);
+    $("#name").val(row.name);
+    $("#isDel").val(row.isDel);
+    $("#isDel").selectpicker('refresh');
+    $("#editModal").modal();
+}

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

@@ -16,6 +16,7 @@ $(function () {
     initDynamicSelect("getSupplyTypes", "supplyType", "supplyCode", "supplyName");
     initDynamicSelect("getMzOrderFrequencyEff", "frequency", "code", "comm");
     initDynamicSelect("getAllZyZdAuditItem", "auditCode");
+    initDynamicSelect("queryAllCategories", "categoriesFlag");
     //数据校验
     init_validator();
     //别名按钮点击事件
@@ -90,6 +91,9 @@ $(function () {
         });
     });
     $('#supplyName').on('input focus', function (e) {
+        if(isEmpty($("#supplyName").val())){
+            $('#zbSupplyer').val("");
+        }
         showSupplyPopover({
             data: {
                 searchText: $("#supplyName").val() == "" ? null : $("#supplyName").val(),
@@ -102,6 +106,9 @@ $(function () {
         });
     });
     $('#manufactoryName').on('input focus', function (e) {
+        if(isEmpty($("#manufactoryName").val())){
+            $('#manuCode').val("");
+        }
         showManufactoryPopover({
             data: {
                 searchText: $("#manufactoryName").val() == "" ? null : $("#manufactoryName").val()

+ 84 - 0
src/main/resources/templates/yk/categories_manage.html

@@ -0,0 +1,84 @@
+<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/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/common/date-util.js"></script>
+<script src="/thmz/js/yk/categories_manage.js"></script>
+<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">
+            <div class="panel-body">
+                <form id="formSearch" class="form-horizontal" autocomplete="off">
+                    <div class="item form-group ">
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="textSearch">关键字
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <input id="textSearch" class="form-control optional" type="text">
+                        </div>
+                        <button type="button" id="btn_search" class="btn btn-primary"
+                                title="查询" onclick="getAllCategories()"><i class="glyphicon glyphicon-search"></i>
+                        </button>
+                        <button type="button" id="btn_reset" class="btn btn-primary"
+                                title="重置" onclick="resetSearch()"><i class="fa fa-rotate-left"></i>
+                        </button>
+                    </div>
+                    <div class="item form-group ">
+                        <button type="button" id="btn_add" class="btn btn-primary"
+                                title="添加大类"><i class="fa fa-plus"></i>
+                        </button>
+                    </div>
+
+                </form>
+            </div>
+            <table id="tb_table"></table>
+        </div>
+    </div>
+</div>
+
+<!--新增或者编辑菜单信息弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="editModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 520px;margin-left: 250px;margin-top: 120px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">药品大类管理【<span id="classTitle">新增</span>】</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal form-label-left" novalidate id="editCategoriesForm" autocomplete="off">
+                    <input id="code" name="code" type="hidden"/>
+                    <div class="item form-group ">
+                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="name">大类名称<span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-5 col-sm-5 col-xs-12">
+                            <input id="name" class="form-control optional" type="text" required="required" data-validate-length-range="1,40">
+                        </div>
+                    </div>
+                    <div class="item form-group ">
+                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="isDel">是否停用<span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-5 col-sm-5 col-xs-12">
+                            <select class="form-control show-tick" required="required" title="请选择"
+                                    id="isDel">
+                                <option value="0">否</option>
+                                <option value="1">是</option>
+                            </select>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <input id="requestId" type="hidden"/>
+                <button type="button" class="btn btn-primary" id="btn_save">保存</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--新增或者编辑菜单信息弹窗结尾-->
+
+
+

+ 3 - 9
src/main/resources/templates/yk/drug_info.html

@@ -247,14 +247,8 @@
                         <label class="control-label col-md-4 col-sm-4 col-xs-12"
                                for="categoriesFlag">大类管理<span class="required">*</span></label>
                         <div class="col-md-8 col-sm-8 col-xs-12">
-                            <select class="form-control selectpicker show-tick"  title="请选择"
+                            <select class="form-control selectpicker show-tick" title="请选择" data-live-search="true"
                                     id="categoriesFlag" name="categoriesFlag" required="required">
-                                <option value="0">口服</option>
-                                <option value="1">大输液</option>
-                                <option value="2">针剂</option>
-                                <option value="3">草药饮片</option>
-                                <option value="4">草药颗粒</option>
-                                <option value="9">其它</option>
                             </select>
                         </div>
                     </div>
@@ -572,8 +566,8 @@
                         <label class="control-label col-md-4 col-sm-4 col-xs-12" for="supplyName">中标供应商
                         </label>
                         <div class="col-md-8 col-sm-8 col-xs-12">
-                            <input id="supplyName" name="supplyName" class="form-control col-md-7 col-xs-12" type="text" required="required">
-                            <input id="zbSupplyer" name="zbSupplyer" type="text" required="required" placeholder="供应商编码" readonly>
+                            <input id="supplyName" name="supplyName" class="form-control col-md-7 col-xs-12" type="text" >
+                            <input id="zbSupplyer" name="zbSupplyer" type="text" placeholder="供应商编码" readonly>
                         </div>
                     </div>
                     <div class="col-md-2 col-sm-2 col-xs-12 item">