✨ ERP:销售订单的 receiptPrice 调整,为接入财务的收款单做准备
This commit is contained in:
parent
e951ed1bd1
commit
e07e19106c
@ -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="customerId">
|
||||
|
@ -121,7 +121,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">
|
||||
@ -155,15 +159,8 @@
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-form-item label="本次收款" prop="payPrice">
|
||||
<el-input-number
|
||||
v-model="formData.payPrice"
|
||||
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>
|
||||
@ -211,15 +208,13 @@ const formData = ref({
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
payPrice: undefined,
|
||||
orderNo: undefined,
|
||||
items: [],
|
||||
no: undefined // 出库单号,后端返回
|
||||
})
|
||||
const formRules = reactive({
|
||||
customerId: [{ required: true, message: '客户不能为空', trigger: 'blur' }],
|
||||
outTime: [{ required: true, message: '出库时间不能为空', trigger: 'blur' }],
|
||||
payPrice: [{ required: true, message: '本次收款不能为空', trigger: 'blur' }]
|
||||
outTime: [{ required: true, message: '出库时间不能为空', trigger: 'blur' }]
|
||||
})
|
||||
const disabled = computed(() => formType.value === 'detail')
|
||||
const formRef = ref() // 表单 Ref
|
||||
@ -242,14 +237,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 芋艿:payPrice 自动计算会有问题,界面上看到修改了,传递到后端还是没改过来
|
||||
// const payPrice = totalPrice - discountPrice + val.otherPrice
|
||||
// 赋值
|
||||
formData.value.discountPrice = discountPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice
|
||||
// val.payPrice = payPrice
|
||||
// formData.value.payPrice = payPrice
|
||||
formData.value.totalPrice = totalPrice - discountPrice + val.otherPrice
|
||||
},
|
||||
{ deep: true }
|
||||
)
|
||||
@ -347,7 +336,6 @@ const resetForm = () => {
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
payPrice: 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="customerId">
|
||||
@ -117,18 +117,19 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="有无欠款" prop="debtStatus">
|
||||
<el-form-item label="收款状态" prop="receiptStatus">
|
||||
<el-select
|
||||
v-model="queryParams.debtStatus"
|
||||
placeholder="请选择有无欠款"
|
||||
v-model="queryParams.receiptStatus"
|
||||
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-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)"
|
||||
@ -208,35 +209,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.payPrice + scope.row.debtPrice) }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column
|
||||
label="本次收款"
|
||||
label="已收金额"
|
||||
align="center"
|
||||
prop="payPrice"
|
||||
prop="receiptPrice"
|
||||
: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.receiptPrice === scope.row.totalPrice">0</span>
|
||||
<el-tag type="danger" v-else>
|
||||
{{ erpPriceInputFormatter(scope.row.totalPrice - scope.row.receiptPrice) }}
|
||||
</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 +329,7 @@ const queryParams = reactive({
|
||||
warehouseId: undefined,
|
||||
outTime: [],
|
||||
orderNo: undefined,
|
||||
debtStatus: undefined,
|
||||
receiptStatus: undefined,
|
||||
accountId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
|
@ -121,7 +121,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">
|
||||
@ -155,15 +159,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>
|
||||
@ -211,15 +208,13 @@ const formData = ref({
|
||||
discountPrice: 0,
|
||||
totalPrice: 0,
|
||||
otherPrice: 0,
|
||||
refundPrice: undefined,
|
||||
orderNo: undefined,
|
||||
items: [],
|
||||
no: undefined // 退货单号,后端返回
|
||||
})
|
||||
const formRules = reactive({
|
||||
customerId: [{ 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
|
||||
@ -242,14 +237,7 @@ 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 }
|
||||
)
|
||||
@ -346,7 +334,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="customerId">
|
||||
@ -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>
|
||||
@ -329,7 +337,8 @@ const queryParams = reactive({
|
||||
accountId: undefined,
|
||||
status: undefined,
|
||||
remark: undefined,
|
||||
creator: undefined
|
||||
creator: undefined,
|
||||
refundStatus: undefined
|
||||
})
|
||||
const queryFormRef = ref() // 搜索的表单
|
||||
const exportLoading = ref(false) // 导出的加载中
|
||||
|
Loading…
Reference in New Issue
Block a user