ERP:采购订单的 paymentPrice 调整,为接入财务的付款单做准备

This commit is contained in:
YunaiV 2024-02-13 14:33:09 +08:00
parent fcba2b4c48
commit 58972e0b98
5 changed files with 72 additions and 90 deletions

View File

@ -103,7 +103,11 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="优惠后金额"> <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-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -137,15 +141,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="本次付款" prop="refundPrice"> <el-form-item label="应付金额">
<el-input-number <el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
v-model="formData.refundPrice"
controls-position="right"
:min="0"
:precision="2"
placeholder="请输入本次付款"
class="!w-1/1"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -195,15 +192,13 @@ const formData = ref({
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
refundPrice: undefined,
orderNo: undefined, orderNo: undefined,
items: [], items: [],
no: undefined // no: undefined //
}) })
const formRules = reactive({ const formRules = reactive({
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }], supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }], inTime: [{ required: true, message: '入库时间不能为空', trigger: 'blur' }]
refundPrice: [{ required: true, message: '本次付款不能为空', trigger: 'blur' }]
}) })
const disabled = computed(() => formType.value === 'detail') const disabled = computed(() => formType.value === 'detail')
const formRef = ref() // Ref const formRef = ref() // Ref
@ -226,14 +221,8 @@ watch(
const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0) const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0)
const discountPrice = const discountPrice =
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0 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.discountPrice = discountPrice
formData.value.totalPrice = totalPrice - discountPrice formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
// val.refundPrice = refundPrice
// formData.value.refundPrice = refundPrice
}, },
{ deep: true } { deep: true }
) )
@ -329,7 +318,6 @@ const resetForm = () => {
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
refundPrice: undefined,
items: [] items: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()

View File

@ -41,7 +41,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" :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>
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
@ -117,19 +117,25 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="有无欠款" prop="debtStatus"> <el-form-item label="付款状态" prop="paymentStatus">
<el-select <el-select
v-model="queryParams.debtStatus" v-model="queryParams.paymentStatus"
placeholder="请选择有无欠款" placeholder="请选择有状态"
clearable clearable
class="!w-240px" class="!w-240px"
> >
<el-option label="有欠款" value="true" /> <el-option label="未付款" value="0" />
<el-option label="无欠款" value="false" /> <el-option label="部分付款" value="1" />
<el-option label="全部付款" value="2" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="审核状态" prop="status">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px"> <el-select
v-model="queryParams.status"
placeholder="请选择审核状态"
clearable
class="!w-240px"
>
<el-option <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)"
:key="dict.value" :key="dict.value"
@ -208,35 +214,26 @@
:formatter="erpCountTableColumnFormatter" :formatter="erpCountTableColumnFormatter"
/> />
<el-table-column <el-table-column
label="金额合计" label="应付金额"
align="center"
prop="totalProductPrice"
:formatter="erpPriceTableColumnFormatter"
/>
<el-table-column
label="含税金额"
align="center" align="center"
prop="totalPrice" prop="totalPrice"
:formatter="erpPriceTableColumnFormatter" :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 <el-table-column
label="本次付款" label="已付金额"
align="center" align="center"
prop="refundPrice" prop="paymentPrice"
:formatter="erpPriceTableColumnFormatter" :formatter="erpPriceTableColumnFormatter"
/> />
<el-table-column label="本次欠款" align="center" prop="debtPrice"> <el-table-column label="未付金额" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.debtPrice === 0">0</span> <span v-if="scope.row.paymentPrice === scope.row.totalPrice">0</span>
<el-tag type="danger" v-else>{{ erpPriceInputFormatter(scope.row.debtPrice) }}</el-tag> <el-tag type="danger" v-else>
{{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.paymentPrice) }}
</el-tag>
</template> </template>
</el-table-column> </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"> <template #default="scope">
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" />
</template> </template>
@ -337,7 +334,7 @@ const queryParams = reactive({
warehouseId: undefined, warehouseId: undefined,
inTime: [], inTime: [],
orderNo: undefined, orderNo: undefined,
debtStatus: undefined, paymentStatus: undefined,
accountId: undefined, accountId: undefined,
status: undefined, status: undefined,
remark: undefined, remark: undefined,

View File

@ -41,7 +41,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" :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>
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">

View File

@ -107,7 +107,11 @@
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="优惠后金额"> <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-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
@ -141,15 +145,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="本次退款" prop="refundPrice"> <el-form-item label="应退金额" prop="totalPrice">
<el-input-number <el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
v-model="formData.refundPrice"
controls-position="right"
:min="0"
:precision="2"
placeholder="请输入本次退款"
class="!w-1/1"
/>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -199,15 +196,13 @@ const formData = ref({
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
refundPrice: undefined,
orderNo: undefined, orderNo: undefined,
items: [], items: [],
no: undefined // 退 no: undefined // 退
}) })
const formRules = reactive({ const formRules = reactive({
supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }], supplierId: [{ required: true, message: '供应商不能为空', trigger: 'blur' }],
returnTime: [{ required: true, message: '退货时间不能为空', trigger: 'blur' }], returnTime: [{ required: true, message: '退货时间不能为空', trigger: 'blur' }]
refundPrice: [{ required: true, message: '本次退款不能为空', trigger: 'blur' }]
}) })
const disabled = computed(() => formType.value === 'detail') const disabled = computed(() => formType.value === 'detail')
const formRef = ref() // Ref const formRef = ref() // Ref
@ -230,14 +225,8 @@ watch(
const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0) const totalPrice = val.items.reduce((prev, curr) => prev + curr.totalPrice, 0)
const discountPrice = const discountPrice =
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0 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.discountPrice = discountPrice
formData.value.totalPrice = totalPrice - discountPrice formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
// val.refundPrice = refundPrice
// formData.value.refundPrice = refundPrice
}, },
{ deep: true } { deep: true }
) )
@ -332,7 +321,6 @@ const resetForm = () => {
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
refundPrice: undefined,
items: [] items: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()

View File

@ -41,7 +41,7 @@
start-placeholder="开始日期" start-placeholder="开始日期"
end-placeholder="结束日期" end-placeholder="结束日期"
:default-time="[new Date('1 00:00:00'), new Date('1 23:59:59')]" :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>
<el-form-item label="供应商" prop="supplierId"> <el-form-item label="供应商" prop="supplierId">
@ -117,8 +117,25 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="状态" prop="status"> <el-form-item label="退款状态" prop="refundStatus">
<el-select v-model="queryParams.status" placeholder="请选择状态" clearable class="!w-240px"> <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 <el-option
v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)" v-for="dict in getIntDictOptions(DICT_TYPE.ERP_AUDIT_STATUS)"
:key="dict.value" :key="dict.value"
@ -197,35 +214,26 @@
:formatter="erpCountTableColumnFormatter" :formatter="erpCountTableColumnFormatter"
/> />
<el-table-column <el-table-column
label="金额合计" label="应退金额"
align="center"
prop="totalProductPrice"
:formatter="erpPriceTableColumnFormatter"
/>
<el-table-column
label="含税金额"
align="center" align="center"
prop="totalPrice" prop="totalPrice"
:formatter="erpPriceTableColumnFormatter" :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 <el-table-column
label="本次收款" label="已退金额"
align="center" align="center"
prop="refundPrice" prop="refundPrice"
:formatter="erpPriceTableColumnFormatter" :formatter="erpPriceTableColumnFormatter"
/> />
<el-table-column label="本次欠款" align="center" prop="debtPrice"> <el-table-column label="未退金额" align="center">
<template #default="scope"> <template #default="scope">
<span v-if="scope.row.debtPrice === 0">0</span> <span v-if="scope.row.refundPrice === scope.row.totalPrice">0</span>
<el-tag type="danger" v-else>{{ erpPriceInputFormatter(scope.row.debtPrice) }}</el-tag> <el-tag type="danger" v-else>
{{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.refundPrice) }}
</el-tag>
</template> </template>
</el-table-column> </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"> <template #default="scope">
<dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" /> <dict-tag :type="DICT_TYPE.ERP_AUDIT_STATUS" :value="scope.row.status" />
</template> </template>
@ -328,6 +336,7 @@ const queryParams = reactive({
orderNo: undefined, orderNo: undefined,
accountId: undefined, accountId: undefined,
status: undefined, status: undefined,
refundStatus: undefined,
remark: undefined, remark: undefined,
creator: undefined creator: undefined
}) })