Compare commits

...

7 Commits

Author SHA1 Message Date
liufumingren
106162d43f feat(盘点): 库位模式商品行接入待拣货标记,未拣完置灰录入框
space 视图(stock.check.workData / workDataSpaceDetails)的 goods 子项已返回
picking_completed / locked_quantity,据此补齐库位模式的静态拣货提示:

- countModel.normalizeSpaceWorkRow:goods 子项输出 pickingPending/lockedQuantity,
  录入单元带 pickingPending;库位行输出 pickingPendingCount
- CountWorkCard:子项显示红色「待拣货」标记 + 「拣货未完成(锁定 N)」,
  未拣完时不再渲染输入框,改为只读「待拣货」
- inventoryCountSpace:顶部提示「N 项商品尚未完成拣货,仅这些商品暂不能上报」,
  handleWorkReport 按商品拦截并语音播报
- 拦截粒度仅为商品行:同库位其他商品照常录入,库位行本身不拦截
- 无 picking_completed 字段(普通盘点/旧后端)时行为不变
- 版本升级至 1.0.137

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:58:54 +08:00
liufumingren
d5607f58b1 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>
2026-10-28 16:33:22 +08:00
liufumingren
9c3ee18cdd Merge origin/main:并入 0.3.318 账面口径,保留未盘库位占位行
线上 f4c40e4 与本地的 stock_id 入口/workDataDetail 改造重叠且为超集,
冲突文件(countModel.js、inventoryCountDetail.vue、inventoryCountGoods.vue)
取线上版本为基准,仅补回本地独有逻辑:

- countModel.normalizeGoodsDetailInfo:库位明细保留未盘占位行(checked 标记、
  实盘置空),记账条数/最近上报仍只统计已盘库位;allLocations 明细ID映射沿用线上
- inventoryCountGoods:resolveHasChecked 改为「有记录 或 存在已盘库位」,
  「共 N 条」按已盘库位数统计
- apis.js 注释同步(detail_id 可选、商品钻取 summary+rows)
- 版本升级至 1.0.135

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:25:31 +08:00
liufumingren
66ca2107b2 chore(release): 版本升级至 1.0.134
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 16:23:12 +08:00
liufumingren
d57cc44bdd feat(盘点): 商品模式上报改为任务ID+stock_id,不再传 detail_id
- 商品视图点击改用 stock_id 进入商品作业页(goods 汇总视图行不再返回明细ID)
- 商品作业页 workDataDetail 改传 id + stock_id,并适配 summary + rows 新返回结构
- check.report 商品模式只传 id + stock_id + space_id,detail_id 改为可选(库位明细行仍必传)
- 库位/space 模式上报逻辑保持不变

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 07:36:33 +08:00
liufumingren
a4bfd09bff chore(release): 发布上传配置改为本地文件,不再纳入版本管理
config/deploy.json 含服务器地址、远程目录与私钥路径,且路径指向提交者本机,
其他人打包执行 pack.ps1 的发布步骤会因私钥不存在而中断。

- git rm --cached config/deploy.json(本地文件保留)
- .gitignore 增加 config/deploy.json,与 config/android.json 同口径
- 模板仍由 config/deploy.example.json 提供,README 已说明 deploy.json 不提交

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 00:13:12 +08:00
liufumingren
3cf709c196 fix(盘点): 商品作业页展示未盘库位占位行,恢复待盘库位可见性
- normalizeGoodsDetailInfo 不再过滤未盘库位:每个库位带 checked 标记,
  未盘行实盘按 -- 展示(后端 quantity 回 0,直接用会误算「账实相符」),不参与盈亏
- recordCount / lastCheckedAt 仍只统计真实作业记录,口径不变
- 商品作业页 resolveHasChecked 改为「有记录 或 存在已盘库位」,
  避免占位行导致卡片误显示已盘 0
- 「共 N 条」按已盘库位数统计,未盘占位行不计入

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
2026-10-28 00:08:22 +08:00
10 changed files with 165 additions and 33 deletions

2
.gitignore vendored
View File

@ -45,6 +45,8 @@ static/uview/
# 签名密钥与本地配置(含密码)不提交
android-offline/keystore/
config/android.json
# 发布上传配置(含服务器地址与私钥路径,每台机器不同;模板见 config/deploy.example.json)
config/deploy.json
# DCloud 离线 SDK(体积大,按需下载解压,勿提交)
android-offline/SDK/
# 原生工程的本地产物(工程源码本身提交,保证发布基座一致)

View File

@ -1,11 +0,0 @@
{
"android": {
"host": "112.124.21.102",
"user": "pdadev",
"keyPath": "C:/Users/Administrator/.ssh/pdadev_112.124.21.102_id_ed25519",
"port": 22,
"remoteDir": "/www/wwwroot/dl/pda",
"downloadUrlPrefix": "http://dl.wms.gztbyc.com/pda",
"latestJsonName": "latest.json"
}
}

