Ver Fonte

解决调用次数递增

hurugang há 4 anos atrás
pai
commit
6ae87141c9

+ 8 - 6
src/main/java/cn/hnthyy/thmz/Utils/JsonUtil.java

@@ -6,27 +6,29 @@ import com.google.gson.Gson;
  * Json 工具类
  */
 public class JsonUtil {
-    private static Gson gson = new Gson();
+     private static Gson gson = new Gson();
 
     /**
      * 将对象转成json串
+     *
      * @param object
      * @return
      */
-    public static String object2Json(Object object){
-        if(object==null){
+    public static String object2Json(Object object) {
+        if (object == null) {
             return null;
         }
-       return gson.toJson(object);
+        return gson.toJson(object);
     }
 
     /**
      * 将json串转为对象
-     * @param str json字符串
+     *
+     * @param str    json字符串
      * @param classz
      * @return
      */
-    public static Object jsontoObject(String str,Class classz) {
+    public static Object jsontoObject(String str, Class classz) {
         // 将json编译成对象
         return gson.fromJson(str, classz);
 

+ 36 - 0
src/main/java/cn/hnthyy/thmz/controller/mz/TCommonParamsController.java

@@ -6,6 +6,7 @@ import cn.hnthyy.thmz.comment.UserLoginToken;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
 import cn.hnthyy.thmz.entity.thmz.TCommonParams;
+import cn.hnthyy.thmz.entity.thmz.Template;
 import cn.hnthyy.thmz.entity.thmz.User;
 import cn.hnthyy.thmz.enums.ParamsTypeEnum;
 import cn.hnthyy.thmz.service.his.mz.*;
@@ -311,4 +312,39 @@ public class TCommonParamsController {
             return resultMap;
         }
     }
+
+
+
+
+    /**
+     * 更新通用参数调用次数
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/increaseTcCommonParamsNumber", method = {RequestMethod.GET})
+    public Map<String, Object> increaseTcCommonParamsNumber(@RequestParam("id") Long id) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(id==null){
+                resultMap.put("code", -1);
+                resultMap.put("message", "更新通用参数调用次数失败,主键为空");
+                return resultMap;
+            }
+            TCommonParams dbTCommonParams = tCommonParamsService.queryById(id);
+            TCommonParams updateTCommonParams = new TCommonParams();
+            updateTCommonParams.setId(id);
+            updateTCommonParams.setUsedTimes(dbTCommonParams.getUsedTimes()==null?1:dbTCommonParams.getUsedTimes()+1);
+            tCommonParamsService.modifyTCommonParams(updateTCommonParams);
+            resultMap.put("code", 0);
+            resultMap.put("message", "更新通用参数调用次数成功");
+            return resultMap;
+        }catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "更新通用参数调用次数失败,请联系管理员");
+            log.error("系统异常,错误信息{}", e.getMessage());
+            return resultMap;
+        }
+    }
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/entity/thmz/Template.java

@@ -70,4 +70,14 @@ public class Template implements Serializable {
 	 */
 	private Date updateTime;
 
+	//用于保存推荐信息,非数据库字段
+	//主诉
+	private String emrChiefComplaint;
+	//现病史
+	private String emrHpi;
+	//既往史
+	private String emrPs;
+	//疾病代码 诊断编码
+	private String icdCode;
+
 }

+ 1 - 5
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -9,10 +9,7 @@ import cn.hnthyy.thmz.entity.his.*;
 import cn.hnthyy.thmz.entity.his.mz.*;
 import cn.hnthyy.thmz.entity.his.zd.MzZdYpYsh;
 import cn.hnthyy.thmz.entity.his.zd.ZdChargeItem;
-import cn.hnthyy.thmz.entity.thmz.Clinic;
-import cn.hnthyy.thmz.entity.thmz.Discount;
-import cn.hnthyy.thmz.entity.thmz.ReceiptSerialFee;
-import cn.hnthyy.thmz.entity.thmz.Windows;
+import cn.hnthyy.thmz.entity.thmz.*;
 import cn.hnthyy.thmz.enums.*;
 import cn.hnthyy.thmz.mapper.his.*;
 import cn.hnthyy.thmz.mapper.his.mz.*;
@@ -39,7 +36,6 @@ 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.math.BigDecimal;
 import java.util.*;
 import java.util.stream.Collectors;

+ 51 - 3
src/main/java/cn/hnthyy/thmz/service/impl/thmz/TemplateServiceImpl.java

@@ -1,23 +1,71 @@
 package cn.hnthyy.thmz.service.impl.thmz;
 
+import cn.hnthyy.thmz.Utils.JsonUtil;
+import cn.hnthyy.thmz.Utils.PyWbUtil;
+import cn.hnthyy.thmz.entity.his.mz.MzBlRecord;
+import cn.hnthyy.thmz.entity.thmz.TCommonParams;
 import cn.hnthyy.thmz.entity.thmz.Template;
+import cn.hnthyy.thmz.enums.ParamsTypeEnum;
+import cn.hnthyy.thmz.enums.YesNoEnum;
+import cn.hnthyy.thmz.mapper.thmz.TCommonParamsMapper;
 import cn.hnthyy.thmz.mapper.thmz.TemplateMapper;
 import cn.hnthyy.thmz.service.thmz.TemplateService;
+import cn.hnthyy.thmz.vo.MzPrescriptionVo;
+import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
 import java.util.Date;
 import java.util.List;
+
 @Service
 public class TemplateServiceImpl implements TemplateService {
     @SuppressWarnings("all")
     @Autowired
     private TemplateMapper templateMapper;
+    @SuppressWarnings("all")
+    @Autowired
+    private TCommonParamsMapper tCommonParamsMapper;
+
     @Override
     public int saveTemplate(Template template) {
-        if(template.getId()==null){
+        if (template.getId() == null) {
             template.setCreateTime(new Date());
-            return templateMapper.insertTemplate(template);
+            int num = templateMapper.insertTemplate(template);
+            TCommonParams tCommonParams= new TCommonParams();
+            tCommonParams.setCreateIdCode(template.getCreateId());
+            tCommonParams.setCreateTime(template.getCreateTime());
+            tCommonParams.setParamsStatus(YesNoEnum.NO.code);
+            tCommonParams.setUsedTimes(0L);
+            if(template.getEmrChiefComplaint()!=null && StringUtils.isNotBlank(template.getEmrChiefComplaint())){
+                tCommonParams.setParamsName(template.getEmrChiefComplaint());
+                tCommonParams.setPyCode(PyWbUtil.toBigFirstChar(template.getEmrChiefComplaint()));
+                tCommonParams.setWbCode(PyWbUtil.getWBCode(template.getEmrChiefComplaint()));
+                tCommonParams.setParamsType(ParamsTypeEnum.SYMPTOM.code);
+                tCommonParamsMapper.insertTCommonParams(tCommonParams);
+            }
+            if(template.getEmrHpi()!=null && StringUtils.isNotBlank(template.getEmrHpi())){
+                tCommonParams.setParamsName(template.getEmrHpi());
+                tCommonParams.setPyCode(PyWbUtil.toBigFirstChar(template.getEmrHpi()));
+                tCommonParams.setWbCode(PyWbUtil.getWBCode(template.getEmrHpi()));
+                tCommonParams.setParamsType(ParamsTypeEnum.HISTORY_OF_PRESENT_ILLNESS.code);
+                tCommonParamsMapper.insertTCommonParams(tCommonParams);
+            }
+            if(template.getEmrPs()!=null && StringUtils.isNotBlank(template.getEmrPs())){
+                tCommonParams.setParamsName(template.getEmrPs());
+                tCommonParams.setPyCode(PyWbUtil.toBigFirstChar(template.getEmrPs()));
+                tCommonParams.setWbCode(PyWbUtil.getWBCode(template.getEmrPs()));
+                tCommonParams.setParamsType(ParamsTypeEnum.FAMILY_HISTORY.code);
+                tCommonParamsMapper.insertTCommonParams(tCommonParams);
+            }
+            if(template.getIcdCode()!=null && StringUtils.isNotBlank(template.getIcdCode())){
+                tCommonParams.setParamsName(template.getIcdCode());
+                tCommonParams.setPyCode(PyWbUtil.toBigFirstChar(template.getIcdCode()));
+                tCommonParams.setWbCode(PyWbUtil.getWBCode(template.getIcdCode()));
+                tCommonParams.setParamsType(ParamsTypeEnum.DIAGNOSE_LIST.code);
+                tCommonParamsMapper.insertTCommonParams(tCommonParams);
+            }
+            return num;
         }
         template.setUpdateTime(new Date());
         return templateMapper.updateTemplateByKey(template);
@@ -25,7 +73,7 @@ public class TemplateServiceImpl implements TemplateService {
 
     @Override
     public List<Template> queryTemplate(String createId, String deptNo) {
-        return templateMapper.selectTemplate(createId,deptNo);
+        return templateMapper.selectTemplate(createId, deptNo);
     }
 
     @Override

+ 158 - 141
src/main/resources/static/js/mz/clinic.js

@@ -111,9 +111,9 @@ $(function () {
         }
         var diagnoseValue = $("#diagnoseValue").val();
         var tentativeDiagnosis = $("#tentativeDiagnosis").val();
-        if(diagnoseValue!=null){
-            var reg = new RegExp( ',' , "g" )
-            diagnoseValue = diagnoseValue.replace( reg , '' );
+        if (diagnoseValue != null) {
+            var reg = new RegExp(',', "g")
+            diagnoseValue = diagnoseValue.replace(reg, '');
         }
         if ((diagnoseValue == null || diagnoseValue == "") && (tentativeDiagnosis == null || tentativeDiagnosis == "")) {
             errorMesageSimaple("诊断和初步诊断不能同时为空!");
@@ -480,7 +480,7 @@ function fitRecommendData(paramsType) {
                         html += paramsContent;
                         html += '                            </div>';
                         html += '                            <div style="float: left;width: 36px;cursor: pointer;"';
-                        html += '                                 onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ')">';
+                        html += '                                 onclick="fitAppeal(\'' + paramsContent + '\',' + paramsType + ','+data[i].id+')">';
                         html += '                                <img';
                         html += '                                        src="/thmz/css/bootstrap/bootstrap-icons-1.5.0/cursor-fill.svg"';
                         html += '                                        style="margin-left: 10px!important;vertical-align: -.15em;margin-right: 10px!important;"/>';
@@ -1276,8 +1276,8 @@ function editPrescription(jsonData) {
     $("#otherCheck").val(jsonData.mzBlRecord.emrPe);
     var icdCode = jsonData.icdCode;
     var icdText = jsonData.icdText;
-    var icdCodeArr = icdCode!=null?icdCode.split(","):null;
-    var icdTextArr = icdText!=null?icdText.split(","):null;
+    var icdCodeArr = icdCode != null ? icdCode.split(",") : null;
+    var icdTextArr = icdText != null ? icdText.split(",") : null;
     if (icdCodeArr != null && icdCodeArr.length > 0 && icdTextArr != null && icdTextArr.length > 0) {
         for (var i = 0; i < icdCodeArr.length; i++) {
             fitDiagnoseValue(icdTextArr[i], icdCodeArr[i]);
@@ -1423,8 +1423,9 @@ function extracted(paramsType, appeal, inputId) {
  * 填充推荐
  * @param appeal
  * @param paramsType
+ * @param id
  */
-function fitAppeal(appeal, paramsType) {
+function fitAppeal(appeal, paramsType,id) {
     var inputId = "symptom";
     var text = "主诉项已经录入,是否覆盖?";
     if (paramsType == 5) {
@@ -1455,6 +1456,15 @@ function fitAppeal(appeal, paramsType) {
     } else {
         extracted(paramsType, appeal, inputId);
     }
+    $.ajax({
+        type: "GET",
+        url: '/thmz/increaseTcCommonParamsNumber?id='+id,
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (res) {
+        }
+    });
 }
 
 /**
@@ -1853,7 +1863,7 @@ function saveWesternMedicine(calculateTotalAmountFlag) {
     html += westernMedicineNamme + ' ';
     html += drugWinDb + drugWinUnit + ' ';
     html += drugWin + drugWinUnit + ' 共';
-    html += gross + packUnit +" "+'<br/><span style="margin-left: 15px"></span>';
+    html += gross + packUnit + " " + '<br/><span style="margin-left: 15px"></span>';
     html += '用法:' + supplyTypeText + ' ';
     html += '频次:' + orderFrequencyText + ' ';
     html += dayNum + '天 ';
@@ -2560,7 +2570,7 @@ function calculateTotalAmount() {
                 $("#totalAmount").html(res.data.amount.toFixed(1));
                 var arrs = $("span.cf_amount");
                 for (var i = 0; i < arrs.length; i++) {
-                    if(res.data.amountList[i]!=undefined && res.data.amountList[i]!=null){
+                    if (res.data.amountList[i] != undefined && res.data.amountList[i] != null) {
                         $(arrs[i]).html(res.data.amountList[i].toFixed(1));
                     }
                 }
@@ -4113,7 +4123,7 @@ function initNavTabs(index) {
     }
     $("#" + 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+='<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
+    html += '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>';
     html += '<input class="current_groupNo" type="hidden"/>';
     html += '                   <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
         '                       <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;padding-top: 10px;">';
@@ -4231,7 +4241,7 @@ function refreshNavTabs(index, groupNo) {
     $("#" + tabId).find("li.active").removeClass("active");
     $("#" + tabId).append('<li><a href="#' + paneId + '" role="tab" data-toggle="tab">' + cfTitle + '</a></li>');
     $("#" + tabContentId).append('<div class="tab-pane fade in active" id="' + paneId + '" style="height: 100%;min-height: 285px;position: relative;">' +
-    '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>'+
+        '<img src="/thmz/images/prescription.png" style="margin-top: 5px;"/>' +
         '<input class="current_groupNo" type="hidden"/>' +
         '                                    <div class="cf_content rb_item" style="height: 230px;padding-top: 5px;overflow-y: auto;"></div>' +
         '                                    <div style="height: 30px;border-top: 1px solid #ddd;width: 100%;position: absolute;bottom:0;">金额:<span class="cf_amount">0.0</span><span>元</span></div>' +
@@ -4840,7 +4850,7 @@ function getParamsForpPrescription() {
                     }
                     jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
                 }
-                detailPrescription.amount=$(arrs[orderNo-1]).text();
+                detailPrescription.amount = $(arrs[orderNo - 1]).text();
                 if (currentGroupNo == "71") {
                     //普药
                     var pyPrescription = jsonDataPrescription.xyPrescription.pyPrescription;
@@ -4899,12 +4909,12 @@ function getParamsForpPrescription() {
             jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
             detailPrescription.detail[detailPrescription.detail.length] = $(zyTabContents[i]).text();
         }
-        detailPrescription.zyfs=zyfs;
-        detailPrescription.frequency=$('#zy_orderFrequency_1 option:selected').text();
-        detailPrescription.cyJssm=$('#cyJssm option:selected').text();
-        detailPrescription.cyFysm=$('#useType_1 option:selected').text();
-        detailPrescription.cyDj=$('#zy_supplyType_1 option:selected').text();
-        detailPrescription.amount=$(arrs[orderNo-1]).text();
+        detailPrescription.zyfs = zyfs;
+        detailPrescription.frequency = $('#zy_orderFrequency_1 option:selected').text();
+        detailPrescription.cyJssm = $('#cyJssm option:selected').text();
+        detailPrescription.cyFysm = $('#useType_1 option:selected').text();
+        detailPrescription.cyDj = $('#zy_supplyType_1 option:selected').text();
+        detailPrescription.amount = $(arrs[orderNo - 1]).text();
         jsonDataPrescription.zyPrescription[jsonDataPrescription.zyPrescription.length] = detailPrescription;
 
     }
@@ -4953,7 +4963,7 @@ function getParamsForpPrescription() {
             }
             detailPrescription.detail[detailPrescription.detail.length] = $(zlTabContents[i]).text();
         }
-        detailPrescription.amount=$(arrs[orderNo-1]).text();
+        detailPrescription.amount = $(arrs[orderNo - 1]).text();
         jsonDataPrescription.zlPrescription[jsonDataPrescription.zlPrescription.length] = detailPrescription;
     }
     //设置诊断名称
@@ -5043,10 +5053,14 @@ function saveapidAccepts() {
             data: JSON.stringify({
                 "id": $("#templateId").val(),
                 "name": templateName,
-                "icdText": jsonData.icdText!=null?jsonData.icdText:jsonData.mzBlRecord.tentativeDiagnosis,
+                "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
                 "templateType": templateType,
                 "templateStatus": templateStatus,
-                "templateData": JSON.stringify(jsonData)
+                "templateData": JSON.stringify(jsonData),
+                "emrChiefComplaint": $("#symptom").val(),
+                "emrHpi": $("#emrHpi").val(),
+                "emrPs": $("#emrPs").val(),
+                "icdCode": $("#diagnoseValue").val()
             }),
             headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
             success: function (res) {
@@ -5454,7 +5468,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         html += '</div>';
                     }
                     $("#prescriptionDetail_zd").html(html);
-                }else {
+                } else {
                     $("#prescriptionDetail_zd").html(jsonData.mzBlRecord.tentativeDiagnosis);
                 }
                 var emrProcess = jsonData.mzBlRecord.emrProcess;
@@ -5539,7 +5553,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                     $("#printPrescription").removeClass("hide").addClass("in");
                     $("#callPrescription").removeClass("in").addClass("hide");
                     $("#printPrescription").off("click").on("click", function (t) {
-                        printPrescription(patientId, times, clnicId,payMark);
+                        printPrescription(patientId, times, clnicId, payMark);
                     });
                 } else {
                     $("#printPrescription").removeClass("in").addClass("hide");
@@ -5613,10 +5627,10 @@ function printGuideCard(patientId, times) {
  * @param clnicId
  * @param payMark
  */
-function printPrescription(patientId, times, clnicId,payMark) {
+function printPrescription(patientId, times, clnicId, payMark) {
     $.ajax({
         type: "GET",
-        url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark='+payMark+'&clnicId=' + clnicId,
+        url: '/thmz/getMzPrescriptionVo?patientId=' + patientId + '&times=' + times + '&MzBlRecordFlag=false&payMark=' + payMark + '&clnicId=' + clnicId,
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
@@ -5628,7 +5642,7 @@ function printPrescription(patientId, times, clnicId,payMark) {
             if (res.code == 0) {
                 var prescriptionDetail = res.data.mzBlRecord.prescriptionDetail;
                 if (prescriptionDetail != null && prescriptionDetail != "") {
-                    var index =0;
+                    var index = 0;
                     setPrint();
                     LODOP = getLodop();
                     LODOP.PRINT_INITA(6, 0, "148mm", "210mm", "湖南泰和医院处方笺");
@@ -5655,65 +5669,65 @@ function printPrescription(patientId, times, clnicId,payMark) {
                     $("#patientDateGuideCard").text(format(new Date(), "yyyy-MM-dd"));
                     var prescriptionDetailJson = JSON.parse(prescriptionDetail);
                     //普药处方
-                    var pyPrescription =prescriptionDetailJson.xyPrescription.pyPrescription;
-                    if(pyPrescription!=null && pyPrescription.length>0){
-                         for (var i=0;i<pyPrescription.length;i++){
-                             if(index>0){
-                                 LODOP.NewPageA();
-                             }
-                             var prescriptionDetail = pyPrescription[i].detail;
-                             var __ret = setTableHtml(prescriptionDetail);
-                             var html = __ret.html;
-                             var j = __ret.j;
-                             if(res.deptName.indexOf("儿")>0){
-                                 $("#typePrescription").text("儿科");
-                                 $("#cfTitle").text("儿科");
-                             }else if(res.deptName.indexOf("急诊科")>0){
-                                 $("#typePrescription").text("急诊");
-                                 $("#cfTitle").text("急诊");
-                             }else {
-                                 $("#typePrescription").text("普通处方");
-                                 $("#cfTitle").text("普通");
-                             }
-                             $("#prescriptionDetail").html(html);
-                             $("#cfAmountPrint").text(pyPrescription[i].amount+"元 ");
-                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
-                             index++;
-
-                         }
+                    var pyPrescription = prescriptionDetailJson.xyPrescription.pyPrescription;
+                    if (pyPrescription != null && pyPrescription.length > 0) {
+                        for (var i = 0; i < pyPrescription.length; i++) {
+                            if (index > 0) {
+                                LODOP.NewPageA();
+                            }
+                            var prescriptionDetail = pyPrescription[i].detail;
+                            var __ret = setTableHtml(prescriptionDetail);
+                            var html = __ret.html;
+                            var j = __ret.j;
+                            if (res.deptName.indexOf("儿") > 0) {
+                                $("#typePrescription").text("儿科");
+                                $("#cfTitle").text("儿科");
+                            } else if (res.deptName.indexOf("急诊科") > 0) {
+                                $("#typePrescription").text("急诊");
+                                $("#cfTitle").text("急诊");
+                            } else {
+                                $("#typePrescription").text("普通处方");
+                                $("#cfTitle").text("普通");
+                            }
+                            $("#prescriptionDetail").html(html);
+                            $("#cfAmountPrint").text(pyPrescription[i].amount + "元 ");
+                            LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
+                            index++;
+
+                        }
                     }
                     //医材处方
-                    var ycPrescription =prescriptionDetailJson.xyPrescription.ycPrescription;
-                    if(ycPrescription!=null && ycPrescription.length>0){
-                        for (var i=0;i<ycPrescription.length;i++){
-                            if(index>0){
+                    var ycPrescription = prescriptionDetailJson.xyPrescription.ycPrescription;
+                    if (ycPrescription != null && ycPrescription.length > 0) {
+                        for (var i = 0; i < ycPrescription.length; i++) {
+                            if (index > 0) {
                                 LODOP.NewPageA();
                             }
                             var prescriptionDetail = ycPrescription[i].detail;
                             var __ret = setTableHtml(prescriptionDetail);
                             var html = __ret.html;
                             var j = __ret.j;
-                            if(res.deptName.indexOf("儿")>0){
+                            if (res.deptName.indexOf("儿") > 0) {
                                 $("#typePrescription").text("儿科");
                                 $("#cfTitle").text("儿科");
-                            }else if(res.deptName.indexOf("急诊科")>0){
+                            } else if (res.deptName.indexOf("急诊科") > 0) {
                                 $("#typePrescription").text("急诊");
                                 $("#cfTitle").text("急诊");
-                            }else {
+                            } else {
                                 $("#typePrescription").text("医材处方");
                                 $("#cfTitle").text("普通");
                             }
                             $("#prescriptionDetail").html(html);
-                            $("#cfAmountPrint").text(ycPrescription[i].amount+"元 ");
+                            $("#cfAmountPrint").text(ycPrescription[i].amount + "元 ");
                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                             index++;
                         }
                     }
                     //麻精处方
-                    var mjPrescription =prescriptionDetailJson.xyPrescription.mjPrescription;
-                    if(mjPrescription!=null && mjPrescription.length>0){
-                        for (var i=0;i<mjPrescription.length;i++){
-                            if(index>0){
+                    var mjPrescription = prescriptionDetailJson.xyPrescription.mjPrescription;
+                    if (mjPrescription != null && mjPrescription.length > 0) {
+                        for (var i = 0; i < mjPrescription.length; i++) {
+                            if (index > 0) {
                                 LODOP.NewPageA();
                             }
                             var prescriptionDetail = mjPrescription[i].detail;
@@ -5723,16 +5737,16 @@ function printPrescription(patientId, times, clnicId,payMark) {
                             $("#typePrescription").text("麻、精一处方");
                             $("#cfTitle").text("麻、精一");
                             $("#prescriptionDetail").html(html);
-                            $("#cfAmountPrint").text(mjPrescription[i].amount+"元 ");
+                            $("#cfAmountPrint").text(mjPrescription[i].amount + "元 ");
                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                             index++;
                         }
                     }
                     //精二处方
-                    var jePrescription =prescriptionDetailJson.xyPrescription.jePrescription;
-                    if(jePrescription!=null && jePrescription.length>0){
-                        for (var i=0;i<jePrescription.length;i++){
-                            if(index>0){
+                    var jePrescription = prescriptionDetailJson.xyPrescription.jePrescription;
+                    if (jePrescription != null && jePrescription.length > 0) {
+                        for (var i = 0; i < jePrescription.length; i++) {
+                            if (index > 0) {
                                 LODOP.NewPageA();
                             }
                             var prescriptionDetail = jePrescription[i].detail;
@@ -5742,151 +5756,154 @@ function printPrescription(patientId, times, clnicId,payMark) {
                             $("#typePrescription").text("精二处方");
                             $("#cfTitle").text("精二");
                             $("#prescriptionDetail").html(html);
-                            $("#cfAmountPrint").text(jePrescription[i].amount+"元 ");
+                            $("#cfAmountPrint").text(jePrescription[i].amount + "元 ");
                             LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                             index++;
                         }
                     }
                     //中药处方
-                    var zyPrescription =prescriptionDetailJson.zyPrescription[0].detail;
-                    if(zyPrescription!=null && zyPrescription.length>0){
+                    var zyPrescription = prescriptionDetailJson.zyPrescription[0].detail;
+                    if (zyPrescription != null && zyPrescription.length > 0) {
                         var html = "";
-                        for (var i=0;i<zyPrescription.length;i++){
-                            if(i%3==0){
-                                html+="<tr>";
+                        for (var i = 0; i < zyPrescription.length; i++) {
+                            if (i % 3 == 0) {
+                                html += "<tr>";
                             }
-                            html+="<td>";
-                            html+=zyPrescription[i].trim();
-                            if(i%3==2){
-                                html+="</td></tr>";
-                            }else {
-                                html+="</td>";
+                            html += "<td>";
+                            html += zyPrescription[i].trim();
+                            if (i % 3 == 2) {
+                                html += "</td></tr>";
+                            } else {
+                                html += "</td>";
                             }
                         }
-                        if(zyPrescription.length%3!=0){
-                            html+="</tr>";
+                        if (zyPrescription.length % 3 != 0) {
+                            html += "</tr>";
                         }
-                        html+="<tr><td>X "+prescriptionDetailJson.zyPrescription[0].zyfs+"付</td>";
-                        var colNum=1;
-                        var frequency=prescriptionDetailJson.zyPrescription[0].frequency;
-                        if(frequency!=null && frequency!=""){
-                            html+="<td>频率:"+frequency+"</td>";
+                        html += "<tr><td>X " + prescriptionDetailJson.zyPrescription[0].zyfs + "付</td>";
+                        var colNum = 1;
+                        var frequency = prescriptionDetailJson.zyPrescription[0].frequency;
+                        if (frequency != null && frequency != "") {
+                            html += "<td>频率:" + frequency + "</td>";
                             colNum++;
                         }
-                        var cyJssm=prescriptionDetailJson.zyPrescription[0].cyJssm;
-                        if(cyJssm!=null && cyJssm!=""){
-                            html+="<td>加水说明:"+cyJssm+"</td>";
+                        var cyJssm = prescriptionDetailJson.zyPrescription[0].cyJssm;
+                        if (cyJssm != null && cyJssm != "") {
+                            html += "<td>加水说明:" + cyJssm + "</td>";
                             colNum++;
-                            if(colNum%3==0){
-                                html+="</tr>";
+                            if (colNum % 3 == 0) {
+                                html += "</tr>";
                             }
                         }
-                        var cyFysm=prescriptionDetailJson.zyPrescription[0].cyFysm;
-                        if(cyFysm!=null && cyFysm!=""){
+                        var cyFysm = prescriptionDetailJson.zyPrescription[0].cyFysm;
+                        if (cyFysm != null && cyFysm != "") {
                             colNum++;
-                            if(colNum%3==1){
-                                html+="<tr>";
+                            if (colNum % 3 == 1) {
+                                html += "<tr>";
                             }
-                            html+="<td>服用说明:"+cyFysm+"</td>";
-                            if(colNum%3==0){
-                                html+="</tr>";
+                            html += "<td>服用说明:" + cyFysm + "</td>";
+                            if (colNum % 3 == 0) {
+                                html += "</tr>";
                             }
                         }
-                        var cyDj=prescriptionDetailJson.zyPrescription[0].cyDj;
-                        if(cyDj!=null && cyDj!=""){
+                        var cyDj = prescriptionDetailJson.zyPrescription[0].cyDj;
+                        if (cyDj != null && cyDj != "") {
                             colNum++;
-                            if(colNum%3==1){
-                                html+="<tr>";
+                            if (colNum % 3 == 1) {
+                                html += "<tr>";
                             }
-                            html+="<td>"+cyDj+"</td>";
-                            if(colNum%3==0){
-                                html+="</tr>";
+                            html += "<td>" + cyDj + "</td>";
+                            if (colNum % 3 == 0) {
+                                html += "</tr>";
                             }
                         }
-                        if(index>0){
+                        if (index > 0) {
                             LODOP.NewPageA();
                         }
-                        if(res.deptName.indexOf("儿")>0){
+                        if (res.deptName.indexOf("儿") > 0) {
                             $("#typePrescription").text("儿科");
                             $("#cfTitle").text("儿科");
-                        }else if(res.deptName.indexOf("急诊科")>0){
+                        } else if (res.deptName.indexOf("急诊科") > 0) {
                             $("#typePrescription").text("急诊");
                             $("#cfTitle").text("急诊");
-                        }else {
+                        } else {
                             $("#typePrescription").text("中药处方");
                             $("#cfTitle").text("普通");
                         }
                         $("#prescriptionDetail").html(html);
-                        $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount+"元 ");
+                        $("#cfAmountPrint").text(prescriptionDetailJson.zyPrescription[0].amount + "元 ");
                         LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                         index++;
                     }
                     //诊疗处方
-                    var zlPrescription =prescriptionDetailJson.zlPrescription[0].detail;
-                    if(zlPrescription!=null && zlPrescription.length>0){
+                    var zlPrescription = prescriptionDetailJson.zlPrescription[0].detail;
+                    if (zlPrescription != null && zlPrescription.length > 0) {
                         var html = "";
-                        for (var i=0;i<zlPrescription.length;i++){
-                            html+="<tr><td>";
-                            html+=zlPrescription[i];
-                            html+="</td></tr>";
+                        for (var i = 0; i < zlPrescription.length; i++) {
+                            html += "<tr><td>";
+                            html += zlPrescription[i];
+                            html += "</td></tr>";
                         }
-                        if(index>0){
+                        if (index > 0) {
                             LODOP.NewPageA();
                         }
-                        if(res.deptName.indexOf("儿")>0){
+                        if (res.deptName.indexOf("儿") > 0) {
                             $("#typePrescription").text("儿科");
                             $("#cfTitle").text("儿科");
-                        }else if(res.deptName.indexOf("急诊科")>0){
+                        } else if (res.deptName.indexOf("急诊科") > 0) {
                             $("#typePrescription").text("急诊");
                             $("#cfTitle").text("急诊");
-                        }else {
+                        } else {
                             $("#typePrescription").text("诊疗处方");
                             $("#cfTitle").text("普通");
                         }
                         $("#prescriptionDetail").html(html);
-                        $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount+"元 ");
+                        $("#cfAmountPrint").text(prescriptionDetailJson.zlPrescription[0].amount + "元 ");
                         LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("prescription_table").innerHTML);
                         index++;
                     }
 
                     $.ajax({
                         type: "GET",
-                        url: '/thmz/getChargeDetailForGuideCard?patientId='+patientId+'&times='+times,
+                        url: '/thmz/getChargeDetailForGuideCard?patientId=' + patientId + '&times=' + times,
                         contentType: "application/json;charset=UTF-8",
                         dataType: "json",
-                        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+                        headers: {
+                            'Accept': 'application/json',
+                            'Authorization': 'Bearer ' + localStorage.getItem("token")
+                        },
                         success: function (res) {
                             if (res == '401' || res == 401) {
                                 window.location.href = '/thmz/login/view'
                                 return;
                             }
                             if (res.code == 0) {
-                                if(res.data!=null && res.data.length>0){
-                                    var html="";
-                                    for(var i=0;i<res.data.length;i++){
-                                        html+="<tr><td>"+res.data[i].itemType+"</td><td>"+Division(res.data[i].itemTotalFee,100).toFixed(2)+"</td><td>"+res.data[i].execDeptName+"</td><td>"+res.data[i].execDeptAddress+"</td></tr>"
+                                if (res.data != null && res.data.length > 0) {
+                                    var html = "";
+                                    for (var i = 0; i < res.data.length; i++) {
+                                        html += "<tr><td>" + res.data[i].itemType + "</td><td>" + Division(res.data[i].itemTotalFee, 100).toFixed(2) + "</td><td>" + res.data[i].execDeptName + "</td><td>" + res.data[i].execDeptAddress + "</td></tr>"
                                     }
                                     $("#guideCardDetail").html(html);
                                 }
-                                if(res.payQrcode!=null && res.payQrcode!=""){
+                                if (res.payQrcode != null && res.payQrcode != "") {
                                     $("#payQrcodeGuideCard").html(null);
                                     new QRCode(document.getElementById("payQrcodeGuideCard"), res.payQrcode);  // 设置要生成二维码的链接
-                                    $("canvas").attr("id","erw");
+                                    $("canvas").attr("id", "erw");
                                     var canvas = document.getElementById('erw');
                                     var src = canvas.toDataURL("image/png");
                                     //var strDataURI =canvas.toDataURL("image/png");
-                                    $("#payQrcodeGuideCard").html("<img src='"+src+"' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>微信支付</div>");
+                                    $("#payQrcodeGuideCard").html("<img src='" + src + "' style='width:100px;height:100px;'/><div style='width: 100px;margin-top: 10px;text-align: center;'>微信支付</div>");
                                 }
-                                $("#totalAmountGuideCard").text("¥"+res.totalAmount);
-                               // $("#imgcode").JsBarcode(patientId);
+                                $("#totalAmountGuideCard").text("¥" + res.totalAmount);
+                                // $("#imgcode").JsBarcode(patientId);
                                 console.log(patientId);
-                                JsBarcode('#imgcode', patientId, {
-                                    lineColor: '#333', //线条颜色
-                                    width: 2, //线宽
-                                    height: 60, //条码高度
-                                    displayValue: false, //是否显示文字信息
+                                JsBarcode('#imgcode', patientId, {
+                                    lineColor: '#333', //线条颜色
+                                    width: 2, //线宽
+                                    height: 60, //条码高度
+                                    displayValue: false, //是否显示文字信息
                                 });
-                                if(index>0){
+                                if (index > 0) {
                                     LODOP.NewPageA();
                                 }
                                 LODOP.ADD_PRINT_HTM("0mm", "5mm", "140mm", "200mm", strStyle + document.getElementById("guide_card_table").innerHTML);
@@ -5898,7 +5915,7 @@ function printPrescription(patientId, times, clnicId,payMark) {
                             }
                         }
                     });
-                   // printGuideCard(patientId, times);
+                    // printGuideCard(patientId, times);
                 }
             } else {
                 errorMesage(res);