ERP:基本完成销售入库模块

This commit is contained in:
YunaiV 2024-02-11 22:13:02 +08:00
parent 00a386dd7c
commit 5736083534
2 changed files with 25 additions and 12 deletions

View File

@ -210,7 +210,7 @@ const formData = ref({
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
payPrice: 0, payPrice: undefined,
orderNo: undefined, orderNo: undefined,
items: [], items: [],
no: undefined // no: undefined //
@ -242,12 +242,13 @@ watch(
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 // debugger
// TODO // TODO payPrice
const payPrice = totalPrice - discountPrice + val.otherPrice // const payPrice = totalPrice - discountPrice + val.otherPrice
// //
formData.value.discountPrice = discountPrice formData.value.discountPrice = discountPrice
formData.value.totalPrice = totalPrice - discountPrice formData.value.totalPrice = totalPrice - discountPrice
formData.value.payPrice = payPrice // val.payPrice = payPrice
// formData.value.payPrice = payPrice
}, },
{ deep: true } { deep: true }
) )
@ -297,7 +298,13 @@ const handleSaleOrderChange = (order: SaleOrderVO) => {
formData.value.remark = order.remark formData.value.remark = order.remark
formData.value.fileUrl = order.fileUrl formData.value.fileUrl = order.fileUrl
// //
formData.value.items = order.items.filter((item) => item.count > item.outCount) order.items.forEach((item) => {
item.totalCount = item.count
item.count = item.totalCount - item.outCount
item.orderItemId = item.id
item.id = undefined
})
formData.value.items = order.items.filter((item) => item.count > 0)
} }
/** 提交表单 */ /** 提交表单 */
@ -339,7 +346,7 @@ const resetForm = () => {
discountPrice: 0, discountPrice: 0,
totalPrice: 0, totalPrice: 0,
otherPrice: 0, otherPrice: 0,
payPrice: 0, payPrice: undefined,
items: [] items: []
} }
formRef.value?.resetFields() formRef.value?.resetFields()

View File

@ -62,14 +62,24 @@
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="原数量" fixed="right" min-width="80"> <el-table-column
label="原数量"
fixed="right"
min-width="80"
v-if="formData[0]?.totalCount != null"
>
<template #default="{ row }"> <template #default="{ row }">
<el-form-item class="mb-0px!"> <el-form-item class="mb-0px!">
<el-input disabled v-model="row.totalCount" :formatter="erpCountInputFormatter" /> <el-input disabled v-model="row.totalCount" :formatter="erpCountInputFormatter" />
</el-form-item> </el-form-item>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="已出库" fixed="right" min-width="80"> <el-table-column
label="已出库"
fixed="right"
min-width="80"
v-if="formData[0]?.outCount != null"
>
<template #default="{ row }"> <template #default="{ row }">
<el-form-item class="mb-0px!"> <el-form-item class="mb-0px!">
<el-input disabled v-model="row.outCount" :formatter="erpCountInputFormatter" /> <el-input disabled v-model="row.outCount" :formatter="erpCountInputFormatter" />
@ -190,8 +200,6 @@ watch(
() => props.items, () => props.items,
async (val) => { async (val) => {
val.forEach((item) => { val.forEach((item) => {
item.totalCount = item.count
item.count = item.totalCount - item.outCount
if (item.warehouseId == null) { if (item.warehouseId == null) {
item.warehouseId = defaultWarehouse.value?.id item.warehouseId = defaultWarehouse.value?.id
} }
@ -200,8 +208,6 @@ watch(
} }
}) })
formData.value = val formData.value = val
// TODO
}, },
{ immediate: true } { immediate: true }
) )