|
@@ -97,14 +97,16 @@
|
|
|
></huan-zhe-fei-yong>
|
|
|
</el-tab-pane>
|
|
|
<el-tab-pane label="费用录入" name="fylr">
|
|
|
- <xiang-mu-lu-ru :patient="patient" @the-upload-is-successful="theUploadIsSuccessful"></xiang-mu-lu-ru>
|
|
|
+ <xiang-mu-lu-ru :patient="patient"
|
|
|
+ ref="xlmrRef"
|
|
|
+ @the-upload-is-successful="theUploadIsSuccessful"/>
|
|
|
</el-tab-pane>
|
|
|
</el-tabs>
|
|
|
</el-main>
|
|
|
</el-container>
|
|
|
</template>
|
|
|
|
|
|
-<script>
|
|
|
+<script setup>
|
|
|
import {ref} from 'vue'
|
|
|
import store from '@/store'
|
|
|
import {getHuanZheXinXi} from '@/api/zhu-yuan-yi-ji/yi-ji-fei-yong-lu-ru'
|
|
@@ -121,176 +123,157 @@ import {downloadExcel} from '@/utils/excel'
|
|
|
import {getServerDateApi} from "@/api/public-api";
|
|
|
import {userInfoStore} from "@/utils/store-public";
|
|
|
|
|
|
-export default {
|
|
|
- components: {HuanZheFeiYong, XiangMuLuRu},
|
|
|
- name: 'yiJiFeiYongLuRu',
|
|
|
- setup() {
|
|
|
- const dangQianShiJian = new Date()
|
|
|
- const deptList = userInfoStore.value.partTimeDeptMap
|
|
|
+const dangQianShiJian = new Date()
|
|
|
+const deptList = userInfoStore.value.partTimeDeptMap
|
|
|
|
|
|
- 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 xlmrRef = ref()
|
|
|
|
|
|
- const total = ref(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 elTabPane = ref('ylrfy')
|
|
|
- const patient = ref({})
|
|
|
+const total = ref(0)
|
|
|
|
|
|
- const tableDataHuanZheFeiYong = ref([])
|
|
|
+const elTabPane = ref('ylrfy')
|
|
|
+const patient = 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) => {
|
|
|
- patient.value = res
|
|
|
- patient.value.feiYongLeiXingCode = queryTerm.value.feiYongLeiXingCode
|
|
|
- queryTerm.value.admissTimes = res.admissTimes
|
|
|
- queryHuanZheFeiYong()
|
|
|
- })
|
|
|
- .catch(() => {
|
|
|
- patient.value = {}
|
|
|
- tableDataHuanZheFeiYong.value = []
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+const tableDataHuanZheFeiYong = ref([])
|
|
|
|
|
|
- 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 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 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 = []
|
|
|
- })
|
|
|
- }
|
|
|
+ })
|
|
|
+ .catch(() => {
|
|
|
+ patient.value = {}
|
|
|
+ tableDataHuanZheFeiYong.value = []
|
|
|
+ })
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- // 根据项目名称来查询
|
|
|
- const chargeCodeNameData = ref([])
|
|
|
+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 remoteMethodChargeCode = (val) => {
|
|
|
- if (val.length >= 2) {
|
|
|
- getChargeCode(val).then((res) => {
|
|
|
- chargeCodeNameData.value = res
|
|
|
- })
|
|
|
- }
|
|
|
- }
|
|
|
+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 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: '文件名不能为空 (∩•̀ω•́)⊃-*⋆',
|
|
|
+// 导出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)
|
|
|
})
|
|
|
- .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()
|
|
|
- }
|
|
|
+ .catch((e) => {
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ ElMessage.error('请先查询出数据')
|
|
|
+ }
|
|
|
+}
|
|
|
|
|
|
- return {
|
|
|
- queryTerm,
|
|
|
- getHuanZheXinXiClick,
|
|
|
- tableDataHuanZheFeiYong,
|
|
|
- patient,
|
|
|
- cptSex,
|
|
|
- queryHuanZheFeiYong,
|
|
|
- chargeCodeNameData,
|
|
|
- remoteMethodChargeCode,
|
|
|
- elTabPane,
|
|
|
- yiZhuTuiFeiLeiXing,
|
|
|
- tuiFeiLeiXin,
|
|
|
- shortcuts,
|
|
|
- feiYongLeiXing,
|
|
|
- handleSizeChange,
|
|
|
- handleCurrentChange,
|
|
|
- exportExecl,
|
|
|
- deptList,
|
|
|
- theUploadIsSuccessful
|
|
|
- }
|
|
|
- },
|
|
|
+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>
|
|
|
|
|
|
<style></style>
|