Sfoglia il codice sorgente

取消接诊功能开发完成

hurugang 3 anni fa
parent
commit
ec45cf7fae

+ 54 - 6
src/main/java/cn/hnthyy/thmz/controller/mz/ClinicController.java

@@ -150,6 +150,54 @@ public class ClinicController {
     }
 
 
+    /**
+     * 取消接诊接诊
+     *
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/cancelClinic", method = {RequestMethod.GET})
+    public Map<String, Object> cancelClinic(@RequestParam("patientId") String patientId, @RequestParam("times") Integer times, HttpServletRequest httpServletRequest) {
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if (StringUtils.isBlank(patientId)) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人id不能为空");
+                return resultMap;
+            }
+            if (times == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人挂号次数不能为空");
+                return resultMap;
+            }
+            MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
+            if (mzPatientMi == null) {
+                resultMap.put("code", -1);
+                resultMap.put("message", "病人不存在");
+                return resultMap;
+            }
+            User tokenUser = TokenUtil.getUser(httpServletRequest);
+            int num = clinicService.cancelClinic(patientId, times, tokenUser.getUserIdCode());
+            if (num > 0) {
+                resultMap.put("code", 0);
+                resultMap.put("message", "取消接诊成功");
+                resultMap.put("data", mzPatientMi);
+                return resultMap;
+            }
+            resultMap.put("code", -1);
+            resultMap.put("message", "取消接诊失败");
+            resultMap.put("data", mzPatientMi);
+            return resultMap;
+        } catch (Exception e) {
+            e.printStackTrace();
+            resultMap.put("code", -1);
+            resultMap.put("message", "取消接诊出错,请联系管理员");
+            log.error("取消接诊异常,错误信息{}", e);
+            return resultMap;
+        }
+    }
+
+
     /**
      * 根据病人id查询分诊记录
      *
@@ -175,7 +223,7 @@ public class ClinicController {
             if (deptCodes.contains(Constants.EMERGENCY_WARD_CODE)) {
                 deptNo = Constants.EMERGENCY_WARD_CODE;
             }
-            List<MzfzPatientOrder> data = mzfzPatientOrderService.queryByPatientId(patientId,deptNo,tokenUser.getUserIdCode());
+            List<MzfzPatientOrder> data = mzfzPatientOrderService.queryByPatientId(patientId, deptNo, tokenUser.getUserIdCode());
             if (data != null && data.size() > 0) {
                 for (MzfzPatientOrder mzfzPatientOrder : data) {
                     if (mzfzPatientOrder.getDeptCode() != null && StringUtils.isNotBlank(mzfzPatientOrder.getDeptCode())) {
@@ -246,7 +294,7 @@ public class ClinicController {
                 resultMap.put("message", "查询就诊记录失败,参数为空");
                 return resultMap;
             }
-            String patientId=null;
+            String patientId = null;
             if (StringUtils.isBlank(clinic.getPatientName())) {
                 clinic.setPatientName(null);
             } else {
@@ -255,7 +303,7 @@ public class ClinicController {
             if (StringUtils.isBlank(clinic.getPatientId())) {
                 clinic.setPatientId(null);
             } else {
-                patientId=clinic.getPatientId();
+                patientId = clinic.getPatientId();
                 clinic.setPatientId("%" + clinic.getPatientId() + "%");
             }
             if (StringUtils.isBlank(clinic.getCommonParams())) {
@@ -390,7 +438,7 @@ public class ClinicController {
     private void process(Date beginTime, Date endTime, Set<String> set) {
 //        List<MzVisitTable> mzVisitTableList = mzVisitTableService.queryByDateRages(beginTime, endTime, "mz_visit_table_b");
 //        setClinic(mzVisitTableList, set);
-        List<MzVisitTable> mzVisitTableList  = mzVisitTableService.queryByDateRages(beginTime, endTime, "mz_visit_table");
+        List<MzVisitTable> mzVisitTableList = mzVisitTableService.queryByDateRages(beginTime, endTime, "mz_visit_table");
         setClinic(mzVisitTableList, set);
     }
 
@@ -527,7 +575,7 @@ public class ClinicController {
             mzfzPatientOrder.setTableName(MzfzPatientOrder.MZFZ_PATIENT_ORDER);
             mzfzPatientOrder.setDoctorCode(tokenUser.getUserIdCode());
             //未接诊的时候急诊医生可以看全科室的病人
-            if(mzfzPatientOrder.getStatusFlagList().size()>1){
+            if (mzfzPatientOrder.getStatusFlagList().size() > 1) {
                 List<String> deptCodes = mzyRequestService.queryUnitCodeByRequestDayAndDoctor(DateFormatUtils.format(new Date(), "yyyy-MM-dd"), tokenUser.getUserIdCode());
                 if (deptCodes == null) {
                     deptCodes = new ArrayList<>();
@@ -537,7 +585,7 @@ public class ClinicController {
                     mzfzPatientOrder.setDeptCodes(Arrays.asList(Constants.EMERGENCY_WARD_CODE));
                 }
             }
-            mzfzPatientOrder.setEndTime(DateUtil.fomart(DateUtil.getLastSecond(new Date()),"yyyy-MM-dd HH:mm:ss"));
+            mzfzPatientOrder.setEndTime(DateUtil.fomart(DateUtil.getLastSecond(new Date()), "yyyy-MM-dd HH:mm:ss"));
             resultMap.put("code", 0);
             resultMap.put("message", "查询分诊记录成功");
             Integer total = mzfzPatientOrderService.querycountUnClinic(mzfzPatientOrder);

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

@@ -370,6 +370,15 @@ public interface MzyReqrecMapper {
             "</script>"})
     int updateNameByPatientIdAndTimes(@Param("name") String name,@Param("patientId") String patientId,@Param("times") Integer times);
 
+    /**
+     * 取消接诊
+     * @param patientId
+     * @param times
+     * @return
+     */
+    @Update("update mzy_reqrec set cancel_mark=0,visit_date=null,visit_dept=null,visit_doctor=null where patient_id = #{patientId} and times = #{times}")
+    int cancelClinic(@Param("patientId") String patientId,@Param("times") Integer times);
+
 
     /**
      * 根据病人编号查询所有未打印的挂号发票列表

+ 6 - 0
src/main/java/cn/hnthyy/thmz/mapper/thmz/ClinicMapper.java

@@ -187,6 +187,12 @@ public interface ClinicMapper {
             "<when test='clinicStatus!=null'>",
             ",clinic_status =#{clinicStatus}",
             "</when>",
+            "<when test='opId!=null'>",
+            ",op_id =#{opId}",
+            "</when>",
+            "<when test='opDay!=null'>",
+            ",op_day =#{opDay}",
+            "</when>",
             "</trim>",
             "</script>"})
     int updateClinicByPatientIdAndTimes(Clinic clinic);

+ 25 - 2
src/main/java/cn/hnthyy/thmz/service/impl/thmz/ClinicServiceImpl.java

@@ -41,7 +41,7 @@ public class ClinicServiceImpl implements ClinicService {
     public int saveClinic(Clinic clinic) {
         //存在就不插入
         Clinic dbClinic = clinicMapper.selectByPatientIdAndTimesAndReceiptNo(clinic.getPatientId(), clinic.getTimes(), clinic.getReceiptNo());
-        if(dbClinic!=null){
+        if (dbClinic != null) {
             return 1;
         }
         return clinicMapper.insertClinic(clinic);
@@ -80,7 +80,7 @@ public class ClinicServiceImpl implements ClinicService {
             throw new MzException("当前接诊患者的分诊记录不存在");
         }
         //此时已经时接诊中,无需改变状态
-        if(ClinicStatusEnum.IN_CLINIC.code.equals(mzfzPatientOrder.getSlowFlag())){
+        if (ClinicStatusEnum.IN_CLINIC.code.equals(mzfzPatientOrder.getSlowFlag())) {
             return 0;
         }
         MzVisitTable mzVisitTable = mzVisitTableService.queryByPatientIdAndTimes(mzfzPatientOrder.getPatientId(), mzfzPatientOrder.getTimes());
@@ -105,4 +105,27 @@ public class ClinicServiceImpl implements ClinicService {
         updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.IN_CLINIC.code);
         return mzfzPatientOrderMapper.updateMzfzPatientOrder(updateMzfzPatientOrder);
     }
+
+    @Override
+    public int cancelClinic(String patientId, Integer times,String userIdCode) throws MzException {
+        MzyReqrec mzyReqrec = mzyReqrecMapper.selectMzyReqrecByPatientIdAndTimes(patientId, times, "mzy_reqrec");
+        if (mzyReqrec == null) {
+            throw new MzException("当前接诊患者的挂号记录不存在");
+        }
+        int num = mzyReqrecMapper.cancelClinic(patientId, times);
+        if (num > 0) {
+            Clinic clinic = new Clinic();
+            clinic.setPatientId(patientId);
+            clinic.setTimes(times);
+            clinic.setClinicStatus(ClinicStatusEnum.REGISTRATION.code);
+            clinic.setOpId(userIdCode);
+            clinic.setOpDay(new Date());
+            clinicMapper.updateClinicByPatientIdAndTimes(clinic);
+            MzfzPatientOrder updateMzfzPatientOrder = new MzfzPatientOrder();
+            updateMzfzPatientOrder.setSerialNo(Integer.valueOf(mzyReqrec.getSerialNo()));
+            updateMzfzPatientOrder.setStatusFlag(MzfzStatusEnum.UN_TRIAGE.code);
+            mzfzPatientOrderMapper.updateMzfzPatientOrder(updateMzfzPatientOrder);
+        }
+        return num;
+    }
 }

+ 10 - 0
src/main/java/cn/hnthyy/thmz/service/thmz/ClinicService.java

@@ -64,4 +64,14 @@ public interface ClinicService {
      * @return
      */
     int inClinic(String patientId,String serialNo, User tokenUser) throws MzException;
