fix(common): 统一异常处理并迁移打印功能到hiprint
- 替换所有System.out.println和printStackTrace为slf4j日志记录 - 在BeanUtils、AuditFieldUtil、DateUtils、ServletUtils等工具类中添加Logger实例 - 在Flowable相关控制器和服务中统一错误日志记录格式 - 在代码生成器中添加日志记录功能 - 将前端打印组件从Lodop迁移到hiprint打印方案 - 更新体温单打印功能使用hiprint预览打印 - 移除调试用的console.log语句 - 修复打印模板中线条元素类型定义
This commit is contained in:
@@ -2,6 +2,8 @@ package com.core.common.utils;
|
||||
|
||||
import com.core.common.core.domain.model.LoginUser;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import java.lang.reflect.Field;
|
||||
@@ -14,6 +16,8 @@ import java.util.Date;
|
||||
@Component
|
||||
public class AuditFieldUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AuditFieldUtil.class);
|
||||
|
||||
/**
|
||||
* 为实体设置创建相关的审计字段
|
||||
* @param entity 实体对象
|
||||
@@ -65,8 +69,7 @@ public class AuditFieldUtil {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("设置创建审计字段时发生异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
log.error("设置创建审计字段时发生异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -110,8 +113,7 @@ public class AuditFieldUtil {
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
System.err.println("设置更新审计字段时发生异常: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
log.error("设置更新审计字段时发生异常", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
package com.core.common.utils;
|
||||
|
||||
import org.apache.commons.lang3.time.DateFormatUtils;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.management.ManagementFactory;
|
||||
import java.text.ParseException;
|
||||
@@ -17,6 +19,9 @@ import java.util.Date;
|
||||
* @author system
|
||||
*/
|
||||
public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DateUtils.class);
|
||||
|
||||
public static String YYYY = "yyyy";
|
||||
|
||||
public static String YYYY_MM = "yyyy-MM";
|
||||
@@ -227,7 +232,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
return endTime;
|
||||
}
|
||||
} catch (DateTimeParseException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("日期解析失败: {}", strDate, e);
|
||||
}
|
||||
return null;
|
||||
}
|
||||
@@ -250,7 +255,7 @@ public class DateUtils extends org.apache.commons.lang3.time.DateUtils {
|
||||
// 检查日期是否是未来的时间
|
||||
return dateToCheck.isAfter(currentDate);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.warn("日期解析失败: {}", dateString, e);
|
||||
// 解析失败或其他异常,返回 false 或根据需要处理异常
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,8 @@ package com.core.common.utils;
|
||||
|
||||
import com.core.common.constant.Constants;
|
||||
import com.core.common.core.text.Convert;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.web.context.request.RequestAttributes;
|
||||
import org.springframework.web.context.request.RequestContextHolder;
|
||||
import org.springframework.web.context.request.ServletRequestAttributes;
|
||||
@@ -24,6 +26,9 @@ import java.util.Map;
|
||||
* @author system
|
||||
*/
|
||||
public class ServletUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(ServletUtils.class);
|
||||
|
||||
/**
|
||||
* 获取String参数
|
||||
*/
|
||||
@@ -130,7 +135,7 @@ public class ServletUtils {
|
||||
response.setCharacterEncoding("utf-8");
|
||||
response.getWriter().print(string);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("渲染响应字符串失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
package com.core.common.utils.bean;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import java.lang.reflect.Method;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
@@ -12,6 +15,9 @@ import java.util.regex.Pattern;
|
||||
* @author system
|
||||
*/
|
||||
public class BeanUtils extends org.springframework.beans.BeanUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(BeanUtils.class);
|
||||
|
||||
/**
|
||||
* Bean方法名中属性名开始的下标
|
||||
*/
|
||||
@@ -37,7 +43,7 @@ public class BeanUtils extends org.springframework.beans.BeanUtils {
|
||||
try {
|
||||
copyProperties(src, dest);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Bean属性复制失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -115,7 +115,7 @@ public class FlowDefinitionController extends BaseController {
|
||||
ImageIO.write(image, "png", os);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("读取流程图片失败, deployId: {}", deployId, e);
|
||||
} finally {
|
||||
try {
|
||||
if (os != null) {
|
||||
@@ -123,7 +123,7 @@ public class FlowDefinitionController extends BaseController {
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("关闭输出流失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -211,7 +211,7 @@ public class FlowTaskController extends BaseController {
|
||||
ImageIO.write(image, "png", os);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("读取流程图片失败", e);
|
||||
} finally {
|
||||
try {
|
||||
if (os != null) {
|
||||
@@ -219,7 +219,7 @@ public class FlowTaskController extends BaseController {
|
||||
os.close();
|
||||
}
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("关闭输出流失败", e);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -722,7 +722,7 @@ public class FlowableUtils {
|
||||
// 反射设置属性值
|
||||
field.set(propertyDto, attribute.getValue());
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("反射设置属性值失败", e);
|
||||
// 如果反射设置失败则忽略该属性
|
||||
}
|
||||
});
|
||||
@@ -730,7 +730,7 @@ public class FlowableUtils {
|
||||
return propertyDto;
|
||||
}).collect(Collectors.toList());
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("解析流程属性失败", e);
|
||||
return Collections.emptyList(); // 如果发生异常则返回空列表
|
||||
}
|
||||
}
|
||||
|
||||
@@ -209,7 +209,7 @@ public class FlowDefinitionServiceImpl extends FlowServiceFactory implements IFl
|
||||
}
|
||||
return AjaxResult.success("流程启动成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("流程启动错误", e);
|
||||
return AjaxResult.error("流程启动错误");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -113,7 +113,7 @@ public class FlowInstanceServiceImpl extends FlowServiceFactory implements IFlow
|
||||
runtimeService.startProcessInstanceById(procDefId, variables);
|
||||
return AjaxResult.success("流程启动成功");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("流程启动错误, procDefId: {}", procDefId, e);
|
||||
return AjaxResult.error("流程启动错误");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,6 +19,8 @@ import com.core.generator.service.IGenTableColumnService;
|
||||
import com.core.generator.service.IGenTableService;
|
||||
import org.apache.commons.io.IOUtils;
|
||||
import org.apache.poi.ss.usermodel.*;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
@@ -43,6 +45,8 @@ import java.util.Map;
|
||||
@RestController
|
||||
@RequestMapping("/tool/gen")
|
||||
public class GenController extends BaseController {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(GenController.class);
|
||||
@Autowired
|
||||
private IGenTableService genTableService;
|
||||
|
||||
@@ -436,7 +440,7 @@ public class GenController extends BaseController {
|
||||
try (BufferedWriter writer = new BufferedWriter(new FileWriter(filePath))) {
|
||||
writer.write(str);
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("写入文件失败: {}", filePath, e);
|
||||
} finally {
|
||||
is.close();
|
||||
}
|
||||
|
||||
@@ -6,6 +6,8 @@ import com.core.system.domain.SysUserConfig;
|
||||
import com.core.common.utils.StringUtils;
|
||||
import com.core.system.mapper.SysUserConfigMapper;
|
||||
import com.core.system.service.ISysUserConfigService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
@@ -20,6 +22,8 @@ import java.util.List;
|
||||
@Service
|
||||
public class SysUserConfigServiceImpl extends ServiceImpl<SysUserConfigMapper, SysUserConfig> implements ISysUserConfigService
|
||||
{
|
||||
private static final Logger log = LoggerFactory.getLogger(SysUserConfigServiceImpl.class);
|
||||
|
||||
@Autowired
|
||||
private SysUserConfigMapper sysUserConfigMapper;
|
||||
|
||||
@@ -170,8 +174,7 @@ public class SysUserConfigServiceImpl extends ServiceImpl<SysUserConfigMapper, S
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// 记录错误日志以便调试
|
||||
System.err.println("保存用户配置时发生错误: " + e.getMessage());
|
||||
e.printStackTrace();
|
||||
log.error("保存用户配置时发生错误, userId: {}, configKey: {}", userId, configKey, e);
|
||||
throw e; // 重新抛出异常让上层处理
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,7 +120,7 @@ public class CheckMethodAppServiceImpl implements ICheckMethodAppService {
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
log.error("导出Excel失败", e);
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public class CheckPartAppServiceImpl implements ICheckPartAppService {
|
||||
// 导出到Excel
|
||||
ExcelFillerUtil.makeExcelFile(response, list, headers, excelName, null);
|
||||
} catch (IOException | IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
log.error("导出Excel失败", e);
|
||||
return R.fail("导出Excel失败:" + e.getMessage());
|
||||
}
|
||||
return R.ok(null, "导出Excel成功");
|
||||
|
||||
@@ -42,6 +42,8 @@ import com.openhis.workflow.domain.DeviceDispense;
|
||||
import com.openhis.workflow.domain.InventoryItem;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IInventoryItemService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -59,6 +61,8 @@ import java.util.stream.Collectors;
|
||||
@Service
|
||||
public class CommonServiceImpl implements ICommonService {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(CommonServiceImpl.class);
|
||||
|
||||
@Resource
|
||||
private AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@@ -410,7 +414,7 @@ public class CommonServiceImpl implements ICommonService {
|
||||
try {
|
||||
BeanUtils.copyProperties(contract, metadata);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.warn("Bean复制失败", e);
|
||||
}
|
||||
return metadata;
|
||||
}).collect(Collectors.toList()));
|
||||
|
||||
@@ -121,4 +121,13 @@ public interface IDiagTreatMAppService {
|
||||
* @return 校验结果
|
||||
*/
|
||||
R<?> validateActivityEdit(Long activityId);
|
||||
|
||||
/**
|
||||
* 批量设置划价标记
|
||||
*
|
||||
* @param ids 诊疗目录ID列表
|
||||
* @param pricingFlag 划价标记(1:允许, 0:不允许)
|
||||
* @return 结果
|
||||
*/
|
||||
R<?> updatePricingFlag(List<Long> ids, Integer pricingFlag);
|
||||
}
|
||||
@@ -626,6 +626,39 @@ public class DiagTreatMAppServiceImpl implements IDiagTreatMAppService {
|
||||
return R.ok();
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置划价标记
|
||||
*
|
||||
* @param ids 诊疗目录ID列表
|
||||
* @param pricingFlag 划价标记(1:允许, 0:不允许)
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public R<?> updatePricingFlag(List<Long> ids, Integer pricingFlag) {
|
||||
if (ids == null || ids.isEmpty()) {
|
||||
return R.fail(null, "请选择要设置的诊疗项目");
|
||||
}
|
||||
|
||||
List<ActivityDefinition> activityDefinitionList = new CopyOnWriteArrayList<>();
|
||||
|
||||
// 取得更新值
|
||||
for (Long id : ids) {
|
||||
ActivityDefinition activityDefinition = new ActivityDefinition();
|
||||
activityDefinition.setId(id);
|
||||
activityDefinition.setPricingFlag(pricingFlag);
|
||||
activityDefinitionList.add(activityDefinition);
|
||||
}
|
||||
|
||||
// 插入操作记录
|
||||
operationRecordService.addIdsOperationRecord(DbOpType.UPDATE.getCode(),
|
||||
CommonConstants.TableName.WOR_ACTIVITY_DEFINITION, ids);
|
||||
|
||||
// 更新诊疗信息
|
||||
return activityDefinitionService.updateBatchById(activityDefinitionList)
|
||||
? R.ok(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00002, new Object[]{"划价标记"}))
|
||||
: R.fail(null, MessageUtils.createMessage(PromptMsgConstant.Common.M00007, null));
|
||||
}
|
||||
|
||||
/**
|
||||
* 导入信息校验
|
||||
*
|
||||
|
||||
@@ -176,4 +176,16 @@ public class DiagnosisTreatmentController {
|
||||
public R<?> getClinicItems(@RequestParam(required = false) Long orgId) {
|
||||
return diagTreatMAppService.getClinicItems(orgId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量设置划价标记
|
||||
*
|
||||
* @param ids 诊疗目录ID列表
|
||||
* @param pricingFlag 划价标记(1:允许, 0:不允许)
|
||||
* @return 结果
|
||||
*/
|
||||
@PutMapping("/pricing-flag")
|
||||
public R<?> updatePricingFlag(@RequestBody List<Long> ids, @RequestParam Integer pricingFlag) {
|
||||
return diagTreatMAppService.updatePricingFlag(ids, pricingFlag);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,8 @@ import com.openhis.workflow.service.IActivityDefinitionService;
|
||||
import com.openhis.workflow.service.IDeviceDispenseService;
|
||||
import com.openhis.workflow.service.IDeviceRequestService;
|
||||
import com.openhis.workflow.service.IServiceRequestService;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -40,6 +42,8 @@ import java.util.stream.Collectors;
|
||||
@Component
|
||||
public class AdviceUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(AdviceUtils.class);
|
||||
|
||||
@Resource
|
||||
AssignSeqUtil assignSeqUtil;
|
||||
|
||||
@@ -396,7 +400,7 @@ public class AdviceUtils {
|
||||
iChargeItemService.updateById(mainChargeItem);
|
||||
}
|
||||
} catch (JsonProcessingException e) {
|
||||
e.printStackTrace();
|
||||
log.error("JSON处理失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -560,13 +560,13 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
|
||||
System.out.println("回复信息:" + JSON.toJSONString(response));
|
||||
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Http请求异常, url: {}", url, e);
|
||||
throw new ServiceException("Http请求异常,请稍后再试。");
|
||||
} finally {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("关闭响应失败", e);
|
||||
}
|
||||
}
|
||||
return resultString;
|
||||
@@ -596,13 +596,13 @@ public class ThreePartPayServiceImpl implements ThreePartPayService {
|
||||
response = httpClient.execute(httpPost);
|
||||
resultString = EntityUtils.toString(response.getEntity(), "utf-8");
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Http请求异常, url: {}", url, e);
|
||||
throw new ServiceException("Http请求异常,请稍后再试。");
|
||||
} finally {
|
||||
try {
|
||||
response.close();
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
log.error("关闭响应失败", e);
|
||||
}
|
||||
}
|
||||
return resultString;
|
||||
|
||||
@@ -7,6 +7,8 @@ import com.openhis.common.annotation.Dict;
|
||||
import org.aspectj.lang.ProceedingJoinPoint;
|
||||
import org.aspectj.lang.annotation.Around;
|
||||
import org.aspectj.lang.annotation.Aspect;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.dao.DataAccessException;
|
||||
import org.springframework.jdbc.core.JdbcTemplate;
|
||||
@@ -20,6 +22,8 @@ import java.util.List;
|
||||
@Component
|
||||
public class DictAspect {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(DictAspect.class);
|
||||
|
||||
@Autowired
|
||||
private JdbcTemplate jdbcTemplate; // 使用 JdbcTemplate 执行 SQL
|
||||
|
||||
@@ -99,15 +103,15 @@ public class DictAspect {
|
||||
// 查询字典值
|
||||
String dictLabel = queryDictLabel(dictTable, dictCode, dictText, deleteFlag, fieldValue.toString());
|
||||
if (dictLabel != null) {
|
||||
// 动态生成 _dictText 字段名
|
||||
String textFieldName = field.getName() + "_dictText";
|
||||
try {
|
||||
// 动态生成 _dictText 字段名
|
||||
String textFieldName = field.getName() + "_dictText";
|
||||
Field textField = dto.getClass().getDeclaredField(textFieldName);
|
||||
textField.setAccessible(true);
|
||||
textField.set(dto, dictLabel); // 设置 _dictText 字段的值
|
||||
} catch (NoSuchFieldException e) {
|
||||
// 如果 _dictText 字段不存在,忽略错误
|
||||
e.printStackTrace();
|
||||
log.debug("字段 {} 不存在,跳过字典翻译", textFieldName);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -5,6 +5,8 @@ import com.core.common.utils.DateUtils;
|
||||
import com.core.common.utils.SecurityUtils;
|
||||
import com.core.framework.config.TenantContext;
|
||||
import com.openhis.common.constant.CommonConstants;
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
|
||||
import javax.servlet.http.HttpServletRequest;
|
||||
import java.lang.reflect.Field;
|
||||
@@ -21,6 +23,8 @@ import java.util.Map;
|
||||
*/
|
||||
public class HisQueryUtils {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(HisQueryUtils.class);
|
||||
|
||||
/**
|
||||
* 条件查询构造器
|
||||
*
|
||||
@@ -72,7 +76,7 @@ public class HisQueryUtils {
|
||||
queryWrapper.ge(dbFieldName, startDate); // 大于等于 STime
|
||||
queryWrapper.le(dbFieldName, endDate); // 小于等于 ETime
|
||||
} catch (ParseException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("日期解析失败: startValue={}, endValue={}", startValue, endValue, e);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -100,7 +104,7 @@ public class HisQueryUtils {
|
||||
queryWrapper.eq(fieldName, value);
|
||||
}
|
||||
} catch (IllegalAccessException e) {
|
||||
e.printStackTrace();
|
||||
log.warn("反射获取字段值失败: field={}", field.getName(), e);
|
||||
}
|
||||
}
|
||||
currentClass = currentClass.getSuperclass();
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
package com.openhis.common.utils;
|
||||
|
||||
import org.slf4j.Logger;
|
||||
import org.slf4j.LoggerFactory;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.data.redis.core.*;
|
||||
import org.springframework.stereotype.Component;
|
||||
@@ -16,6 +18,8 @@ import java.util.concurrent.TimeUnit;
|
||||
@Component
|
||||
public class RedisUtil {
|
||||
|
||||
private static final Logger log = LoggerFactory.getLogger(RedisUtil.class);
|
||||
|
||||
@Autowired
|
||||
private RedisTemplate<Object, Object> redisTemplate;
|
||||
@Autowired
|
||||
@@ -35,7 +39,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -60,7 +64,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.hasKey(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -104,7 +108,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForValue().set(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -127,7 +131,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -194,7 +198,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForHash().putAll(key, map);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -215,7 +219,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -233,7 +237,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForHash().put(key, item, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -255,7 +259,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -316,7 +320,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForSet().members(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -332,7 +336,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForSet().isMember(key, value);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -348,7 +352,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForSet().add(key, values);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -369,7 +373,7 @@ public class RedisUtil {
|
||||
}
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -384,7 +388,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForSet().size(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -401,7 +405,7 @@ public class RedisUtil {
|
||||
Long count = redisTemplate.opsForSet().remove(key, values);
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -419,7 +423,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForList().range(key, start, end);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -434,7 +438,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForList().size(key);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -450,7 +454,7 @@ public class RedisUtil {
|
||||
try {
|
||||
return redisTemplate.opsForList().index(key, index);
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return null;
|
||||
}
|
||||
}
|
||||
@@ -468,7 +472,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForList().rightPush(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -489,7 +493,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -507,7 +511,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForList().rightPushAll(key, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -528,7 +532,7 @@ public class RedisUtil {
|
||||
}
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -546,7 +550,7 @@ public class RedisUtil {
|
||||
redisTemplate.opsForList().set(key, index, value);
|
||||
return true;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis expire操作失败, key: {}", key, e);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -564,7 +568,7 @@ public class RedisUtil {
|
||||
Long remove = redisTemplate.opsForList().remove(key, count, value);
|
||||
return remove;
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis操作失败, key: {}", key, e);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
@@ -590,7 +594,7 @@ public class RedisUtil {
|
||||
return binaryKeys;
|
||||
});
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis scan操作失败, keyPrefix: {}", keyPrefix, e);
|
||||
}
|
||||
|
||||
return null;
|
||||
@@ -605,7 +609,7 @@ public class RedisUtil {
|
||||
Set<String> keys = keys(keyPrefix);
|
||||
redisTemplate.delete(keys);
|
||||
} catch (Throwable e) {
|
||||
e.printStackTrace();
|
||||
log.error("Redis删除操作失败, keyPrefix: {}", keyPrefix, e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -7,10 +7,7 @@ import request from '@/utils/request';
|
||||
* @returns {Promise} 请求结果
|
||||
*/
|
||||
export function getPatientList(query) {
|
||||
// 打印日志便于调试
|
||||
console.log('调用患者查询API,参数:', query);
|
||||
|
||||
// 直接复用门诊挂号模块完全相同的实现方式
|
||||
// 直接复用门诊挂号模块完全相同的实现方式
|
||||
// 不做额外的参数处理,直接将query传递给后端
|
||||
return request({
|
||||
url: '/charge-manage/register/patient-metadata',
|
||||
|
||||
@@ -61,7 +61,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
|
||||
export default {
|
||||
data() {
|
||||
@@ -73,23 +74,35 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
printTest() {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.ADD_PRINT_TABLE(100, 40, 750, 900, document.getElementById('div2').innerHTML)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'Horient', 3)
|
||||
LODOP.ADD_PRINT_HTM(20, 40, '100%', 100, document.getElementById('div1').innerHTML)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
|
||||
// LODOP.SET_PRINT_PAGESIZE(2, '', '', ''); // 设置横向打印
|
||||
LODOP.ADD_PRINT_HTM(1080, 500, 300, 100, '总页数:<span><span tdata="pageNO">第##页</span>/ <span tdata="pageCount">共##页</span></span>')
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'Horient', 1)
|
||||
// LODOP.PREVIEW(); // 打印预览
|
||||
LODOP.PRINT() // 直接打印
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
*/
|
||||
async printTest() {
|
||||
try {
|
||||
// 构建打印数据
|
||||
const shiftRecordItems = (this.printData.shiftRecordItems || []).map(item => ({
|
||||
typeDisplay: item.typeDisplay || '',
|
||||
bedName: item.bedName || '',
|
||||
patientName: item.patientName || '',
|
||||
mainSuit: item.mainSuit || '',
|
||||
previousHistory: item.previousHistory || '',
|
||||
diagnosis: item.diagnosis || '',
|
||||
content: item.content || ''
|
||||
}))
|
||||
|
||||
const printData = {
|
||||
date: this.printData.date ? this.printData.date.substring(0, 10) : '',
|
||||
initiatorName: this.printData.initiator ? this.printData.initiator.name : '',
|
||||
heirName: this.printData.heir ? this.printData.heir.name : '',
|
||||
shiftRecordItems: shiftRecordItems
|
||||
}
|
||||
// 使用 hiprint 打印
|
||||
await simplePrint(PRINT_TEMPLATE.CHANGE_SHIFT_BILL, printData)
|
||||
} catch (error) {
|
||||
console.error('护理交接班打印失败:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -86,7 +86,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
export default {
|
||||
@@ -98,33 +99,47 @@ export default {
|
||||
printData: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
return {}
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
printTest() {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.ADD_PRINT_TABLE(120, 35, 750, 900, document.getElementById('exeSheet' + this.printData.id).innerHTML)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'Horient', 3)
|
||||
LODOP.ADD_PRINT_HTM(20, 40, '100%', 100, document.getElementById('exeSheetTitle' + this.printData.id).innerHTML)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'LinkedItem', 1)
|
||||
// LODOP.SET_PRINT_PAGESIZE(2, '', '', ''); // 设置横向打印
|
||||
LODOP.ADD_PRINT_HTM(1080, 500, 300, 100, '总页数:<span><span tdata="pageNO">第##页</span>/ <span tdata="pageCount">共##页</span></span>')
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'Horient', 1)
|
||||
LODOP.SET_SHOW_MODE('LANDSCAPE_DEFROTATED', 1)// 横向时的正向显示
|
||||
LODOP.PREVIEW() // 打印预览
|
||||
// LODOP.PRINT(); // 直接打印
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
*/
|
||||
async printTest() {
|
||||
try {
|
||||
// 构建打印数据
|
||||
const recordData = (this.printData.recordData || []).map(item => ({
|
||||
moTime: item.moTime || '',
|
||||
orderName: item.orderName || '',
|
||||
flag: item.flag || '',
|
||||
remark: item.remark || '',
|
||||
doseOnceUnit: item.doseOnce <= 0 ? '' : (item.doseOnce + item.doseUnit),
|
||||
usageName: item.usageName || '',
|
||||
frequency: item.frequency || '',
|
||||
moDocName: item.moDocName || '',
|
||||
occurrence: item.occurrence || '',
|
||||
performName: item.performName || ''
|
||||
}))
|
||||
|
||||
const printData = {
|
||||
hospitalName: this.userStore.hospitalName,
|
||||
bedName: this.printData.patientInfo ? this.printData.patientInfo.encounterLocationName : '',
|
||||
patientName: this.printData.patientInfo ? this.printData.patientInfo.name : '',
|
||||
patientAge: this.printData.patientInfo ? this.printData.patientInfo.patientAge : '',
|
||||
diag: this.printData.patientInfo ? this.printData.patientInfo.diag : '',
|
||||
recordData: recordData
|
||||
}
|
||||
// 使用 hiprint 打印
|
||||
await simplePrint(PRINT_TEMPLATE.EXE_ORDER_SHEET, printData)
|
||||
} catch (error) {
|
||||
console.error('医嘱执行单打印失败:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -46,8 +46,9 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
// import QRCode from 'qrcodejs2'
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
import moment from 'moment'
|
||||
|
||||
export default {
|
||||
name: 'VuePrintNb',
|
||||
@@ -55,8 +56,7 @@ export default {
|
||||
printData: {
|
||||
type: Object,
|
||||
default() {
|
||||
return {
|
||||
}
|
||||
return {}
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -66,72 +66,46 @@ export default {
|
||||
qrCode: ''
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// console.log('mounted方法');
|
||||
// this.initBarCode();
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
// initBarCode() {
|
||||
// this.$nextTick(() => {
|
||||
// if (this.lastId !== this.printData.patient.hisId) {
|
||||
// new QRCode(this.getId(this.printData.id), {
|
||||
// text: this.printData.patient.hisId,
|
||||
// width: 50,
|
||||
// height: 50,
|
||||
// colorDark: '#000000',
|
||||
// colorLight: '#ffffff',
|
||||
// correctLevel: QRCode.CorrectLevel.H
|
||||
// });
|
||||
// }
|
||||
// this.lastId = this.printData.patient.hisId;
|
||||
// });
|
||||
// },
|
||||
//
|
||||
// getId(id) {
|
||||
// return 'qrcode' + id;
|
||||
// },
|
||||
print(printerName) {
|
||||
const LODOP = getLodop()
|
||||
const printer = this.getPrinter(LODOP, printerName)
|
||||
if (printer === null) {
|
||||
this.openMesBox('6', '没有找到打印机【' + printerName + '】')
|
||||
return
|
||||
}
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
* @param {string} printerName 打印机名称
|
||||
*/
|
||||
async print(printerName) {
|
||||
console.log(this.printData, 'printData')
|
||||
this.qrCode = this.printData.orderDetail[0].comboNo + this.printData.orderDetail[0].executionSeq
|
||||
LODOP.PRINT_INIT()
|
||||
LODOP.SET_PRINTER_INDEX(printer)// 指定打印机
|
||||
this.setPrint(LODOP)
|
||||
LODOP.SET_PRINT_PAGESIZE(0, 1070, 800, '')
|
||||
LODOP.PREVIEW() // 打印预览
|
||||
// LODOP.PRINT(); // 直接打印
|
||||
},
|
||||
setPrint(LODOP) {
|
||||
LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', document.getElementById(this.printData.id + 'div1').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(82, 0, '100%', '100%', document.getElementById(this.printData.id + 'div2').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(265, 10, '100%', '100%', document.getElementById(this.printData.id + 'div3').innerHTML)
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ItemType', 1)
|
||||
// 设置二维码 qrcode ,条码128B等
|
||||
// LODOP.ADD_PRINT_BARCODE(Top,Left,Width,Height,BarCodeType,BarCodeValue);
|
||||
LODOP.ADD_PRINT_BARCODE(0, 300, 75, 75, 'qrcode', this.qrCode)// 设置条码位置、宽高、字体、值
|
||||
LODOP.SET_PRINT_STYLEA(0, 'FontSize', 18)// 设置上面这个条码下方的文字字体大小
|
||||
// LODOP.SET_PRINT_STYLEA(0,"Color","#FF0000");//设置当前条码以及条码下方字体的颜色
|
||||
LODOP.SET_PRINT_STYLEA(0, 'Angle', 180)// 设置旋转角度
|
||||
LODOP.SET_PRINT_STYLEA(0, 'ShowBarText', 0)// 设置是否显示下方的文字
|
||||
LODOP.SET_PRINT_STYLEA(0, 'AlignJustify', 2)// 设置条码下方的文字相对于条码本身居中
|
||||
// LODOP.SET_PRINT_STYLEA(0,"AlignJustify",1);//设置条码下方的文字相对于条码本身居左
|
||||
// LODOP.SET_PRINT_STYLEA(0,"AlignJustify",3);//设置条码下方的文字相对于条码本身居右
|
||||
// LODOP.SET_PRINT_STYLEA(0,"GroundColor","#0080FF");//设置条码的背景色
|
||||
},
|
||||
// 获取打印机
|
||||
getPrinter(LODOP, name) {
|
||||
const listCount = LODOP.GET_PRINTER_COUNT() // 当前打印设备数量
|
||||
for (let i = 0; i < listCount; i++) {
|
||||
if (LODOP.GET_PRINTER_NAME(i) === name) {
|
||||
return name
|
||||
try {
|
||||
// 构建打印数据
|
||||
const orderDetail = this.printData.orderDetail || []
|
||||
const qrCode = orderDetail[0] ? (orderDetail[0].comboNo + orderDetail[0].executionSeq) : ''
|
||||
|
||||
// 转换药品明细数据
|
||||
const formattedOrderDetail = orderDetail.map(item => ({
|
||||
orderName: item.orderName,
|
||||
doseOnceUnit: (item.doseOnce || '') + (item.doseUnit || ''),
|
||||
flag: item.flag || '',
|
||||
frequency: item.frequency || '',
|
||||
usageName: item.usageName || ''
|
||||
}))
|
||||
|
||||
const printData = {
|
||||
hisNo: this.printData.patient ? this.printData.patient.hisNo : '',
|
||||
name: this.printData.patient ? this.printData.patient.name : '',
|
||||
sexName: this.printData.patient ? this.printData.patient.sexName : '',
|
||||
patientAge: this.printData.patient ? this.printData.patient.patientAge : '',
|
||||
priority: this.printData.priority || '',
|
||||
qrCode: qrCode,
|
||||
orderDetail: formattedOrderDetail,
|
||||
printDate: moment().format('YYYY-MM-DD HH:mm')
|
||||
}
|
||||
// 使用 hiprint 打印
|
||||
await simplePrint(PRINT_TEMPLATE.INJECT_LABEL, printData, printerName)
|
||||
} catch (error) {
|
||||
console.error('输液标签打印失败:', error)
|
||||
if (this.openMesBox) {
|
||||
this.openMesBox('6', '打印失败: ' + (error.message || '未知错误'))
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -60,7 +60,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
|
||||
export default {
|
||||
@@ -76,18 +77,38 @@ export default {
|
||||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
},
|
||||
mounted() {},
|
||||
methods: {
|
||||
printTest() {
|
||||
const LODOP = getLodop()
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.ADD_PRINT_TABLE(100, 35, 700, 900, document.getElementById('div2').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(20, 40, '100%', 100, document.getElementById('div1').innerHTML)
|
||||
LODOP.SET_PRINT_PAGESIZE(0, '148mm', '210mm', '') // 设置横向打印
|
||||
// LODOP.SET_SHOW_MODE('LANDSCAPE_DEFROTATED', 1);// 横向时的正向显示
|
||||
LODOP.PREVIEW() // 打印预览
|
||||
// LODOP.PRINT(); // 直接打印
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
*/
|
||||
async printTest() {
|
||||
try {
|
||||
// 构建打印数据
|
||||
const recordData = (this.printData.recordData || []).map(item => ({
|
||||
moTime: item.moTime ? item.moTime.substring(0, 16) : '',
|
||||
orderName: item.orderName || '',
|
||||
flag: item.flag || '',
|
||||
doseOnceUnit: (item.doseOnce || '') + (item.doseUnit || ''),
|
||||
freqName: item.freqName || '',
|
||||
usageName: item.usageName || ''
|
||||
}))
|
||||
|
||||
const printData = {
|
||||
hospitalName: this.userStore.hospitalName,
|
||||
encounterLocationName: this.printData.patientInfo ? this.printData.patientInfo.encounterLocationName : '',
|
||||
name: this.printData.patientInfo ? this.printData.patientInfo.name : '',
|
||||
sexName: this.printData.patientInfo ? this.printData.patientInfo.sexName : '',
|
||||
patientAge: this.printData.patientInfo ? this.printData.patientInfo.patientAge : '',
|
||||
hisNo: this.printData.patientInfo ? this.printData.patientInfo.hisNo : '',
|
||||
deptName: this.printData.patientInfo ? this.printData.patientInfo.deptName : '',
|
||||
recordData: recordData
|
||||
}
|
||||
// 使用 hiprint 打印(复用医嘱执行单模板)
|
||||
await simplePrint(PRINT_TEMPLATE.EXE_ORDER_SHEET, printData)
|
||||
} catch (error) {
|
||||
console.error('输液执行单打印失败:', error)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
<script setup>
|
||||
import Graphics from '../../../views/inpatientNurse/tprChart/index';
|
||||
import data from '../../../action/nurseStation/temperatureSheet/datas';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
const printData = ref({});
|
||||
const resInfo = ref({});
|
||||
@@ -75,7 +77,9 @@ function setTime(num) {
|
||||
}
|
||||
}
|
||||
function printPage() {
|
||||
window.print();
|
||||
// 使用 hiprint 预览打印
|
||||
const printDom = document.querySelector('.tpr-chart-container') || document.body;
|
||||
previewPrint(printDom);
|
||||
}
|
||||
// 获取每周数据
|
||||
async function getData(curWeekInfo) {
|
||||
|
||||
@@ -117,7 +117,8 @@
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
|
||||
export default {
|
||||
name: 'VuePrintNb',
|
||||
@@ -143,37 +144,38 @@ export default {
|
||||
else if (pressure.bloodPressureShrinkOne === null) return ''
|
||||
return pressure.bloodPressureShrinkOne + '/' + pressure.bloodPressureDiastoleOne
|
||||
},
|
||||
printTriage(printerName) {
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
* @param {string} printerName 打印机名称
|
||||
*/
|
||||
async printTriage(printerName) {
|
||||
console.log(this.printData, 'printData')
|
||||
const LODOP = getLodop()
|
||||
const printer = this.getPrinter(LODOP, printerName)
|
||||
if (printer === null) {
|
||||
this.openMesBox('6', '没有找到打印机【' + printerName + '】')
|
||||
return
|
||||
}
|
||||
LODOP.PRINT_INIT()
|
||||
LODOP.SET_PRINTER_INDEX(printer) // 指定打印机
|
||||
this.setPrint(LODOP)
|
||||
LODOP.SET_PRINT_PAGESIZE(0, '100mm', '140mm', '')
|
||||
// LODOP.PREVIEW(); // 打印预览
|
||||
LODOP.PRINT() // 直接打印
|
||||
},
|
||||
setPrint(LODOP) {
|
||||
LODOP.ADD_PRINT_HTM(0, 0, '100%', '100%', document.getElementById('div1').innerHTML)
|
||||
LODOP.ADD_PRINT_BARCODE(40, 100, 100, 100, 'qrcode', this.printData.hisId) // 设置条码位置、宽高、字体、值
|
||||
LODOP.ADD_PRINT_HTM(200, 0, '100%', '100%', document.getElementById('div2').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(230, 10, '100%', '100%', document.getElementById('div3').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(295, 10, '100%', '100%', document.getElementById('div4').innerHTML)
|
||||
},
|
||||
// 获取打印机
|
||||
getPrinter(LODOP, name) {
|
||||
const listCount = LODOP.GET_PRINTER_COUNT() // 当前打印设备数量
|
||||
for (let i = 0; i < listCount; i++) {
|
||||
if (LODOP.GET_PRINTER_NAME(i) === name) {
|
||||
return name
|
||||
try {
|
||||
// 构建打印数据
|
||||
const printData = {
|
||||
hisId: this.printData.hisId,
|
||||
triageLevel: this.printData.triageLevel,
|
||||
dept: this.printData.dept,
|
||||
patientName: this.printData.patientName,
|
||||
sex: this.printData.sex,
|
||||
age: this.printData.age,
|
||||
temperature: this.printData.observation ? this.printData.observation.temperature : '',
|
||||
sphygmus: this.printData.observation ? this.printData.observation.sphygmus : '',
|
||||
breath: this.printData.observation ? this.printData.observation.breath : '',
|
||||
bloodPressure: this.getBloodPressure(this.printData.observation),
|
||||
bloodOxygen: this.printData.observation ? this.printData.observation.bloodOxygen : '',
|
||||
triageTime: this.printData.triageTime,
|
||||
tel: this.printData.tel,
|
||||
greenText: this.printData.greenText || ''
|
||||
}
|
||||
// 使用 hiprint 打印
|
||||
await simplePrint(PRINT_TEMPLATE.TRIAGE_TICKET, printData, printerName)
|
||||
} catch (error) {
|
||||
console.error('分诊条打印失败:', error)
|
||||
if (this.openMesBox) {
|
||||
this.openMesBox('6', '打印失败: ' + (error.message || '未知错误'))
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,8 @@
|
||||
</template>
|
||||
<script>
|
||||
import QRCode from 'qrcodejs2'
|
||||
import {getLodop} from '../../../plugins/print/LodopFuncs'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
|
||||
export default {
|
||||
name: 'WristPrint',
|
||||
@@ -67,33 +68,31 @@ export default {
|
||||
clear() {
|
||||
document.getElementById('qrcode').innerHTML = ''
|
||||
},
|
||||
execPrint(preview, printerName) {
|
||||
const LODOP = getLodop()
|
||||
const printer = this.getPrinter(LODOP, printerName)
|
||||
if (printer === null) {
|
||||
this.openMesBox('6', '没有找到打印机【' + printerName + '】')
|
||||
return
|
||||
}
|
||||
LODOP.PRINT_INIT('')
|
||||
LODOP.ADD_PRINT_HTM(30, 100, '100%', 100, document.getElementById('div1').innerHTML)
|
||||
LODOP.ADD_PRINT_HTM(30, 20, '100%', 40, document.getElementById('qrcode').innerHTML)
|
||||
LODOP.SET_PRINT_PAGESIZE(2, '25mm', '270mm', '') // 设置横向打印
|
||||
if (preview) {
|
||||
LODOP.PREVIEW() // 打印预览
|
||||
return
|
||||
}
|
||||
// LODOP.PREVIEW(); // 打印预览
|
||||
LODOP.PRINT() // 直接打印
|
||||
},
|
||||
// 获取打印机
|
||||
getPrinter(LODOP, name) {
|
||||
const listCount = LODOP.GET_PRINTER_COUNT() // 当前打印设备数量
|
||||
for (let i = 0; i < listCount; i++) {
|
||||
if (LODOP.GET_PRINTER_NAME(i) === name) {
|
||||
return name
|
||||
/**
|
||||
* 使用 hiprint 执行打印
|
||||
* @param {boolean} preview 是否预览(hiprint暂不支持预览参数,保留兼容性)
|
||||
* @param {string} printerName 打印机名称
|
||||
*/
|
||||
async execPrint(preview, printerName) {
|
||||
try {
|
||||
// 构建打印数据
|
||||
const printData = {
|
||||
patientName: this.printData.patientName,
|
||||
hisId: this.printData.hisId,
|
||||
gender: this.printData.gender ? this.printData.gender.display : '',
|
||||
dept: this.printData.dept,
|
||||
bedName: this.printData.bedName,
|
||||
triageLevel: this.printData.triageLevel,
|
||||
checkInWardTime: this.printData.checkInWardTime
|
||||
}
|
||||
// 使用 hiprint 打印
|
||||
await simplePrint(PRINT_TEMPLATE.WRIST_BAND, printData, printerName)
|
||||
} catch (error) {
|
||||
console.error('腕带打印失败:', error)
|
||||
if (this.openMesBox) {
|
||||
this.openMesBox('6', '打印失败: ' + (error.message || '未知错误'))
|
||||
}
|
||||
}
|
||||
return null
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
@close="cancel"
|
||||
@opened="
|
||||
() => {
|
||||
console.log(123);
|
||||
traceNoTempRef.focus();
|
||||
}
|
||||
"
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -24,18 +24,18 @@
|
||||
{"options": {"left": 10, "top": 50, "height": 10, "width": 80, "title": "病人类型:", "fontSize": 9, "field": "personType"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 100, "top": 50, "height": 10, "width": 120, "title": "门诊号:", "fontSize": 9, "field": "busNo"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 10, "top": 62, "height": 10, "width": 150, "title": "收费时间:", "fontSize": 9, "field": "chargeTime"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 0, "top": 76, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#000000"}, "printElementType": {"title": "线", "type": "line"}},
|
||||
{"options": {"left": 0, "top": 76, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#000000"}, "printElementType": {"title": "横线", "type": "hline"}},
|
||||
{"options": {"left": 10, "top": 82, "height": 10, "width": 80, "title": "收费项目", "fontSize": 9, "fontWeight": "bold"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 100, "top": 82, "height": 10, "width": 40, "title": "数量", "fontSize": 9, "fontWeight": "bold", "textAlign": "center"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 145, "top": 82, "height": 10, "width": 80, "title": "金额", "fontSize": 9, "fontWeight": "bold", "textAlign": "right"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 0, "top": 94, "height": 40, "width": 226.5, "field": "chargeItem", "textAlign": "center", "fontSize": 8, "columns": [[{"title": "收费项目", "width": 95, "field": "chargeItemName"}, {"title": "数量", "width": 40, "field": "quantityValue"}, {"title": "金额", "width": 50, "field": "totalPrice"}]]}, "printElementType": {"title": "表格", "type": "table"}},
|
||||
{"options": {"left": 0, "top": 136, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#000000"}, "printElementType": {"title": "线", "type": "line"}},
|
||||
{"options": {"left": 0, "top": 136, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "solid", "borderColor": "#000000"}, "printElementType": {"title": "横线", "type": "hline"}},
|
||||
{"options": {"left": 10, "top": 142, "height": 10, "width": 80, "title": "合计:", "fontSize": 9, "field": "FULAMT_OWNPAY_AMT"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 100, "top": 142, "height": 10, "width": 120, "title": "现金:", "fontSize": 9, "textAlign": "right", "field": "SELF_CASH_PAY"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 10, "top": 154, "height": 10, "width": 100, "title": "微信:", "fontSize": 9, "field": "SELF_VX_PAY"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 120, "top": 154, "height": 10, "width": 100, "title": "支付宝:", "fontSize": 9, "textAlign": "right", "field": "SELF_ALI_PAY"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 10, "top": 166, "height": 10, "width": 150, "title": "医保账户:", "fontSize": 9, "field": "SELF_YB_ZH_PAY"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 0, "top": 180, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "dashed", "borderColor": "#CCCCCC"}, "printElementType": {"title": "线", "type": "line"}},
|
||||
{"options": {"left": 0, "top": 180, "height": 2, "width": 226.5, "borderWidth": 1, "borderStyle": "dashed", "borderColor": "#CCCCCC"}, "printElementType": {"title": "横线", "type": "hline"}},
|
||||
{"options": {"left": 0, "top": 186, "height": 12, "width": 226.5, "title": "门诊手术计费流程", "fontWeight": "bold", "textAlign": "center", "fontSize": 10, "color": "#0066CC"}, "printElementType": {"title": "文本", "type": "text"}},
|
||||
{"options": {"left": 10, "top": 200, "height": 85, "width": 206.5, "field": "surgeryFlowImage", "fit": "contain"}, "printElementType": {"title": "图片", "type": "image"}},
|
||||
{"options": {"left": 0, "top": 288, "height": 10, "width": 226.5, "title": "请妥善保管,有疑问请咨询服务台", "fontSize": 8, "textAlign": "center", "color": "#666666"}, "printElementType": {"title": "文本", "type": "text"}}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
处方签 Prescription.json
|
||||
1处方签 Prescription.json
|
||||
处置单 Disposal.json
|
||||
门诊日结 DailyOutpatientSettlement.json
|
||||
门诊挂号 OutpatientRegistration.json
|
||||
|
||||
@@ -3,7 +3,7 @@ import {createApp} from 'vue';
|
||||
import Cookies from 'js-cookie';
|
||||
|
||||
// 导入 hiprint 并挂载到全局 window 对象
|
||||
import {hiprint, autoConnect, disAutoConnect} from 'vue-plugin-hiprint';
|
||||
import {hiprint, defaultElementTypeProvider} from 'vue-plugin-hiprint';
|
||||
|
||||
import ElementPlus, {ElDialog, ElMessage} from 'element-plus';
|
||||
import zhCn from 'element-plus/es/locale/lang/zh-cn';
|
||||
@@ -52,9 +52,9 @@ import {registerComponents} from './template';
|
||||
|
||||
window.hiprint = hiprint;
|
||||
|
||||
// 初始化 hiprint 并连接本地客户端
|
||||
// 初始化 hiprint,使用默认元素类型提供器(支持 table、text、image 等元素)
|
||||
hiprint.init({
|
||||
providers: []
|
||||
providers: [new defaultElementTypeProvider()]
|
||||
});
|
||||
|
||||
// 延迟连接,确保 hiwebSocket 已初始化
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
<script lang="ts" setup>
|
||||
import {ref} from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
|
||||
@@ -99,10 +101,14 @@ const signatures = ref<Signatures>({
|
||||
}, {} as Record<string, string>),
|
||||
});
|
||||
|
||||
// 5. 打印功能:控制打印范围+样式
|
||||
// 5. 打印功能:使用 hiprint
|
||||
const handlePrint = () => {
|
||||
// 1. 触发浏览器打印
|
||||
window.print();
|
||||
const printDom = document.querySelector('.medical-record');
|
||||
if (printDom) {
|
||||
previewPrint(printDom);
|
||||
} else {
|
||||
window.print();
|
||||
}
|
||||
};
|
||||
|
||||
// 暴露接口
|
||||
|
||||
@@ -233,6 +233,8 @@
|
||||
import {onMounted, reactive, ref} from 'vue';
|
||||
import intOperRecordSheet from '../views/hospitalRecord/components/intOperRecordSheet.vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const isShowprintDom = ref(false);
|
||||
@@ -393,11 +395,16 @@ const setFormData = (data) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 打印功能
|
||||
// 打印功能 - 使用 hiprint
|
||||
const handlePrint = () => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
window.print();
|
||||
const printDom = document.querySelector('.form-container');
|
||||
if (printDom) {
|
||||
previewPrint(printDom);
|
||||
} else {
|
||||
window.print();
|
||||
}
|
||||
} else {
|
||||
ElMessageBox.warning('请先完善表单信息再打印');
|
||||
}
|
||||
|
||||
@@ -214,6 +214,8 @@
|
||||
<script setup>
|
||||
import {onMounted, reactive, ref} from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
// 医院名称
|
||||
@@ -346,11 +348,16 @@ const setFormData = (data) => {
|
||||
}
|
||||
};
|
||||
|
||||
// 打印功能
|
||||
// 打印功能 - 使用 hiprint
|
||||
const handlePrint = () => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
window.print();
|
||||
const printDom = document.querySelector('.form-container');
|
||||
if (printDom) {
|
||||
previewPrint(printDom);
|
||||
} else {
|
||||
window.print();
|
||||
}
|
||||
} else {
|
||||
ElMessageBox.warning('请先完善表单信息再打印');
|
||||
}
|
||||
|
||||
@@ -96,6 +96,8 @@ import {
|
||||
} from 'element-plus';
|
||||
import {patientInfo} from '../views/doctorstation/components/store/patient';
|
||||
import useUserStore from '../store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
defineOptions({
|
||||
name: 'tySurgicalRecord'
|
||||
@@ -165,12 +167,16 @@ const submit = () => {
|
||||
});
|
||||
};
|
||||
|
||||
// 打印功能
|
||||
// 打印功能 - 使用 hiprint
|
||||
const handlePrint = () => {
|
||||
formRef.value.validate((valid) => {
|
||||
if (valid) {
|
||||
// window.print();
|
||||
ElMessage.warning('打印功能待实现');
|
||||
const printDom = document.querySelector('.form-container');
|
||||
if (printDom) {
|
||||
previewPrint(printDom);
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容');
|
||||
}
|
||||
} else {
|
||||
ElMessage.warning('请先完善表单信息再打印');
|
||||
}
|
||||
|
||||
@@ -351,11 +351,6 @@ async function handleAdd() {
|
||||
const tenantId = userStore?.tenantId
|
||||
const tenantName = userStore?.tenantName
|
||||
|
||||
console.log('当前用户信息:', userStore)
|
||||
console.log('当前用户租户ID:', tenantId)
|
||||
console.log('当前用户租户名称:', tenantName)
|
||||
console.log('租户选项列表:', tenantOptions.value)
|
||||
|
||||
// 检查租户ID是否存在,如果不存在则尝试从租户名称匹配
|
||||
let matchedTenantId = null
|
||||
if (tenantId) {
|
||||
@@ -368,7 +363,6 @@ async function handleAdd() {
|
||||
)
|
||||
if (matchedTenant) {
|
||||
matchedTenantId = matchedTenant.id
|
||||
console.log('通过租户名称匹配到租户ID:', matchedTenantId)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -406,11 +406,17 @@ function openSaveImplementDepartment(row) {
|
||||
function deleteSelectedRows(row) {
|
||||
proxy.$modal.confirm('是否删除选中数据').then(() => {
|
||||
if (row.id) {
|
||||
deleteImplementDepartment({ orgLocId: row.id }).then((res) => {});
|
||||
deleteImplementDepartment({ orgLocId: row.id }).then((res) => {
|
||||
if (res.code === 200) {
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
}).catch(() => {
|
||||
proxy.$modal.msgError('删除失败');
|
||||
});
|
||||
} else {
|
||||
catagoryList.value.pop();
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
}
|
||||
proxy.$modal.msgSuccess('删除成功');
|
||||
data.isAdding = false;
|
||||
getList();
|
||||
});
|
||||
|
||||
@@ -113,4 +113,14 @@ export function getDiseaseTreatmentByYbNo (ybNo) {
|
||||
});
|
||||
}
|
||||
|
||||
// 批量设置划价标记
|
||||
export function updatePricingFlag (ids, pricingFlag) {
|
||||
return request ({
|
||||
url: '/data-dictionary/diagnosis-treatment/pricing-flag',
|
||||
method: 'put',
|
||||
data: ids,
|
||||
params: { pricingFlag },
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -95,6 +95,28 @@
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="primary"
|
||||
plain
|
||||
icon="Check"
|
||||
:disabled="multiple"
|
||||
@click="handlePricingFlag(1)"
|
||||
>允许划价</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button
|
||||
type="warning"
|
||||
plain
|
||||
icon="Close"
|
||||
:disabled="multiple"
|
||||
@click="handlePricingFlag(0)"
|
||||
>禁止划价</el-button
|
||||
>
|
||||
</el-col>
|
||||
|
||||
<el-col :span="1.5">
|
||||
<el-button type="info" plain icon="Upload" @click="handleImport">导入</el-button>
|
||||
</el-col>
|
||||
@@ -301,6 +323,7 @@ import {
|
||||
startDiseaseTreatment,
|
||||
stopDiseaseTreatment,
|
||||
validateActivityEdit,
|
||||
updatePricingFlag,
|
||||
} from './components/diagnosistreatment';
|
||||
import diagnosisTreatmentDialog from './components/diagnosisTreatmentDialog';
|
||||
import DiagTreYbDialog from './components/diagTreYbDialog';
|
||||
@@ -429,6 +452,22 @@ function handleClose() {
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
|
||||
/** 批量设置划价标记 */
|
||||
function handlePricingFlag(pricingFlag) {
|
||||
const selectedIds = ids.value;
|
||||
const flagText = pricingFlag === 1 ? '允许划价' : '禁止划价';
|
||||
proxy.$modal
|
||||
.confirm(`是否确认将选中的诊疗项目设置为"${flagText}"?`)
|
||||
.then(function () {
|
||||
return updatePricingFlag(selectedIds, pricingFlag);
|
||||
})
|
||||
.then(() => {
|
||||
getList();
|
||||
proxy.$modal.msgSuccess(`批量设置${flagText}成功`);
|
||||
})
|
||||
.catch(() => {});
|
||||
}
|
||||
/** 导出按钮操作 */
|
||||
function handleExport() {
|
||||
proxy.download(
|
||||
|
||||
@@ -147,7 +147,7 @@ export function wxPay (data) {
|
||||
*/
|
||||
export function WxPayResult (data) {
|
||||
return request ({
|
||||
url: '/three-part/pay/pay-query'+data.paymentId,
|
||||
url: '/three-part/pay/pay-query/' + data.paymentId,
|
||||
method: 'get',
|
||||
});
|
||||
}
|
||||
|
||||
@@ -613,7 +613,7 @@ async function submit() {
|
||||
return sum + (Number(item.amount) || 0);
|
||||
}, 0)
|
||||
.toFixed(2);
|
||||
if (parseFloat(amount) < formData.totalAmount.toFixed(2)) {
|
||||
if (parseFloat(amount) < parseFloat(formData.totalAmount.toFixed(2))) {
|
||||
proxy.$modal.msgError('请输入正确的结算金额');
|
||||
return;
|
||||
}
|
||||
@@ -639,8 +639,14 @@ async function submit() {
|
||||
if (userStore.fixmedinsCode == 'H22010200672' && props.consumablesIdList.length > 0) {
|
||||
dispenseMedicalConsumables(props.consumablesIdList);
|
||||
}
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '收费失败');
|
||||
}
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('收费失败:', error);
|
||||
proxy.$modal.msgError(error.message || '收费失败,请重试');
|
||||
})
|
||||
.finally(() => {
|
||||
dialogLoading.value = false;
|
||||
});
|
||||
|
||||
@@ -497,14 +497,14 @@
|
||||
handleColor(
|
||||
[1, 2, 3, 4, 5, 6, 7, 8, 9],
|
||||
[
|
||||
'default',
|
||||
'info',
|
||||
'success',
|
||||
'default',
|
||||
'info',
|
||||
'info',
|
||||
'success',
|
||||
'info',
|
||||
'warning',
|
||||
'error',
|
||||
'danger',
|
||||
'info',
|
||||
],
|
||||
scope.row.statusEnum
|
||||
|
||||
@@ -352,6 +352,8 @@ import { ref, reactive, onMounted, computed } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Search, Refresh, Printer, Edit, View, Delete } from '@element-plus/icons-vue'
|
||||
import { queryConsultationListPage, cancelConsultation, saveConsultation } from './api'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
|
||||
const loading = ref(false)
|
||||
const saving = ref(false)
|
||||
@@ -477,12 +479,28 @@ const handleCurrentChange = (val) => {
|
||||
loadData()
|
||||
}
|
||||
|
||||
const handlePrint = () => {
|
||||
const handlePrint = async () => {
|
||||
if (!currentRow.value) {
|
||||
ElMessage.warning('请先选择一条记录')
|
||||
return
|
||||
}
|
||||
window.print()
|
||||
try {
|
||||
// 构建打印数据
|
||||
const printData = {
|
||||
patientName: currentRow.value.patientName || '',
|
||||
gender: currentRow.value.genderText || '',
|
||||
age: currentRow.value.age || '',
|
||||
deptName: currentRow.value.department || '',
|
||||
diagnosis: currentRow.value.provisionalDiagnosis || '',
|
||||
consultationReason: currentRow.value.consultationPurpose || '',
|
||||
applyTime: currentRow.value.applyTime || '',
|
||||
applyDoctor: currentRow.value.requestingPhysician || ''
|
||||
}
|
||||
await simplePrint(PRINT_TEMPLATE.CONSULTATION, printData)
|
||||
} catch (error) {
|
||||
console.error('会诊申请单打印失败:', error)
|
||||
ElMessage.error('打印失败')
|
||||
}
|
||||
}
|
||||
|
||||
const handleRowChange = (row) => {
|
||||
|
||||
@@ -211,6 +211,8 @@ import { computed, ref, onMounted, watch } from 'vue'
|
||||
import { ElMessage, ElMessageBox } from 'element-plus'
|
||||
import { Check } from '@element-plus/icons-vue'
|
||||
import useUserStore from '@/store/modules/user'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE } from '@/utils/printUtils.js'
|
||||
import {
|
||||
getPendingConfirmationList,
|
||||
confirmConsultation,
|
||||
@@ -498,12 +500,28 @@ const handleSign = async () => {
|
||||
}
|
||||
}
|
||||
|
||||
const handlePrint = () => {
|
||||
const handlePrint = async () => {
|
||||
if (!currentRow.value) {
|
||||
ElMessage.warning('请先选择会诊申请')
|
||||
return
|
||||
}
|
||||
window.print()
|
||||
try {
|
||||
// 构建打印数据
|
||||
const printData = {
|
||||
patientName: formData.value.patientName || '',
|
||||
gender: formData.value.genderText || '',
|
||||
age: formData.value.age || '',
|
||||
deptName: formData.value.applyDept || '',
|
||||
diagnosis: formData.value.provisionalDiagnosis || '',
|
||||
consultationReason: formData.value.consultationPurpose || '',
|
||||
applyTime: formData.value.applyTime || '',
|
||||
applyDoctor: formData.value.applyDoctor || ''
|
||||
}
|
||||
await simplePrint(PRINT_TEMPLATE.CONSULTATION, printData)
|
||||
} catch (error) {
|
||||
console.error('会诊确认单打印失败:', error)
|
||||
ElMessage.error('打印失败')
|
||||
}
|
||||
}
|
||||
|
||||
const handleRefresh = async () => {
|
||||
|
||||
@@ -501,6 +501,8 @@ import {
|
||||
getInspectionItemList
|
||||
} from '../api'
|
||||
import useUserStore from '@/store/modules/user.js'
|
||||
// 迁移到 hiprint
|
||||
import { simplePrint, PRINT_TEMPLATE, previewPrint } from '@/utils/printUtils.js'
|
||||
import {storeToRefs} from 'pinia'
|
||||
|
||||
// Props
|
||||
@@ -1366,8 +1368,6 @@ function handleSelectionChange(selection) {
|
||||
|
||||
// 打印申请单
|
||||
function handlePrint(row) {
|
||||
// console.log('打印申请单:', row)
|
||||
|
||||
// 切换到申请单TAB
|
||||
leftActiveTab.value = 'application'
|
||||
|
||||
@@ -1376,64 +1376,14 @@ function handlePrint(row) {
|
||||
|
||||
// 等待DOM更新后执行打印
|
||||
setTimeout(() => {
|
||||
// 添加打印样式
|
||||
const printStyle = document.createElement('style')
|
||||
printStyle.innerHTML = `
|
||||
@media print {
|
||||
body * {
|
||||
visibility: hidden;
|
||||
}
|
||||
.application-form,
|
||||
.application-form * {
|
||||
visibility: visible;
|
||||
}
|
||||
.application-form {
|
||||
position: absolute;
|
||||
left: 0;
|
||||
top: 0;
|
||||
width: 100%;
|
||||
max-width: none;
|
||||
box-shadow: none;
|
||||
border: none;
|
||||
margin: 0;
|
||||
padding: 20px;
|
||||
}
|
||||
.el-tabs__header {
|
||||
display: none;
|
||||
}
|
||||
.el-tabs__content {
|
||||
padding: 0;
|
||||
}
|
||||
.section-header,
|
||||
.pagination-container,
|
||||
.inspection-selector,
|
||||
.selected-items-area,
|
||||
.actions {
|
||||
display: none !important;
|
||||
}
|
||||
.application-form .el-input__inner,
|
||||
.application-form .el-select .el-input__inner,
|
||||
.application-form .el-textarea__inner {
|
||||
border: 1px solid #ddd !important;
|
||||
background: white !important;
|
||||
}
|
||||
.application-form .el-checkbox__input.is-checked .el-checkbox__inner {
|
||||
background-color: #409eff;
|
||||
border-color: #409eff;
|
||||
}
|
||||
}
|
||||
`
|
||||
document.head.appendChild(printStyle)
|
||||
|
||||
// 执行打印
|
||||
window.print()
|
||||
|
||||
// 移除打印样式
|
||||
setTimeout(() => {
|
||||
document.head.removeChild(printStyle)
|
||||
}, 1000)
|
||||
|
||||
ElMessage.success('正在准备打印...')
|
||||
// 使用 hiprint 的 previewPrint 方法
|
||||
const printDom = document.querySelector('.application-form')
|
||||
if (printDom) {
|
||||
previewPrint(printDom)
|
||||
ElMessage.success('正在准备打印...')
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容')
|
||||
}
|
||||
}, 100)
|
||||
}
|
||||
|
||||
|
||||
@@ -1348,6 +1348,8 @@
|
||||
<script setup>
|
||||
import {computed, reactive, ref} from 'vue';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
const userStore = useUserStore();
|
||||
const bodyRef = ref();
|
||||
@@ -1390,32 +1392,11 @@ const closePrintPreview = () => {
|
||||
showPrintPreview.value = false;
|
||||
};
|
||||
|
||||
// 处理打印逻辑
|
||||
// 处理打印逻辑 - 使用 hiprint
|
||||
const handlePrint = () => {
|
||||
if (!printContentRef.value) return;
|
||||
|
||||
// 创建打印窗口
|
||||
const printWindow = window.open('', '_blank');
|
||||
// 复制打印内容到新窗口
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>打印预览</title>
|
||||
<style>
|
||||
body { font-family: 'Microsoft YaHei', 'PingFang SC', sans-serif; padding: 20px; }
|
||||
* { box-sizing: border-box; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${printContentRef.value.innerHTML}
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
printWindow.document.close();
|
||||
// 执行打印
|
||||
printWindow.print();
|
||||
// 关闭打印窗口(可选)
|
||||
printWindow.close();
|
||||
// 使用 hiprint 预览打印
|
||||
previewPrint(printContentRef.value);
|
||||
};
|
||||
|
||||
const getDom = () => {
|
||||
|
||||
@@ -172,7 +172,9 @@ import {computed, onMounted, ref} from 'vue';
|
||||
import {ElMessage} from 'element-plus';
|
||||
import {patientInfoList} from '../../components/store/patient.js';
|
||||
import {getSinglePatient} from '../store/patient.js'; // 导入获取单选患者信息的方法
|
||||
import {formatDateStr} from '@/utils/index';
|
||||
import {formatDateStr} from '@/utils';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
|
||||
// 响应式数据
|
||||
const loading = ref(false);
|
||||
@@ -433,39 +435,16 @@ function handlePrint() {
|
||||
printDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 执行打印
|
||||
// 执行打印 - 使用 hiprint
|
||||
function doPrint() {
|
||||
try {
|
||||
// 获取要打印的内容
|
||||
const printContent = document.getElementById('print-content').innerHTML;
|
||||
|
||||
// 创建临时窗口
|
||||
const printWindow = window.open('', '_blank');
|
||||
|
||||
// 写入内容
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>预交金清单</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { border: 1px solid #ccc; padding: 8px; }
|
||||
th { background-color: #f2f2f2; }
|
||||
tfoot { font-weight: bold; }
|
||||
.total-row { background-color: #f5f5f5; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${printContent}
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
|
||||
// 打印
|
||||
printWindow.document.close();
|
||||
printWindow.focus();
|
||||
printWindow.print();
|
||||
const printContent = document.getElementById('print-content');
|
||||
if (printContent) {
|
||||
previewPrint(printContent);
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容');
|
||||
}
|
||||
} catch (e) {
|
||||
ElMessage.error('打印失败');
|
||||
console.error('Print error:', e);
|
||||
|
||||
@@ -495,38 +495,16 @@ function handlePrint() {
|
||||
printDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 执行打印
|
||||
// 执行打印 - 使用 hiprint
|
||||
function doPrint() {
|
||||
try {
|
||||
// 获取要打印的内容
|
||||
const printContent = document.getElementById('print-content').innerHTML;
|
||||
|
||||
// 创建临时窗口
|
||||
const printWindow = window.open('', '_blank');
|
||||
|
||||
// 写入内容
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>费用明细清单</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { border: 1px solid #ccc; padding: 8px; }
|
||||
th { background-color: #f2f2f2; }
|
||||
tfoot { font-weight: bold; }
|
||||
.total-row { background-color: #f5f5f5; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${printContent}
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
// 打印
|
||||
printWindow.document.close();
|
||||
printWindow.focus();
|
||||
printWindow.print();
|
||||
const printContent = document.getElementById('print-content');
|
||||
if (printContent) {
|
||||
previewPrint(printContent);
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容');
|
||||
}
|
||||
} catch (e) {
|
||||
ElMessage.error('打印失败');
|
||||
console.error('Print error:', e);
|
||||
|
||||
@@ -345,6 +345,8 @@ import moment from 'moment';
|
||||
import {ElMessage} from 'element-plus';
|
||||
import {patientInfoList} from '../../components/store/patient.js';
|
||||
import {formatDateStr} from '@/utils/index';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
import {getCostDetail} from './api.js';
|
||||
import {getOrgList} from '../../../basicmanage/ward/components/api.js';
|
||||
import {User} from '@element-plus/icons-vue';
|
||||
@@ -627,39 +629,16 @@ function handlePrint() {
|
||||
printDialogVisible.value = true;
|
||||
}
|
||||
|
||||
// 执行打印
|
||||
// 执行打印 - 使用 hiprint
|
||||
function doPrint() {
|
||||
try {
|
||||
// 获取要打印的内容
|
||||
const printContent = document.getElementById('print-content').innerHTML;
|
||||
|
||||
// 创建临时窗口
|
||||
const printWindow = window.open('', '_blank');
|
||||
|
||||
// 写入内容
|
||||
printWindow.document.write(`
|
||||
<html>
|
||||
<head>
|
||||
<title>费用明细清单</title>
|
||||
<style>
|
||||
body { font-family: Arial, sans-serif; margin: 20px; }
|
||||
table { width: 100%; border-collapse: collapse; }
|
||||
th, td { border: 1px solid #ccc; padding: 8px; }
|
||||
th { background-color: #f2f2f2; }
|
||||
tfoot { font-weight: bold; }
|
||||
.total-row { background-color: #f5f5f5; }
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
${printContent}
|
||||
</body>
|
||||
</html>
|
||||
`);
|
||||
|
||||
// 打印
|
||||
printWindow.document.close();
|
||||
printWindow.focus();
|
||||
printWindow.print();
|
||||
const printContent = document.getElementById('print-content');
|
||||
if (printContent) {
|
||||
previewPrint(printContent);
|
||||
} else {
|
||||
ElMessage.warning('未找到打印内容');
|
||||
}
|
||||
} catch (e) {
|
||||
ElMessage.error('打印失败');
|
||||
console.error('Print error:', e);
|
||||
|
||||
@@ -147,6 +147,8 @@ import {formatDateStr} from '@/utils';
|
||||
import moment from 'moment';
|
||||
import {getVitalSignsInfo, listPatient} from './components/api';
|
||||
import useUserStore from '@/store/modules/user';
|
||||
// 迁移到 hiprint
|
||||
import { previewPrint } from '@/utils/printUtils.js';
|
||||
// import { getSignsCharts } from '@/api/signsManagement'
|
||||
// import { date } from 'jszip/lib/defaults'
|
||||
const userStore = useUserStore();
|
||||
@@ -452,65 +454,23 @@ function dateDiff(start, end) {
|
||||
return '0';
|
||||
}
|
||||
}
|
||||
// 打印体温单
|
||||
// 打印体温单 - 使用 hiprint
|
||||
function printTW() {
|
||||
// this.$print(this.$refs.print);
|
||||
printRef.value.focus();
|
||||
printRef.value.contentWindow.print();
|
||||
// this.$refs.refTemp.printPage();
|
||||
const element = printRef.value;
|
||||
if (element) {
|
||||
previewPrint(element);
|
||||
} else {
|
||||
console.error('未找到可打印的内容');
|
||||
}
|
||||
}
|
||||
// 打印体温单
|
||||
// 打印体温单 - 使用 hiprint
|
||||
function printPage() {
|
||||
const element = printRef.value;
|
||||
|
||||
if (!element) {
|
||||
if (element) {
|
||||
previewPrint(element);
|
||||
} else {
|
||||
console.error('未找到可打印的内容');
|
||||
return;
|
||||
}
|
||||
|
||||
// 创建一个克隆元素用于打印,避免修改原 DOM
|
||||
const clone = element.cloneNode(true);
|
||||
|
||||
// 设置宽度为 A4(780px ≈ 210mm),高度自适应
|
||||
clone.style.transform = 'scale(0.7)';
|
||||
clone.style.transformOrigin = 'top left';
|
||||
clone.style.width = 'calc(210mm * 1.11)';
|
||||
clone.style.height = 'calc(297mm * 1.11)';
|
||||
clone.style.marginLeft = '50px';
|
||||
|
||||
// 插入到 body 中以便 html2pdf 渲染
|
||||
document.body.appendChild(clone);
|
||||
|
||||
// 设置 html2pdf 配置
|
||||
const opt = {
|
||||
margin: 0,
|
||||
filename: '体温单.pdf',
|
||||
image: { type: 'jpeg', quality: 1 },
|
||||
html2canvas: { scale: 2, useCORS: true }, // 启用跨域资源支持
|
||||
jsPDF: { unit: 'mm', format: 'a4', orientation: 'portrait' },
|
||||
pagebreak: { mode: ['avoid-all'] },
|
||||
onclone: (clonedDoc) => {
|
||||
const chart = clonedDoc.getElementById(clone.id);
|
||||
if (chart) {
|
||||
chart.style.width = '210mm'; // 强制 A4 宽度
|
||||
chart.style.margin = '0 auto';
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
// 导出为 PDF 并打印
|
||||
html2pdf()
|
||||
.from(clone)
|
||||
.set(opt)
|
||||
.toPdf()
|
||||
.get('pdf')
|
||||
.then(function (pdf) {
|
||||
pdf.autoPrint(); // 自动打印
|
||||
window.open(pdf.output('bloburl'), '_blank'); // 在新窗口打开 PDF(以便用户确认)
|
||||
})
|
||||
.finally(() => {
|
||||
document.body.removeChild(clone); // 清理临时元素
|
||||
});
|
||||
}
|
||||
// 转化时间
|
||||
function formatDateTo(dateStr) {
|
||||
|
||||
@@ -1017,7 +1017,12 @@ function submitAudit() {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
emit('refresh');
|
||||
visible.value = false;
|
||||
} else {
|
||||
proxy.$modal.msgError(res.msg || '提交审批失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('提交审批失败:', error);
|
||||
proxy.$modal.msgError(error.message || '提交审批失败,请重试');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -942,10 +942,17 @@ function handleSubmitApproval() {
|
||||
proxy.$modal.msgWarning('第' + length + '行单据未保存,请先保存');
|
||||
} else {
|
||||
submitApproval(receiptHeaderForm.busNo).then((response) => {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
store.clearCurrentDataLYCK();
|
||||
router.replace({ path: 'requisitionManagementList' });
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
store.clearCurrentDataLYCK();
|
||||
router.replace({ path: 'requisitionManagementList' });
|
||||
} else {
|
||||
proxy.$modal.msgError(response.msg || '提交审批失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('提交审批失败:', error);
|
||||
proxy.$modal.msgError(error.message || '提交审批失败,请重试');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1015,11 +1015,18 @@ function handleSubmitApproval() {
|
||||
proxy.$modal.msgWarning('第' + length + '行单据未保存,请先保存');
|
||||
} else {
|
||||
submitTHApproval(receiptHeaderForm.busNo).then((response) => {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
store.clearCurrentDataLYTK();
|
||||
// 跳转到审核页面
|
||||
router.replace({ path: 'requisitionInventoryManagement' });
|
||||
if (response.code == 200) {
|
||||
proxy.$modal.msgSuccess('提交审批成功');
|
||||
tagsViewStore.delView(router.currentRoute.value);
|
||||
store.clearCurrentDataLYTK();
|
||||
// 跳转到审核页面
|
||||
router.replace({ path: 'requisitionInventoryManagement' });
|
||||
} else {
|
||||
proxy.$modal.msgError(response.msg || '提交审批失败');
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('提交审批失败:', error);
|
||||
proxy.$modal.msgError(error.message || '提交审批失败,请重试');
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -244,7 +244,6 @@ const loading = ref(false);
|
||||
const getList = () => {
|
||||
loading.value = true;
|
||||
getRegisteInfoPage(queryParams.value).then((res) => {
|
||||
console.log(res);
|
||||
treatHospitalizedData.value = res.data.records;
|
||||
total.value = res.data.total;
|
||||
loading.value = false;
|
||||
|
||||
Reference in New Issue
Block a user