Ver código fonte

工作台清空

hurugang 4 anos atrás
pai
commit
33b3518dbc

+ 14 - 1
src/main/java/cn/hnthyy/thmz/common/Constants.java

@@ -236,11 +236,21 @@ public class Constants {
      */
     public static final String ZY_GROUP_NO="81";
 
+    /**
+     * 颗粒剂中药药品组
+     */
+    public static final String GRANULA_GROUP_NO="82";
+
     /**
      * 医材的药品组
      */
     public static final String YC_GROUP_NO="91";
 
+    /**
+     * 颗粒剂类型
+     */
+    public static final String GRANULA_DRUG_KIND="0007";
+
     /**
      * 西药和中成药的执行科室 门诊西药房
      */
@@ -251,7 +261,10 @@ public class Constants {
      */
     public static final String ZY_EXEC_CODE="2060500";
 
-
+    /**
+     * 中草药药的执行科室 门诊颗粒剂药房
+     */
+    public static final String GRANULA_EXEC_CODE="2060501";
     /**
      * 四舍五入 收费编码
      */

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

@@ -179,4 +179,6 @@ public class YpZdDict {
     private String volUnitDesc;
     //包装单位 中文描述
     private String packUnitDesc;
+    //最小单位 中文描述
+    private String miniUnitDesc;
 }

+ 1 - 1
src/main/java/cn/hnthyy/thmz/entity/his/mz/MzBlRecord.java

@@ -56,7 +56,7 @@ public class MzBlRecord {
     private String gmText;
     //
     private String statusFlag;
-    //
+    //辩证分析
     private String emrBzfx;
     //
     private String emrZf;

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

@@ -13,7 +13,7 @@ public interface YpZdDictMapper {
      * @param code
      * @return
      */
-    @Select("select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag from yp_zd_dict where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
+    @Select("select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag,mini_unit,ps_flag from yp_zd_dict where code = #{code,jdbcType=VARCHAR} and serial = #{serial}")
     YpZdDict selectYpZdDictByCodeAndSerial(@Param("code") String code,@Param("serial") String serial);
 
     /**
@@ -23,7 +23,7 @@ public interface YpZdDictMapper {
      * @return
      */
     @Select({"<script>",
-            "select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag from yp_zd_dict",
+            "select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag,mini_unit,ps_flag from yp_zd_dict",
             "<when test='codes!=null'>",
             " where code in",
             "<foreach item='item' index='index' collection='codes' open='(' separator=',' close=')'>",
@@ -41,6 +41,6 @@ public interface YpZdDictMapper {
      * @param code
      * @return
      */
-    @Select("select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag from yp_zd_dict where code = #{code,jdbcType=VARCHAR} ")
+    @Select("select code,name,specification,mz_restrict,bill_item_mz,pack_retprice,country_flag,supply_type,pack_unit,weight,volum,weigh_unit,vol_unit,pack_size,manu_code,frequency,serial,drug_flag,mini_unit,ps_flag from yp_zd_dict where code = #{code,jdbcType=VARCHAR} ")
     List<YpZdDict> selectYpZdDictByCode(@Param("code") String code);
 }

+ 13 - 3
src/main/java/cn/hnthyy/thmz/service/impl/his/YpZdDictServiceImpl.java

@@ -4,6 +4,7 @@ import cn.hnthyy.thmz.entity.his.YpZdDict;
 import cn.hnthyy.thmz.enums.UnitTypeEnum;
 import cn.hnthyy.thmz.mapper.his.YpZdDictMapper;
 import cn.hnthyy.thmz.service.his.YpZdDictService;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
@@ -19,9 +20,18 @@ public class YpZdDictServiceImpl implements YpZdDictService {
         if(ypZdDict==null){
             return ypZdDict;
         }
-        ypZdDict.setWeighUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getWeighUnit()).name);
-        ypZdDict.setVolUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getVolUnit()).name);
-        ypZdDict.setPackUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getPackUnit()).name);
+        if(StringUtils.isNotBlank(ypZdDict.getWeighUnit())){
+            ypZdDict.setWeighUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getWeighUnit()).name);
+        }
+        if(StringUtils.isNotBlank(ypZdDict.getVolUnit())){
+            ypZdDict.setVolUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getVolUnit()).name);
+        }
+        if(StringUtils.isNotBlank(ypZdDict.getPackUnit())){
+            ypZdDict.setPackUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getPackUnit()).name);
+        }
+        if(StringUtils.isNotBlank(ypZdDict.getMiniUnit())){
+            ypZdDict.setMiniUnitDesc(UnitTypeEnum.getUnitTypeByCode(ypZdDict.getMiniUnit()).name);
+        }
         return ypZdDict;
     }
 