+
+    /**
+     * 取消接诊
+     * @param patientId 病人id
+     * @param times 就诊次数
+     * @param userIdCode 操作人编码
+     * @return
+     */
+    int cancelClinic(String patientId,Integer times,String userIdCode) throws MzException;
+
 }

+ 39 - 1
src/main/resources/static/js/mz/clinic.js

@@ -1040,7 +1040,7 @@ function loadCanClinicTableList(id, queryParams) {
                         return '<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
                     } else if (row.statusFlag == 8) {
                         //TODO 继续接诊需要新方法
-                        return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">续接诊</a>';
+                        return '<a title="继续接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">续诊</a> <a title="取消诊" onclick="cancelClinic(\'' + row.patientId + '\',\'' + row.times + '\')" style="cursor: pointer">消诊</a>';
                     } else if (row.statusFlag == 1 || row.statusFlag == 2 || row.statusFlag == 3) {
                         return '<a title="通知" onclick="clinicCallNumber(\'' + row.serialNo + '\')" style="cursor: pointer">通知</a>&nbsp;<a title="接诊" onclick="clinicalReception(\'' + row.patientId + '\',\'' + row.serialNo + '\')" style="cursor: pointer">接诊</a>';
                     }
@@ -1171,6 +1171,44 @@ function clinicalReception(patientId, serialNo) {
     }
 }
 
