|
@@ -5,21 +5,18 @@
|
|
|
cancel-text="关闭"
|
|
|
:confirm-click="execPrint"
|
|
|
>
|
|
|
- <Charge :patNo :times :showButton/>
|
|
|
+ <Charge ref="chargeList" :patNo :times :showButton/>
|
|
|
</CyDialog>
|
|
|
</template>
|
|
|
|
|
|
<script setup>
|
|
|
import {
|
|
|
selectPatOverviews,
|
|
|
- selectBriefPatInfo,
|
|
|
- selectChargeList,
|
|
|
- executeSelfpayUpload
|
|
|
} from "@/api/inpatient/charge-list";
|
|
|
-import {ElMessage, ElMessageBox} from "element-plus";
|
|
|
-import {getLodop, initLodop} from '@/utils/c-lodop'
|
|
|
+import {initLodop} from '@/utils/c-lodop'
|
|
|
import Charge from "./Charge.vue";
|
|
|
import CyDialog from "@/components/cy/dialog/src/CyDialog.vue";
|
|
|
+import {useCompRef} from "@/utils/useCompRef";
|
|
|
|
|
|
const props = defineProps({
|
|
|
patNo: {
|
|
@@ -38,82 +35,13 @@ const props = defineProps({
|
|
|
}
|
|
|
})
|
|
|
const emits = defineEmits(["close"])
|
|
|
-
|
|
|
+const chargeList = useCompRef(Charge)
|
|
|
const patList = ref([])
|
|
|
-const briefPatInfo = ref({})
|
|
|
-const chargeListMap = ref({})
|
|
|
-const sumsMap = ref({})
|
|
|
|
|
|
const currentPatNo = ref('')
|
|
|
-const fetchOverview = () => {
|
|
|
- if (!currentPatNo.value) {
|
|
|
- ElMessage({
|
|
|
- message: '住院号不能为空!',
|
|
|
- type: 'warning',
|
|
|
- duration: 2500,
|
|
|
- showClose: true
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- selectPatOverviews(currentPatNo.value).then(res => {
|
|
|
- patList.value = res
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const ajustDisdate = (disdate) => {
|
|
|
- return disdate ? disdate : '<span style="color: green">● 在院</span>'
|
|
|
-}
|
|
|
-
|
|
|
-const fetchBriefPatInfo = (row) => {
|
|
|
- selectBriefPatInfo(row).then(res => {
|
|
|
- briefPatInfo.value = res
|
|
|
- selectChargeList(row).then(rslt => {
|
|
|
- chargeListMap.value = rslt.chargeList
|
|
|
- sumsMap.value = rslt.sumsMap
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
-const selfpayUpload = () => {
|
|
|
- if (!briefPatInfo.value.patNo) {
|
|
|
- ElMessage({
|
|
|
- message: '请先选择住院历史记录。',
|
|
|
- type: 'warning',
|
|
|
- duration: 2500,
|
|
|
- showClose: true
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- executeSelfpayUpload(briefPatInfo.value).then(res => {
|
|
|
- ElMessageBox.alert(res, '上传完成', {
|
|
|
- type: 'info',
|
|
|
- showCancelButton: false,
|
|
|
- })
|
|
|
- })
|
|
|
-}
|
|
|
-
|
|
|
|
|
|
const execPrint = () => {
|
|
|
- if (!briefPatInfo.value.patNo) {
|
|
|
- ElMessage({
|
|
|
- message: '请先选择住院历史记录。',
|
|
|
- type: 'warning',
|
|
|
- duration: 2500,
|
|
|
- showClose: true
|
|
|
- })
|
|
|
- return
|
|
|
- }
|
|
|
- let LODOP = getLodop();
|
|
|
- const prntStyle = `<style>table, table * {margin: 0;padding: 0;border-collapse: collapse;font-size: 12px}</style>`
|
|
|
- const prntContent = document.getElementById('printArea').innerHTML
|
|
|
- let pagePrint = prntStyle + '<body>' + prntContent + '</body>'
|
|
|
- LODOP.PRINT_INIT('chargelist')
|
|
|
- LODOP.SET_PRINT_PAGESIZE(1, '210mm', '297mm', '')
|
|
|
- LODOP.ADD_PRINT_TABLE('0mm', '3mm', '210mm', '230mm', pagePrint)
|
|
|
- LODOP.SET_PRINT_STYLE('ItemType', 3)
|
|
|
- LODOP.ADD_PRINT_TEXT('280mm', '180mm', '25mm', '10mm', '第#页/共&页')
|
|
|
- LODOP.PRINT();
|
|
|
- // LODOP.PRINT_DESIGN()
|
|
|
+ chargeList.value.execPrint()
|
|
|
}
|
|
|
|
|
|
onMounted(() => {
|