+ 48 - 28
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -741,7 +741,7 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
         List<MzChargeDetail> dbMzChargeDetailList = mzChargeDetailMapper.selectNotPayMzChargeDetailByPatientId(mzPrescriptionVo.getPatientId());
         if (dbMzChargeDetailList != null && dbMzChargeDetailList.size() > 0) {
             for (MzChargeDetail mzChargeDetail : dbMzChargeDetailList) {
-                if (Arrays.asList(Constants.XY_ZCY_GROUP_NO, Constants.ZY_GROUP_NO).contains(mzChargeDetail.getGroupNo())) {
+                if (Arrays.asList(Constants.XY_ZCY_GROUP_NO, Constants.ZY_GROUP_NO, Constants.YC_GROUP_NO, Constants.GRANULA_GROUP_NO).contains(mzChargeDetail.getGroupNo())) {
                     ypBaseYfMapper.updateStockAmountVirtualAdd(mzChargeDetail.getChargeItemCode(), mzChargeDetail.getSerial(), mzChargeDetail.getGroupNo(), BigDecimal.valueOf(mzChargeDetail.getQuantity()).multiply(BigDecimal.valueOf(mzChargeDetail.getDrugWin())));
                 }
             }
@@ -863,48 +863,68 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
                 mzChargeDetail.setConfirmFlag(0);
                 mzChargeDetail.setJzFlag(mzPrescriptionVo.getJzFlag().toString());
                 mzChargeDetail.setItemNo(itemNo);
-                YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCodeAndSerial(mzChargeDetail.getChargeItemCode(), mzChargeDetail.getSerial());
-                if (ypZdDict == null) {
-                    throw new MzException("保存处方失败,第" + itemNo + "行对应的药品不存在");
-                }
-                String chargeBillCode = Constants.BILL_ITEM_CODE_prev + ypZdDict.getBillItemMz().substring(1);
-                mzChargeDetail.setChargeBillCode(chargeBillCode);
-                mzChargeDetail.setUnitPrice(ypZdDict.getPackRetprice());
-                mzChargeDetail.setOrigPrice(ypZdDict.getPackRetprice());
                 mzChargeDetail.setPayMark(PayMarkEnum.NO_CHARGE.code);
-                mzChargeDetail.setCountryFlag(ypZdDict.getCountryFlag());
-                if (Arrays.asList(Constants.XYF, Constants.ZCYF).contains(ypZdDict.getBillItemMz())) {
-                    if (StringUtils.isBlank(mzChargeDetail.getFrequency())) {
-                        throw new MzException("保存处方失败,第" + itemNo + "行药品频率不能为空");
+                YpZdDict ypZdDict = ypZdDictService.queryYpZdDictByCodeAndSerial(mzChargeDetail.getChargeItemCode(), mzChargeDetail.getSerial());
+                if (ypZdDict != null) {
+                    String chargeBillCode = Constants.BILL_ITEM_CODE_prev + ypZdDict.getBillItemMz().substring(1);
+                    mzChargeDetail.setChargeBillCode(chargeBillCode);
+                    mzChargeDetail.setUnitPrice(ypZdDict.getPackRetprice());
+                    mzChargeDetail.setOrigPrice(ypZdDict.getPackRetprice());
+                    mzChargeDetail.setCountryFlag(ypZdDict.getCountryFlag());
+                    mzChargeDetail.setSupplyCode(ypZdDict.getSupplyType());
+                    mzChargeDetail.setBillItemCode(ypZdDict.getBillItemMz());
+                    mzChargeDetail.setTcName(ypZdDict.getName());
+                    if (Arrays.asList(Constants.XYF, Constants.ZCYF, Constants.CLF).contains(ypZdDict.getBillItemMz())) {
+                        if (StringUtils.isBlank(mzChargeDetail.getFrequency())) {
+                            throw new MzException("保存处方失败,第" + itemNo + "行药品频率不能为空");
+                        }
+                        mzChargeDetail.setGroupNo(Constants.XY_ZCY_GROUP_NO);
+                        mzChargeDetail.setExecDept(Constants.XY_ZCY_EXEC_CODE);
+                        mzChargeDetail.setDrugWin(1);
+                        mzChargeDetail.setGroupType(Constants.XYF.equals(ypZdDict.getBillItemMz()) ? "1" : "2");
+                    } else if (Constants.CYF.equals(ypZdDict.getBillItemMz())) {
+                        if(Constants.GRANULA_DRUG_KIND.equals(ypZdDict.getDrugKind())){
+                            mzChargeDetail.setGroupNo(Constants.GRANULA_GROUP_NO);
+                            mzChargeDetail.setExecDept(Constants.GRANULA_EXEC_CODE);
+                        }else {
+                            mzChargeDetail.setGroupNo(Constants.ZY_GROUP_NO);
+                            mzChargeDetail.setExecDept(Constants.ZY_EXEC_CODE);
+                        }
+                        mzChargeDetail.setGroupType("3");
+                        if (mzChargeDetail.getDrugWin() == null) {
+                            throw new MzException("保存处方失败,第" + itemNo + "行药品的剂量为空");
+                        }
+                    } else {
+                        throw new MzException("保存处方失败,第" + itemNo + "行药品的账单类型错误");
                     }
-                    mzChargeDetail.setGroupNo(Constants.XY_ZCY_GROUP_NO);
-                    mzChargeDetail.setExecDept(Constants.XY_ZCY_EXEC_CODE);
-                    mzChargeDetail.setDrugWin(1);
-                    mzChargeDetail.setGroupType(Constants.XYF.equals(ypZdDict.getBillItemMz()) ? "1" : "2");
-                } else if (Constants.CYF.equals(ypZdDict.getBillItemMz())) {
-                    mzChargeDetail.setGroupNo(Constants.ZY_GROUP_NO);
-                    mzChargeDetail.setExecDept(Constants.ZY_EXEC_CODE);
-                    mzChargeDetail.setGroupType("3");
-                    if (mzChargeDetail.getDrugWin() == null) {
-                        throw new MzException("保存处方失败,第" + itemNo + "行药品的剂量为空");
+                }else {
+                    ZdChargeItem zdChargeItem = zdChargeItemService.queryZdChargeItemByCode(mzChargeDetail.getChargeItemCode());
+                    if(zdChargeItem==null){
+                        continue;
                     }
-                } else {
-                    throw new MzException("保存处方失败,第" + itemNo + "行药品的账单类型错误");
+                    mzChargeDetail.setChargeBillCode(mzChargeDetail.getChargeItemCode());
+                    mzChargeDetail.setUnitPrice(zdChargeItem.getChargeAmount());
+                    mzChargeDetail.setOrigPrice(zdChargeItem.getChargeAmount());
+                    mzChargeDetail.setCountryFlag("");
+                    mzChargeDetail.setSupplyCode("");
+                    mzChargeDetail.setBillItemCode(zdChargeItem.getBillItemMz());
+                    mzChargeDetail.setTcName(zdChargeItem.getName());
+                    mzChargeDetail.setGroupNo(Constants.YJ_GROUP_NO);
+                    mzChargeDetail.setExecDept(mzChargeDetail.getExecDept());
+                    mzChargeDetail.setDrugWin(1);
+                    mzChargeDetail.setGroupType("4");
                 }
                 mzChargeDetail.setWarnDept(mzPrescriptionVo.getVisitDeptCode());
-                mzChargeDetail.setSupplyCode(ypZdDict.getSupplyType());
                 mzChargeDetail.setPriceId(mzPrescriptionVo.getDoctorCode());
                 mzChargeDetail.setPriceTime(now);
                 mzChargeDetail.setRealNo(0);
                 mzChargeDetail.setDoctorFlag(YesNoEnum.YES.code.toString());
                 mzChargeDetail.setGlPercent(BigDecimal.ONE);
-                mzChargeDetail.setBillItemCode(ypZdDict.getBillItemMz());
                 mzChargeDetail.setDoctorCode(mzPrescriptionVo.getDoctorCode());
                 mzChargeDetail.setName(mzPatientMi.getName());
                 mzChargeDetail.setResponceType(mzPatientMi.getResponseType());
                 mzChargeDetail.setYbbxFlag("");
                 mzChargeDetail.setTcNo("");
-                mzChargeDetail.setTcName(ypZdDict.getName());
                 mzChargeDetail.setDetailFlag(YesNoEnum.NO.code.toString());
                 mzChargeDetail.setOrderType(YesNoEnum.YES.code.toString());
                 mzChargeDetail.setTryFlag(YesNoEnum.NO.code.toString());

+ 159 - 71
src/main/resources/static/js/mz/clinic.js

@@ -974,6 +974,33 @@ function realClinicalReception(patientId) {
 function clearWorkSpace() {
     //TODO
     clearUser();
+    $("#symptom").val(null);
+    $("#emrHpi").val(null);
+    $("#emrPs").val(null);
+    $("#personalHistory").val(null);
+    $("#familyHistory").val(null);
+
+    $("#obstericalHistory").val(null);
+    $("#weight").val(null);
+    $("#temperature").val(null);
+    $("#sphygmus").val(null);
+    $("#breathe").val(null);
+    $("#pressure_high").val(null);
+    $("#pressure_floor").val(null);
+    $("#pressure_high_left").val(null);
+    $("#pressure_floor_left").val(null);
+    $("#otherCheck").val(null);
+    $("#diagnoseValue").val(null);
+    $("#diagnoseTags").html(null);
+
+    clearWesternMedicine(true);
+    clearChineseMedicine();
+    clearJyJcItem();
+    initNavTabs(0);
+    initNavTabs(1);
+    initNavTabs(2);
+    $("#totalAmount").text(0);
+
 }
 
 /**
@@ -1468,6 +1495,8 @@ function saveWesternMedicine() {
     var currentCode = $("#current_code").val();
     //当前药品规格
     var currentSerial = $("#current_serial").val();
+    //当前药房编码
+    var currentGroupNo = $("#current_groupNo").val();
     //用法编码
     var supplyType = $("#supplyType").val();
     //用法描述
@@ -1477,7 +1506,7 @@ function saveWesternMedicine() {
     //处方实际单次使用剂量
     var drugWin = $("#drugWin").val();
     //剂量单位
-    var drugWinUnit = $("#drugWinUnit").val();
+    var drugWinUnit = $('#drugWinUnit option:selected').text();
     //天数
     var dayNum = $("#dayNum").val();
     //频次编码
@@ -1494,10 +1523,30 @@ function saveWesternMedicine() {
     var totalRetprice = parseFloat($("#totalRetprice").val());
     //单价
     var packRetprice = $("#packRetprice").val();
+    //皮试
+    var tryFlag = $("#tryFlag").parent().hasClass("checked");
     if (currentCode == null || currentCode == '') {
         errorMesageSimaple("未选择任何药品!");
         return;
     }
+    if(drugWin==null || drugWin==""){
+        errorMesageSimaple("剂量为空!");
+        return;
+    }
+    if(dayNum==null || dayNum==""){
+        errorMesageSimaple("天数为空!");
+        return;
+    }
+    if(orderFrequency==null || orderFrequency==""){
+        errorMesageSimaple("频次为空!");
+        return;
+    }
+    if(currentGroupNo!='91'){
+        if(supplyType==null || supplyType==""){
+            errorMesageSimaple("用法为空!");
+            return;
+        }
+    }
     var html = '<div class="form-group">';
     html += groupId + '.&nbsp;&nbsp;';
     html += westernMedicineNamme + ' ';
@@ -1507,6 +1556,9 @@ function saveWesternMedicine() {
     html += '用法:' + supplyTypeText + ' ';
     html += '频次:' + orderFrequencyText + ' ';
     html += dayNum + '天 ';
+    if(tryFlag=="true" || tryFlag==true){
+        html += '皮试 ';
+    }
     if (medicalAdvice != null && medicalAdvice != '') {
         html += '医嘱:' + medicalAdvice;
     }
@@ -1519,7 +1571,7 @@ function saveWesternMedicine() {
     html += '<input type="hidden" class="temporary_items_westernMedicineNamme" value="' + westernMedicineNamme + '"/>';
     html += '<input type="hidden" class="temporary_items_drugWinDb" value="' + drugWinDb + '"/>';
     html += '<input type="hidden" class="temporary_items_drugWin" value="' + drugWin + '"/>';
-    html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + drugWinUnit + '"/>';
+    html += '<input type="hidden" class="temporary_items_drugWinUnit" value="' + $("#drugWinUnit").val() + '"/>';
     html += '<input type="hidden" class="temporary_items_gross" value="' + gross + '"/>';
     html += '<input type="hidden" class="temporary_items_packUnit" value="' + packUnit + '"/>';
     html += '<input type="hidden" class="temporary_items_supplyType" value="' + supplyType + '"/>';
@@ -1527,6 +1579,7 @@ function saveWesternMedicine() {
     html += '<input type="hidden" class="temporary_items_dayNum" value="' + dayNum + '"/>';
     html += '<input type="hidden" class="temporary_items_medicalAdvice" value="' + medicalAdvice + '"/>';
     html += '<input type="hidden" class="temporary_items_packRetprice" value="' + packRetprice + '"/>';
+    html += '<input type="hidden" class="temporary_items_tryFlag" value="' + tryFlag + '"/>';
     html += '</div>';
 
     var tableId = $("#xyTab li.active").find("a").attr("href");
@@ -1691,6 +1744,12 @@ function editWesternMedicine(obj) {
     $("#totalRetprice").val($(parentObject).find("input.temporary_items_amount").val());
     //单价
     $("#packRetprice").val($(parentObject).find("input.temporary_items_packRetprice").val());
+    //皮试
+    var tryFlag=$(parentObject).find("input.temporary_items_tryFlag").val();
+    if(tryFlag==true || tryFlag=="true"){
+        $("#tryFlag").parent().addClass("checked");
+        $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
+    }
 }
 
 
@@ -1754,6 +1813,8 @@ function saveJyJcItem() {
     var currentCode = $("#current_code").val();
     //当前项目价格
     var jcjyItemPrice = $("#jcjyItemPrice").val();
+    //描述
+    var chargeUnit = $("#chargeUnit").val();
     //备注
     var remark = $("#remark").val();
     if (currentCode == null || currentCode == '') {
@@ -1763,6 +1824,9 @@ function saveJyJcItem() {
     var html = '<div class="form-group">';
     html += '<span class="jcjyItemGroupId">' + groupId + '</span>.&nbsp;&nbsp;'
     html += jcJyItem + ' ';
+    if (chargeUnit != null && chargeUnit != '') {
+        html += '描述:' + chargeUnit;
+    }
     if (remark != null && remark != '') {
         html += '备注:' + remark;
     }
@@ -1911,6 +1975,9 @@ function clearWesternMedicine(flag) {
     $("#totalRetprice").val(null);
     //医嘱
     $("#medicalAdvice").val(null);
+    //皮试
+    $("#tryFlag").parent().removeClass('checked');
+    $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
 }
 
 
@@ -2905,8 +2972,8 @@ function loadDiagnose(value) {
 function fitDiagnoseValue(value, code) {
     var html = '';
     var childrenNum = $("#diagnoseTags").children().length;
-    if (childrenNum == 3) {
-        errorMesageSimaple("最多填写个诊断!");
+    if (childrenNum == 10) {
+        errorMesageSimaple("最多填写个诊断!");
         return;
     }
     if (childrenNum == 0) {
@@ -3661,69 +3728,67 @@ function initNavTabs(index) {
         paneId = "zlcf_1";
         cfdesc='医技与诊疗';
     }
-    if ($("#" + tabId).children().length == 0) {
-        $("#" + tabId).append('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方一 <small class="cfdesc">('+cfdesc+')</small></a></li>');
-        var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
-        html += '<input class="current_groupNo" type="hidden"/>';
-        html += '                   <div class="cf_content rb_item" style="height: 250px;padding-top: 5px;"></div>' +
-            '                       <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
-        html += '<div style="width: 460px;">'
-        if (index == 1) {
-            html += ' <div style="width: 130px;float: left;">' +
-                '                                        <label class="my_label_2">付数:</label>' +
-                '                                        <input type="text" class="form-control my_label_input_2 zyfs"' +
-                '                                               placeholder="请输入" style="padding-left: 10px;" onchange="calculateZyAmount()" value="1">' +
-                '                                    </div>';
-            html += '<div style="width: 130px;float: left;">' +
-                '                                        <label class="my_label_2">频次:</label>' +
-                '                                        <div style="width: 85px;float: right;">' +
-                '                                            <select class="form-control selectpicker show-tick zy_orderFrequency"' +
-                '                                                    title="请选择" data-live-search="true" onchange="calculate()" id="zy_orderFrequency_1">' +
-                '                                            </select>' +
-                '                                        </div>' +
-                '                                    </div>';
-            html += '<div style="width: 180px;float: left;">' +
-                '                                        <label class="my_label_2">用法:</label>' +
-                '                                        <div style="width: 135px;float: left;">' +
-                '                                            <select class="form-control selectpicker show-tick useType"' +
-                '                                                    title="请选择"  id="useType_1">' +
-                '                                            </select>' +
-                '                                        </div>' +
-                '                                    </div>';
-            html += '</div><div style="width: 460px;">'
-            html += '<input id="singleAmount" type="hidden"/>';
-        }
-        html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
-        if (index == 1) {
-            html += '<div style="width: 130px;float: left;">' +
-                '                                        <label class="my_label_2">液型:</label>' +
-                '                                        <div style="width: 85px;float: right;">' +
-                '                                            <select class="form-control selectpicker show-tick water" >' +
-                '                                            </select>' +
-                '                                        </div>' +
-                '                                    </div>';
-            html += '      <div style="width: 180px;float: left;">' +
-                '                                        <label class="my_label_2">煎法:</label>' +
-                '                                        <div style="width: 135px;float: left;">' +
-                '                                            <select class="form-control selectpicker show-tick zy_supplyType"' +
-                '                                                    title="请选择" id="zy_supplyType_1">' +
-                '                                            </select>' +
-                '                                        </div>' +
-                '                                    </div>';
-        }
-        html += '</div></div></div>'
-        $("#" + tabContentId).append(html);
-        if (index == 1) {
-            var useType = '<option value="饭前温服">饭前温服</option><option value="饭后温服">饭后温服</option><option value="饭前凉服">饭前凉服</option><option value="饭后凉服">饭后凉服</option><option value="顿服">顿服</option><option value="冲服">冲服</option><option value="外用">外用</option>';
-            $('.useType').html(useType);
-            $('.useType').selectpicker('refresh');
-            var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
-            $('.water').html(water);
-            $('.water').selectpicker('refresh');
-            initOrderFrequencys("zy_orderFrequency_1");
-            initZySupplyTypes("zy_supplyType_1");
+    $("#" + tabId).html('<li class="active"><a href="#' + paneId + '" role="tab" data-toggle="tab">处方一 <small class="cfdesc">('+cfdesc+')</small></a></li>');
+    var html = '<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">';
+    html += '<input class="current_groupNo" type="hidden"/>';
+    html += '                   <div class="cf_content rb_item" style="height: 250px;padding-top: 5px;"></div>' +
+        '                       <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
+    html += '<div style="width: 460px;">'
+    if (index == 1) {
+        html += ' <div style="width: 130px;float: left;">' +
+            '                                        <label class="my_label_2">付数:</label>' +
+            '                                        <input type="text" class="form-control my_label_input_2 zyfs"' +
+            '                                               placeholder="请输入" style="padding-left: 10px;" onchange="calculateZyAmount()" value="1">' +
+            '                                    </div>';
+        html += '<div style="width: 130px;float: left;">' +
+            '                                        <label class="my_label_2">频次:</label>' +
+            '                                        <div style="width: 85px;float: right;">' +
+            '                                            <select class="form-control selectpicker show-tick zy_orderFrequency"' +
+            '                                                    title="请选择" data-live-search="true" onchange="calculate()" id="zy_orderFrequency_1">' +
+            '                                            </select>' +
+            '                                        </div>' +
+            '                                    </div>';
+        html += '<div style="width: 180px;float: left;">' +
+            '                                        <label class="my_label_2">用法:</label>' +
+            '                                        <div style="width: 135px;float: left;">' +
+            '                                            <select class="form-control selectpicker show-tick useType"' +
+            '                                                    title="请选择"  id="useType_1">' +
+            '                                            </select>' +
+            '                                        </div>' +
+            '                                    </div>';
+        html += '</div><div style="width: 460px;">'
+        html += '<input id="singleAmount" type="hidden"/>';
+    }
+    html += '<div style="width: 130px;float: left;padding-left: 7px;padding-top: 8px;">金额:<span class="cf_amount">0.0</span><span>元</span></div>';
+    if (index == 1) {
+        html += '<div style="width: 130px;float: left;">' +
+            '                                        <label class="my_label_2">液型:</label>' +
+            '                                        <div style="width: 85px;float: right;">' +
+            '                                            <select class="form-control selectpicker show-tick water" >' +
+            '                                            </select>' +
+            '                                        </div>' +
+            '                                    </div>';
+        html += '      <div style="width: 180px;float: left;">' +
+            '                                        <label class="my_label_2">煎法:</label>' +
+            '                                        <div style="width: 135px;float: left;">' +
+            '                                            <select class="form-control selectpicker show-tick zy_supplyType"' +
+            '                                                    title="请选择" id="zy_supplyType_1">' +
+            '                                            </select>' +
+            '                                        </div>' +
+            '                                    </div>';
+    }
+    html += '</div></div></div>'
+    $("#" + tabContentId).html(html);
+    if (index == 1) {
+        var useType = '<option value="饭前温服">饭前温服</option><option value="饭后温服">饭后温服</option><option value="饭前凉服">饭前凉服</option><option value="饭后凉服">饭后凉服</option><option value="顿服">顿服</option><option value="冲服">冲服</option><option value="外用">外用</option>';
+        $('.useType').html(useType);
+        $('.useType').selectpicker('refresh');
+        var water = '<option value="加凉水">加凉水</option><option value="加温水">加温水</option><option value="加开水">加开水</option><option value="加冰水">加冰水</option><option value="加糖水">加糖水</option>';
+        $('.water').html(water);
+        $('.water').selectpicker('refresh');
+        initOrderFrequencys("zy_orderFrequency_1");
+        initZySupplyTypes("zy_supplyType_1");
 
-        }
     }
 }
 
@@ -3801,17 +3866,27 @@ function fitWesternMedicine(res) {
     if (res.data.weight != null) {
         $("#drugWin").val(res.data.weight);
         $("#drugWinDb").val(res.data.weight);
-        drugWinHtml = '<option value="' + res.data.weighUnitDesc + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
-        index = res.data.weighUnitDesc;
+        drugWinHtml = '<option value="' + res.data.weighUnit + '" desc="' + res.data.weight + '">' + res.data.weighUnitDesc + '</option>';
+        index = res.data.weighUnit;
     }
     if (res.data.volum != null) {
         if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
             $("#drugWin").val(res.data.volum);
             $("#drugWinDb").val(res.data.volum);
         }
-        drugWinHtml += '<option value="' + res.data.volUnitDesc + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
+        drugWinHtml += '<option value="' + res.data.volUnit + '" desc="' + res.data.volum + '">' + res.data.volUnitDesc + '</option>';
         if (index == null) {
-            index = res.data.volUnitDesc;
+            index = res.data.volUnit;
+        }
+    }
+    if (res.data.miniUnit != null && res.data.miniUnit !="") {
+        if ($("#drugWin").val() == null || $("#drugWin").val() == '') {
+            $("#drugWin").val(1);
+            $("#drugWinDb").val(1);
+        }
+        drugWinHtml += '<option value="' + res.data.miniUnit + '" desc="1">' + res.data.miniUnitDesc + '</option>';
+        if (index == null) {
+            index = res.data.miniUnit;
         }
     }
     $('#drugWinUnit').html(drugWinHtml);
@@ -3837,6 +3912,19 @@ function fitWesternMedicine(res) {
     $("#packSize").val(res.data.packSize);
     $("#current_code").val(res.data.code);
     $("#current_serial").val(res.data.serial);
+    //天数
+    $("#dayNum").selectpicker('val', 1);
+    $('#dayNum').selectpicker('refresh');
+    //频次编码
+    $("#orderFrequency").selectpicker('val', "ONCE");
+    $('#orderFrequency').selectpicker('refresh');
+    if(res.data.psFlag!=null && (res.data.psFlag==1 || res.data.psFlag=="1")){
+        $("#tryFlag").parent().addClass("checked");
+        $("#tryFlag").parent().parent().parent().removeClass("hide").addClass("in");
+    }else {
+        $("#tryFlag").parent().removeClass("checked");
+        $("#tryFlag").parent().parent().parent().removeClass("in").addClass("hide");
+    }
     calculate();
 }
 
@@ -3895,7 +3983,7 @@ function calculate() {
     //拆零总量
     var scatteredTotalNum = Multiply(Multiply(dayNum, drugWin), times);
     //整包装的数量
-    var totalNum = Division(scatteredTotalNum, Multiply(packSize, drugWinDb)).toFixed(0);
+    var totalNum = Math.ceil(Division(scatteredTotalNum, Multiply(packSize, drugWinDb)));
     $("#gross").val(totalNum);
     $("#totalRetprice").val(Multiply(totalNum, packRetprice).toFixed(2));
 }

+ 8 - 3
src/main/resources/templates/mz/clinic.html

@@ -306,7 +306,7 @@
                         </p>
                     </div>
                     <div class="col-md-4 col-sm-4 col-xs-12" style="text-align: right;">
-                        <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;" onclick="clearWorkSpace()">&nbsp;&nbsp;重置工作台</i></a>
+                        <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;" onclick="clearWorkSpace()">&nbsp;&nbsp;清空工作台</i></a>
                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;"
                            onclick="configWorkspaceModal()">&nbsp;&nbsp;配置</i></a>
                     </div>
@@ -381,7 +381,7 @@
                                 血压<input id="pressure_high"/>&nbsp;/
                                 <input id="pressure_floor"/>mmhg
                             </div>
-                            <div id="pressureLeftFlag" style="float: left;margin-left: 15px;"> 血压(左)<input
+                            <div id="pressureLeftFlag" style="float: left;margin-left: 5px;"> 血压(左)<input
                                     id="pressure_high_left"/>&nbsp;/
                                 <input id="pressure_floor_left"/>mmhg
                             </div>
@@ -396,7 +396,7 @@
                     <!--</div>-->
                     <div class="item form-group">
                         <label class="my_label">其他检查:</label>
-                        <input id="symptom3" class="form-control my_label_input"
+                        <input id="otherCheck" class="form-control my_label_input"
                                placeholder="请输入" type="text" data-placement="bottom-right">
                     </div>
                     <div class="item form-group">
@@ -522,6 +522,11 @@
                                                     id="orderFrequency">
                                             </select>
                                         </div>
+                                        <div class="checkbox hide" style="margin-left: 15px;width: 55px;float: left;" >
+                                            <label style="padding-left: 0px;">
+                                                <input type="checkbox" class="flat" id="tryFlag" >&nbsp;&nbsp;皮试
+                                            </label>
+                                        </div>
                                     </div>
                                 </div>
                                 <div class="item form-group">