View File

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

View File

@ -462,9 +462,11 @@ export default {
method: "POST",
isSystemApi: true
},
// 单条盘点明细的作业数据(入参仅 detail_id,兼容 detailId)——库位明细返回 location 单行结构
// (detail_id/location_code/location_name/status/has_unknown/is_empty/checked_at/checkers/goods);
// 商品明细返回商品行结构(item_name/barcode/spec/store_name/images + 明盘 system/checked/diff_quantity);
// 盘点作业明细:入参二选一——① detail_id(盘点明细ID,兼容 detailId,库位明细必传);
// ② id(任务ID)+ stock_id(商品库存ID,兼容 stockId;goods 汇总视图行不再返回明细ID,商品钻取用)
// 库位明细返回 location 单行结构(detail_id/location_code/location_name/status/has_unknown/is_empty/checked_at/checkers/goods);
// 商品钻取返回 { stock_id/item_code/item_name/spec/store_name/barcode/images,
// summary(明盘:system_quantity/checked_quantity/diff_quantity/is_diff), rows(按库位分行) };
// warehouse_id 由服务端注入;仅 approved/checking 可拉取
workDataDetail: {
path: "stock.check.workDataDetail",
@ -482,6 +484,7 @@ export default {
isSystemApi: true
},
// 盘点作业上报:单条明细实盘数量(quantity>=0 整数)
// detail_id 可选:库位明细行必传;商品模式只传 id + stock_id + space_id,明细由服务端反查
report: {
path: "stock.check.report",
auth: true,

View File

@ -2,8 +2,8 @@
"name" : "WMS_PDA",
"appid" : "__UNI__0B3DAD3",
"description" : "多平台快速开发的UI框架",
"versionName" : "1.0.132",
"versionCode" : 1000132,
"versionName" : "1.0.137",
"versionCode" : 1000137,
"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

@ -66,16 +66,18 @@
</view>
<view class="work-child__side">
<text v-if="child.statusText" class="work-card__tag" :class="child.statusClass">{{ child.statusText }}</text>
<text v-if="child.pickingPending" class="work-card__tag work-card__tag--picking">待拣货</text>
<text v-if="child.amount" class="work-child__amount">
{{ child.amount.systemLabel || '账面' }} {{ child.amount.systemText }} · 已盘 {{ child.amount.checkedText }}
</text>
<text v-else-if="child.quantityText !== ''" class="work-child__amount">实盘 {{ child.quantityText }}</text>
<text v-if="child.amount && child.amount.bookHint" class="work-child__hint">{{ child.amount.bookHint }}</text>
<text v-if="child.pickingPending" class="work-child__hint work-child__hint--picking">{{ pickingHint(child) }}</text>
</view>
<view v-if="child.unit" class="work-child__input">
<view class="work-input" :class="{ 'work-input--reported': child.unit.reported }">
<input
v-if="editable"
v-if="editable && !child.pickingPending"
class="work-input__field"
type="number"
v-model="child.unit.inputValue"
@ -84,6 +86,10 @@
@blur="$emit('report', child.unit)"
@confirm="$emit('report', child.unit)"
/>
<text
v-else-if="child.pickingPending"
class="work-input__readonly work-input__readonly--picking"
>待拣货</text>
<text
v-else
class="work-input__readonly"
@ -140,6 +146,13 @@ export default {
type: String,
default: ''
}
},
methods: {
// 静态盘点拣货未完成提示(带锁定量时一并显示)
pickingHint(child) {
const locked = child ? child.lockedQuantity : null;
return locked === null || locked === undefined ? '拣货未完成' : `拣货未完成(锁定 ${locked})`;
}
}
};
</script>
@ -215,6 +228,12 @@ export default {
background: #fdecec;
}
/* 静态盘点拣货未完成(后端会拒绝上报) */
.work-card__tag--picking {
color: #e64340;
background: #fdecec;
}
.work-card__meta {
margin-top: 10rpx;
display: flex;
@ -406,6 +425,16 @@ export default {
color: #b8811a;
}
/* 拣货未完成提示:红色(与账面口径提示区分) */
.work-child__hint--picking {
color: #e64340;
}
/* 拣货未完成时的录入框占位(不可录入) */
.work-input__readonly--picking {
color: #e64340;
}
.work-child__side .work-card__amount {
margin-left: 16rpx;
}

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 为另一口径参考值,两者不一致时给出提示文案。
@ -657,7 +677,7 @@ function buildWorkAmount(systemQuantity, checkedQuantity, diffQuantity, open, me
}
/** 录入单元:detailId + location + 输入值(original 用于判断是否已修改) */
function buildWorkUnit(detailId, location, currentQuantity, reported, stockId, spaceId) {
function buildWorkUnit(detailId, location, currentQuantity, reported, stockId, spaceId, pickingPending = false) {
const value = toNumberString(currentQuantity);
const done = !!reported;
return {
@ -669,7 +689,9 @@ function buildWorkUnit(detailId, location, currentQuantity, reported, stockId, s
inputValue: done ? value : '',
original: done ? value : '',
reported: done,
reporting: false
reporting: false,
// 静态盘点拣货未完成(0.3.320):录入框置灰,report 会被后端拒绝
pickingPending: !!pickingPending
};
}
@ -737,6 +759,7 @@ function normalizeSpaceWorkRow(item, index, open, options = {}) {
const checkedRaw = good.checked_quantity !== undefined ? good.checked_quantity : good.checkedQuantity;
const done = String(good.status || '').trim().toLowerCase() === 'checked';
const bookMeta = pickBookMeta(good, options.isStatic);
const pickingMeta = pickPickingMeta(good);
return {
key: `${spaceCode}-${detailId || goodIndex + 1}`,
title: firstValue(good, ['item_name', 'itemName']) || '--',
@ -750,8 +773,13 @@ function normalizeSpaceWorkRow(item, index, open, options = {}) {
open,
bookMeta
),
// 静态盘点拣货完成标记(0.3.320)
hasPickingFlag: pickingMeta.hasPickingFlag,
pickingCompleted: pickingMeta.pickingCompleted,
pickingPending: pickingMeta.pickingPending,
lockedQuantity: pickingMeta.lockedQuantity,
quantityText: '',
unit: buildWorkUnit(detailId, spaceCode, checkedRaw, done, firstValue(good, ['stock_id', 'stockId']), rowSpaceId)
unit: buildWorkUnit(detailId, spaceCode, checkedRaw, done, firstValue(good, ['stock_id', 'stockId']), rowSpaceId, pickingMeta.pickingPending)
};
});
// 库位统计(口径=商品条数):商品 status=checked 即该明细在该库位已有作业记录
@ -759,6 +787,8 @@ function normalizeSpaceWorkRow(item, index, open, options = {}) {
const checkedCount = rawGoods.filter(row => String((row && row.status) || '').trim().toLowerCase() === 'checked').length;
const uncheckedCount = Math.max(0, total - checkedCount);
const allDone = total > 0 && checkedCount === total;
// 静态盘点:该库位下拣货未完成的商品数(宫格与作业页提示用)
const pickingPendingCount = children.filter(child => child.pickingPending).length;
const spaceName = firstValue(source, ['custom_name', 'customName']);
return {
key: `space-${firstValue(source, ['id']) || spaceCode}`,
@ -788,6 +818,8 @@ function normalizeSpaceWorkRow(item, index, open, options = {}) {
unknownCount: 0,
checkedCount,
uncheckedCount,
// 静态盘点拣货未完成的商品数(>0 时宫格/作业页提示「待拣货」)
pickingPendingCount,
gridText: spaceName || spaceCode,
gridCode: spaceCode,
gridLabel: shortLocationLabel(spaceCode),
@ -824,6 +856,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 +897,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 +1130,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) || '';
@ -1104,7 +1144,7 @@ export function normalizeGoodsDetailInfo(row, mode, options = {}) {
const checkers = Array.isArray(checkersRaw) ? checkersRaw.filter(Boolean).join('、') : String(checkersRaw || '');
// 库位明细(每库位一行:账面 / 实盘 / 盈亏),顺便汇总记录条数与最近上报时间
// 未盘点库位只是任务范围占位(record_ids 空且无盘点人/上报时间),不作为「盘点记录」展示
// 未盘点库位是任务范围占位:保留展示以便看到待盘库位,但实盘按 -- 处理、不参与盈亏、不计入记录条数
const rawLocations = isDrillLayout
? (drillRows || [])
: (Array.isArray(source.locations) ? source.locations : []);
@ -1126,11 +1166,11 @@ export function normalizeGoodsDetailInfo(row, mode, options = {}) {
locationCode: firstValue(loc, ['location_code', 'locationCode']) || ''
};
});
const checkedLocations = rawLocations.filter(isCheckedLocation);
let recordCount = 0;
let lastCheckedAt = '';
const locations = checkedLocations.map((item, index) => {
const locations = rawLocations.map((item, index) => {
const loc = item && typeof item === 'object' ? item : {};
const checked = isCheckedLocation(loc);
const locationCode = firstValue(loc, ['location_code', 'locationCode']) || '';
const locationName = firstValue(loc, ['location_name', 'locationName']) || '';
const spaceId = firstValue(loc, ['space_id', 'location_id', 'locationId', 'spaceId']);
@ -1139,20 +1179,24 @@ export function normalizeGoodsDetailInfo(row, mode, options = {}) {
const recordIds = Array.isArray(loc.record_ids) ? loc.record_ids.filter(id => id !== null && id !== undefined && id !== '') : [];
const rowBook = pickBookMeta(loc);
const systemQuantity = toNumberOrNull(loc.system_quantity !== undefined ? loc.system_quantity : loc.systemQuantity);
// 实盘:旧结构为 quantity,钻取结构为 checked_quantity
const quantity = toNumberOrNull(
// 实盘:旧结构为 quantity,钻取结构为 checked_quantity;未盘库位后端可能回 0,直接展示会算出「账实相符」,因此按未盘置空
const quantity = checked ? toNumberOrNull(
loc.quantity !== undefined
? loc.quantity
: (loc.checked_quantity !== undefined ? loc.checked_quantity : loc.checkedQuantity)
);
) : null;
const checkedAt = firstValue(loc, ['checked_at', 'checkedAt']);
const checkerName = firstValue(loc, ['checker_name', 'checkerName']);
const rowBookInfo = resolveBookMeta(systemQuantity, rowBook);
recordCount += recordIds.length;
if (checkedAt && checkedAt > lastCheckedAt) lastCheckedAt = checkedAt;
if (checked) {
recordCount += recordIds.length;
if (checkedAt && checkedAt > lastCheckedAt) lastCheckedAt = checkedAt;
}
const diff = systemQuantity === null || quantity === null ? null : quantity - systemQuantity;
return {
key: `loc-${locationCode || index + 1}`,
// 该库位是否已盘(未盘占位行 checked=false:实盘 --、不可删除)
checked,
// 该库位对应的盘点明细ID(多库位商品上报时按行回传)
detailId: rowDetailId,
// 左滑删除用:整库位的记录 ID 列表(recordDelete 支持数组)
@ -1218,6 +1262,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>
@ -177,11 +181,12 @@ function resolveBookHint(goodsInfo) {
return amount && amount.bookHint ? amount.bookHint : '';
}
/** 是否已盘(有库位明细/作业记录) */
/** 是否已盘(有作业记录或已盘库位;未盘占位行不算) */
function resolveHasChecked(goodsInfo) {
const info = goodsInfo || {};
if (Array.isArray(info.locations) && info.locations.length) return true;
return Number(info.recordCount) > 0;
if (Number(info.recordCount) > 0) return true;
const locations = Array.isArray(info.locations) ? info.locations : [];
return locations.some(item => item && item.checked);
}
/** 已盘合计:优先接口 checked_quantity,缺失时用库位明细合计 */
@ -253,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);
@ -309,7 +322,8 @@ export default {
statusText: '',
statusClass: '',
meta,
goodsCount: locations.length,
// 「共 N 条」按实际已盘库位数统计(未盘占位行不计入)
goodsCount: locations.filter(item => item && item.checked).length,
unknownCount: 0,
children: locations
};
@ -413,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;
},
@ -454,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;
@ -769,6 +796,11 @@ export default {
color: #ff9800;
}
/* 静态盘点拣货未完成(后端会拒绝上报,需置灰上报入口) */
.inv-goods-card__flag--picking {
color: #e64340;
}
.inv-goods-card__line {
margin-top: 6rpx;
font-size: 34rpx;

View File

@ -34,6 +34,10 @@
<view v-if="!editable" class="inv-space-tip">当前盘点任务状态不可作业,仅可查看</view>
<view v-if="editable && pickingPendingCount" class="inv-space-tip">
静态盘点:{{ pickingPendingCount }} 项商品尚未完成拣货,仅这些商品暂不能上报
</view>
<view v-if="loading && !row" class="inv-space-tip">加载中...</view>
<!-- 该库位下的任务商品:逐条录入实盘数量并上报(check.report) -->
@ -108,6 +112,11 @@ export default {
progressText() {
if (!this.row) return '--';
return this.row.gridProgressText || `${this.row.goodsCount || 0} 项`;
},
// 静态盘点:本库位下拣货未完成的商品数(>0 时顶部提示)
pickingPendingCount() {
const children = this.row && Array.isArray(this.row.children) ? this.row.children : [];
return children.filter(child => child && child.pickingPending).length;
}
},
onLoad(options = {}) {
@ -227,6 +236,12 @@ export default {
// ===== 录入上报(check.report)=====
async handleWorkReport(unit) {
if (!this.editable || !unit || unit.reporting) return;
// 静态盘点拣货未完成:后端会拒绝上报,这里先给明确提示
if (unit.pickingPending) {
uni.showToast({ title: '商品尚未完成拣货,请等待拣货完成', icon: 'none' });
this.speakMessage('拣货未完成,暂不能上报', { force: true, minInterval: 0 });
return;
}
const raw = String(unit.inputValue || '').trim();
if (raw === '') return;
if (raw === String(unit.original || '')) return;