ERP:销售订单的 receiptPrice 调整,为接入财务的收款单做准备

This commit is contained in:
YunaiV 2024-02-15 09:16:18 +08:00
parent e951ed1bd1
commit e07e19106c
5 changed files with 67 additions and 91 deletions

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="customerId"> <el-form-item label="客户" prop="customerId">

View File

@ -121,7 +121,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">
@ -155,15 +159,8 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="8"> <el-col :span="8">
<el-form-item label="本次收款" prop="payPrice"> <el-form-item label="应收金额">
<el-input-number <el-input disabled v-model="formData.totalPrice" :formatter="erpPriceInputFormatter" />
v-model="formData.payPrice"
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>
@ -211,15 +208,13 @@ const formData = ref({
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
payPrice: undefined,
orderNo: undefined, orderNo: undefined,
items: [], items: [],
no: undefined // no: undefined //
}) })
const formRules = reactive({ const formRules = reactive({
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }], customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
outTime: [{ required: true, message: '出库时间不能为空', trigger: 'blur' }], outTime: [{ required: true, message: '出库时间不能为空', trigger: 'blur' }]
payPrice: [{ 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
@ -242,14 +237,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 payPrice
// const payPrice = 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.payPrice = payPrice
// formData.value.payPrice = payPrice
}, },
{ deep: true } { deep: true }
) )
@ -347,7 +336,6 @@ const resetForm = () => {
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
payPrice: 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="customerId"> <el-form-item label="客户" prop="customerId">
@ -117,18 +117,19 @@
/> />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="有无欠款" prop="debtStatus"> <el-form-item label="收款状态" prop="receiptStatus">
<el-select <el-select
v-model="queryParams.debtStatus" v-model="queryParams.receiptStatus"
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)"
@ -208,35 +209,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.payPrice + scope.row.debtPrice) }}
</template>
</el-table-column>
<el-table-column <el-table-column
label="本次收款" label="已收金额"
align="center" align="center"
prop="payPrice" prop="receiptPrice"
: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.receiptPrice === 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.receiptPrice) }}
</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 +329,7 @@ const queryParams = reactive({
warehouseId: undefined, warehouseId: undefined,
outTime: [], outTime: [],
orderNo: undefined, orderNo: undefined,
debtStatus: undefined, receiptStatus: undefined,
accountId: undefined, accountId: undefined,
status: undefined, status: undefined,
remark: undefined, remark: undefined,

View File

@ -121,7 +121,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">
@ -155,15 +159,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>
@ -211,15 +208,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({
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }], customerId: [{ 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
@ -242,14 +237,7 @@ 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 formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
// TODO refundPrice
// const refundPrice = totalPrice - discountPrice + val.otherPrice
//
formData.value.discountPrice = discountPrice
formData.value.totalPrice = totalPrice - discountPrice
// val.refundPrice = refundPrice
// formData.value.refundPrice = refundPrice
}, },
{ deep: true } { deep: true }
) )
@ -346,7 +334,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="customerId"> <el-form-item label="客户" prop="customerId">
@ -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>
@ -329,7 +337,8 @@ const queryParams = reactive({
accountId: undefined, accountId: undefined,
status: undefined, status: undefined,
remark: undefined, remark: undefined,
creator: undefined creator: undefined,
refundStatus: undefined
}) })
const queryFormRef = ref() // const queryFormRef = ref() //
const exportLoading = ref(false) // const exportLoading = ref(false) //