Merge branch 'main' of ssh://git.jizhiweb.cn:2222/clinic-v2/web

This commit is contained in:
LiJianZhao 2025-05-08 11:50:30 +08:00
commit ae284f92cc
5 changed files with 145 additions and 103 deletions

View File

@ -29,7 +29,6 @@
v-for="item in showConfig" v-for="item in showConfig"
:prop="item.prop" :prop="item.prop"
:label="item.label" :label="item.label"
show-overflow-tooltip
></el-table-column> ></el-table-column>
</el-table> </el-table>
</div> </div>
@ -58,7 +57,7 @@ const props = defineProps({
}, },
width: { width: {
type: Number, type: Number,
default: 600 default: 800
}, },
showConfig: { showConfig: {
type: Array as () => showConfig[], type: Array as () => showConfig[],

View File

@ -1,84 +0,0 @@
<template>
<el-table :data="data.itemDetail" max-height="150">
<el-table-column prop="itemName" label="项目名称" show-overflow-tooltip></el-table-column>
<el-table-column label="单价">
<template #default="scope">
{{scope.row.selectedPrice}}
</template>
</el-table-column>
<el-table-column label="数量">
<template #default="scope">
<el-input-number v-model="scope.row.selectedNum" min="0"
@change="handleNumChange" v-if="data.status == 0" size="small"></el-input-number>
<span v-else>{{scope.row.selectedNum}}</span>
{{scope.row.selectedUnit}}
</template>
</el-table-column>
<el-table-column label="小计">
<template #default="scope">
{{scope.row.selectedNum*scope.row.selectedPrice}}
</template>
</el-table-column>
<el-table-column label="操作" v-if="data.status ==0">
<template #default="scope">
<el-button type="danger" link @click="delService(scope.row)">X</el-button>
</template>
</el-table-column>
</el-table>
<div class="bottom">
<SearchInput v-if="data.status == 0" :request-api="serviceSearchApi" :show-config="serviceShowConfig"
@selectedCallBack="serviceSelect"></SearchInput>
<span>合计{{getTotalPrice()}}</span>
</div>
</template>
<script setup lang="ts">
import SearchInput from "@/components/SearchInput.vue";
const data = defineModel<any>();
const delService = (item: any) => {
data.value.itemDetail = data.value.itemDetail.filter((i: any) => i.id != item.id)
}
const serviceSearchApi = "item/search";
const serviceShowConfig = [
{
label: "服务名称",
prop: "itemName",
},
{
label: "服务医保码",
prop: "itemSocialCode",
},
{
label: "售价",
prop: "unitPrice",
},
]
const emit = defineEmits(['totalPriceChange'])
const serviceSelect = (row: any) => {
row.selectedNum = 1
row.selectedUnit = row.unit
row.selectedPrice = row.unitPrice
data.value.itemDetail.push(row)
emit('totalPriceChange', row)
}
const handleNumChange = () => {
emit('totalPriceChange')
}
const getTotalPrice =()=>{
let totalPrice = 0;
data.value.itemDetail?.forEach((item:any)=>{
totalPrice += item.selectedNum*item.selectedPrice
})
return totalPrice;
}
</script>
<style scoped lang="scss">
:deep(.el-table__cell){
padding: 0 4px;
}
.bottom{
text-align: right;
}
</style>

View File

@ -0,0 +1,110 @@
<template>
<Panel title="服务项目">
<el-table v-if="itemDetail.length>0" :data="itemDetail" max-height="150">
<el-table-column prop="itemName" label="项目名称" show-overflow-tooltip></el-table-column>
<el-table-column label="单价">
<template #default="scope">
{{ scope.row.selectedPrice }}
</template>
</el-table-column>
<el-table-column label="数量">
<template #default="scope">
<el-input-number v-if="disabled||props.status==0" v-model="scope.row.selectedNum" min="0"
@change="handleNumChange" size="small"></el-input-number>
<span v-else>{{ scope.row.selectedNum }}</span>
{{ scope.row.selectedUnit }}
</template>
</el-table-column>
<el-table-column label="小计">
<template #default="scope">
{{ scope.row.selectedNum * scope.row.selectedPrice }}
</template>
</el-table-column>
<el-table-column label="操作">
<template #default="scope">
<el-button type="danger" link @click="delService(scope.row)">X</el-button>
</template>
</el-table-column>
</el-table>
<div class="bottom">
<SearchInput :request-api="serviceSearchApi"
:show-config="serviceShowConfig"
:disabled="!disabled"
@selectedCallBack="serviceSelect"></SearchInput>
<span>合计{{ getTotalPrice() || 0 }}</span>
</div>
</Panel>
</template>
<script setup lang="ts">
import {defineProps, watchEffect, ref} from "vue";
import SearchInput from "@/components/SearchInput.vue";
import Panel from "@/components/common/Panel.vue";
const props = defineProps({
status: {
type: Number,
default: 0
}
})
const itemDetail = defineModel<any>();
const delService = (item: any) => {
itemDetail.value = itemDetail.value.filter((i: any) => i.id != item.id)
}
const serviceSearchApi = "item/search";
const serviceShowConfig = [
{
label: "服务名称",
prop: "itemName",
},
{
label: "服务医保码",
prop: "itemSocialCode",
},
{
label: "售价",
prop: "unitPrice",
},
]
const emit = defineEmits(['totalPriceChange'])
const serviceSelect = (row: any) => {
row.selectedNum = 1
row.selectedUnit = row.unit
row.selectedPrice = row.unitPrice
itemDetail.value.push(row)
emit('totalPriceChange')
}
const handleNumChange = () => {
emit('totalPriceChange')
}
const getTotalPrice = () => {
let totalPrice = 0;
if (itemDetail.value) {
itemDetail.value.forEach((item: any) => {
totalPrice += item.selectedNum * item.selectedPrice
})
}
return totalPrice;
}
const disabled = ref<any>(false)
watchEffect(() => {
if (props.status == 2 || props.status == 0) {
disabled.value = true
} else {
disabled.value = false
}
}
)
</script>
<style scoped lang="scss">
:deep(.el-table__cell) {
padding: 0 4px;
}
.bottom {
text-align: right;
}
</style>

View File

@ -47,9 +47,7 @@
</Panel> </Panel>
</div> </div>
<div style="margin-top: 24px"> <div style="margin-top: 24px">
<Panel title="服务项目"> <ServiceDetail v-model="formData.itemDetail" :status="statusDisabled" @totalPriceChange="getOrderTotalPrice"></ServiceDetail>
<ServiceDetail v-model="formData" @totalPriceChange="getOrderTotalPrice"></ServiceDetail>
</Panel>
</div> </div>
<div style="margin-top: 24px"> <div style="margin-top: 24px">
<Panel title="药品耗材"> <Panel title="药品耗材">
@ -84,7 +82,7 @@ import Panel from "@/components/common/Panel.vue";
import ChargeQueue from "@/components/charge/ChargeQueue.vue"; import ChargeQueue from "@/components/charge/ChargeQueue.vue";
import {nextTick, onMounted, ref} from "vue"; import {nextTick, onMounted, ref} from "vue";
import {post} from "@/utils/request.ts"; import {post} from "@/utils/request.ts";
import ServiceDetail from "@/components/charge/ServiceDetail.vue"; import ServiceDetail from "@/components/common/service/ServiceDetail.vue";
import GoodsDetail from "@/components/charge/GoodsDetail.vue"; import GoodsDetail from "@/components/charge/GoodsDetail.vue";
import DiagnosisSearchInput from "@/components/outpatient/DiagnosisSearchInput.vue"; import DiagnosisSearchInput from "@/components/outpatient/DiagnosisSearchInput.vue";
import Settlement from "@/components/charge/Settlement.vue"; import Settlement from "@/components/charge/Settlement.vue";
@ -100,6 +98,8 @@ const socialCard = ref<any>({payInfo: {}})
const formData = ref<any>({ const formData = ref<any>({
patientInfo: {}, patientInfo: {},
diagnosisMedicalRecord: {}, diagnosisMedicalRecord: {},
goodsList: [],
itemDetail: [],
}) })
const statusDisabled = ref(0) const statusDisabled = ref(0)
const diagnosisKeyword = ref("") const diagnosisKeyword = ref("")
@ -177,10 +177,10 @@ onMounted(() => {
}) })
const getOrderTotalPrice = () => { const getOrderTotalPrice = () => {
let totalPrice = 0 let totalPrice = 0
formData.value.itemDetail.forEach((item: any) => { formData.value.itemDetail?.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum totalPrice += item.selectedPrice * item.selectedNum
}) })
formData.value.goodsDetail.forEach((item: any) => { formData.value.goodsList.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum totalPrice += item.selectedPrice * item.selectedNum
}) })
formData.value.preTotalPrice = totalPrice formData.value.preTotalPrice = totalPrice

