- 退件收件:returnRecord 改为收件任务列表(默认只看本人创建、可切全部、新建任务默认「用户名 当天日期」、左滑删除),扫码登记抽到 ReturnScanPanel 组件并由 returnRecordScan 页面承载,登记带 return_received_task_id - 扫描记录:按任务 ID 过滤、底部剩余空间独立滚动(上拉/点击加载更多、下拉刷新)、标题显示任务登记总条数、原单退回显示货主名、常用备注抽屉(localStorage)、导出(异步任务+进度轮询+二维码/复制链接) - 库存盘点:库位/商品/单库位作业页拆分与 workDataDetail/workDataSpaceDetails/recordList 接入;App.vue 图片预览层 z-index、auth-guard 整页启动路由修复;apis.js 补 returnReceivedTask/returnReceived.list/export 与漏登记保护
432 lines
9.4 KiB
Vue
432 lines
9.4 KiB
Vue
<template>
|
||
<view class="work-card" :class="{ 'work-card--highlight': focused }">
|
||
<view class="work-card__head">
|
||
<view class="work-card__title-wrap">
|
||
<text class="work-card__title">{{ row.title || '--' }}</text>
|
||
<text v-if="row.subtitle" class="work-card__subtitle">{{ row.subtitle }}</text>
|
||
</view>
|
||
<text v-if="row.statusText" class="work-card__tag" :class="row.statusClass">{{ row.statusText }}</text>
|
||
</view>
|
||
|
||
<view v-if="row.meta && row.meta.length" class="work-card__meta">
|
||
<text v-for="item in row.meta" :key="item.label" class="work-card__meta-item">{{ item.label }}:{{ item.value }}</text>
|
||
</view>
|
||
|
||
<!-- 行级数量(明盘) -->
|
||
<view v-if="row.amount" class="work-card__amount">
|
||
<view class="work-card__metric">
|
||
<text class="work-card__label">账面数量</text>
|
||
<text class="work-card__value">{{ row.amount.systemText }}</text>
|
||
</view>
|
||
<view class="work-card__metric">
|
||
<text class="work-card__label">已盘数量</text>
|
||
<text class="work-card__value">{{ row.amount.checkedText }}</text>
|
||
</view>
|
||
<text v-if="row.amount.diffText" class="work-card__diff" :class="row.amount.diffClass">{{ row.amount.diffText }}</text>
|
||
</view>
|
||
|
||
<!-- 行级录入(库位任务的库位行 / 商品任务的商品行) -->
|
||
<view v-if="row.unit" class="work-card__input-row">
|
||
<text class="work-card__label">实盘数量</text>
|
||
<view class="work-input" :class="{ 'work-input--reported': row.unit.reported }">
|
||
<input
|
||
v-if="editable"
|
||
class="work-input__field"
|
||
type="number"
|
||
v-model="row.unit.inputValue"
|
||
placeholder="请输入"
|
||
placeholder-style="color: #c0c4cc;"
|
||
@blur="$emit('report', row.unit)"
|
||
@confirm="$emit('report', row.unit)"
|
||
/>
|
||
<text
|
||
v-else
|
||
class="work-input__readonly"
|
||
:class="{ 'work-input__readonly--empty': !row.unit.inputValue }"
|
||
>{{ row.unit.inputValue || '--' }}</text>
|
||
<text v-if="row.unit.reported" class="work-card__checked">
|
||
<u-icon name="checkmark-circle-fill" size="32rpx" color="#18a058"></u-icon>
|
||
</text>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 子项:space=该库位下的商品;goods=该商品的各库位记录;location=该库位的作业记录 -->
|
||
<view v-if="row.children && row.children.length" class="work-card__children">
|
||
<view
|
||
v-for="child in row.children"
|
||
:id="`work-${child.key}`"
|
||
:key="child.key"
|
||
class="work-child"
|
||
:class="{ 'work-child--active': !!focusedKey && child.key === focusedKey }"
|
||
>
|
||
<view class="work-child__main">
|
||
<text class="work-child__title">{{ child.title }}</text>
|
||
<text v-if="child.subtitle" class="work-child__subtitle">{{ child.subtitle }}</text>
|
||
</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.amount" class="work-child__amount">
|
||
账面 {{ child.amount.systemText }} · 已盘 {{ child.amount.checkedText }}
|
||
</text>
|
||
<text v-else-if="child.quantityText !== ''" class="work-child__amount">实盘 {{ child.quantityText }}</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"
|
||
class="work-input__field"
|
||
type="number"
|
||
v-model="child.unit.inputValue"
|
||
placeholder="请输入"
|
||
placeholder-style="color: #c0c4cc;"
|
||
@blur="$emit('report', child.unit)"
|
||
@confirm="$emit('report', child.unit)"
|
||
/>
|
||
<text
|
||
v-else
|
||
class="work-input__readonly"
|
||
:class="{ 'work-input__readonly--empty': !child.unit.inputValue }"
|
||
>{{ child.unit.inputValue || '--' }}</text>
|
||
<text v-if="child.unit.reported" class="work-card__checked">
|
||
<u-icon name="checkmark-circle-fill" size="32rpx" color="#18a058"></u-icon>
|
||
</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
|
||
<!-- 行级动作(库位视图:添加商品 / 标记空库位) -->
|
||
<view v-if="editable && row.actions && row.actions.length" class="work-card__actions">
|
||
<view
|
||
v-for="action in row.actions"
|
||
:key="action.key"
|
||
class="work-card__action"
|
||
:class="{ 'work-card__action--danger': action.key === 'mark-empty' }"
|
||
@click="$emit('action', { row, key: action.key })"
|
||
>
|
||
<text class="work-card__action-text">{{ action.text }}</text>
|
||
</view>
|
||
</view>
|
||
</view>
|
||
</template>
|
||
|
||
<script>
|
||
/**
|
||
* 盘点作业行卡片(stock.check.workData)
|
||
* view = space → 行=库位,children=该库位下的任务商品(子项可录入)
|
||
* view = goods → 行=商品,children=各库位作业记录(行级可录入)
|
||
* view = location → 行=任务库位,children=已知/未知商品作业记录(行级可录入)
|
||
* 录入单元上报由父级处理:@report 回传 unit(detailId/location/inputValue)
|
||
*/
|
||
export default {
|
||
name: 'CountWorkCard',
|
||
props: {
|
||
row: {
|
||
type: Object,
|
||
default: () => ({})
|
||
},
|
||
editable: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
focused: {
|
||
type: Boolean,
|
||
default: false
|
||
},
|
||
// 子项定位高亮(按 child.key,如扫码定位到某个商品行)
|
||
focusedKey: {
|
||
type: String,
|
||
default: ''
|
||
}
|
||
}
|
||
};
|
||
</script>
|
||
|
||
<style lang="scss" scoped>
|
||
.work-card {
|
||
background: #ffffff;
|
||
border: 2rpx solid #ebedf2;
|
||
border-radius: 20rpx;
|
||
padding: 20rpx 28rpx;
|
||
margin-bottom: 20rpx;
|
||
box-shadow: 0 6rpx 20rpx rgba(31, 45, 61, 0.06);
|
||
transition: border-color 0.3s ease, background-color 0.3s ease;
|
||
}
|
||
|
||
.work-card--highlight {
|
||
border-color: #2979ff;
|
||
background: #eef4ff;
|
||
box-shadow: 0 6rpx 20rpx rgba(41, 121, 255, 0.22);
|
||
}
|
||
|
||
.work-card__head {
|
||
display: flex;
|
||
align-items: flex-start;
|
||
justify-content: space-between;
|
||
}
|
||
|
||
.work-card__title-wrap {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.work-card__title {
|
||
font-size: 38rpx;
|
||
font-weight: 600;
|
||
color: #303133;
|
||
line-height: 1.4;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.work-card__subtitle {
|
||
margin-top: 6rpx;
|
||
font-size: 30rpx;
|
||
color: #8a9099;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.work-card__tag {
|
||
flex-shrink: 0;
|
||
margin-left: 16rpx;
|
||
padding: 6rpx 14rpx;
|
||
border-radius: 8rpx;
|
||
font-size: 24rpx;
|
||
line-height: 1;
|
||
color: #909399;
|
||
background: #f5f7fa;
|
||
}
|
||
|
||
.work-card__tag--done {
|
||
color: #18a058;
|
||
background: #e8f7ee;
|
||
}
|
||
|
||
.work-card__tag--todo {
|
||
color: #ff9800;
|
||
background: #fff5e6;
|
||
}
|
||
|
||
.work-card__tag--unknown {
|
||
color: #e64340;
|
||
background: #fdecec;
|
||
}
|
||
|
||
.work-card__meta {
|
||
margin-top: 10rpx;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.work-card__meta-item {
|
||
margin-right: 24rpx;
|
||
font-size: 28rpx;
|
||
color: #909399;
|
||
}
|
||
|
||
.work-card__amount {
|
||
margin-top: 20rpx;
|
||
display: flex;
|
||
align-items: flex-end;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.work-card__metric {
|
||
flex: 1;
|
||
min-width: 0;
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.work-card__label {
|
||
font-size: 28rpx;
|
||
color: #8a9099;
|
||
}
|
||
|
||
.work-card__value {
|
||
margin-top: 8rpx;
|
||
font-size: 40rpx;
|
||
font-weight: 600;
|
||
color: #303133;
|
||
line-height: 1.3;
|
||
}
|
||
|
||
.work-card__diff {
|
||
margin-left: 16rpx;
|
||
padding: 6rpx 14rpx;
|
||
border-radius: 8rpx;
|
||
font-size: 26rpx;
|
||
font-weight: 600;
|
||
}
|
||
|
||
.work-card__diff--gain {
|
||
color: #18a058;
|
||
background: #e8f7ee;
|
||
}
|
||
|
||
.work-card__diff--loss {
|
||
color: #e64340;
|
||
background: #fdecec;
|
||
}
|
||
|
||
.work-card__diff--match {
|
||
color: #606266;
|
||
background: #f5f7fa;
|
||
}
|
||
|
||
.work-card__input-row {
|
||
margin-top: 20rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.work-card__input-row .work-card__label {
|
||
flex-shrink: 0;
|
||
margin-right: 20rpx;
|
||
}
|
||
|
||
.work-input {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 68rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
background: #f5f7fa;
|
||
border: 1rpx solid #ebeef5;
|
||
border-radius: 12rpx;
|
||
padding: 0 16rpx;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
.work-input--reported {
|
||
background: #e8f7ee;
|
||
border-color: #b7e4c7;
|
||
}
|
||
|
||
.work-input__field {
|
||
flex: 1;
|
||
min-width: 0;
|
||
height: 100%;
|
||
font-size: 36rpx;
|
||
color: #303133;
|
||
}
|
||
|
||
.work-input__readonly {
|
||
flex: 1;
|
||
min-width: 0;
|
||
font-size: 36rpx;
|
||
font-weight: 600;
|
||
color: #303133;
|
||
}
|
||
|
||
.work-input__readonly--empty {
|
||
color: #c0c4cc;
|
||
font-weight: 400;
|
||
}
|
||
|
||
.work-card__checked {
|
||
flex-shrink: 0;
|
||
margin-left: 10rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
}
|
||
|
||
.work-card__children {
|
||
margin-top: 16rpx;
|
||
border-top: 1rpx solid #f0f2f5;
|
||
}
|
||
|
||
.work-child {
|
||
padding: 16rpx 0;
|
||
border-bottom: 1rpx solid #f5f6f8;
|
||
|
||
&:last-child {
|
||
border-bottom: none;
|
||
padding-bottom: 0;
|
||
}
|
||
}
|
||
|
||
/* 扫码/输入定位到某个商品行时的高亮 */
|
||
.work-child--active {
|
||
background: #eef4ff;
|
||
border-radius: 8rpx;
|
||
}
|
||
|
||
.work-child__main {
|
||
display: flex;
|
||
flex-direction: column;
|
||
}
|
||
|
||
.work-child__title {
|
||
font-size: 32rpx;
|
||
color: #303133;
|
||
line-height: 1.4;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.work-child__subtitle {
|
||
margin-top: 4rpx;
|
||
font-size: 26rpx;
|
||
color: #909399;
|
||
word-break: break-all;
|
||
}
|
||
|
||
.work-child__side {
|
||
margin-top: 8rpx;
|
||
display: flex;
|
||
align-items: center;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.work-child__amount {
|
||
margin-left: 16rpx;
|
||
font-size: 28rpx;
|
||
color: #606266;
|
||
}
|
||
|
||
.work-child__side .work-card__amount {
|
||
margin-left: 16rpx;
|
||
}
|
||
|
||
.work-child__input {
|
||
margin-top: 12rpx;
|
||
}
|
||
|
||
.work-card__actions {
|
||
margin-top: 16rpx;
|
||
display: flex;
|
||
flex-wrap: wrap;
|
||
}
|
||
|
||
.work-card__action {
|
||
flex: 1 1 200rpx;
|
||
height: 72rpx;
|
||
margin: 8rpx 10rpx 0 0;
|
||
border-radius: 12rpx;
|
||
background: #eef4ff;
|
||
border: 1rpx solid #cfe1ff;
|
||
display: flex;
|
||
align-items: center;
|
||
justify-content: center;
|
||
|
||
&:active {
|
||
opacity: 0.88;
|
||
}
|
||
}
|
||
|
||
.work-card__action--danger {
|
||
background: #fff1f0;
|
||
border-color: #ffccc7;
|
||
}
|
||
|
||
.work-card__action--danger .work-card__action-text {
|
||
color: #f56c6c;
|
||
}
|
||
|
||
.work-card__action-text {
|
||
font-size: 28rpx;
|
||
color: #2979ff;
|
||
}
|
||
</style>
|