fix: clarify PDA quantity inputs
This commit is contained in:
@@ -54,7 +54,7 @@
|
||||
|
||||
<view v-if="selectedItem && selectedRemaining > 0" class="fulfillment-card">
|
||||
<text class="card-title">本次拣货:{{ selectedItem.palletNo }}</text>
|
||||
<view class="count-row"><text>拣货箱数</text><input type="number" :value="packages" @input="updatePackages" /><text>最多 {{ selectedRemaining }} 箱</text></view>
|
||||
<view class="count-row"><text>拣货箱数</text><input type="number" :value="packages" :placeholder="`请输入 1-${selectedRemaining} 箱`" @input="updatePackages" /><text>最多 {{ selectedRemaining }} 箱</text></view>
|
||||
<button class="primary-button" :disabled="!canPick || busy" @tap="submitPick">{{ busyAction === 'pick' ? '提交中…' : '确认拣货' }}</button>
|
||||
</view>
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
</view>
|
||||
<view v-else class="fulfillment-state"><text class="state-title">任务详情尚无可拣货明细</text><text>请刷新;若持续为空,请联系平台确认出库货物是否已下发。</text></view>
|
||||
|
||||
<view v-if="selectedPosition && selectedRemaining > 0" class="fulfillment-card"><text class="card-title">本次拣货:{{ lineBusinessCode(selectedPosition) }}</text><view class="count-row"><text>拣货箱数</text><input type="number" :value="packages" @input="updatePackages" /><text>最多 {{ selectedRemaining }} 箱</text></view><button class="primary-button" :disabled="!canPick || busy" @tap="submitPick">{{ busyAction === 'pick' ? '提交中…' : '确认出库拣货' }}</button></view>
|
||||
<view v-if="selectedPosition && selectedRemaining > 0" class="fulfillment-card"><text class="card-title">本次拣货:{{ lineBusinessCode(selectedPosition) }}</text><view class="count-row"><text>拣货箱数</text><input type="number" :value="packages" :placeholder="`请输入 1-${selectedRemaining} 箱`" @input="updatePackages" /><text>最多 {{ selectedRemaining }} 箱</text></view><button class="primary-button" :disabled="!canPick || busy" @tap="submitPick">{{ busyAction === 'pick' ? '提交中…' : '确认出库拣货' }}</button></view>
|
||||
|
||||
<view class="fulfillment-card gate-card"><text class="card-title">完成出库任务</text><text v-if="remainingPackages > 0" class="gate-warning">尚有 {{ remainingPackages }} 箱未拣,不能完成出库。</text><text v-else-if="current.status === 'COMPLETED'" class="gate-success">出库任务已完成,不可重复提交。</text><text v-else class="gate-note">全部计划货物已扫描核平,服务端将再次校验库存门禁。</text><button v-if="current.status !== 'COMPLETED'" class="primary-button" :disabled="!canComplete || busy" @tap="completeTask">{{ busyAction === 'complete' ? '完成中…' : '完成出库任务' }}</button></view>
|
||||
</template>
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
<view v-if="source.inventory?.length" class="inventory-list">
|
||||
<view v-for="line in source.inventory" :key="String(line.positionId)" class="inventory-line">
|
||||
<view class="inventory-copy"><text class="inventory-name">{{ line.productName || line.inboundCode || '库存明细' }}</text><text class="inventory-meta">{{ line.inboundCode || '无入仓码' }} · 可移动 {{ line.availablePackages }} 箱</text><text v-if="lockedPackages(line)" class="inventory-warning">另有 {{ lockedPackages(line) }} 箱处于冻结或处理中</text></view>
|
||||
<view v-if="editableLines" class="inventory-count"><input type="number" :value="line.movePackages" @input="updateMovePackages(source.palletCode, line.positionId, $event.detail.value)" /><text>箱</text></view>
|
||||
<view v-if="editableLines" class="inventory-count"><input type="number" :value="line.movePackages" :placeholder="`最多 ${line.availablePackages} 箱`" @input="updateMovePackages(source.palletCode, line.positionId, $event.detail.value)" /><text>箱</text></view>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="pallet-empty-inline">当前托盘为空</view>
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
import test from 'node:test'
|
||||
import assert from 'node:assert/strict'
|
||||
import { readdir, readFile } from 'node:fs/promises'
|
||||
import { fileURLToPath } from 'node:url'
|
||||
import { join, relative } from 'node:path'
|
||||
|
||||
const sourceRoot = fileURLToPath(new URL('../src', import.meta.url))
|
||||
|
||||
async function vueFiles(directory) {
|
||||
const entries = await readdir(directory, { withFileTypes: true })
|
||||
const files = []
|
||||
for (const entry of entries) {
|
||||
if (entry.name === 'uni_modules') continue
|
||||
const path = join(directory, entry.name)
|
||||
if (entry.isDirectory()) files.push(...await vueFiles(path))
|
||||
else if (entry.name.endsWith('.vue')) files.push(path)
|
||||
}
|
||||
return files
|
||||
}
|
||||
|
||||
test('every editable PDA input and textarea provides an input hint', async () => {
|
||||
const missing = []
|
||||
for (const file of await vueFiles(sourceRoot)) {
|
||||
const source = await readFile(file, 'utf8')
|
||||
for (const match of source.matchAll(/<(input|textarea)\b[^>]*>/gs)) {
|
||||
if (!/\s:?placeholder\s*=/.test(match[0])) {
|
||||
const line = source.slice(0, match.index).split('\n').length
|
||||
missing.push(`${relative(sourceRoot, file)}:${line}`)
|
||||
}
|
||||
}
|
||||
}
|
||||
assert.deepEqual(missing, [], `缺少 placeholder:${missing.join(', ')}`)
|
||||
})
|
||||
|
||||
test('quantity inputs explain the valid package range', async () => {
|
||||
const [dispatch, outbound, pallet] = await Promise.all([
|
||||
readFile(join(sourceRoot, 'pages/dispatch/dispatch.vue'), 'utf8'),
|
||||
readFile(join(sourceRoot, 'pages/outbound/outbound.vue'), 'utf8'),
|
||||
readFile(join(sourceRoot, 'pages/pallet/pallet.vue'), 'utf8')
|
||||
])
|
||||
assert.match(dispatch, /:placeholder="`请输入 1-\$\{selectedRemaining\} 箱`"/)
|
||||
assert.match(outbound, /:placeholder="`请输入 1-\$\{selectedRemaining\} 箱`"/)
|
||||
assert.match(pallet, /:placeholder="`最多 \$\{line\.availablePackages\} 箱`"/)
|
||||
})
|
||||
Reference in New Issue
Block a user