@@ -44,14 +44,24 @@
< el-table-column prop = "patientName" label = "姓名" align = "center" / >
< el-table-column prop = "genderEnum_enumText" label = "性别" align = "center" / >
< el-table-column prop = "age" label = "年龄" align = "center" / >
<< << << < HEAD
=== === =
< el-table-column prop = "receptionTime" label = "挂号时间" align = "center" / >
>>> >>> > v1 .3
< / el-table >
< pagination
v-show = "total > 0"
:total = "total"
v -model :page = "queryParams.pageNo"
v -model :limit = "queryParams.pageSize"
< < < < < < < HEAD
layout = "total, sizes, prev, pager, next"
@pagination ="getPatientList"
= = = = = = =
@pagination ="getPatientList"
:pager-count = "1"
: layout = "'total, prev, pager, next'"
> >>> >>> v1 .3
/ >
< / el-col >
< / el-row >
@@ -96,6 +106,10 @@
>
打印处置单
< / el-button >
<< << << < HEAD
=== === =
< el-button type = "primary" plain @click.stop ="getEnPrescription()" > 处方单 < / el -button >
>>> >>> > v1 .3
< / el-col >
< el-col :xs = "24" :sm = "12" :md = "6" >
< el-form
@@ -282,16 +296,28 @@
< / template >
< / el-table-column >
< el-table-column align = "center" header -align = " center " prop = "unitPrice" label = "单价" >
<< << << < HEAD
< template # default = "scope" >
< span >
{ { scope . unitPrice ? scope . unitPrice . toFixed ( 2 ) : '0.00' + ' 元' } }
=== === =
< template # default = "{ row }" >
< span >
{ { row . unitPrice ? row . unitPrice . toFixed ( 2 ) : '0.00' + ' 元' } }
>>> >>> > v1 .3
< / span >
< / template >
< / el-table-column >
< el-table-column align = "center" header -align = " center " prop = "totalPrice" label = "总价" >
<< << << < HEAD
< template # default = "scope" >
< span >
{ { scope . totalPrice ? scope . totalPrice . toFixed ( 2 ) : '0.00' + ' 元' } }
=== === =
< template # default = "{ row }" >
< span >
{ { row . totalPrice ? row . totalPrice . toFixed ( 2 ) : '0.00' + ' 元' } }
>>> >>> > v1 .3
< / span >
< / template >
< / el-table-column >
@@ -301,6 +327,11 @@
< / el-col >
< / el-row >
< PerformRecordDialog :open = "openDialog" :recordList = "recordList" @close ="openDialog = false" / >
< PrescriptionInfo
:open = "openPrescriptionDialog"
:precriptionInfo = "prescriptionInfo"
@close ="openPrescriptionDialog = false"
/ >
< / div >
< / template >
@@ -311,20 +342,27 @@ import {
getDisposalList ,
execute ,
cancel ,
getEnPrescriptionInfo ,
getPerformRecord ,
listWesternmedicine ,
printBloodCode ,
} from './components/api' ;
import PerformRecordDialog from './components/performRecordDialog' ;
import PrescriptionInfo from '../../doctorstation/components/prescription/prescriptionInfo.vue' ;
import templateJson from './components/template.json' ;
import prescriptionTemplate from './components/prescriptionTemplate.json' ;
import bloodTemplate from './components/bloodTemplate.json' ;
import disposalTemplate from './components/disposalTemplate.json' ;
import { advicePrint , getAdjustPriceSwitchState , lotNumberMatch } from '@/api/public' ;
import { formatDateStr } from '@/utils' ;
import { hiprint } from 'vue-plugin-hiprint' ;
import { advicePrint } from '@/api/public' ;
import useUserStore from '@/store/modules/user' ;
import { getGroupMarkers } from '@/utils/his' ;
<< << << < HEAD
=== === =
import { simplePrint , PRINT _TEMPLATE } from '@/utils/printUtils.js' ;
>>> >>> > v1 .3
// 患者搜索
const queryParams = ref ( {
pageNo : 1 ,
@@ -334,6 +372,10 @@ const receptionTime = ref([
formatDateStr ( new Date ( ) , 'YYYY-MM-DD' ) ,
formatDateStr ( new Date ( ) , 'YYYY-MM-DD' ) ,
] ) ;
const openPrescriptionDialog = ref ( false ) ;
const prescriptionInfo = ref ( [ ] ) ;
const total = ref ( 0 ) ;
// 患者数据
const patientList = ref ( [ ] ) ;
@@ -408,6 +450,10 @@ function handleServiceCategoryChange(value) {
deviceList . value = res . data . records . filter ( ( item ) => {
return item . requestTable == 'wor_device_request' ;
} ) ;
<< << << < HEAD
=== === =
>>> >>> > v1 .3
activityList . value = res . data . records . filter ( ( item ) => {
return (
item . requestTable == 'wor_service_request' ||
@@ -424,10 +470,23 @@ function handleServiceCategoryChange(value) {
function handlePatientSelect ( row ) {
loading . value = true ;
currentPatient . value = row ;
getAdjustPriceSwitchState ( ) . then ( ( res ) => {
if ( res . data ) {
lotNumberMatch ( { encounterIdList : row . encounterId } ) . then ( ( ) => {
getAllList ( row ) ;
} ) ;
} else {
getAllList ( row ) ;
}
} ) ;
}
function getAllList ( row ) {
getDisposalList ( row . encounterId ) . then ( ( res ) => {
deviceList . value = res . data . records . filter ( ( item ) => {
return item . requestTable == 'wor_device_request' ;
} ) ;
console . log ( '耗材列表=====>' , JSON . stringify ( deviceList . value ) ) ;
activityList . value = res . data . records . filter ( ( item ) => {
return (
item . requestTable == 'wor_service_request' || item . requestTable == 'med_medication_request'
@@ -478,6 +537,47 @@ function handleBatchValidate(type) {
} ;
} ) ;
<< << << < HEAD
=== === =
// 批量操作校验
function handleBatchValidate ( type ) {
let params = [ ] ;
// 是否批量选择了数据
if ( isMultiple . value ) {
proxy . $modal . msgError ( '请选择要执行的项目' ) ;
return ;
}
if ( type === 'execute' ) {
let activityList = activitySelectedList . value
. filter ( ( item ) => {
return item . chargeStatus === 5 ;
} )
. map ( ( item ) => {
return {
requestId : item . requestId ,
dispenseId : item . dispenseId ,
requestTable : item . requestTable ,
chargeStatus : item . chargeStatus _enumText ,
dispenseStatus : item . dispenseStatus _enumText ,
name : item . itemName ,
} ;
} ) ;
let deviceList = deviceSelectedList . value
. filter ( ( item ) => {
return item . dispenseStatus === 2 ;
} )
. map ( ( item ) => {
return {
requestId : item . requestId ,
dispenseId : item . dispenseId ,
requestTable : item . requestTable ,
chargeStatus : item . chargeStatus _enumText ,
dispenseStatus : item . dispenseStatus _enumText ,
name : item . itemName ,
} ;
} ) ;
>>> >>> > v1 .3
return [ ... activityList , ... deviceList ] ;
} else if ( type === 'cancel' ) {
let list = [ ... activitySelectedList . value , ... deviceSelectedList . value ] ;
@@ -642,6 +742,26 @@ function printPrescription() {
} ) ; //开始打印
} ) ;
}
<< << << < HEAD
=== === =
// 查看本次就诊处方单
function getEnPrescription ( ) {
getEnPrescriptionInfo ( { encounterId : currentPatient . value . encounterId } ) . then ( ( res ) => {
console . log ( '处方单 res' , res ) ;
let dataArr = res . data . records || [ ] ;
if ( dataArr . length <= 0 ) {
ElMessage ( {
type : 'error' ,
message : '暂无处方单' ,
} ) ;
return ;
}
prescriptionInfo . value = res . data . records ;
openPrescriptionDialog . value = true ;
} ) ;
}
>>> >>> > v1 .3
// 打印处置单
function printDisposal ( ) {
let requestIds = deviceActivityList . value
@@ -749,7 +869,104 @@ function handleCancel(row) {
} ) ;
}
// 打印瓶贴
<< << << < HEAD
function printBottleLabel ( ) {
=== === =
// function printBottleLabel() {
// let result = [];
// // 过滤出全部输液药品
// let selectRows = activityListRef.value.getSelectionRows();
// let printLiist = [];
// // 有选中的优先打印选中行,没有的话打印全部的输液药品
// if (selectRows.length > 0) {
// printLiist = selectRows.filter((item) => {
// return item.medCategory == '2' || item.medCategory == '1';
// });
// } else {
// printLiist = activityList.value.filter((item) => {
// return item.medCategory == '2' || item.medCategory == '1';
// });
// }
// // 按照groupId分组, 但将多天的项目展开为独立项目
// let expandedList = [];
// printLiist.forEach((item) => {
// // 如果用药天数大于1, 则创建多个项目
// if (item.dispensePerDuration && item.dispensePerDuration > 1) {
// // 为每一天创建一个项目
// for (let i = 0; i < item.dispensePerDuration; i++) {
// // 克隆项目并调整数量
// const clonedItem = {
// ...item,
// // 数量除以天数
// quantity: item.quantity ? item.quantity / item.dispensePerDuration : item.quantity,
// // 可以添加一个字段表示是第几天
// dayIndex: i + 1,
// totalDays: item.dispensePerDuration,
// data: item.itemName + ' ' + item.size + ' ' + item.methodCode_dictText,
// };
// // 获取当前时间做执行日期, 如果用药天数大于1, 依次累加
// const date = new Date();
// date.setDate(date.getDate() + i);
// clonedItem.performDateTime = formatDateStr(date, 'YYYY-MM-DD');
// // 将克隆的项目添加到展开列表中, 不按groupId分组
// expandedList.push(clonedItem);
// }
// } else {
// // 天数为1或没有设置天数, 直接使用原项目
// item.data = item.itemName + ' ' + item.size + ' ' + item.methodCode_dictText;
// expandedList.push(item);
// }
// });
// // 重新按groupId分组, 但每个展开的项目都是独立的
// const groupedByGroupId = expandedList.reduce((acc, item) => {
// // 为展开的项目生成新的唯一groupId
// const groupId = item.dayIndex
// ? `${item.groupId || item.requestId}_day${item.dayIndex}`
// : item.groupId || item.requestId;
// if (!acc[groupId]) {
// acc[groupId] = [];
// }
// acc[groupId].push(item);
// return acc;
// }, {});
// const resultList = Object.values(groupedByGroupId);
// console.log(resultList, '23456789');
// result = resultList.map((item) => {
// return {
// patientName: currentPatient.value.patientName,
// prepareName: userStore.nickName,
// genderEnum_enumText: currentPatient.value.genderEnum_enumText,
// age: currentPatient.value.age,
// date: item[0].performDateTime,
// infuseData: item,
// };
// });
// const printElements = templateJson;
// var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
// console.log(result, '打印机列表');
// hiprintTemplate.print2(result, {
// // printer: 'Xprinter XP-365B',
// height: 210,
// width: 148,
// });
// // 直接打印回调
// // 发送任务到打印机成功
// hiprintTemplate.on('printSuccess', function (e) {
// console.log('打印成功');
// });
// // 发送任务到打印机失败
// hiprintTemplate.on('printError', function (e) {
// console.log('打印失败');
// });
// }
async function printBottleLabel ( ) {
>>> >>> > v1 .3
let result = [ ] ;
// 过滤出全部输液药品
let selectRows = activityListRef . value . getSelectionRows ( ) ;
@@ -795,6 +1012,9 @@ function printBottleLabel() {
// 天数为1或没有设置天数, 直接使用原项目
item . data = item . itemName + ' ' + item . size + ' ' + item . methodCode _dictText ;
expandedList . push ( item ) ;
//将当前时间传到expandedList中
const date = new Date ( ) ;
item . performDateTime = formatDateStr ( date , 'YYYY-MM-DD' ) ;
}
} ) ;
@@ -815,6 +1035,7 @@ function printBottleLabel() {
console . log ( resultList , '23456789' ) ;
result = resultList . map ( ( item ) => {
console . log ( item , '111323item' ) ;
return {
patientName : currentPatient . value . patientName ,
prepareName : userStore . nickName ,
@@ -824,6 +1045,7 @@ function printBottleLabel() {
infuseData : item ,
} ;
} ) ;
<< << << < HEAD
const printElements = templateJson ;
var hiprintTemplate = new hiprint . PrintTemplate ( { template : printElements } ) ; // 定义模板
console . log ( result , '打印机列表' ) ;
@@ -832,15 +1054,39 @@ function printBottleLabel() {
height : 210 ,
width : 148 ,
} ) ;
=== === =
console . log ( result , '打印数据' ) ;
await simplePrint ( PRINT _TEMPLATE . OUTPATIENT _INFUSION , result ) ;
// console.log('打印成功');
// const printElements = templateJson;
// var hiprintTemplate = new hiprint.PrintTemplate({ template: printElements }); // 定义模板
// console.log(result, '打印机列表');
// hiprintTemplate.print2(result, {
// height: 210,
// width: 148,
// });
>>> >>> > v1 .3
// 直接打印回调
// 发送任务到打印机成功
hiprintTemplate. on ( 'printSuccess', function ( e ) {
console. log ( '打印成功' ) ;
} ) ;
// 发送任务到打印机失败
hiprintTemplate. on ( 'printError', function ( e ) {
console. log ( '打印失败' ) ;
} ) ;
// hiprintTemplate.on( 'printSuccess', function (e) {
// console.log('打印成功');
// });
// // 发送任务到打印机失败
// hiprintTemplate.on( 'printError', function (e) {
// console.log('打印失败');
// });
}
// 选择框改变时的处理
function handleSelectionChange ( selection , row ) {
const isSelected = selection . some ( ( item ) => item . requestId === row . requestId ) ;
activityList . value
. filter ( ( item ) => {
return item . groupId && item . groupId == row ? . groupId ;
} )
. forEach ( ( row ) => {
activityListRef . value . toggleRowSelection ( row , isSelected ) ;
} ) ;
}
// 选择框改变时的处理
@@ -1039,4 +1285,8 @@ function getRecord(row) {
: deep ( . el - table _ _body ) tr : hover td . no - hover - column {
background - color : inherit ! important ;
}
< / style >
<< << << < HEAD
< / style >
=== === =
< / style >
>>> >>> > v1 .3