This commit is contained in:
ChenQiuYu 2025-05-06 16:32:19 +08:00
parent fc3fe2e825
commit 215c69a5cb
3 changed files with 36 additions and 22 deletions

View File

@ -1,5 +1,5 @@
<template>
<Panel :title="'病'">
<Panel :title="'病'">
<template #tools>
<div class="content">
<div class="model-selector">

View File

@ -1,5 +1,5 @@
<template>
<Panel :title="'病'">
<Panel :title="'病'">
<template #tools>
<div class="content">
<div class="model-selector">

View File

@ -9,20 +9,28 @@
<el-popover
placement="top-start"
trigger="hover"
width="200px"
width="400"
@show="getHilistInfo(item)"
@hide="colosInfo"
>
<template #reference>
{{ item.name }}
</template>
<div>
{{item.hilistCode}}
<div class="detail">
<div style="display: flex;justify-content: space-between">
<div style="font-size: 18px;font-weight: 500;color: #000">{{ hilistInfo.name }}</div>
<div>{{ item.selectedPrice }}/{{ item.selectedUnit }}</div>
</div>
<div>
<div>规格:{{hilistInfo.json?.dosage_specifications||'-'}}</div>
</div>
</div>
</el-popover>
</div>
<div class="price">{{item.selectedPrice || '0' }}</div>
</div>
<div class="price">{{ item.selectedPrice || '0' }}</div>
<div class="unit">
<div class="unit-content">
<el-input-number v-model="item.selectedNum" min="1" size="small"></el-input-number>
@ -39,11 +47,11 @@
</el-dropdown>
</div>
</div>
<div class="sub-price">{{ item.unitPrice*item.selectedNum }}</div>
<div class="sub-price">{{ item.unitPrice * item.selectedNum }}</div>
<div class="delete">
<div @click="deleteItem(item.id)" class="delete-btn">
<el-icon>
<Close />
<Close/>
</el-icon>
</div>
</div>
@ -63,7 +71,7 @@
</SearchInput>
</div>
<span style="margin-right: 24px">
{{ sumPrice}}
{{ sumPrice }}
</span>
</div>
</div>
@ -82,8 +90,8 @@ const props = defineProps({
default: 0
}
})
const disabled=computed(()=>{
if(props.status === 1){
const disabled = computed(() => {
if (props.status === 1) {
return true
}
})
@ -126,21 +134,21 @@ const selectUnit = (item: any, unit: any) => {
}
const sumPrice = ref(0)
const emit = defineEmits(['focus'])
const focus=(e:any)=>{
emit('focus',e)
const focus = (e: any) => {
emit('focus', e)
}
const hilistInfo = ref<any>({})
const getHilistInfo = (item:any) => {
const getHilistInfo = (item: any) => {
if (item.hilistCode) {
post("social/directory/getByCode", {code: item.hilistCode}).then((res: any) => {
hilistInfo.value = res
})
}
}
const colosInfo=()=>{
hilistInfo.value={}
const colosInfo = () => {
hilistInfo.value = {}
}
watch(()=>list.value, (newList) => {
watch(() => list.value, (newList) => {
sumPrice.value = newList.reduce((total, item) => {
return total + (item.selectedNum || 0) * (item.selectedPrice || 0);
}, 0);
@ -149,6 +157,7 @@ watch(()=>list.value, (newList) => {
<style scoped lang="scss">
@use "@/assets/scss/base";
.content {
display: flex;
flex-direction: column;
@ -156,6 +165,7 @@ watch(()=>list.value, (newList) => {
.list {
flex: 1;
min-height: 0;
.item {
height: 30px;
border-top: 1px solid #EAEAEC;
@ -197,13 +207,15 @@ watch(()=>list.value, (newList) => {
width: 180px;
margin-left: 10px;
line-height: 30px;
.unit-content{
.unit-content {
display: flex;
align-items: center;
}
}
.sub-price{
.sub-price {
height: 100%;
line-height: 30px;
}
@ -213,9 +225,11 @@ watch(()=>list.value, (newList) => {
width: 100px;
text-align: center;
line-height: 30px;
.delete-btn{
.delete-btn {
cursor: pointer;
&:hover{
&:hover {
color: base.$primary-color;
}
}