Skip to content

Commit 5736083

Browse files
committed
✨ ERP:基本完成销售入库模块
1 parent 00a386d commit 5736083

File tree

2 files changed

+25
-12
lines changed

2 files changed

+25
-12
lines changed

src/views/erp/sale/out/SaleOutForm.vue

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -210,7 +210,7 @@ const formData = ref({
210210
discountPrice: 0,
211211
totalPrice: 0,
212212
otherPrice: 0,
213-
payPrice: 0,
213+
payPrice: undefined,
214214
orderNo: undefined,
215215
items: [],
216216
no: undefined // 出库单号,后端返回
@@ -242,12 +242,13 @@ watch(
242242
const discountPrice =
243243
val.discountPercent != null ? erpPriceMultiply(totalPrice, val.discountPercent / 100.0) : 0
244244
// debugger
245-
// TODO 芋艿:这里有问题
246-
const payPrice = totalPrice - discountPrice + val.otherPrice
245+
// TODO 芋艿:payPrice 自动计算会有问题,界面上看到修改了,传递到后端还是没改过来
246+
// const payPrice = totalPrice - discountPrice + val.otherPrice
247247
// 赋值
248248
formData.value.discountPrice = discountPrice
249249
formData.value.totalPrice = totalPrice - discountPrice
250-
formData.value.payPrice = payPrice
250+
// val.payPrice = payPrice
251+
// formData.value.payPrice = payPrice
251252
},
252253
{ deep: true }
253254
)
@@ -297,7 +298,13 @@ const handleSaleOrderChange = (order: SaleOrderVO) => {
297298
formData.value.remark = order.remark
298299
formData.value.fileUrl = order.fileUrl
299300
// 将订单项设置到出库单项
300-
formData.value.items = order.items.filter((item) => item.count > item.outCount)
301+
order.items.forEach((item) => {
302+
item.totalCount = item.count
303+
item.count = item.totalCount - item.outCount
304+
item.orderItemId = item.id
305+
item.id = undefined
306+
})
307+
formData.value.items = order.items.filter((item) => item.count > 0)
301308
}
302309
303310
/** 提交表单 */
@@ -339,7 +346,7 @@ const resetForm = () => {
339346
discountPrice: 0,
340347
totalPrice: 0,
341348
otherPrice: 0,
342-
payPrice: 0,
349+
payPrice: undefined,
343350
items: []
344351
}
345352
formRef.value?.resetFields()

src/views/erp/sale/out/components/SaleOutItemForm.vue

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,14 +62,24 @@
6262
</el-form-item>
6363
</template>
6464
</el-table-column>
65-
<el-table-column label="原数量" fixed="right" min-width="80">
65+
<el-table-column
66+
label="原数量"
67+
fixed="right"
68+
min-width="80"
69+
v-if="formData[0]?.totalCount != null"
70+
>
6671
<template #default="{ row }">
6772
<el-form-item class="mb-0px!">
6873
<el-input disabled v-model="row.totalCount" :formatter="erpCountInputFormatter" />
6974
</el-form-item>
7075
</template>
7176
</el-table-column>
72-
<el-table-column label="已出库" fixed="right" min-width="80">
77+
<el-table-column
78+
label="已出库"
79+
fixed="right"
80+
min-width="80"
81+
v-if="formData[0]?.outCount != null"
82+
>
7383
<template #default="{ row }">
7484
<el-form-item class="mb-0px!">
7585
<el-input disabled v-model="row.outCount" :formatter="erpCountInputFormatter" />
@@ -190,8 +200,6 @@ watch(
190200
() => props.items,
191201
async (val) => {
192202
val.forEach((item) => {
193-
item.totalCount = item.count
194-
item.count = item.totalCount - item.outCount
195203
if (item.warehouseId == null) {
196204
item.warehouseId = defaultWarehouse.value?.id
197205
}
@@ -200,8 +208,6 @@ watch(
200208
}
201209
})
202210
formData.value = val
203-
204-
// TODO 芋艿:这里添加逻辑
205211
},
206212
{ immediate: true }
207213
)

0 commit comments

Comments
 (0)