Browse Source

本院记账的挂号信息支持退费重收

hurugang 4 years ago
parent
commit
71bb1dde3d

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

@@ -398,4 +398,40 @@ public class MzPatientMiController {
         }
         return false;
     }
+
+
+
+    /**
+     * 消卡
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/clearIcCardNo", method = {RequestMethod.GET})
+    public Map<String, Object> clearIcCardNo(@RequestParam String patientId) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "销卡的病人id不能为空");
+                return resultMap;
+            }
+            int num = mzPatientMiService.clearIcCardNo(patientId);
+            if (num == 1) {
+                resultMap.put("code", 0);
+                resultMap.put("message", "销卡成功");
+                return resultMap;
+            }
+            resultMap.put("code", -1);
+            resultMap.put("message", "销卡失败");
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "销卡失败,系统出错,请联系管理员");
+            log.error("销卡失败,系统异常,错误信息{}", e.getMessage());
+            return resultMap;
+        }
+    }
+
 }

+ 25 - 15
src/main/java/cn/hnthyy/thmz/controller/MzyReqrecController.java

@@ -695,39 +695,50 @@ public class MzyReqrecController {
 
 
     /**
-     * 消卡
-     *
+     * 本院记账退费重收
+     * @param serialNo
+     * @param paymode 付费方式
      * @return
      */
     @UserLoginToken
