feat: 打通出库作业链路

This commit is contained in:
zgw
2026-06-24 09:13:18 +08:00
parent a3c023a8d3
commit 1af5b3cbd3
141 changed files with 17337 additions and 1065 deletions

View File

@@ -1,18 +1,42 @@
<template>
<view class="page-container">
<!-- 任务信息 -->
<view class="task-info" v-if="taskNo">
<text class="task-label">任务编号</text>
<text class="task-value">{{ taskNo }}</text>
<view class="task-info" v-if="stockinId || taskNo">
<text class="task-label">入库主单</text>
<text class="task-value">{{ documentN || stockinId || taskNo }}</text>
</view>
<!-- 托盘信息 -->
<view class="form-section">
<text class="form-title">托盘信息</text>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请输入托盘号" />
<text class="form-label">仓库</text>
<picker class="form-picker" mode="selector" :range="warehouseOptions" range-key="warehouseName"
:value="warehouseIndex" :disabled="bindSuccess" @change="handleWarehouseChange">
<view class="picker-value" :class="{ placeholder: !warehouseId }">
{{ selectedWarehouseName || '请选择仓库' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">入库点位</text>
<picker class="form-picker" mode="selector" :range="stationPointOptions" range-key="pointName"
:value="stationPointIndex" :disabled="bindSuccess || !warehouseId || !trayCode" @change="handleStationPointChange">
<view class="picker-value" :class="{ placeholder: !stationPointId }">
{{ selectedStationPointName || '请选择入库点位' }}
</view>
</picker>
</view>
<view class="form-item">
<text class="form-label">托盘号</text>
<input class="form-input" v-model="trayCode" placeholder="请扫描托盘号" />
</view>
</view>
<!-- 绑盘状态提示 -->
<view class="bind-status" v-if="bindSuccess">
<view class="bind-status-title">入库作业已生成</view>
<view class="bind-status-desc">物料已写入托盘绑定信息,并已生成入库作业。</view>
</view>
<!-- 扫码添加物料 -->
@@ -30,29 +54,78 @@
</view>
</view>
<!-- 当前扫码物料信息(待添加) -->
<view class="form-section" v-if="currentMaterial">
<text class="form-title">物料信息</text>
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ currentMaterial.productId }}</text>
<!-- 主单下待绑盘子单 -->
<view class="list-section" v-if="stockinId">
<view class="section-header">
<text class="section-title">子单物料({{ availableDetailList.length }} 条)</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ currentMaterial.productName }}</text>
<view class="detail-empty" v-if="availableDetailList.length === 0">
<text class="empty-text">当前主单暂无待绑盘子单</text>
</view>
<view class="info-row">
<text class="info-label">子单号</text>
<text class="info-value">{{ currentMaterial.stockinDetailId }}</text>
<view class="detail-card" v-for="(detail, index) in availableDetailList" :key="detail.stockinDetailId || index"
@click="selectDetail(detail)">
<view class="detail-row">
<text class="detail-label">子单号</text>
<text class="detail-value">{{ detail.stockinDetailId }}</text>
</view>
<view class="detail-row">
<text class="detail-label">物料编码</text>
<text class="detail-value">{{ detail.productId }}</text>
</view>
<view class="detail-row">
<text class="detail-label">物料名称</text>
<text class="detail-value">{{ detail.productName }}</text>
</view>
<view class="detail-row">
<text class="detail-label">待绑数量</text>
<text class="detail-value highlight">{{ getAvailableRemainQty(detail) }}</text>
</view>
<view class="detail-action">选择并填写数量</view>
</view>
<view class="form-item">
<text class="form-label">绑定数量</text>
<input class="form-input" v-model="currentQty" type="number" placeholder="请输入绑定数量" />
</view>
<!-- 数量填写弹窗 -->
<view class="quantity-modal-mask" v-if="showQuantityPopup" @click="closeQuantityPopup">
<view class="quantity-modal" @click.stop>
<view class="modal-header">
<text class="modal-title">选择并填写数量</text>
<text class="modal-close" @click="closeQuantityPopup">×</text>
</view>
<view class="modal-body" v-if="currentMaterial">
<view class="info-row">
<text class="info-label">物料编码</text>
<text class="info-value">{{ currentMaterial.productId }}</text>
</view>
<view class="info-row">
<text class="info-label">物料名称</text>
<text class="info-value">{{ currentMaterial.productName }}</text>
</view>
<view class="info-row">
<text class="info-label">子单号</text>
<text class="info-value">{{ currentMaterial.stockinDetailId }}</text>
</view>
<view class="info-row">
<text class="info-label">入库单号</text>
<text class="info-value">{{ currentMaterial.stockinId || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">批次</text>
<text class="info-value">{{ currentMaterial.lotNo || '-' }}</text>
</view>
<view class="info-row">
<text class="info-label">待绑数量</text>
<text class="info-value highlight">{{ currentRemainQty }}</text>
</view>
<view class="modal-form-item">
<text class="modal-form-label">本次绑定数量</text>
<input class="modal-form-input" v-model="currentQty" type="number" placeholder="请修改本次绑定数量" />
</view>
</view>
<view class="modal-actions">
<button class="modal-btn modal-btn-cancel" @click="closeQuantityPopup">取消</button>
<button class="modal-btn modal-btn-confirm" @click="addItem">加入列表</button>
</view>
</view>
<button class="btn-add" @click="addItem">
<uni-icons type="plus" size="16" color="#fff"></uni-icons>
<text class="btn-add-text">加入列表</text>
</button>
</view>
<!-- 已添加物料列表 -->
@@ -75,7 +148,7 @@
<text class="item-value highlight">{{ item.quantity }}</text>
</view>
</view>
<view class="item-delete" @click="removeItem(index)">
<view class="item-delete" :class="{ disabled: bindSuccess }" @click="removeItem(index)">
<uni-icons type="trash" size="20" color="#f5222d"></uni-icons>
</view>
</view>
@@ -88,12 +161,8 @@
<!-- 操作按钮 -->
<view class="btn-section">
<button class="btn btn-primary" :disabled="items.length === 0 || !trayCode" @click="submitBindTrayAction">
确认绑盘({{ items.length }} 种物料)
</button>
<button class="btn btn-success" :disabled="items.length === 0 || !trayCode" @click="submitAddInJobAction">
生成入库作业
<button class="btn btn-primary" :disabled="items.length === 0 || !trayCode || !warehouseId || !stationPointId || bindSuccess" @click="submitBindTrayAction">
{{ bindSuccess ? '已生成入库作业' : '确认绑盘并生成作业(' + items.length + ' 种物料)' }}
</button>
<button class="btn btn-default" @click="resetAll">全部重置</button>
</view>
@@ -101,27 +170,229 @@
</template>
<script>
import { getMaterialByDetailId, submitBindTray,submitAddInJob } from '@/api/warehouse/inbound'
import { getInboundDetailList, getInboundStationPointOptions, getMaterialByDetailId, getWarehouseOptions, submitBindTrayAndAddInJob } from '@/api/warehouse/inbound'
export default {
data() {
return {
taskNo: '',
stockinId: '',
documentN: '',
warehouseId: '',
warehouseName: '',
warehouseIndex: 0,
warehouseOptions: [],
stationPointId: '',
stationPointName: '',
stationPointIndex: 0,
stationPointOptions: [],
trayCode: '',
// 当前扫码
barcode: '',
currentMaterial: null,
currentRemainQty: 0,
currentQty: '',
showQuantityPopup: false,
// 已完成绑盘并生成入库作业时保持页面状态,便于操作人员核对结果。
bindSuccess: false,
// 当前主单下待绑盘子单,操作人员选择子单后再修改本次绑定数量。
detailList: [],
// 已加入列表的物料
items: []
}
},
computed: {
selectedWarehouseName() {
if (this.warehouseName) {
return this.warehouseName
}
var selected = this.warehouseOptions[this.warehouseIndex]
return selected && selected.warehouseId === this.warehouseId ? selected.warehouseName : ''
},
selectedStationPointName() {
if (this.stationPointName) {
return this.stationPointName
}
var selected = this.stationPointOptions[this.stationPointIndex]
return selected && selected.pointId === this.stationPointId ? (selected.pointName || selected.pointId) : ''
},
availableDetailList() {
return this.detailList.filter(function(detail) {
return this.getAvailableRemainQty(detail) > 0
}.bind(this))
}
},
watch: {
trayCode: function() {
if (this.bindSuccess) {
return
}
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
this.loadStationPointOptions()
}
},
onLoad(options) {
if (options.taskNo) {
this.taskNo = options.taskNo
}
if (options.stockinId) {
this.stockinId = decodeURIComponent(options.stockinId)
}
if (options.documentN) {
this.documentN = decodeURIComponent(options.documentN)
}
if (options.warehouseId) {
this.warehouseId = decodeURIComponent(options.warehouseId)
}
if (options.warehouseName) {
this.warehouseName = decodeURIComponent(options.warehouseName)
}
if (options.stationPointId) {
this.stationPointId = decodeURIComponent(options.stationPointId)
}
this.loadWarehouseOptions()
if (this.warehouseId) {
this.loadStationPointOptions()
}
if (this.stockinId) {
this.loadDetailList()
}
if (options.detailId) {
this.barcode = decodeURIComponent(options.detailId)
this.handleBarcode()
}
},
methods: {
loadWarehouseOptions() {
var that = this
getWarehouseOptions().then(function(res) {
that.warehouseOptions = res.data || res.rows || []
that.syncWarehouseIndex()
if (that.warehouseId) {
that.loadStationPointOptions()
}
}).catch(function() {
that.warehouseOptions = []
})
},
syncWarehouseIndex() {
if (!this.warehouseId || this.warehouseOptions.length === 0) {
return
}
for (var i = 0; i < this.warehouseOptions.length; i++) {
if (this.warehouseOptions[i].warehouseId === this.warehouseId) {
this.warehouseIndex = i
this.warehouseName = this.warehouseOptions[i].warehouseName
return
}
}
},
handleWarehouseChange(e) {
if (this.bindSuccess) {
this.$modal.msg('托盘已绑定,不能修改仓库')
return
}
var index = Number(e.detail.value)
var selected = this.warehouseOptions[index]
if (!selected) {
return
}
this.warehouseIndex = index
this.warehouseId = selected.warehouseId
this.warehouseName = selected.warehouseName
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
this.loadStationPointOptions()
},
loadStationPointOptions() {
var that = this
if (!this.warehouseId || !this.trayCode) {
this.stationPointOptions = []
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
return
}
getInboundStationPointOptions(this.warehouseId, this.trayCode).then(function(res) {
that.stationPointOptions = res.data || res.rows || []
that.syncStationPointIndex()
}).catch(function() {
that.stationPointOptions = []
that.stationPointId = ''
that.stationPointName = ''
that.stationPointIndex = 0
})
},
syncStationPointIndex() {
if (!this.stationPointId || this.stationPointOptions.length === 0) {
return
}
for (var i = 0; i < this.stationPointOptions.length; i++) {
if (this.stationPointOptions[i].pointId === this.stationPointId) {
this.stationPointIndex = i
this.stationPointName = this.stationPointOptions[i].pointName || this.stationPointOptions[i].pointId
return
}
}
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
},
handleStationPointChange(e) {
if (this.bindSuccess) {
this.$modal.msg('托盘已绑定,不能修改入库点位')
return
}
var index = Number(e.detail.value)
var selected = this.stationPointOptions[index]
if (!selected) {
return
}
this.stationPointIndex = index
this.stationPointId = selected.pointId
this.stationPointName = selected.pointName || selected.pointId
},
loadDetailList() {
var that = this
getInboundDetailList({ stockinId: this.stockinId }).then(function(res) {
that.detailList = res.rows || []
}).catch(function() {
that.detailList = []
})
},
selectDetail(detail) {
if (this.bindSuccess) {
this.$modal.msg('托盘已绑定,不能再选择子单')
return
}
this.currentMaterial = detail
this.barcode = detail.stockinDetailId
this.currentRemainQty = this.getAvailableRemainQty(detail)
if (this.currentRemainQty <= 0) {
this.$modal.msg('该子单待绑数量已满')
return
}
this.currentQty = this.currentRemainQty > 0 ? String(this.currentRemainQty) : ''
this.showQuantityPopup = true
},
closeQuantityPopup() {
this.showQuantityPopup = false
this.currentMaterial = null
this.currentRemainQty = 0
this.currentQty = ''
},
// 调用摄像头扫码
startScan() {
var that = this
@@ -144,15 +415,57 @@
var that = this
getMaterialByDetailId(this.barcode).then(function(res) {
that.currentMaterial = res.data
that.currentQty = res.data.quantity ? String(res.data.quantity) : ''
if (res.data && res.data.stockinId && !that.stockinId) {
that.stockinId = res.data.stockinId
}
that.currentRemainQty = that.getAvailableRemainQty(res.data)
if (that.currentRemainQty <= 0) {
that.currentMaterial = null
that.currentQty = ''
that.showQuantityPopup = false
that.$modal.msg('该子单待绑数量已满')
return
}
that.currentQty = that.currentRemainQty > 0 ? String(that.currentRemainQty) : ''
that.showQuantityPopup = true
that.$modal.msgSuccess('物料信息获取成功')
}).catch(function() {
that.currentMaterial = null
that.currentRemainQty = 0
that.currentQty = ''
that.showQuantityPopup = false
that.$modal.msg('未找到该入库子单信息')
})
},
getRemainQty(material) {
var quantity = Number(material && material.quantity) || 0
var scanNum = Number(material && material.scanNum) || 0
var assignNum = Number(material && material.assignNum) || 0
var usedNum = scanNum > 0 ? scanNum : assignNum
var remainQty = quantity - usedNum
return remainQty > 0 ? remainQty : 0
},
getLocalBindQty(stockinDetailId) {
if (this.bindSuccess || !stockinDetailId) {
return 0
}
return this.items.reduce(function(total, item) {
if (item.stockinDetailId === stockinDetailId) {
return total + (Number(item.quantity) || 0)
}
return total
}, 0)
},
getAvailableRemainQty(material) {
var remainQty = this.getRemainQty(material)
var localBindQty = this.getLocalBindQty(material && material.stockinDetailId)
var availableQty = remainQty - localBindQty
return availableQty > 0 ? availableQty : 0
},
// 将当前物料加入绑定列表
addItem() {
if (!this.currentMaterial) {
@@ -163,36 +476,56 @@
this.$modal.msg('请输入有效的绑定数量')
return
}
// 检查是否已存在相同子单
var exists = this.items.some(function(i) {
if (Number(this.currentQty) > Number(this.currentRemainQty)) {
this.$modal.msg('绑定数量不能超过待绑数量')
return
}
var currentQty = Number(this.currentQty)
var exists = this.items.find(function(i) {
return i.stockinDetailId === this.currentMaterial.stockinDetailId
}.bind(this))
if (exists) {
this.$modal.msg('该物料已在列表中,请勿重复添加')
return
exists.quantity = Number(exists.quantity || 0) + currentQty
} else {
this.items.push({
stockinDetailId: this.currentMaterial.stockinDetailId,
stockinId: this.currentMaterial.stockinId,
productId: this.currentMaterial.productId,
productName: this.currentMaterial.productName,
lotNo: this.currentMaterial.lotNo,
quantity: currentQty
})
}
this.items.push({
stockinDetailId: this.currentMaterial.stockinDetailId,
productId: this.currentMaterial.productId,
productName: this.currentMaterial.productName,
quantity: Number(this.currentQty)
})
// 清空当前扫码区,继续扫下一个
this.barcode = ''
this.currentMaterial = null
this.currentRemainQty = 0
this.currentQty = ''
this.showQuantityPopup = false
this.$modal.msgSuccess('已加入列表')
},
// 从列表中移除某条物料
removeItem(index) {
if (this.bindSuccess) {
this.$modal.msg('托盘已绑定,不能再移除物料')
return
}
this.items.splice(index, 1)
},
// 提交绑盘
submitBindTrayAction() {
if (!this.trayCode) {
this.$modal.msg('请输入托盘号')
this.$modal.msg('请扫描托盘号')
return
}
if (!this.warehouseId) {
this.$modal.msg('请选择仓库')
return
}
if (!this.stationPointId) {
this.$modal.msg('请选择入库点位')
return
}
if (this.items.length === 0) {
@@ -201,6 +534,8 @@
}
var data = {
trayCode: this.trayCode,
warehouseId: this.warehouseId,
stationPointId: this.stationPointId,
items: this.items.map(function(i) {
return {
stockinDetailId: i.stockinDetailId,
@@ -210,37 +545,43 @@
})
}
var that = this
submitBindTray(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '入库绑盘成功')
that.resetAll()
}).catch(function() {})
},
submitAddInJobAction() {
if (!this.trayCode) {
this.$modal.msg('请输入托盘号')
return
}
if (this.items.length === 0) {
this.$modal.msg('请至少添加一种物料')
return
}
var data = {
trayCode: this.trayCode,
}
var that = this
submitAddInJob(data).then(function(res) {
that.$modal.msgSuccess(res.msg || '生成入库作业成功')
that.resetAll()
this.$modal.confirm('是否确认提交绑盘信息?').then(function() {
return that.$modal.confirm('确认后将立即生成入库作业,是否继续?')
}).then(function() {
return submitBindTrayAndAddInJob(data)
}).then(function(res) {
that.$modal.msgSuccess(res.msg || '绑盘并生成入库作业成功')
that.bindSuccess = true
if (that.stockinId) {
that.loadDetailList()
}
that.barcode = ''
that.currentMaterial = null
that.currentRemainQty = 0
that.currentQty = ''
that.showQuantityPopup = false
}).catch(function() {})
},
// 全部重置
resetAll() {
this.stockinId = ''
this.documentN = ''
this.warehouseId = ''
this.warehouseName = ''
this.warehouseIndex = 0
this.stationPointId = ''
this.stationPointName = ''
this.stationPointIndex = 0
this.stationPointOptions = []
this.trayCode = ''
this.barcode = ''
this.currentMaterial = null
this.currentRemainQty = 0
this.currentQty = ''
this.showQuantityPopup = false
this.bindSuccess = false
this.detailList = []
this.items = []
}
}
@@ -518,4 +859,225 @@
color: #666;
border: 1rpx solid #d9d9d9;
}
.form-picker {
flex: 1;
min-height: 72rpx;
display: flex;
align-items: center;
}
.picker-value {
width: 100%;
font-size: 28rpx;
color: #333;
padding: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
background: #fff;
}
.picker-value.placeholder {
color: #c0c4cc;
}
.bind-status {
background: #f6ffed;
border: 1rpx solid #b7eb8f;
border-radius: 16rpx;
padding: 24rpx;
margin-bottom: 24rpx;
}
.bind-status-title {
font-size: 30rpx;
font-weight: 600;
color: #389e0d;
margin-bottom: 8rpx;
}
.bind-status-desc {
font-size: 26rpx;
color: #52c41a;
}
.detail-empty {
padding: 40rpx 0;
display: flex;
justify-content: center;
}
.detail-card {
background: #fafafa;
border: 1rpx solid #f0f0f0;
border-radius: 12rpx;
padding: 22rpx;
margin-bottom: 18rpx;
}
.detail-row {
display: flex;
justify-content: space-between;
padding: 6rpx 0;
}
.detail-label {
font-size: 24rpx;
color: #999;
}
.detail-value {
flex: 1;
margin-left: 20rpx;
text-align: right;
font-size: 24rpx;
color: #333;
word-break: break-all;
}
.detail-action {
margin-top: 14rpx;
padding-top: 14rpx;
border-top: 1rpx solid #f0f0f0;
font-size: 24rpx;
color: #1890ff;
text-align: right;
}
.item-delete.disabled {
opacity: 0.45;
}
/* 仓库下拉和普通输入框在同一表单行内保持等宽。 */
.form-picker,
.form-input {
flex: 1;
width: 0;
min-width: 0;
box-sizing: border-box;
}
.picker-value {
width: 100%;
box-sizing: border-box;
}
/* uni-app H5 会把 picker 内部再包一层无 class 节点,边框放在外层 picker 才能和输入框等宽。 */
.form-item .form-picker,
.form-item uni-picker.form-picker {
flex: 1;
width: 0;
min-width: 0;
min-height: 72rpx;
padding: 16rpx;
border: 1rpx solid #e8e8e8;
border-radius: 8rpx;
background: #fff;
box-sizing: border-box;
}
.form-item .form-picker .picker-value,
.form-item uni-picker.form-picker .picker-value {
display: flex;
align-items: center;
width: auto !important;
min-width: 0;
padding: 0 !important;
border: 0 !important;
background: transparent !important;
box-sizing: border-box;
}
.quantity-modal-mask {
position: fixed;
left: 0;
right: 0;
top: 0;
bottom: 0;
z-index: 999;
display: flex;
align-items: center;
justify-content: center;
padding: 32rpx;
background: rgba(0, 0, 0, 0.45);
box-sizing: border-box;
}
.quantity-modal {
width: 100%;
max-width: 680rpx;
max-height: 86vh;
overflow-y: auto;
background: #fff;
border-radius: 16rpx;
box-shadow: 0 16rpx 48rpx rgba(0, 0, 0, 0.18);
}
.modal-header {
display: flex;
align-items: center;
justify-content: space-between;
padding: 28rpx;
border-bottom: 1rpx solid #f0f0f0;
}
.modal-title {
font-size: 30rpx;
font-weight: 600;
color: #333;
}
.modal-close {
width: 48rpx;
height: 48rpx;
line-height: 48rpx;
text-align: center;
font-size: 40rpx;
color: #999;
}
.modal-body {
padding: 24rpx 28rpx;
}
.modal-form-item {
margin-top: 24rpx;
}
.modal-form-label {
display: block;
margin-bottom: 12rpx;
font-size: 26rpx;
color: #666;
}
.modal-form-input {
width: 100%;
height: 72rpx;
padding: 0 20rpx;
border: 1rpx solid #d9d9d9;
border-radius: 8rpx;
font-size: 28rpx;
box-sizing: border-box;
}
.modal-actions {
display: flex;
gap: 20rpx;
padding: 20rpx 28rpx 28rpx;
}
.modal-btn {
flex: 1;
height: 72rpx;
line-height: 72rpx;
border-radius: 8rpx;
font-size: 28rpx;
}
.modal-btn-cancel {
color: #666;
background: #f5f5f5;
}
.modal-btn-confirm {
color: #fff;
background: #1890ff;
}
</style>

View File

@@ -42,26 +42,26 @@
<view class="task-card" v-for="(item, index) in taskList" :key="index"
@click="handleTask(item)">
<view class="task-header">
<text class="task-type">{{ item.typeName }}</text>
<text class="task-no">{{ item.taskNo }}</text>
<text class="task-type">{{ getInTypeName(item) }}</text>
<text class="task-no">{{ item.documentN || item.stockinId }}</text>
</view>
<view class="task-body">
<view class="task-info-item">
<text class="info-label">物料编码</text>
<text class="info-value">{{ item.productId }}</text>
<text class="info-label">主单号</text>
<text class="info-value">{{ item.stockinId }}</text>
</view>
<view class="task-info-item">
<text class="info-label">物料名称</text>
<text class="info-value">{{ item.productName }}</text>
<text class="info-label">仓库</text>
<text class="info-value">{{ item.warehouseName || item.warehouseId || '-' }}</text>
</view>
<view class="task-info-item">
<text class="info-label">数量</text>
<text class="info-value">{{ item.quantity - item.assignNum }}</text>
<text class="info-label">供应商</text>
<text class="info-value">{{ item.supplierName || item.counterpart || '-' }}</text>
</view>
</view>
<view class="task-footer">
<text class="task-time">{{ item.createTime }}</text>
<view class="task-status" :class="item.statusClass">{{ item.statusName }}</view>
<text class="task-time">{{ getDisplayDate(item) }}</text>
<view class="task-status" :class="item.statusClass">{{ item.statusName || getStatusName(item.status) }}</view>
</view>
</view>
</view>
@@ -70,7 +70,7 @@
</template>
<script>
import { getInboundTaskList } from '@/api/warehouse/inbound'
import { getInboundStockinList } from '@/api/warehouse/inbound'
import UniIcons from "../../../uni_modules/uni-icons/components/uni-icons/uni-icons.vue";
export default {
@@ -91,7 +91,7 @@
this.$tab.navigateTo(url)
},
loadTasks() {
getInboundTaskList().then(res => {
getInboundStockinList().then(res => {
this.taskList = res.rows || []
}).catch(() => {
this.taskList = []
@@ -101,12 +101,33 @@
this.loadTasks()
this.$modal.showToast('刷新成功')
},
handleTask(item) {
if (item.type === 'bindTray') {
this.$tab.navigateTo('/pages/warehouse/inbound/bindTray?taskNo=' + item.taskNo)
} else if (item.type === 'supply') {
this.$tab.navigateTo('/pages/warehouse/inbound/supply?taskNo=' + item.taskNo)
getInTypeName(item) {
return item.typeName || item.inTypeName || '入库单'
},
getStatusName(status) {
var map = {
'1': '创建',
'2': '审核',
'3': '执行',
'4': '完成',
'5': '作废'
}
return map[String(status)] || '待处理'
},
getDisplayDate(item) {
return item.documentDat || item.createDate || item.createDat || '-'
},
handleTask(item) {
if (item.type === 'supply') {
this.$tab.navigateTo('/pages/warehouse/inbound/supply?taskNo=' + (item.taskNo || ''))
return
}
var params = []
if (item.stockinId) params.push('stockinId=' + encodeURIComponent(item.stockinId))
if (item.warehouseId) params.push('warehouseId=' + encodeURIComponent(item.warehouseId))
if (item.warehouseName) params.push('warehouseName=' + encodeURIComponent(item.warehouseName))
if (item.documentN) params.push('documentN=' + encodeURIComponent(item.documentN))
this.$tab.navigateTo('/pages/warehouse/inbound/bindTray' + (params.length ? '?' + params.join('&') : ''))
}
}
}