|
@@ -106,7 +106,7 @@
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
-<script setup>
|
|
|
+<script>
|
|
|
import {ref} from 'vue'
|
|
|
import store from '@/store'
|
|
|
import {getHuanZheXinXi} from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
|
|
@@ -123,156 +123,187 @@ import {downloadExcel} from '@/utils/excel'
|
|
|
import {getServerDateApi} from "@/api/public-api";
|
|
|
import {userInfoStore} from "@/utils/store-public";
|
|
|
|
|
|
-const dangQianShiJian = new Date()
|
|
|
-const deptList = userInfoStore.value.partTimeDeptMap
|
|
|
+export default {
|
|
|
+ components: {HuanZheFeiYong, XiangMuLuRu},
|
|
|
+ name: 'yiJiFeiYongLuRu',
|
|
|
+ setup() {
|
|
|
+ const dangQianShiJian = new Date()
|
|
|
+ const deptList = userInfoStore.value.partTimeDeptMap
|
|
|
|
|
|
-const xlmrRef = ref()
|
|
|
+ const xlmrRef = ref()
|
|
|
|
|
|
-const queryTerm = ref({
|
|
|
- inpatientNo: '',
|
|
|
- admissTimes: 0,
|
|
|
- zaiHuanChuYuan: '',
|
|
|
- dateRange: [dangQianShiJian, dangQianShiJian],
|
|
|
- riQiPaiXu: 'DESC',
|
|
|
- chargeCode: '',
|
|
|
- orderNo: 2,
|
|
|
- feiYongLeiXingCode: 0,
|
|
|
- dept: store.state.user.info.deptCode === '3100000' ? '' : store.state.user.info.deptCode,
|
|
|
- currentPage: 1,
|
|
|
- pageSize: 30,
|
|
|
- total: 0,
|
|
|
- tuiFeiFlag: 0,
|
|
|
-})
|
|
|
+ const queryTerm = ref({
|
|
|
+ inpatientNo: '',
|
|
|
+ admissTimes: 0,
|
|
|
+ zaiHuanChuYuan: '',
|
|
|
+ dateRange: [dangQianShiJian, dangQianShiJian],
|
|
|
+ riQiPaiXu: 'DESC',
|
|
|
+ chargeCode: '',
|
|
|
+ orderNo: 2,
|
|
|
+ feiYongLeiXingCode: 0,
|
|
|
+ dept: store.state.user.info.deptCode === '3100000' ? '' : store.state.user.info.deptCode,
|
|
|
+ currentPage: 1,
|
|
|
+ pageSize: 30,
|
|
|
+ total: 0,
|
|
|
+ tuiFeiFlag: 0,
|
|
|
+ })
|
|
|
|
|
|
-const total = ref(0)
|
|
|
+ const total = ref(0)
|
|
|
|
|
|
-const elTabPane = ref('ylrfy')
|
|
|
-const patient = ref({})
|
|
|
+ const elTabPane = ref('ylrfy')
|
|
|
+ const patient = ref({})
|
|
|
|
|
|
-const tableDataHuanZheFeiYong = ref([])
|
|
|
+ const tableDataHuanZheFeiYong = ref([])
|
|
|
|
|
|
-const getHuanZheXinXiClick = () => {
|
|
|
- if (queryTerm.value.zaiHuanChuYuan === 0) {
|
|
|
- queryTerm.value.admissTimes = 0
|
|
|
- }
|
|
|
- if (patient.inpatientNo === queryTerm.value.inpatientNo) {
|
|
|
- queryHuanZheFeiYong()
|
|
|
- } else {
|
|
|
- getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
|
|
|
- .then((res) => {
|
|
|
- console.log(res)
|
|
|
- console.log(xlmrRef)
|
|
|
- xlmrRef.value.updateDeptAndWard(res.admissDept, res.zkWard)
|
|
|
- patient.value = res
|
|
|
- patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
|
|
|
- queryTerm.value.admissTimes = res.admissTimes
|
|
|
- queryHuanZheFeiYong()
|
|
|
- // 第一个参数病区, 第二个参数科室 , 这里是需要反过来的
|
|
|
+ const getHuanZheXinXiClick = () => {
|
|
|
+ if (queryTerm.value.zaiHuanChuYuan === 0) {
|
|
|
+ queryTerm.value.admissTimes = 0
|
|
|
+ }
|
|
|
+ if (patient.inpatientNo === queryTerm.value.inpatientNo) {
|
|
|
+ queryHuanZheFeiYong()
|
|
|
+ } else {
|
|
|
+ getHuanZheXinXi(queryTerm.value.inpatientNo, queryTerm.value.zaiHuanChuYuan, queryTerm.value.admissTimes)
|
|
|
+ .then((res) => {
|
|
|
+ console.log(res)
|
|
|
+ console.log(xlmrRef)
|
|
|
+ xlmrRef.value.updateDeptAndWard(res.admissDept, res.zkWard)
|
|
|
+ patient.value = res
|
|
|
+ patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
|
|
|
+ queryTerm.value.admissTimes = res.admissTimes
|
|
|
+ queryHuanZheFeiYong()
|
|
|
+ // 第一个参数病区, 第二个参数科室 , 这里是需要反过来的
|
|
|
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- patient.value = {}
|
|
|
- tableDataHuanZheFeiYong.value = []
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ patient.value = {}
|
|
|
+ tableDataHuanZheFeiYong.value = []
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
-const queryHuanZheFeiYong = () => {
|
|
|
- if (elTabPane.value !== 'ylrfy') return
|
|
|
- let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
|
|
|
- queryTerm.value.startTime = dateRangeS.startTime
|
|
|
- queryTerm.value.endTime = dateRangeS.endTime
|
|
|
- queryTerm.value.currentPage = 1
|
|
|
- queryTerm.value.total = 0
|
|
|
- getHuanZheFeiYong(queryTerm.value)
|
|
|
- .then((res) => {
|
|
|
- total.value = res.total
|
|
|
- patient.value.total = total.value
|
|
|
- tableDataHuanZheFeiYong.value = res
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- tableDataHuanZheFeiYong.value = []
|
|
|
- })
|
|
|
-}
|
|
|
+ const queryHuanZheFeiYong = () => {
|
|
|
+ if (elTabPane.value !== 'ylrfy') return
|
|
|
+ let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
|
|
|
+ queryTerm.value.startTime = dateRangeS.startTime
|
|
|
+ queryTerm.value.endTime = dateRangeS.endTime
|
|
|
+ queryTerm.value.currentPage = 1
|
|
|
+ queryTerm.value.total = 0
|
|
|
+ getHuanZheFeiYong(queryTerm.value)
|
|
|
+ .then((res) => {
|
|
|
+ total.value = res.total
|
|
|
+ patient.value.total = total.value
|
|
|
+ tableDataHuanZheFeiYong.value = res
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ tableDataHuanZheFeiYong.value = []
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
-const handleHuanZheFeiYong = () => {
|
|
|
- if (elTabPane.value !== 'ylrfy') return
|
|
|
- let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
|
|
|
- queryTerm.value.startTime = dateRangeS.startTime
|
|
|
- queryTerm.value.endTime = dateRangeS.endTime
|
|
|
- queryTerm.value.total = total.value
|
|
|
- getHuanZheFeiYong(queryTerm.value)
|
|
|
- .then((res) => {
|
|
|
- res.total = total.value
|
|
|
- tableDataHuanZheFeiYong.value = res
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- tableDataHuanZheFeiYong.value = []
|
|
|
- })
|
|
|
-}
|
|
|
+ const handleHuanZheFeiYong = () => {
|
|
|
+ if (elTabPane.value !== 'ylrfy') return
|
|
|
+ let dateRangeS = getDateRangeFormatDate(queryTerm.value.dateRange)
|
|
|
+ queryTerm.value.startTime = dateRangeS.startTime
|
|
|
+ queryTerm.value.endTime = dateRangeS.endTime
|
|
|
+ queryTerm.value.total = total.value
|
|
|
+ getHuanZheFeiYong(queryTerm.value)
|
|
|
+ .then((res) => {
|
|
|
+ res.total = total.value
|
|
|
+ tableDataHuanZheFeiYong.value = res
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ tableDataHuanZheFeiYong.value = []
|
|
|
+ })
|
|
|
+ }
|
|
|
|
|
|
// 根据项目名称来查询
|
|
|
-const chargeCodeNameData = ref([])
|
|
|
+ const chargeCodeNameData = ref([])
|
|
|
|
|
|
-/**
|
|
|
- * 远程搜索
|
|
|
- */
|
|
|
-const remoteMethodChargeCode = (val) => {
|
|
|
- if (val.length >= 2) {
|
|
|
- getChargeCode(val).then((res) => {
|
|
|
- chargeCodeNameData.value = res
|
|
|
- })
|
|
|
- }
|
|
|
-}
|
|
|
+ /**
|
|
|
+ * 远程搜索
|
|
|
+ */
|
|
|
+ const remoteMethodChargeCode = (val) => {
|
|
|
+ if (val.length >= 2) {
|
|
|
+ getChargeCode(val).then((res) => {
|
|
|
+ chargeCodeNameData.value = res
|
|
|
+ })
|
|
|
+ }
|
|
|
+ }
|
|
|
|
|
|
// 分页
|
|
|
-const handleSizeChange = (val) => {
|
|
|
- queryTerm.value.pageSize = val.val
|
|
|
- patient.value.pageSize = val.val
|
|
|
- queryHuanZheFeiYong()
|
|
|
-}
|
|
|
+ const handleSizeChange = (val) => {
|
|
|
+ queryTerm.value.pageSize = val.val
|
|
|
+ patient.value.pageSize = val.val
|
|
|
+ queryHuanZheFeiYong()
|
|
|
+ }
|
|
|
|
|
|
-const handleCurrentChange = (val) => {
|
|
|
- queryTerm.value.currentPage = val.val
|
|
|
- handleHuanZheFeiYong()
|
|
|
-}
|
|
|
+ const handleCurrentChange = (val) => {
|
|
|
+ queryTerm.value.currentPage = val.val
|
|
|
+ handleHuanZheFeiYong()
|
|
|
+ }
|
|
|
|
|
|
// 导出excel 表格
|
|
|
-const exportExecl = () => {
|
|
|
- if (total.value > 0) {
|
|
|
- ElMessageBox.prompt('导出文件名字', '提示', {
|
|
|
- confirmButtonText: '确定',
|
|
|
- cancelButtonText: '取消',
|
|
|
- inputPattern: /\S/,
|
|
|
- inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
|
|
|
- })
|
|
|
- .then(({value}) => {
|
|
|
- queryTerm.value.total = total.value
|
|
|
- const data = {
|
|
|
- param: queryTerm.value,
|
|
|
- url: '/xmlr/exportExcel',
|
|
|
- fileName: `${value}.xlsx`,
|
|
|
- }
|
|
|
- setTimeout(() => {
|
|
|
- downloadExcel(data)
|
|
|
- }, 500)
|
|
|
- })
|
|
|
- .catch((e) => {
|
|
|
+ const exportExecl = () => {
|
|
|
+ if (total.value > 0) {
|
|
|
+ ElMessageBox.prompt('导出文件名字', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ inputPattern: /\S/,
|
|
|
+ inputErrorMessage: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
|
|
|
})
|
|
|
- } else {
|
|
|
- ElMessage.error('请先查询出数据')
|
|
|
+ .then(({value}) => {
|
|
|
+ queryTerm.value.total = total.value
|
|
|
+ const data = {
|
|
|
+ param: queryTerm.value,
|
|
|
+ url: '/xmlr/exportExcel',
|
|
|
+ fileName: `${value}.xlsx`,
|
|
|
+ }
|
|
|
+ setTimeout(() => {
|
|
|
+ downloadExcel(data)
|
|
|
+ }, 500)
|
|
|
+ })
|
|
|
+ .catch((e) => {
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.error('请先查询出数据')
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ const theUploadIsSuccessful = async () => {
|
|
|
+ elTabPane.value = 'ylrfy'
|
|
|
+ let now = await getServerDateApi()
|
|
|
+ queryTerm.value.dateRange = [now, now]
|
|
|
+ queryTerm.value.feiYongLeiXingCode = 0
|
|
|
+ queryTerm.value.orderNo = 2
|
|
|
+ queryTerm.value.tuiFeiFlag = 0
|
|
|
+ queryHuanZheFeiYong()
|
|
|
+ }
|
|
|
+ return {
|
|
|
+ dangQianShiJian,
|
|
|
+ deptList,
|
|
|
+ xlmrRef,
|
|
|
+ queryTerm,
|
|
|
+ total,
|
|
|
+ elTabPane,
|
|
|
+ patient,
|
|
|
+ tableDataHuanZheFeiYong,
|
|
|
+ getHuanZheXinXiClick,
|
|
|
+ queryHuanZheFeiYong,
|
|
|
+ handleHuanZheFeiYong,
|
|
|
+ chargeCodeNameData,
|
|
|
+ remoteMethodChargeCode,
|
|
|
+ handleSizeChange,
|
|
|
+ handleCurrentChange,
|
|
|
+ exportExecl,
|
|
|
+ theUploadIsSuccessful,
|
|
|
+ cptSex,
|
|
|
+ yiZhuTuiFeiLeiXing,
|
|
|
+ feiYongLeiXing,
|
|
|
+ tuiFeiLeiXin,
|
|
|
+ shortcuts
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-const theUploadIsSuccessful = async () => {
|
|
|
- elTabPane.value = 'ylrfy'
|
|
|
- let now = await getServerDateApi()
|
|
|
- queryTerm.value.dateRange = [now, now]
|
|
|
- queryTerm.value.feiYongLeiXingCode = 0
|
|
|
- queryTerm.value.orderNo = 2
|
|
|
- queryTerm.value.tuiFeiFlag = 0
|
|
|
- queryHuanZheFeiYong()
|
|
|
-}
|
|
|
|
|
|
</script>
|
|
|
|