-    @RequestMapping(value = "/clearIcCardNo", method = {RequestMethod.GET})
-    public Map<String, Object> clearIcCardNo(@RequestParam String patientId) {
+    @RequestMapping(value = "/chargeFeeForByjz", method = {RequestMethod.GET})
+    public Map<String, Object> chargeFeeForByjz(@RequestParam Integer serialNo,@RequestParam String paymode, HttpServletRequest httpServletRequest) {
         Map<String, Object> resultMap = new HashMap<>();
         try {
-            if (StringUtils.isBlank(patientId)) {
+            if (serialNo==null) {
                 resultMap.put("code", -1);
-                resultMap.put("message", "销卡的病人id不能为空");
+                resultMap.put("message", "需要退费重收的流水号不能为空");
                 return resultMap;
             }
-            int num = mzPatientMiService.clearIcCardNo(patientId);
-            if (num == 1) {
-                resultMap.put("code", 0);
-                resultMap.put("message", "销卡成功");
+            User tokenUser = TokenUtil.getUser(httpServletRequest);
+            if (tokenUser == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "打印当前挂号的发票信息失败,用户Token不存在");
                 return resultMap;
             }
-            resultMap.put("code", -1);
-            resultMap.put("message", "销卡失败");
+            MzyReqrec mzyReqrec = mzyReqrecService.chargeFeeForByjz(serialNo,paymode,tokenUser.getUserIdCode());
+            if (mzyReqrec==null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "本院记账退费重收操作失败");
+                return resultMap;
+            }
+            resultMap.put("code", 0);
+            resultMap.put("data", mzyReqrec);
+            resultMap.put("message", "本院记账退费重收成功");
             return resultMap;
         } catch (Exception e) {
             e.printStackTrace();
             resultMap.put("code", -1);
-            resultMap.put("message", "销卡失败,系统出错,请联系管理员");
-            log.error("销卡失败,系统异常,错误信息{}", e.getMessage());
+            resultMap.put("message", e.getMessage());
+            log.error("本院记账退费重收失败,系统异常,错误信息{}", e.getMessage());
             return resultMap;
         }
     }
 
 
+
+
+
     /**
      * 门诊号别统计表
      *
@@ -765,7 +776,6 @@ public class MzyReqrecController {
             resultMap.put("code", 0);
             resultMap.put("message", "门诊号别统计表成功");
             List<Map<String, Object>> mzhbCounts = mzyReqrecService.queryMzhbCount(thmzmxsrParamsVo);
-
             if (mzhbCounts == null || mzhbCounts.size() == 0) {
                 resultMap.put("code", -1);
                 resultMap.put("message", "没有查询到符合条件的门诊挂号统计信息");

+ 2 - 1
src/main/java/cn/hnthyy/thmz/entity/his/MzyReqrec.java

@@ -3,6 +3,7 @@ package cn.hnthyy.thmz.entity.his;
 import cn.hnthyy.thmz.Utils.DateUtil;
 import lombok.Data;
 
+import java.io.Serializable;
 import java.math.BigDecimal;
 import java.util.Date;
 
@@ -10,7 +11,7 @@ import java.util.Date;
  * 门诊挂号记录
  */
 @Data
-public class MzyReqrec {
+public class MzyReqrec implements Serializable {
     //病人ID码 门诊号
     private String patientId;
     //门诊挂号次数

+ 16 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/MzyReqrecMapper.java

@@ -192,6 +192,22 @@ public interface MzyReqrecMapper {
             "</script>"})
     MzyReqrec selectMzyReqrecByPatientIdAndTimes(@Param("patientId") String patientId, @Param("times") Integer times);
 
+
+    /**
+     * 按照缴费流水号查询病人挂号信息
+     *
+     * @param serialNo
+     * @return
+     */
+    @Select({"<script>",
+            "select rtrim(patient_id) patient_id,times,rtrim(name) name,rtrim(req_type) req_type,request_day,rtrim(ampm) ampm,rtrim(unit_code) unit_code,",
+            "rtrim(group_code) group_code,rtrim(doctor_code) doctor_code,rtrim(charge_type) charge_type,req_order,req_fee,oth_fee,rtrim(cancel_mark) cancel_mark,",
+            "rtrim(admiss_time) admiss_time,rtrim(op_id) op_id,op_day,clinic_fee,rtrim(visited_mark) visited_mark,rtrim(plus_mark) plus_mark,closing_date,",
+            "rtrim(print_flag) print_flag,rtrim(windows_no) windows_no,serial_no,rtrim(receipt_bill) receipt_bill,dcount_no,brochure_fee,dept_no,visit_dept,",
+            "visit_doctor,visit_date,paymode,psordnum,agtordnum,print_closing_date,print_dcount_no   from dbo.mzy_reqrec where serial_no = #{serialNo}",
+            "</script>"})
+    MzyReqrec selectMzyReqrecBySerialNo(@Param("serialNo") Integer serialNo);
+
     /**
      * 老系统的退号数据清洗 临时用法
      *

+ 21 - 0
src/main/java/cn/hnthyy/thmz/service/his/MzyReqrecService.java

@@ -16,6 +16,12 @@ import java.util.Map;
  * 门诊挂号记录
  */
 public interface MzyReqrecService {
+    /**
+     * 保存挂号信息
+     * @param mzyReqrecPageDto
+     * @return
+     * @throws MzException
+     */
     int saveMzyReqrec(MzyReqrecPageDto mzyReqrecPageDto) throws MzException;
 
 
@@ -57,7 +63,22 @@ public interface MzyReqrecService {
      */
     MzyReqrec queryMzyReqrecByPatientIdAndTimes(String patientId, Integer times);
 
+    /**
+     * 按照缴费流水号查询病人挂号信息
+     *
+     * @param serialNo
+     * @return
+     */
+    MzyReqrec queryMzyReqrecBySerialNo(Integer serialNo);
 
+    /**
+     * 退费重收 本院记账
+     * @param serialNo
+     * @param paymode 付费方式
+     * @param opId 操作员
+     * @return
+     */
+    MzyReqrec chargeFeeForByjz(Integer serialNo,String paymode, String opId) throws MzException;
     /**
      * 根据病人编号查询最后一次挂号信息
      *

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/MzPatientMiServiceImpl.java

@@ -14,6 +14,9 @@ import lombok.extern.slf4j.Slf4j;
 import org.apache.commons.lang3.StringUtils;
 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.Date;
 import java.util.List;
@@ -67,7 +70,9 @@ public class MzPatientMiServiceImpl implements MzPatientMiService {
         return mzPatientMiMapper.insertMzPatientMi(mzPatientMi);
     }
 
+
     @Override
+    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
     public int modifyMzPatientMi(MzPatientMi mzPatientMi) {
         if(StringUtils.isBlank(mzPatientMi.getPatientId())){
             return 0;

+ 102 - 9
src/main/java/cn/hnthyy/thmz/service/impl/his/MzyReqrecServiceImpl.java

@@ -1,5 +1,6 @@
 package cn.hnthyy.thmz.service.impl.his;
 
+import cn.hnthyy.thmz.Utils.CloneUtil;
 import cn.hnthyy.thmz.Utils.DateUtil;
 import cn.hnthyy.thmz.common.Constants;
 import cn.hnthyy.thmz.entity.MzException;
@@ -121,15 +122,7 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         //covidManage(mzyReqrec, mzPatientMi, mzyRequest);
 
 
-        MzVisitTable lastMzVisitTable = mzVisitTableMapper.selectLastMzVisitTableByPatientId(mzyReqrec.getPatientId());
-        int times = 0;
-        if (lastMzVisitTable != null && lastMzVisitTable.getTimes() != null && lastMzVisitTable.getTimes() > times) {
-            times = lastMzVisitTable.getTimes();
-        }
-        if (mzPatientMi.getTimes() != null && mzPatientMi.getTimes() > times) {
-            times = mzPatientMi.getTimes();
-        }
-        times++;
+        int times = getTimes(mzyReqrec, mzPatientMi);
         int serialNo = mzSerialNoService.getMzSerialNo();
         Date now = new Date();
         MzVisitTable newMzVisitTable = getMzVisitTable(mzyReqrecPageDto, mzyReqrec, mzPatientMi, windows, times, serialNo, now);
@@ -169,6 +162,25 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         return 1;
     }
 
+    /**
+     * 获取新的缴费次数
+     * @param mzyReqrec
+     * @param mzPatientMi
+     * @return
+     */
+    private int getTimes(MzyReqrec mzyReqrec, MzPatientMi mzPatientMi) {
+        MzVisitTable lastMzVisitTable = mzVisitTableMapper.selectLastMzVisitTableByPatientId(mzyReqrec.getPatientId());
+        int times = 0;
+        if (lastMzVisitTable != null && lastMzVisitTable.getTimes() != null && lastMzVisitTable.getTimes() > times) {
+            times = lastMzVisitTable.getTimes();
+        }
+        if (mzPatientMi.getTimes() != null && mzPatientMi.getTimes() > times) {
+            times = mzPatientMi.getTimes();
+        }
+        times++;
+        return times;
+    }
+
     /**
      * 新冠拦截手机挂号
      * @param mzyReqrec
@@ -444,6 +456,87 @@ public class MzyReqrecServiceImpl implements MzyReqrecService {
         return mzyReqrecMapper.selectMzyReqrecByPatientIdAndTimes(patientId, times);
     }
 
+    @Override
+    public MzyReqrec queryMzyReqrecBySerialNo(Integer serialNo) {
+        return mzyReqrecMapper.selectMzyReqrecBySerialNo(serialNo);
+    }
+
+    @Override
+    @Transactional(propagation = Propagation.REQUIRED, isolation = Isolation.DEFAULT, timeout = 36000, rollbackFor = Exception.class)
+    public MzyReqrec chargeFeeForByjz(Integer serialNo, String paymode, String opId) throws MzException {
+        if (serialNo==null) {
+          throw new MzException("需要退费重收的流水号不能为空");
+        }
+        if (StringUtils.isBlank(paymode)) {
+            throw new MzException("收款方式不能为空");
+        }
+        if (Constants.BYJZ.equals(paymode)) {
+            throw new MzException("新收款方式不能为本院记账");
+        }
+        if (StringUtils.isBlank(opId)) {
+            throw new MzException("操作员不能为空");
+        }
+        MzyReqrec dbMzyReqrec=mzyReqrecMapper.selectMzyReqrecBySerialNo(serialNo);
+        if(dbMzyReqrec==null){
+            throw new MzException("流水号对应的挂号信息不存在");
+        }
+        if(!Constants.BYJZ.equals(dbMzyReqrec.getPaymode())){
+            throw new MzException("当前挂号记录非本院记账支付,无法进行退费重收操作!");
+        }
+        MzPatientMi mzPatientMi = mzPatientMiMapper.selectByPatientId(dbMzyReqrec.getPatientId());
+        if (mzPatientMi == null) {
+            throw new MzException("当前病人信息不存在");
+        }
+        MzVisitTable mzVisitTable=mzVisitTableMapper.selectByPatientIdAndTimes(dbMzyReqrec.getPatientId(),dbMzyReqrec.getTimes());
+        if(mzVisitTable==null){
+            throw new MzException("流水号对应的病人就诊记录信息不存在");
+        }
+        //退费之前记账信息,需要把就诊信息也标记成退号
+        MzVisitTable updateMzVisitTable = new MzVisitTable();
+        updateMzVisitTable.setPatientId(dbMzyReqrec.getPatientId());
+        updateMzVisitTable.setTimes(dbMzyReqrec.getTimes());
+        updateMzVisitTable.setCancelMark(dbMzyReqrec.getCancelMark());
+        mzVisitTableMapper.updateMzVisitTable(updateMzVisitTable);
+        int times = getTimes(dbMzyReqrec, mzPatientMi);
+        int newSerialNo = mzSerialNoService.getMzSerialNo();
+        Date now = new Date();
+        mzVisitTable.setTimes(times);
+        mzVisitTable.setOpDay(now);
+        mzVisitTable.setOpId(opId);
+        mzVisitTable.setGhSerialNo(newSerialNo);
+        mzVisitTableMapper.insertMzVisitTable(mzVisitTable);
+        //复制新记录
+        MzyReqrec newMzyReqrec = CloneUtil.clone(dbMzyReqrec);
+        //更新老记录为退号
+        dbMzyReqrec.setCancelMark(YesNoEnum.YES.code);
+        mzyReqrecMapper.updateMzyReqrec(dbMzyReqrec);
+        //将原记录退费
+        dbMzyReqrec.setTimes(-dbMzyReqrec.getTimes());
+        dbMzyReqrec.setReqFee(BigDecimal.ZERO.subtract(dbMzyReqrec.getReqFee()));
+        dbMzyReqrec.setClinicFee(BigDecimal.ZERO.subtract(dbMzyReqrec.getClinicFee()));
+        dbMzyReqrec.setOthFee(BigDecimal.ZERO.subtract(dbMzyReqrec.getOthFee()));
+        dbMzyReqrec.setSerialNo(-dbMzyReqrec.getSerialNo());
+        dbMzyReqrec.setOpDay(now);
+        dbMzyReqrec.setOpId(opId);
+        dbMzyReqrec.setDcountNo(YesNoEnum.NO.code);
+        dbMzyReqrec.setClosingDate(null);
+        dbMzyReqrec.setPrintClosingDate(null);
+        dbMzyReqrec.setPrintDcountNo(YesNoEnum.NO.code);
+        mzyReqrecMapper.insertMzyReqrec(dbMzyReqrec);
+        //入库新的挂号记录
+        newMzyReqrec.setTimes(times);
+        newMzyReqrec.setOpDay(now);
+        newMzyReqrec.setOpId(opId);
+        newMzyReqrec.setDcountNo(YesNoEnum.NO.code);
+        newMzyReqrec.setClosingDate(null);
+        newMzyReqrec.setPrintClosingDate(null);
+        newMzyReqrec.setPrintDcountNo(YesNoEnum.NO.code);
+        newMzyReqrec.setPaymode(paymode);
+        newMzyReqrec.setSerialNo(newSerialNo);
+        mzyReqrecMapper.insertMzyReqrec(newMzyReqrec);
+        return newMzyReqrec;
+    }
+
     @Override
     public MzyReqrec queryLastMzyReqrecByPatientId(String patientId) {
         return mzyReqrecMapper.selectLastMzyReqrecByPatientId(patientId);

+ 91 - 61
src/main/resources/static/js/registration_list.js

@@ -101,17 +101,7 @@ var TableInit = function () {
 $(function () {
     initGenderSelect();
     initResponceTypeSelect();
-    var birthDay = $('#birthDayGroup').datetimepicker({
-        format: 'yyyy-mm-dd',
-        language: 'zh-CN',
-        minView: "month",
-    }).on('changeDate', changeDate);
-
-    var editUserBirthDay = $('#editUserBirthDayGroup').datetimepicker({
-        format: 'yyyy-mm-dd',
-        language: 'zh-CN',
-        minView: "month",
-    });
+
 
     //设置挂号窗口的高度
     var width = $('#confirmFee').css("width");
@@ -169,18 +159,6 @@ $(function () {
     //     }
     // });
 
-    /**
-     * 保存挂号信息
-     */
-    $("#saveConfirmFee").on("click", function (t) {
-        var patientId = $("#patientId").val();
-        if (patientId == null || patientId == "") {
-            savePatient();
-        } else {
-            saveMzyReqrec();
-        }
-
-    });
 
     // /**
     //  * 设置窗口号
@@ -213,6 +191,43 @@ $(function () {
     //     $("#editWindowsModal").modal();
     // });
 
+
+    /**
+     * 退费重收事件
+     */
+    $("#saveConfirmFee").on("click", function (t) {
+        var serialNo = $("#serialNo").val();
+        if (!confirm("确定要将流水号【"+serialNo+"】的挂号记录退费重收吗?")) {
+            return;
+        }
+        $.ajax({
+            type: "GET",
+            url: '/thmz/chargeFeeForByjz?serialNo='+serialNo+"&paymode="+$("#payType").val(),
+            contentType: "application/json;charset=UTF-8",
+            dataType: "json",
+            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) {
+                    $('#confirmFeeModal').modal('hide');
+                    $("#serialNo").val(null);
+                    prn1Print(res.data.patientId, res.data.times);
+                } else {
+                    new PNotify({
+                        title: '错误提示',
+                        text: res.message,
+                        type: 'error',
+                        hide: true,
+                        styling: 'bootstrap3'
+                    });
+                }
+            }
+        });
+    });
+
     /**
      * 患者信息修改
      */
@@ -564,15 +579,6 @@ function listTypeChange(object) {
 }
 
 
-/**
- * 打开编辑挂号信息窗口
- * @param data
- */
-function editRegistration(data) {
-    $("#editRegiModal").modal();
-}
-
-
 /**
  * 打开编辑用户信息窗口
  * @param data
@@ -673,13 +679,6 @@ function backNoModal(patientId, times) {
     $("#backNoModal").modal();
 }
 
-/**
- * 打开打印窗口
- * @param data
- */
-function printOrPreviewModal(data) {
-    $("#printOrPreviewModal").modal();
-}
 
 /**
  * 打开打印内容窗口
@@ -1617,14 +1616,19 @@ function loadCardList() {
                             '                            </button>' +
                             '                        </div>' +
                             '                        <div class="col-md-3 col-sm-3 col-xs-12">';
-                        var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
-                        if (printFlag) {
-                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
+                        if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
+                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
+                            html += '                                <i class="fa fa-rmb"></i>';
                         } else {
-                            html += '                            <button type="button" class="can-not-used" title="打印">';
+                            var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
+                            if (printFlag) {
+                                html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
+                            } else {
+                                html += '                            <button type="button" class="can-not-used" title="打印">';
+                            }
+                            html += '                                <i class="fa fa-print"></i>';
                         }
-                        html += '                                <i class="fa fa-print"></i>' +
-                            '                            </button>' +
+                        html += '                            </button>' +
                             '                        </div>' +
                             '                    </div>';
                     } else {
@@ -1648,14 +1652,19 @@ function loadCardList() {
                             '                            </button>' +
                             '                        </div>' +
                             '                        <div class="col-md-3 col-sm-3 col-xs-12">';
-                        var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
-                        if (printFlag) {
-                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
+                        if (mzyReqrecVo.mzyReqrec.paymode == "本院记账") {
+                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + mzyReqrecVo.mzyReqrec.serialNo + '\')">';
+                            html += '                                <i class="fa fa-rmb"></i>';
                         } else {
-                            html += '                            <button type="button" class="can-not-used" title="打印">';
+                            var printFlag = isEmpty(mzyReqrecVo.mzyReqrec.printerId);
+                            if (printFlag) {
+                                html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">';
+                            } else {
+                                html += '                            <button type="button" class="can-not-used" title="打印">';
+                            }
+                            html += '                                <i class="fa fa-print"></i>';
                         }
-                        html += '                                <i class="fa fa-print"></i>' +
-                            '                            </button>' +
+                        html += '                            </button>' +
                             '                        </div>' +
                             '                    </div>';
                     }
@@ -1808,24 +1817,34 @@ function loadTableList() {
                         }
                         if (row.mzyReqrec.visitedMark == 1) {
                             var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button><button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button>';
-                            var printFlag = isEmpty(row.mzyReqrec.printerId);
-                            if (printFlag) {
-                                html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
+                            if (row.mzyReqrec.paymode == "本院记账") {
+                                html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
+                                html += '<i class="fa fa-rmb"></i></button>';
                             } else {
-                                html += '                            <button type="button" class="can-not-used" title="打印">';
+                                var printFlag = isEmpty(row.mzyReqrec.printerId);
+                                if (printFlag) {
+                                    html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
+                                } else {
+                                    html += '                            <button type="button" class="can-not-used" title="打印">';
+                                }
+                                html += '<i class="fa fa-print"></i></button>';
                             }
-                            html += '<i class="fa fa-print"></i></button>';
                             return html;
 
                         }
                         var html = '<button type="button" class="can-not-used" title="修改挂号"><i class="fa fa-edit"></i></button><button type="button" class="registration-no-color-foot-button"title="修改患者" onclick="editUserModal(\'' + row.mzyReqrec.patientId + '\')"><i class="fa fa-user"></i></button><button type="button" class="registration-no-color-foot-button" title="退号" onclick="backNoModal(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-minus-square-o"></i></button>';
-                        var printFlag = isEmpty(row.mzyReqrec.printerId);
-                        if (printFlag) {
-                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
+                        if (row.mzyReqrec.paymode == "本院记账") {
+                            html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
+                            html += '<i class="fa fa-rmb"></i></button>';
                         } else {
-                            html += '                            <button type="button" class="can-not-used" title="打印">';
+                            var printFlag = isEmpty(row.mzyReqrec.printerId);
+                            if (printFlag) {
+                                html += '                            <button type="button" class="registration-no-color-foot-button"  title="打印" onclick="prn1Print(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')">';
+                            } else {
+                                html += '                            <button type="button" class="can-not-used" title="打印">';
+                            }
+                            html += '<i class="fa fa-print"></i></button>';
                         }
-                        html += '<i class="fa fa-print"></i></button>';
                         return html;
                     }
                 }],
@@ -2061,6 +2080,16 @@ function clearRegistration() {
 }
 
 
+/**
+ * 打开退费重收确认弹框
+ * @param serialNo
+ */
+function chargeFeeForByjz(serialNo) {
+    $("#serialNo").val(serialNo);
+    $("#confirmFeeModal").modal();
+}
+
+
 /**
  * 直接打印发票
  * @param patientId
@@ -2122,6 +2151,7 @@ function prn1Print(patientId, times) {
                 //LODOP.PREVIEW();
                 LODOP.PRINT();
                 if (times > 0) {
+                    loadTableCount();
                     loadRegistrationList(true);
                 }
             } else if (res.code == -1) {

+ 35 - 75
src/main/resources/templates/registration_list.html

@@ -154,81 +154,6 @@
 </div>
 
 
-<!--收费弹窗开始-->
-<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="confirmFeeModal">
-    <div class="modal-dialog modal-lg">
-        <div class="modal-content" style="width: 680px;">
-            <div class="modal-header">
-                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
-                </button>
-                <h4 class="modal-title">收费</h4>
-            </div>
-            <div class="modal-body">
-                <form class="form-horizontal form-label-left" novalidate>
-                    <div class="item form-group"
-                         style="padding: 20px 10px;background: rgb(245, 246, 250);border-radius: 4px;border: none;">
-                        <div class="col-md-12 col-sm-12 col-xs-12">
-                            <div class="col-md-4 col-sm-4 col-xs-12">
-                                <div class="total"> 合计:
-                                    <span class="amountMoney" id="amountMoneyConfirm">0.00</span><span>元</span>
-                                </div>
-                            </div>
-                            <div class="col-md-5 col-sm-5 col-xs-12">
-                                <label class="control-label col-md-4 col-sm-4 col-xs-12" for="realMoney">实收:
-                                </label>
-                                <div class="col-md-8 col-sm-8 col-xs-12">
-                                    <input id="realMoney" class="form-control col-md-5 col-xs-12" type="number"
-                                           data-placement="bottom-right" min="0" onchange="checkFee()" readonly>
-                                </div>
-                            </div>
-                            <div class="col-md-3 col-sm-3 col-xs-12" style="line-height: 34px;">
-                                <span>元(折扣</span><span class="amountMoney" id="discount">100</span><span>%)</span>
-                            </div>
-                        </div>
-                    </div>
-                    <div class="item form-group">
-                        <div class="col-md-12 col-sm-12 col-xs-12">
-                            <div class="col-md-2 col-sm-2 col-xs-12"></div>
-                            <label class="col-md-3 col-sm-3 col-xs-12" for="cash">
-                                <select class="form-control selectpicker show-tick" required="true"
-                                        id="payType" onchange="checkFee()"></select>
-                            </label>
-                            <div class="col-md-3 col-sm-3 col-xs-12">
-                                <input id="cash" class="form-control col-md-5 col-xs-12" type="number"
-                                       data-placement="bottom-right" min="0" onchange="checkFee()">
-                            </div>
-                            <!--<div class="col-md-4 col-sm-4 col-xs-12">
-                                <button type="button" class="btn btn-primary" id="addPayType">
-                                    <span>增加收款方式</span>
-                                </button>
-                                <input type="hidden" id="payTypeIndex" value="0"/>
-                            </div>-->
-                        </div>
-                    </div>
-                    <div class="item form-group" id="changeAmountParent">
-                        <div class="col-md-12 col-sm-12 col-xs-12">
-                            <div class="col-md-2 col-sm-2 col-xs-12"></div>
-                            <label class="control-label col-md-3 col-sm-3 col-xs-12" for="changeAmount">找零金额:
-                            </label>
-                            <div class="col-md-3 col-sm-3 col-xs-12">
-                                <input id="changeAmount" class="form-control col-md-5 col-xs-12"
-                                       data-placement="bottom-right" readonly>
-                            </div>
-                        </div>
-                    </div>
-                </form>
-            </div>
-            <div class="modal-footer">
-                <!--<div style="float: left;margin-left: 10px;">-->
-                    <!--<input type="checkbox"/>&nbsp;&nbsp;打印-->
-                <!--</div>-->
-                <button type="button" class="btn btn-primary" id="saveConfirmFee">确定</button>
-                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
-            </div>
-        </div>
-    </div>
-</div>
-<!--收费弹窗结尾-->
 
 
 <!--修改挂号信息弹窗开始-->
@@ -810,6 +735,41 @@
 <!--</div>-->
 <!--打印设置弹窗结尾-->
 
+
+
+<!--退费重收弹窗开始-->
+<div class="modal fade bs-example-modal-lg" tabindex="-1" role="dialog" aria-hidden="true" id="confirmFeeModal">
+    <div class="modal-dialog modal-lg">
+        <div class="modal-content" style="width: 480px;margin-top: 200px;margin-left: 100px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title">退记账重收</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal form-label-left" novalidate>
+                    <div class="item form-group">
+                        <label class="control-label col-md-3 col-sm-3 col-xs-12" for="payType">收款方式 <span
+                                class="required">*</span>
+                        </label>
+                        <div class="col-md-6 col-sm-6 col-xs-12">
+                            <select class="form-control selectpicker show-tick" required="true"
+                                    id="payType" onchange="checkFee()"></select>
+                        </div>
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <input id="serialNo" type="hidden"/>
+                <button type="button" class="btn btn-primary" id="saveConfirmFee">确定</button>
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--退费重收弹窗结尾-->
+
+
 <object  id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
 </object>