+/**
+ * 取消接诊
+ * @param patientId
+ */
+function cancelClinic(patientId, times) {
+    $("#messageModal").modal();
+    $("#messageContent").html("确认取消当前病人的接诊记录吗?");
+    $("#messageButton").off("click").on("click", function (t) {
+        $("#messageModal").modal("hide");
+        $.ajax({
+            type: "GET",
+            url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
+            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) {
+                    if (res.data == null || res.data.length == 0) {
+                        return;
+                    }
+                    successMesage(res);
+                    if (times > 0) {
+                        loadUnClinicTableList();
+                        loadInClinicTableList();
+                    }
+                } else if (res.code == -1) {
+                    errorMesage(res);
+                }
+            }
+        });
+    });
+};
+
+
 /**
  * 设置当前接诊病人信息
  * @param mzPatientMi

+ 86 - 25
src/main/resources/static/js/mz/registration_list.js

@@ -199,12 +199,12 @@ $(function () {
      */
     $("#saveConfirmFee").on("click", function (t) {
         var serialNo = $("#serialNo").val();
-        if (!confirm("确定要将流水号【"+serialNo+"】的挂号记录退费重收吗?")) {
+        if (!confirm("确定要将流水号【" + serialNo + "】的挂号记录退费重收吗?")) {
             return;
         }
         $.ajax({
             type: "GET",
-            url: '/thmz/chargeFeeForByjz?serialNo='+serialNo+"&paymode="+$("#payType").val(),
+            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")},
@@ -1571,13 +1571,13 @@ function loadCardList() {
                     html += '</div><div class="el-row" title="' + mzyReqrecVo.mzPatientMi.phoneNo + '">' + sex + ' / ' + mzyReqrecVo.mzPatientMi.age + '岁 / ' + mzyReqrecVo.mzPatientMi.phoneNo + '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.ampm + '">' + mzyReqrecVo.mzyReqrec.ampm + ' / ' + mzyReqrecVo.mzyReqrec.chargeType + '</div><div class="el-row" title="' + mzyReqrecVo.mzyReqrec.chargeType + '">' + mzyReqrecVo.mzyReqrec.unitCode + ' / ' + mzyReqrecVo.mzyReqrec.doctorCode + '</div><div class="el-row">' + format(mzyReqrecVo.mzyReqrec.requestDay, "yyyy-MM-dd HH:mm:ss") + '</div></div></div>';
                     if (mzyReqrecVo.mzyReqrec.cancelMark == 1) {
                         html += '<div class="patient-card-foot">' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="修改挂号">' +
                             '                                <i class="fa fa-edit"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="registration-no-color-foot-button"' +
                             '                                    title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
                             '                                <i class="fa fa-user"></i>' +
@@ -1589,13 +1589,19 @@ function loadCardList() {
                             // '                                <i class="fa fa-credit-card"></i>' +
                             // '                            </button>' +
                             // '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
+                            '                            <button type="button" class="can-not-used"' +
+                            '                                    title="取消接诊">' +
+                            '                                <i class="fa fa-mail-reply"></i>' +
+                            '                            </button>' +
+                            '                        </div>' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="退号">' +
                             '                                <i class="fa fa-minus-square-o"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="打印">' +
                             '                                <i class="fa fa-print"></i>' +
@@ -1605,13 +1611,13 @@ function loadCardList() {
                     }
                     if (mzyReqrecVo.mzyReqrec.visitedMark == 1) {
                         html += '<div class="patient-card-foot">' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="修改挂号">' +
                             '                                <i class="fa fa-edit"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="registration-no-color-foot-button"' +
                             '                                    title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
                             '                                <i class="fa fa-user"></i>' +
@@ -1623,13 +1629,19 @@ function loadCardList() {
                             // '                                <i class="fa fa-credit-card"></i>' +
                             // '                            </button>' +
                             // '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
+                            '                            <button type="button" class="registration-no-color-foot-button"' +
+                            '                                    title="取消接诊"  onclick="cancelClinic\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
+                            '                                <i class="fa fa-mail-reply"></i>' +
+                            '                            </button>' +
+                            '                        </div>' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="退号">' +
                             '                                <i class="fa fa-minus-square-o"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">';
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">';
                         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>';
@@ -1647,13 +1659,13 @@ function loadCardList() {
                             '                    </div>';
                     } else {
                         html += '<div class="patient-card-foot">' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="can-not-used"' +
                             '                                    title="修改挂号">' +
                             '                                <i class="fa fa-edit"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="registration-no-color-foot-button"' +
                             '                                    title="修改患者" onclick="editUserModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\')">' +
                             '                                <i class="fa fa-user"></i>' +
@@ -1665,13 +1677,19 @@ function loadCardList() {
                             // '                                <i class="fa fa-credit-card"></i>' +
                             // '                            </button>' +
                             // '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
+                            '                            <button type="button" class="can-not-used"' +
+                            '                                    title="取消接诊">' +
+                            '                                <i class="fa fa-mail-reply"></i>' +
+                            '                            </button>' +
+                            '                        </div>' +
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">' +
                             '                            <button type="button" class="registration-no-color-foot-button"' +
                             '                                    title="退号" onclick="backNoModal(\'' + mzyReqrecVo.mzyReqrec.patientId + '\',' + mzyReqrecVo.mzyReqrec.times + ')">' +
                             '                                <i class="fa fa-minus-square-o"></i>' +
                             '                            </button>' +
                             '                        </div>' +
-                            '                        <div class="col-md-3 col-sm-3 col-xs-12">';
+                            '                        <div class="col-md-2 col-sm-2 col-xs-12">';
                         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>';
@@ -1742,13 +1760,13 @@ function loadTableList() {
                     align: "center",
                     valign: 'middle',
                     // sortable: true
-                },{
+                }, {
                     field: 'mzyReqrec.times',
                     title: '就诊次数',
                     align: "center",
                     valign: 'middle',
                     // sortable: true
-                },{
+                }, {
                     field: 'mzyReqrec.name',
                     title: '病人姓名',
                     align: "center",
@@ -1848,12 +1866,14 @@ function loadTableList() {
                     formatter: function (value, row, index) {
                         if (row.mzyReqrec.cancelMark == 1) {
                             return '<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="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                                //       '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                                '<button type="button" class="can-not-used"  title="取消接诊"><i class="fa fa-mail-reply"></i></button>'+
                                 '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button><button type="button" class="can-not-used" title="打印" ><i class="fa fa-print"></i></button>';
                         }
                         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="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\',\''+row.mzyReqrec.times+','+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                                // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\',\''+row.mzyReqrec.times+','+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                                '<button type="button" class="registration-no-color-foot-button"  title="取消接诊" onclick="cancelClinic(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-mail-reply"></i></button>'+
                                 '<button type="button" class="can-not-used" title="退号"><i class="fa fa-minus-square-o"></i></button>';
                             if (row.mzyReqrec.paymode == "本院记账") {
                                 html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
@@ -1867,11 +1887,13 @@ function loadTableList() {
                                 }
                                 html += '<i class="fa fa-print"></i></button>';
                             }
+                           // html += '<button type="button" class="registration-no-color-foot-button"  title="取消接诊" onclick="cancelClinic(\'' + row.mzyReqrec.patientId + '\',' + row.mzyReqrec.times + ')"><i class="fa fa-mail-reply"></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="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                            // '<button type="button" class="registration-no-color-foot-button" title="修改收款方式" onclick="editPayMode(\'' + row.mzyReqrec.patientId + '\','+row.mzyReqrec.times+',\''+row.mzyReqrec.paymode+'\','+row.mzyReqrec.dcountNo+')"><i class="fa fa-credit-card"></i></button>' +
+                            '<button type="button" class="can-not-used"  title="取消接诊"><i class="fa fa-mail-reply"></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>';
                         if (row.mzyReqrec.paymode == "本院记账") {
                             html += '                            <button type="button" class="registration-no-color-foot-button"  title="退记账重收" onclick="chargeFeeForByjz(\'' + row.mzyReqrec.serialNo + '\')">';
@@ -1885,6 +1907,7 @@ function loadTableList() {
                             }
                             html += '<i class="fa fa-print"></i></button>';
                         }
+                        //html += '<button type="button" class="can-not-used"  title="取消接诊"><i class="fa fa-mail-reply"></i></button>';
                         return html;
                     }
                 }],
@@ -2208,6 +2231,44 @@ function prn1Print(patientId, times) {
 };
 
 
+/**
+ * 取消接诊
+ * @param patientId
+ */
+function cancelClinic(patientId, times) {
+    $("#messageModal").modal();
+    $("#messageContent").html("确认取消当前病人的接诊记录吗?");
+    $("#messageButton").off("click").on("click", function (t) {
+        $("#messageModal").modal("hide");
+        $.ajax({
+            type: "GET",
+            url: '/thmz/cancelClinic?patientId=' + patientId + "&times=" + times,
+            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) {
+                    if (res.data == null || res.data.length == 0) {
+                        return;
+                    }
+                    successMesage(res);
+                    if (times > 0) {
+                        loadTableCount();
+                        loadRegistrationList(true);
+                    }
+                } else if (res.code == -1) {
+                    errorMesage(res);
+                }
+            }
+        });
+    });
+};
+
+
 //判断字符是否为空的方法
 function isEmpty(obj) {
     if (typeof obj == "undefined" || obj == null || obj == "") {
@@ -2248,10 +2309,10 @@ function exportExcel() {
  * @param times
  * @param paymode
  */
-function editPayMode(patientId,times,paymode,dcountNo) {
-    var message = "当前病人本次挂号的收费方式为【"+paymode+"】,确定需要修改吗?";
-    if(dcountNo==1){
-        message = "当前病人本次挂号的收费方式为【"+paymode+"】,且本次挂号已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次挂号所在日期的【日结报表】!";
+function editPayMode(patientId, times, paymode, dcountNo) {
+    var message = "当前病人本次挂号的收费方式为【" + paymode + "】,确定需要修改吗?";
+    if (dcountNo == 1) {
+        message = "当前病人本次挂号的收费方式为【" + paymode + "】,且本次挂号已经结算,确定需要修改吗?如仍需继续修改,会影响已经结算的报表,请重新打印本次挂号所在日期的【日结报表】!";
     }
     $("#editPayModeTip").html(message);
     $("#patientId").val(patientId);
@@ -2265,10 +2326,10 @@ function editPayMode(patientId,times,paymode,dcountNo) {
 /**
  * 提交修改收款方式
  */
-function saveEditPayMode(){
+function saveEditPayMode() {
     $.ajax({
         type: "GET",
-        url: '/thmz/updatePayMode?patientId=' + $("#patientId").val() + "&times=" + $("#times").val()+"&payMode="+$("#payTypeEditPayMode").val(),
+        url: '/thmz/updatePayMode?patientId=' + $("#patientId").val() + "&times=" + $("#times").val() + "&payMode=" + $("#payTypeEditPayMode").val(),
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},

+ 33 - 0
src/main/resources/templates/mz/registration_list.html

@@ -809,6 +809,39 @@
 </div>
 <!--修改付款方式弹窗结尾-->
 
+
+<!--提示弹窗开始-->
+<div class="modal fade bs-example-modal-sm in" tabindex="-1" role="dialog" aria-hidden="true" id="messageModal"
+     style="top:20%;">
+    <div class="modal-dialog modal-sm">
+        <div class="modal-content" style="width: 480px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">提示</h4>
+            </div>
+            <div class="modal-body">
+                <form class="form-horizontal form-label-left" novalidate>
+                    <div class="col-md-2 col-sm-2 col-xs-12">
+                        <i class="fa fa-info-circle blue fa-3x"></i>
+                    </div>
+                    <div class="col-md-10 col-sm-10 col-xs-12"
+                         style="font-size: 14px;font-weight: 700;min-height: 39px;line-height: 39px;" id="messageContent">
+                        当前有病人正在接诊,是否切换?
+                    </div>
+                </form>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-primary" id="messageButton">确定</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>