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> <template>
<Panel :title="'病'"> <Panel :title="'病'">
<template #tools> <template #tools>
<div class="content"> <div class="content">
<div class="model-selector"> <div class="model-selector">

View File

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

View File

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