fix: add optional remark field to inventory profit/loss entry modal
This commit is contained in:
@ -181,6 +181,19 @@
|
|||||||
/>
|
/>
|
||||||
<p class="unit-text">单位: {{ currentItem.unit || '个' }}</p>
|
<p class="unit-text">单位: {{ currentItem.unit || '个' }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- ★ 新增: 备注输入框 -->
|
||||||
|
<div class="remark-area" style="margin-top: 15px;">
|
||||||
|
<el-form-item label="备注:" label-width="60px">
|
||||||
|
<el-input
|
||||||
|
v-model="inputRemark"
|
||||||
|
placeholder="选填,可填写差异原因说明"
|
||||||
|
type="textarea"
|
||||||
|
:rows="2"
|
||||||
|
clearable
|
||||||
|
/>
|
||||||
|
</el-form-item>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<template #footer>
|
<template #footer>
|
||||||
<div class="dialog-footer">
|
<div class="dialog-footer">
|
||||||
@ -451,6 +464,7 @@ const searchKeyword = ref('')
|
|||||||
|
|
||||||
const currentItem = ref<StockItem | null>(null)
|
const currentItem = ref<StockItem | null>(null)
|
||||||
const inputQty = ref<number | undefined>(undefined)
|
const inputQty = ref<number | undefined>(undefined)
|
||||||
|
const inputRemark = ref('')
|
||||||
const qtyInputRef = ref()
|
const qtyInputRef = ref()
|
||||||
|
|
||||||
// ★ 新增: 多人协同心跳刷新定时器
|
// ★ 新增: 多人协同心跳刷新定时器
|
||||||
@ -831,8 +845,10 @@ const handleManualConfirm = () => {
|
|||||||
if (!currentItem.value) return
|
if (!currentItem.value) return
|
||||||
const val = inputQty.value === undefined ? 0 : inputQty.value
|
const val = inputQty.value === undefined ? 0 : inputQty.value
|
||||||
|
|
||||||
updateAndSync(currentItem.value, val)
|
updateAndSync(currentItem.value, val, inputRemark.value)
|
||||||
showQtyDialog.value = false
|
showQtyDialog.value = false
|
||||||
|
// 重置备注
|
||||||
|
inputRemark.value = ''
|
||||||
ElMessage.success(`已记录实盘: ${val}`)
|
ElMessage.success(`已记录实盘: ${val}`)
|
||||||
|
|
||||||
// ★★★ 核心修改:确认数量后自动重新打开全屏扫码,实现无缝闭环
|
// ★★★ 核心修改:确认数量后自动重新打开全屏扫码,实现无缝闭环
|
||||||
@ -843,14 +859,14 @@ const handleManualConfirm = () => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
const updateAndSync = async (item: StockItem, quantity: number) => {
|
const updateAndSync = async (item: StockItem, quantity: number, remark: string = '') => {
|
||||||
item.scanned = true
|
item.scanned = true
|
||||||
item.qty_actual = quantity
|
item.qty_actual = quantity
|
||||||
scannedMap.value.set(item.uuid, quantity)
|
scannedMap.value.set(item.uuid, quantity)
|
||||||
|
|
||||||
syncStatus.value = 'syncing'
|
syncStatus.value = 'syncing'
|
||||||
try {
|
try {
|
||||||
await api.addDraft({ uuid: item.uuid, quantity: quantity })
|
await api.addDraft({ uuid: item.uuid, quantity: quantity, remark: remark })
|
||||||
syncStatus.value = 'success'
|
syncStatus.value = 'success'
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
syncStatus.value = 'failed'
|
syncStatus.value = 'failed'
|
||||||
|
|||||||
Reference in New Issue
Block a user