|
@@ -9,6 +9,9 @@ import dayjs from "dayjs";
|
|
|
import { stringIsBlank } from "@/utils/blank-utils";
|
|
|
import { xcMessage } from "@/utils/xiaochan-element-plus";
|
|
|
import { getDate } from "@/utils/date"
|
|
|
+import {
|
|
|
+ selectOrderFrequency,
|
|
|
+} from "@/api/orderZdMaintain";
|
|
|
|
|
|
const props = defineProps<{
|
|
|
data: PrintOrderVo;
|
|
@@ -122,9 +125,34 @@ async function printPrescription(red: boolean) {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+let orderFrequency = []
|
|
|
+
|
|
|
+const getFrequencyCount = (frequCode) => {
|
|
|
+ console.log(frequCode, 'frequCode')
|
|
|
+ let count = 0
|
|
|
+ let target = orderFrequency.find(item=> item.code === frequCode)
|
|
|
+ let nextDayKey = ['day030','day100','day130','day200',
|
|
|
+ 'day230','day300','day330','day400','day430','day500','day530','day2400',]
|
|
|
+ // 遍历对象的所有键
|
|
|
+ Object.keys(target).forEach(key => {
|
|
|
+ // 判断键是否以'day'开头(区分大小写)
|
|
|
+ if (key.startsWith('day')) {
|
|
|
+ if(target[key]) console.log(target[key], 'key')
|
|
|
+ if(!nextDayKey.includes(key) && target[key] == 1) count++
|
|
|
+ }
|
|
|
+ });
|
|
|
+ console.log(count, 'count')
|
|
|
+ // console.log(target, 'target')
|
|
|
+ return count
|
|
|
+}
|
|
|
+
|
|
|
onMounted(() => {
|
|
|
state.data = props.data;
|
|
|
- console.log(state.data, 'state.data')
|
|
|
+ selectOrderFrequency().then(res=>{
|
|
|
+ // console.log(res, 'selectOrderFrequency')
|
|
|
+ orderFrequency = res
|
|
|
+ })
|
|
|
+ // console.log(state.data, 'state.data')
|
|
|
});
|
|
|
|
|
|
defineExpose({
|
|
@@ -381,7 +409,7 @@ defineExpose({
|
|
|
{{ item.drugSpecification }}
|
|
|
</td>
|
|
|
<td>
|
|
|
- {{ item.drugQuan }}{{ item.packUnitName }}
|
|
|
+ {{ Number(item.drugQuan) * getFrequencyCount(item.frequCode) }}{{ item.packUnitName }}
|
|
|
</td>
|
|
|
<td>
|
|
|
{{ item.dose }}{{ item.doseUnitName }}
|
|
@@ -430,7 +458,9 @@ defineExpose({
|
|
|
</div>
|
|
|
<div>药费</div>
|
|
|
<div class="print-poisonous-hemp__tag--underline" style="width: 21%;padding-left: 5px;">
|
|
|
- {{ item.packRetprice ? Number(item.packRetprice) * Number(item.drugQuan) : 0 }}
|
|
|
+ {{ item.packRetprice ?
|
|
|
+ Number(item.packRetprice) * Number(item.drugQuan) * getFrequencyCount(item.frequCode)
|
|
|
+ : 0 }}
|
|
|
</div>
|
|
|
<div>发出药品批号</div>
|
|
|
<div class="print-poisonous-hemp__tag--underline" style="width: 35%"></div>
|