现场调试修改 入库 出库 放货重新分配货位
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="header">
|
||||
<text class="title">{{ $t('outbound.bindShelf.materialInfo') }}</text>
|
||||
<text class="title">物料信息</text>
|
||||
</view>
|
||||
|
||||
<view class="warehouse-select">
|
||||
@@ -9,7 +9,7 @@
|
||||
v-model="selectedWarehouse"
|
||||
:localdata="warehouseList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.bindShelf.selectWarehouse')"
|
||||
placeholder="请选择仓库"
|
||||
@change="handleWarehouseChange"
|
||||
/>
|
||||
</view>
|
||||
@@ -19,13 +19,13 @@
|
||||
v-model="selectedExit"
|
||||
:localdata="exitList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.bindShelf.selectExit')"
|
||||
placeholder="请选择出口"
|
||||
@change="handleExitChange"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<view class="loading-container" v-if="loading">
|
||||
<text class="loading-text">{{ $t('outbound.bindShelf.loading') }}</text>
|
||||
<text class="loading-text">加载中...</text>
|
||||
</view>
|
||||
|
||||
<view class="materials-list" v-else-if="materialList.length > 0">
|
||||
@@ -36,12 +36,12 @@
|
||||
</view>
|
||||
<view class="material-info">
|
||||
<view class="material-title">{{ item.productName }}</view>
|
||||
<view class="material-code">{{ $t('outbound.bindShelf.materialInfo') }}: {{ item.productId }}</view>
|
||||
<view class="material-code">物料信息: {{ item.productId }}</view>
|
||||
</view>
|
||||
</view>
|
||||
<view class="material-content">
|
||||
<view class="quantity-control">
|
||||
<text class="quantity-label">{{ $t('outbound.bindShelf.bindQuantity') }}</text>
|
||||
<text class="quantity-label">绑定数量</text>
|
||||
<input
|
||||
type="number"
|
||||
v-model="item.bindQuantity"
|
||||
@@ -54,18 +54,18 @@
|
||||
</view>
|
||||
|
||||
<view v-else class="no-data">
|
||||
<text>{{ $t('outbound.bindShelf.noMaterialInfo') }}</text>
|
||||
<text>暂无物料信息</text>
|
||||
</view>
|
||||
|
||||
<view class="button-group">
|
||||
<button class="bind-button" @click="openBindShelfPopup">{{ $t('outbound.bindShelf.bindShelf') }}</button>
|
||||
<button class="bind-button" @click="openBindShelfPopup">绑定料架</button>
|
||||
</view>
|
||||
|
||||
<!-- 绑定料架弹窗 -->
|
||||
<uni-popup ref="bindShelfPopup" type="center">
|
||||
<view class="popup-content">
|
||||
<view class="popup-header">
|
||||
<text class="popup-title">{{ $t('outbound.bindShelf.bindShelfTitle') }}</text>
|
||||
<text class="popup-title">绑定料架</text>
|
||||
<text class="popup-close" @click="closeBindShelfPopup">×</text>
|
||||
</view>
|
||||
|
||||
@@ -74,7 +74,7 @@
|
||||
<input
|
||||
type="text"
|
||||
v-model="shelfCode"
|
||||
:placeholder="$t('outbound.bindShelf.scanShelfCode')"
|
||||
placeholder="请扫描料架条码"
|
||||
class="scan-input"
|
||||
@input="fetchShelfInfo"
|
||||
@clear="handleClear"
|
||||
@@ -86,14 +86,13 @@
|
||||
|
||||
<view class="shelf-info" v-if="shelfInfo.length > 0">
|
||||
<view v-for="(item, index) in shelfInfo" :key="index" class="shelf-item">
|
||||
<text class="shelf-name">{{ item.productName || $t('outbound.bindShelf.unknownMaterial') }}</text>
|
||||
<text class="shelf-code">{{ item.productId || $t('outbound.bindShelf.noCode') }}</text>
|
||||
<text class="shelf-quantity">{{ item.quantity || $t('outbound.bindShelf.noQuantity') }}</text>
|
||||
<text class="shelf-name">{{ item.productName || '未知物料' }}</text>
|
||||
<text class="shelf-code">{{ item.productId || '无编码' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<view class="popup-footer">
|
||||
<button class="submit-button" @click="submitBindShelf">{{ $t('outbound.bindShelf.submit') }}</button>
|
||||
<button class="submit-button" @click="submitBindShelf">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
@@ -245,7 +244,7 @@ export default {
|
||||
this.materialList = (response.rows || []).map(item => ({
|
||||
...item,
|
||||
selected: false,
|
||||
bindQuantity: item.quantity
|
||||
bindQuantity: item.quantit
|
||||
}))
|
||||
} else {
|
||||
uni.showToast({
|
||||
@@ -257,7 +256,7 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('获取物料信息失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.bindShelf.noMaterialInfo'),
|
||||
title: '暂无物料信息',
|
||||
icon: 'none'
|
||||
})
|
||||
this.materialList = []
|
||||
@@ -300,19 +299,6 @@ export default {
|
||||
return
|
||||
}
|
||||
|
||||
// 检查绑定数量是否为0或空
|
||||
const invalidQuantityItem = selectedItems.find(item => {
|
||||
return !item.bindQuantity || item.bindQuantity === 0
|
||||
})
|
||||
|
||||
if (invalidQuantityItem) {
|
||||
uni.showToast({
|
||||
title: '绑定数量不能为0或空',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
this.$refs.bindShelfPopup.open()
|
||||
},
|
||||
// 关闭绑定料架弹窗
|
||||
@@ -374,7 +360,7 @@ export default {
|
||||
async submitBindShelf() {
|
||||
if (!this.shelfCode) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.bindShelf.pleaseScanShelfCode'),
|
||||
title: '请先扫描料架条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -383,20 +369,7 @@ export default {
|
||||
const selectedItems = this.materialList.filter(item => item.selected)
|
||||
if (selectedItems.length === 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.bindShelf.pleaseSelectMaterial'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 检查绑定数量是否为0或空
|
||||
const invalidQuantityItem = selectedItems.find(item => {
|
||||
return !item.bindQuantity || item.bindQuantity === 0
|
||||
})
|
||||
|
||||
if (invalidQuantityItem) {
|
||||
uni.showToast({
|
||||
title: '绑定数量不能为0或空',
|
||||
title: '请先选择需要绑定的物料',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
|
||||
@@ -1,9 +1,22 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<!-- 出口选择框 -->
|
||||
<view class="input-group">
|
||||
<view class="input-label">出口:</view>
|
||||
<uni-data-select
|
||||
v-model="selectedExit"
|
||||
:localdata="exitOptions"
|
||||
placeholder="请选择出口"
|
||||
class="select-input"
|
||||
/>
|
||||
</view>
|
||||
|
||||
<!-- 托盘条码输入框 -->
|
||||
<view class="input-group">
|
||||
<view class="input-label">物料条码:</view>
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
placeholder="请输入或扫码输入托盘条码"
|
||||
placeholder="请扫码输入物料条码"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
@@ -18,37 +31,21 @@
|
||||
<view class="table-container" v-if="materialList.length > 0">
|
||||
<view class="table">
|
||||
<view class="table-header">
|
||||
<view class="table-cell checkbox-cell">
|
||||
<checkbox :checked="isAllSelected" @click="toggleSelectAll" />
|
||||
</view>
|
||||
|
||||
<view class="table-cell">物资编码</view>
|
||||
<view class="table-cell">物料名称</view>
|
||||
<view class="table-cell">出库数量</view>
|
||||
<view class="table-cell">绑定数量</view>
|
||||
</view>
|
||||
<view v-for="(item, index) in materialList" :key="index" class="table-row">
|
||||
<view class="table-cell checkbox-cell">
|
||||
<checkbox :checked="item.selected" @click="toggleSelect(index)" />
|
||||
</view>
|
||||
|
||||
<view class="table-cell">{{ item.productId }}</view>
|
||||
<view class="table-cell">{{ item.extraField.materialDesc }}</view>
|
||||
<view class="table-cell">{{ item.outQuantity }}</view>
|
||||
<view class="table-cell">
|
||||
<input type="number" v-model.number="item.bindQuantity" @input="handleBindQuantityInput($event, index)" class="quantity-input" />
|
||||
</view>
|
||||
<view class="table-cell">{{ item.productName }}</view>
|
||||
|
||||
</view>
|
||||
</view>
|
||||
<view class="rack-code-input" v-if="materialList.length > 0 && (!materialList[0].spare2 || materialList[0].spare2 !== '2')">
|
||||
<uni-easyinput
|
||||
v-model="rackCode"
|
||||
placeholder="请输入料架码"
|
||||
:clearable="true"
|
||||
>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
|
||||
<view class="button-group" v-if="materialList.length > 0">
|
||||
<view class="button-group">
|
||||
<button class="confirm-button" @click="handleConfirm">确认出库</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -76,13 +73,26 @@
|
||||
return {
|
||||
trayCode: '',
|
||||
materialList: [],
|
||||
isAllSelected: false,
|
||||
rackCode: ''
|
||||
selectedExit: '',
|
||||
// 出口选项
|
||||
exitOptions: [
|
||||
{ value: 'L1021', text: 'L1021' },
|
||||
{ value: 'L1022', text: 'L1022' },
|
||||
{ value: 'L2002', text: 'L2002' },
|
||||
{ value: 'L2008', text: 'L2008' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 处理输入事件
|
||||
handleInput(value) {
|
||||
if(!this.selectedExit){
|
||||
uni.showToast({
|
||||
title: '请选择出口',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (value) {
|
||||
this.fetchTrayInfo(value)
|
||||
}
|
||||
@@ -103,12 +113,11 @@
|
||||
// 获取托盘信息
|
||||
async fetchTrayInfo(trayCode) {
|
||||
try {
|
||||
const response = await getTaskDetail({trayCode:trayCode,status:'3'})
|
||||
const response = await getTaskDetail({trayCode:trayCode,exitId:this.selectedExit})
|
||||
// 为每个物料添加选择状态和绑定数量
|
||||
this.materialList = response.data.map(item => ({
|
||||
...item,
|
||||
selected: false,
|
||||
bindQuantity: item.pickQuantityReal
|
||||
...item
|
||||
|
||||
}))
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
@@ -119,84 +128,43 @@
|
||||
},
|
||||
// 确认出库
|
||||
async handleConfirm() {
|
||||
const selectedItems = this.materialList.filter(item => item.selected)
|
||||
if (this.materialList[0].spare2 === '2') {
|
||||
try {
|
||||
await ckMakeSure({
|
||||
trayCode: this.trayCode,
|
||||
containerCode: 'MOCK_CONTAINER',
|
||||
mydoJobDetailList: [{
|
||||
jobDetailId: 'MOCK_JOB_DETAIL_ID',
|
||||
pickQuantity: 1
|
||||
}]
|
||||
})
|
||||
uni.showToast({
|
||||
title: '出库确认成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 清空数据
|
||||
this.trayCode = ''
|
||||
this.rackCode = ''
|
||||
this.materialList = []
|
||||
return
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '出库确认失败',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
if (selectedItems.length === 0) {
|
||||
// 验证出口选择
|
||||
if (!this.selectedExit) {
|
||||
uni.showToast({
|
||||
title: '请选择要出库的物料',
|
||||
title: '请选择出口',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
if (!this.rackCode) {
|
||||
if (!this.trayCode) {
|
||||
uni.showToast({
|
||||
title: '请输入料架码',
|
||||
title: '请输入托盘条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
for (const item of selectedItems) {
|
||||
if (item.bindQuantity <= 0 || item.bindQuantity > item.outQuantity) {
|
||||
uni.showToast({
|
||||
title: '绑定数量必须大于0且不能超过出库数量',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
}
|
||||
|
||||
try {
|
||||
await ckMakeSure({
|
||||
|
||||
const response=await ckMakeSure({
|
||||
trayCode: this.trayCode,
|
||||
containerCode: this.rackCode,
|
||||
mydoJobDetailList: selectedItems.map(item => ({
|
||||
jobDetailId: item.jobDetailId,
|
||||
pickQuantity: item.bindQuantity
|
||||
}))
|
||||
exitId: this.selectedExit
|
||||
})
|
||||
uni.showToast({
|
||||
title: '出库确认成功',
|
||||
if (response.code==200) {
|
||||
uni.showToast({
|
||||
title: '出库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 清空数据
|
||||
this.trayCode = ''
|
||||
this.rackCode = ''
|
||||
this.materialList = []
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: '出库确认失败',
|
||||
// 清空数据
|
||||
this.trayCode = ''
|
||||
this.materialList = []
|
||||
this.selectedExit = ''
|
||||
}else{
|
||||
uni.showToast({
|
||||
title: response.msg,
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
},
|
||||
// 切换全选状态
|
||||
toggleSelectAll() {
|
||||
@@ -235,12 +203,49 @@
|
||||
margin-bottom: 30rpx;
|
||||
box-shadow: 0 2rpx 12rpx rgba(0, 0, 0, 0.08);
|
||||
|
||||
.input-label {
|
||||
display: block;
|
||||
font-size: 28rpx;
|
||||
color: #606266;
|
||||
margin-bottom: 16rpx;
|
||||
font-weight: 500;
|
||||
}
|
||||
|
||||
.select-input {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
:deep(.uni-easyinput__content) {
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
height: 80rpx;
|
||||
padding: 0 24rpx;
|
||||
}
|
||||
|
||||
// uni-data-select 样式
|
||||
:deep(.uni-select) {
|
||||
.uni-select__input-box {
|
||||
background-color: #f8f8f8;
|
||||
border-radius: 8rpx;
|
||||
border: 2rpx solid #dcdfe6;
|
||||
transition: all 0.3s ease;
|
||||
height: 80rpx;
|
||||
|
||||
.uni-select__input-text {
|
||||
font-size: 28rpx;
|
||||
color: #606266;
|
||||
}
|
||||
|
||||
.uni-select__input-placeholder {
|
||||
font-size: 28rpx;
|
||||
color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
|
||||
.uni-select__input-box:hover {
|
||||
border-color: #c0c4cc;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
.scan-icon {
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="input-group">
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
:placeholder="$t('outbound.ckMakeSureByTray.trayCodePlaceholder')"
|
||||
placeholder="请输入或扫码输入托盘条码"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
@@ -16,26 +16,26 @@
|
||||
</view>
|
||||
|
||||
<view class="loading-container" v-if="loading">
|
||||
<uni-load-more status="loading" :content-text="{contentdown: $t('outbound.ckMakeSureByTray.loading'),contentrefresh: $t('outbound.ckMakeSureByTray.loading'),contentnomore: $t('outbound.ckMakeSureByTray.noMoreData')}"></uni-load-more>
|
||||
<uni-load-more status="loading" :content-text="{contentdown: '加载中...',contentrefresh: '加载中...',contentnomore: '没有更多数据'}"></uni-load-more>
|
||||
</view>
|
||||
|
||||
<view class="materials-list" v-if="materialList.length > 0">
|
||||
<view v-for="(item, index) in materialList" :key="index" class="material-card">
|
||||
<view class="material-header">
|
||||
<text class="material-title">{{ item.extraField.materialDesc || item.productId }}</text>
|
||||
<text class="material-code">{{ item.productId }} | {{ $t('outbound.ckMakeSureByTray.quantity') }}: {{ item.outQuantity }}{{ $t('outbound.ckMakeSureByTray.unit') }}</text>
|
||||
<text class="material-title">{{ item.productName }}</text>
|
||||
<text class="material-code">{{ item.productId }} | 数量: {{ item.outQuantity }}件</text>
|
||||
</view>
|
||||
<!-- <view class="material-content">
|
||||
<view class="material-info">
|
||||
<text class="info-label">{{ $t('outbound.ckMakeSureByTray.batchNo') }}:</text>
|
||||
<text class="info-label">批次号:</text>
|
||||
<text class="info-value">{{ item.batchNo || '无' }}</text>
|
||||
</view>
|
||||
<view class="material-info">
|
||||
<text class="info-label">{{ $t('outbound.ckMakeSureByTray.spec') }}:</text>
|
||||
<text class="info-label">规格:</text>
|
||||
<text class="info-value">{{ item.extraField.spec || '无' }}</text>
|
||||
</view>
|
||||
<view class="material-info">
|
||||
<text class="info-label">{{ $t('outbound.ckMakeSureByTray.unit') }}:</text>
|
||||
<text class="info-label">单位:</text>
|
||||
<text class="info-value">{{ item.extraField.unit || '件' }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
@@ -43,7 +43,7 @@
|
||||
</view>
|
||||
|
||||
<view class="button-group" v-if="materialList.length > 0">
|
||||
<button class="submit-button" @click="handleSubmit">{{ $t('outbound.ckMakeSureByTray.confirmOutbound') }}</button>
|
||||
<button class="submit-button" @click="handleSubmit">确认出库</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -101,13 +101,13 @@
|
||||
this.materialList = response.data
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.trayInfoNotFound'),
|
||||
title: '未找到托盘信息',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.getTrayInfoFailed'),
|
||||
title: '获取托盘信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
@@ -118,7 +118,7 @@
|
||||
async handleSubmit() {
|
||||
if (!this.trayCode) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.enterTrayCode'),
|
||||
title: '请输入托盘条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -126,7 +126,7 @@
|
||||
|
||||
if (this.materialList.length === 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.noOutboundMaterial'),
|
||||
title: '没有可出库的物料',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -139,7 +139,7 @@
|
||||
})
|
||||
if (response.code==200) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.outboundSuccess'),
|
||||
title: '出库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 清空数据
|
||||
@@ -155,7 +155,7 @@
|
||||
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.ckMakeSureByTray.outboundFailed'),
|
||||
title: '出库失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="input-group">
|
||||
<uni-easyinput
|
||||
v-model="trayCode"
|
||||
:placeholder="$t('outbound.exception.trayCodePlaceholder')"
|
||||
placeholder="请输入或扫码输入托盘条码"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
@@ -19,27 +19,27 @@
|
||||
<uni-card v-for="(item, index) in materialList" :key="index" class="material-card">
|
||||
<view class="card-content">
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.exception.materialCode') }}:</text>
|
||||
<text class="label">物资编码:</text>
|
||||
<text class="value">{{ item.productId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.exception.materialName') }}:</text>
|
||||
<text class="label">物料名称:</text>
|
||||
<text class="value">{{ item.extraField.materialDesc }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.exception.outQuantity') }}:</text>
|
||||
<text class="label">出库数量:</text>
|
||||
<text class="value">{{ item.outQuantity }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.exception.pickQuantity') }}:</text>
|
||||
<uni-easyinput v-model="item.pickQuantity" type="number" :placeholder="$t('outbound.exception.enterPickQuantity')" style="flex: 1;" @input="validatePickQuantity(item)"></uni-easyinput>
|
||||
</view>
|
||||
<text class="label">拣选数量:</text>
|
||||
<text class="value">{{ item.pickQuantity }}</text>
|
||||
</view>
|
||||
</view>
|
||||
</uni-card>
|
||||
</view>
|
||||
|
||||
<view class="button-group" v-if="materialList.length > 0">
|
||||
<button class="submit-button" @click="handleSubmit">{{ $t('outbound.exception.submit') }}</button>
|
||||
<button class="submit-button" @click="handleSubmit">提交</button>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -68,25 +68,19 @@ export default {
|
||||
try {
|
||||
const response = await getTaskDetail({trayCode: value,inOut:'2'})
|
||||
if (response.code === 200) {
|
||||
// 设置materialList并初始化pickQuantity为outQuantity的值
|
||||
this.materialList = (response.data || []).map(item => {
|
||||
return {
|
||||
...item,
|
||||
pickQuantity: item.outQuantity
|
||||
}
|
||||
})
|
||||
this.materialList = response.data || []
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('common.noData'),
|
||||
title: response.msg || '暂无数据',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(this.$t('outbound.exception.getTrayInfoFailed'), error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.getTrayInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('获取托盘信息失败', error)
|
||||
uni.showToast({
|
||||
title: '获取托盘信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
},
|
||||
@@ -94,37 +88,6 @@ export default {
|
||||
handleClear() {
|
||||
this.materialList = []
|
||||
},
|
||||
// 验证拣货数量不超过出库数量且不为负数
|
||||
validatePickQuantity(item) {
|
||||
// 转换为数字
|
||||
let pickQty = Number(item.pickQuantity)
|
||||
let outQty = Number(item.outQuantity)
|
||||
|
||||
// 检查是否为有效数字
|
||||
if (isNaN(pickQty) || pickQty === '') {
|
||||
item.pickQuantity = outQty
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否为负数
|
||||
if (pickQty < 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.pickQuantityNegative'),
|
||||
icon: 'none'
|
||||
})
|
||||
item.pickQuantity = 0
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否超过出库数量
|
||||
if (pickQty > outQty) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.pickQuantityExceed'),
|
||||
icon: 'none'
|
||||
})
|
||||
item.pickQuantity = outQty
|
||||
}
|
||||
},
|
||||
// 处理扫码事件
|
||||
handleScan() {
|
||||
uni.scanCode({
|
||||
@@ -138,71 +101,19 @@ export default {
|
||||
async handleSubmit() {
|
||||
if (!this.materialList.length) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.scanTrayFirst'),
|
||||
title: '请先扫描托盘条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
|
||||
// 提交前再次验证所有物料的pickQuantity
|
||||
let isValid = true
|
||||
this.materialList.forEach(item => {
|
||||
// 转换为数字
|
||||
let pickQty = Number(item.pickQuantity)
|
||||
let outQty = Number(item.outQuantity)
|
||||
|
||||
// 检查是否为有效数字
|
||||
if (isNaN(pickQty) || pickQty === '') {
|
||||
isValid = false
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.invalidPickQuantity'),
|
||||
icon: 'none'
|
||||
})
|
||||
item.pickQuantity = outQty
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否为负数
|
||||
if (pickQty < 0) {
|
||||
isValid = false
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.pickQuantityNegative'),
|
||||
icon: 'none'
|
||||
})
|
||||
item.pickQuantity = 0
|
||||
return
|
||||
}
|
||||
|
||||
// 检查是否超过出库数量
|
||||
if (pickQty > outQty) {
|
||||
isValid = false
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.pickQuantityExceed'),
|
||||
icon: 'none'
|
||||
})
|
||||
item.pickQuantity = outQty
|
||||
}
|
||||
})
|
||||
|
||||
if (!isValid) return
|
||||
|
||||
// 准备提交数据,包含所有物料编码和pickQuantity
|
||||
const materialDetails = this.materialList.map(item => {
|
||||
return {
|
||||
jobDetailId: item.jobDetailId,
|
||||
productId: item.productId,
|
||||
pickQuantity: item.pickQuantity
|
||||
}
|
||||
})
|
||||
|
||||
try {
|
||||
const response = await submitError({
|
||||
trayCode: this.trayCode,
|
||||
materialDetails: materialDetails
|
||||
trayCode: this.trayCode
|
||||
|
||||
})
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.submitSuccess'),
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 清空数据
|
||||
@@ -210,16 +121,16 @@ export default {
|
||||
this.materialList = []
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('outbound.exception.submitFailed'),
|
||||
title: response.msg || '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(this.$t('outbound.exception.submitFailed'), error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.exception.submitFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('提交失败', error)
|
||||
uni.showToast({
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,43 +2,28 @@
|
||||
<view class="container">
|
||||
<view class="form-card">
|
||||
<uni-forms>
|
||||
<uni-forms-item :label="$t('outbound.emptyPalletBox.emptyPallet.warehouse')">
|
||||
<uni-forms-item label="仓库">
|
||||
<uni-data-select
|
||||
v-model="formData.warehouseId"
|
||||
:localdata="warehouseList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.emptyPalletBox.emptyPallet.warehousePlaceholder')"
|
||||
placeholder="请选择仓库"
|
||||
@change="handleWarehouseChange"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
<view class="cargo-space-container" v-if="currentWarehouseType == '1'">
|
||||
<uni-forms-item :label="$t('outbound.emptyPalletBox.emptyPallet.cargoSpace')">
|
||||
<view class="cargo-input-group">
|
||||
<uni-easyinput
|
||||
v-model="formData.cargoSpaceName"
|
||||
:placeholder="$t('outbound.emptyPalletBox.emptyPallet.cargoSpacePlaceholder')"
|
||||
:clearable="true"
|
||||
@input="handleCargoSpaceInput"
|
||||
/>
|
||||
<button class="recommend-btn" @click="handleRecommendCargoSpace">{{ $t('outbound.emptyPalletBox.emptyPallet.recommendCargoSpace') }}</button>
|
||||
</view>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
<view v-if="currentWarehouseType == '1' && cargoSpaceHeight" class="cargo-space-info">
|
||||
<text class="cargo-space-height">{{ $t('outbound.emptyPalletBox.emptyPallet.cargoSpaceHeight') }}{{ cargoSpaceHeight }}{{ $t('outbound.emptyPalletBox.emptyPallet.meter') }}</text>
|
||||
</view>
|
||||
<view class="cargo-space-container" v-if="currentWarehouseType == '2'">
|
||||
<uni-forms-item :label="$t('outbound.emptyPalletBox.emptyPallet.exit')">
|
||||
|
||||
<view class="cargo-space-container">
|
||||
<uni-forms-item label="出口">
|
||||
<uni-data-select
|
||||
v-model="formData.exitId"
|
||||
:localdata="exitList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.emptyPalletBox.emptyPallet.exitPlaceholder')"
|
||||
placeholder="请选择出口"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<button class="submit-button" hover-class="button-hover" @click="handleSubmit">{{ $t('outbound.emptyPalletBox.emptyPallet.submit') }}</button>
|
||||
<button class="submit-button" hover-class="button-hover" @click="handleSubmit">空托盘出库</button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</view>
|
||||
@@ -53,9 +38,7 @@ export default {
|
||||
return {
|
||||
formData: {
|
||||
warehouseId: '',
|
||||
cargoSpaceId: '',
|
||||
exitId: '',
|
||||
cargoSpaceName: ''
|
||||
exitId: ''
|
||||
},
|
||||
warehouseList: [],
|
||||
cargoSpaceList: [],
|
||||
@@ -73,17 +56,17 @@ export default {
|
||||
const res = await getBasWarehouList({
|
||||
pageNum:1,
|
||||
pageSize:100,
|
||||
typeData:['1','2']
|
||||
// typeData:['1','2']
|
||||
})
|
||||
if (res.code === 200) {
|
||||
this.warehouseList = res.rows.map(item => ({
|
||||
value: item.warehouseId,
|
||||
text: item.warehouseName,
|
||||
type: item.warehouseType
|
||||
text: item.warehouseName
|
||||
// type: item.warehouseType
|
||||
}))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(this.$t('outbound.emptyPalletBox.emptyPallet.getWarehouseListFailed'), error)
|
||||
console.error('获取仓库列表失败', error)
|
||||
}
|
||||
},
|
||||
async handleWarehouseChange(warehouseId) {
|
||||
@@ -92,97 +75,27 @@ export default {
|
||||
this.currentWarehouseType = selectedWarehouse ? selectedWarehouse.type : ''
|
||||
this.formData.exitId = ''
|
||||
|
||||
if (this.currentWarehouseType == '2') {
|
||||
// if (this.currentWarehouseType == '2') {
|
||||
// 模拟出口数据,实际项目中应该从后端获取
|
||||
this.exitList = [
|
||||
{ value: '1', text: this.$t('outbound.emptyPalletBox.emptyPallet.exit') + '1' },
|
||||
{ value: '2', text: this.$t('outbound.emptyPalletBox.emptyPallet.exit') + '2' },
|
||||
{ value: '3', text: this.$t('outbound.emptyPalletBox.emptyPallet.exit') + '3' }
|
||||
{ value: '1', text: '出口方向1' },
|
||||
{ value: '2', text: '出口方向2' }
|
||||
]
|
||||
}
|
||||
},
|
||||
handleCargoSpaceSelect(item) {
|
||||
this.formData.cargoSpaceId = item.value
|
||||
},
|
||||
async handleRecommendCargoSpace() {
|
||||
if (!this.formData.warehouseId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.selectWarehouse'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// try {
|
||||
const response = await getFullCargoSpaceListByWarehouse({ warehouseId: this.formData.warehouseId })
|
||||
if (response.code === 200 && response.data.length > 0) {
|
||||
// 获取第一个推荐货位
|
||||
this.formData.cargoSpaceId = response.data[0].cargoSpaceId
|
||||
this.formData.cargoSpaceName = response.data[0].cargoSpaceName
|
||||
// 手动触发handleCargoSpaceInput方法获取货位高度信息
|
||||
await this.handleCargoSpaceInput(response.data[0].cargoSpaceName)
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.noAvailableCargoSpace'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
// } catch (error) {
|
||||
// console.error('获取推荐货位失败:', error)
|
||||
// uni.showToast({
|
||||
// title: '获取推荐货位失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
},
|
||||
// 处理货位选择
|
||||
async handleCargoSpaceInput(value) {
|
||||
if (value) {
|
||||
try {
|
||||
const response = await getCargoSpaceList({ cargoSpaceName: value, warehouseId: this.formData.warehouseId })
|
||||
if (response.code === 200 && response.rows.length > 0) {
|
||||
this.formData.cargoSpaceId = response.rows[0].cargoSpaceId
|
||||
this.cargoSpaceHeight = response.rows[0].cargoHight
|
||||
console.log(this.formData.cargoSpaceId)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.getCargoSpaceInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.getCargoSpaceInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
} else {
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
},
|
||||
|
||||
async handleSubmit() {
|
||||
if (!this.formData.warehouseId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.selectWarehouse'),
|
||||
title: '请选择仓库',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.currentWarehouseType == '1' && !this.formData.cargoSpaceId) {
|
||||
|
||||
if ( !this.formData.exitId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.selectCargoSpace'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.currentWarehouseType == '2' && !this.formData.exitId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.selectExit'),
|
||||
title: '请选择出口',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -194,22 +107,19 @@ export default {
|
||||
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.emptyPalletBox.emptyPallet.outboundSuccess'),
|
||||
title: '空托盘出库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 重置表单数据
|
||||
this.formData = {
|
||||
warehouseId: '',
|
||||
cargoSpaceId: '',
|
||||
exitId: ''
|
||||
}
|
||||
this.cargoSpaceList = []
|
||||
this.exitList = []
|
||||
this.currentWarehouseType = ''
|
||||
this.cargoSpaceHeight = ''
|
||||
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('outbound.emptyPalletBox.emptyPallet.outboundOperationFailed'),
|
||||
title: response.msg || '出库操作失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@
|
||||
<image src="/static/images/tabbar/trayout.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.emptyPalletBox.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.emptyPalletBox.desc') }}</text>
|
||||
<text class="title">空托盘/料箱出库</text>
|
||||
<text class="desc">空托盘/料箱出库管理</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/pkout')">
|
||||
@@ -15,8 +15,8 @@
|
||||
<image src="/static/images/tabbar/trayout.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.pkout.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.pkout.desc') }}</text>
|
||||
<text class="title">平库出库</text>
|
||||
<text class="desc">平库出库管理</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/ckMakeSureByTray')">
|
||||
@@ -24,8 +24,8 @@
|
||||
<image src="/static/images/tabbar/readyCheck.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.ckMakeSureByTray.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.ckMakeSureByTray.desc') }}</text>
|
||||
<text class="title">出库确认</text>
|
||||
<text class="desc">出库单确认管理</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/bindShell')">
|
||||
@@ -33,8 +33,8 @@
|
||||
<image src="/static/images/tabbar/readyCheck.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.bindShelf.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.bindShelf.desc') }}</text>
|
||||
<text class="title">绑定料架</text>
|
||||
<text class="desc">出库单确认管理</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/errorout')">
|
||||
@@ -42,8 +42,8 @@
|
||||
<image src="/static/images/tabbar/readyCheck.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.exception.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.exception.desc') }}</text>
|
||||
<text class="title">异常出库</text>
|
||||
<text class="desc">异常出库</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/out/move')">
|
||||
@@ -51,8 +51,8 @@
|
||||
<image src="/static/images/tabbar/readyCheck.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('outbound.move.title') }}</text>
|
||||
<text class="desc">{{ $t('outbound.move.desc') }}</text>
|
||||
<text class="title">料架搬运</text>
|
||||
<text class="desc">点对点搬运</text>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
@@ -3,49 +3,49 @@
|
||||
<uni-forms class="form-card">
|
||||
<view class="form-content">
|
||||
<!-- 第一个独立下拉框 -->
|
||||
<uni-forms-item :label="$t('outbound.move.startPointType')">
|
||||
<uni-forms-item label="起始点类型">
|
||||
<uni-data-select
|
||||
v-model="formData.startPointType"
|
||||
:localdata="pointTypeList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.move.startPointTypePlaceholder')"
|
||||
placeholder="请选择起始点类型"
|
||||
@change="handleStartPointTypeChange"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
|
||||
<!-- 第二个独立下拉框 -->
|
||||
<uni-forms-item :label="$t('outbound.move.targetPointType')">
|
||||
<uni-forms-item label="目标点类型">
|
||||
<uni-data-select
|
||||
v-model="formData.targetPointType"
|
||||
:localdata="pointTypeList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.move.targetPointTypePlaceholder')"
|
||||
placeholder="请选择目标点类型"
|
||||
@change="handleTargetPointTypeChange"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
|
||||
<!-- 第一个联动下拉框(主) -->
|
||||
<uni-forms-item :label="$t('outbound.move.sourceLocation')">
|
||||
<uni-forms-item label="起始位置">
|
||||
<uni-data-select
|
||||
v-model="formData.sourceLocationId"
|
||||
:localdata="sourceLocationList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.move.sourceLocationPlaceholder')"
|
||||
placeholder="请选择起始位置"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
|
||||
<!-- 第二个联动下拉框(从) -->
|
||||
<uni-forms-item :label="$t('outbound.move.targetLocation')">
|
||||
<uni-forms-item label="目标位置">
|
||||
<uni-data-select
|
||||
v-model="formData.targetLocationId"
|
||||
:localdata="targetLocationList"
|
||||
:clear="false"
|
||||
:placeholder="$t('outbound.move.targetLocationPlaceholder')"
|
||||
placeholder="请选择目标位置"
|
||||
/>
|
||||
</uni-forms-item>
|
||||
</view>
|
||||
|
||||
<button class="submit-button" @click="handleSubmit">{{ $t('outbound.move.submit') }}</button>
|
||||
<button class="submit-button" @click="handleSubmit">提交</button>
|
||||
</uni-forms>
|
||||
</view>
|
||||
</template>
|
||||
@@ -82,7 +82,7 @@ export default {
|
||||
|
||||
this.pointTypeList = res.map(item => ({
|
||||
value: item.dictValue,
|
||||
text: this.$t(item.dictLabel)
|
||||
text: item.dictLabel
|
||||
}))
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('获取点位列表失败', error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.getPointTypeListFailed'),
|
||||
title: '获取点位类型列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -118,7 +118,7 @@ async handleStartPointTypeChange(value) {
|
||||
} catch (error) {
|
||||
console.error('获取端口列表失败', error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.getPortListFailed'),
|
||||
title: '获取端口列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -148,7 +148,7 @@ async handleStartPointTypeChange(value) {
|
||||
} catch (error) {
|
||||
console.error('获取目标端口列表失败', error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.getPortListFailed'),
|
||||
title: '获取端口列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -161,7 +161,7 @@ async handleStartPointTypeChange(value) {
|
||||
// 表单验证
|
||||
if (!this.formData.startPointType) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.startPointTypeRequired'),
|
||||
title: '请选择起始点类型',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -169,7 +169,7 @@ async handleStartPointTypeChange(value) {
|
||||
|
||||
if (!this.formData.targetPointType) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.targetPointTypeRequired'),
|
||||
title: '请选择目标点类型',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -177,7 +177,7 @@ async handleStartPointTypeChange(value) {
|
||||
|
||||
if (!this.formData.sourceLocationId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.sourceLocationRequired'),
|
||||
title: '请选择起始位置',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -185,7 +185,7 @@ async handleStartPointTypeChange(value) {
|
||||
|
||||
if (!this.formData.targetLocationId) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.targetLocationRequired'),
|
||||
title: '请选择目标位置',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -197,7 +197,7 @@ async handleStartPointTypeChange(value) {
|
||||
endPoint:this.formData.targetLocationId})
|
||||
if (res.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.move.submitSuccess'),
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 重置表单
|
||||
@@ -211,14 +211,14 @@ async handleStartPointTypeChange(value) {
|
||||
this.targetLocationList = []
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: res.msg || this.$t('outbound.move.submitFailed'),
|
||||
title: res.msg || '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('提交移库请求失败', error)
|
||||
uni.showToast({
|
||||
title: res.msg ||this.$t('outbound.move.submitError'),
|
||||
title: res.msg ||'提交请求失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="search-box">
|
||||
<uni-easyinput
|
||||
v-model="stockoutId"
|
||||
:placeholder="$t('outbound.pkout.searchPlaceholder')"
|
||||
placeholder="请输入或扫码输入单据号"
|
||||
:clearable="true"
|
||||
@clear="handleClear"
|
||||
@confirm="handleSearch"
|
||||
@@ -20,27 +20,27 @@
|
||||
<uni-card>
|
||||
<view class="card-content">
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.pkout.orderNumber') }}</text>
|
||||
<text class="label">单据编号:</text>
|
||||
<text class="value">{{ order.stockoutId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.pkout.createTime') }}</text>
|
||||
<text class="label">创建时间:</text>
|
||||
<text class="value">{{ order.createDate }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('outbound.pkout.customer') }}</text>
|
||||
<text class="label">客户:</text>
|
||||
<text class="value">{{ order.customerName }}</text>
|
||||
</view>
|
||||
<!-- 展开时显示物料信息 -->
|
||||
<view v-if="order.expanded && order.goodsList" class="goods-list">
|
||||
<view class="goods-title">{{ $t('outbound.pkout.goodsInfo') }}</view>
|
||||
<view class="goods-title">物品信息</view>
|
||||
<view class="goods-table">
|
||||
<view class="table-header">
|
||||
<text class="header-cell" style="display: none;">{{ $t('outbound.pkout.productCode') }}</text>
|
||||
<text class="header-cell">{{ $t('outbound.pkout.productName') }}</text>
|
||||
<text class="header-cell">{{ $t('outbound.pkout.planQuantity') }}</text>
|
||||
<text class="header-cell">{{ $t('outbound.pkout.outboundQuantity') }}</text>
|
||||
<text class="header-cell">{{ $t('outbound.pkout.operation') }}</text>
|
||||
<text class="header-cell" style="display: none;">物品编码</text>
|
||||
<text class="header-cell">物品名称</text>
|
||||
<text class="header-cell">计划数量</text>
|
||||
<text class="header-cell">出库数量</text>
|
||||
<text class="header-cell">操作</text>
|
||||
</view>
|
||||
<view v-for="(goods, goodsIndex) in order.goodsList" :key="goodsIndex" class="table-row">
|
||||
<text class="table-cell" style="display: none;">{{ goods.productId }}</text>
|
||||
@@ -49,7 +49,7 @@
|
||||
<text class="table-cell">{{ goods.quantity - goods.assignNum }}</text>
|
||||
<view class="table-cell">
|
||||
<button class="operate-btn" @click.stop="handleOutStock(goods)" :disabled="(goods.quantity - goods.assignNum) <= 0" :class="{'operate-btn-disabled': (goods.quantity - goods.assignNum) <= 0}">
|
||||
{{ $t('outbound.pkout.outbound') }}
|
||||
出库
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
@@ -59,7 +59,7 @@
|
||||
</uni-card>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="no-data">{{ $t('outbound.pkout.noOrderInfo') }}</view>
|
||||
<view v-else class="no-data">暂无出库单信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -102,11 +102,11 @@ export default {
|
||||
goodsList: null
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error(this.$t('outbound.pkout.getOrderListFailed'), error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.pkout.getOrderListFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('获取出库单列表失败', error)
|
||||
uni.showToast({
|
||||
title: '获取出库单列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 获取物品列表
|
||||
@@ -123,11 +123,11 @@ export default {
|
||||
// outQuantity: item.quantity-item.assignNum
|
||||
}))
|
||||
} catch (error) {
|
||||
console.error(this.$t('outbound.pkout.getItemInfoFailed'), error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.pkout.getItemInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
console.error('获取物品信息失败', error)
|
||||
uni.showToast({
|
||||
title: '获取物品信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
},
|
||||
// 处理出库单点击
|
||||
@@ -179,18 +179,18 @@ export default {
|
||||
})
|
||||
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.pkout.outboundSuccess'),
|
||||
icon: 'success'
|
||||
})
|
||||
title: '出库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
// 刷新数据
|
||||
this.getOrderList()
|
||||
} catch (error) {
|
||||
console.error('出库失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('outbound.pkout.outboundFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
title: '出库失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user