View File

@ -10,8 +10,8 @@
<Case ref="caseRef" v-else v-model="formData" :status="status" :isShowFrom="isShowFrom" @focus="focus"></Case> <Case ref="caseRef" v-else v-model="formData" :status="status" :isShowFrom="isShowFrom" @focus="focus"></Case>
</div> </div>
<div class="service-items"> <div class="service-items">
<ServiceItemsDetail v-if="patientRegistration.status==3" v-model="itemList"></ServiceItemsDetail> <!-- <ServiceItemsDetail v-if="patientRegistration.status==3" v-model="itemList"></ServiceItemsDetail>-->
<ServiceItems v-else v-model="itemList" :status="status" @focus="focus"></ServiceItems> <ServiceDetail v-model="formData.itemDetail" :status="status" @focus="focus" @totalPriceChange="getOrderTotalPrice"></ServiceDetail>
</div> </div>
<div class="pharmaceutical-consumables"> <div class="pharmaceutical-consumables">
<PharmaceuticalConsumablesDetail v-if="patientRegistration.status==3" <PharmaceuticalConsumablesDetail v-if="patientRegistration.status==3"
@ -53,12 +53,17 @@ import PharmaceuticalConsumablesDetail from "@/components/outpatient/Pharmaceuti
import CaseDetail from "@/components/outpatient/CaseDetail.vue"; import CaseDetail from "@/components/outpatient/CaseDetail.vue";
import {apiConfig} from "@/assets/config/apiConfig.ts"; import {apiConfig} from "@/assets/config/apiConfig.ts";
import PatientCard from "@/components/charge/PatientCard.vue"; import PatientCard from "@/components/charge/PatientCard.vue";
import ServiceDetail from "@/components/common/service/ServiceDetail.vue";
const registerId = ref() const registerId = ref()
const patientId = ref() const patientId = ref()
const itemList = ref([]) const itemDetail = ref([])
const goodsList = ref([]) const goodsList = ref([])
const formData = ref<any>({diagType: 1}) const formData = ref<any>({
diagType: 1,
itemDetail: [],
goodsDetail: [],
})
const save = () => { const save = () => {
let json = { let json = {
chinaAdjunctCheck: formData.value.chinaAdjunctCheck, chinaAdjunctCheck: formData.value.chinaAdjunctCheck,
@ -81,7 +86,7 @@ const save = () => {
const data = { const data = {
registrationId: registerId.value, registrationId: registerId.value,
patientId: patientId.value, patientId: patientId.value,
itemList: itemList.value, itemList: itemDetail.value,
goodsList: goodsList.value, goodsList: goodsList.value,
diagnosisMedicalRecord: medicalRecord, diagnosisMedicalRecord: medicalRecord,
@ -122,7 +127,7 @@ const getId = (item: any) => {
}).then((res: any) => { }).then((res: any) => {
formData.value = res.diagnosisMedicalRecord formData.value = res.diagnosisMedicalRecord
goodsList.value = res.goodsDetail goodsList.value = res.goodsDetail
itemList.value = res.itemDetail itemDetail.value = res.itemDetail
patientRegistration.value = res.patientRegistration patientRegistration.value = res.patientRegistration
}) })
@ -141,9 +146,10 @@ const deleteItem = () => {
} }
const getStatus = (e: any) => { const getStatus = (e: any) => {
status.value = e status.value = e
formData.value = {}
goodsList.value = [] formData.value.itemDetail = []
itemList.value = [] // goodsList.value = []
// itemDetail.value = []
patientRegistration.value = {} patientRegistration.value = {}
nextTick(() => { nextTick(() => {
medicalHistoryRef.value?.clearList(); medicalHistoryRef.value?.clearList();
@ -155,8 +161,19 @@ const edit = () => {
status.value = 2 status.value = 2
}) })
} }
const getOrderTotalPrice = () => {
let totalPrice = 0
formData.value.itemDetail?.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum
})
formData.value.goodsDetail?.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum
})
formData.value.preTotalPrice = totalPrice
formData.value.totalPrice = totalPrice
}
// 使 watch goodsList itemList // 使 watch goodsList itemList
watch([() => goodsList.value, itemList], ([newGoodsList, newItemList]) => { watch([() => goodsList.value, itemDetail], ([newGoodsList, newItemList]) => {
const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => { const pharmaceuticalTotalAmount = newItemList.reduce((pre: any, cur: any) => {
return pre + cur.unitPrice * cur.selectedNum return pre + cur.unitPrice * cur.selectedNum
}, 0); }, 0);
@ -176,7 +193,7 @@ const copyForm=(item:any) => {
} }
const copyItemList=(item:any) => { const copyItemList=(item:any) => {
console.log(item) console.log(item)
itemList.value = item.itemDetail itemDetail.value = item.itemDetail
} }
const copyGoodsList=(item:any) => { const copyGoodsList=(item:any) => {
goodsList.value = item.goodsDetail goodsList.value = item.goodsDetail