现场调试修改 入库 出库 放货重新分配货位
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="input-group">
|
||||
<text class="input-label">{{ $t('inbound.backIn.rackCode') }}</text>
|
||||
<text class="input-label">料架条码:</text>
|
||||
<uni-easyinput
|
||||
v-model="rackCode"
|
||||
:placeholder="$t('inbound.backIn.rackCodePlaceholder')"
|
||||
placeholder="请输入或扫码输入料架条码"
|
||||
:clearable="true"
|
||||
@input="handleInput"
|
||||
@clear="handleClear"
|
||||
@@ -17,22 +17,22 @@
|
||||
</view>
|
||||
|
||||
<view class="loading-container" v-if="loading">
|
||||
<uni-load-more status="loading" :content-text="{contentdown: $t('inbound.backIn.loading'),contentrefresh: $t('inbound.backIn.loading'),contentnomore: $t('common.noData')}"></uni-load-more>
|
||||
<uni-load-more status="loading" :content-text="{contentdown: '加载中...',contentrefresh: '加载中...',contentnomore: '暂无数据'}"></uni-load-more>
|
||||
</view>
|
||||
|
||||
<view class="card-container" v-if="materialList.length > 0">
|
||||
<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('inbound.backIn.materialCode') }}</text>
|
||||
<text class="label">物料编码:</text>
|
||||
<text class="value">{{ item.productId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.backIn.materialName') }}</text>
|
||||
<text class="label">物料名称:</text>
|
||||
<text class="value">{{ item.productName }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.backIn.quantity') }}</text>
|
||||
<text class="label">数量:</text>
|
||||
<uni-easyinput
|
||||
v-model="item.editQuantity"
|
||||
type="number"
|
||||
@@ -46,28 +46,28 @@
|
||||
</view>
|
||||
|
||||
<view class="empty-state" v-if="!loading && materialList.length === 0 && rackCode">
|
||||
<text>{{ $t('inbound.backIn.noMaterialInfo') }}</text>
|
||||
<text>未找到相关物料信息</text>
|
||||
</view>
|
||||
|
||||
<view class="button-container" v-if="materialList.length > 0">
|
||||
<button class="submit-button" @click="handleSubmit">{{ $t('inbound.backIn.submit') }}</button>
|
||||
<button class="submit-button" @click="handleSubmit">提交</button>
|
||||
</view>
|
||||
|
||||
<!-- 仓库选择弹窗 -->
|
||||
<uni-popup ref="warehousePopup" type="center">
|
||||
<view class="popup-content">
|
||||
<view class="popup-title">{{ $t('inbound.backIn.selectWarehouse') }}</view>
|
||||
<view class="popup-title">请选择仓库</view>
|
||||
<view class="popup-body">
|
||||
<uni-data-select
|
||||
v-model="selectedWarehouseId"
|
||||
:localdata="warehouseList"
|
||||
:clear="false"
|
||||
:placeholder="$t('inbound.backIn.warehousePlaceholder')"
|
||||
placeholder="请选择仓库"
|
||||
/>
|
||||
</view>
|
||||
<view class="popup-footer">
|
||||
<button class="cancel-button" @click="closeWarehousePopup">{{ $t('inbound.backIn.cancel') }}</button>
|
||||
<button class="confirm-button" @click="confirmSubmit">{{ $t('inbound.backIn.confirm') }}</button>
|
||||
<button class="cancel-button" @click="closeWarehousePopup">取消</button>
|
||||
<button class="confirm-button" @click="confirmSubmit">确定</button>
|
||||
</view>
|
||||
</view>
|
||||
</uni-popup>
|
||||
@@ -119,7 +119,7 @@
|
||||
} catch (error) {
|
||||
console.error('获取仓库列表失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.getWarehouseListFailed'),
|
||||
title: '获取仓库列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -164,21 +164,21 @@
|
||||
} else {
|
||||
this.materialList = []
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.noMaterialInfo'),
|
||||
title: '未找到相关物料信息',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} else {
|
||||
this.materialList = []
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.backIn.getRackInfoFailed'),
|
||||
title: response.msg || '获取料架信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
this.materialList = []
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.getRackInfoFailed'),
|
||||
title: '获取料架信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
} finally {
|
||||
@@ -208,14 +208,14 @@
|
||||
|
||||
if (this.materialList.length === 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.noSubmitMaterial'),
|
||||
title: '没有可提交的物料信息',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if(!this.rackCode){
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.enterRackCode'),
|
||||
title: '请输入料架条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -231,7 +231,7 @@
|
||||
|
||||
if (!isValid) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.enterValidQuantity'),
|
||||
title: '请输入有效的数量',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -264,7 +264,7 @@
|
||||
async confirmSubmit() {
|
||||
if (!this.selectedWarehouseId) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.selectWarehouse'),
|
||||
title: '请选择仓库',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -290,7 +290,7 @@
|
||||
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.submitSuccess'),
|
||||
title: '提交成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
@@ -300,13 +300,13 @@
|
||||
})
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.backIn.submitFailed'),
|
||||
title: response.msg || '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.backIn.submitFailed'),
|
||||
title: '提交失败',
|
||||
icon: 'none'
|
||||
})
|
||||
console.error(error)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -168,7 +168,7 @@
|
||||
})
|
||||
}
|
||||
|
||||
// try {
|
||||
try {
|
||||
const response = await bindTray(this.formData)
|
||||
|
||||
console.log(response)
|
||||
@@ -193,13 +193,13 @@
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
// } catch (error) {
|
||||
// // console.error('绑定托盘失败:', error)
|
||||
// uni.showToast({
|
||||
// title: '绑定托盘失败',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// }
|
||||
} catch (error) {
|
||||
console.error('绑定托盘失败:', error)
|
||||
uni.showToast({
|
||||
title: '网络错误,请稍后重试',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<view class="search-box">
|
||||
<uni-easyinput
|
||||
v-model="stockinId"
|
||||
:placeholder="$t('inbound.inorder.searchPlaceholder')"
|
||||
placeholder="请输入或扫码输入单据号"
|
||||
:clearable="true"
|
||||
@clear="handleClear"
|
||||
@confirm="handleSearch"
|
||||
@@ -21,28 +21,28 @@
|
||||
<view class="card-content">
|
||||
<view class="order-header" @click="handleOrderClick(order)">
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.inorder.orderNumber') }}</text>
|
||||
<text class="value">{{ order.stockinId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.inorder.createTime') }}</text>
|
||||
<text class="value">{{ order.createDate }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.inorder.supplier') }}</text>
|
||||
<text class="value">{{ order.supplierName }}</text>
|
||||
</view>
|
||||
<text class="label">单据编号:</text>
|
||||
<text class="value">{{ order.stockinId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">创建时间:</text>
|
||||
<text class="value">{{ order.createDate }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">供应商</text>
|
||||
<text class="value">{{ order.supplierName }}</text>
|
||||
</view>
|
||||
</view>
|
||||
<!-- 展开时显示物料信息 -->
|
||||
<view v-if="order.expanded && order.goodsList" class="goods-list" @click.stop>
|
||||
<view class="goods-title">{{ $t('inbound.inorder.goodsInfo') }}</view>
|
||||
<view class="goods-title">物品信息</view>
|
||||
<view class="goods-table">
|
||||
<view class="table-header">
|
||||
<text class="header-cell" style="display: none;">{{ $t('inbound.inorder.productCode') }}</text>
|
||||
<text class="header-cell">{{ $t('inbound.inorder.productName') }}</text>
|
||||
<text class="header-cell">{{ $t('inbound.inorder.planQuantity') }}</text>
|
||||
<text class="header-cell">{{ $t('inbound.inorder.inboundQuantity') }}</text>
|
||||
</view>
|
||||
<text class="header-cell" style="display: none;">物品编码</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>
|
||||
<text class="table-cell material-name">{{ goods.extraField.materialDesc }}</text>
|
||||
@@ -60,8 +60,8 @@
|
||||
</view>
|
||||
<view class="table-cell">
|
||||
<button class="operate-btn" @click.stop="handleInStock(goods)" :class="{'operate-btn-disabled': !isValidQuantity(goods)}">
|
||||
{{ $t('inbound.inorder.inbound') }}
|
||||
</button>
|
||||
入库
|
||||
</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -70,7 +70,7 @@
|
||||
</uni-card>
|
||||
</view>
|
||||
</view>
|
||||
<view v-else class="no-data">{{ $t('inbound.inorder.noOrderInfo') }}</view>
|
||||
<view v-else class="no-data">暂无入库单信息</view>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -118,7 +118,7 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('获取入库单列表失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.getOrderListFailed'),
|
||||
title: '获取入库单列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -139,7 +139,7 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('获取物品信息失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.getItemInfoFailed'),
|
||||
title: '获取物品信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -187,7 +187,7 @@ export default {
|
||||
if (Number(goods.inQuantity) > maxQuantity) {
|
||||
goods.inQuantity = maxQuantity;
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.exceedInboundQuantity'),
|
||||
title: '超出可入库数量',
|
||||
icon: 'none'
|
||||
});
|
||||
}
|
||||
@@ -197,7 +197,7 @@ export default {
|
||||
async handleInStock(goods) {
|
||||
if (!this.isValidQuantity(goods)) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.enterValidQuantity'),
|
||||
title: '请输入有效的入库数量',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -210,7 +210,7 @@ export default {
|
||||
})
|
||||
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.inboundSuccess'),
|
||||
title: '入库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
@@ -219,7 +219,7 @@ export default {
|
||||
} catch (error) {
|
||||
console.error('入库操作失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.inorder.inboundFailed'),
|
||||
title: '入库失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="input-group">
|
||||
<text class="input-label">{{ $t('inbound.emptyPalletBox.emptyPallet.trayCode') }}</text>
|
||||
<text class="input-label">托盘条码:</text>
|
||||
<uni-easyinput
|
||||
v-model="formData.trayCode"
|
||||
:placeholder="$t('inbound.emptyPalletBox.emptyPallet.trayCodePlaceholder')"
|
||||
placeholder="请输入或扫码输入托盘条码"
|
||||
:clearable="true"
|
||||
@clear="handleClear"
|
||||
@confirm="handleConfirm"
|
||||
@@ -16,33 +16,18 @@
|
||||
</template>
|
||||
</uni-easyinput>
|
||||
</view>
|
||||
<view class="input-group">
|
||||
<text class="input-label">{{ $t('inbound.emptyPalletBox.emptyPallet.warehouse') }}</text>
|
||||
<!-- <view class="input-group">
|
||||
<text class="input-label">仓库</text>
|
||||
<uni-data-select
|
||||
v-model="formData.warehouseId"
|
||||
:localdata="warehouseList"
|
||||
:clear="false"
|
||||
:placeholder="$t('inbound.emptyPalletBox.emptyPallet.warehousePlaceholder')"
|
||||
@change="handleWarehouseChange"
|
||||
placeholder="请选择仓库"
|
||||
|
||||
/>
|
||||
</view>
|
||||
<view class="input-group" v-if="currentWarehouseType == '1'">
|
||||
<text class="input-label">{{ $t('inbound.emptyPalletBox.emptyPallet.cargoSpace') }}</text>
|
||||
<view class="cargo-input-group">
|
||||
<uni-easyinput
|
||||
v-model="formData.cargoSpaceName"
|
||||
:placeholder="$t('inbound.emptyPalletBox.emptyPallet.cargoSpacePlaceholder')"
|
||||
:clearable="true"
|
||||
@input="handleCargoSpaceInput"
|
||||
/>
|
||||
<button class="recommend-btn" @click="handleRecommendCargoSpace">{{ $t('inbound.emptyPalletBox.emptyPallet.recommendCargoSpace') }}</button>
|
||||
</view>
|
||||
</view>
|
||||
<view v-if="currentWarehouseType == '1' && cargoSpaceHeight" class="cargo-space-info">
|
||||
<text class="cargo-space-height">{{ $t('inbound.emptyPalletBox.emptyPallet.cargoSpaceHeight') }}{{ cargoSpaceHeight }}{{ $t('inbound.emptyPalletBox.emptyPallet.meter') }}</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="button-group">
|
||||
<button class="submit-button" @click="handleSubmit">{{ $t('inbound.emptyPalletBox.emptyPallet.submit') }}</button>
|
||||
<button class="submit-button" @click="handleSubmit">空托盘入库</button>
|
||||
</view>
|
||||
|
||||
</view>
|
||||
@@ -57,16 +42,11 @@ import { getBasWarehouList,getCargoSpaceList } from '@/api/bas/bas.js'
|
||||
return {
|
||||
formData: {
|
||||
trayCode: '',
|
||||
warehouseId: '',
|
||||
cargoSpaceId: '',
|
||||
cargoSpaceName:'',
|
||||
|
||||
warehouseId: ''
|
||||
|
||||
},
|
||||
warehouseList: [],
|
||||
cargoSpaceId: '',
|
||||
cargoSpaceList: [],
|
||||
currentWarehouseType: null,
|
||||
cargoSpaceHeight:''
|
||||
warehouseList: []
|
||||
|
||||
}
|
||||
},
|
||||
onReady() {
|
||||
@@ -77,7 +57,7 @@ import { getBasWarehouList,getCargoSpaceList } from '@/api/bas/bas.js'
|
||||
}, 100)
|
||||
|
||||
// 获取仓库列表
|
||||
this.getWarehouseList()
|
||||
// this.getWarehouseList()
|
||||
},
|
||||
methods: {
|
||||
// 获取仓库列表
|
||||
@@ -85,20 +65,20 @@ import { getBasWarehouList,getCargoSpaceList } from '@/api/bas/bas.js'
|
||||
try {
|
||||
const response = await getBasWarehouList({
|
||||
pageNum:1,
|
||||
pageSize:100,
|
||||
typeData:['1','2']
|
||||
pageSize:100
|
||||
|
||||
})
|
||||
if (response.code === 200) {
|
||||
this.warehouseList = response.rows.map(item => ({
|
||||
value: item.warehouseId,
|
||||
text: item.warehouseName,
|
||||
type: item.warehouseType
|
||||
text: item.warehouseName
|
||||
// type: item.warehouseType
|
||||
}))
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取仓库列表失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.getWarehouseListFailed'),
|
||||
title: '获取仓库列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -119,103 +99,34 @@ import { getBasWarehouList,getCargoSpaceList } from '@/api/bas/bas.js'
|
||||
})
|
||||
},
|
||||
|
||||
handleWarehouseChange(warehouseId) {
|
||||
if (!warehouseId) return
|
||||
const selectedWarehouse = this.warehouseList.find(item => item.value === warehouseId)
|
||||
this.currentWarehouseType = selectedWarehouse ? selectedWarehouse.type : null
|
||||
|
||||
},
|
||||
// 处理货位选择
|
||||
async handleRecommendCargoSpace() {
|
||||
// try {
|
||||
const response = await getCargoSpaceList({ warehouseId: this.formData.warehouseId, status: 1 })
|
||||
if (response.code === 200 && response.rows.length > 0) {
|
||||
// 获取第一个推荐货位
|
||||
this.formData.cargoSpaceId = response.rows[0].cargoSpaceId
|
||||
this.formData.cargoSpaceName = response.rows[0].cargoSpaceName
|
||||
// 手动触发handleCargoSpaceInput方法获取货位高度信息
|
||||
await this.handleCargoSpaceInput(response.rows[0].cargoSpaceName)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.noAvailableCargoSpace'),
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
// } catch (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('inbound.emptyPalletBox.emptyPallet.getCargoSpaceInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
} catch (error) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.getCargoSpaceInfoFailed'),
|
||||
icon: 'none'
|
||||
})
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
} else {
|
||||
this.formData.cargoSpaceId = ''
|
||||
this.cargoSpaceHeight = null
|
||||
}
|
||||
},
|
||||
async handleSubmit() {
|
||||
if (!this.formData.trayCode) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.enterTrayCode'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (!this.formData.warehouseId) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.selectWarehouse'),
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
if (this.currentWarehouseType === '1' && (!this.formData.cargoSpaceId || this.formData.cargoSpaceId === null)) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.selectCargoSpace'),
|
||||
title: '请输入托盘条码',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
}
|
||||
// if (!this.formData.warehouseId) {
|
||||
// uni.showToast({
|
||||
// title: '请选择仓库',
|
||||
// icon: 'none'
|
||||
// })
|
||||
// return
|
||||
// }
|
||||
|
||||
await emptyTrayIn(this.formData).then(response => {
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.inboundSuccess'),
|
||||
title: '空托盘入库成功',
|
||||
icon: 'success'
|
||||
})
|
||||
// 清空表单
|
||||
this.formData = {
|
||||
trayCode: '',
|
||||
warehouseId: '',
|
||||
cargoSpaceId: '',
|
||||
cargoSpaceName: ''
|
||||
warehouseId: ''
|
||||
|
||||
}
|
||||
this.cargoSpaceHeight=''
|
||||
this.currentWarehouseType=null
|
||||
// 重新聚焦到托盘条码输入框
|
||||
setTimeout(() => {
|
||||
this.$nextTick(() => {
|
||||
@@ -224,14 +135,14 @@ import { getBasWarehouList,getCargoSpaceList } from '@/api/bas/bas.js'
|
||||
}, 100)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.emptyPalletBox.emptyPallet.inboundOperationFailed'),
|
||||
title: response.msg || '入库操作失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
}).catch(error => {
|
||||
console.error('入库失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.emptyPalletBox.emptyPallet.inboundFailed'),
|
||||
title: '入库失败',
|
||||
icon: 'none'
|
||||
})
|
||||
})
|
||||
|
||||
@@ -1,15 +1,15 @@
|
||||
<template>
|
||||
<view class="container">
|
||||
<view class="function-list">
|
||||
<view class="function-item" @click="navigateTo('/pages/in/qualityCheck')">
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/in/qualityCheck')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/tray121.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('inbound.qualityCheck.title') }}</text>
|
||||
<text class="desc">{{ $t('inbound.qualityCheck.desc') }}</text>
|
||||
<text class="title">入库质检</text>
|
||||
<text class="desc">物料收货质检入库</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/in/klxin')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/tray121.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
@@ -19,42 +19,42 @@
|
||||
<text class="desc">空料箱收货入库</text>
|
||||
</view>
|
||||
</view> -->
|
||||
<view class="function-item" @click="navigateTo('/pages/in/ktpin')">
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/in/ktpin')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/tray121.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('inbound.emptyPalletBox.title') }}</text>
|
||||
<text class="desc">{{ $t('inbound.emptyPalletBox.desc') }}</text>
|
||||
<text class="title">空托盘/料箱入库</text>
|
||||
<text class="desc">空托盘/料箱扫码入库</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/in/inorder')">
|
||||
</view> -->
|
||||
<view class="function-item" @click="navigateTo('/pages/in/bindManypk')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/dingdandanjuwenjian-2.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('inbound.inorder.title') }}</text>
|
||||
<text class="desc">{{ $t('inbound.inorder.desc') }}</text>
|
||||
<text class="title">平库入库</text>
|
||||
<text class="desc">平库收货入库</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/in/bindMsg')">
|
||||
<view class="function-item" @click="navigateTo('/pages/in/bindMany')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/list.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('inbound.bindMsg.title') }}</text>
|
||||
<text class="desc">{{ $t('inbound.bindMsg.desc') }}</text>
|
||||
<text class="title">物资入库</text>
|
||||
<text class="desc">托盘绑定物资</text>
|
||||
</view>
|
||||
</view>
|
||||
<view class="function-item" @click="navigateTo('/pages/in/backIn')">
|
||||
<!-- <view class="function-item" @click="navigateTo('/pages/in/backIn')">
|
||||
<view class="icon-box blue">
|
||||
<image src="/static/images/tabbar/list.png" mode="aspectFit" class="icon-image" style="width: 40rpx; height: 40rpx;"></image>
|
||||
</view>
|
||||
<view class="function-text">
|
||||
<text class="title">{{ $t('inbound.backIn.title') }}</text>
|
||||
<text class="desc">{{ $t('inbound.backIn.desc') }}</text>
|
||||
<text class="title">退料入库</text>
|
||||
<text class="desc">退料入库</text>
|
||||
</view>
|
||||
</view>
|
||||
</view> -->
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
|
||||
@@ -5,30 +5,30 @@
|
||||
<uni-card v-for="(item, index) in orderList" :key="index" class="order-card">
|
||||
<view class="order-info" @click="handleOrderClick(item)">
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.qualityCheck.orderNumber') }}</text>
|
||||
<text class="label">单据编号:</text>
|
||||
<text class="value">{{ item.stockinId }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.qualityCheck.supplier') }}</text>
|
||||
<text class="label">供应商:</text>
|
||||
<text class="value">{{ item.supplierName }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.qualityCheck.warehouse') }}</text>
|
||||
<text class="label">仓库</text>
|
||||
<text class="value">{{ item.warehouseName }}</text>
|
||||
</view>
|
||||
<view class="info-row">
|
||||
<text class="label">{{ $t('inbound.qualityCheck.createTime') }}</text>
|
||||
<text class="label">创建时间:</text>
|
||||
<text class="value">{{ item.createDate }}</text>
|
||||
</view>
|
||||
<view class="expand-icon" :class="{'expanded': item.isExpanded}">
|
||||
<text>{{ item.isExpanded ? $t('inbound.qualityCheck.collapse') : $t('inbound.qualityCheck.expand') }}</text>
|
||||
<text>{{ item.isExpanded ? '收起' : '展开' }}</text>
|
||||
</view>
|
||||
</view>
|
||||
|
||||
<!-- 物料详情 -->
|
||||
<view class="material-detail" v-if="item.isExpanded && item.materials && item.materials.length > 0">
|
||||
<view class="material-header">
|
||||
<button class="check-all-button" @click="handleCheckAll(index)">{{ $t('inbound.qualityCheck.checkAll') }}</button>
|
||||
<button class="check-all-button" @click="handleCheckAll(index)">全部质检</button>
|
||||
</view>
|
||||
<view class="material-list">
|
||||
<view v-for="(material, mIndex) in item.materials" :key="mIndex" class="material-item">
|
||||
@@ -36,7 +36,7 @@
|
||||
<!-- <text class="material-code">{{ material.productId }}</text> -->
|
||||
<text class="material-name">{{ material.extraField.materialDesc }}</text>
|
||||
<view class="material-quantity">
|
||||
<text>{{ $t('inbound.qualityCheck.quantity') }}</text>
|
||||
<text>数量:</text>
|
||||
<uni-easyinput
|
||||
v-model="material.quantity"
|
||||
type="number"
|
||||
@@ -46,9 +46,9 @@
|
||||
/>
|
||||
</view>
|
||||
<text class="material-status" :class="{'status-checked': material.stockStatus == '1'}">
|
||||
{{ material.stockStatus == '1' ? $t('inbound.qualityCheck.checked') : $t('inbound.qualityCheck.unchecked') }}
|
||||
</text>
|
||||
<button class="check-button" @click="handleQualityCheck(index, mIndex)">{{ $t('inbound.qualityCheck.check') }}</button>
|
||||
{{ material.stockStatus == '1' ? '已质检' : '待质检' }}
|
||||
</text>
|
||||
<button class="check-button" @click="handleQualityCheck(index, mIndex)">质检</button>
|
||||
</view>
|
||||
</view>
|
||||
</view>
|
||||
@@ -56,7 +56,7 @@
|
||||
</uni-card>
|
||||
</view>
|
||||
<view v-else class="no-data">
|
||||
<text>{{ $t('inbound.qualityCheck.noOrders') }}</text>
|
||||
<text>暂无待质检单据</text>
|
||||
</view>
|
||||
</view>
|
||||
</template>
|
||||
@@ -86,14 +86,14 @@ export default {
|
||||
}))
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.qualityCheck.getOrdersFailed'),
|
||||
title: response.msg || '获取单据列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取单据列表失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.getOrdersFailed'),
|
||||
title: '获取单据列表失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -117,14 +117,14 @@ export default {
|
||||
this.$set(this.orderList[index], 'materials', response.rows)
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.qualityCheck.getMaterialsFailed'),
|
||||
title: response.msg || '获取物料信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('获取物料信息失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.getMaterialsFailed'),
|
||||
title: '获取物料信息失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -135,7 +135,7 @@ export default {
|
||||
const order = this.orderList[index]
|
||||
if (!order.materials || order.materials.length === 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.noMaterials'),
|
||||
title: '暂无可质检的物料',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -150,7 +150,7 @@ export default {
|
||||
|
||||
if (materials.length === 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.allChecked'),
|
||||
title: '所有物料已完成质检',
|
||||
icon: 'none'
|
||||
})
|
||||
return
|
||||
@@ -164,7 +164,7 @@ export default {
|
||||
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.batchCheckSuccess'),
|
||||
title: '批量质检完成',
|
||||
icon: 'success'
|
||||
})
|
||||
|
||||
@@ -179,14 +179,14 @@ export default {
|
||||
this.fetchOrderList()
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.qualityCheck.batchCheckFailed'),
|
||||
title: response.msg || '批量质检失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
} catch (error) {
|
||||
console.error('批量质检失败:', error)
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.batchCheckFailed'),
|
||||
title: '批量质检失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -203,7 +203,7 @@ export default {
|
||||
})
|
||||
if (response.code === 200) {
|
||||
uni.showToast({
|
||||
title: `${material.extraField.materialDesc} ${this.$t('inbound.qualityCheck.checkSuccess')}`,
|
||||
title: `${material.extraField.materialDesc} 质检完成`,
|
||||
icon: 'success'
|
||||
})
|
||||
// 重新获取当前单据的物料列表
|
||||
@@ -216,7 +216,7 @@ export default {
|
||||
}
|
||||
} else {
|
||||
uni.showToast({
|
||||
title: response.msg || this.$t('inbound.qualityCheck.checkFailed'),
|
||||
title: response.msg || '质检操作失败',
|
||||
icon: 'none'
|
||||
})
|
||||
}
|
||||
@@ -230,7 +230,7 @@ export default {
|
||||
// 验证输入值
|
||||
if (isNaN(newQuantity) || newQuantity < 0) {
|
||||
uni.showToast({
|
||||
title: this.$t('inbound.qualityCheck.invalidQuantity'),
|
||||
title: '请输入有效的数量',
|
||||
icon: 'none'
|
||||
})
|
||||
material.quantity = material.quantity
|
||||
|
||||
Reference in New Issue
Block a user