feat(盘点): 接入 0.3.320 静态拣货完成标记,未拣完禁止上报

后端 stock.check.workData / workDataDetail 对 is_static=1 返回
picking_completed(1=已完成拣货 / 0=未完成)与明盘下的 locked_quantity,
report 对「静态任务 + 该商品仍有锁定量」直接拒绝。

- countModel:新增 pickPickingMeta,goods 行与商品钻取统一输出
  hasPickingFlag / pickingCompleted / pickingPending / lockedQuantity
- CountGoodsCard:未拣完显示「待拣货」标记与「拣货未完成(锁定 N)」提示
- inventoryCountGoods:概况卡标记与提示、顶部黄条说明;openEntryPopup 与
  submitReport 拦截并语音播报,避免录完数量才被后端拒绝
- 普通盘点/库位任务后端不返回该字段,行为不变
- 版本升级至 1.0.136(package.json + manifest.json)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
This commit is contained in:
liufumingren 2026-10-28 16:33:22 +08:00
parent 9c3ee18cdd
commit d5607f58b1
5 changed files with 79 additions and 3 deletions

View File

@ -1,6 +1,6 @@
{
"name": "wms-pda",
"version": "1.0.135",
"version": "1.0.136",
"private": true,
"description": "天豹云仓 WMS_PDA(uni-app Vue2 + @vue/cli 4.5)",
"scripts": {

View File

@ -2,8 +2,8 @@
"name" : "WMS_PDA",
"appid" : "__UNI__0B3DAD3",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.0.132",
"versionCode" : 1000132,
"versionName" : "1.0.136",
"versionCode" : 1000136,
"transformPx" : false,
"app-plus" : {
"optimization" : {

View File

@ -17,6 +17,7 @@
<text class="goods-card__flag" :class="row.checked ? 'goods-card__flag--done' : 'goods-card__flag--todo'">
{{ row.checked ? '已盘' : '未盘' }}
</text>
<text v-if="row.pickingPending" class="goods-card__flag goods-card__flag--picking">待拣货</text>
</view>
<text v-if="row.subtitle" class="goods-card__subtitle">{{ row.subtitle }}</text>
<view class="goods-card__metrics">
@ -29,6 +30,7 @@
<text v-if="row.amount.bookHint" class="goods-card__metric goods-card__metric--hint">{{ row.amount.bookHint }}</text>
</template>
<text v-else class="goods-card__metric">已盘记录 {{ row.recordCount || 0 }} 条</text>
<text v-if="pickingHint" class="goods-card__metric goods-card__metric--hint">{{ pickingHint }}</text>
<text v-if="locationText" class="goods-card__metric">{{ locationText }}</text>
</view>
</view>
@ -57,6 +59,12 @@ export default {
if (!codes.length) return '';
if (codes.length === 1) return codes[0];
return `${codes.length} 个库位`;
},
// 静态盘点拣货未完成提示(带锁定量时一并显示,便于判断还差多少)
pickingHint() {
if (!this.row.pickingPending) return '';
const locked = this.row.lockedQuantity;
return locked === null || locked === undefined ? '拣货未完成' : `拣货未完成(锁定 ${locked})`;
}
},
methods: {
@ -151,6 +159,11 @@ export default {
color: #ff9800;
}
/* 静态盘点拣货未完成(后端会拒绝上报,需置灰入口) */
.goods-card__flag--picking {
color: #e64340;
}
.goods-card__subtitle {
margin-top: 6rpx;
font-size: 34rpx;

View File

@ -544,6 +544,26 @@ function pickBookMeta(source, fallbackIsStatic) {
};
}
/**
* 静态盘点拣货完成标记(0.3.320):
* picking_completed=1 已完成拣货 / 0 未完成(仓库内该商品 SUM(locked_quantity)==0 视为完成);
* locked_quantity 仅明盘返回,盲盘不输出。非静态任务后端不返回这两个字段。
*/
function pickPickingMeta(source) {
const obj = source && typeof source === 'object' ? source : {};
const completedRaw = obj.picking_completed !== undefined ? obj.picking_completed : obj.pickingCompleted;
const lockedRaw = obj.locked_quantity !== undefined ? obj.locked_quantity : obj.lockedQuantity;
const hasPickingFlag = completedRaw !== undefined && completedRaw !== null && String(completedRaw).trim() !== '';
const pickingCompleted = hasPickingFlag && toBool(completedRaw);
return {
hasPickingFlag,
pickingCompleted,
lockedQuantity: toNumberOrNull(lockedRaw),
// 未完成拣货时后端会拒绝 report,前端据此置灰上报入口
pickingPending: hasPickingFlag && !pickingCompleted
};
}
/**
* 账面口径元信息:system_quantity 为本次参与差异计算的账面(静态=快照、普通=当前库存),
* storage_quantity / snapshot_quantity 为另一口径参考值,两者不一致时给出提示文案。
@ -824,6 +844,7 @@ function normalizeGoodsWorkRow(item, index, open, options = {}) {
const checkedNumber = toNumberOrNull(checkedRaw);
// 账面口径(0.3.318):is_static/book_source/storage_quantity/snapshot_quantity
const bookMeta = pickBookMeta(source, options.isStatic);
const pickingMeta = pickPickingMeta(source);
const stockIdValue = firstValue(source, ['stock_id', 'stockId']);
// 行唯一键:0.3.309 起 goods 视图行不再返回 detail_id,优先用 stock_id
const rowKey = stockIdValue || detailId || `${index + 1}`;
@ -864,6 +885,11 @@ function normalizeGoodsWorkRow(item, index, open, options = {}) {
bookSource: bookMeta.bookSource,
storageQuantity: bookMeta.storageQuantity,
snapshotQuantity: bookMeta.snapshotQuantity,
// 静态盘点拣货完成标记(0.3.320):pickingPending=true 时 report 会被后端拒绝
hasPickingFlag: pickingMeta.hasPickingFlag,
pickingCompleted: pickingMeta.pickingCompleted,
pickingPending: pickingMeta.pickingPending,
lockedQuantity: pickingMeta.lockedQuantity,
// 列表行(CountGoodsCard)与商品作业页(概况带入路由)用的字段:一行一个商品,操作剥离到操作页
images: imageList,
image: imageList[0] || '',
@ -1092,6 +1118,8 @@ export function normalizeGoodsDetailInfo(row, mode, options = {}) {
const open = isOpenCheckMode(mode) || hasQuantity;
// 账面口径(0.3.318):顶层 is_static/book_source
const bookMeta = pickBookMeta(source, options.isStatic);
// 静态盘点拣货完成标记(0.3.320):顶层 picking_completed / locked_quantity
const pickingMeta = pickPickingMeta(source);
// 库位行形态:商品信息/图片取 goods 首项兜底
const firstGoods = Array.isArray(source.goods) && source.goods.length ? (source.goods[0] || {}) : {};
const pickText = keys => firstValue(source, keys) || firstValue(firstGoods, keys) || '';
@ -1222,6 +1250,11 @@ export function normalizeGoodsDetailInfo(row, mode, options = {}) {
bookSourceText: summaryBook.bookSourceText,
storageQuantity: summaryBook.storageQuantity,
snapshotQuantity: summaryBook.snapshotQuantity,
// 静态盘点拣货完成标记(0.3.320):pickingPending=true 时 report 会被后端拒绝
hasPickingFlag: pickingMeta.hasPickingFlag,
pickingCompleted: pickingMeta.pickingCompleted,
pickingPending: pickingMeta.pickingPending,
lockedQuantity: pickingMeta.lockedQuantity,
systemQuantity: toNumberOrNull(systemRaw),
checkedQuantity: toNumberOrNull(checkedRaw),
amount: buildWorkAmount(systemRaw, checkedRaw, diffRaw, open, {

View File

@ -25,6 +25,8 @@
>
<view v-if="!editable" class="inv-goods-tip">当前盘点任务状态不可作业,仅可查看</view>
<view v-if="editable && pickingPending" class="inv-goods-tip">静态盘点:该商品尚未完成拣货,拣货完成前不能上报</view>
<view v-if="loading && !detailRow" class="inv-goods-tip">加载中...</view>
<!-- 商品概况(紧凑卡片,有图就显示:商品主图优先,否则用作业照片兜底) -->
@ -51,6 +53,7 @@
class="inv-goods-card__flag"
:class="hasChecked ? 'inv-goods-card__flag--done' : 'inv-goods-card__flag--todo'"
>{{ hasChecked ? '已盘' : '未盘' }}</text>
<text v-if="pickingPending" class="inv-goods-card__flag inv-goods-card__flag--picking">待拣货</text>
</view>
<text class="inv-goods-card__line">{{ goodsMetaText }}</text>
<view class="inv-goods-card__metrics">
@ -58,6 +61,7 @@
<text class="inv-goods-card__metric">已盘 {{ checkedTotalText }}</text>
<text v-if="diffText" class="inv-goods-card__diff" :class="diffValueClass">{{ diffText }}</text>
<text v-if="bookHintText" class="inv-goods-card__hint">{{ bookHintText }}</text>
<text v-if="pickingPending" class="inv-goods-card__hint">{{ pickingHintText }}</text>
</view>
</view>
</view>
@ -254,6 +258,14 @@ export default {
hasChecked() {
return resolveHasChecked(this.goodsInfo);
},
// 静态盘点拣货未完成(0.3.320):后端 report 会拒绝,前端先置灰上报入口
pickingPending() {
return !!this.goodsInfo.pickingPending;
},
pickingHintText() {
const locked = this.goodsInfo.lockedQuantity;
return locked === null || locked === undefined ? '拣货未完成,暂不能上报' : `拣货未完成(锁定 ${locked}),暂不能上报`;
},
// 账面数量(接口 system_quantity)
systemQuantityValue() {
return resolveSystemQuantity(this.goodsInfo);
@ -415,6 +427,13 @@ export default {
this.openEntryPopup(this.scanKeyword);
},
openEntryPopup(keyword) {
if (!this.editable) return;
// 静态盘点拣货未完成时后端拒绝上报,这里先拦住,避免录完数量才失败
if (this.pickingPending) {
uni.showToast({ title: '商品尚未完成拣货,请等待拣货完成', icon: 'none' });
this.speakMessage('拣货未完成,暂不能上报', { force: true, minInterval: 0 });
return;
}
this.pendingLocation = String(keyword || '').trim();
this.showEntryPopup = true;
},
@ -456,6 +475,12 @@ export default {
/** 上报(check.report:detail_id=该库位明细,location=库位) */
async submitReport(payload) {
if (!this.editable || this.submitting) return false;
// 静态盘点拣货未完成:后端会拦,前端先给明确提示
if (this.pickingPending) {
uni.showToast({ title: '商品尚未完成拣货,请等待拣货完成', icon: 'none' });
this.speakMessage('拣货未完成,暂不能上报', { force: true, minInterval: 0 });
return false;
}
if (!payload || (!payload.detailId && !payload.stockId)) {
uni.showToast({ title: '缺少盘点明细ID', icon: 'none' });
return false;
@ -771,6 +796,11 @@ export default {
color: #ff9800;
}
/* 静态盘点拣货未完成(后端会拒绝上报,需置灰上报入口) */
.inv-goods-card__flag--picking {
color: #e64340;
}
.inv-goods-card__line {
margin-top: 6rpx;
font-size: 34rpx;