Compare commits

..

No commits in common. "62b0a3e246ba8f1657b7bad6a59cd3e5b6d8efec" and "ae598d2287efaa38adaf74ae64e5cdda2dd87f01" have entirely different histories.

3 changed files with 14 additions and 6 deletions

View File

@ -10,7 +10,7 @@
<el-table-column prop="number" label="数量">
<template #default="scope">
<div v-if="props.status">
<el-input-number v-model="scope.row.selectedNum" :min="0" @change="handleNumChange"
<el-input-number v-model="scope.row.selectedNum" min="0" @change="handleNumChange"
size="small"></el-input-number>
<el-dropdown>
<span style="line-height: 30px;margin-left: 10px">{{ scope.row.selectedUnit }}</span>
@ -117,7 +117,16 @@ const getTotalPrice = () => {
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) {

View File

@ -9,7 +9,7 @@
</el-table-column>
<el-table-column label="数量">
<template #default="scope">
<el-input-number v-if="props.status" v-model="scope.row.selectedNum" :min="0"
<el-input-number v-if="props.status" v-model="scope.row.selectedNum" min="0"
@change="handleNumChange" size="small"></el-input-number>
<span v-else>{{ scope.row.selectedNum }}</span>
{{ scope.row.selectedUnit }}

View File

@ -47,10 +47,10 @@
</Panel>
</div>
<div style="margin-top: 24px">
<ServiceDetail v-model="formData.itemDetail" :status="formData.status == 0" @totalPriceChange="getOrderTotalPrice"></ServiceDetail>
<ServiceDetail v-model="formData.itemDetail" :status="statusDisabled" @totalPriceChange="getOrderTotalPrice"></ServiceDetail>
</div>
<div style="margin-top: 24px">
<GoodsDetail v-model="formData.goodsDetail" :status="formData.status == 0" @totalPriceChange="getOrderTotalPrice"></GoodsDetail>
<GoodsDetail v-model="formData.goodsDetail" :status="statusDisabled" @totalPriceChange="getOrderTotalPrice"></GoodsDetail>
</div>
<div class="bottom" >
<TotalPrice v-model="formData.totalPrice" @edit="saveAndCharge" :status="formData.status" ></TotalPrice>
@ -174,12 +174,11 @@ onMounted(() => {
list()
})
const getOrderTotalPrice = () => {
debugger
let totalPrice = 0
formData.value.itemDetail?.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum
})
formData.value.goodsDetail.forEach((item: any) => {
formData.value.goodsList.forEach((item: any) => {
totalPrice += item.selectedPrice * item.selectedNum
})
formData.value.preTotalPrice = totalPrice