|
@@ -2717,6 +2717,15 @@ function printPrescription(patientId, times, orderNo) {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+function groupByGroupProperty(array) {
|
|
|
+ return array.reduce((acc, current) => {
|
|
|
+ const group = current.groupOrder;
|
|
|
+ acc[group] = acc[group] || [];
|
|
|
+ acc[group].push(current);
|
|
|
+ return acc;
|
|
|
+ }, {});
|
|
|
+}
|
|
|
+
|
|
|
function printView(data) {
|
|
|
$('.sjh').remove();
|
|
|
$('#print_view input').attr("value", "");
|
|
@@ -2729,7 +2738,30 @@ function printView(data) {
|
|
|
$("#age").attr("value", age);
|
|
|
}
|
|
|
var list = data.list;
|
|
|
- console.log('list',list);
|
|
|
+ // console.log('list',list);
|
|
|
+ if(list.length > 0) {
|
|
|
+ let gruop = groupByGroupProperty(list);
|
|
|
+ for (const key in gruop) {
|
|
|
+ let current = gruop[key]
|
|
|
+ // console.log('current',current);
|
|
|
+ if (current) {
|
|
|
+ if(current.length == 1){
|
|
|
+ current[0].groupSign = '⊐'
|
|
|
+ } else {
|
|
|
+ current.forEach((item,index) => {
|
|
|
+ if(index == 0) {
|
|
|
+ item.groupSign = '⌝'
|
|
|
+ } else if(index == current.length - 1) {
|
|
|
+ item.groupSign = '⌟'
|
|
|
+ } else {
|
|
|
+ item.groupSign = ''
|
|
|
+ }
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ // console.log('gruop',gruop);
|
|
|
+ }
|
|
|
if (age.substring(0, age.indexOf('岁')) < 18 && yf.xyFlag === '1') {
|
|
|
$('#drugFlag').attr("value", "儿科");
|
|
|
printIndex = ekCfPrintIndex;
|
|
@@ -2871,7 +2903,7 @@ function getXyPrintHtml(list) {
|
|
|
var number = i + 1;
|
|
|
let manufactoryName = list[i].manufactoryName == null || list[i].manufactoryName === '' ? '' : '(' + list[i].manufactoryName + ')';
|
|
|
tr += '<tr>' +
|
|
|
- ' <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' + number + "." +
|
|
|
+ ' <td style="margin-bottom: 5px;width: 10px;font-size: 18px;" align="left" valign="top">' + number + "." +
|
|
|
' </td>' +
|
|
|
' <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">' + tryResult + list[i].drugName +
|
|
|
' </td>' +
|
|
@@ -2882,14 +2914,16 @@ function getXyPrintHtml(list) {
|
|
|
' </td>' +
|
|
|
' <td style="margin-bottom: 5px;vertical-align: middle !important;width: 25px;text-align: left;font-size: 13px;">' + list[i].ypUnitName +
|
|
|
' </td>' +
|
|
|
+ ' <td style="vertical-align: middle !important;width: 25px;text-align: left;font-size:25px;font-weight: bold">' + list[i].groupSign +
|
|
|
+ ' </td>' +
|
|
|
'</tr>' +
|
|
|
'<tr>' +
|
|
|
' <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' +
|
|
|
' </td>' +
|
|
|
- ' <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">' + '组 (' + list[i].groupOrder + ')' + tryFlag +
|
|
|
- ' </td>' +
|
|
|
' <td colspan="4" style="padding-left:0;margin-bottom: 5px;width:220px;vertical-align: middle !important;text-align: left;font-size: 13px;">用法:' + list[i].drugQuan + " " + list[i].drugUnitName + '/次 ' + list[i].frequencyName + ' ' + printName +
|
|
|
' </td>' +
|
|
|
+ ' <td style="margin-bottom: 5px;vertical-align: middle !important;width: 245px;font-size: 13px;">' + tryFlag +
|
|
|
+ ' </td>' +
|
|
|
'</tr>' +
|
|
|
'<tr>' +
|
|
|
' <td style="margin-bottom: 5px;width: 10px;font-size: 13px;" align="left" valign="top">' +
|