Skip to content

Commit 14ab46c

Browse files
committed
✨ ERP:增加 ERP 盘点单的实现 100%
1 parent 0319056 commit 14ab46c

File tree

1 file changed

+28
-6
lines changed

1 file changed

+28
-6
lines changed

src/views/erp/stock/check/components/StockCheckItemForm.vue

Lines changed: 28 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@
5252
</el-form-item>
5353
</template>
5454
</el-table-column>
55-
<el-table-column label="库存" min-width="100">
55+
<el-table-column label="账面库存" min-width="100">
5656
<template #default="{ row }">
5757
<el-form-item class="mb-0px!">
5858
<el-input disabled v-model="row.stockCount" :formatter="erpCountInputFormatter" />
@@ -73,19 +73,34 @@
7373
</el-form-item>
7474
</template>
7575
</el-table-column>
76-
<el-table-column label="数量" prop="count" fixed="right" min-width="140">
76+
<el-table-column label="实际库存" fixed="right" min-width="140">
7777
<template #default="{ row, $index }">
78-
<el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!">
78+
<el-form-item
79+
:prop="`${$index}.actualCount`"
80+
:rules="formRules.actualCount"
81+
class="mb-0px!"
82+
>
7983
<el-input-number
80-
v-model="row.count"
84+
v-model="row.actualCount"
8185
controls-position="right"
82-
:min="0.001"
8386
:precision="3"
8487
class="!w-100%"
8588
/>
8689
</el-form-item>
8790
</template>
8891
</el-table-column>
92+
<el-table-column label="盈亏数量" prop="count" fixed="right" min-width="110">
93+
<template #default="{ row, $index }">
94+
<el-form-item :prop="`${$index}.count`" :rules="formRules.count" class="mb-0px!">
95+
<el-input
96+
disabled
97+
v-model="row.count"
98+
:formatter="erpCountInputFormatter"
99+
class="!w-100%"
100+
/>
101+
</el-form-item>
102+
</template>
103+
</el-table-column>
89104
<el-table-column label="产品单价" fixed="right" min-width="120">
90105
<template #default="{ row, $index }">
91106
<el-form-item
@@ -179,6 +194,11 @@ watch(
179194
}
180195
// 循环处理
181196
val.forEach((item) => {
197+
if (item.stockCount != null && item.actualCount != null) {
198+
item.count = item.actualCount - item.stockCount
199+
} else {
200+
item.count = undefined
201+
}
182202
item.totalPrice = erpPriceMultiply(item.productPrice, item.count)
183203
})
184204
},
@@ -216,7 +236,8 @@ const handleAdd = () => {
216236
productBarCode: undefined, // 产品条码
217237
productPrice: undefined,
218238
stockCount: undefined,
219-
count: 1,
239+
actualCount: undefined,
240+
count: undefined,
220241
totalPrice: undefined,
221242
remark: undefined
222243
}
@@ -253,6 +274,7 @@ const setStockCount = async (row) => {
253274
}
254275
const stock = await StockApi.getStock2(row.productId, row.warehouseId)
255276
row.stockCount = stock ? stock.count : 0
277+
row.actualCount = row.stockCount
256278
}
257279
258280
/** 表单校验 */

0 commit comments

Comments
 (0)