|
|
@@ -28,7 +28,7 @@
|
|
|
<div class="header">
|
|
|
<div class="left">{{ tTitle }}</div>
|
|
|
<div class="right">
|
|
|
- {{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(dataForm.totalMonthPrice) }}</span></div>
|
|
|
+ {{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(monthSubtotalAmount) }}</span></div>
|
|
|
</div>
|
|
|
<el-table
|
|
|
ref="monthTableRef"
|
|
|
@@ -64,11 +64,12 @@
|
|
|
<el-table-column prop="totalAmount" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
|
|
|
- <el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 1)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ formatTotalMonth(scope.row) }}</span>
|
|
|
+ <el-input-number v-if="isEdit && scope.row.payStatus == 0" @blur="handlePrice(scope.row, 1)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (formatTotalMonth(scope.row) - scope.row.payAmount).toFixed(2) : formatTotalMonth(scope.row) }}</span>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 1)"/>
|
|
|
@@ -86,7 +87,7 @@
|
|
|
<div class="header">
|
|
|
<div class="left">预备金费用(元)</div>
|
|
|
<div class="right"
|
|
|
- >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(dataForm.totalDepositPrice) }}</span></div
|
|
|
+ >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(depositSubtotalAmount) }}</span></div
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -122,11 +123,12 @@
|
|
|
<el-table-column prop="count" label="数量" width="100" align="center" />
|
|
|
<el-table-column prop="totalAmount" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 2)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ tableRowPay(scope.row) }}</span>
|
|
|
+ <el-input-number v-if="isEdit && scope.row.payStatus == 0" @blur="handlePrice(scope.row, 2)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (tableRowPay(scope.row) - scope.row.payAmount).toFixed(2) : tableRowPay(scope.row) }}</span>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 2)"/>
|
|
|
@@ -143,7 +145,7 @@
|
|
|
<div class="header">
|
|
|
<div class="left">阶段性费用(元)</div>
|
|
|
<div class="right"
|
|
|
- >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(dataForm.totalStageExpandPrice) }}</span></div
|
|
|
+ >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(stageSubtotalAmount) }}</span></div
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -206,10 +208,11 @@
|
|
|
<el-table-column prop="totalAmount" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 3)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ tableRowPay(scope.row) }}</span>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (tableRowPay(scope.row) - scope.row.payAmount).toFixed(2) : tableRowPay(scope.row) }}</span>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 3)"/>
|
|
|
@@ -221,7 +224,7 @@
|
|
|
<div class="header">
|
|
|
<div class="left">其他费用(元)</div>
|
|
|
<div class="right"
|
|
|
- >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(dataForm.totalOneTimeFeePrice) }}</span></div
|
|
|
+ >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(oneTimeSubtotalAmount) }}</span></div
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -257,11 +260,12 @@
|
|
|
<el-table-column prop="count" label="数量" width="100" align="center" />
|
|
|
<el-table-column prop="totalAmount" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 5)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ tableRowPay(scope.row) }}</span>
|
|
|
+ <el-input-number v-if="isEdit && scope.row.payStatus == 0" @blur="handlePrice(scope.row, 5)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (tableRowPay(scope.row) - scope.row.payAmount).toFixed(2) : tableRowPay(scope.row) }}</span>
|
|
|
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 5)"/>
|
|
|
@@ -353,10 +357,11 @@
|
|
|
</el-table-column> -->
|
|
|
<el-table-column prop="totalAmount" width="180" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 5)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ tableRowPay(scope.row) }}</span>
|
|
|
+ <el-input-number v-if="isEdit && scope.row.payStatus == 0" @blur="handlePrice(scope.row, 5)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (tableRowPay(scope.row) - scope.row.payAmount).toFixed(2) : tableRowPay(scope.row) }}</span>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 5)"/>
|
|
|
@@ -374,7 +379,7 @@
|
|
|
<div class="header">
|
|
|
<div class="left">阶段性费用(元)</div>
|
|
|
<div class="right"
|
|
|
- >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(dataForm.totalStageExpandPrice) }}</span></div
|
|
|
+ >{{isDetail ? '已缴' : '小计'}}<span class="price">¥{{ formatNum(stageExpandSubtotalAmount) }}</span></div
|
|
|
>
|
|
|
</div>
|
|
|
<el-table
|
|
|
@@ -436,11 +441,12 @@
|
|
|
<el-table-column prop="count" label="数量" width="100" align="center" />
|
|
|
<el-table-column prop="totalAmount" label="应收金额(元)" align="center">
|
|
|
<template #default="scope">
|
|
|
- <el-input-number v-if="isEdit" @blur="handlePrice(scope.row, 3)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
- <span v-else>{{ tableRowPay(scope.row) }}</span>
|
|
|
+ <el-input-number v-if="isEdit && scope.row.payStatus == 0" @blur="handlePrice(scope.row, 3)" v-model="scope.row.totalAmount" controls-position="right"/>
|
|
|
+ <span v-else>{{ (scope.row.payStatus == 1 || scope.row.payStatus == 2) ? (tableRowPay(scope.row) - scope.row.payAmount).toFixed(2) : tableRowPay(scope.row) }}</span>
|
|
|
<!-- <span class="underline" v-if="!settingStore.getRceivable||settingStore.getAdmissionBillRoundUp">{{ formatNum(scope.row.totalAmount) }}</span> -->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column prop="payAmount" label="已缴费用" width="100" align="center" />
|
|
|
<el-table-column prop="isShow" label="是否显示在单据上" align="center">
|
|
|
<template #default="scope">
|
|
|
<el-checkbox v-if="isEdit" v-model="scope.row.isShow" :checked="scope.row.isShow == 1" @change="handlePrice(scope.row, 3)"/>
|
|
|
@@ -594,6 +600,12 @@ const totalAllAmount = computed(()=>{
|
|
|
return formatNum(dataForm.value.totalMonthPrice + dataForm.value.totalOneTimeFeePrice + dataForm.value.totalDepositPrice + dataForm.value.totalStageExpandPrice)
|
|
|
})
|
|
|
|
|
|
+const monthSubtotalAmount = computed(() => monthSelected.value.length ? formatNum(dataForm.value.totalMonthPrice) : 0)
|
|
|
+const depositSubtotalAmount = computed(() => depositSelected.value.length ? formatNum(dataForm.value.totalDepositPrice) : 0)
|
|
|
+const oneTimeSubtotalAmount = computed(() => oneTimeSelected.value.length ? formatNum(dataForm.value.totalOneTimeFeePrice) : 0)
|
|
|
+const stageSubtotalAmount = computed(() => stageExpandSelected.value.length ? formatNum(dataForm.value.totalStageExpandPrice) : 0)
|
|
|
+const stageExpandSubtotalAmount = stageSubtotalAmount
|
|
|
+
|
|
|
// 固定费用
|
|
|
const formatTotalMonth = (item)=>{
|
|
|
if(dataForm.value.type == 1){
|
|
|
@@ -644,6 +656,10 @@ const totalRoundAndTwoDecimalAmount = computed(()=>{
|
|
|
|
|
|
// 账单总额 1.入院且入院配置了向上取整 2.账单四舍五入 3.账单实际金额 (需要减去长护险)
|
|
|
const tAmount = computed(()=>{
|
|
|
+ let payAmountTotal = 0
|
|
|
+ dataForm.value.monthArr.map(item => {
|
|
|
+ payAmountTotal += item.payAmount ? Number(item.payAmount) : 0
|
|
|
+ })
|
|
|
if(dataForm.value.type == 1){ //1入院,2月度
|
|
|
return totalAllAmount.value
|
|
|
// if(settingStore.getAdmissionBill == 2){ // 向上取整
|
|
|
@@ -655,11 +671,11 @@ const tAmount = computed(()=>{
|
|
|
}else{
|
|
|
console.log("取值",rounding.value,fixed2Num.value)
|
|
|
if(rounding.value){
|
|
|
- return formatRound(totalRoundAndTwoDecimalAmount.value.num)
|
|
|
+ return formatRound(totalRoundAndTwoDecimalAmount.value.num - payAmountTotal)
|
|
|
}else if(fixed2Num.value){
|
|
|
- return formatNum(totalRoundAndTwoDecimalAmount.value.decimal)
|
|
|
+ return formatNum(totalRoundAndTwoDecimalAmount.value.decimal - payAmountTotal)
|
|
|
}else{
|
|
|
- return formatNum(dataForm.value.actualAmount)
|
|
|
+ return formatNum(dataForm.value.actualAmount - payAmountTotal)
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -797,7 +813,7 @@ const goToBill = () => {
|
|
|
|
|
|
// 判断表格中那些数据可选
|
|
|
const handleSelectable = (row) => {
|
|
|
- return row.payStatus == 0
|
|
|
+ return row.payStatus == 0 || row.payStatus == 2
|
|
|
}
|
|
|
|
|
|
// 选中数据
|
|
|
@@ -809,21 +825,21 @@ const handleMonthSelectionChange = (val) => {
|
|
|
if(item.isShow){
|
|
|
if(dataForm.value.type == '1'){
|
|
|
if(settingStore.getAdmissionBill == 2){ // 向上取整
|
|
|
- total += formatDecimal(Number(formatCeil(item.totalAmount))) as number
|
|
|
+ total += formatDecimal(Number(formatCeil(item.totalAmount - (item.payAmount || 0)))) as number
|
|
|
}else if(settingStore.getAdmissionBill == 3){ // 四舍五入保留两位
|
|
|
- total += formatDecimal(formatNum(item.roundTwoDecimalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundTwoDecimalAmount - (item.payAmount || 0))) as number
|
|
|
}else if(settingStore.getAdmissionBill == 4){ // 四舍五入取整
|
|
|
- total += formatDecimal(formatNum(item.roundAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundAmount - (item.payAmount || 0))) as number
|
|
|
}else{ // 应收
|
|
|
- total += formatDecimal(formatNum(item.totalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.totalAmount - (item.payAmount || 0))) as number
|
|
|
}
|
|
|
}else{
|
|
|
if(rounding.value){ // 账单取整
|
|
|
- total += formatDecimal(formatNum(item.roundAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundAmount - (item.payAmount || 0))) as number
|
|
|
} else if(fixed2Num.value){ // 四舍五入保留两位
|
|
|
- total += formatDecimal(formatNum(item.roundTwoDecimalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundTwoDecimalAmount - (item.payAmount || 0))) as number
|
|
|
} else{ // 实际应收
|
|
|
- total += formatDecimal(formatNum(item.totalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.totalAmount - (item.payAmount || 0))) as number
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -840,11 +856,11 @@ const handleDepositSelectionChange = (val) => {
|
|
|
val.map((item) => {
|
|
|
if(item.isShow){
|
|
|
if(rounding.value){ // 账单取整
|
|
|
- total += formatDecimal(formatNum(item.roundAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundAmount - (item.payAmount || 0))) as number
|
|
|
} else if(fixed2Num.value){ // 四舍五入保留两位
|
|
|
- total += formatDecimal(formatNum(item.roundTwoDecimalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundTwoDecimalAmount - (item.payAmount || 0))) as number
|
|
|
} else{ // 实际应收
|
|
|
- total += formatDecimal(formatNum(item.totalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.totalAmount - (item.payAmount || 0))) as number
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -860,11 +876,11 @@ const handleOneTimeSelectionChange = (val) => {
|
|
|
val.map((item) => {
|
|
|
if(item.isShow){
|
|
|
if(rounding.value){ // 账单取整
|
|
|
- total += formatDecimal(formatNum(item.roundAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundAmount - (item.payAmount || 0))) as number
|
|
|
} else if(fixed2Num.value){ // 四舍五入保留两位
|
|
|
- total += formatDecimal(formatNum(item.roundTwoDecimalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundTwoDecimalAmount - (item.payAmount || 0))) as number
|
|
|
} else{ // 实际应收
|
|
|
- total += formatDecimal(formatNum(item.totalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.totalAmount - (item.payAmount || 0))) as number
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
@@ -880,11 +896,11 @@ const handleStageExpandSelectionChange = (val) => {
|
|
|
val.map((item) => {
|
|
|
if(item.isShow){
|
|
|
if(rounding.value){ // 账单取整
|
|
|
- total += formatDecimal(formatNum(item.roundAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundAmount - (item.payAmount || 0))) as number
|
|
|
} else if(fixed2Num.value){ // 四舍五入保留两位
|
|
|
- total += formatDecimal(formatNum(item.roundTwoDecimalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.roundTwoDecimalAmount - (item.payAmount || 0))) as number
|
|
|
} else{ // 实际应收
|
|
|
- total += formatDecimal(formatNum(item.totalAmount)) as number
|
|
|
+ total += formatDecimal(formatNum(item.totalAmount - (item.payAmount || 0))) as number
|
|
|
}
|
|
|
}
|
|
|
})
|