✨ ERP:采购订单的 paymentPrice 调整,为接入财务的付款单做准备
This commit is contained in:
parent
fcba2b4c48
commit
58972e0b98
@ -103,7 +103,11 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="优惠后金额">
|
||||
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||
<el-input
|
||||
disabled
|
||||
:model-value="formData.totalPrice - formData.otherPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -137,15 +141,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次付款" prop="refundPrice">
|
||||
<el-input-number
|
||||
v-model="formData.refundPrice"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
placeholder="请输入本次付款"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
<el-form-item label="应付金额">
|
||||
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -195,15 +192,13 @@ const formData = ref({
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
refundPrice: undefined,
|
||||
orderNo: undefined,
|
||||
items: [],
|
||||
no: undefined // 入库单号,后端返回
|
||||
})
|
||||
const formRules = reactive({
|
||||
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
|
||||
inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }],
|
||||
refundPrice: [{ required: true, message: '本次付款不能为空', trigger: 'blur' }]
|
||||
inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const disabled = computed(() => formType.value === 'detail')
|
||||
const formRef = ref() // 表单 Ref
|
||||
@ -226,14 +221,8 @@ watch(
|
||||
const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||
const discountPrice =
|
||||
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0
|
||||
// debugger
|
||||
// TODO 芋艿:refundPrice 自动计算会有问题,界面上看到修改了,传递到后端还是没改过来
|
||||
// const refundPrice = totalPrice - discountPrice + val.otherPrice
|
||||
// 赋值
|
||||
formData.value.discountPrice = discountPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice
|
||||
// val.refundPrice = refundPrice
|
||||
// formData.value.refundPrice = refundPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
@ -329,7 +318,6 @@ const resetForm = () => {
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
refundPrice: undefined,
|
||||
items: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
@ -41,7 +41,7 @@
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
@ -117,19 +117,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="有无欠款" prop="debtStatus">
|
||||
<el-form-item label="付款状态" prop="paymentStatus">
|
||||
<el-select
|
||||
v-model="queryParams.debtStatus"
|
||||
placeholder="请选择有无欠款"
|
||||
v-model="queryParams.paymentStatus"
|
||||
placeholder="请选择有款状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option label="有欠款" value="true" />
|
||||
<el-option label="无欠款" value="false" />
|
||||
<el-option label="未付款" value="0" />
|
||||
<el-option label="部分付款" value="1" />
|
||||
<el-option label="全部付款" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-form-item label="审核状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择审核状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)"
|
||||
:key="dict.value"
|
||||
@ -208,35 +214,26 @@
|
||||
:formatter="erpCountTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column
|
||||
label="金额合计"
|
||||
align="center"
|
||||
prop="totalProductPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column
|
||||
label="含税金额"
|
||||
label="应付金额"
|
||||
align="center"
|
||||
prop="totalPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column label="待收金额" align="center">
|
||||
<template #default="scope">
|
||||
{{ erpPriceInputFormatter(scope.row.refundPrice + scope.row.debtPrice) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="本次付款"
|
||||
label="已付金额"
|
||||
align="center"
|
||||
prop="refundPrice"
|
||||
prop="paymentPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column label="本次欠款" align="center" prop="debtPrice">
|
||||
<el-table-column label="未付金额" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.debtPrice === 0">0</span>
|
||||
<el-tag type="danger" v-else>{{ erpPriceInputFormatter(scope.row.debtPrice) }}</el-tag>
|
||||
<span v-if="scope.row.paymentPrice === scope.row.totalPrice">0</span>
|
||||
<el-tag type="danger" v-else>
|
||||
{{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.paymentPrice) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" fixed="right" width="90" prop="status">
|
||||
<el-table-column label="审核状态" align="center" fixed="right" width="90" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
@ -337,7 +334,7 @@ const queryParams = reactive({
|
||||
warehouseId: undefined,
|
||||
inTime: [],
|
||||
orderNo: undefined,
|
||||
debtStatus: undefined,
|
||||
paymentStatus: undefined,
|
||||
accountId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
|
@ -41,7 +41,7 @@
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
|
@ -107,7 +107,11 @@
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="优惠后金额">
|
||||
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||
<el-input
|
||||
disabled
|
||||
:model-value="formData.totalPrice - formData.otherPrice"
|
||||
:formatter="erpPriceInputFormatter"
|
||||
/>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
@ -141,15 +145,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次退款" prop="refundPrice">
|
||||
<el-input-number
|
||||
v-model="formData.refundPrice"
|
||||
controls-position="right"
|
||||
:min="0"
|
||||
:precision="2"
|
||||
placeholder="请输入本次退款"
|
||||
class="!w-1/1"
|
||||
/>
|
||||
<el-form-item label="应退金额" prop="totalPrice">
|
||||
<el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
@ -199,15 +196,13 @@ const formData = ref({
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
refundPrice: undefined,
|
||||
orderNo: undefined,
|
||||
items: [],
|
||||
no: undefined // 退货单号,后端返回
|
||||
})
|
||||
const formRules = reactive({
|
||||
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
|
||||
returnTime: [{ required: true, message: '退货时间不能为空', trigger: 'blur' }],
|
||||
refundPrice: [{ required: true, message: '本次退款不能为空', trigger: 'blur' }]
|
||||
returnTime: [{ required: true, message: '退货时间不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const disabled = computed(() => formType.value === 'detail')
|
||||
const formRef = ref() // 表单 Ref
|
||||
@ -230,14 +225,8 @@ watch(
|
||||
const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0)
|
||||
const discountPrice =
|
||||
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0
|
||||
// debugger
|
||||
// TODO 芋艿:refundPrice 自动计算会有问题,界面上看到修改了,传递到后端还是没改过来
|
||||
// const refundPrice = totalPrice - discountPrice + val.otherPrice
|
||||
// 赋值
|
||||
formData.value.discountPrice = discountPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice
|
||||
// val.refundPrice = refundPrice
|
||||
// formData.value.refundPrice = refundPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
@ -332,7 +321,6 @@ const resetForm = () => {
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
refundPrice: undefined,
|
||||
items: []
|
||||
}
|
||||
formRef.value?.resetFields()
|
||||
|
@ -41,7 +41,7 @@
|
||||
start-placeholder="开始日期"
|
||||
end-placeholder="结束日期"
|
||||
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]"
|
||||
class="!w-240px"
|
||||
class="!w-220px"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="供应商" prop="supplierId">
|
||||
@ -117,8 +117,25 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="状态" prop="status">
|
||||
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px">
|
||||
<el-form-item label="退款状态" prop="refundStatus">
|
||||
<el-select
|
||||
v-model="queryParams.refundStatus"
|
||||
placeholder="请选择退款状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option label="未退款" value="0" />
|
||||
<el-option label="部分退款" value="1" />
|
||||
<el-option label="全部退款" value="2" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="审核状态" prop="status">
|
||||
<el-select
|
||||
v-model="queryParams.status"
|
||||
placeholder="请选择审核状态"
|
||||
clearable
|
||||
class="!w-240px"
|
||||
>
|
||||
<el-option
|
||||
v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)"
|
||||
:key="dict.value"
|
||||
@ -197,35 +214,26 @@
|
||||
:formatter="erpCountTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column
|
||||
label="金额合计"
|
||||
align="center"
|
||||
prop="totalProductPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column
|
||||
label="含税金额"
|
||||
label="应退金额"
|
||||
align="center"
|
||||
prop="totalPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column label="待收金额" align="center">
|
||||
<template #default="scope">
|
||||
{{ erpPriceInputFormatter(scope.row.refundPrice + scope.row.debtPrice) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="本次收款"
|
||||
label="已退金额"
|
||||
align="center"
|
||||
prop="refundPrice"
|
||||
:formatter="erpPriceTableColumnFormatter"
|
||||
/>
|
||||
<el-table-column label="本次欠款" align="center" prop="debtPrice">
|
||||
<el-table-column label="未退金额" align="center">
|
||||
<template #default="scope">
|
||||
<span v-if="scope.row.debtPrice === 0">0</span>
|
||||
<el-tag type="danger" v-else>{{ erpPriceInputFormatter(scope.row.debtPrice) }}</el-tag>
|
||||
<span v-if="scope.row.refundPrice === scope.row.totalPrice">0</span>
|
||||
<el-tag type="danger" v-else>
|
||||
{{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.refundPrice) }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="状态" align="center" fixed="right" width="90" prop="status">
|
||||
<el-table-column label="审核状态" align="center" fixed="right" width="90" prop="status">
|
||||
<template #default="scope">
|
||||
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" />
|
||||
</template>
|
||||
@ -328,6 +336,7 @@ const queryParams = reactive({
|
||||
orderNo: undefined,
|
||||
accountId: undefined,
|
||||
status: undefined,
|
||||
refundStatus: undefined,
|
||||
remark: undefined,
|
||||
creator: undefined
|
||||
})
|
||||
|
Loading…
Reference in New Issue
Block a user